@blipit/browser 0.2.0
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/README.md +103 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +58 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.global.js +2 -0
- package/dist/index.js +2 -0
- package/dist/replay.global.js +152 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# @blipit/browser
|
|
2
|
+
|
|
3
|
+
Blipit error monitoring SDK for browsers. 4.0 KB gzipped. Know your app broke before your users tell you.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @blipit/browser
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import * as Blipit from "@blipit/browser";
|
|
15
|
+
|
|
16
|
+
Blipit.init({
|
|
17
|
+
key: "your-project-key",
|
|
18
|
+
endpoint: "https://your-ingest-host/api/v1/events",
|
|
19
|
+
release: "myapp@1.4.2",
|
|
20
|
+
environment: "production",
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
That's it. Uncaught errors and unhandled promise rejections are captured automatically, with breadcrumbs for clicks, fetch calls, console errors/warnings, and SPA navigations.
|
|
25
|
+
|
|
26
|
+
## Manual capture
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
try {
|
|
30
|
+
riskyThing();
|
|
31
|
+
} catch (err) {
|
|
32
|
+
Blipit.captureException(err);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
Blipit.captureMessage("something odd happened", "warning");
|
|
36
|
+
Blipit.setUser({ id: "user-42", email: "user@example.com" });
|
|
37
|
+
Blipit.setTag("plan", "pro");
|
|
38
|
+
Blipit.addBreadcrumb({ category: "custom", message: "cart checkout started" });
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Login attempts and other security events
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
Blipit.captureSecurity({ kind: "login_failed", actor: "admin@company.com" });
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`kind` is one of `login_failed`, `login_succeeded`, `login_blocked`, `password_reset_requested`,
|
|
48
|
+
`privilege_granted`. `actor` is the login name or user id that was used, and it is required. The
|
|
49
|
+
optional fields are `actorId`, `ip`, `userAgent`, `database`, `outcome` and `target`. Never pass a
|
|
50
|
+
password, a password hash, a session token or a cookie: the event is stored and shown in the
|
|
51
|
+
dashboard as it arrives.
|
|
52
|
+
|
|
53
|
+
Security events skip `sampleRate`, `ignoreErrors` and the duplicate filter, so a burst of failed
|
|
54
|
+
logins is never thinned out on its way to the threshold.
|
|
55
|
+
|
|
56
|
+
### What a browser report is worth
|
|
57
|
+
|
|
58
|
+
**Treat a browser-reported login attempt as a hint, not as evidence.** The public key sits in
|
|
59
|
+
client-side code where anyone can read it, so anyone can also post security events with it:
|
|
60
|
+
|
|
61
|
+
- Anyone can invent failed logins for any actor name, from any machine, at any rate. Nothing about
|
|
62
|
+
the report is attested.
|
|
63
|
+
- Anyone can stay silent. A real attacker scripting your login endpoint never runs your JavaScript,
|
|
64
|
+
so the attempts you most want to see are exactly the ones a browser cannot report.
|
|
65
|
+
- `ip` is whatever the page puts in it. The real client IP is the one the ingest API sees on the
|
|
66
|
+
connection.
|
|
67
|
+
- A report only exists if the browser stayed long enough to send it, and if no extension or blocker
|
|
68
|
+
got in the way.
|
|
69
|
+
|
|
70
|
+
So use it for what it is good at: a signal that a real person is struggling on a real page, on the
|
|
71
|
+
same timeline as the errors around it. For alerting that has to hold up, report from the server
|
|
72
|
+
that actually checks the password, with `@blipit/node` or a plain `fetch` using the project secret
|
|
73
|
+
key.
|
|
74
|
+
|
|
75
|
+
## Options
|
|
76
|
+
|
|
77
|
+
| Option | Default | Description |
|
|
78
|
+
|---|---|---|
|
|
79
|
+
| `key` | required | Project ingest key, sent as `X-Blipit-Key` |
|
|
80
|
+
| `endpoint` | `https://in.blipit.io/api/v1/events` | Ingestion URL |
|
|
81
|
+
| `instance` | — | Instance fingerprint sent as `X-Blipit-Instance`; required once the project is bound to an instance |
|
|
82
|
+
| `release` | — | App version or git SHA; powers regression detection |
|
|
83
|
+
| `environment` | `"production"` | e.g. `staging`, `development` |
|
|
84
|
+
| `sampleRate` | `1` | Fraction of events to send (0–1) |
|
|
85
|
+
| `maxBreadcrumbs` | `50` | Ring buffer size, max 100 |
|
|
86
|
+
| `autoMuteExtensions` | `true` | Drop errors whose frames are all from browser extensions |
|
|
87
|
+
| `webVitals` | `true` | Report LCP, INP, CLS, FCP and TTFB once per page view to `/api/v1/vitals` |
|
|
88
|
+
| `replay` | off | Session replay add-on: `{ sessionSampleRate: 0, onErrorSampleRate: 1, src }`. Loaded from `src` (default `https://blipit.io/sdk/<version>/blipit-replay.js`) only when a session is sampled |
|
|
89
|
+
| `ignoreErrors` | built-in noise list | Extra strings/regexes to drop (matched on error message) |
|
|
90
|
+
| `beforeSend` | — | Inspect/modify the event; return `null` to drop it |
|
|
91
|
+
| `debug` | `false` | Log SDK activity to the console |
|
|
92
|
+
|
|
93
|
+
## Built-in noise filtering
|
|
94
|
+
|
|
95
|
+
Dropped by default, before leaving the page: browser-extension stack traces, `ResizeObserver loop` warnings, cross-origin `Script error.`, and rapid duplicates of the same unhandled error (5-second window).
|
|
96
|
+
|
|
97
|
+
## Privacy
|
|
98
|
+
|
|
99
|
+
Query-string values whose names match token/key/password/secret/auth/session patterns are redacted from all captured URLs before the event leaves the browser. Use `beforeSend` for app-specific scrubbing.
|
|
100
|
+
|
|
101
|
+
## Delivery
|
|
102
|
+
|
|
103
|
+
Events batch with a 1-second debounce, retry twice with backoff on network failures/429/5xx, and flush via `navigator.sendBeacon` when the tab is hidden or closed. Call `await Blipit.flush()` to force delivery.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var M=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var te=(t,e)=>{for(var n in e)M(t,n,{get:e[n],enumerable:!0})},ne=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Q(e))!ee.call(t,r)&&r!==n&&M(t,r,{get:()=>e[r],enumerable:!(i=Z(e,r))||i.enumerable});return t};var ie=t=>ne(M({},"__esModule",{value:!0}),t);var Oe={};te(Oe,{addBreadcrumb:()=>Te,captureException:()=>xe,captureMessage:()=>Se,captureSecurity:()=>Ee,flush:()=>Be,init:()=>ve,setTag:()=>ke,setUser:()=>we,showFeedback:()=>Re});module.exports=ie(Oe);var q=["login_failed","login_succeeded","login_blocked","password_reset_requested","privilege_granted"];var O=class{constructor(e,n,i,r){this.endpoint=e;this.key=n;this.debug=i;this.instance=r;typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushWithBeacon()})}endpoint;key;debug;instance;queue=[];timer;sending=!1;enqueue(e){this.queue.push(e),this.queue.length>30&&this.queue.shift(),this.timer||(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},1e3))}async flush(){if(!this.sending){this.sending=!0;try{for(;this.queue.length>0;){let e=this.queue[0];if(!await this.send(e))break;this.queue.shift()}}finally{this.sending=!1}}}async send(e,n=0){try{let i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,...this.instance?{"X-Blipit-Instance":this.instance}:{}},body:JSON.stringify(e),keepalive:!0});return i.status===429||i.status>=500?this.retry(e,n):(this.debug&&i.status>=400&&console.warn("[blipit] event rejected",i.status,await i.text()),!0)}catch{return this.retry(e,n)}}async retry(e,n){return n>=2?(this.debug&&console.warn("[blipit] dropping event after retries",e.event_id),!0):(await new Promise(i=>setTimeout(i,1e3*2**n)),this.send(e,n+1))}flushWithBeacon(){if(!(typeof navigator>"u"||!navigator.sendBeacon))for(;this.queue.length>0;){let e=this.queue.shift(),n=`key=${encodeURIComponent(this.key)}${this.instance?`&instance=${encodeURIComponent(this.instance)}`:""}`,i=`${this.endpoint}${this.endpoint.includes("?")?"&":"?"}${n}`;navigator.sendBeacon(i,JSON.stringify(e))}}};function E(){let t=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let n=0;n<16;n++)t[n]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let e="";for(let n=0;n<16;n++)e+=t[n].toString(16).padStart(2,"0");return e}function R(){return new Date().toISOString()}var re=/token|key|password|secret|auth|session|passwd|api/i;function g(t){let e=t.indexOf("?");if(e===-1)return t.slice(0,2048);let n=t.slice(0,e),r=t.slice(e+1).split("&").map(o=>{let s=o.indexOf("=");if(s===-1)return o;let a=o.slice(0,s);return re.test(a)?`${a}=[redacted]`:o}).join("&");return`${n}?${r}`.slice(0,2048)}var se=/\b((?:[a-zA-Z0-9_-]*(?:token|key|password|secret|auth|session|passwd|api)[a-zA-Z0-9_-]*)=)[^&\s"']+/gi;function F(t){return t.replace(se,"$1[redacted]")}function u(t,e){return t.length>e?t.slice(0,e):t}var K={ok:0,errored:1,crashed:2};function I(t,e){return`${t.replace(/\/api\/v1\/events.*$/,"").replace(/\/$/,"")}${e}`}var _=class{constructor(e,n,i,r){this.url=e;this.key=n;this.release=i;this.environment=r;this.start(),typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.end():this.sid||this.start()})}url;key;release;environment;sid="";started="";status="ok";errors=0;did;setUser(e){this.did=e}markError(e){if(!this.sid)return;this.errors+=1;let n=e?"crashed":"errored";K[n]<=K[this.status]||(this.status=n,this.send(!1))}start(){this.sid=E(),this.started=R(),this.status="ok",this.errors=0,this.send(!1)}end(){this.sid&&(this.send(!0),this.sid="")}send(e){let n=JSON.stringify({sid:this.sid,did:this.did,status:this.status==="ok"&&e?"exited":this.status,errors:this.errors,started:this.started,release:this.release,environment:this.environment}),i=`${this.url}?key=${encodeURIComponent(this.key)}`;try{if(e&&typeof navigator<"u"&&navigator.sendBeacon){navigator.sendBeacon(i,n);return}if(typeof fetch>"u")return;fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key},body:n,keepalive:!0}).catch(()=>{})}catch{return}}};var oe=/^\s*at (?:async )?(?:new )?(?:(.+?) )?\(?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack):.*?|[^()]+?)(?::(\d+))?(?::(\d+))?\)?\s*$/,ae=/^\s*(?:(.*?)@)?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack).*?|[^@]*?)(?::(\d+))?(?::(\d+))?\s*$/,j=/^(chrome|moz|safari-web)-extension:/;function de(){if(typeof location<"u"&&location.origin)return location.origin}function ce(t){if(j.test(t)||t==="<anonymous>"||t==="[native code]")return!1;let e=de();return!!(!e||t.startsWith(e)||!/^[a-z]+:/i.test(t))}function D(t){if(!t)return[];let e=[];for(let n of t.split(`
|
|
2
|
+
`)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let i=oe.exec(n)??ae.exec(n);if(!i)continue;let[,r,o,s,a]=i;if(!o)continue;let d={filename:u(o,1024),in_app:ce(o)};r&&(d.function=u(r,512)),s&&(d.lineno=Number(s)),a&&(d.colno=Number(a)),e.push(d)}return e.reverse(),e.slice(-128)}function z(t){return t.length===0?!1:t.every(e=>j.test(e.filename))}var N="@blipit/browser",C="0.2.0",L="https://in.blipit.io/api/v1/events",ue=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],pe={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},le={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function fe(t){if(!q.includes(t?.kind))return;let e=u(String(t.actor??"").trim(),256);if(!e)return;let n={kind:t.kind,actor:e};return t.actorId&&(n.actor_id=u(String(t.actorId),128)),t.ip&&(n.ip=u(String(t.ip).trim(),45)),t.userAgent&&(n.user_agent=u(String(t.userAgent),512)),t.database&&(n.database=u(String(t.database),64)),t.outcome&&(n.outcome=u(String(t.outcome),64)),t.target&&(n.target=u(String(t.target),256)),n}var $=class{constructor(e){this.options=e;this.endpoint=e.endpoint??L,this.transport=new O(this.endpoint,e.key,e.debug??!1,e.instance),e.autoSessionTracking&&(e.release?this.session=new _(I(this.endpoint,"/api/v1/sessions"),e.key,e.release,e.environment??"production"):e.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(e.maxBreadcrumbs??50,100),this.ignoreErrors=[...ue,...e.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;session;lastEventId;endpoint;replay;setUser(e){this.user=e,this.session?.setUser(e?.id??e?.email)}setTag(e,n){this.tags[u(e,64)]=u(n,256)}addBreadcrumb(e){let n={timestamp:R(),...e};n.message&&(n.message=F(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:g(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(e,n=!0){let i=e instanceof Error?e:new Error(String(e)),r={type:i.name||"Error",value:u(i.message||String(i),4096),handled:n},o=D(i.stack);return o.length>0&&(r.stacktrace={frames:o}),this.processAndSend({exception:r,level:"error"})}captureMessage(e,n="info"){return this.processAndSend({message:u(e,8192),level:n})}captureSecurity(e){let n=fe(e);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${pe[n.kind]} for ${n.actor}`,level:le[n.kind],security:n},!1)}processAndSend(e,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let i=e.exception?.value??e.message??"";if(n){for(let a of this.ignoreErrors)if(typeof a=="string"?i.includes(a):a.test(i))return;if((this.options.autoMuteExtensions??!0)&&e.exception?.stacktrace&&z(e.exception.stacktrace.frames))return;let s=`${e.exception?.type??""}|${i}`;if(e.exception?.handled===!1){if(this.seen.has(s)&&this.seen.size<100)return;this.seen.add(s),setTimeout(()=>this.seen.delete(s),5e3)}}let r={event_id:E(),timestamp:R(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:g(location.href)}:void 0,contexts:this.collectContexts(),sdk:{name:N,version:C},...e};for(let s of Object.keys(r))r[s]===void 0&&delete r[s];let o=this.replay?.active()&&(r.level==="error"||r.level==="fatal")?this.replay:void 0;if(o&&(r.tags={...r.tags,replay_id:o.id}),this.options.beforeSend){let s=this.options.beforeSend(r);if(!s)return;r=s}return this.transport.enqueue(r),this.lastEventId=r.event_id,r.exception&&this.session?.markError(r.exception.handled===!1),o?.error(r.event_id),r.event_id}collectContexts(){if(typeof navigator>"u")return;let e={},n=navigator.userAgent??"",i=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;i&&(e.browser={name:i[1],version:i[2]});let r=/\(([^)]+)\)/.exec(n);return r&&r[1]&&(e.os={name:u(r[1],64)}),typeof screen<"u"&&(e.device={screen:`${screen.width}x${screen.height}`}),Object.keys(e).length>0?e:void 0}flush(){return this.transport.flush()}};function me(t){if(!t||!(t instanceof Element))return"<unknown>";let e=t.tagName.toLowerCase(),n=t.id?`#${t.id}`:"",i=typeof t.className=="string"&&t.className?`.${t.className.trim().split(/\s+/).slice(0,2).join(".")}`:"";return u(`${e}${n}${i}`,128)}function V(t){if(!(typeof window>"u")){if(window.addEventListener("error",e=>{t.captureException(e.error??e.message,!1)}),window.addEventListener("unhandledrejection",e=>{t.captureException(e.reason,!1)}),typeof document<"u"&&document.addEventListener("click",e=>{t.addBreadcrumb({category:"ui.click",message:`Clicked ${me(e.target)}`})},{capture:!0,passive:!0}),typeof window.fetch=="function"){let e=window.fetch.bind(window);window.fetch=async(n,i)=>{let r=typeof n=="string"?n:n instanceof URL?n.href:n.url,o=i?.method??(n instanceof Request?n.method:"GET");try{let s=await e(n,i);return t.addBreadcrumb({category:"http",message:`${o} ${g(r)} \u2192 ${s.status}`,level:s.status>=400?"error":"info",data:{url:g(r),method:o,status_code:s.status}}),s}catch(s){throw t.addBreadcrumb({category:"http",message:`${o} ${g(r)} \u2192 network error`,level:"error",data:{url:g(r),method:o}}),s}}}for(let e of["error","warn"]){let n=console[e].bind(console);console[e]=(...i)=>{t.addBreadcrumb({category:"console",level:e==="warn"?"warning":"error",message:u(i.map(r=>typeof r=="string"?r:he(r)).join(" "),1024)}),n(...i)}}if(window.history){let e=window.history.pushState.bind(window.history);window.history.pushState=(...n)=>{e(...n),t.addBreadcrumb({category:"navigation",message:`Navigated to ${g(location.href)}`})},window.addEventListener("popstate",()=>{t.addBreadcrumb({category:"navigation",message:`Navigated to ${g(location.href)}`})})}}}function he(t){try{return JSON.stringify(t)??String(t)}catch{return String(t)}}function H(){let t=0,e=0,n=0,i=0;return r=>(r.hadRecentInput||(e>0&&r.startTime-i<1e3&&r.startTime-n<5e3?e+=r.value:(e=r.value,n=r.startTime),i=r.startTime,e>t&&(t=e)),t)}function ge(t){if(t.size===0)return;let e=[...t.values()].sort((n,i)=>i-n);return e[Math.min(e.length-1,Math.floor(t.size/50))]}function ye(t){return/iPad|Tablet|Android(?!.*Mobile)/i.test(t)?"tablet":/Mobi|iPhone|Android/i.test(t)?"mobile":"desktop"}function B(t,e,n){try{new PerformanceObserver(i=>i.getEntries().forEach(r=>e(r))).observe({type:t,buffered:!0,...n})}catch{}}function X(t,e,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let i=performance.getEntriesByType("navigation")[0],r=i?.activationStart??0,o=p=>Math.max(0,Math.round(p-r)),s=document.visibilityState==="hidden",a=location.pathname,d=i?.type,c={},h=H(),x=new Map,y=!1,f=!1;i&&i.responseStart>0&&(c.ttfb=o(i.responseStart)),s||(B("paint",p=>{p.name==="first-contentful-paint"&&(c.fcp=o(p.startTime))}),B("largest-contentful-paint",p=>{y||(c.lcp=o(p.startTime))}));let w=()=>{y=!0};addEventListener("keydown",w,{once:!0,capture:!0}),addEventListener("pointerdown",w,{once:!0,capture:!0}),B("layout-shift",p=>{c.cls=Math.round(h(p)*1e4)/1e4});let k=p=>{if(!p.interactionId)return;x.set(p.interactionId,Math.max(x.get(p.interactionId)??0,p.duration));let P=ge(x);P!==void 0&&(c.inp=Math.round(P))};B("event",k,{durationThreshold:40}),B("first-input",k);let S=navigator.connection?.effectiveType,v=`${new URL("/api/v1/vitals",t).href}?key=${encodeURIComponent(e)}${n?`&instance=${encodeURIComponent(n)}`:""}`,b=()=>{if(f||Object.keys(c).length===0)return;f=!0;let p=JSON.stringify({path:a.slice(0,512),metrics:c,nav:d,connection:S&&/^(slow-2g|2g|3g|4g)$/.test(S)?S:void 0,device:ye(navigator.userAgent)});try{if(navigator.sendBeacon?.(v,p))return}catch{}fetch(v,{method:"POST",body:p,keepalive:!0}).catch(()=>{})},T=()=>{location.pathname!==a&&(b(),a=location.pathname,d="route",c={},h=H(),x=new Map,y=!0,f=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&b()),addEventListener("pagehide",b),addEventListener("popstate",T);let Y=history.pushState;history.pushState=function(...p){Y.apply(this,p),T()}}function be(t,e=Math.random){return e()<(t.sessionSampleRate??0)?"session":e()<(t.onErrorSampleRate??1)?"buffer":null}function J(t,e,n,i,r){let o=be(t);if(!o||typeof document>"u")return;let s=E(),a,d=document.createElement("script");return d.src=t.src??`https://blipit.io/sdk/${r}/blipit-replay.js`,d.async=!0,d.onload=()=>{let c=window.BlipitReplay?.start;a=c?.({id:s,mode:o,endpoint:e,key:n,instance:i})},document.head.appendChild(d),{id:s,active:()=>a?.active()??!1,error:c=>a?.error(c)}}function m(t,e,n){let i=document.createElement(t);return i.style.cssText=e,n!==void 0&&(i.textContent=n),i}var A="display:block;width:100%;box-sizing:border-box;margin:4px 0 12px;padding:8px 10px;font:inherit;border:1px solid #c5ccd6;border-radius:6px;background:#fff;color:#111",G="font:inherit;padding:8px 14px;border-radius:6px;cursor:pointer;border:1px solid #c5ccd6;background:#fff;color:#111",U=!1;function W(t,e,n){if(U||typeof document>"u"||!document.body)return;U=!0;let i=m("dialog","max-width:420px;width:calc(100% - 32px);padding:20px;border:1px solid #c5ccd6;border-radius:10px;font:14px/1.45 system-ui,sans-serif;color:#111;background:#fff");i.setAttribute("aria-labelledby","blipit-fb-title");let r=m("form","margin:0"),o=m("h2","margin:0 0 12px;font-size:17px",n.title??"Tell us what happened");o.id="blipit-fb-title";let s=(S,v,b)=>{let T=m("label","display:block;font-weight:600",S);T.htmlFor=b,v.id=b,r.append(T,v)},a=m("input",A);a.type="text",a.maxLength=128,a.autocomplete="name",a.value=n.name??"";let d=m("input",A);d.type="email",d.maxLength=254,d.autocomplete="email",d.value=n.email??"";let c=m("textarea",`${A};min-height:110px;resize:vertical`);c.required=!0,c.maxLength=5e3;let h=m("p","margin:0 0 12px;min-height:1.2em;font-size:13px");h.setAttribute("role","status"),h.setAttribute("aria-live","polite");let x=m("div","display:flex;gap:8px;justify-content:flex-end"),y=m("button",G,"Cancel");y.type="button";let f=m("button",`${G};background:#111;color:#fff;border-color:#111`,"Send");f.type="submit",r.append(o),s("Name (optional)",a,"blipit-fb-name"),s("Email (optional)",d,"blipit-fb-email"),s("What went wrong?",c,"blipit-fb-message"),x.append(y,f),r.append(h,x),i.append(r),document.body.append(i);let w=()=>{U=!1,i.remove()},k=()=>typeof i.close=="function"&&i.open?i.close():w();y.addEventListener("click",k),i.addEventListener("close",w),r.addEventListener("submit",async S=>{S.preventDefault();let v=c.value.trim();if(!v){h.textContent="Please describe what happened.",c.focus();return}f.disabled=!0,y.disabled=!0,f.setAttribute("aria-busy","true"),f.textContent="Sending\u2026",h.textContent="";try{let b=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":e},body:JSON.stringify({name:a.value.trim()||void 0,email:d.value.trim()||void 0,message:v,event_id:n.eventId,url:typeof location<"u"?location.href.split(/[?#]/)[0]:void 0})});if(!b.ok)throw new Error(String(b.status));h.textContent="Thanks, your message was sent.",f.textContent="Sent",setTimeout(k,1200)}catch{h.textContent="That did not send. Please try again.",f.disabled=!1,y.disabled=!1,f.removeAttribute("aria-busy"),f.textContent="Send"}}),typeof i.showModal=="function"?i.showModal():i.setAttribute("open",""),c.focus()}var l;function ve(t){l||(l=new $(t),V(l),t.webVitals!==!1&&typeof window<"u"&&X(t.endpoint??L,t.key,t.instance),t.replay&&(l.replay=J(t.replay,t.endpoint??L,t.key,t.instance,C)),t.debug&&console.log(`[blipit] ${N}@${C} initialized`))}function xe(t){return l?.captureException(t,!0)}function Se(t,e){return l?.captureMessage(t,e)}function Ee(t){return l?.captureSecurity(t)}function we(t){l?.setUser(t)}function ke(t,e){l?.setTag(t,e)}function Te(t){l?.addBreadcrumb(t)}function Re(t={}){l&&W(I(l.endpoint,"/api/v1/feedback"),l.options.key,{...t,eventId:t.eventId??l.lastEventId})}function Be(){return l?.flush()??Promise.resolve()}0&&(module.exports={addBreadcrumb,captureException,captureMessage,captureSecurity,flush,init,setTag,setUser,showFeedback});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { BlipitEvent, SecurityKind, Breadcrumb, Level } from '@blipit/schema';
|
|
2
|
+
export { BlipitEvent, BlipitSecurity, Breadcrumb, Level, SecurityKind } from '@blipit/schema';
|
|
3
|
+
|
|
4
|
+
interface BlipitOptions {
|
|
5
|
+
key: string;
|
|
6
|
+
endpoint?: string;
|
|
7
|
+
instance?: string;
|
|
8
|
+
release?: string;
|
|
9
|
+
environment?: string;
|
|
10
|
+
debug?: boolean;
|
|
11
|
+
sampleRate?: number;
|
|
12
|
+
maxBreadcrumbs?: number;
|
|
13
|
+
autoMuteExtensions?: boolean;
|
|
14
|
+
webVitals?: boolean;
|
|
15
|
+
replay?: ReplayOptions;
|
|
16
|
+
ignoreErrors?: Array<string | RegExp>;
|
|
17
|
+
beforeSend?: (event: BlipitEvent) => BlipitEvent | null;
|
|
18
|
+
autoSessionTracking?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface ReplayOptions {
|
|
21
|
+
sessionSampleRate?: number;
|
|
22
|
+
onErrorSampleRate?: number;
|
|
23
|
+
src?: string;
|
|
24
|
+
}
|
|
25
|
+
interface UserContext {
|
|
26
|
+
id?: string;
|
|
27
|
+
email?: string;
|
|
28
|
+
username?: string;
|
|
29
|
+
}
|
|
30
|
+
interface SecurityReport {
|
|
31
|
+
kind: SecurityKind;
|
|
32
|
+
actor: string;
|
|
33
|
+
actorId?: string;
|
|
34
|
+
ip?: string;
|
|
35
|
+
userAgent?: string;
|
|
36
|
+
database?: string;
|
|
37
|
+
outcome?: string;
|
|
38
|
+
target?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface FeedbackOptions {
|
|
42
|
+
eventId?: string;
|
|
43
|
+
title?: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
email?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare function init(options: BlipitOptions): void;
|
|
49
|
+
declare function captureException(error: unknown): string | undefined;
|
|
50
|
+
declare function captureMessage(message: string, level?: Level): string | undefined;
|
|
51
|
+
declare function captureSecurity(report: SecurityReport): string | undefined;
|
|
52
|
+
declare function setUser(user: UserContext | undefined): void;
|
|
53
|
+
declare function setTag(key: string, value: string): void;
|
|
54
|
+
declare function addBreadcrumb(crumb: Omit<Breadcrumb, "timestamp">): void;
|
|
55
|
+
declare function showFeedback(options?: FeedbackOptions): void;
|
|
56
|
+
declare function flush(): Promise<void>;
|
|
57
|
+
|
|
58
|
+
export { type BlipitOptions, type FeedbackOptions, type ReplayOptions, type SecurityReport, type UserContext, addBreadcrumb, captureException, captureMessage, captureSecurity, flush, init, setTag, setUser, showFeedback };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { BlipitEvent, SecurityKind, Breadcrumb, Level } from '@blipit/schema';
|
|
2
|
+
export { BlipitEvent, BlipitSecurity, Breadcrumb, Level, SecurityKind } from '@blipit/schema';
|
|
3
|
+
|
|
4
|
+
interface BlipitOptions {
|
|
5
|
+
key: string;
|
|
6
|
+
endpoint?: string;
|
|
7
|
+
instance?: string;
|
|
8
|
+
release?: string;
|
|
9
|
+
environment?: string;
|
|
10
|
+
debug?: boolean;
|
|
11
|
+
sampleRate?: number;
|
|
12
|
+
maxBreadcrumbs?: number;
|
|
13
|
+
autoMuteExtensions?: boolean;
|
|
14
|
+
webVitals?: boolean;
|
|
15
|
+
replay?: ReplayOptions;
|
|
16
|
+
ignoreErrors?: Array<string | RegExp>;
|
|
17
|
+
beforeSend?: (event: BlipitEvent) => BlipitEvent | null;
|
|
18
|
+
autoSessionTracking?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface ReplayOptions {
|
|
21
|
+
sessionSampleRate?: number;
|
|
22
|
+
onErrorSampleRate?: number;
|
|
23
|
+
src?: string;
|
|
24
|
+
}
|
|
25
|
+
interface UserContext {
|
|
26
|
+
id?: string;
|
|
27
|
+
email?: string;
|
|
28
|
+
username?: string;
|
|
29
|
+
}
|
|
30
|
+
interface SecurityReport {
|
|
31
|
+
kind: SecurityKind;
|
|
32
|
+
actor: string;
|
|
33
|
+
actorId?: string;
|
|
34
|
+
ip?: string;
|
|
35
|
+
userAgent?: string;
|
|
36
|
+
database?: string;
|
|
37
|
+
outcome?: string;
|
|
38
|
+
target?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface FeedbackOptions {
|
|
42
|
+
eventId?: string;
|
|
43
|
+
title?: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
email?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare function init(options: BlipitOptions): void;
|
|
49
|
+
declare function captureException(error: unknown): string | undefined;
|
|
50
|
+
declare function captureMessage(message: string, level?: Level): string | undefined;
|
|
51
|
+
declare function captureSecurity(report: SecurityReport): string | undefined;
|
|
52
|
+
declare function setUser(user: UserContext | undefined): void;
|
|
53
|
+
declare function setTag(key: string, value: string): void;
|
|
54
|
+
declare function addBreadcrumb(crumb: Omit<Breadcrumb, "timestamp">): void;
|
|
55
|
+
declare function showFeedback(options?: FeedbackOptions): void;
|
|
56
|
+
declare function flush(): Promise<void>;
|
|
57
|
+
|
|
58
|
+
export { type BlipitOptions, type FeedbackOptions, type ReplayOptions, type SecurityReport, type UserContext, addBreadcrumb, captureException, captureMessage, captureSecurity, flush, init, setTag, setUser, showFeedback };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var Blipit=(()=>{var M=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var te=(t,e)=>{for(var n in e)M(t,n,{get:e[n],enumerable:!0})},ne=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Q(e))!ee.call(t,r)&&r!==n&&M(t,r,{get:()=>e[r],enumerable:!(i=Z(e,r))||i.enumerable});return t};var ie=t=>ne(M({},"__esModule",{value:!0}),t);var Oe={};te(Oe,{addBreadcrumb:()=>Te,captureException:()=>xe,captureMessage:()=>Se,captureSecurity:()=>Ee,flush:()=>Be,init:()=>ve,setTag:()=>ke,setUser:()=>we,showFeedback:()=>Re});var q=["login_failed","login_succeeded","login_blocked","password_reset_requested","privilege_granted"];var O=class{constructor(e,n,i,r){this.endpoint=e;this.key=n;this.debug=i;this.instance=r;typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushWithBeacon()})}endpoint;key;debug;instance;queue=[];timer;sending=!1;enqueue(e){this.queue.push(e),this.queue.length>30&&this.queue.shift(),this.timer||(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},1e3))}async flush(){if(!this.sending){this.sending=!0;try{for(;this.queue.length>0;){let e=this.queue[0];if(!await this.send(e))break;this.queue.shift()}}finally{this.sending=!1}}}async send(e,n=0){try{let i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,...this.instance?{"X-Blipit-Instance":this.instance}:{}},body:JSON.stringify(e),keepalive:!0});return i.status===429||i.status>=500?this.retry(e,n):(this.debug&&i.status>=400&&console.warn("[blipit] event rejected",i.status,await i.text()),!0)}catch{return this.retry(e,n)}}async retry(e,n){return n>=2?(this.debug&&console.warn("[blipit] dropping event after retries",e.event_id),!0):(await new Promise(i=>setTimeout(i,1e3*2**n)),this.send(e,n+1))}flushWithBeacon(){if(!(typeof navigator>"u"||!navigator.sendBeacon))for(;this.queue.length>0;){let e=this.queue.shift(),n=`key=${encodeURIComponent(this.key)}${this.instance?`&instance=${encodeURIComponent(this.instance)}`:""}`,i=`${this.endpoint}${this.endpoint.includes("?")?"&":"?"}${n}`;navigator.sendBeacon(i,JSON.stringify(e))}}};function E(){let t=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let n=0;n<16;n++)t[n]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let e="";for(let n=0;n<16;n++)e+=t[n].toString(16).padStart(2,"0");return e}function R(){return new Date().toISOString()}var re=/token|key|password|secret|auth|session|passwd|api/i;function g(t){let e=t.indexOf("?");if(e===-1)return t.slice(0,2048);let n=t.slice(0,e),r=t.slice(e+1).split("&").map(o=>{let s=o.indexOf("=");if(s===-1)return o;let a=o.slice(0,s);return re.test(a)?`${a}=[redacted]`:o}).join("&");return`${n}?${r}`.slice(0,2048)}var se=/\b((?:[a-zA-Z0-9_-]*(?:token|key|password|secret|auth|session|passwd|api)[a-zA-Z0-9_-]*)=)[^&\s"']+/gi;function F(t){return t.replace(se,"$1[redacted]")}function u(t,e){return t.length>e?t.slice(0,e):t}var K={ok:0,errored:1,crashed:2};function I(t,e){return`${t.replace(/\/api\/v1\/events.*$/,"").replace(/\/$/,"")}${e}`}var _=class{constructor(e,n,i,r){this.url=e;this.key=n;this.release=i;this.environment=r;this.start(),typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.end():this.sid||this.start()})}url;key;release;environment;sid="";started="";status="ok";errors=0;did;setUser(e){this.did=e}markError(e){if(!this.sid)return;this.errors+=1;let n=e?"crashed":"errored";K[n]<=K[this.status]||(this.status=n,this.send(!1))}start(){this.sid=E(),this.started=R(),this.status="ok",this.errors=0,this.send(!1)}end(){this.sid&&(this.send(!0),this.sid="")}send(e){let n=JSON.stringify({sid:this.sid,did:this.did,status:this.status==="ok"&&e?"exited":this.status,errors:this.errors,started:this.started,release:this.release,environment:this.environment}),i=`${this.url}?key=${encodeURIComponent(this.key)}`;try{if(e&&typeof navigator<"u"&&navigator.sendBeacon){navigator.sendBeacon(i,n);return}if(typeof fetch>"u")return;fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key},body:n,keepalive:!0}).catch(()=>{})}catch{return}}};var oe=/^\s*at (?:async )?(?:new )?(?:(.+?) )?\(?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack):.*?|[^()]+?)(?::(\d+))?(?::(\d+))?\)?\s*$/,ae=/^\s*(?:(.*?)@)?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack).*?|[^@]*?)(?::(\d+))?(?::(\d+))?\s*$/,j=/^(chrome|moz|safari-web)-extension:/;function de(){if(typeof location<"u"&&location.origin)return location.origin}function ce(t){if(j.test(t)||t==="<anonymous>"||t==="[native code]")return!1;let e=de();return!!(!e||t.startsWith(e)||!/^[a-z]+:/i.test(t))}function D(t){if(!t)return[];let e=[];for(let n of t.split(`
|
|
2
|
+
`)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let i=oe.exec(n)??ae.exec(n);if(!i)continue;let[,r,o,s,a]=i;if(!o)continue;let d={filename:u(o,1024),in_app:ce(o)};r&&(d.function=u(r,512)),s&&(d.lineno=Number(s)),a&&(d.colno=Number(a)),e.push(d)}return e.reverse(),e.slice(-128)}function z(t){return t.length===0?!1:t.every(e=>j.test(e.filename))}var N="@blipit/browser",C="0.2.0",L="https://in.blipit.io/api/v1/events",ue=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],pe={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},le={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function fe(t){if(!q.includes(t?.kind))return;let e=u(String(t.actor??"").trim(),256);if(!e)return;let n={kind:t.kind,actor:e};return t.actorId&&(n.actor_id=u(String(t.actorId),128)),t.ip&&(n.ip=u(String(t.ip).trim(),45)),t.userAgent&&(n.user_agent=u(String(t.userAgent),512)),t.database&&(n.database=u(String(t.database),64)),t.outcome&&(n.outcome=u(String(t.outcome),64)),t.target&&(n.target=u(String(t.target),256)),n}var $=class{constructor(e){this.options=e;this.endpoint=e.endpoint??L,this.transport=new O(this.endpoint,e.key,e.debug??!1,e.instance),e.autoSessionTracking&&(e.release?this.session=new _(I(this.endpoint,"/api/v1/sessions"),e.key,e.release,e.environment??"production"):e.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(e.maxBreadcrumbs??50,100),this.ignoreErrors=[...ue,...e.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;session;lastEventId;endpoint;replay;setUser(e){this.user=e,this.session?.setUser(e?.id??e?.email)}setTag(e,n){this.tags[u(e,64)]=u(n,256)}addBreadcrumb(e){let n={timestamp:R(),...e};n.message&&(n.message=F(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:g(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(e,n=!0){let i=e instanceof Error?e:new Error(String(e)),r={type:i.name||"Error",value:u(i.message||String(i),4096),handled:n},o=D(i.stack);return o.length>0&&(r.stacktrace={frames:o}),this.processAndSend({exception:r,level:"error"})}captureMessage(e,n="info"){return this.processAndSend({message:u(e,8192),level:n})}captureSecurity(e){let n=fe(e);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${pe[n.kind]} for ${n.actor}`,level:le[n.kind],security:n},!1)}processAndSend(e,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let i=e.exception?.value??e.message??"";if(n){for(let a of this.ignoreErrors)if(typeof a=="string"?i.includes(a):a.test(i))return;if((this.options.autoMuteExtensions??!0)&&e.exception?.stacktrace&&z(e.exception.stacktrace.frames))return;let s=`${e.exception?.type??""}|${i}`;if(e.exception?.handled===!1){if(this.seen.has(s)&&this.seen.size<100)return;this.seen.add(s),setTimeout(()=>this.seen.delete(s),5e3)}}let r={event_id:E(),timestamp:R(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:g(location.href)}:void 0,contexts:this.collectContexts(),sdk:{name:N,version:C},...e};for(let s of Object.keys(r))r[s]===void 0&&delete r[s];let o=this.replay?.active()&&(r.level==="error"||r.level==="fatal")?this.replay:void 0;if(o&&(r.tags={...r.tags,replay_id:o.id}),this.options.beforeSend){let s=this.options.beforeSend(r);if(!s)return;r=s}return this.transport.enqueue(r),this.lastEventId=r.event_id,r.exception&&this.session?.markError(r.exception.handled===!1),o?.error(r.event_id),r.event_id}collectContexts(){if(typeof navigator>"u")return;let e={},n=navigator.userAgent??"",i=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;i&&(e.browser={name:i[1],version:i[2]});let r=/\(([^)]+)\)/.exec(n);return r&&r[1]&&(e.os={name:u(r[1],64)}),typeof screen<"u"&&(e.device={screen:`${screen.width}x${screen.height}`}),Object.keys(e).length>0?e:void 0}flush(){return this.transport.flush()}};function me(t){if(!t||!(t instanceof Element))return"<unknown>";let e=t.tagName.toLowerCase(),n=t.id?`#${t.id}`:"",i=typeof t.className=="string"&&t.className?`.${t.className.trim().split(/\s+/).slice(0,2).join(".")}`:"";return u(`${e}${n}${i}`,128)}function V(t){if(!(typeof window>"u")){if(window.addEventListener("error",e=>{t.captureException(e.error??e.message,!1)}),window.addEventListener("unhandledrejection",e=>{t.captureException(e.reason,!1)}),typeof document<"u"&&document.addEventListener("click",e=>{t.addBreadcrumb({category:"ui.click",message:`Clicked ${me(e.target)}`})},{capture:!0,passive:!0}),typeof window.fetch=="function"){let e=window.fetch.bind(window);window.fetch=async(n,i)=>{let r=typeof n=="string"?n:n instanceof URL?n.href:n.url,o=i?.method??(n instanceof Request?n.method:"GET");try{let s=await e(n,i);return t.addBreadcrumb({category:"http",message:`${o} ${g(r)} \u2192 ${s.status}`,level:s.status>=400?"error":"info",data:{url:g(r),method:o,status_code:s.status}}),s}catch(s){throw t.addBreadcrumb({category:"http",message:`${o} ${g(r)} \u2192 network error`,level:"error",data:{url:g(r),method:o}}),s}}}for(let e of["error","warn"]){let n=console[e].bind(console);console[e]=(...i)=>{t.addBreadcrumb({category:"console",level:e==="warn"?"warning":"error",message:u(i.map(r=>typeof r=="string"?r:he(r)).join(" "),1024)}),n(...i)}}if(window.history){let e=window.history.pushState.bind(window.history);window.history.pushState=(...n)=>{e(...n),t.addBreadcrumb({category:"navigation",message:`Navigated to ${g(location.href)}`})},window.addEventListener("popstate",()=>{t.addBreadcrumb({category:"navigation",message:`Navigated to ${g(location.href)}`})})}}}function he(t){try{return JSON.stringify(t)??String(t)}catch{return String(t)}}function H(){let t=0,e=0,n=0,i=0;return r=>(r.hadRecentInput||(e>0&&r.startTime-i<1e3&&r.startTime-n<5e3?e+=r.value:(e=r.value,n=r.startTime),i=r.startTime,e>t&&(t=e)),t)}function ge(t){if(t.size===0)return;let e=[...t.values()].sort((n,i)=>i-n);return e[Math.min(e.length-1,Math.floor(t.size/50))]}function ye(t){return/iPad|Tablet|Android(?!.*Mobile)/i.test(t)?"tablet":/Mobi|iPhone|Android/i.test(t)?"mobile":"desktop"}function B(t,e,n){try{new PerformanceObserver(i=>i.getEntries().forEach(r=>e(r))).observe({type:t,buffered:!0,...n})}catch{}}function X(t,e,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let i=performance.getEntriesByType("navigation")[0],r=i?.activationStart??0,o=p=>Math.max(0,Math.round(p-r)),s=document.visibilityState==="hidden",a=location.pathname,d=i?.type,c={},h=H(),x=new Map,y=!1,f=!1;i&&i.responseStart>0&&(c.ttfb=o(i.responseStart)),s||(B("paint",p=>{p.name==="first-contentful-paint"&&(c.fcp=o(p.startTime))}),B("largest-contentful-paint",p=>{y||(c.lcp=o(p.startTime))}));let w=()=>{y=!0};addEventListener("keydown",w,{once:!0,capture:!0}),addEventListener("pointerdown",w,{once:!0,capture:!0}),B("layout-shift",p=>{c.cls=Math.round(h(p)*1e4)/1e4});let k=p=>{if(!p.interactionId)return;x.set(p.interactionId,Math.max(x.get(p.interactionId)??0,p.duration));let P=ge(x);P!==void 0&&(c.inp=Math.round(P))};B("event",k,{durationThreshold:40}),B("first-input",k);let S=navigator.connection?.effectiveType,v=`${new URL("/api/v1/vitals",t).href}?key=${encodeURIComponent(e)}${n?`&instance=${encodeURIComponent(n)}`:""}`,b=()=>{if(f||Object.keys(c).length===0)return;f=!0;let p=JSON.stringify({path:a.slice(0,512),metrics:c,nav:d,connection:S&&/^(slow-2g|2g|3g|4g)$/.test(S)?S:void 0,device:ye(navigator.userAgent)});try{if(navigator.sendBeacon?.(v,p))return}catch{}fetch(v,{method:"POST",body:p,keepalive:!0}).catch(()=>{})},T=()=>{location.pathname!==a&&(b(),a=location.pathname,d="route",c={},h=H(),x=new Map,y=!0,f=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&b()),addEventListener("pagehide",b),addEventListener("popstate",T);let Y=history.pushState;history.pushState=function(...p){Y.apply(this,p),T()}}function be(t,e=Math.random){return e()<(t.sessionSampleRate??0)?"session":e()<(t.onErrorSampleRate??1)?"buffer":null}function J(t,e,n,i,r){let o=be(t);if(!o||typeof document>"u")return;let s=E(),a,d=document.createElement("script");return d.src=t.src??`https://blipit.io/sdk/${r}/blipit-replay.js`,d.async=!0,d.onload=()=>{let c=window.BlipitReplay?.start;a=c?.({id:s,mode:o,endpoint:e,key:n,instance:i})},document.head.appendChild(d),{id:s,active:()=>a?.active()??!1,error:c=>a?.error(c)}}function m(t,e,n){let i=document.createElement(t);return i.style.cssText=e,n!==void 0&&(i.textContent=n),i}var A="display:block;width:100%;box-sizing:border-box;margin:4px 0 12px;padding:8px 10px;font:inherit;border:1px solid #c5ccd6;border-radius:6px;background:#fff;color:#111",G="font:inherit;padding:8px 14px;border-radius:6px;cursor:pointer;border:1px solid #c5ccd6;background:#fff;color:#111",U=!1;function W(t,e,n){if(U||typeof document>"u"||!document.body)return;U=!0;let i=m("dialog","max-width:420px;width:calc(100% - 32px);padding:20px;border:1px solid #c5ccd6;border-radius:10px;font:14px/1.45 system-ui,sans-serif;color:#111;background:#fff");i.setAttribute("aria-labelledby","blipit-fb-title");let r=m("form","margin:0"),o=m("h2","margin:0 0 12px;font-size:17px",n.title??"Tell us what happened");o.id="blipit-fb-title";let s=(S,v,b)=>{let T=m("label","display:block;font-weight:600",S);T.htmlFor=b,v.id=b,r.append(T,v)},a=m("input",A);a.type="text",a.maxLength=128,a.autocomplete="name",a.value=n.name??"";let d=m("input",A);d.type="email",d.maxLength=254,d.autocomplete="email",d.value=n.email??"";let c=m("textarea",`${A};min-height:110px;resize:vertical`);c.required=!0,c.maxLength=5e3;let h=m("p","margin:0 0 12px;min-height:1.2em;font-size:13px");h.setAttribute("role","status"),h.setAttribute("aria-live","polite");let x=m("div","display:flex;gap:8px;justify-content:flex-end"),y=m("button",G,"Cancel");y.type="button";let f=m("button",`${G};background:#111;color:#fff;border-color:#111`,"Send");f.type="submit",r.append(o),s("Name (optional)",a,"blipit-fb-name"),s("Email (optional)",d,"blipit-fb-email"),s("What went wrong?",c,"blipit-fb-message"),x.append(y,f),r.append(h,x),i.append(r),document.body.append(i);let w=()=>{U=!1,i.remove()},k=()=>typeof i.close=="function"&&i.open?i.close():w();y.addEventListener("click",k),i.addEventListener("close",w),r.addEventListener("submit",async S=>{S.preventDefault();let v=c.value.trim();if(!v){h.textContent="Please describe what happened.",c.focus();return}f.disabled=!0,y.disabled=!0,f.setAttribute("aria-busy","true"),f.textContent="Sending\u2026",h.textContent="";try{let b=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":e},body:JSON.stringify({name:a.value.trim()||void 0,email:d.value.trim()||void 0,message:v,event_id:n.eventId,url:typeof location<"u"?location.href.split(/[?#]/)[0]:void 0})});if(!b.ok)throw new Error(String(b.status));h.textContent="Thanks, your message was sent.",f.textContent="Sent",setTimeout(k,1200)}catch{h.textContent="That did not send. Please try again.",f.disabled=!1,y.disabled=!1,f.removeAttribute("aria-busy"),f.textContent="Send"}}),typeof i.showModal=="function"?i.showModal():i.setAttribute("open",""),c.focus()}var l;function ve(t){l||(l=new $(t),V(l),t.webVitals!==!1&&typeof window<"u"&&X(t.endpoint??L,t.key,t.instance),t.replay&&(l.replay=J(t.replay,t.endpoint??L,t.key,t.instance,C)),t.debug&&console.log(`[blipit] ${N}@${C} initialized`))}function xe(t){return l?.captureException(t,!0)}function Se(t,e){return l?.captureMessage(t,e)}function Ee(t){return l?.captureSecurity(t)}function we(t){l?.setUser(t)}function ke(t,e){l?.setTag(t,e)}function Te(t){l?.addBreadcrumb(t)}function Re(t={}){l&&W(I(l.endpoint,"/api/v1/feedback"),l.options.key,{...t,eventId:t.eventId??l.lastEventId})}function Be(){return l?.flush()??Promise.resolve()}return ie(Oe);})();
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var P=["login_failed","login_succeeded","login_blocked","password_reset_requested","privilege_granted"];var O=class{constructor(e,n,i,r){this.endpoint=e;this.key=n;this.debug=i;this.instance=r;typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushWithBeacon()})}endpoint;key;debug;instance;queue=[];timer;sending=!1;enqueue(e){this.queue.push(e),this.queue.length>30&&this.queue.shift(),this.timer||(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},1e3))}async flush(){if(!this.sending){this.sending=!0;try{for(;this.queue.length>0;){let e=this.queue[0];if(!await this.send(e))break;this.queue.shift()}}finally{this.sending=!1}}}async send(e,n=0){try{let i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,...this.instance?{"X-Blipit-Instance":this.instance}:{}},body:JSON.stringify(e),keepalive:!0});return i.status===429||i.status>=500?this.retry(e,n):(this.debug&&i.status>=400&&console.warn("[blipit] event rejected",i.status,await i.text()),!0)}catch{return this.retry(e,n)}}async retry(e,n){return n>=2?(this.debug&&console.warn("[blipit] dropping event after retries",e.event_id),!0):(await new Promise(i=>setTimeout(i,1e3*2**n)),this.send(e,n+1))}flushWithBeacon(){if(!(typeof navigator>"u"||!navigator.sendBeacon))for(;this.queue.length>0;){let e=this.queue.shift(),n=`key=${encodeURIComponent(this.key)}${this.instance?`&instance=${encodeURIComponent(this.instance)}`:""}`,i=`${this.endpoint}${this.endpoint.includes("?")?"&":"?"}${n}`;navigator.sendBeacon(i,JSON.stringify(e))}}};function E(){let t=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let n=0;n<16;n++)t[n]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let e="";for(let n=0;n<16;n++)e+=t[n].toString(16).padStart(2,"0");return e}function R(){return new Date().toISOString()}var Y=/token|key|password|secret|auth|session|passwd|api/i;function g(t){let e=t.indexOf("?");if(e===-1)return t.slice(0,2048);let n=t.slice(0,e),r=t.slice(e+1).split("&").map(o=>{let s=o.indexOf("=");if(s===-1)return o;let a=o.slice(0,s);return Y.test(a)?`${a}=[redacted]`:o}).join("&");return`${n}?${r}`.slice(0,2048)}var Z=/\b((?:[a-zA-Z0-9_-]*(?:token|key|password|secret|auth|session|passwd|api)[a-zA-Z0-9_-]*)=)[^&\s"']+/gi;function q(t){return t.replace(Z,"$1[redacted]")}function u(t,e){return t.length>e?t.slice(0,e):t}var F={ok:0,errored:1,crashed:2};function I(t,e){return`${t.replace(/\/api\/v1\/events.*$/,"").replace(/\/$/,"")}${e}`}var _=class{constructor(e,n,i,r){this.url=e;this.key=n;this.release=i;this.environment=r;this.start(),typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.end():this.sid||this.start()})}url;key;release;environment;sid="";started="";status="ok";errors=0;did;setUser(e){this.did=e}markError(e){if(!this.sid)return;this.errors+=1;let n=e?"crashed":"errored";F[n]<=F[this.status]||(this.status=n,this.send(!1))}start(){this.sid=E(),this.started=R(),this.status="ok",this.errors=0,this.send(!1)}end(){this.sid&&(this.send(!0),this.sid="")}send(e){let n=JSON.stringify({sid:this.sid,did:this.did,status:this.status==="ok"&&e?"exited":this.status,errors:this.errors,started:this.started,release:this.release,environment:this.environment}),i=`${this.url}?key=${encodeURIComponent(this.key)}`;try{if(e&&typeof navigator<"u"&&navigator.sendBeacon){navigator.sendBeacon(i,n);return}if(typeof fetch>"u")return;fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key},body:n,keepalive:!0}).catch(()=>{})}catch{return}}};var Q=/^\s*at (?:async )?(?:new )?(?:(.+?) )?\(?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack):.*?|[^()]+?)(?::(\d+))?(?::(\d+))?\)?\s*$/,ee=/^\s*(?:(.*?)@)?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack).*?|[^@]*?)(?::(\d+))?(?::(\d+))?\s*$/,K=/^(chrome|moz|safari-web)-extension:/;function te(){if(typeof location<"u"&&location.origin)return location.origin}function ne(t){if(K.test(t)||t==="<anonymous>"||t==="[native code]")return!1;let e=te();return!!(!e||t.startsWith(e)||!/^[a-z]+:/i.test(t))}function j(t){if(!t)return[];let e=[];for(let n of t.split(`
|
|
2
|
+
`)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let i=Q.exec(n)??ee.exec(n);if(!i)continue;let[,r,o,s,a]=i;if(!o)continue;let d={filename:u(o,1024),in_app:ne(o)};r&&(d.function=u(r,512)),s&&(d.lineno=Number(s)),a&&(d.colno=Number(a)),e.push(d)}return e.reverse(),e.slice(-128)}function D(t){return t.length===0?!1:t.every(e=>K.test(e.filename))}var M="@blipit/browser",C="0.2.0",L="https://in.blipit.io/api/v1/events",ie=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],re={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},se={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function oe(t){if(!P.includes(t?.kind))return;let e=u(String(t.actor??"").trim(),256);if(!e)return;let n={kind:t.kind,actor:e};return t.actorId&&(n.actor_id=u(String(t.actorId),128)),t.ip&&(n.ip=u(String(t.ip).trim(),45)),t.userAgent&&(n.user_agent=u(String(t.userAgent),512)),t.database&&(n.database=u(String(t.database),64)),t.outcome&&(n.outcome=u(String(t.outcome),64)),t.target&&(n.target=u(String(t.target),256)),n}var $=class{constructor(e){this.options=e;this.endpoint=e.endpoint??L,this.transport=new O(this.endpoint,e.key,e.debug??!1,e.instance),e.autoSessionTracking&&(e.release?this.session=new _(I(this.endpoint,"/api/v1/sessions"),e.key,e.release,e.environment??"production"):e.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(e.maxBreadcrumbs??50,100),this.ignoreErrors=[...ie,...e.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;session;lastEventId;endpoint;replay;setUser(e){this.user=e,this.session?.setUser(e?.id??e?.email)}setTag(e,n){this.tags[u(e,64)]=u(n,256)}addBreadcrumb(e){let n={timestamp:R(),...e};n.message&&(n.message=q(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:g(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(e,n=!0){let i=e instanceof Error?e:new Error(String(e)),r={type:i.name||"Error",value:u(i.message||String(i),4096),handled:n},o=j(i.stack);return o.length>0&&(r.stacktrace={frames:o}),this.processAndSend({exception:r,level:"error"})}captureMessage(e,n="info"){return this.processAndSend({message:u(e,8192),level:n})}captureSecurity(e){let n=oe(e);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${re[n.kind]} for ${n.actor}`,level:se[n.kind],security:n},!1)}processAndSend(e,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let i=e.exception?.value??e.message??"";if(n){for(let a of this.ignoreErrors)if(typeof a=="string"?i.includes(a):a.test(i))return;if((this.options.autoMuteExtensions??!0)&&e.exception?.stacktrace&&D(e.exception.stacktrace.frames))return;let s=`${e.exception?.type??""}|${i}`;if(e.exception?.handled===!1){if(this.seen.has(s)&&this.seen.size<100)return;this.seen.add(s),setTimeout(()=>this.seen.delete(s),5e3)}}let r={event_id:E(),timestamp:R(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:g(location.href)}:void 0,contexts:this.collectContexts(),sdk:{name:M,version:C},...e};for(let s of Object.keys(r))r[s]===void 0&&delete r[s];let o=this.replay?.active()&&(r.level==="error"||r.level==="fatal")?this.replay:void 0;if(o&&(r.tags={...r.tags,replay_id:o.id}),this.options.beforeSend){let s=this.options.beforeSend(r);if(!s)return;r=s}return this.transport.enqueue(r),this.lastEventId=r.event_id,r.exception&&this.session?.markError(r.exception.handled===!1),o?.error(r.event_id),r.event_id}collectContexts(){if(typeof navigator>"u")return;let e={},n=navigator.userAgent??"",i=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;i&&(e.browser={name:i[1],version:i[2]});let r=/\(([^)]+)\)/.exec(n);return r&&r[1]&&(e.os={name:u(r[1],64)}),typeof screen<"u"&&(e.device={screen:`${screen.width}x${screen.height}`}),Object.keys(e).length>0?e:void 0}flush(){return this.transport.flush()}};function ae(t){if(!t||!(t instanceof Element))return"<unknown>";let e=t.tagName.toLowerCase(),n=t.id?`#${t.id}`:"",i=typeof t.className=="string"&&t.className?`.${t.className.trim().split(/\s+/).slice(0,2).join(".")}`:"";return u(`${e}${n}${i}`,128)}function z(t){if(!(typeof window>"u")){if(window.addEventListener("error",e=>{t.captureException(e.error??e.message,!1)}),window.addEventListener("unhandledrejection",e=>{t.captureException(e.reason,!1)}),typeof document<"u"&&document.addEventListener("click",e=>{t.addBreadcrumb({category:"ui.click",message:`Clicked ${ae(e.target)}`})},{capture:!0,passive:!0}),typeof window.fetch=="function"){let e=window.fetch.bind(window);window.fetch=async(n,i)=>{let r=typeof n=="string"?n:n instanceof URL?n.href:n.url,o=i?.method??(n instanceof Request?n.method:"GET");try{let s=await e(n,i);return t.addBreadcrumb({category:"http",message:`${o} ${g(r)} \u2192 ${s.status}`,level:s.status>=400?"error":"info",data:{url:g(r),method:o,status_code:s.status}}),s}catch(s){throw t.addBreadcrumb({category:"http",message:`${o} ${g(r)} \u2192 network error`,level:"error",data:{url:g(r),method:o}}),s}}}for(let e of["error","warn"]){let n=console[e].bind(console);console[e]=(...i)=>{t.addBreadcrumb({category:"console",level:e==="warn"?"warning":"error",message:u(i.map(r=>typeof r=="string"?r:de(r)).join(" "),1024)}),n(...i)}}if(window.history){let e=window.history.pushState.bind(window.history);window.history.pushState=(...n)=>{e(...n),t.addBreadcrumb({category:"navigation",message:`Navigated to ${g(location.href)}`})},window.addEventListener("popstate",()=>{t.addBreadcrumb({category:"navigation",message:`Navigated to ${g(location.href)}`})})}}}function de(t){try{return JSON.stringify(t)??String(t)}catch{return String(t)}}function V(){let t=0,e=0,n=0,i=0;return r=>(r.hadRecentInput||(e>0&&r.startTime-i<1e3&&r.startTime-n<5e3?e+=r.value:(e=r.value,n=r.startTime),i=r.startTime,e>t&&(t=e)),t)}function ce(t){if(t.size===0)return;let e=[...t.values()].sort((n,i)=>i-n);return e[Math.min(e.length-1,Math.floor(t.size/50))]}function ue(t){return/iPad|Tablet|Android(?!.*Mobile)/i.test(t)?"tablet":/Mobi|iPhone|Android/i.test(t)?"mobile":"desktop"}function B(t,e,n){try{new PerformanceObserver(i=>i.getEntries().forEach(r=>e(r))).observe({type:t,buffered:!0,...n})}catch{}}function H(t,e,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let i=performance.getEntriesByType("navigation")[0],r=i?.activationStart??0,o=p=>Math.max(0,Math.round(p-r)),s=document.visibilityState==="hidden",a=location.pathname,d=i?.type,c={},h=V(),x=new Map,y=!1,f=!1;i&&i.responseStart>0&&(c.ttfb=o(i.responseStart)),s||(B("paint",p=>{p.name==="first-contentful-paint"&&(c.fcp=o(p.startTime))}),B("largest-contentful-paint",p=>{y||(c.lcp=o(p.startTime))}));let w=()=>{y=!0};addEventListener("keydown",w,{once:!0,capture:!0}),addEventListener("pointerdown",w,{once:!0,capture:!0}),B("layout-shift",p=>{c.cls=Math.round(h(p)*1e4)/1e4});let k=p=>{if(!p.interactionId)return;x.set(p.interactionId,Math.max(x.get(p.interactionId)??0,p.duration));let U=ce(x);U!==void 0&&(c.inp=Math.round(U))};B("event",k,{durationThreshold:40}),B("first-input",k);let S=navigator.connection?.effectiveType,v=`${new URL("/api/v1/vitals",t).href}?key=${encodeURIComponent(e)}${n?`&instance=${encodeURIComponent(n)}`:""}`,b=()=>{if(f||Object.keys(c).length===0)return;f=!0;let p=JSON.stringify({path:a.slice(0,512),metrics:c,nav:d,connection:S&&/^(slow-2g|2g|3g|4g)$/.test(S)?S:void 0,device:ue(navigator.userAgent)});try{if(navigator.sendBeacon?.(v,p))return}catch{}fetch(v,{method:"POST",body:p,keepalive:!0}).catch(()=>{})},T=()=>{location.pathname!==a&&(b(),a=location.pathname,d="route",c={},h=V(),x=new Map,y=!0,f=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&b()),addEventListener("pagehide",b),addEventListener("popstate",T);let W=history.pushState;history.pushState=function(...p){W.apply(this,p),T()}}function pe(t,e=Math.random){return e()<(t.sessionSampleRate??0)?"session":e()<(t.onErrorSampleRate??1)?"buffer":null}function X(t,e,n,i,r){let o=pe(t);if(!o||typeof document>"u")return;let s=E(),a,d=document.createElement("script");return d.src=t.src??`https://blipit.io/sdk/${r}/blipit-replay.js`,d.async=!0,d.onload=()=>{let c=window.BlipitReplay?.start;a=c?.({id:s,mode:o,endpoint:e,key:n,instance:i})},document.head.appendChild(d),{id:s,active:()=>a?.active()??!1,error:c=>a?.error(c)}}function m(t,e,n){let i=document.createElement(t);return i.style.cssText=e,n!==void 0&&(i.textContent=n),i}var N="display:block;width:100%;box-sizing:border-box;margin:4px 0 12px;padding:8px 10px;font:inherit;border:1px solid #c5ccd6;border-radius:6px;background:#fff;color:#111",J="font:inherit;padding:8px 14px;border-radius:6px;cursor:pointer;border:1px solid #c5ccd6;background:#fff;color:#111",A=!1;function G(t,e,n){if(A||typeof document>"u"||!document.body)return;A=!0;let i=m("dialog","max-width:420px;width:calc(100% - 32px);padding:20px;border:1px solid #c5ccd6;border-radius:10px;font:14px/1.45 system-ui,sans-serif;color:#111;background:#fff");i.setAttribute("aria-labelledby","blipit-fb-title");let r=m("form","margin:0"),o=m("h2","margin:0 0 12px;font-size:17px",n.title??"Tell us what happened");o.id="blipit-fb-title";let s=(S,v,b)=>{let T=m("label","display:block;font-weight:600",S);T.htmlFor=b,v.id=b,r.append(T,v)},a=m("input",N);a.type="text",a.maxLength=128,a.autocomplete="name",a.value=n.name??"";let d=m("input",N);d.type="email",d.maxLength=254,d.autocomplete="email",d.value=n.email??"";let c=m("textarea",`${N};min-height:110px;resize:vertical`);c.required=!0,c.maxLength=5e3;let h=m("p","margin:0 0 12px;min-height:1.2em;font-size:13px");h.setAttribute("role","status"),h.setAttribute("aria-live","polite");let x=m("div","display:flex;gap:8px;justify-content:flex-end"),y=m("button",J,"Cancel");y.type="button";let f=m("button",`${J};background:#111;color:#fff;border-color:#111`,"Send");f.type="submit",r.append(o),s("Name (optional)",a,"blipit-fb-name"),s("Email (optional)",d,"blipit-fb-email"),s("What went wrong?",c,"blipit-fb-message"),x.append(y,f),r.append(h,x),i.append(r),document.body.append(i);let w=()=>{A=!1,i.remove()},k=()=>typeof i.close=="function"&&i.open?i.close():w();y.addEventListener("click",k),i.addEventListener("close",w),r.addEventListener("submit",async S=>{S.preventDefault();let v=c.value.trim();if(!v){h.textContent="Please describe what happened.",c.focus();return}f.disabled=!0,y.disabled=!0,f.setAttribute("aria-busy","true"),f.textContent="Sending\u2026",h.textContent="";try{let b=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":e},body:JSON.stringify({name:a.value.trim()||void 0,email:d.value.trim()||void 0,message:v,event_id:n.eventId,url:typeof location<"u"?location.href.split(/[?#]/)[0]:void 0})});if(!b.ok)throw new Error(String(b.status));h.textContent="Thanks, your message was sent.",f.textContent="Sent",setTimeout(k,1200)}catch{h.textContent="That did not send. Please try again.",f.disabled=!1,y.disabled=!1,f.removeAttribute("aria-busy"),f.textContent="Send"}}),typeof i.showModal=="function"?i.showModal():i.setAttribute("open",""),c.focus()}var l;function Ue(t){l||(l=new $(t),z(l),t.webVitals!==!1&&typeof window<"u"&&H(t.endpoint??L,t.key,t.instance),t.replay&&(l.replay=X(t.replay,t.endpoint??L,t.key,t.instance,C)),t.debug&&console.log(`[blipit] ${M}@${C} initialized`))}function Pe(t){return l?.captureException(t,!0)}function qe(t,e){return l?.captureMessage(t,e)}function Fe(t){return l?.captureSecurity(t)}function Ke(t){l?.setUser(t)}function je(t,e){l?.setTag(t,e)}function De(t){l?.addBreadcrumb(t)}function ze(t={}){l&&G(I(l.endpoint,"/api/v1/feedback"),l.options.key,{...t,eventId:t.eventId??l.lastEventId})}function Ve(){return l?.flush()??Promise.resolve()}export{De as addBreadcrumb,Pe as captureException,qe as captureMessage,Fe as captureSecurity,Ve as flush,Ue as init,je as setTag,Ke as setUser,ze as showFeedback};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";var BlipitReplay=(()=>{var Ct=Object.defineProperty;var En=Object.getOwnPropertyDescriptor;var xn=Object.getOwnPropertyNames;var Mn=Object.prototype.hasOwnProperty;var Rn=(e,t)=>{for(var s in t)Ct(e,s,{get:t[s],enumerable:!0})},Nn=(e,t,s,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xn(t))!Mn.call(e,r)&&r!==s&&Ct(e,r,{get:()=>t[r],enumerable:!(a=En(t,r))||a.enumerable});return e};var On=e=>Nn(Ct({},"__esModule",{value:!0}),e);var nl={};Rn(nl,{start:()=>il});var In=Object.defineProperty,An=(e,t,s)=>t in e?In(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,I=(e,t,s)=>An(e,typeof t!="symbol"?t+"":t,s),ns,Dn=Object.defineProperty,Tn=(e,t,s)=>t in e?Dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,os=(e,t,s)=>Tn(e,typeof t!="symbol"?t+"":t,s),J=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(J||{}),as={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ls={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},qe={},Ni={},_n=()=>!!globalThis.Zone;function Wr(e){if(qe[e])return qe[e];let t=globalThis[e],s=t.prototype,a=e in as?as[e]:void 0,r=!!(a&&a.every(m=>{var l,d;return!!((d=(l=Object.getOwnPropertyDescriptor(s,m))==null?void 0:l.get)!=null&&d.toString().includes("[native code]"))})),c=e in ls?ls[e]:void 0,f=!!(c&&c.every(m=>{var l;return typeof s[m]=="function"&&((l=s[m])==null?void 0:l.toString().includes("[native code]"))}));if(r&&f&&!_n())return qe[e]=t.prototype,t.prototype;try{let m=document.createElement("iframe");m.style.display="none",document.body.appendChild(m);let l=m.contentWindow;if(!l)return t.prototype;let d=l[e].prototype;if(!d)return m.remove(),s;let i=navigator.userAgent;return i.includes("Safari")&&!i.includes("Chrome")?(m.classList.add("rr-block"),m.setAttribute("__rrwebUntaintedMutationObserver",""),Ni[e]=()=>m.remove()):m.remove(),qe[e]=d}catch{return s}}var Et={};function ne(e,t,s){var a,r;let c=(a=Et[e])==null?void 0:a[s];if(c)return c.call(t);let f=Wr(e),m=(r=Object.getOwnPropertyDescriptor(f,s))==null?void 0:r.get;return m?((Et[e]||(Et[e]={}))[s]=m,m.call(t)):t[s]}var xt={};function Oi(e,t,s){let a=`${e}.${String(s)}`;if(xt[a])return xt[a].bind(t);let c=Wr(e)[s];return typeof c!="function"?t[s]:(xt[a]=c,c.bind(t))}function kn(e){return ne("Node",e,"ownerDocument")}function Pn(e){return ne("Node",e,"childNodes")}function Ln(e){return ne("Node",e,"parentNode")}function Fn(e){return ne("Node",e,"parentElement")}function Un(e){return ne("Node",e,"textContent")}function Bn(e){return ne("Node",e,"firstChild")}function $n(e){return ne("Node",e,"lastChild")}function Wn(e){return ne("Node",e,"nextSibling")}function zn(e){return ne("Node",e,"previousSibling")}function qn(e,t){return Oi("Node",e,"contains")(t)}function Vn(e){return Oi("Node",e,"getRootNode")()}function jn(e){return!e||!("host"in e)?null:ne("ShadowRoot",e,"host")}function Gn(e){return e.styleSheets}function Hn(e){return!e||!("shadowRoot"in e)?null:ne("Element",e,"shadowRoot")}function Yn(e,t){return ne("Element",e,"querySelector")(t)}function Xn(e,t){return ne("Element",e,"querySelectorAll")(t)}function Jn(){return[Wr("MutationObserver").constructor,Ni.MutationObserver??(()=>{})]}var Ii=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ii=()=>new Date().getTime());function Qn(e,t,s){try{if(!(t in e))return()=>{};let a=e[t],r=s(a);return typeof r=="function"&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:a}})),e[t]=r,()=>{e[t]=a}}catch{return()=>{}}}var Z={ownerDocument:kn,childNodes:Pn,parentNode:Ln,parentElement:Fn,textContent:Un,firstChild:Bn,lastChild:$n,nextSibling:Wn,previousSibling:zn,contains:qn,getRootNode:Vn,host:jn,styleSheets:Gn,shadowRoot:Hn,querySelector:Yn,querySelectorAll:Xn,nowTimestamp:Ii,mutationObserverCtor:Jn,patch:Qn};function Ai(e){return e.nodeType===e.ELEMENT_NODE}function Pe(e){let t=e&&"host"in e&&"mode"in e&&Z.host(e)||null;return!!(t&&"shadowRoot"in t&&Z.shadowRoot(t)===e)}function Le(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Zn(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Kn(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let s=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?s.push("layer"):e.layerName&&s.push(`layer(${e.layerName})`),e.supportsText&&s.push(`supports(${e.supportsText})`),e.media.length&&s.push(e.media.mediaText),s.join(" ")+";"}function Ir(e){try{let t=e.rules||e.cssRules;if(!t)return null;let s=e.href;!s&&e.ownerNode&&(s=e.ownerNode.baseURI);let a=Array.from(t,r=>Di(r,s)).join("");return Zn(a)}catch{return null}}function Di(e,t){if(to(e)){let s;try{s=Ir(e.styleSheet)||Kn(e)}catch{s=e.cssText}return e.styleSheet.href?st(s,e.styleSheet.href):s}else{let s=e.cssText;return ro(e)&&e.selectorText.includes(":")&&(s=eo(s)),t?st(s,t):s}}function eo(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function to(e){return"styleSheet"in e}function ro(e){return"selectorText"in e}var et=class{constructor(){os(this,"idNodeMap",new Map),os(this,"nodeMetaMap",new WeakMap)}getId(t){var s;return t?((s=this.getMeta(t))==null?void 0:s.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let s=this.getId(t);this.idNodeMap.delete(s),t.childNodes&&t.childNodes.forEach(a=>this.removeNodeFromMap(a))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,s){let a=s.id;this.idNodeMap.set(a,t),this.nodeMetaMap.set(t,s)}replace(t,s){let a=this.getNode(t);if(a){let r=this.nodeMetaMap.get(a);r&&this.nodeMetaMap.set(s,r)}this.idNodeMap.set(t,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function so(){return new et}function tt({element:e,maskInputOptions:t,tagName:s,type:a,value:r,maskInputFn:c}){let f=r||"",m=a&&Se(a);return(t[s.toLowerCase()]||m&&t[m])&&(c?f=c(f,e):f="*".repeat(f.length)),f}function Se(e){return e.toLowerCase()}var us="__rrweb_original__";function io(e){let t=e.getContext("2d");if(!t)return!0;let s=50;for(let a=0;a<e.width;a+=s)for(let r=0;r<e.height;r+=s){let c=t.getImageData,f=us in c?c[us]:c;if(new Uint32Array(f.call(t,a,r,Math.min(s,e.width-a),Math.min(s,e.height-r)).data.buffer).some(l=>l!==0))return!1}return!0}function rt(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Se(t):null}function Ti(e,t){let s;try{s=new URL(e,t??window.location.href)}catch{return null}let a=/\.([0-9a-z]+)(?:$)/i,r=s.pathname.match(a);return r?.[1]??null}function no(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var oo=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ao=/^(?:[a-z+]+:)?\/\//i,lo=/^www\..*/i,uo=/^(data:)([^,]*),(.*)/i;function st(e,t){return(e||"").replace(oo,(s,a,r,c,f,m)=>{let l=r||f||m,d=a||c||"";if(!l)return s;if(ao.test(l)||lo.test(l))return`url(${d}${l}${d})`;if(uo.test(l))return`url(${d}${l}${d})`;if(l[0]==="/")return`url(${d}${no(t)+l}${d})`;let i=l.split("#")[0],h=l.substring(i.length),o=t.split("#")[0].split("/"),n=i.split("/");o.pop();for(let p of n)p!=="."&&(p===".."?o.pop():o.push(p));return`url(${d}${o.join("/")}${h}${d})`})}function Ve(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function co(e,t,s=!1){let a=Array.from(t.childNodes),r=[],c=0;if(a.length>1&&e&&typeof e=="string"){let f=Ve(e,s),m=f.length/e.length;for(let l=1;l<a.length;l++)if(a[l].textContent&&typeof a[l].textContent=="string"){let d=Ve(a[l].textContent,s),i=100,h=3;for(;h<d.length&&(d[h].match(/[a-zA-Z0-9]/)||d.indexOf(d.substring(0,h),1)!==-1);h++);for(;h<d.length;h++){let o=d.substring(0,h),n=f.split(o),p=-1;if(n.length===2)p=n[0].length;else if(n.length>2&&n[0]===""&&a[l-1].textContent!=="")p=f.indexOf(o,1);else if(n.length===1){if(o=o.substring(0,o.length-1),n=f.split(o),n.length<=1)return r.push(e),r;h=i+1}else h===d.length-1&&(p=f.indexOf(o));if(n.length>=2&&h>i){let u=a[l-1].textContent;if(u&&typeof u=="string"){let g=Ve(u).length;p=f.indexOf(o,g)}p===-1&&(p=n[0].length)}if(p!==-1){let u=Math.floor(p/m);for(;u>0&&u<e.length;){if(c+=1,c>50*a.length)return r.push(e),r;let g=Ve(e.substring(0,u),s);if(g.length===p){r.push(e.substring(0,u)),e=e.substring(u),f=f.substring(p);break}else g.length<p?u+=Math.max(1,Math.floor((p-g.length)/m)):u-=Math.max(1,Math.floor((g.length-p)*m))}break}}}}return r.push(e),r}function ho(e,t){return co(e,t).join("/* rr_split */")}var fo=1,po=new RegExp("[^a-z0-9-_:]"),it=-2;function _i(){return fo++}function mo(e){if(e instanceof HTMLFormElement)return"form";let t=Se(e.tagName);return po.test(t)?"div":t}var Re,cs,go=/^[^ \t\n\r\u000c]+/,yo=/^[, \t\n\r\u000c]+/;function wo(e,t){if(t.trim()==="")return t;let s=0;function a(c){let f,m=c.exec(t.substring(s));return m?(f=m[0],s+=f.length,f):""}let r=[];for(;a(yo),!(s>=t.length);){let c=a(go);if(c.slice(-1)===",")c=Ie(e,c.substring(0,c.length-1)),r.push(c);else{let f="";c=Ie(e,c);let m=!1;for(;;){let l=t.charAt(s);if(l===""){r.push((c+f).trim());break}else if(m)l===")"&&(m=!1);else if(l===","){s+=1,r.push((c+f).trim());break}else l==="("&&(m=!0);f+=l,s+=1}}}return r.join(", ")}var hs=new WeakMap;function Ie(e,t){return!t||t.trim()===""?t:zr(e,t)}function bo(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function zr(e,t){let s=hs.get(e);if(s||(s=e.createElement("a"),hs.set(e,s)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return s.setAttribute("href",t),s.href}function ki(e,t,s,a){return a&&(s==="src"||s==="href"&&!(t==="use"&&a[0]==="#")||s==="xlink:href"&&a[0]!=="#"||s==="background"&&["table","td","th"].includes(t)?Ie(e,a):s==="srcset"?wo(e,a):s==="style"?st(a,zr(e)):t==="object"&&s==="data"?Ie(e,a):a)}function Pi(e,t,s){return["video","audio"].includes(e)&&Se(t)==="autoplay"}function So(e,t,s){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let a=e.classList.length;a--;){let r=e.classList[a];if(t.test(r))return!0}if(s)return e.matches(s)}catch{}return!1}function nt(e,t,s){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return s?nt(Z.parentNode(e),t,s):!1;for(let a=e.classList.length;a--;){let r=e.classList[a];if(t.test(r))return!0}return s?nt(Z.parentNode(e),t,s):!1}function Li(e,t,s,a){let r;if(Ai(e)){if(r=e,!Z.childNodes(r).length)return!1}else{if(Z.parentElement(e)===null)return!1;r=Z.parentElement(e)}try{if(typeof t=="string"){if(a){if(r.closest(`.${t}`))return!0}else if(r.classList.contains(t))return!0}else if(nt(r,t,a))return!0;if(s){if(a){if(r.closest(s))return!0}else if(r.matches(s))return!0}}catch{}return!1}function vo(e,t,s){let a=e.contentWindow;if(!a)return;let r=!1,c;try{c=a.document.readyState}catch{return}if(c!=="complete"){let m=setTimeout(()=>{r||(t(),r=!0)},s);e.addEventListener("load",()=>{clearTimeout(m),r=!0,t()});return}let f="about:blank";if(a.location.href!==f||e.src===f||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Co(e,t,s){let a=!1,r;try{r=e.sheet}catch{return}if(r)return;let c=setTimeout(()=>{a||(t(),a=!0)},s);e.addEventListener("load",()=>{clearTimeout(c),a=!0,t()})}function Eo(e,t){let{doc:s,mirror:a,blockClass:r,blockSelector:c,needsMask:f,inlineStylesheet:m,maskInputOptions:l={},maskTextFn:d,maskInputFn:i,dataURLOptions:h={},inlineImages:o,recordCanvas:n,keepIframeSrcFn:p,newlyAddedElement:u=!1,cssCaptured:g=!1}=t,v=xo(s,a);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:J.Document,childNodes:[],compatMode:e.compatMode}:{type:J.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:J.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return Ro(e,{doc:s,blockClass:r,blockSelector:c,inlineStylesheet:m,maskInputOptions:l,maskInputFn:i,dataURLOptions:h,inlineImages:o,recordCanvas:n,keepIframeSrcFn:p,newlyAddedElement:u,rootId:v});case e.TEXT_NODE:return Mo(e,{doc:s,needsMask:f,maskTextFn:d,rootId:v,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:J.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:J.Comment,textContent:Z.textContent(e)||"",rootId:v};default:return!1}}function xo(e,t){if(!t.hasNode(e))return;let s=t.getId(e);return s===1?void 0:s}function Mo(e,t){let{needsMask:s,maskTextFn:a,rootId:r,cssCaptured:c}=t,f=Z.parentNode(e),m=f&&f.tagName,l="",d=m==="STYLE"?!0:void 0,i=m==="SCRIPT"?!0:void 0;return i?l="SCRIPT_PLACEHOLDER":c||(l=Z.textContent(e),d&&l&&(l=st(l,zr(t.doc)))),!d&&!i&&l&&s&&(l=a?a(l,Z.parentElement(e)):l.replace(/[\S]/g,"*")),{type:J.Text,textContent:l||"",rootId:r}}function Ro(e,t){let{doc:s,blockClass:a,blockSelector:r,inlineStylesheet:c,maskInputOptions:f={},maskInputFn:m,dataURLOptions:l={},inlineImages:d,recordCanvas:i,keepIframeSrcFn:h,newlyAddedElement:o=!1,rootId:n}=t,p=So(e,a,r),u=mo(e),g={},v=e.attributes.length;for(let b=0;b<v;b++){let E=e.attributes[b];Pi(u,E.name,E.value)||(g[E.name]=ki(s,u,Se(E.name),E.value))}if(u==="link"&&c){let b=Array.from(s.styleSheets).find(w=>w.href===e.href),E=null;b&&(E=Ir(b)),E&&(delete g.rel,delete g.href,g._cssText=E)}if(u==="style"&&e.sheet){let b=Ir(e.sheet);b&&(e.childNodes.length>1&&(b=ho(b,e)),g._cssText=b)}if(["input","textarea","select"].includes(u)){let b=e.value,E=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&b?g.value=tt({element:e,type:rt(e),tagName:u,value:b,maskInputOptions:f,maskInputFn:m}):E&&(g.checked=E)}if(u==="option"&&(e.selected&&!f.select?g.selected=!0:delete g.selected),u==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),u==="canvas"&&i){if(e.__context==="2d")io(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let b=e.toDataURL(l.type,l.quality),E=s.createElement("canvas");E.width=e.width,E.height=e.height;let w=E.toDataURL(l.type,l.quality);b!==w&&(g.rr_dataURL=b)}}if(u==="img"&&d){Re||(Re=s.createElement("canvas"),cs=Re.getContext("2d"));let b=e,E=b.currentSrc||b.getAttribute("src")||"<unknown-src>",w=b.crossOrigin,y=()=>{b.removeEventListener("load",y);try{Re.width=b.naturalWidth,Re.height=b.naturalHeight,cs.drawImage(b,0,0),g.rr_dataURL=Re.toDataURL(l.type,l.quality)}catch(C){if(b.crossOrigin!=="anonymous"){b.crossOrigin="anonymous",b.complete&&b.naturalWidth!==0?y():b.addEventListener("load",y);return}else console.warn(`Cannot inline img src=${E}! Error: ${C}`)}b.crossOrigin==="anonymous"&&(w?g.crossOrigin=w:b.removeAttribute("crossorigin"))};b.complete&&b.naturalWidth!==0?y():b.addEventListener("load",y)}if(["audio","video"].includes(u)){let b=g;b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime,b.rr_mediaPlaybackRate=e.playbackRate,b.rr_mediaMuted=e.muted,b.rr_mediaLoop=e.loop,b.rr_mediaVolume=e.volume}if(o||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),p){let{width:b,height:E}=e.getBoundingClientRect();g={class:g.class,rr_width:`${b}px`,rr_height:`${E}px`}}u==="iframe"&&!h(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let S;try{customElements.get(u)&&(S=!0)}catch{}return{type:J.Element,tagName:u,attributes:g,childNodes:[],isSVG:bo(e)||void 0,needBlock:p,rootId:n,isCustom:S}}function z(e){return e==null?"":e.toLowerCase()}function Fi(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function No(e,t){if(t.comment&&e.type===J.Comment)return!0;if(e.type===J.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Ti(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||z(e.attributes.name)==="application-name"||z(e.attributes.rel)==="icon"||z(e.attributes.rel)==="apple-touch-icon"||z(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&z(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(z(e.attributes.property).match(/^(og|twitter|fb):/)||z(e.attributes.name).match(/^(og|twitter):/)||z(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(z(e.attributes.name)==="robots"||z(e.attributes.name)==="googlebot"||z(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(z(e.attributes.name)==="author"||z(e.attributes.name)==="generator"||z(e.attributes.name)==="framework"||z(e.attributes.name)==="publisher"||z(e.attributes.name)==="progid"||z(e.attributes.property).match(/^article:/)||z(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(z(e.attributes.name)==="google-site-verification"||z(e.attributes.name)==="yandex-verification"||z(e.attributes.name)==="csrf-token"||z(e.attributes.name)==="p:domain_verify"||z(e.attributes.name)==="verify-v1"||z(e.attributes.name)==="verification"||z(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ae(e,t){let{doc:s,mirror:a,blockClass:r,blockSelector:c,maskTextClass:f,maskTextSelector:m,skipChild:l=!1,inlineStylesheet:d=!0,maskInputOptions:i={},maskTextFn:h,maskInputFn:o,slimDOMOptions:n,dataURLOptions:p={},inlineImages:u=!1,recordCanvas:g=!1,onSerialize:v,onIframeLoad:S,iframeLoadTimeout:b=5e3,onStylesheetLoad:E,stylesheetLoadTimeout:w=5e3,keepIframeSrcFn:y=()=>!1,newlyAddedElement:C=!1,cssCaptured:M=!1}=t,{needsMask:O}=t,{preserveWhiteSpace:R=!0}=t;O||(O=Li(e,f,m,O===void 0));let D=Eo(e,{doc:s,mirror:a,blockClass:r,blockSelector:c,needsMask:O,inlineStylesheet:d,maskInputOptions:i,maskTextFn:h,maskInputFn:o,dataURLOptions:p,inlineImages:u,recordCanvas:g,keepIframeSrcFn:y,newlyAddedElement:C,cssCaptured:M});if(!D)return console.warn(e,"not serialized"),null;let A;a.hasNode(e)?A=a.getId(e):No(D,n)||!R&&D.type===J.Text&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?A=it:A=_i();let x=Object.assign(D,{id:A});if(a.add(e,x),A===it)return null;v&&v(e);let ue=!l;if(x.type===J.Element){ue=ue&&!x.needBlock,delete x.needBlock;let U=Z.shadowRoot(e);U&&Le(U)&&(x.isShadowHost=!0)}if((x.type===J.Document||x.type===J.Element)&&ue){n.headWhitespace&&x.type===J.Element&&x.tagName==="head"&&(R=!1);let U={doc:s,mirror:a,blockClass:r,blockSelector:c,needsMask:O,maskTextClass:f,maskTextSelector:m,skipChild:l,inlineStylesheet:d,maskInputOptions:i,maskTextFn:h,maskInputFn:o,slimDOMOptions:n,dataURLOptions:p,inlineImages:u,recordCanvas:g,preserveWhiteSpace:R,onSerialize:v,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:E,stylesheetLoadTimeout:w,keepIframeSrcFn:y,cssCaptured:!1};if(!(x.type===J.Element&&x.tagName==="textarea"&&x.attributes.value!==void 0)){x.type===J.Element&&x.attributes._cssText!==void 0&&typeof x.attributes._cssText=="string"&&(U.cssCaptured=!0);for(let H of Array.from(Z.childNodes(e))){let Q=Ae(H,U);Q&&x.childNodes.push(Q)}}let F=null;if(Ai(e)&&(F=Z.shadowRoot(e)))for(let H of Array.from(Z.childNodes(F))){let Q=Ae(H,U);Q&&(Le(F)&&(Q.isShadow=!0),x.childNodes.push(Q))}}let se=Z.parentNode(e);return se&&Pe(se)&&Le(se)&&(x.isShadow=!0),x.type===J.Element&&x.tagName==="iframe"&&vo(e,()=>{let U=e.contentDocument;if(U&&S){let F=Ae(U,{doc:U,mirror:a,blockClass:r,blockSelector:c,needsMask:O,maskTextClass:f,maskTextSelector:m,skipChild:!1,inlineStylesheet:d,maskInputOptions:i,maskTextFn:h,maskInputFn:o,slimDOMOptions:n,dataURLOptions:p,inlineImages:u,recordCanvas:g,preserveWhiteSpace:R,onSerialize:v,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:E,stylesheetLoadTimeout:w,keepIframeSrcFn:y});F&&S(e,F)}},b),x.type===J.Element&&x.tagName==="link"&&typeof x.attributes.rel=="string"&&(x.attributes.rel==="stylesheet"||x.attributes.rel==="preload"&&typeof x.attributes.href=="string"&&Ti(x.attributes.href)==="css")&&Co(e,()=>{if(E){let U=Ae(e,{doc:s,mirror:a,blockClass:r,blockSelector:c,needsMask:O,maskTextClass:f,maskTextSelector:m,skipChild:!1,inlineStylesheet:d,maskInputOptions:i,maskTextFn:h,maskInputFn:o,slimDOMOptions:n,dataURLOptions:p,inlineImages:u,recordCanvas:g,preserveWhiteSpace:R,onSerialize:v,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:E,stylesheetLoadTimeout:w,keepIframeSrcFn:y});U&&E(e,U)}},w),x}function Oo(e,t){let{mirror:s=new et,blockClass:a="rr-block",blockSelector:r=null,maskTextClass:c="rr-mask",maskTextSelector:f=null,inlineStylesheet:m=!0,inlineImages:l=!1,recordCanvas:d=!1,maskAllInputs:i=!1,maskTextFn:h,maskInputFn:o,slimDOM:n=!1,dataURLOptions:p,preserveWhiteSpace:u,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:S,onStylesheetLoad:b,stylesheetLoadTimeout:E,keepIframeSrcFn:w=()=>!1}=t,y=i===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:i===!1?{password:!0}:i,C=Fi(n);return Ae(e,{doc:e,mirror:s,blockClass:a,blockSelector:r,maskTextClass:c,maskTextSelector:f,skipChild:!1,inlineStylesheet:m,maskInputOptions:y,maskTextFn:h,maskInputFn:o,slimDOMOptions:C,dataURLOptions:p,inlineImages:l,recordCanvas:d,preserveWhiteSpace:u,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:S,onStylesheetLoad:b,stylesheetLoadTimeout:E,keepIframeSrcFn:w,newlyAddedElement:!1})}var Io=/(max|min)-device-(width|height)/,al=new RegExp(Io.source,"g");function Ao(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Do(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var s=function a(){return this instanceof a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(s,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}),s}var je={exports:{}},fs;function To(){if(fs)return je.exports;fs=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return je.exports=t(),je.exports.createColors=t,je.exports}var _o={},ko=Object.freeze(Object.defineProperty({__proto__:null,default:_o},Symbol.toStringTag,{value:"Module"})),fe=Do(ko),Mt,ds;function qr(){if(ds)return Mt;ds=1;let e=To(),t=fe;class s extends Error{constructor(r,c,f,m,l,d){super(r),this.name="CssSyntaxError",this.reason=r,l&&(this.file=l),m&&(this.source=m),d&&(this.plugin=d),typeof c<"u"&&typeof f<"u"&&(typeof c=="number"?(this.line=c,this.column=f):(this.line=c.line,this.column=c.column,this.endLine=f.line,this.endColumn=f.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let c=this.source;r==null&&(r=e.isColorSupported),t&&r&&(c=t(c));let f=c.split(/\r?\n/),m=Math.max(this.line-3,0),l=Math.min(this.line+2,f.length),d=String(l).length,i,h;if(r){let{bold:o,gray:n,red:p}=e.createColors(!0);i=u=>o(p(u)),h=u=>n(u)}else i=h=o=>o;return f.slice(m,l).map((o,n)=>{let p=m+1+n,u=" "+(" "+p).slice(-d)+" | ";if(p===this.line){let g=h(u.replace(/\d/g," "))+o.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+h(u)+o+`
|
|
2
|
+
`+g+i("^")}return" "+h(u)+o}).join(`
|
|
3
|
+
`)}toString(){let r=this.showSourceCode();return r&&(r=`
|
|
4
|
+
|
|
5
|
+
`+r+`
|
|
6
|
+
`),this.name+": "+this.message+r}}return Mt=s,s.default=s,Mt}var Ge={},ps;function Vr(){return ps||(ps=1,Ge.isClean=Symbol("isClean"),Ge.my=Symbol("my")),Ge}var Rt,ms;function Ui(){if(ms)return Rt;ms=1;let e={after:`
|
|
7
|
+
`,beforeClose:`
|
|
8
|
+
`,beforeComment:`
|
|
9
|
+
`,beforeDecl:`
|
|
10
|
+
`,beforeOpen:" ",beforeRule:`
|
|
11
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(a){return a[0].toUpperCase()+a.slice(1)}class s{constructor(r){this.builder=r}atrule(r,c){let f="@"+r.name,m=r.params?this.rawValue(r,"params"):"";if(typeof r.raws.afterName<"u"?f+=r.raws.afterName:m&&(f+=" "),r.nodes)this.block(r,f+m);else{let l=(r.raws.between||"")+(c?";":"");this.builder(f+m+l,r)}}beforeAfter(r,c){let f;r.type==="decl"?f=this.raw(r,null,"beforeDecl"):r.type==="comment"?f=this.raw(r,null,"beforeComment"):c==="before"?f=this.raw(r,null,"beforeRule"):f=this.raw(r,null,"beforeClose");let m=r.parent,l=0;for(;m&&m.type!=="root";)l+=1,m=m.parent;if(f.includes(`
|
|
12
|
+
`)){let d=this.raw(r,null,"indent");if(d.length)for(let i=0;i<l;i++)f+=d}return f}block(r,c){let f=this.raw(r,"between","beforeOpen");this.builder(c+f+"{",r,"start");let m;r.nodes&&r.nodes.length?(this.body(r),m=this.raw(r,"after")):m=this.raw(r,"after","emptyBody"),m&&this.builder(m),this.builder("}",r,"end")}body(r){let c=r.nodes.length-1;for(;c>0&&r.nodes[c].type==="comment";)c-=1;let f=this.raw(r,"semicolon");for(let m=0;m<r.nodes.length;m++){let l=r.nodes[m],d=this.raw(l,"before");d&&this.builder(d),this.stringify(l,c!==m||f)}}comment(r){let c=this.raw(r,"left","commentLeft"),f=this.raw(r,"right","commentRight");this.builder("/*"+c+r.text+f+"*/",r)}decl(r,c){let f=this.raw(r,"between","colon"),m=r.prop+f+this.rawValue(r,"value");r.important&&(m+=r.raws.important||" !important"),c&&(m+=";"),this.builder(m,r)}document(r){this.body(r)}raw(r,c,f){let m;if(f||(f=c),c&&(m=r.raws[c],typeof m<"u"))return m;let l=r.parent;if(f==="before"&&(!l||l.type==="root"&&l.first===r||l&&l.type==="document"))return"";if(!l)return e[f];let d=r.root();if(d.rawCache||(d.rawCache={}),typeof d.rawCache[f]<"u")return d.rawCache[f];if(f==="before"||f==="after")return this.beforeAfter(r,f);{let i="raw"+t(f);this[i]?m=this[i](d,r):d.walk(h=>{if(m=h.raws[c],typeof m<"u")return!1})}return typeof m>"u"&&(m=e[f]),d.rawCache[f]=m,m}rawBeforeClose(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length>0&&typeof f.raws.after<"u")return c=f.raws.after,c.includes(`
|
|
13
|
+
`)&&(c=c.replace(/[^\n]+$/,"")),!1}),c&&(c=c.replace(/\S/g,"")),c}rawBeforeComment(r,c){let f;return r.walkComments(m=>{if(typeof m.raws.before<"u")return f=m.raws.before,f.includes(`
|
|
14
|
+
`)&&(f=f.replace(/[^\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(c,null,"beforeDecl"):f&&(f=f.replace(/\S/g,"")),f}rawBeforeDecl(r,c){let f;return r.walkDecls(m=>{if(typeof m.raws.before<"u")return f=m.raws.before,f.includes(`
|
|
15
|
+
`)&&(f=f.replace(/[^\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(c,null,"beforeRule"):f&&(f=f.replace(/\S/g,"")),f}rawBeforeOpen(r){let c;return r.walk(f=>{if(f.type!=="decl"&&(c=f.raws.between,typeof c<"u"))return!1}),c}rawBeforeRule(r){let c;return r.walk(f=>{if(f.nodes&&(f.parent!==r||r.first!==f)&&typeof f.raws.before<"u")return c=f.raws.before,c.includes(`
|
|
16
|
+
`)&&(c=c.replace(/[^\n]+$/,"")),!1}),c&&(c=c.replace(/\S/g,"")),c}rawColon(r){let c;return r.walkDecls(f=>{if(typeof f.raws.between<"u")return c=f.raws.between.replace(/[^\s:]/g,""),!1}),c}rawEmptyBody(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length===0&&(c=f.raws.after,typeof c<"u"))return!1}),c}rawIndent(r){if(r.raws.indent)return r.raws.indent;let c;return r.walk(f=>{let m=f.parent;if(m&&m!==r&&m.parent&&m.parent===r&&typeof f.raws.before<"u"){let l=f.raws.before.split(`
|
|
17
|
+
`);return c=l[l.length-1],c=c.replace(/\S/g,""),!1}}),c}rawSemicolon(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length&&f.last.type==="decl"&&(c=f.raws.semicolon,typeof c<"u"))return!1}),c}rawValue(r,c){let f=r[c],m=r.raws[c];return m&&m.value===f?m.raw:f}root(r){this.body(r),r.raws.after&&this.builder(r.raws.after)}rule(r){this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon&&this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,c){if(!this[r.type])throw new Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,c)}}return Rt=s,s.default=s,Rt}var Nt,gs;function ut(){if(gs)return Nt;gs=1;let e=Ui();function t(s,a){new e(a).stringify(s)}return Nt=t,t.default=t,Nt}var Ot,ys;function ct(){if(ys)return Ot;ys=1;let{isClean:e,my:t}=Vr(),s=qr(),a=Ui(),r=ut();function c(m,l){let d=new m.constructor;for(let i in m){if(!Object.prototype.hasOwnProperty.call(m,i)||i==="proxyCache")continue;let h=m[i],o=typeof h;i==="parent"&&o==="object"?l&&(d[i]=l):i==="source"?d[i]=h:Array.isArray(h)?d[i]=h.map(n=>c(n,d)):(o==="object"&&h!==null&&(h=c(h)),d[i]=h)}return d}class f{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let d in l)if(d==="nodes"){this.nodes=[];for(let i of l[d])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[d]=l[d]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\n\s{4}at /.test(l.stack)){let d=this.source;l.stack=l.stack.replace(/\n\s{4}at /,`$&${d.input.from}:${d.start.line}:${d.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let d in l)this[d]=l[d];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){delete this.raws.before,delete this.raws.after,l||delete this.raws.between}clone(l={}){let d=c(this);for(let i in l)d[i]=l[i];return d}cloneAfter(l={}){let d=this.clone(l);return this.parent.insertAfter(this,d),d}cloneBefore(l={}){let d=this.clone(l);return this.parent.insertBefore(this,d),d}error(l,d={}){if(this.source){let{end:i,start:h}=this.rangeBy(d);return this.source.input.error(l,{column:h.column,line:h.line},{column:i.column,line:i.line},d)}return new s(l)}getProxyProcessor(){return{get(l,d){return d==="proxyOf"?l:d==="root"?()=>l.root().toProxy():l[d]},set(l,d,i){return l[d]===i||(l[d]=i,(d==="prop"||d==="value"||d==="name"||d==="params"||d==="important"||d==="text")&&l.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let l=this;for(;l=l.parent;)l[e]=!1}}next(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l+1]}positionBy(l,d){let i=this.source.start;if(l.index)i=this.positionInside(l.index,d);else if(l.word){d=this.toString();let h=d.indexOf(l.word);h!==-1&&(i=this.positionInside(h,d))}return i}positionInside(l,d){let i=d||this.toString(),h=this.source.start.column,o=this.source.start.line;for(let n=0;n<l;n++)i[n]===`
|
|
18
|
+
`?(h=1,o+=1):h+=1;return{column:h,line:o}}prev(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l-1]}rangeBy(l){let d={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:d.column+1,line:d.line};if(l.word){let h=this.toString(),o=h.indexOf(l.word);o!==-1&&(d=this.positionInside(o,h),i=this.positionInside(o+l.word.length,h))}else l.start?d={column:l.start.column,line:l.start.line}:l.index&&(d=this.positionInside(l.index)),l.end?i={column:l.end.column,line:l.end.line}:typeof l.endIndex=="number"?i=this.positionInside(l.endIndex):l.index&&(i=this.positionInside(l.index+1));return(i.line<d.line||i.line===d.line&&i.column<=d.column)&&(i={column:d.column+1,line:d.line}),{end:i,start:d}}raw(l,d){return new a().raw(this,l,d)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...l){if(this.parent){let d=this,i=!1;for(let h of l)h===this?i=!0:i?(this.parent.insertAfter(d,h),d=h):this.parent.insertBefore(d,h);i||this.remove()}return this}root(){let l=this;for(;l.parent&&l.parent.type!=="document";)l=l.parent;return l}toJSON(l,d){let i={},h=d==null;d=d||new Map;let o=0;for(let n in this){if(!Object.prototype.hasOwnProperty.call(this,n)||n==="parent"||n==="proxyCache")continue;let p=this[n];if(Array.isArray(p))i[n]=p.map(u=>typeof u=="object"&&u.toJSON?u.toJSON(null,d):u);else if(typeof p=="object"&&p.toJSON)i[n]=p.toJSON(null,d);else if(n==="source"){let u=d.get(p.input);u==null&&(u=o,d.set(p.input,o),o++),i[n]={end:p.end,inputId:u,start:p.start}}else i[n]=p}return h&&(i.inputs=[...d.keys()].map(n=>n.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(l=r){l.stringify&&(l=l.stringify);let d="";return l(this,i=>{d+=i}),d}warn(l,d,i){let h={node:this};for(let o in i)h[o]=i[o];return l.warn(d,h)}get proxyOf(){return this}}return Ot=f,f.default=f,Ot}var It,ws;function ht(){if(ws)return It;ws=1;let e=ct();class t extends e{constructor(a){a&&typeof a.value<"u"&&typeof a.value!="string"&&(a={...a,value:String(a.value)}),super(a),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return It=t,t.default=t,It}var At,bs;function Po(){if(bs)return At;bs=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return At={nanoid:(a=21)=>{let r="",c=a;for(;c--;)r+=e[Math.random()*64|0];return r},customAlphabet:(a,r=21)=>(c=r)=>{let f="",m=c;for(;m--;)f+=a[Math.random()*a.length|0];return f}},At}var Dt,Ss;function Bi(){if(Ss)return Dt;Ss=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=fe,{existsSync:s,readFileSync:a}=fe,{dirname:r,join:c}=fe;function f(l){return Buffer?Buffer.from(l,"base64").toString():window.atob(l)}class m{constructor(d,i){if(i.map===!1)return;this.loadAnnotation(d),this.inline=this.startWith(this.annotation,"data:");let h=i.map?i.map.prev:void 0,o=this.loadMap(i.from,h);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=r(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(d){let i=/^data:application\/json;charset=utf-?8;base64,/,h=/^data:application\/json;base64,/,o=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(o.test(d)||n.test(d))return decodeURIComponent(d.substr(RegExp.lastMatch.length));if(i.test(d)||h.test(d))return f(d.substr(RegExp.lastMatch.length));let p=d.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+p)}getAnnotationURL(d){return d.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(d){return typeof d!="object"?!1:typeof d.mappings=="string"||typeof d._mappings=="string"||Array.isArray(d.sections)}loadAnnotation(d){let i=d.match(/\/\*\s*# sourceMappingURL=/gm);if(!i)return;let h=d.lastIndexOf(i.pop()),o=d.indexOf("*/",h);h>-1&&o>-1&&(this.annotation=this.getAnnotationURL(d.substring(h,o)))}loadFile(d){if(this.root=r(d),s(d))return this.mapFile=d,a(d,"utf-8").toString().trim()}loadMap(d,i){if(i===!1)return!1;if(i){if(typeof i=="string")return i;if(typeof i=="function"){let h=i(d);if(h){let o=this.loadFile(h);if(!o)throw new Error("Unable to load previous source map: "+h.toString());return o}}else{if(i instanceof e)return t.fromSourceMap(i).toString();if(i instanceof t)return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let h=this.annotation;return d&&(h=c(r(d),h)),this.loadFile(h)}}}startWith(d,i){return d?d.substr(0,i.length)===i:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Dt=m,m.default=m,Dt}var Tt,vs;function ft(){if(vs)return Tt;vs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=fe,{fileURLToPath:s,pathToFileURL:a}=fe,{isAbsolute:r,resolve:c}=fe,{nanoid:f}=Po(),m=fe,l=qr(),d=Bi(),i=Symbol("fromOffsetCache"),h=!!(e&&t),o=!!(c&&r);class n{constructor(u,g={}){if(u===null||typeof u>"u"||typeof u=="object"&&!u.toString)throw new Error(`PostCSS received ${u} instead of CSS string`);if(this.css=u.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!o||/^\w+:\/\//.test(g.from)||r(g.from)?this.file=g.from:this.file=c(g.from)),o&&h){let v=new d(this.css,g);if(v.text){this.map=v;let S=v.consumer().file;!this.file&&S&&(this.file=this.mapResolve(S))}}this.file||(this.id="<input css "+f(6)+">"),this.map&&(this.map.file=this.from)}error(u,g,v,S={}){let b,E,w;if(g&&typeof g=="object"){let C=g,M=v;if(typeof C.offset=="number"){let O=this.fromOffset(C.offset);g=O.line,v=O.col}else g=C.line,v=C.column;if(typeof M.offset=="number"){let O=this.fromOffset(M.offset);E=O.line,w=O.col}else E=M.line,w=M.column}else if(!v){let C=this.fromOffset(g);g=C.line,v=C.col}let y=this.origin(g,v,E,w);return y?b=new l(u,y.endLine===void 0?y.line:{column:y.column,line:y.line},y.endLine===void 0?y.column:{column:y.endColumn,line:y.endLine},y.source,y.file,S.plugin):b=new l(u,E===void 0?g:{column:v,line:g},E===void 0?v:{column:w,line:E},this.css,this.file,S.plugin),b.input={column:v,endColumn:w,endLine:E,line:g,source:this.css},this.file&&(a&&(b.input.url=a(this.file).toString()),b.input.file=this.file),b}fromOffset(u){let g,v;if(this[i])v=this[i];else{let b=this.css.split(`
|
|
19
|
+
`);v=new Array(b.length);let E=0;for(let w=0,y=b.length;w<y;w++)v[w]=E,E+=b[w].length+1;this[i]=v}g=v[v.length-1];let S=0;if(u>=g)S=v.length-1;else{let b=v.length-2,E;for(;S<b;)if(E=S+(b-S>>1),u<v[E])b=E-1;else if(u>=v[E+1])S=E+1;else{S=E;break}}return{col:u-v[S]+1,line:S+1}}mapResolve(u){return/^\w+:\/\//.test(u)?u:c(this.map.consumer().sourceRoot||this.map.root||".",u)}origin(u,g,v,S){if(!this.map)return!1;let b=this.map.consumer(),E=b.originalPositionFor({column:g,line:u});if(!E.source)return!1;let w;typeof v=="number"&&(w=b.originalPositionFor({column:S,line:v}));let y;r(E.source)?y=a(E.source):y=new URL(E.source,this.map.consumer().sourceRoot||a(this.map.mapFile));let C={column:E.column,endColumn:w&&w.column,endLine:w&&w.line,line:E.line,url:y.toString()};if(y.protocol==="file:")if(s)C.file=s(y);else throw new Error("file: protocol is not available in this PostCSS build");let M=b.sourceContentFor(E.source);return M&&(C.source=M),C}toJSON(){let u={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(u[g]=this[g]);return this.map&&(u.map={...this.map},u.map.consumerCache&&(u.map.consumerCache=void 0)),u}get from(){return this.file||this.id}}return Tt=n,n.default=n,m&&m.registerInput&&m.registerInput(n),Tt}var _t,Cs;function $i(){if(Cs)return _t;Cs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=fe,{dirname:s,relative:a,resolve:r,sep:c}=fe,{pathToFileURL:f}=fe,m=ft(),l=!!(e&&t),d=!!(s&&r&&a&&c);class i{constructor(o,n,p,u){this.stringify=o,this.mapOpts=p.map||{},this.root=n,this.opts=p,this.css=u,this.originalCSS=u,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let o;this.isInline()?o="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?o=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?o=this.mapOpts.annotation(this.opts.to,this.root):o=this.outputFile()+".map";let n=`
|
|
20
|
+
`;this.css.includes(`\r
|
|
21
|
+
`)&&(n=`\r
|
|
22
|
+
`),this.css+=n+"/*# sourceMappingURL="+o+" */"}applyPrevMaps(){for(let o of this.previous()){let n=this.toUrl(this.path(o.file)),p=o.root||s(o.file),u;this.mapOpts.sourcesContent===!1?(u=new e(o.text),u.sourcesContent&&(u.sourcesContent=null)):u=o.consumer(),this.map.applySourceMap(u,n,this.toUrl(this.path(p)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let o;for(let n=this.root.nodes.length-1;n>=0;n--)o=this.root.nodes[n],o.type==="comment"&&o.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),d&&l&&this.isMap())return this.generateMap();{let o="";return this.stringify(this.root,n=>{o+=n}),[o]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let o=this.previous()[0].consumer();o.file=this.outputFile(),this.map=t.fromSourceMap(o,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let o=1,n=1,p="<no source>",u={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,v;this.stringify(this.root,(S,b,E)=>{if(this.css+=S,b&&E!=="end"&&(u.generated.line=o,u.generated.column=n-1,b.source&&b.source.start?(u.source=this.sourcePath(b),u.original.line=b.source.start.line,u.original.column=b.source.start.column-1,this.map.addMapping(u)):(u.source=p,u.original.line=1,u.original.column=0,this.map.addMapping(u))),g=S.match(/\n/g),g?(o+=g.length,v=S.lastIndexOf(`
|
|
23
|
+
`),n=S.length-v):n+=S.length,b&&E!=="start"){let w=b.parent||{raws:{}};(!(b.type==="decl"||b.type==="atrule"&&!b.nodes)||b!==w.last||w.raws.semicolon)&&(b.source&&b.source.end?(u.source=this.sourcePath(b),u.original.line=b.source.end.line,u.original.column=b.source.end.column-1,u.generated.line=o,u.generated.column=n-2,this.map.addMapping(u)):(u.source=p,u.original.line=1,u.original.column=0,u.generated.line=o,u.generated.column=n-1,this.map.addMapping(u)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(o=>o.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let o=this.mapOpts.annotation;return typeof o<"u"&&o!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(o=>o.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(o){if(this.mapOpts.absolute||o.charCodeAt(0)===60||/^\w+:\/\//.test(o))return o;let n=this.memoizedPaths.get(o);if(n)return n;let p=this.opts.to?s(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(p=s(r(p,this.mapOpts.annotation)));let u=a(p,o);return this.memoizedPaths.set(o,u),u}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(o=>{if(o.source&&o.source.input.map){let n=o.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let o=new m(this.originalCSS,this.opts);o.map&&this.previousMaps.push(o.map)}return this.previousMaps}setSourcesContent(){let o={};if(this.root)this.root.walk(n=>{if(n.source){let p=n.source.input.from;if(p&&!o[p]){o[p]=!0;let u=this.usesFileUrls?this.toFileUrl(p):this.toUrl(this.path(p));this.map.setSourceContent(u,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(o){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(o.source.input.from):this.toUrl(this.path(o.source.input.from))}toBase64(o){return Buffer?Buffer.from(o).toString("base64"):window.btoa(unescape(encodeURIComponent(o)))}toFileUrl(o){let n=this.memoizedFileURLs.get(o);if(n)return n;if(f){let p=f(o).toString();return this.memoizedFileURLs.set(o,p),p}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(o){let n=this.memoizedURLs.get(o);if(n)return n;c==="\\"&&(o=o.replace(/\\/g,"/"));let p=encodeURI(o).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(o,p),p}}return _t=i,_t}var kt,Es;function dt(){if(Es)return kt;Es=1;let e=ct();class t extends e{constructor(a){super(a),this.type="comment"}}return kt=t,t.default=t,kt}var Pt,xs;function Ee(){if(xs)return Pt;xs=1;let{isClean:e,my:t}=Vr(),s=ht(),a=dt(),r=ct(),c,f,m,l;function d(o){return o.map(n=>(n.nodes&&(n.nodes=d(n.nodes)),delete n.source,n))}function i(o){if(o[e]=!1,o.proxyOf.nodes)for(let n of o.proxyOf.nodes)i(n)}class h extends r{append(...n){for(let p of n){let u=this.normalize(p,this.last);for(let g of u)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(n){if(super.cleanRaws(n),this.nodes)for(let p of this.nodes)p.cleanRaws(n)}each(n){if(!this.proxyOf.nodes)return;let p=this.getIterator(),u,g;for(;this.indexes[p]<this.proxyOf.nodes.length&&(u=this.indexes[p],g=n(this.proxyOf.nodes[u],u),g!==!1);)this.indexes[p]+=1;return delete this.indexes[p],g}every(n){return this.nodes.every(n)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let n=this.lastEach;return this.indexes[n]=0,n}getProxyProcessor(){return{get(n,p){return p==="proxyOf"?n:n[p]?p==="each"||typeof p=="string"&&p.startsWith("walk")?(...u)=>n[p](...u.map(g=>typeof g=="function"?(v,S)=>g(v.toProxy(),S):g)):p==="every"||p==="some"?u=>n[p]((g,...v)=>u(g.toProxy(),...v)):p==="root"?()=>n.root().toProxy():p==="nodes"?n.nodes.map(u=>u.toProxy()):p==="first"||p==="last"?n[p].toProxy():n[p]:n[p]},set(n,p,u){return n[p]===u||(n[p]=u,(p==="name"||p==="params"||p==="selector")&&n.markDirty()),!0}}}index(n){return typeof n=="number"?n:(n.proxyOf&&(n=n.proxyOf),this.proxyOf.nodes.indexOf(n))}insertAfter(n,p){let u=this.index(n),g=this.normalize(p,this.proxyOf.nodes[u]).reverse();u=this.index(n);for(let S of g)this.proxyOf.nodes.splice(u+1,0,S);let v;for(let S in this.indexes)v=this.indexes[S],u<v&&(this.indexes[S]=v+g.length);return this.markDirty(),this}insertBefore(n,p){let u=this.index(n),g=u===0?"prepend":!1,v=this.normalize(p,this.proxyOf.nodes[u],g).reverse();u=this.index(n);for(let b of v)this.proxyOf.nodes.splice(u,0,b);let S;for(let b in this.indexes)S=this.indexes[b],u<=S&&(this.indexes[b]=S+v.length);return this.markDirty(),this}normalize(n,p){if(typeof n=="string")n=d(c(n).nodes);else if(typeof n>"u")n=[];else if(Array.isArray(n)){n=n.slice(0);for(let g of n)g.parent&&g.parent.removeChild(g,"ignore")}else if(n.type==="root"&&this.type!=="document"){n=n.nodes.slice(0);for(let g of n)g.parent&&g.parent.removeChild(g,"ignore")}else if(n.type)n=[n];else if(n.prop){if(typeof n.value>"u")throw new Error("Value field is missed in node creation");typeof n.value!="string"&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new f(n)];else if(n.name)n=[new m(n)];else if(n.text)n=[new a(n)];else throw new Error("Unknown node type in node creation");return n.map(g=>(g[t]||h.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&i(g),typeof g.raws.before>"u"&&p&&typeof p.raws.before<"u"&&(g.raws.before=p.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...n){n=n.reverse();for(let p of n){let u=this.normalize(p,this.first,"prepend").reverse();for(let g of u)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+u.length}return this.markDirty(),this}push(n){return n.parent=this,this.proxyOf.nodes.push(n),this}removeAll(){for(let n of this.proxyOf.nodes)n.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(n){n=this.index(n),this.proxyOf.nodes[n].parent=void 0,this.proxyOf.nodes.splice(n,1);let p;for(let u in this.indexes)p=this.indexes[u],p>=n&&(this.indexes[u]=p-1);return this.markDirty(),this}replaceValues(n,p,u){return u||(u=p,p={}),this.walkDecls(g=>{p.props&&!p.props.includes(g.prop)||p.fast&&!g.value.includes(p.fast)||(g.value=g.value.replace(n,u))}),this.markDirty(),this}some(n){return this.nodes.some(n)}walk(n){return this.each((p,u)=>{let g;try{g=n(p,u)}catch(v){throw p.addToError(v)}return g!==!1&&p.walk&&(g=p.walk(n)),g})}walkAtRules(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="atrule"&&n.test(u.name))return p(u,g)}):this.walk((u,g)=>{if(u.type==="atrule"&&u.name===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="atrule")return p(u,g)}))}walkComments(n){return this.walk((p,u)=>{if(p.type==="comment")return n(p,u)})}walkDecls(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="decl"&&n.test(u.prop))return p(u,g)}):this.walk((u,g)=>{if(u.type==="decl"&&u.prop===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="decl")return p(u,g)}))}walkRules(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="rule"&&n.test(u.selector))return p(u,g)}):this.walk((u,g)=>{if(u.type==="rule"&&u.selector===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="rule")return p(u,g)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return h.registerParse=o=>{c=o},h.registerRule=o=>{f=o},h.registerAtRule=o=>{m=o},h.registerRoot=o=>{l=o},Pt=h,h.default=h,h.rebuild=o=>{o.type==="atrule"?Object.setPrototypeOf(o,m.prototype):o.type==="rule"?Object.setPrototypeOf(o,f.prototype):o.type==="decl"?Object.setPrototypeOf(o,s.prototype):o.type==="comment"?Object.setPrototypeOf(o,a.prototype):o.type==="root"&&Object.setPrototypeOf(o,l.prototype),o[t]=!0,o.nodes&&o.nodes.forEach(n=>{h.rebuild(n)})},Pt}var Lt,Ms;function jr(){if(Ms)return Lt;Ms=1;let e=Ee(),t,s;class a extends e{constructor(c){super({type:"document",...c}),this.nodes||(this.nodes=[])}toResult(c={}){return new t(new s,this,c).stringify()}}return a.registerLazyResult=r=>{t=r},a.registerProcessor=r=>{s=r},Lt=a,a.default=a,Lt}var Ft,Rs;function Wi(){if(Rs)return Ft;Rs=1;let e={};return Ft=function(s){e[s]||(e[s]=!0,typeof console<"u"&&console.warn&&console.warn(s))},Ft}var Ut,Ns;function zi(){if(Ns)return Ut;Ns=1;class e{constructor(s,a={}){if(this.type="warning",this.text=s,a.node&&a.node.source){let r=a.node.rangeBy(a);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in a)this[r]=a[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return Ut=e,e.default=e,Ut}var Bt,Os;function Gr(){if(Os)return Bt;Os=1;let e=zi();class t{constructor(a,r,c){this.processor=a,this.messages=[],this.root=r,this.opts=c,this.css=void 0,this.map=void 0}toString(){return this.css}warn(a,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let c=new e(a,r);return this.messages.push(c),c}warnings(){return this.messages.filter(a=>a.type==="warning")}get content(){return this.css}}return Bt=t,t.default=t,Bt}var $t,Is;function Lo(){if(Is)return $t;Is=1;let e=39,t=34,s=92,a=47,r=10,c=32,f=12,m=9,l=13,d=91,i=93,h=40,o=41,n=123,p=125,u=59,g=42,v=58,S=64,b=/[\t\n\f\r "#'()/;[\\\]{}]/g,E=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,w=/.[\r\n"'(/\\]/,y=/[\da-f]/i;return $t=function(M,O={}){let R=M.css.valueOf(),D=O.ignoreErrors,A,x,ue,se,U,F,H,Q,Y,B,ye=R.length,N=0,pe=[],ae=[];function _e(){return N}function K(T){throw M.error("Unclosed "+T,N)}function ce(){return ae.length===0&&N>=ye}function ve(T){if(ae.length)return ae.pop();if(N>=ye)return;let X=T?T.ignoreUnclosed:!1;switch(A=R.charCodeAt(N),A){case r:case c:case m:case l:case f:{x=N;do x+=1,A=R.charCodeAt(x);while(A===c||A===r||A===m||A===l||A===f);B=["space",R.slice(N,x)],N=x-1;break}case d:case i:case n:case p:case v:case u:case o:{let $=String.fromCharCode(A);B=[$,$,N];break}case h:{if(Q=pe.length?pe.pop()[1]:"",Y=R.charCodeAt(N+1),Q==="url"&&Y!==e&&Y!==t&&Y!==c&&Y!==r&&Y!==m&&Y!==f&&Y!==l){x=N;do{if(F=!1,x=R.indexOf(")",x+1),x===-1)if(D||X){x=N;break}else K("bracket");for(H=x;R.charCodeAt(H-1)===s;)H-=1,F=!F}while(F);B=["brackets",R.slice(N,x+1),N,x],N=x}else x=R.indexOf(")",N+1),se=R.slice(N,x+1),x===-1||w.test(se)?B=["(","(",N]:(B=["brackets",se,N,x],N=x);break}case e:case t:{ue=A===e?"'":'"',x=N;do{if(F=!1,x=R.indexOf(ue,x+1),x===-1)if(D||X){x=N+1;break}else K("string");for(H=x;R.charCodeAt(H-1)===s;)H-=1,F=!F}while(F);B=["string",R.slice(N,x+1),N,x],N=x;break}case S:{b.lastIndex=N+1,b.test(R),b.lastIndex===0?x=R.length-1:x=b.lastIndex-2,B=["at-word",R.slice(N,x+1),N,x],N=x;break}case s:{for(x=N,U=!0;R.charCodeAt(x+1)===s;)x+=1,U=!U;if(A=R.charCodeAt(x+1),U&&A!==a&&A!==c&&A!==r&&A!==m&&A!==l&&A!==f&&(x+=1,y.test(R.charAt(x)))){for(;y.test(R.charAt(x+1));)x+=1;R.charCodeAt(x+1)===c&&(x+=1)}B=["word",R.slice(N,x+1),N,x],N=x;break}default:{A===a&&R.charCodeAt(N+1)===g?(x=R.indexOf("*/",N+2)+1,x===0&&(D||X?x=R.length:K("comment")),B=["comment",R.slice(N,x+1),N,x],N=x):(E.lastIndex=N+1,E.test(R),E.lastIndex===0?x=R.length-1:x=E.lastIndex-2,B=["word",R.slice(N,x+1),N,x],pe.push(B),N=x);break}}return N++,B}function we(T){ae.push(T)}return{back:we,endOfFile:ce,nextToken:ve,position:_e}},$t}var Wt,As;function Hr(){if(As)return Wt;As=1;let e=Ee();class t extends e{constructor(a){super(a),this.type="atrule"}append(...a){return this.proxyOf.nodes||(this.nodes=[]),super.append(...a)}prepend(...a){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...a)}}return Wt=t,t.default=t,e.registerAtRule(t),Wt}var zt,Ds;function $e(){if(Ds)return zt;Ds=1;let e=Ee(),t,s;class a extends e{constructor(c){super(c),this.type="root",this.nodes||(this.nodes=[])}normalize(c,f,m){let l=super.normalize(c);if(f){if(m==="prepend")this.nodes.length>1?f.raws.before=this.nodes[1].raws.before:delete f.raws.before;else if(this.first!==f)for(let d of l)d.raws.before=f.raws.before}return l}removeChild(c,f){let m=this.index(c);return!f&&m===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[m].raws.before),super.removeChild(c)}toResult(c={}){return new t(new s,this,c).stringify()}}return a.registerLazyResult=r=>{t=r},a.registerProcessor=r=>{s=r},zt=a,a.default=a,e.registerRoot(a),zt}var qt,Ts;function qi(){if(Ts)return qt;Ts=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let s=[" ",`
|
|
24
|
+
`," "];return e.split(t,s)},split(t,s,a){let r=[],c="",f=!1,m=0,l=!1,d="",i=!1;for(let h of t)i?i=!1:h==="\\"?i=!0:l?h===d&&(l=!1):h==='"'||h==="'"?(l=!0,d=h):h==="("?m+=1:h===")"?m>0&&(m-=1):m===0&&s.includes(h)&&(f=!0),f?(c!==""&&r.push(c.trim()),c="",f=!1):c+=h;return(a||c!=="")&&r.push(c.trim()),r}};return qt=e,e.default=e,qt}var Vt,_s;function Yr(){if(_s)return Vt;_s=1;let e=Ee(),t=qi();class s extends e{constructor(r){super(r),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(r){let c=this.selector?this.selector.match(/,\s*/):null,f=c?c[0]:","+this.raw("between","beforeOpen");this.selector=r.join(f)}}return Vt=s,s.default=s,e.registerRule(s),Vt}var jt,ks;function Fo(){if(ks)return jt;ks=1;let e=ht(),t=Lo(),s=dt(),a=Hr(),r=$e(),c=Yr(),f={empty:!0,space:!0};function m(d){for(let i=d.length-1;i>=0;i--){let h=d[i],o=h[3]||h[2];if(o)return o}}class l{constructor(i){this.input=i,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:i,start:{column:1,line:1,offset:0}}}atrule(i){let h=new a;h.name=i[1].slice(1),h.name===""&&this.unnamedAtrule(h,i),this.init(h,i[2]);let o,n,p,u=!1,g=!1,v=[],S=[];for(;!this.tokenizer.endOfFile();){if(i=this.tokenizer.nextToken(),o=i[0],o==="("||o==="["?S.push(o==="("?")":"]"):o==="{"&&S.length>0?S.push("}"):o===S[S.length-1]&&S.pop(),S.length===0)if(o===";"){h.source.end=this.getPosition(i[2]),h.source.end.offset++,this.semicolon=!0;break}else if(o==="{"){g=!0;break}else if(o==="}"){if(v.length>0){for(p=v.length-1,n=v[p];n&&n[0]==="space";)n=v[--p];n&&(h.source.end=this.getPosition(n[3]||n[2]),h.source.end.offset++)}this.end(i);break}else v.push(i);else v.push(i);if(this.tokenizer.endOfFile()){u=!0;break}}h.raws.between=this.spacesAndCommentsFromEnd(v),v.length?(h.raws.afterName=this.spacesAndCommentsFromStart(v),this.raw(h,"params",v),u&&(i=v[v.length-1],h.source.end=this.getPosition(i[3]||i[2]),h.source.end.offset++,this.spaces=h.raws.between,h.raws.between="")):(h.raws.afterName="",h.params=""),g&&(h.nodes=[],this.current=h)}checkMissedSemicolon(i){let h=this.colon(i);if(h===!1)return;let o=0,n;for(let p=h-1;p>=0&&(n=i[p],!(n[0]!=="space"&&(o+=1,o===2)));p--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(i){let h=0,o,n,p;for(let[u,g]of i.entries()){if(o=g,n=o[0],n==="("&&(h+=1),n===")"&&(h-=1),h===0&&n===":")if(!p)this.doubleColon(o);else{if(p[0]==="word"&&p[1]==="progid")continue;return u}p=o}return!1}comment(i){let h=new s;this.init(h,i[2]),h.source.end=this.getPosition(i[3]||i[2]),h.source.end.offset++;let o=i[1].slice(2,-2);if(/^\s*$/.test(o))h.text="",h.raws.left=o,h.raws.right="";else{let n=o.match(/^(\s*)([^]*\S)(\s*)$/);h.text=n[2],h.raws.left=n[1],h.raws.right=n[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(i,h){let o=new e;this.init(o,i[0][2]);let n=i[i.length-1];for(n[0]===";"&&(this.semicolon=!0,i.pop()),o.source.end=this.getPosition(n[3]||n[2]||m(i)),o.source.end.offset++;i[0][0]!=="word";)i.length===1&&this.unknownWord(i),o.raws.before+=i.shift()[1];for(o.source.start=this.getPosition(i[0][2]),o.prop="";i.length;){let S=i[0][0];if(S===":"||S==="space"||S==="comment")break;o.prop+=i.shift()[1]}o.raws.between="";let p;for(;i.length;)if(p=i.shift(),p[0]===":"){o.raws.between+=p[1];break}else p[0]==="word"&&/\w/.test(p[1])&&this.unknownWord([p]),o.raws.between+=p[1];(o.prop[0]==="_"||o.prop[0]==="*")&&(o.raws.before+=o.prop[0],o.prop=o.prop.slice(1));let u=[],g;for(;i.length&&(g=i[0][0],!(g!=="space"&&g!=="comment"));)u.push(i.shift());this.precheckMissedSemicolon(i);for(let S=i.length-1;S>=0;S--){if(p=i[S],p[1].toLowerCase()==="!important"){o.important=!0;let b=this.stringFrom(i,S);b=this.spacesFromEnd(i)+b,b!==" !important"&&(o.raws.important=b);break}else if(p[1].toLowerCase()==="important"){let b=i.slice(0),E="";for(let w=S;w>0;w--){let y=b[w][0];if(E.trim().indexOf("!")===0&&y!=="space")break;E=b.pop()[1]+E}E.trim().indexOf("!")===0&&(o.important=!0,o.raws.important=E,i=b)}if(p[0]!=="space"&&p[0]!=="comment")break}i.some(S=>S[0]!=="space"&&S[0]!=="comment")&&(o.raws.between+=u.map(S=>S[1]).join(""),u=[]),this.raw(o,"value",u.concat(i),h),o.value.includes(":")&&!h&&this.checkMissedSemicolon(i)}doubleColon(i){throw this.input.error("Double colon",{offset:i[2]},{offset:i[2]+i[1].length})}emptyRule(i){let h=new c;this.init(h,i[2]),h.selector="",h.raws.between="",this.current=h}end(i){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(i[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(i)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(i){if(this.spaces+=i[1],this.current.nodes){let h=this.current.nodes[this.current.nodes.length-1];h&&h.type==="rule"&&!h.raws.ownSemicolon&&(h.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(i){let h=this.input.fromOffset(i);return{column:h.col,line:h.line,offset:i}}init(i,h){this.current.push(i),i.source={input:this.input,start:this.getPosition(h)},i.raws.before=this.spaces,this.spaces="",i.type!=="comment"&&(this.semicolon=!1)}other(i){let h=!1,o=null,n=!1,p=null,u=[],g=i[1].startsWith("--"),v=[],S=i;for(;S;){if(o=S[0],v.push(S),o==="("||o==="[")p||(p=S),u.push(o==="("?")":"]");else if(g&&n&&o==="{")p||(p=S),u.push("}");else if(u.length===0)if(o===";")if(n){this.decl(v,g);return}else break;else if(o==="{"){this.rule(v);return}else if(o==="}"){this.tokenizer.back(v.pop()),h=!0;break}else o===":"&&(n=!0);else o===u[u.length-1]&&(u.pop(),u.length===0&&(p=null));S=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(h=!0),u.length>0&&this.unclosedBracket(p),h&&n){if(!g)for(;v.length&&(S=v[v.length-1][0],!(S!=="space"&&S!=="comment"));)this.tokenizer.back(v.pop());this.decl(v,g)}else this.unknownWord(v)}parse(){let i;for(;!this.tokenizer.endOfFile();)switch(i=this.tokenizer.nextToken(),i[0]){case"space":this.spaces+=i[1];break;case";":this.freeSemicolon(i);break;case"}":this.end(i);break;case"comment":this.comment(i);break;case"at-word":this.atrule(i);break;case"{":this.emptyRule(i);break;default:this.other(i);break}this.endFile()}precheckMissedSemicolon(){}raw(i,h,o,n){let p,u,g=o.length,v="",S=!0,b,E;for(let w=0;w<g;w+=1)p=o[w],u=p[0],u==="space"&&w===g-1&&!n?S=!1:u==="comment"?(E=o[w-1]?o[w-1][0]:"empty",b=o[w+1]?o[w+1][0]:"empty",!f[E]&&!f[b]?v.slice(-1)===","?S=!1:v+=p[1]:S=!1):v+=p[1];if(!S){let w=o.reduce((y,C)=>y+C[1],"");i.raws[h]={raw:w,value:v}}i[h]=v}rule(i){i.pop();let h=new c;this.init(h,i[0][2]),h.raws.between=this.spacesAndCommentsFromEnd(i),this.raw(h,"selector",i),this.current=h}spacesAndCommentsFromEnd(i){let h,o="";for(;i.length&&(h=i[i.length-1][0],!(h!=="space"&&h!=="comment"));)o=i.pop()[1]+o;return o}spacesAndCommentsFromStart(i){let h,o="";for(;i.length&&(h=i[0][0],!(h!=="space"&&h!=="comment"));)o+=i.shift()[1];return o}spacesFromEnd(i){let h,o="";for(;i.length&&(h=i[i.length-1][0],h==="space");)o=i.pop()[1]+o;return o}stringFrom(i,h){let o="";for(let n=h;n<i.length;n++)o+=i[n][1];return i.splice(h,i.length-h),o}unclosedBlock(){let i=this.current.source.start;throw this.input.error("Unclosed block",i.line,i.column)}unclosedBracket(i){throw this.input.error("Unclosed bracket",{offset:i[2]},{offset:i[2]+1})}unexpectedClose(i){throw this.input.error("Unexpected }",{offset:i[2]},{offset:i[2]+1})}unknownWord(i){throw this.input.error("Unknown word",{offset:i[0][2]},{offset:i[0][2]+i[0][1].length})}unnamedAtrule(i,h){throw this.input.error("At-rule without name",{offset:h[2]},{offset:h[2]+h[1].length})}}return jt=l,jt}var Gt,Ps;function Xr(){if(Ps)return Gt;Ps=1;let e=Ee(),t=Fo(),s=ft();function a(r,c){let f=new s(r,c),m=new t(f);try{m.parse()}catch(l){throw process.env.NODE_ENV!=="production"&&l.name==="CssSyntaxError"&&c&&c.from&&(/\.scss$/i.test(c.from)?l.message+=`
|
|
25
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(c.from)?l.message+=`
|
|
26
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(c.from)&&(l.message+=`
|
|
27
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),l}return m.root}return Gt=a,a.default=a,e.registerParse(a),Gt}var Ht,Ls;function Vi(){if(Ls)return Ht;Ls=1;let{isClean:e,my:t}=Vr(),s=$i(),a=ut(),r=Ee(),c=jr(),f=Wi(),m=Gr(),l=Xr(),d=$e(),i={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},o={Once:!0,postcssPlugin:!0,prepare:!0},n=0;function p(E){return typeof E=="object"&&typeof E.then=="function"}function u(E){let w=!1,y=i[E.type];return E.type==="decl"?w=E.prop.toLowerCase():E.type==="atrule"&&(w=E.name.toLowerCase()),w&&E.append?[y,y+"-"+w,n,y+"Exit",y+"Exit-"+w]:w?[y,y+"-"+w,y+"Exit",y+"Exit-"+w]:E.append?[y,n,y+"Exit"]:[y,y+"Exit"]}function g(E){let w;return E.type==="document"?w=["Document",n,"DocumentExit"]:E.type==="root"?w=["Root",n,"RootExit"]:w=u(E),{eventIndex:0,events:w,iterator:0,node:E,visitorIndex:0,visitors:[]}}function v(E){return E[e]=!1,E.nodes&&E.nodes.forEach(w=>v(w)),E}let S={};class b{constructor(w,y,C){this.stringified=!1,this.processed=!1;let M;if(typeof y=="object"&&y!==null&&(y.type==="root"||y.type==="document"))M=v(y);else if(y instanceof b||y instanceof m)M=v(y.root),y.map&&(typeof C.map>"u"&&(C.map={}),C.map.inline||(C.map.inline=!1),C.map.prev=y.map);else{let O=l;C.syntax&&(O=C.syntax.parse),C.parser&&(O=C.parser),O.parse&&(O=O.parse);try{M=O(y,C)}catch(R){this.processed=!0,this.error=R}M&&!M[t]&&r.rebuild(M)}this.result=new m(w,M,C),this.helpers={...S,postcss:S,result:this.result},this.plugins=this.processor.plugins.map(O=>typeof O=="object"&&O.prepare?{...O,...O.prepare(this.result)}:O)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(w){return this.async().catch(w)}finally(w){return this.async().then(w,w)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(w,y){let C=this.result.lastPlugin;try{if(y&&y.addToError(w),this.error=w,w.name==="CssSyntaxError"&&!w.plugin)w.plugin=C.postcssPlugin,w.setMessage();else if(C.postcssVersion&&process.env.NODE_ENV!=="production"){let M=C.postcssPlugin,O=C.postcssVersion,R=this.result.processor.version,D=O.split("."),A=R.split(".");(D[0]!==A[0]||parseInt(D[1])>parseInt(A[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+R+", but "+M+" uses "+O+". Perhaps this is the source of the error below.")}}catch(M){console&&console.error&&console.error(M)}return w}prepareVisitors(){this.listeners={};let w=(y,C,M)=>{this.listeners[C]||(this.listeners[C]=[]),this.listeners[C].push([y,M])};for(let y of this.plugins)if(typeof y=="object")for(let C in y){if(!h[C]&&/^[A-Z]/.test(C))throw new Error(`Unknown event ${C} in ${y.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!o[C])if(typeof y[C]=="object")for(let M in y[C])M==="*"?w(y,C,y[C][M]):w(y,C+"-"+M.toLowerCase(),y[C][M]);else typeof y[C]=="function"&&w(y,C,y[C])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let w=0;w<this.plugins.length;w++){let y=this.plugins[w],C=this.runOnRoot(y);if(p(C))try{await C}catch(M){throw this.handleError(M)}}if(this.prepareVisitors(),this.hasListener){let w=this.result.root;for(;!w[e];){w[e]=!0;let y=[g(w)];for(;y.length>0;){let C=this.visitTick(y);if(p(C))try{await C}catch(M){let O=y[y.length-1].node;throw this.handleError(M,O)}}}if(this.listeners.OnceExit)for(let[y,C]of this.listeners.OnceExit){this.result.lastPlugin=y;try{if(w.type==="document"){let M=w.nodes.map(O=>C(O,this.helpers));await Promise.all(M)}else await C(w,this.helpers)}catch(M){throw this.handleError(M)}}}return this.processed=!0,this.stringify()}runOnRoot(w){this.result.lastPlugin=w;try{if(typeof w=="object"&&w.Once){if(this.result.root.type==="document"){let y=this.result.root.nodes.map(C=>w.Once(C,this.helpers));return p(y[0])?Promise.all(y):y}return w.Once(this.result.root,this.helpers)}else if(typeof w=="function")return w(this.result.root,this.result)}catch(y){throw this.handleError(y)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let w=this.result.opts,y=a;w.syntax&&(y=w.syntax.stringify),w.stringifier&&(y=w.stringifier),y.stringify&&(y=y.stringify);let M=new s(y,this.result.root,this.result.opts).generate();return this.result.css=M[0],this.result.map=M[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let w of this.plugins){let y=this.runOnRoot(w);if(p(y))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let w=this.result.root;for(;!w[e];)w[e]=!0,this.walkSync(w);if(this.listeners.OnceExit)if(w.type==="document")for(let y of w.nodes)this.visitSync(this.listeners.OnceExit,y);else this.visitSync(this.listeners.OnceExit,w)}return this.result}then(w,y){return process.env.NODE_ENV!=="production"&&("from"in this.opts||f("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(w,y)}toString(){return this.css}visitSync(w,y){for(let[C,M]of w){this.result.lastPlugin=C;let O;try{O=M(y,this.helpers)}catch(R){throw this.handleError(R,y.proxyOf)}if(y.type!=="root"&&y.type!=="document"&&!y.parent)return!0;if(p(O))throw this.getAsyncError()}}visitTick(w){let y=w[w.length-1],{node:C,visitors:M}=y;if(C.type!=="root"&&C.type!=="document"&&!C.parent){w.pop();return}if(M.length>0&&y.visitorIndex<M.length){let[R,D]=M[y.visitorIndex];y.visitorIndex+=1,y.visitorIndex===M.length&&(y.visitors=[],y.visitorIndex=0),this.result.lastPlugin=R;try{return D(C.toProxy(),this.helpers)}catch(A){throw this.handleError(A,C)}}if(y.iterator!==0){let R=y.iterator,D;for(;D=C.nodes[C.indexes[R]];)if(C.indexes[R]+=1,!D[e]){D[e]=!0,w.push(g(D));return}y.iterator=0,delete C.indexes[R]}let O=y.events;for(;y.eventIndex<O.length;){let R=O[y.eventIndex];if(y.eventIndex+=1,R===n){C.nodes&&C.nodes.length&&(C[e]=!0,y.iterator=C.getIterator());return}else if(this.listeners[R]){y.visitors=this.listeners[R];return}}w.pop()}walkSync(w){w[e]=!0;let y=u(w);for(let C of y)if(C===n)w.nodes&&w.each(M=>{M[e]||this.walkSync(M)});else{let M=this.listeners[C];if(M&&this.visitSync(M,w.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return b.registerPostcss=E=>{S=E},Ht=b,b.default=b,d.registerLazyResult(b),c.registerLazyResult(b),Ht}var Yt,Fs;function Uo(){if(Fs)return Yt;Fs=1;let e=$i(),t=ut(),s=Wi(),a=Xr(),r=Gr();class c{constructor(m,l,d){l=l.toString(),this.stringified=!1,this._processor=m,this._css=l,this._opts=d,this._map=void 0;let i,h=t;this.result=new r(this._processor,i,this._opts),this.result.css=l;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let n=new e(h,i,this._opts,l);if(n.isMap()){let[p,u]=n.generate();p&&(this.result.css=p),u&&(this.result.map=u)}else n.clearAnnotation(),this.result.css=n.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(m){return this.async().catch(m)}finally(m){return this.async().then(m,m)}sync(){if(this.error)throw this.error;return this.result}then(m,l){return process.env.NODE_ENV!=="production"&&("from"in this._opts||s("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(m,l)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let m,l=a;try{m=l(this._css,this._opts)}catch(d){this.error=d}if(this.error)throw this.error;return this._root=m,m}get[Symbol.toStringTag](){return"NoWorkResult"}}return Yt=c,c.default=c,Yt}var Xt,Us;function Bo(){if(Us)return Xt;Us=1;let e=Uo(),t=Vi(),s=jr(),a=$e();class r{constructor(f=[]){this.version="8.4.38",this.plugins=this.normalize(f)}normalize(f){let m=[];for(let l of f)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))m=m.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)m.push(l);else if(typeof l=="function")m.push(l);else if(typeof l=="object"&&(l.parse||l.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(l+" is not a PostCSS plugin");return m}process(f,m={}){return!this.plugins.length&&!m.parser&&!m.stringifier&&!m.syntax?new e(this,f,m):new t(this,f,m)}use(f){return this.plugins=this.plugins.concat(this.normalize([f])),this}}return Xt=r,r.default=r,a.registerProcessor(r),s.registerProcessor(r),Xt}var Jt,Bs;function $o(){if(Bs)return Jt;Bs=1;let e=ht(),t=Bi(),s=dt(),a=Hr(),r=ft(),c=$e(),f=Yr();function m(l,d){if(Array.isArray(l))return l.map(o=>m(o));let{inputs:i,...h}=l;if(i){d=[];for(let o of i){let n={...o,__proto__:r.prototype};n.map&&(n.map={...n.map,__proto__:t.prototype}),d.push(n)}}if(h.nodes&&(h.nodes=l.nodes.map(o=>m(o,d))),h.source){let{inputId:o,...n}=h.source;h.source=n,o!=null&&(h.source.input=d[o])}if(h.type==="root")return new c(h);if(h.type==="decl")return new e(h);if(h.type==="rule")return new f(h);if(h.type==="comment")return new s(h);if(h.type==="atrule")return new a(h);throw new Error("Unknown node type: "+l.type)}return Jt=m,m.default=m,Jt}var Qt,$s;function Wo(){if($s)return Qt;$s=1;let e=qr(),t=ht(),s=Vi(),a=Ee(),r=Bo(),c=ut(),f=$o(),m=jr(),l=zi(),d=dt(),i=Hr(),h=Gr(),o=ft(),n=Xr(),p=qi(),u=Yr(),g=$e(),v=ct();function S(...b){return b.length===1&&Array.isArray(b[0])&&(b=b[0]),new r(b)}return S.plugin=function(E,w){let y=!1;function C(...O){console&&console.warn&&!y&&(y=!0,console.warn(E+`: postcss.plugin was deprecated. Migration guide:
|
|
28
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(E+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
29
|
+
https://www.w3ctech.com/topic/2226`));let R=w(...O);return R.postcssPlugin=E,R.postcssVersion=new r().version,R}let M;return Object.defineProperty(C,"postcss",{get(){return M||(M=C()),M}}),C.process=function(O,R,D){return S([C(D)]).process(O,R)},C},S.stringify=c,S.parse=n,S.fromJSON=f,S.list=p,S.comment=b=>new d(b),S.atRule=b=>new i(b),S.decl=b=>new t(b),S.rule=b=>new u(b),S.root=b=>new g(b),S.document=b=>new m(b),S.CssSyntaxError=e,S.Declaration=t,S.Container=a,S.Processor=r,S.Document=m,S.Comment=d,S.Warning=l,S.AtRule=i,S.Result=h,S.Input=o,S.Rule=u,S.Root=g,S.Node=v,s.registerPostcss(S),Qt=S,S.default=S,Qt}var zo=Wo(),q=Ao(zo);q.stringify;q.fromJSON;q.plugin;q.parse;q.list;q.document;q.comment;q.atRule;q.rule;q.decl;q.root;q.CssSyntaxError;q.Declaration;q.Container;q.Processor;q.Document;q.Comment;q.Warning;q.AtRule;q.Result;q.Input;q.Rule;q.Root;q.Node;var qo=Object.defineProperty,Vo=(e,t,s)=>t in e?qo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,le=(e,t,s)=>Vo(e,typeof t!="symbol"?t+"":t,s);Date.now().toString();function jo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Go(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var s=function a(){return this instanceof a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(s,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}),s}var He={exports:{}},Ws;function Ho(){if(Ws)return He.exports;Ws=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return He.exports=t(),He.exports.createColors=t,He.exports}var Yo={},Xo=Object.freeze(Object.defineProperty({__proto__:null,default:Yo},Symbol.toStringTag,{value:"Module"})),de=Go(Xo),Zt,zs;function Jr(){if(zs)return Zt;zs=1;let e=Ho(),t=de;class s extends Error{constructor(r,c,f,m,l,d){super(r),this.name="CssSyntaxError",this.reason=r,l&&(this.file=l),m&&(this.source=m),d&&(this.plugin=d),typeof c<"u"&&typeof f<"u"&&(typeof c=="number"?(this.line=c,this.column=f):(this.line=c.line,this.column=c.column,this.endLine=f.line,this.endColumn=f.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let c=this.source;r==null&&(r=e.isColorSupported),t&&r&&(c=t(c));let f=c.split(/\r?\n/),m=Math.max(this.line-3,0),l=Math.min(this.line+2,f.length),d=String(l).length,i,h;if(r){let{bold:o,gray:n,red:p}=e.createColors(!0);i=u=>o(p(u)),h=u=>n(u)}else i=h=o=>o;return f.slice(m,l).map((o,n)=>{let p=m+1+n,u=" "+(" "+p).slice(-d)+" | ";if(p===this.line){let g=h(u.replace(/\d/g," "))+o.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+h(u)+o+`
|
|
30
|
+
`+g+i("^")}return" "+h(u)+o}).join(`
|
|
31
|
+
`)}toString(){let r=this.showSourceCode();return r&&(r=`
|
|
32
|
+
|
|
33
|
+
`+r+`
|
|
34
|
+
`),this.name+": "+this.message+r}}return Zt=s,s.default=s,Zt}var Ye={},qs;function Qr(){return qs||(qs=1,Ye.isClean=Symbol("isClean"),Ye.my=Symbol("my")),Ye}var Kt,Vs;function ji(){if(Vs)return Kt;Vs=1;let e={after:`
|
|
35
|
+
`,beforeClose:`
|
|
36
|
+
`,beforeComment:`
|
|
37
|
+
`,beforeDecl:`
|
|
38
|
+
`,beforeOpen:" ",beforeRule:`
|
|
39
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(a){return a[0].toUpperCase()+a.slice(1)}class s{constructor(r){this.builder=r}atrule(r,c){let f="@"+r.name,m=r.params?this.rawValue(r,"params"):"";if(typeof r.raws.afterName<"u"?f+=r.raws.afterName:m&&(f+=" "),r.nodes)this.block(r,f+m);else{let l=(r.raws.between||"")+(c?";":"");this.builder(f+m+l,r)}}beforeAfter(r,c){let f;r.type==="decl"?f=this.raw(r,null,"beforeDecl"):r.type==="comment"?f=this.raw(r,null,"beforeComment"):c==="before"?f=this.raw(r,null,"beforeRule"):f=this.raw(r,null,"beforeClose");let m=r.parent,l=0;for(;m&&m.type!=="root";)l+=1,m=m.parent;if(f.includes(`
|
|
40
|
+
`)){let d=this.raw(r,null,"indent");if(d.length)for(let i=0;i<l;i++)f+=d}return f}block(r,c){let f=this.raw(r,"between","beforeOpen");this.builder(c+f+"{",r,"start");let m;r.nodes&&r.nodes.length?(this.body(r),m=this.raw(r,"after")):m=this.raw(r,"after","emptyBody"),m&&this.builder(m),this.builder("}",r,"end")}body(r){let c=r.nodes.length-1;for(;c>0&&r.nodes[c].type==="comment";)c-=1;let f=this.raw(r,"semicolon");for(let m=0;m<r.nodes.length;m++){let l=r.nodes[m],d=this.raw(l,"before");d&&this.builder(d),this.stringify(l,c!==m||f)}}comment(r){let c=this.raw(r,"left","commentLeft"),f=this.raw(r,"right","commentRight");this.builder("/*"+c+r.text+f+"*/",r)}decl(r,c){let f=this.raw(r,"between","colon"),m=r.prop+f+this.rawValue(r,"value");r.important&&(m+=r.raws.important||" !important"),c&&(m+=";"),this.builder(m,r)}document(r){this.body(r)}raw(r,c,f){let m;if(f||(f=c),c&&(m=r.raws[c],typeof m<"u"))return m;let l=r.parent;if(f==="before"&&(!l||l.type==="root"&&l.first===r||l&&l.type==="document"))return"";if(!l)return e[f];let d=r.root();if(d.rawCache||(d.rawCache={}),typeof d.rawCache[f]<"u")return d.rawCache[f];if(f==="before"||f==="after")return this.beforeAfter(r,f);{let i="raw"+t(f);this[i]?m=this[i](d,r):d.walk(h=>{if(m=h.raws[c],typeof m<"u")return!1})}return typeof m>"u"&&(m=e[f]),d.rawCache[f]=m,m}rawBeforeClose(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length>0&&typeof f.raws.after<"u")return c=f.raws.after,c.includes(`
|
|
41
|
+
`)&&(c=c.replace(/[^\n]+$/,"")),!1}),c&&(c=c.replace(/\S/g,"")),c}rawBeforeComment(r,c){let f;return r.walkComments(m=>{if(typeof m.raws.before<"u")return f=m.raws.before,f.includes(`
|
|
42
|
+
`)&&(f=f.replace(/[^\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(c,null,"beforeDecl"):f&&(f=f.replace(/\S/g,"")),f}rawBeforeDecl(r,c){let f;return r.walkDecls(m=>{if(typeof m.raws.before<"u")return f=m.raws.before,f.includes(`
|
|
43
|
+
`)&&(f=f.replace(/[^\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(c,null,"beforeRule"):f&&(f=f.replace(/\S/g,"")),f}rawBeforeOpen(r){let c;return r.walk(f=>{if(f.type!=="decl"&&(c=f.raws.between,typeof c<"u"))return!1}),c}rawBeforeRule(r){let c;return r.walk(f=>{if(f.nodes&&(f.parent!==r||r.first!==f)&&typeof f.raws.before<"u")return c=f.raws.before,c.includes(`
|
|
44
|
+
`)&&(c=c.replace(/[^\n]+$/,"")),!1}),c&&(c=c.replace(/\S/g,"")),c}rawColon(r){let c;return r.walkDecls(f=>{if(typeof f.raws.between<"u")return c=f.raws.between.replace(/[^\s:]/g,""),!1}),c}rawEmptyBody(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length===0&&(c=f.raws.after,typeof c<"u"))return!1}),c}rawIndent(r){if(r.raws.indent)return r.raws.indent;let c;return r.walk(f=>{let m=f.parent;if(m&&m!==r&&m.parent&&m.parent===r&&typeof f.raws.before<"u"){let l=f.raws.before.split(`
|
|
45
|
+
`);return c=l[l.length-1],c=c.replace(/\S/g,""),!1}}),c}rawSemicolon(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length&&f.last.type==="decl"&&(c=f.raws.semicolon,typeof c<"u"))return!1}),c}rawValue(r,c){let f=r[c],m=r.raws[c];return m&&m.value===f?m.raw:f}root(r){this.body(r),r.raws.after&&this.builder(r.raws.after)}rule(r){this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon&&this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,c){if(!this[r.type])throw new Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,c)}}return Kt=s,s.default=s,Kt}var er,js;function pt(){if(js)return er;js=1;let e=ji();function t(s,a){new e(a).stringify(s)}return er=t,t.default=t,er}var tr,Gs;function mt(){if(Gs)return tr;Gs=1;let{isClean:e,my:t}=Qr(),s=Jr(),a=ji(),r=pt();function c(m,l){let d=new m.constructor;for(let i in m){if(!Object.prototype.hasOwnProperty.call(m,i)||i==="proxyCache")continue;let h=m[i],o=typeof h;i==="parent"&&o==="object"?l&&(d[i]=l):i==="source"?d[i]=h:Array.isArray(h)?d[i]=h.map(n=>c(n,d)):(o==="object"&&h!==null&&(h=c(h)),d[i]=h)}return d}class f{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let d in l)if(d==="nodes"){this.nodes=[];for(let i of l[d])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[d]=l[d]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\n\s{4}at /.test(l.stack)){let d=this.source;l.stack=l.stack.replace(/\n\s{4}at /,`$&${d.input.from}:${d.start.line}:${d.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let d in l)this[d]=l[d];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){delete this.raws.before,delete this.raws.after,l||delete this.raws.between}clone(l={}){let d=c(this);for(let i in l)d[i]=l[i];return d}cloneAfter(l={}){let d=this.clone(l);return this.parent.insertAfter(this,d),d}cloneBefore(l={}){let d=this.clone(l);return this.parent.insertBefore(this,d),d}error(l,d={}){if(this.source){let{end:i,start:h}=this.rangeBy(d);return this.source.input.error(l,{column:h.column,line:h.line},{column:i.column,line:i.line},d)}return new s(l)}getProxyProcessor(){return{get(l,d){return d==="proxyOf"?l:d==="root"?()=>l.root().toProxy():l[d]},set(l,d,i){return l[d]===i||(l[d]=i,(d==="prop"||d==="value"||d==="name"||d==="params"||d==="important"||d==="text")&&l.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let l=this;for(;l=l.parent;)l[e]=!1}}next(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l+1]}positionBy(l,d){let i=this.source.start;if(l.index)i=this.positionInside(l.index,d);else if(l.word){d=this.toString();let h=d.indexOf(l.word);h!==-1&&(i=this.positionInside(h,d))}return i}positionInside(l,d){let i=d||this.toString(),h=this.source.start.column,o=this.source.start.line;for(let n=0;n<l;n++)i[n]===`
|
|
46
|
+
`?(h=1,o+=1):h+=1;return{column:h,line:o}}prev(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l-1]}rangeBy(l){let d={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:d.column+1,line:d.line};if(l.word){let h=this.toString(),o=h.indexOf(l.word);o!==-1&&(d=this.positionInside(o,h),i=this.positionInside(o+l.word.length,h))}else l.start?d={column:l.start.column,line:l.start.line}:l.index&&(d=this.positionInside(l.index)),l.end?i={column:l.end.column,line:l.end.line}:typeof l.endIndex=="number"?i=this.positionInside(l.endIndex):l.index&&(i=this.positionInside(l.index+1));return(i.line<d.line||i.line===d.line&&i.column<=d.column)&&(i={column:d.column+1,line:d.line}),{end:i,start:d}}raw(l,d){return new a().raw(this,l,d)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...l){if(this.parent){let d=this,i=!1;for(let h of l)h===this?i=!0:i?(this.parent.insertAfter(d,h),d=h):this.parent.insertBefore(d,h);i||this.remove()}return this}root(){let l=this;for(;l.parent&&l.parent.type!=="document";)l=l.parent;return l}toJSON(l,d){let i={},h=d==null;d=d||new Map;let o=0;for(let n in this){if(!Object.prototype.hasOwnProperty.call(this,n)||n==="parent"||n==="proxyCache")continue;let p=this[n];if(Array.isArray(p))i[n]=p.map(u=>typeof u=="object"&&u.toJSON?u.toJSON(null,d):u);else if(typeof p=="object"&&p.toJSON)i[n]=p.toJSON(null,d);else if(n==="source"){let u=d.get(p.input);u==null&&(u=o,d.set(p.input,o),o++),i[n]={end:p.end,inputId:u,start:p.start}}else i[n]=p}return h&&(i.inputs=[...d.keys()].map(n=>n.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(l=r){l.stringify&&(l=l.stringify);let d="";return l(this,i=>{d+=i}),d}warn(l,d,i){let h={node:this};for(let o in i)h[o]=i[o];return l.warn(d,h)}get proxyOf(){return this}}return tr=f,f.default=f,tr}var rr,Hs;function gt(){if(Hs)return rr;Hs=1;let e=mt();class t extends e{constructor(a){a&&typeof a.value<"u"&&typeof a.value!="string"&&(a={...a,value:String(a.value)}),super(a),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return rr=t,t.default=t,rr}var sr,Ys;function Jo(){if(Ys)return sr;Ys=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return sr={nanoid:(a=21)=>{let r="",c=a;for(;c--;)r+=e[Math.random()*64|0];return r},customAlphabet:(a,r=21)=>(c=r)=>{let f="",m=c;for(;m--;)f+=a[Math.random()*a.length|0];return f}},sr}var ir,Xs;function Gi(){if(Xs)return ir;Xs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=de,{existsSync:s,readFileSync:a}=de,{dirname:r,join:c}=de;function f(l){return Buffer?Buffer.from(l,"base64").toString():window.atob(l)}class m{constructor(d,i){if(i.map===!1)return;this.loadAnnotation(d),this.inline=this.startWith(this.annotation,"data:");let h=i.map?i.map.prev:void 0,o=this.loadMap(i.from,h);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=r(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(d){let i=/^data:application\/json;charset=utf-?8;base64,/,h=/^data:application\/json;base64,/,o=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(o.test(d)||n.test(d))return decodeURIComponent(d.substr(RegExp.lastMatch.length));if(i.test(d)||h.test(d))return f(d.substr(RegExp.lastMatch.length));let p=d.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+p)}getAnnotationURL(d){return d.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(d){return typeof d!="object"?!1:typeof d.mappings=="string"||typeof d._mappings=="string"||Array.isArray(d.sections)}loadAnnotation(d){let i=d.match(/\/\*\s*# sourceMappingURL=/gm);if(!i)return;let h=d.lastIndexOf(i.pop()),o=d.indexOf("*/",h);h>-1&&o>-1&&(this.annotation=this.getAnnotationURL(d.substring(h,o)))}loadFile(d){if(this.root=r(d),s(d))return this.mapFile=d,a(d,"utf-8").toString().trim()}loadMap(d,i){if(i===!1)return!1;if(i){if(typeof i=="string")return i;if(typeof i=="function"){let h=i(d);if(h){let o=this.loadFile(h);if(!o)throw new Error("Unable to load previous source map: "+h.toString());return o}}else{if(i instanceof e)return t.fromSourceMap(i).toString();if(i instanceof t)return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let h=this.annotation;return d&&(h=c(r(d),h)),this.loadFile(h)}}}startWith(d,i){return d?d.substr(0,i.length)===i:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return ir=m,m.default=m,ir}var nr,Js;function yt(){if(Js)return nr;Js=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=de,{fileURLToPath:s,pathToFileURL:a}=de,{isAbsolute:r,resolve:c}=de,{nanoid:f}=Jo(),m=de,l=Jr(),d=Gi(),i=Symbol("fromOffsetCache"),h=!!(e&&t),o=!!(c&&r);class n{constructor(u,g={}){if(u===null||typeof u>"u"||typeof u=="object"&&!u.toString)throw new Error(`PostCSS received ${u} instead of CSS string`);if(this.css=u.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!o||/^\w+:\/\//.test(g.from)||r(g.from)?this.file=g.from:this.file=c(g.from)),o&&h){let v=new d(this.css,g);if(v.text){this.map=v;let S=v.consumer().file;!this.file&&S&&(this.file=this.mapResolve(S))}}this.file||(this.id="<input css "+f(6)+">"),this.map&&(this.map.file=this.from)}error(u,g,v,S={}){let b,E,w;if(g&&typeof g=="object"){let C=g,M=v;if(typeof C.offset=="number"){let O=this.fromOffset(C.offset);g=O.line,v=O.col}else g=C.line,v=C.column;if(typeof M.offset=="number"){let O=this.fromOffset(M.offset);E=O.line,w=O.col}else E=M.line,w=M.column}else if(!v){let C=this.fromOffset(g);g=C.line,v=C.col}let y=this.origin(g,v,E,w);return y?b=new l(u,y.endLine===void 0?y.line:{column:y.column,line:y.line},y.endLine===void 0?y.column:{column:y.endColumn,line:y.endLine},y.source,y.file,S.plugin):b=new l(u,E===void 0?g:{column:v,line:g},E===void 0?v:{column:w,line:E},this.css,this.file,S.plugin),b.input={column:v,endColumn:w,endLine:E,line:g,source:this.css},this.file&&(a&&(b.input.url=a(this.file).toString()),b.input.file=this.file),b}fromOffset(u){let g,v;if(this[i])v=this[i];else{let b=this.css.split(`
|
|
47
|
+
`);v=new Array(b.length);let E=0;for(let w=0,y=b.length;w<y;w++)v[w]=E,E+=b[w].length+1;this[i]=v}g=v[v.length-1];let S=0;if(u>=g)S=v.length-1;else{let b=v.length-2,E;for(;S<b;)if(E=S+(b-S>>1),u<v[E])b=E-1;else if(u>=v[E+1])S=E+1;else{S=E;break}}return{col:u-v[S]+1,line:S+1}}mapResolve(u){return/^\w+:\/\//.test(u)?u:c(this.map.consumer().sourceRoot||this.map.root||".",u)}origin(u,g,v,S){if(!this.map)return!1;let b=this.map.consumer(),E=b.originalPositionFor({column:g,line:u});if(!E.source)return!1;let w;typeof v=="number"&&(w=b.originalPositionFor({column:S,line:v}));let y;r(E.source)?y=a(E.source):y=new URL(E.source,this.map.consumer().sourceRoot||a(this.map.mapFile));let C={column:E.column,endColumn:w&&w.column,endLine:w&&w.line,line:E.line,url:y.toString()};if(y.protocol==="file:")if(s)C.file=s(y);else throw new Error("file: protocol is not available in this PostCSS build");let M=b.sourceContentFor(E.source);return M&&(C.source=M),C}toJSON(){let u={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(u[g]=this[g]);return this.map&&(u.map={...this.map},u.map.consumerCache&&(u.map.consumerCache=void 0)),u}get from(){return this.file||this.id}}return nr=n,n.default=n,m&&m.registerInput&&m.registerInput(n),nr}var or,Qs;function Hi(){if(Qs)return or;Qs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=de,{dirname:s,relative:a,resolve:r,sep:c}=de,{pathToFileURL:f}=de,m=yt(),l=!!(e&&t),d=!!(s&&r&&a&&c);class i{constructor(o,n,p,u){this.stringify=o,this.mapOpts=p.map||{},this.root=n,this.opts=p,this.css=u,this.originalCSS=u,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let o;this.isInline()?o="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?o=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?o=this.mapOpts.annotation(this.opts.to,this.root):o=this.outputFile()+".map";let n=`
|
|
48
|
+
`;this.css.includes(`\r
|
|
49
|
+
`)&&(n=`\r
|
|
50
|
+
`),this.css+=n+"/*# sourceMappingURL="+o+" */"}applyPrevMaps(){for(let o of this.previous()){let n=this.toUrl(this.path(o.file)),p=o.root||s(o.file),u;this.mapOpts.sourcesContent===!1?(u=new e(o.text),u.sourcesContent&&(u.sourcesContent=null)):u=o.consumer(),this.map.applySourceMap(u,n,this.toUrl(this.path(p)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let o;for(let n=this.root.nodes.length-1;n>=0;n--)o=this.root.nodes[n],o.type==="comment"&&o.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),d&&l&&this.isMap())return this.generateMap();{let o="";return this.stringify(this.root,n=>{o+=n}),[o]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let o=this.previous()[0].consumer();o.file=this.outputFile(),this.map=t.fromSourceMap(o,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let o=1,n=1,p="<no source>",u={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,v;this.stringify(this.root,(S,b,E)=>{if(this.css+=S,b&&E!=="end"&&(u.generated.line=o,u.generated.column=n-1,b.source&&b.source.start?(u.source=this.sourcePath(b),u.original.line=b.source.start.line,u.original.column=b.source.start.column-1,this.map.addMapping(u)):(u.source=p,u.original.line=1,u.original.column=0,this.map.addMapping(u))),g=S.match(/\n/g),g?(o+=g.length,v=S.lastIndexOf(`
|
|
51
|
+
`),n=S.length-v):n+=S.length,b&&E!=="start"){let w=b.parent||{raws:{}};(!(b.type==="decl"||b.type==="atrule"&&!b.nodes)||b!==w.last||w.raws.semicolon)&&(b.source&&b.source.end?(u.source=this.sourcePath(b),u.original.line=b.source.end.line,u.original.column=b.source.end.column-1,u.generated.line=o,u.generated.column=n-2,this.map.addMapping(u)):(u.source=p,u.original.line=1,u.original.column=0,u.generated.line=o,u.generated.column=n-1,this.map.addMapping(u)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(o=>o.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let o=this.mapOpts.annotation;return typeof o<"u"&&o!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(o=>o.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(o){if(this.mapOpts.absolute||o.charCodeAt(0)===60||/^\w+:\/\//.test(o))return o;let n=this.memoizedPaths.get(o);if(n)return n;let p=this.opts.to?s(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(p=s(r(p,this.mapOpts.annotation)));let u=a(p,o);return this.memoizedPaths.set(o,u),u}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(o=>{if(o.source&&o.source.input.map){let n=o.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let o=new m(this.originalCSS,this.opts);o.map&&this.previousMaps.push(o.map)}return this.previousMaps}setSourcesContent(){let o={};if(this.root)this.root.walk(n=>{if(n.source){let p=n.source.input.from;if(p&&!o[p]){o[p]=!0;let u=this.usesFileUrls?this.toFileUrl(p):this.toUrl(this.path(p));this.map.setSourceContent(u,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(o){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(o.source.input.from):this.toUrl(this.path(o.source.input.from))}toBase64(o){return Buffer?Buffer.from(o).toString("base64"):window.btoa(unescape(encodeURIComponent(o)))}toFileUrl(o){let n=this.memoizedFileURLs.get(o);if(n)return n;if(f){let p=f(o).toString();return this.memoizedFileURLs.set(o,p),p}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(o){let n=this.memoizedURLs.get(o);if(n)return n;c==="\\"&&(o=o.replace(/\\/g,"/"));let p=encodeURI(o).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(o,p),p}}return or=i,or}var ar,Zs;function wt(){if(Zs)return ar;Zs=1;let e=mt();class t extends e{constructor(a){super(a),this.type="comment"}}return ar=t,t.default=t,ar}var lr,Ks;function xe(){if(Ks)return lr;Ks=1;let{isClean:e,my:t}=Qr(),s=gt(),a=wt(),r=mt(),c,f,m,l;function d(o){return o.map(n=>(n.nodes&&(n.nodes=d(n.nodes)),delete n.source,n))}function i(o){if(o[e]=!1,o.proxyOf.nodes)for(let n of o.proxyOf.nodes)i(n)}class h extends r{append(...n){for(let p of n){let u=this.normalize(p,this.last);for(let g of u)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(n){if(super.cleanRaws(n),this.nodes)for(let p of this.nodes)p.cleanRaws(n)}each(n){if(!this.proxyOf.nodes)return;let p=this.getIterator(),u,g;for(;this.indexes[p]<this.proxyOf.nodes.length&&(u=this.indexes[p],g=n(this.proxyOf.nodes[u],u),g!==!1);)this.indexes[p]+=1;return delete this.indexes[p],g}every(n){return this.nodes.every(n)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let n=this.lastEach;return this.indexes[n]=0,n}getProxyProcessor(){return{get(n,p){return p==="proxyOf"?n:n[p]?p==="each"||typeof p=="string"&&p.startsWith("walk")?(...u)=>n[p](...u.map(g=>typeof g=="function"?(v,S)=>g(v.toProxy(),S):g)):p==="every"||p==="some"?u=>n[p]((g,...v)=>u(g.toProxy(),...v)):p==="root"?()=>n.root().toProxy():p==="nodes"?n.nodes.map(u=>u.toProxy()):p==="first"||p==="last"?n[p].toProxy():n[p]:n[p]},set(n,p,u){return n[p]===u||(n[p]=u,(p==="name"||p==="params"||p==="selector")&&n.markDirty()),!0}}}index(n){return typeof n=="number"?n:(n.proxyOf&&(n=n.proxyOf),this.proxyOf.nodes.indexOf(n))}insertAfter(n,p){let u=this.index(n),g=this.normalize(p,this.proxyOf.nodes[u]).reverse();u=this.index(n);for(let S of g)this.proxyOf.nodes.splice(u+1,0,S);let v;for(let S in this.indexes)v=this.indexes[S],u<v&&(this.indexes[S]=v+g.length);return this.markDirty(),this}insertBefore(n,p){let u=this.index(n),g=u===0?"prepend":!1,v=this.normalize(p,this.proxyOf.nodes[u],g).reverse();u=this.index(n);for(let b of v)this.proxyOf.nodes.splice(u,0,b);let S;for(let b in this.indexes)S=this.indexes[b],u<=S&&(this.indexes[b]=S+v.length);return this.markDirty(),this}normalize(n,p){if(typeof n=="string")n=d(c(n).nodes);else if(typeof n>"u")n=[];else if(Array.isArray(n)){n=n.slice(0);for(let g of n)g.parent&&g.parent.removeChild(g,"ignore")}else if(n.type==="root"&&this.type!=="document"){n=n.nodes.slice(0);for(let g of n)g.parent&&g.parent.removeChild(g,"ignore")}else if(n.type)n=[n];else if(n.prop){if(typeof n.value>"u")throw new Error("Value field is missed in node creation");typeof n.value!="string"&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new f(n)];else if(n.name)n=[new m(n)];else if(n.text)n=[new a(n)];else throw new Error("Unknown node type in node creation");return n.map(g=>(g[t]||h.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&i(g),typeof g.raws.before>"u"&&p&&typeof p.raws.before<"u"&&(g.raws.before=p.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...n){n=n.reverse();for(let p of n){let u=this.normalize(p,this.first,"prepend").reverse();for(let g of u)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+u.length}return this.markDirty(),this}push(n){return n.parent=this,this.proxyOf.nodes.push(n),this}removeAll(){for(let n of this.proxyOf.nodes)n.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(n){n=this.index(n),this.proxyOf.nodes[n].parent=void 0,this.proxyOf.nodes.splice(n,1);let p;for(let u in this.indexes)p=this.indexes[u],p>=n&&(this.indexes[u]=p-1);return this.markDirty(),this}replaceValues(n,p,u){return u||(u=p,p={}),this.walkDecls(g=>{p.props&&!p.props.includes(g.prop)||p.fast&&!g.value.includes(p.fast)||(g.value=g.value.replace(n,u))}),this.markDirty(),this}some(n){return this.nodes.some(n)}walk(n){return this.each((p,u)=>{let g;try{g=n(p,u)}catch(v){throw p.addToError(v)}return g!==!1&&p.walk&&(g=p.walk(n)),g})}walkAtRules(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="atrule"&&n.test(u.name))return p(u,g)}):this.walk((u,g)=>{if(u.type==="atrule"&&u.name===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="atrule")return p(u,g)}))}walkComments(n){return this.walk((p,u)=>{if(p.type==="comment")return n(p,u)})}walkDecls(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="decl"&&n.test(u.prop))return p(u,g)}):this.walk((u,g)=>{if(u.type==="decl"&&u.prop===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="decl")return p(u,g)}))}walkRules(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="rule"&&n.test(u.selector))return p(u,g)}):this.walk((u,g)=>{if(u.type==="rule"&&u.selector===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="rule")return p(u,g)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return h.registerParse=o=>{c=o},h.registerRule=o=>{f=o},h.registerAtRule=o=>{m=o},h.registerRoot=o=>{l=o},lr=h,h.default=h,h.rebuild=o=>{o.type==="atrule"?Object.setPrototypeOf(o,m.prototype):o.type==="rule"?Object.setPrototypeOf(o,f.prototype):o.type==="decl"?Object.setPrototypeOf(o,s.prototype):o.type==="comment"?Object.setPrototypeOf(o,a.prototype):o.type==="root"&&Object.setPrototypeOf(o,l.prototype),o[t]=!0,o.nodes&&o.nodes.forEach(n=>{h.rebuild(n)})},lr}var ur,ei;function Zr(){if(ei)return ur;ei=1;let e=xe(),t,s;class a extends e{constructor(c){super({type:"document",...c}),this.nodes||(this.nodes=[])}toResult(c={}){return new t(new s,this,c).stringify()}}return a.registerLazyResult=r=>{t=r},a.registerProcessor=r=>{s=r},ur=a,a.default=a,ur}var cr,ti;function Yi(){if(ti)return cr;ti=1;let e={};return cr=function(s){e[s]||(e[s]=!0,typeof console<"u"&&console.warn&&console.warn(s))},cr}var hr,ri;function Xi(){if(ri)return hr;ri=1;class e{constructor(s,a={}){if(this.type="warning",this.text=s,a.node&&a.node.source){let r=a.node.rangeBy(a);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in a)this[r]=a[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return hr=e,e.default=e,hr}var fr,si;function Kr(){if(si)return fr;si=1;let e=Xi();class t{constructor(a,r,c){this.processor=a,this.messages=[],this.root=r,this.opts=c,this.css=void 0,this.map=void 0}toString(){return this.css}warn(a,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let c=new e(a,r);return this.messages.push(c),c}warnings(){return this.messages.filter(a=>a.type==="warning")}get content(){return this.css}}return fr=t,t.default=t,fr}var dr,ii;function Qo(){if(ii)return dr;ii=1;let e=39,t=34,s=92,a=47,r=10,c=32,f=12,m=9,l=13,d=91,i=93,h=40,o=41,n=123,p=125,u=59,g=42,v=58,S=64,b=/[\t\n\f\r "#'()/;[\\\]{}]/g,E=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,w=/.[\r\n"'(/\\]/,y=/[\da-f]/i;return dr=function(M,O={}){let R=M.css.valueOf(),D=O.ignoreErrors,A,x,ue,se,U,F,H,Q,Y,B,ye=R.length,N=0,pe=[],ae=[];function _e(){return N}function K(T){throw M.error("Unclosed "+T,N)}function ce(){return ae.length===0&&N>=ye}function ve(T){if(ae.length)return ae.pop();if(N>=ye)return;let X=T?T.ignoreUnclosed:!1;switch(A=R.charCodeAt(N),A){case r:case c:case m:case l:case f:{x=N;do x+=1,A=R.charCodeAt(x);while(A===c||A===r||A===m||A===l||A===f);B=["space",R.slice(N,x)],N=x-1;break}case d:case i:case n:case p:case v:case u:case o:{let $=String.fromCharCode(A);B=[$,$,N];break}case h:{if(Q=pe.length?pe.pop()[1]:"",Y=R.charCodeAt(N+1),Q==="url"&&Y!==e&&Y!==t&&Y!==c&&Y!==r&&Y!==m&&Y!==f&&Y!==l){x=N;do{if(F=!1,x=R.indexOf(")",x+1),x===-1)if(D||X){x=N;break}else K("bracket");for(H=x;R.charCodeAt(H-1)===s;)H-=1,F=!F}while(F);B=["brackets",R.slice(N,x+1),N,x],N=x}else x=R.indexOf(")",N+1),se=R.slice(N,x+1),x===-1||w.test(se)?B=["(","(",N]:(B=["brackets",se,N,x],N=x);break}case e:case t:{ue=A===e?"'":'"',x=N;do{if(F=!1,x=R.indexOf(ue,x+1),x===-1)if(D||X){x=N+1;break}else K("string");for(H=x;R.charCodeAt(H-1)===s;)H-=1,F=!F}while(F);B=["string",R.slice(N,x+1),N,x],N=x;break}case S:{b.lastIndex=N+1,b.test(R),b.lastIndex===0?x=R.length-1:x=b.lastIndex-2,B=["at-word",R.slice(N,x+1),N,x],N=x;break}case s:{for(x=N,U=!0;R.charCodeAt(x+1)===s;)x+=1,U=!U;if(A=R.charCodeAt(x+1),U&&A!==a&&A!==c&&A!==r&&A!==m&&A!==l&&A!==f&&(x+=1,y.test(R.charAt(x)))){for(;y.test(R.charAt(x+1));)x+=1;R.charCodeAt(x+1)===c&&(x+=1)}B=["word",R.slice(N,x+1),N,x],N=x;break}default:{A===a&&R.charCodeAt(N+1)===g?(x=R.indexOf("*/",N+2)+1,x===0&&(D||X?x=R.length:K("comment")),B=["comment",R.slice(N,x+1),N,x],N=x):(E.lastIndex=N+1,E.test(R),E.lastIndex===0?x=R.length-1:x=E.lastIndex-2,B=["word",R.slice(N,x+1),N,x],pe.push(B),N=x);break}}return N++,B}function we(T){ae.push(T)}return{back:we,endOfFile:ce,nextToken:ve,position:_e}},dr}var pr,ni;function es(){if(ni)return pr;ni=1;let e=xe();class t extends e{constructor(a){super(a),this.type="atrule"}append(...a){return this.proxyOf.nodes||(this.nodes=[]),super.append(...a)}prepend(...a){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...a)}}return pr=t,t.default=t,e.registerAtRule(t),pr}var mr,oi;function We(){if(oi)return mr;oi=1;let e=xe(),t,s;class a extends e{constructor(c){super(c),this.type="root",this.nodes||(this.nodes=[])}normalize(c,f,m){let l=super.normalize(c);if(f){if(m==="prepend")this.nodes.length>1?f.raws.before=this.nodes[1].raws.before:delete f.raws.before;else if(this.first!==f)for(let d of l)d.raws.before=f.raws.before}return l}removeChild(c,f){let m=this.index(c);return!f&&m===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[m].raws.before),super.removeChild(c)}toResult(c={}){return new t(new s,this,c).stringify()}}return a.registerLazyResult=r=>{t=r},a.registerProcessor=r=>{s=r},mr=a,a.default=a,e.registerRoot(a),mr}var gr,ai;function Ji(){if(ai)return gr;ai=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let s=[" ",`
|
|
52
|
+
`," "];return e.split(t,s)},split(t,s,a){let r=[],c="",f=!1,m=0,l=!1,d="",i=!1;for(let h of t)i?i=!1:h==="\\"?i=!0:l?h===d&&(l=!1):h==='"'||h==="'"?(l=!0,d=h):h==="("?m+=1:h===")"?m>0&&(m-=1):m===0&&s.includes(h)&&(f=!0),f?(c!==""&&r.push(c.trim()),c="",f=!1):c+=h;return(a||c!=="")&&r.push(c.trim()),r}};return gr=e,e.default=e,gr}var yr,li;function ts(){if(li)return yr;li=1;let e=xe(),t=Ji();class s extends e{constructor(r){super(r),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(r){let c=this.selector?this.selector.match(/,\s*/):null,f=c?c[0]:","+this.raw("between","beforeOpen");this.selector=r.join(f)}}return yr=s,s.default=s,e.registerRule(s),yr}var wr,ui;function Zo(){if(ui)return wr;ui=1;let e=gt(),t=Qo(),s=wt(),a=es(),r=We(),c=ts(),f={empty:!0,space:!0};function m(d){for(let i=d.length-1;i>=0;i--){let h=d[i],o=h[3]||h[2];if(o)return o}}class l{constructor(i){this.input=i,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:i,start:{column:1,line:1,offset:0}}}atrule(i){let h=new a;h.name=i[1].slice(1),h.name===""&&this.unnamedAtrule(h,i),this.init(h,i[2]);let o,n,p,u=!1,g=!1,v=[],S=[];for(;!this.tokenizer.endOfFile();){if(i=this.tokenizer.nextToken(),o=i[0],o==="("||o==="["?S.push(o==="("?")":"]"):o==="{"&&S.length>0?S.push("}"):o===S[S.length-1]&&S.pop(),S.length===0)if(o===";"){h.source.end=this.getPosition(i[2]),h.source.end.offset++,this.semicolon=!0;break}else if(o==="{"){g=!0;break}else if(o==="}"){if(v.length>0){for(p=v.length-1,n=v[p];n&&n[0]==="space";)n=v[--p];n&&(h.source.end=this.getPosition(n[3]||n[2]),h.source.end.offset++)}this.end(i);break}else v.push(i);else v.push(i);if(this.tokenizer.endOfFile()){u=!0;break}}h.raws.between=this.spacesAndCommentsFromEnd(v),v.length?(h.raws.afterName=this.spacesAndCommentsFromStart(v),this.raw(h,"params",v),u&&(i=v[v.length-1],h.source.end=this.getPosition(i[3]||i[2]),h.source.end.offset++,this.spaces=h.raws.between,h.raws.between="")):(h.raws.afterName="",h.params=""),g&&(h.nodes=[],this.current=h)}checkMissedSemicolon(i){let h=this.colon(i);if(h===!1)return;let o=0,n;for(let p=h-1;p>=0&&(n=i[p],!(n[0]!=="space"&&(o+=1,o===2)));p--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(i){let h=0,o,n,p;for(let[u,g]of i.entries()){if(o=g,n=o[0],n==="("&&(h+=1),n===")"&&(h-=1),h===0&&n===":")if(!p)this.doubleColon(o);else{if(p[0]==="word"&&p[1]==="progid")continue;return u}p=o}return!1}comment(i){let h=new s;this.init(h,i[2]),h.source.end=this.getPosition(i[3]||i[2]),h.source.end.offset++;let o=i[1].slice(2,-2);if(/^\s*$/.test(o))h.text="",h.raws.left=o,h.raws.right="";else{let n=o.match(/^(\s*)([^]*\S)(\s*)$/);h.text=n[2],h.raws.left=n[1],h.raws.right=n[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(i,h){let o=new e;this.init(o,i[0][2]);let n=i[i.length-1];for(n[0]===";"&&(this.semicolon=!0,i.pop()),o.source.end=this.getPosition(n[3]||n[2]||m(i)),o.source.end.offset++;i[0][0]!=="word";)i.length===1&&this.unknownWord(i),o.raws.before+=i.shift()[1];for(o.source.start=this.getPosition(i[0][2]),o.prop="";i.length;){let S=i[0][0];if(S===":"||S==="space"||S==="comment")break;o.prop+=i.shift()[1]}o.raws.between="";let p;for(;i.length;)if(p=i.shift(),p[0]===":"){o.raws.between+=p[1];break}else p[0]==="word"&&/\w/.test(p[1])&&this.unknownWord([p]),o.raws.between+=p[1];(o.prop[0]==="_"||o.prop[0]==="*")&&(o.raws.before+=o.prop[0],o.prop=o.prop.slice(1));let u=[],g;for(;i.length&&(g=i[0][0],!(g!=="space"&&g!=="comment"));)u.push(i.shift());this.precheckMissedSemicolon(i);for(let S=i.length-1;S>=0;S--){if(p=i[S],p[1].toLowerCase()==="!important"){o.important=!0;let b=this.stringFrom(i,S);b=this.spacesFromEnd(i)+b,b!==" !important"&&(o.raws.important=b);break}else if(p[1].toLowerCase()==="important"){let b=i.slice(0),E="";for(let w=S;w>0;w--){let y=b[w][0];if(E.trim().indexOf("!")===0&&y!=="space")break;E=b.pop()[1]+E}E.trim().indexOf("!")===0&&(o.important=!0,o.raws.important=E,i=b)}if(p[0]!=="space"&&p[0]!=="comment")break}i.some(S=>S[0]!=="space"&&S[0]!=="comment")&&(o.raws.between+=u.map(S=>S[1]).join(""),u=[]),this.raw(o,"value",u.concat(i),h),o.value.includes(":")&&!h&&this.checkMissedSemicolon(i)}doubleColon(i){throw this.input.error("Double colon",{offset:i[2]},{offset:i[2]+i[1].length})}emptyRule(i){let h=new c;this.init(h,i[2]),h.selector="",h.raws.between="",this.current=h}end(i){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(i[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(i)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(i){if(this.spaces+=i[1],this.current.nodes){let h=this.current.nodes[this.current.nodes.length-1];h&&h.type==="rule"&&!h.raws.ownSemicolon&&(h.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(i){let h=this.input.fromOffset(i);return{column:h.col,line:h.line,offset:i}}init(i,h){this.current.push(i),i.source={input:this.input,start:this.getPosition(h)},i.raws.before=this.spaces,this.spaces="",i.type!=="comment"&&(this.semicolon=!1)}other(i){let h=!1,o=null,n=!1,p=null,u=[],g=i[1].startsWith("--"),v=[],S=i;for(;S;){if(o=S[0],v.push(S),o==="("||o==="[")p||(p=S),u.push(o==="("?")":"]");else if(g&&n&&o==="{")p||(p=S),u.push("}");else if(u.length===0)if(o===";")if(n){this.decl(v,g);return}else break;else if(o==="{"){this.rule(v);return}else if(o==="}"){this.tokenizer.back(v.pop()),h=!0;break}else o===":"&&(n=!0);else o===u[u.length-1]&&(u.pop(),u.length===0&&(p=null));S=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(h=!0),u.length>0&&this.unclosedBracket(p),h&&n){if(!g)for(;v.length&&(S=v[v.length-1][0],!(S!=="space"&&S!=="comment"));)this.tokenizer.back(v.pop());this.decl(v,g)}else this.unknownWord(v)}parse(){let i;for(;!this.tokenizer.endOfFile();)switch(i=this.tokenizer.nextToken(),i[0]){case"space":this.spaces+=i[1];break;case";":this.freeSemicolon(i);break;case"}":this.end(i);break;case"comment":this.comment(i);break;case"at-word":this.atrule(i);break;case"{":this.emptyRule(i);break;default:this.other(i);break}this.endFile()}precheckMissedSemicolon(){}raw(i,h,o,n){let p,u,g=o.length,v="",S=!0,b,E;for(let w=0;w<g;w+=1)p=o[w],u=p[0],u==="space"&&w===g-1&&!n?S=!1:u==="comment"?(E=o[w-1]?o[w-1][0]:"empty",b=o[w+1]?o[w+1][0]:"empty",!f[E]&&!f[b]?v.slice(-1)===","?S=!1:v+=p[1]:S=!1):v+=p[1];if(!S){let w=o.reduce((y,C)=>y+C[1],"");i.raws[h]={raw:w,value:v}}i[h]=v}rule(i){i.pop();let h=new c;this.init(h,i[0][2]),h.raws.between=this.spacesAndCommentsFromEnd(i),this.raw(h,"selector",i),this.current=h}spacesAndCommentsFromEnd(i){let h,o="";for(;i.length&&(h=i[i.length-1][0],!(h!=="space"&&h!=="comment"));)o=i.pop()[1]+o;return o}spacesAndCommentsFromStart(i){let h,o="";for(;i.length&&(h=i[0][0],!(h!=="space"&&h!=="comment"));)o+=i.shift()[1];return o}spacesFromEnd(i){let h,o="";for(;i.length&&(h=i[i.length-1][0],h==="space");)o=i.pop()[1]+o;return o}stringFrom(i,h){let o="";for(let n=h;n<i.length;n++)o+=i[n][1];return i.splice(h,i.length-h),o}unclosedBlock(){let i=this.current.source.start;throw this.input.error("Unclosed block",i.line,i.column)}unclosedBracket(i){throw this.input.error("Unclosed bracket",{offset:i[2]},{offset:i[2]+1})}unexpectedClose(i){throw this.input.error("Unexpected }",{offset:i[2]},{offset:i[2]+1})}unknownWord(i){throw this.input.error("Unknown word",{offset:i[0][2]},{offset:i[0][2]+i[0][1].length})}unnamedAtrule(i,h){throw this.input.error("At-rule without name",{offset:h[2]},{offset:h[2]+h[1].length})}}return wr=l,wr}var br,ci;function rs(){if(ci)return br;ci=1;let e=xe(),t=Zo(),s=yt();function a(r,c){let f=new s(r,c),m=new t(f);try{m.parse()}catch(l){throw process.env.NODE_ENV!=="production"&&l.name==="CssSyntaxError"&&c&&c.from&&(/\.scss$/i.test(c.from)?l.message+=`
|
|
53
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(c.from)?l.message+=`
|
|
54
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(c.from)&&(l.message+=`
|
|
55
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),l}return m.root}return br=a,a.default=a,e.registerParse(a),br}var Sr,hi;function Qi(){if(hi)return Sr;hi=1;let{isClean:e,my:t}=Qr(),s=Hi(),a=pt(),r=xe(),c=Zr(),f=Yi(),m=Kr(),l=rs(),d=We(),i={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},o={Once:!0,postcssPlugin:!0,prepare:!0},n=0;function p(E){return typeof E=="object"&&typeof E.then=="function"}function u(E){let w=!1,y=i[E.type];return E.type==="decl"?w=E.prop.toLowerCase():E.type==="atrule"&&(w=E.name.toLowerCase()),w&&E.append?[y,y+"-"+w,n,y+"Exit",y+"Exit-"+w]:w?[y,y+"-"+w,y+"Exit",y+"Exit-"+w]:E.append?[y,n,y+"Exit"]:[y,y+"Exit"]}function g(E){let w;return E.type==="document"?w=["Document",n,"DocumentExit"]:E.type==="root"?w=["Root",n,"RootExit"]:w=u(E),{eventIndex:0,events:w,iterator:0,node:E,visitorIndex:0,visitors:[]}}function v(E){return E[e]=!1,E.nodes&&E.nodes.forEach(w=>v(w)),E}let S={};class b{constructor(w,y,C){this.stringified=!1,this.processed=!1;let M;if(typeof y=="object"&&y!==null&&(y.type==="root"||y.type==="document"))M=v(y);else if(y instanceof b||y instanceof m)M=v(y.root),y.map&&(typeof C.map>"u"&&(C.map={}),C.map.inline||(C.map.inline=!1),C.map.prev=y.map);else{let O=l;C.syntax&&(O=C.syntax.parse),C.parser&&(O=C.parser),O.parse&&(O=O.parse);try{M=O(y,C)}catch(R){this.processed=!0,this.error=R}M&&!M[t]&&r.rebuild(M)}this.result=new m(w,M,C),this.helpers={...S,postcss:S,result:this.result},this.plugins=this.processor.plugins.map(O=>typeof O=="object"&&O.prepare?{...O,...O.prepare(this.result)}:O)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(w){return this.async().catch(w)}finally(w){return this.async().then(w,w)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(w,y){let C=this.result.lastPlugin;try{if(y&&y.addToError(w),this.error=w,w.name==="CssSyntaxError"&&!w.plugin)w.plugin=C.postcssPlugin,w.setMessage();else if(C.postcssVersion&&process.env.NODE_ENV!=="production"){let M=C.postcssPlugin,O=C.postcssVersion,R=this.result.processor.version,D=O.split("."),A=R.split(".");(D[0]!==A[0]||parseInt(D[1])>parseInt(A[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+R+", but "+M+" uses "+O+". Perhaps this is the source of the error below.")}}catch(M){console&&console.error&&console.error(M)}return w}prepareVisitors(){this.listeners={};let w=(y,C,M)=>{this.listeners[C]||(this.listeners[C]=[]),this.listeners[C].push([y,M])};for(let y of this.plugins)if(typeof y=="object")for(let C in y){if(!h[C]&&/^[A-Z]/.test(C))throw new Error(`Unknown event ${C} in ${y.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!o[C])if(typeof y[C]=="object")for(let M in y[C])M==="*"?w(y,C,y[C][M]):w(y,C+"-"+M.toLowerCase(),y[C][M]);else typeof y[C]=="function"&&w(y,C,y[C])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let w=0;w<this.plugins.length;w++){let y=this.plugins[w],C=this.runOnRoot(y);if(p(C))try{await C}catch(M){throw this.handleError(M)}}if(this.prepareVisitors(),this.hasListener){let w=this.result.root;for(;!w[e];){w[e]=!0;let y=[g(w)];for(;y.length>0;){let C=this.visitTick(y);if(p(C))try{await C}catch(M){let O=y[y.length-1].node;throw this.handleError(M,O)}}}if(this.listeners.OnceExit)for(let[y,C]of this.listeners.OnceExit){this.result.lastPlugin=y;try{if(w.type==="document"){let M=w.nodes.map(O=>C(O,this.helpers));await Promise.all(M)}else await C(w,this.helpers)}catch(M){throw this.handleError(M)}}}return this.processed=!0,this.stringify()}runOnRoot(w){this.result.lastPlugin=w;try{if(typeof w=="object"&&w.Once){if(this.result.root.type==="document"){let y=this.result.root.nodes.map(C=>w.Once(C,this.helpers));return p(y[0])?Promise.all(y):y}return w.Once(this.result.root,this.helpers)}else if(typeof w=="function")return w(this.result.root,this.result)}catch(y){throw this.handleError(y)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let w=this.result.opts,y=a;w.syntax&&(y=w.syntax.stringify),w.stringifier&&(y=w.stringifier),y.stringify&&(y=y.stringify);let M=new s(y,this.result.root,this.result.opts).generate();return this.result.css=M[0],this.result.map=M[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let w of this.plugins){let y=this.runOnRoot(w);if(p(y))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let w=this.result.root;for(;!w[e];)w[e]=!0,this.walkSync(w);if(this.listeners.OnceExit)if(w.type==="document")for(let y of w.nodes)this.visitSync(this.listeners.OnceExit,y);else this.visitSync(this.listeners.OnceExit,w)}return this.result}then(w,y){return process.env.NODE_ENV!=="production"&&("from"in this.opts||f("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(w,y)}toString(){return this.css}visitSync(w,y){for(let[C,M]of w){this.result.lastPlugin=C;let O;try{O=M(y,this.helpers)}catch(R){throw this.handleError(R,y.proxyOf)}if(y.type!=="root"&&y.type!=="document"&&!y.parent)return!0;if(p(O))throw this.getAsyncError()}}visitTick(w){let y=w[w.length-1],{node:C,visitors:M}=y;if(C.type!=="root"&&C.type!=="document"&&!C.parent){w.pop();return}if(M.length>0&&y.visitorIndex<M.length){let[R,D]=M[y.visitorIndex];y.visitorIndex+=1,y.visitorIndex===M.length&&(y.visitors=[],y.visitorIndex=0),this.result.lastPlugin=R;try{return D(C.toProxy(),this.helpers)}catch(A){throw this.handleError(A,C)}}if(y.iterator!==0){let R=y.iterator,D;for(;D=C.nodes[C.indexes[R]];)if(C.indexes[R]+=1,!D[e]){D[e]=!0,w.push(g(D));return}y.iterator=0,delete C.indexes[R]}let O=y.events;for(;y.eventIndex<O.length;){let R=O[y.eventIndex];if(y.eventIndex+=1,R===n){C.nodes&&C.nodes.length&&(C[e]=!0,y.iterator=C.getIterator());return}else if(this.listeners[R]){y.visitors=this.listeners[R];return}}w.pop()}walkSync(w){w[e]=!0;let y=u(w);for(let C of y)if(C===n)w.nodes&&w.each(M=>{M[e]||this.walkSync(M)});else{let M=this.listeners[C];if(M&&this.visitSync(M,w.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return b.registerPostcss=E=>{S=E},Sr=b,b.default=b,d.registerLazyResult(b),c.registerLazyResult(b),Sr}var vr,fi;function Ko(){if(fi)return vr;fi=1;let e=Hi(),t=pt(),s=Yi(),a=rs(),r=Kr();class c{constructor(m,l,d){l=l.toString(),this.stringified=!1,this._processor=m,this._css=l,this._opts=d,this._map=void 0;let i,h=t;this.result=new r(this._processor,i,this._opts),this.result.css=l;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let n=new e(h,i,this._opts,l);if(n.isMap()){let[p,u]=n.generate();p&&(this.result.css=p),u&&(this.result.map=u)}else n.clearAnnotation(),this.result.css=n.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(m){return this.async().catch(m)}finally(m){return this.async().then(m,m)}sync(){if(this.error)throw this.error;return this.result}then(m,l){return process.env.NODE_ENV!=="production"&&("from"in this._opts||s("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(m,l)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let m,l=a;try{m=l(this._css,this._opts)}catch(d){this.error=d}if(this.error)throw this.error;return this._root=m,m}get[Symbol.toStringTag](){return"NoWorkResult"}}return vr=c,c.default=c,vr}var Cr,di;function ea(){if(di)return Cr;di=1;let e=Ko(),t=Qi(),s=Zr(),a=We();class r{constructor(f=[]){this.version="8.4.38",this.plugins=this.normalize(f)}normalize(f){let m=[];for(let l of f)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))m=m.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)m.push(l);else if(typeof l=="function")m.push(l);else if(typeof l=="object"&&(l.parse||l.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(l+" is not a PostCSS plugin");return m}process(f,m={}){return!this.plugins.length&&!m.parser&&!m.stringifier&&!m.syntax?new e(this,f,m):new t(this,f,m)}use(f){return this.plugins=this.plugins.concat(this.normalize([f])),this}}return Cr=r,r.default=r,a.registerProcessor(r),s.registerProcessor(r),Cr}var Er,pi;function ta(){if(pi)return Er;pi=1;let e=gt(),t=Gi(),s=wt(),a=es(),r=yt(),c=We(),f=ts();function m(l,d){if(Array.isArray(l))return l.map(o=>m(o));let{inputs:i,...h}=l;if(i){d=[];for(let o of i){let n={...o,__proto__:r.prototype};n.map&&(n.map={...n.map,__proto__:t.prototype}),d.push(n)}}if(h.nodes&&(h.nodes=l.nodes.map(o=>m(o,d))),h.source){let{inputId:o,...n}=h.source;h.source=n,o!=null&&(h.source.input=d[o])}if(h.type==="root")return new c(h);if(h.type==="decl")return new e(h);if(h.type==="rule")return new f(h);if(h.type==="comment")return new s(h);if(h.type==="atrule")return new a(h);throw new Error("Unknown node type: "+l.type)}return Er=m,m.default=m,Er}var xr,mi;function ra(){if(mi)return xr;mi=1;let e=Jr(),t=gt(),s=Qi(),a=xe(),r=ea(),c=pt(),f=ta(),m=Zr(),l=Xi(),d=wt(),i=es(),h=Kr(),o=yt(),n=rs(),p=Ji(),u=ts(),g=We(),v=mt();function S(...b){return b.length===1&&Array.isArray(b[0])&&(b=b[0]),new r(b)}return S.plugin=function(E,w){let y=!1;function C(...O){console&&console.warn&&!y&&(y=!0,console.warn(E+`: postcss.plugin was deprecated. Migration guide:
|
|
56
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(E+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
57
|
+
https://www.w3ctech.com/topic/2226`));let R=w(...O);return R.postcssPlugin=E,R.postcssVersion=new r().version,R}let M;return Object.defineProperty(C,"postcss",{get(){return M||(M=C()),M}}),C.process=function(O,R,D){return S([C(D)]).process(O,R)},C},S.stringify=c,S.parse=n,S.fromJSON=f,S.list=p,S.comment=b=>new d(b),S.atRule=b=>new i(b),S.decl=b=>new t(b),S.rule=b=>new u(b),S.root=b=>new g(b),S.document=b=>new m(b),S.CssSyntaxError=e,S.Declaration=t,S.Container=a,S.Processor=r,S.Document=m,S.Comment=d,S.Warning=l,S.AtRule=i,S.Result=h,S.Input=o,S.Rule=u,S.Root=g,S.Node=v,s.registerPostcss(S),xr=S,S.default=S,xr}var sa=ra(),V=jo(sa);V.stringify;V.fromJSON;V.plugin;V.parse;V.list;V.document;V.comment;V.atRule;V.rule;V.decl;V.root;V.CssSyntaxError;V.Declaration;V.Container;V.Processor;V.Document;V.Comment;V.Warning;V.AtRule;V.Result;V.Input;V.Rule;V.Root;V.Node;var Ar=class e{constructor(...t){le(this,"parentElement",null),le(this,"parentNode",null),le(this,"ownerDocument"),le(this,"firstChild",null),le(this,"lastChild",null),le(this,"previousSibling",null),le(this,"nextSibling",null),le(this,"ELEMENT_NODE",1),le(this,"TEXT_NODE",3),le(this,"nodeType"),le(this,"nodeName"),le(this,"RRNodeType")}get childNodes(){let t=[],s=this.firstChild;for(;s;)t.push(s),s=s.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,s){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var gi={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},yi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xe={},Zi={},ia=()=>!!globalThis.Zone;function ss(e){if(Xe[e])return Xe[e];let t=globalThis[e],s=t.prototype,a=e in gi?gi[e]:void 0,r=!!(a&&a.every(m=>{var l,d;return!!((d=(l=Object.getOwnPropertyDescriptor(s,m))==null?void 0:l.get)!=null&&d.toString().includes("[native code]"))})),c=e in yi?yi[e]:void 0,f=!!(c&&c.every(m=>{var l;return typeof s[m]=="function"&&((l=s[m])==null?void 0:l.toString().includes("[native code]"))}));if(r&&f&&!ia())return Xe[e]=t.prototype,t.prototype;try{let m=document.createElement("iframe");m.style.display="none",document.body.appendChild(m);let l=m.contentWindow;if(!l)return t.prototype;let d=l[e].prototype;if(!d)return m.remove(),s;let i=navigator.userAgent;return i.includes("Safari")&&!i.includes("Chrome")?(m.classList.add("rr-block"),m.setAttribute("__rrwebUntaintedMutationObserver",""),Zi[e]=()=>m.remove()):m.remove(),Xe[e]=d}catch{return s}}var Mr={};function oe(e,t,s){var a,r;let c=(a=Mr[e])==null?void 0:a[s];if(c)return c.call(t);let f=ss(e),m=(r=Object.getOwnPropertyDescriptor(f,s))==null?void 0:r.get;return m?((Mr[e]||(Mr[e]={}))[s]=m,m.call(t)):t[s]}var Rr={};function Ki(e,t,s){let a=`${e}.${String(s)}`;if(Rr[a])return Rr[a].bind(t);let c=ss(e)[s];return typeof c!="function"?t[s]:(Rr[a]=c,c.bind(t))}function na(e){return oe("Node",e,"ownerDocument")}function oa(e){return oe("Node",e,"childNodes")}function aa(e){return oe("Node",e,"parentNode")}function la(e){return oe("Node",e,"parentElement")}function ua(e){return oe("Node",e,"textContent")}function ca(e){return oe("Node",e,"firstChild")}function ha(e){return oe("Node",e,"lastChild")}function fa(e){return oe("Node",e,"nextSibling")}function da(e){return oe("Node",e,"previousSibling")}function pa(e,t){return Ki("Node",e,"contains")(t)}function ma(e){return Ki("Node",e,"getRootNode")()}function ga(e){return!e||!("host"in e)?null:oe("ShadowRoot",e,"host")}function ya(e){return e.styleSheets}function wa(e){return!e||!("shadowRoot"in e)?null:oe("Element",e,"shadowRoot")}function ba(e,t){return oe("Element",e,"querySelector")(t)}function Sa(e,t){return oe("Element",e,"querySelectorAll")(t)}function en(){return[ss("MutationObserver").constructor,Zi.MutationObserver??(()=>{})]}var Ue=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ue=()=>new Date().getTime());function Me(e,t,s){try{if(!(t in e))return()=>{};let a=e[t],r=s(a);return typeof r=="function"&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:a}})),e[t]=r,()=>{e[t]=a}}catch{return()=>{}}}var _={ownerDocument:na,childNodes:oa,parentNode:aa,parentElement:la,textContent:ua,firstChild:ca,lastChild:ha,nextSibling:fa,previousSibling:da,contains:pa,getRootNode:ma,host:ga,styleSheets:ya,shadowRoot:wa,querySelector:ba,querySelectorAll:Sa,nowTimestamp:Ue,mutationObserverCtor:en,patch:Me};function ee(e,t,s=document){let a={capture:!0,passive:!0};return s.addEventListener(e,t,a),()=>s.removeEventListener(e,t,a)}var Ne=`Please stop import mirror directly. Instead of that,\r
|
|
58
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
59
|
+
or you can use record.mirror to access the mirror instance during recording.`,wi={map:{},getId(){return console.error(Ne),-1},getNode(){return console.error(Ne),null},removeNodeFromMap(){console.error(Ne)},has(){return console.error(Ne),!1},reset(){console.error(Ne)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(wi=new Proxy(wi,{get(e,t,s){return t==="map"&&console.error(Ne),Reflect.get(e,t,s)}}));function Be(e,t,s={}){let a=null,r=0;return function(...c){let f=Date.now();!r&&s.leading===!1&&(r=f);let m=t-(f-r),l=this;m<=0||m>t?(a&&(clearTimeout(a),a=null),r=f,e.apply(l,c)):!a&&s.trailing!==!1&&(a=setTimeout(()=>{r=s.leading===!1?0:Date.now(),a=null,e.apply(l,c)},m))}}function bt(e,t,s,a,r=window){let c=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,a?s:{set(f){setTimeout(()=>{s.set.call(this,f)},0),c&&c.set&&c.set.call(this,f)}}),()=>bt(e,t,c||{},!0)}function tn(e){var t,s,a,r;let c=e.document;return{left:c.scrollingElement?c.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:c.documentElement.scrollLeft||c?.body&&((t=_.parentElement(c.body))==null?void 0:t.scrollLeft)||((s=c?.body)==null?void 0:s.scrollLeft)||0,top:c.scrollingElement?c.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:c?.documentElement.scrollTop||c?.body&&((a=_.parentElement(c.body))==null?void 0:a.scrollTop)||((r=c?.body)==null?void 0:r.scrollTop)||0}}function rn(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function sn(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function nn(e){return e?e.nodeType===e.ELEMENT_NODE?e:_.parentElement(e):null}function te(e,t,s,a){if(!e)return!1;let r=nn(e);if(!r)return!1;try{if(typeof t=="string"){if(r.classList.contains(t)||a&&r.closest("."+t)!==null)return!0}else if(nt(r,t,a))return!0}catch{}return!!(s&&(r.matches(s)||a&&r.closest(s)!==null))}function va(e,t){return t.getId(e)!==-1}function Nr(e,t,s){return e.tagName==="TITLE"&&s.headTitleMutations?!0:t.getId(e)===it}function on(e,t){if(Pe(e))return!1;let s=t.getId(e);if(!t.has(s))return!0;let a=_.parentNode(e);return a&&a.nodeType===e.DOCUMENT_NODE?!1:a?on(a,t):!0}function Dr(e){return!!e.changedTouches}function Ca(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function an(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function ln(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Tr(e){return e?e instanceof Ar&&"shadowRoot"in e?!!e.shadowRoot:!!_.shadowRoot(e):!1}var _r=class{constructor(){I(this,"id",1),I(this,"styleIDMap",new WeakMap),I(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,s){if(this.has(t))return this.getId(t);let a;return s===void 0?a=this.id++:a=s,this.styleIDMap.set(t,a),this.idStyleMap.set(a,t),a}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function un(e){var t;let s=null;return"getRootNode"in e&&((t=_.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&_.host(_.getRootNode(e))&&(s=_.host(_.getRootNode(e))),s}function Ea(e){let t=e,s;for(;s=un(t);)t=s;return t}function xa(e){let t=_.ownerDocument(e);if(!t)return!1;let s=Ea(e);return _.contains(t,s)}function cn(e){let t=_.ownerDocument(e);return t?_.contains(t,e)||xa(e):!1}var L=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(L||{}),k=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(k||{}),re=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(re||{}),ge=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ge||{}),Te=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Te||{}),Oe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Oe||{});var hn=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(hn||{}),bi=(e,t)=>`${e}@${t}`,kr=class{constructor(){I(this,"frozen",!1),I(this,"locked",!1),I(this,"texts",[]),I(this,"attributes",[]),I(this,"attributeMap",new WeakMap),I(this,"removes",[]),I(this,"mapRemoves",[]),I(this,"movedMap",{}),I(this,"addedSet",new Set),I(this,"movedSet",new Set),I(this,"droppedSet",new Set),I(this,"removesSubTreeCache",new Set),I(this,"mutationCb"),I(this,"blockClass"),I(this,"blockSelector"),I(this,"maskTextClass"),I(this,"maskTextSelector"),I(this,"inlineStylesheet"),I(this,"maskInputOptions"),I(this,"maskTextFn"),I(this,"maskInputFn"),I(this,"keepIframeSrcFn"),I(this,"recordCanvas"),I(this,"inlineImages"),I(this,"slimDOMOptions"),I(this,"dataURLOptions"),I(this,"doc"),I(this,"mirror"),I(this,"iframeManager"),I(this,"stylesheetManager"),I(this,"shadowDomManager"),I(this,"canvasManager"),I(this,"processedNodeManager"),I(this,"unattachedDoc"),I(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),I(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],s=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let o of this.movedSet){let n=_.parentNode(o);this.removesSubTreeCache.has(n)&&!this.movedSet.has(n)||this.addedSet.add(o)}let a=null,r=null,c=-1,f=null,m=!1,l=new Set,d=this.addedSet.values(),i=d.next();for(;this.addedSet.size;){if(a!==null&&this.addedSet.has(_.previousSibling(a)))f=a,a=_.previousSibling(a);else{for(this.addedSet.has(i.value)||(i=d.next()),a=i.value;;){if(r=_.parentNode(a),this.addedSet.has(r)){a=r;continue}break}if(l.has(r))r=null;else if(r){if(cn(r)?(m=Si(this.droppedSet,r)||this.removesSubTreeCache.has(r),m&&Si(this.movedSet,a)&&(m=!1)):m=!0,this.addedSet.has(_.lastChild(r)))a=_.lastChild(r),f=null;else for(;;){if(f=_.nextSibling(a),this.addedSet.has(f)){a=f;continue}break}if(c=Pe(r)?this.mirror.getId(un(a)):this.mirror.getId(r),c===-1&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let u=_.host(r);c=this.mirror.getId(u)}}}if(this.addedSet.delete(a),!r||c===-1){l.add(a);continue}else if(m){this.droppedSet.add(a);continue}let o=!1;if(a.nodeType===Node.TEXT_NODE){let u=r.tagName;if(u==="TEXTAREA")continue;u==="STYLE"&&s.has(c)&&(o=!0)}let n=f?this.mirror.getId(f):null;for(;n===it;)f=f&&_.nextSibling(f),n=f&&this.mirror.getId(f);if(n===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",f),a=null;continue}let p=Ae(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:u=>{an(u,this.mirror)&&this.iframeManager.addIframe(u),ln(u,this.mirror)&&this.stylesheetManager.trackLinkElement(u),Tr(a)&&this.shadowDomManager.addShadowRoot(_.shadowRoot(a),this.doc)},onIframeLoad:(u,g)=>{this.iframeManager.attachIframe(u,g),this.shadowDomManager.observeAttachShadow(u)},onStylesheetLoad:(u,g)=>{this.stylesheetManager.attachLinkElement(u,g)},cssCaptured:o});p&&(t.push({parentId:c,nextId:n,node:p}),s.add(p.id))}let h={texts:this.texts.map(o=>{let n=o.node,p=_.parentNode(n);return p&&p.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(p),{id:this.mirror.getId(n),value:o.value}}).filter(o=>!s.has(o.id)).filter(o=>this.mirror.has(o.id)),attributes:this.attributes.map(o=>{let{attributes:n}=o;if(typeof n.style=="string"){let p=JSON.stringify(o.styleDiff),u=JSON.stringify(o._unchangedStyles);p.length<n.style.length&&(p+u).split("var(").length===n.style.split("var(").length&&(n.style=o.styleDiff)}return{id:this.mirror.getId(o.node),attributes:n}}).filter(o=>!s.has(o.id)).filter(o=>this.mirror.has(o.id)),removes:this.removes,adds:t};!h.texts.length&&!h.attributes.length&&!h.removes.length&&!h.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(h))}),I(this,"genTextAreaValueMutation",t=>{let s=this.attributeMap.get(t);s||(s={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t,s));let a=Array.from(_.childNodes(t),r=>_.textContent(r)||"").join("");s.attributes.value=tt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:rt(t),value:a,maskInputFn:this.maskInputFn})}),I(this,"processMutation",t=>{if(!Nr(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let s=_.textContent(t.target);!te(t.target,this.blockClass,this.blockSelector,!1)&&s!==t.oldValue&&this.texts.push({value:Li(t.target,this.maskTextClass,this.maskTextSelector,!0)&&s?this.maskTextFn?this.maskTextFn(s,nn(t.target)):s.replace(/[\S]/g,"*"):s,node:t.target});break}case"attributes":{let s=t.target,a=Se(s.tagName),r=t.attributeName,c=t.target.getAttribute(r);if(r==="value"){let m=rt(s);c=tt({element:s,maskInputOptions:this.maskInputOptions,tagName:s.tagName,type:m,value:c,maskInputFn:this.maskInputFn})}if(te(t.target,this.blockClass,this.blockSelector,!1)||c===t.oldValue)return;let f=this.attributeMap.get(t.target);if(a==="iframe"&&r==="src"&&!this.keepIframeSrcFn(c))if(!s.contentDocument)r="rr_src";else return;if(f||(f={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(f),this.attributeMap.set(t.target,f)),r==="type"&&a==="input"&&(t.oldValue||"").toLowerCase()==="password"&&s.setAttribute("data-rr-is-password","true"),!Pi(a,r))if(f.attributes[r]=ki(this.doc,a,Se(r),c),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let m=this.unattachedDoc.createElement("span");t.oldValue&&m.setAttribute("style",t.oldValue);for(let l of Array.from(s.style)){let d=s.style.getPropertyValue(l),i=s.style.getPropertyPriority(l);d!==m.style.getPropertyValue(l)||i!==m.style.getPropertyPriority(l)?i===""?f.styleDiff[l]=d:f.styleDiff[l]=[d,i]:f._unchangedStyles[l]=[d,i]}for(let l of Array.from(m.style))s.style.getPropertyValue(l)===""&&(f.styleDiff[l]=!1)}else r==="open"&&s.tagName==="DIALOG"&&(s.matches("dialog:modal")?f.attributes.rr_open_mode="modal":f.attributes.rr_open_mode="non-modal");break}case"childList":{if(te(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(s=>this.genAdds(s,t.target)),t.removedNodes.forEach(s=>{let a=this.mirror.getId(s),r=Pe(t.target)?this.mirror.getId(_.host(t.target)):this.mirror.getId(t.target);te(t.target,this.blockClass,this.blockSelector,!1)||Nr(s,this.mirror,this.slimDOMOptions)||!va(s,this.mirror)||(this.addedSet.has(s)?(Pr(this.addedSet,s),this.droppedSet.add(s)):this.addedSet.has(t.target)&&a===-1||on(t.target,this.mirror)||(this.movedSet.has(s)&&this.movedMap[bi(a,r)]?Pr(this.movedSet,s):(this.removes.push({parentId:r,id:a,isShadow:Pe(t.target)&&Le(t.target)?!0:void 0}),Ma(s,this.removesSubTreeCache))),this.mapRemoves.push(s))});break}}}),I(this,"genAdds",(t,s)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Nr(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let a=null;s&&this.mirror.hasNode(s)&&(a=this.mirror.getId(s)),a&&a!==-1&&(this.movedMap[bi(this.mirror.getId(t),a)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);te(t,this.blockClass,this.blockSelector,!1)||(_.childNodes(t).forEach(a=>this.genAdds(a)),Tr(t)&&_.childNodes(_.shadowRoot(t)).forEach(a=>{this.processedNodeManager.add(a,this),this.genAdds(a,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(s=>{this[s]=t[s]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Pr(e,t){e.delete(t),_.childNodes(t).forEach(s=>Pr(e,s))}function Ma(e,t){let s=[e];for(;s.length;){let a=s.pop();t.has(a)||(t.add(a),_.childNodes(a).forEach(r=>s.push(r)))}}function Si(e,t){return e.size===0?!1:fn(e,t)}function fn(e,t){if(e.has(t))return!0;let s=_.parentNode(t);return s?fn(e,s):!1}var Fe;function Ra(e){Fe=e}function Na(){Fe=void 0}var P=e=>Fe?(...s)=>{try{return e(...s)}catch(a){if(Fe&&Fe(a)===!0)return;throw a}}:e,Ce=[];function ze(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function dn(e,t){let s=new kr;Ce.push(s),s.init(e);let[a,r]=en(),c=new a(P(s.processMutations.bind(s)));return c.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[c,r]}function Oa({mousemoveCb:e,sampling:t,doc:s,mirror:a}){if(t.mousemove===!1)return()=>{};let r=typeof t.mousemove=="number"?t.mousemove:50,c=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,f=[],m,l=Be(P(h=>{let o=Date.now()-m;e(f.map(n=>(n.timeOffset-=o,n)),h),f=[],m=null}),c),d=P(Be(P(h=>{let o=ze(h),{clientX:n,clientY:p}=Dr(h)?h.changedTouches[0]:h;m||(m=Ue()),f.push({x:n,y:p,id:a.getId(o),timeOffset:Ue()-m}),l(typeof DragEvent<"u"&&h instanceof DragEvent?k.Drag:h instanceof MouseEvent?k.MouseMove:k.TouchMove)}),r,{trailing:!1})),i=[ee("mousemove",d,s),ee("touchmove",d,s),ee("drag",d,s)];return P(()=>{i.forEach(h=>h())})}function Ia({mouseInteractionCb:e,doc:t,mirror:s,blockClass:a,blockSelector:r,sampling:c}){if(c.mouseInteraction===!1)return()=>{};let f=c.mouseInteraction===!0||c.mouseInteraction===void 0?{}:c.mouseInteraction,m=[],l=null,d=i=>h=>{let o=ze(h);if(te(o,a,r,!0))return;let n=null,p=i;if("pointerType"in h){switch(h.pointerType){case"mouse":n=ge.Mouse;break;case"touch":n=ge.Touch;break;case"pen":n=ge.Pen;break}n===ge.Touch?re[i]===re.MouseDown?p="TouchStart":re[i]===re.MouseUp&&(p="TouchEnd"):ge.Pen}else Dr(h)&&(n=ge.Touch);n!==null?(l=n,(p.startsWith("Touch")&&n===ge.Touch||p.startsWith("Mouse")&&n===ge.Mouse)&&(n=null)):re[i]===re.Click&&(n=l,l=null);let u=Dr(h)?h.changedTouches[0]:h;if(!u)return;let g=s.getId(o),{clientX:v,clientY:S}=u;P(e)({type:re[p],id:g,x:v,y:S,...n!==null&&{pointerType:n}})};return Object.keys(re).filter(i=>Number.isNaN(Number(i))&&!i.endsWith("_Departed")&&f[i]!==!1).forEach(i=>{let h=Se(i),o=d(i);if(window.PointerEvent)switch(re[i]){case re.MouseDown:case re.MouseUp:h=h.replace("mouse","pointer");break;case re.TouchStart:case re.TouchEnd:return}m.push(ee(h,o,t))}),P(()=>{m.forEach(i=>i())})}function pn({scrollCb:e,doc:t,mirror:s,blockClass:a,blockSelector:r,sampling:c}){let f=P(Be(P(m=>{let l=ze(m);if(!l||te(l,a,r,!0))return;let d=s.getId(l);if(l===t&&t.defaultView){let i=tn(t.defaultView);e({id:d,x:i.left,y:i.top})}else e({id:d,x:l.scrollLeft,y:l.scrollTop})}),c.scroll||100));return ee("scroll",f,t)}function Aa({viewportResizeCb:e},{win:t}){let s=-1,a=-1,r=P(Be(P(()=>{let c=rn(),f=sn();(s!==c||a!==f)&&(e({width:Number(f),height:Number(c)}),s=c,a=f)}),200));return ee("resize",r,t)}var Da=["INPUT","TEXTAREA","SELECT"],vi=new WeakMap;function Ta({inputCb:e,doc:t,mirror:s,blockClass:a,blockSelector:r,ignoreClass:c,ignoreSelector:f,maskInputOptions:m,maskInputFn:l,sampling:d,userTriggeredOnInput:i}){function h(S){let b=ze(S),E=S.isTrusted,w=b&&b.tagName;if(b&&w==="OPTION"&&(b=_.parentElement(b)),!b||!w||Da.indexOf(w)<0||te(b,a,r,!0)||b.classList.contains(c)||f&&b.matches(f))return;let y=b.value,C=!1,M=rt(b)||"";M==="radio"||M==="checkbox"?C=b.checked:(m[w.toLowerCase()]||m[M])&&(y=tt({element:b,maskInputOptions:m,tagName:w,type:M,value:y,maskInputFn:l})),o(b,i?{text:y,isChecked:C,userTriggered:E}:{text:y,isChecked:C});let O=b.name;M==="radio"&&O&&C&&t.querySelectorAll(`input[type="radio"][name="${O}"]`).forEach(R=>{if(R!==b){let D=R.value;o(R,i?{text:D,isChecked:!C,userTriggered:!1}:{text:D,isChecked:!C})}})}function o(S,b){let E=vi.get(S);if(!E||E.text!==b.text||E.isChecked!==b.isChecked){vi.set(S,b);let w=s.getId(S);P(e)({...b,id:w})}}let p=(d.input==="last"?["change"]:["input","change"]).map(S=>ee(S,P(h),t)),u=t.defaultView;if(!u)return()=>{p.forEach(S=>S())};let g=u.Object.getOwnPropertyDescriptor(u.HTMLInputElement.prototype,"value"),v=[[u.HTMLInputElement.prototype,"value"],[u.HTMLInputElement.prototype,"checked"],[u.HTMLSelectElement.prototype,"value"],[u.HTMLTextAreaElement.prototype,"value"],[u.HTMLSelectElement.prototype,"selectedIndex"],[u.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...v.map(S=>bt(S[0],S[1],{set(){P(h)({target:this,isTrusted:!1})}},!1,u))),P(()=>{p.forEach(S=>S())})}function ot(e){let t=[];function s(a,r){if(Je("CSSGroupingRule")&&a.parentRule instanceof CSSGroupingRule||Je("CSSMediaRule")&&a.parentRule instanceof CSSMediaRule||Je("CSSSupportsRule")&&a.parentRule instanceof CSSSupportsRule||Je("CSSConditionRule")&&a.parentRule instanceof CSSConditionRule){let f=Array.from(a.parentRule.cssRules).indexOf(a);return r.unshift(f),s(a.parentRule,r)}else if(a.parentStyleSheet){let f=Array.from(a.parentStyleSheet.cssRules).indexOf(a);r.unshift(f)}return r}return s(e,t)}function be(e,t,s){let a,r;return e?(e.ownerNode?a=t.getId(e.ownerNode):r=s.getId(e),{styleId:r,id:a}):{}}function _a({styleSheetRuleCb:e,mirror:t,stylesheetManager:s},{win:a}){if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};let r=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(r,{apply:P((i,h,o)=>{let[n,p]=o,{id:u,styleId:g}=be(h,t,s.styleMirror);return(u&&u!==-1||g&&g!==-1)&&e({id:u,styleId:g,adds:[{rule:n,index:p}]}),i.apply(h,o)})}),a.CSSStyleSheet.prototype.addRule=function(i,h,o=this.cssRules.length){let n=`${i} { ${h} }`;return a.CSSStyleSheet.prototype.insertRule.apply(this,[n,o])};let c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:P((i,h,o)=>{let[n]=o,{id:p,styleId:u}=be(h,t,s.styleMirror);return(p&&p!==-1||u&&u!==-1)&&e({id:p,styleId:u,removes:[{index:n}]}),i.apply(h,o)})}),a.CSSStyleSheet.prototype.removeRule=function(i){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[i])};let f;a.CSSStyleSheet.prototype.replace&&(f=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(f,{apply:P((i,h,o)=>{let[n]=o,{id:p,styleId:u}=be(h,t,s.styleMirror);return(p&&p!==-1||u&&u!==-1)&&e({id:p,styleId:u,replace:n}),i.apply(h,o)})}));let m;a.CSSStyleSheet.prototype.replaceSync&&(m=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(m,{apply:P((i,h,o)=>{let[n]=o,{id:p,styleId:u}=be(h,t,s.styleMirror);return(p&&p!==-1||u&&u!==-1)&&e({id:p,styleId:u,replaceSync:n}),i.apply(h,o)})}));let l={};Qe("CSSGroupingRule")?l.CSSGroupingRule=a.CSSGroupingRule:(Qe("CSSMediaRule")&&(l.CSSMediaRule=a.CSSMediaRule),Qe("CSSConditionRule")&&(l.CSSConditionRule=a.CSSConditionRule),Qe("CSSSupportsRule")&&(l.CSSSupportsRule=a.CSSSupportsRule));let d={};return Object.entries(l).forEach(([i,h])=>{d[i]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(d[i].insertRule,{apply:P((o,n,p)=>{let[u,g]=p,{id:v,styleId:S}=be(n.parentStyleSheet,t,s.styleMirror);return(v&&v!==-1||S&&S!==-1)&&e({id:v,styleId:S,adds:[{rule:u,index:[...ot(n),g||0]}]}),o.apply(n,p)})}),h.prototype.deleteRule=new Proxy(d[i].deleteRule,{apply:P((o,n,p)=>{let[u]=p,{id:g,styleId:v}=be(n.parentStyleSheet,t,s.styleMirror);return(g&&g!==-1||v&&v!==-1)&&e({id:g,styleId:v,removes:[{index:[...ot(n),u]}]}),o.apply(n,p)})})}),P(()=>{a.CSSStyleSheet.prototype.insertRule=r,a.CSSStyleSheet.prototype.deleteRule=c,f&&(a.CSSStyleSheet.prototype.replace=f),m&&(a.CSSStyleSheet.prototype.replaceSync=m),Object.entries(l).forEach(([i,h])=>{h.prototype.insertRule=d[i].insertRule,h.prototype.deleteRule=d[i].deleteRule})})}function mn({mirror:e,stylesheetManager:t},s){var a,r,c;let f=null;s.nodeName==="#document"?f=e.getId(s):f=e.getId(_.host(s));let m=s.nodeName==="#document"?(a=s.defaultView)==null?void 0:a.Document:(c=(r=s.ownerDocument)==null?void 0:r.defaultView)==null?void 0:c.ShadowRoot,l=m?.prototype?Object.getOwnPropertyDescriptor(m?.prototype,"adoptedStyleSheets"):void 0;return f===null||f===-1||!m||!l?()=>{}:(Object.defineProperty(s,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var d;return(d=l.get)==null?void 0:d.call(this)},set(d){var i;let h=(i=l.set)==null?void 0:i.call(this,d);if(f!==null&&f!==-1)try{t.adoptStyleSheets(d,f)}catch{}return h}}),P(()=>{Object.defineProperty(s,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function ka({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:s,stylesheetManager:a},{win:r}){let c=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(c,{apply:P((m,l,d)=>{var i;let[h,o,n]=d;if(s.has(h))return c.apply(l,[h,o,n]);let{id:p,styleId:u}=be((i=l.parentRule)==null?void 0:i.parentStyleSheet,t,a.styleMirror);return(p&&p!==-1||u&&u!==-1)&&e({id:p,styleId:u,set:{property:h,value:o,priority:n},index:ot(l.parentRule)}),m.apply(l,d)})});let f=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(f,{apply:P((m,l,d)=>{var i;let[h]=d;if(s.has(h))return f.apply(l,[h]);let{id:o,styleId:n}=be((i=l.parentRule)==null?void 0:i.parentStyleSheet,t,a.styleMirror);return(o&&o!==-1||n&&n!==-1)&&e({id:o,styleId:n,remove:{property:h},index:ot(l.parentRule)}),m.apply(l,d)})}),P(()=>{r.CSSStyleDeclaration.prototype.setProperty=c,r.CSSStyleDeclaration.prototype.removeProperty=f})}function Pa({mediaInteractionCb:e,blockClass:t,blockSelector:s,mirror:a,sampling:r,doc:c}){let f=P(l=>Be(P(d=>{let i=ze(d);if(!i||te(i,t,s,!0))return;let{currentTime:h,volume:o,muted:n,playbackRate:p,loop:u}=i;e({type:l,id:a.getId(i),currentTime:h,volume:o,muted:n,playbackRate:p,loop:u})}),r.media||500)),m=[ee("play",f(Oe.Play),c),ee("pause",f(Oe.Pause),c),ee("seeked",f(Oe.Seeked),c),ee("volumechange",f(Oe.VolumeChange),c),ee("ratechange",f(Oe.RateChange),c)];return P(()=>{m.forEach(l=>l())})}function La({fontCb:e,doc:t}){let s=t.defaultView;if(!s)return()=>{};let a=[],r=new WeakMap,c=s.FontFace;s.FontFace=function(l,d,i){let h=new c(l,d,i);return r.set(h,{family:l,buffer:typeof d!="string",descriptors:i,fontSource:typeof d=="string"?d:JSON.stringify(Array.from(new Uint8Array(d)))}),h};let f=Me(t.fonts,"add",function(m){return function(l){return setTimeout(P(()=>{let d=r.get(l);d&&(e(d),r.delete(l))}),0),m.apply(this,[l])}});return a.push(()=>{s.FontFace=c}),a.push(f),P(()=>{a.forEach(m=>m())})}function Fa(e){let{doc:t,mirror:s,blockClass:a,blockSelector:r,selectionCb:c}=e,f=!0,m=P(()=>{let l=t.getSelection();if(!l||f&&l?.isCollapsed)return;f=l.isCollapsed||!1;let d=[],i=l.rangeCount||0;for(let h=0;h<i;h++){let o=l.getRangeAt(h),{startContainer:n,startOffset:p,endContainer:u,endOffset:g}=o;te(n,a,r,!0)||te(u,a,r,!0)||d.push({start:s.getId(n),startOffset:p,end:s.getId(u),endOffset:g})}c({ranges:d})});return m(),ee("selectionchange",m)}function Ua({doc:e,customElementCb:t}){let s=e.defaultView;return!s||!s.customElements?()=>{}:Me(s.customElements,"define",function(r){return function(c,f,m){try{t({define:{name:c}})}catch{console.warn(`Custom element callback failed for ${c}`)}return r.apply(this,[c,f,m])}})}function Ba(e,t){let{mutationCb:s,mousemoveCb:a,mouseInteractionCb:r,scrollCb:c,viewportResizeCb:f,inputCb:m,mediaInteractionCb:l,styleSheetRuleCb:d,styleDeclarationCb:i,canvasMutationCb:h,fontCb:o,selectionCb:n,customElementCb:p}=e;e.mutationCb=(...u)=>{t.mutation&&t.mutation(...u),s(...u)},e.mousemoveCb=(...u)=>{t.mousemove&&t.mousemove(...u),a(...u)},e.mouseInteractionCb=(...u)=>{t.mouseInteraction&&t.mouseInteraction(...u),r(...u)},e.scrollCb=(...u)=>{t.scroll&&t.scroll(...u),c(...u)},e.viewportResizeCb=(...u)=>{t.viewportResize&&t.viewportResize(...u),f(...u)},e.inputCb=(...u)=>{t.input&&t.input(...u),m(...u)},e.mediaInteractionCb=(...u)=>{t.mediaInteaction&&t.mediaInteaction(...u),l(...u)},e.styleSheetRuleCb=(...u)=>{t.styleSheetRule&&t.styleSheetRule(...u),d(...u)},e.styleDeclarationCb=(...u)=>{t.styleDeclaration&&t.styleDeclaration(...u),i(...u)},e.canvasMutationCb=(...u)=>{t.canvasMutation&&t.canvasMutation(...u),h(...u)},e.fontCb=(...u)=>{t.font&&t.font(...u),o(...u)},e.selectionCb=(...u)=>{t.selection&&t.selection(...u),n(...u)},e.customElementCb=(...u)=>{t.customElement&&t.customElement(...u),p(...u)}}function $a(e,t={}){let s=e.doc.defaultView;if(!s)return()=>{};Ba(e,t);let a,r=()=>{};e.recordDOM&&([a,r]=dn(e,e.doc));let c=Oa(e),f=Ia(e),m=pn(e),l=Aa(e,{win:s}),d=Ta(e),i=Pa(e),h=()=>{},o=()=>{},n=()=>{},p=()=>{};e.recordDOM&&(h=_a(e,{win:s}),o=mn(e,e.doc),n=ka(e,{win:s}),e.collectFonts&&(p=La(e)));let u=Fa(e),g=Ua(e),v=[];for(let S of e.plugins)v.push(S.observer(S.callback,s,S.options));return P(()=>{Ce.forEach(S=>S.reset()),a?.disconnect(),r(),c(),f(),m(),l(),d(),i(),h(),o(),n(),p(),u(),g(),v.forEach(S=>S())})}function Je(e){return typeof window[e]<"u"}function Qe(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var at=class{constructor(t){I(this,"iframeIdToRemoteIdMap",new WeakMap),I(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,s,a,r){let c=a||this.getIdToRemoteIdMap(t),f=r||this.getRemoteIdToIdMap(t),m=c.get(s);return m||(m=this.generateIdFn(),c.set(s,m),f.set(m,s)),m}getIds(t,s){let a=this.getIdToRemoteIdMap(t),r=this.getRemoteIdToIdMap(t);return s.map(c=>this.getId(t,c,a,r))}getRemoteId(t,s,a){let r=a||this.getRemoteIdToIdMap(t);if(typeof s!="number")return s;let c=r.get(s);return c||-1}getRemoteIds(t,s){let a=this.getRemoteIdToIdMap(t);return s.map(r=>this.getRemoteId(t,r,a))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let s=this.iframeIdToRemoteIdMap.get(t);return s||(s=new Map,this.iframeIdToRemoteIdMap.set(t,s)),s}getRemoteIdToIdMap(t){let s=this.iframeRemoteIdToIdMap.get(t);return s||(s=new Map,this.iframeRemoteIdToIdMap.set(t,s)),s}},Lr=class{constructor(t){I(this,"iframes",new WeakMap),I(this,"crossOriginIframeMap",new WeakMap),I(this,"crossOriginIframeMirror",new at(_i)),I(this,"crossOriginIframeStyleMirror"),I(this,"crossOriginIframeRootIdMap",new WeakMap),I(this,"mirror"),I(this,"mutationCb"),I(this,"wrappedEmit"),I(this,"loadListener"),I(this,"stylesheetManager"),I(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new at(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,s){var a,r;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:s}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((a=t.contentWindow)==null||a.addEventListener("message",this.handleMessage.bind(this))),(r=this.loadListener)==null||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){let s=t;if(s.data.type!=="rrweb"||s.origin!==s.data.origin||!t.source)return;let r=this.crossOriginIframeMap.get(t.source);if(!r)return;let c=this.transformCrossOriginEvent(r,s.data.event);c&&this.wrappedEmit(c,s.data.isCheckout)}transformCrossOriginEvent(t,s){var a;switch(s.type){case L.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(s.data.node,t);let r=s.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(s.data.node,r),{timestamp:s.timestamp,type:L.IncrementalSnapshot,data:{source:k.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:s.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case L.Meta:case L.Load:case L.DomContentLoaded:return!1;case L.Plugin:return s;case L.Custom:return this.replaceIds(s.data.payload,t,["id","parentId","previousId","nextId"]),s;case L.IncrementalSnapshot:switch(s.data.source){case k.Mutation:return s.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);let c=this.crossOriginIframeRootIdMap.get(t);c&&this.patchRootIdOnNode(r.node,c)}),s.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),s.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),s.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),s;case k.Drag:case k.TouchMove:case k.MouseMove:return s.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),s;case k.ViewportResize:return!1;case k.MediaInteraction:case k.MouseInteraction:case k.Scroll:case k.CanvasMutation:case k.Input:return this.replaceIds(s.data,t,["id"]),s;case k.StyleSheetRule:case k.StyleDeclaration:return this.replaceIds(s.data,t,["id"]),this.replaceStyleIds(s.data,t,["styleId"]),s;case k.Font:return s;case k.Selection:return s.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),s;case k.AdoptedStyleSheet:return this.replaceIds(s.data,t,["id"]),this.replaceStyleIds(s.data,t,["styleIds"]),(a=s.data.styles)==null||a.forEach(r=>{this.replaceStyleIds(r,t,["styleId"])}),s}}return!1}replace(t,s,a,r){for(let c of r)!Array.isArray(s[c])&&typeof s[c]!="number"||(Array.isArray(s[c])?s[c]=t.getIds(a,s[c]):s[c]=t.getId(a,s[c]));return s}replaceIds(t,s,a){return this.replace(this.crossOriginIframeMirror,t,s,a)}replaceStyleIds(t,s,a){return this.replace(this.crossOriginIframeStyleMirror,t,s,a)}replaceIdOnNode(t,s){this.replaceIds(t,s,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(a=>{this.replaceIdOnNode(a,s)})}patchRootIdOnNode(t,s){t.type!==hn.Document&&!t.rootId&&(t.rootId=s),"childNodes"in t&&t.childNodes.forEach(a=>{this.patchRootIdOnNode(a,s)})}},Fr=class{constructor(t){I(this,"shadowDoms",new WeakSet),I(this,"mutationCb"),I(this,"scrollCb"),I(this,"bypassOptions"),I(this,"mirror"),I(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,s){if(!Le(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let[a]=dn({...this.bypassOptions,doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>a.disconnect()),this.restoreHandlers.push(pn({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(_.host(t))),this.restoreHandlers.push(mn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,s){let a=this;this.restoreHandlers.push(Me(t.prototype,"attachShadow",function(r){return function(c){let f=r.call(this,c),m=_.shadowRoot(this);return m&&cn(this)&&a.addShadowRoot(m,s),f}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},De="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(ke=0;ke<De.length;ke++)Wa[De.charCodeAt(ke)]=ke;var ke,za=function(e){var t=new Uint8Array(e),s,a=t.length,r="";for(s=0;s<a;s+=3)r+=De[t[s]>>2],r+=De[(t[s]&3)<<4|t[s+1]>>4],r+=De[(t[s+1]&15)<<2|t[s+2]>>6],r+=De[t[s+2]&63];return a%3===2?r=r.substring(0,r.length-1)+"=":a%3===1&&(r=r.substring(0,r.length-2)+"=="),r};var Ci=new Map;function qa(e,t){let s=Ci.get(e);return s||(s=new Map,Ci.set(e,s)),s.has(t)||s.set(t,[]),s.get(t)}var gn=(e,t,s)=>{if(!e||!(wn(e,t)||typeof e=="object"))return;let a=e.constructor.name,r=qa(s,a),c=r.indexOf(e);return c===-1&&(c=r.length,r.push(e)),c};function Ze(e,t,s){if(e instanceof Array)return e.map(a=>Ze(a,t,s));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let a=e.constructor.name,r=za(e);return{rr_type:a,base64:r}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ze(e.buffer,t,s),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let a=e.constructor.name,{src:r}=e;return{rr_type:a,src:r}}else if(e instanceof HTMLCanvasElement){let a="HTMLImageElement",r=e.toDataURL();return{rr_type:a,src:r}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Ze(e.data,t,s),e.width,e.height]};if(wn(e,t)||typeof e=="object"){let a=e.constructor.name,r=gn(e,t,s);return{rr_type:a,index:r}}}}return e}var yn=(e,t,s)=>e.map(a=>Ze(a,t,s)),wn=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function").find(r=>e instanceof t[r]);function Va(e,t,s,a){let r=[],c=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let f of c)try{if(typeof t.CanvasRenderingContext2D.prototype[f]!="function")continue;let m=Me(t.CanvasRenderingContext2D.prototype,f,function(l){return function(...d){return te(this.canvas,s,a,!0)||setTimeout(()=>{let i=yn(d,t,this);e(this.canvas,{type:Te["2D"],property:f,args:i})},0),l.apply(this,d)}});r.push(m)}catch{let m=bt(t.CanvasRenderingContext2D.prototype,f,{set(l){e(this.canvas,{type:Te["2D"],property:f,args:[l],setter:!0})}});r.push(m)}return()=>{r.forEach(f=>f())}}function ja(e){return e==="experimental-webgl"?"webgl":e}function Ei(e,t,s,a){let r=[];try{let c=Me(e.HTMLCanvasElement.prototype,"getContext",function(f){return function(m,...l){if(!te(this,t,s,!0)){let d=ja(m);if("__context"in this||(this.__context=d),a&&["webgl","webgl2"].includes(d))if(l[0]&&typeof l[0]=="object"){let i=l[0];i.preserveDrawingBuffer||(i.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return f.apply(this,[m,...l])}});r.push(c)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(c=>c())}}function xi(e,t,s,a,r,c){let f=[],m=Object.getOwnPropertyNames(e);for(let l of m)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let d=Me(e,l,function(i){return function(...h){let o=i.apply(this,h);if(gn(o,c,this),"tagName"in this.canvas&&!te(this.canvas,a,r,!0)){let n=yn(h,c,this),p={type:t,property:l,args:n};s(this.canvas,p)}return o}});f.push(d)}catch{let d=bt(e,l,{set(i){s(this.canvas,{type:t,property:l,args:[i],setter:!0})}});f.push(d)}return f}function Ga(e,t,s,a){let r=[];return typeof t.WebGLRenderingContext<"u"&&r.push(...xi(t.WebGLRenderingContext.prototype,Te.WebGL,e,s,a,t)),typeof t.WebGL2RenderingContext<"u"&&r.push(...xi(t.WebGL2RenderingContext.prototype,Te.WebGL2,e,s,a,t)),()=>{r.forEach(c=>c())}}var bn=`(function() {
|
|
60
|
+
"use strict";
|
|
61
|
+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
62
|
+
var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
|
|
63
|
+
for (var i = 0; i < chars.length; i++) {
|
|
64
|
+
lookup[chars.charCodeAt(i)] = i;
|
|
65
|
+
}
|
|
66
|
+
var encode = function(arraybuffer) {
|
|
67
|
+
var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";
|
|
68
|
+
for (i2 = 0; i2 < len; i2 += 3) {
|
|
69
|
+
base64 += chars[bytes[i2] >> 2];
|
|
70
|
+
base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];
|
|
71
|
+
base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];
|
|
72
|
+
base64 += chars[bytes[i2 + 2] & 63];
|
|
73
|
+
}
|
|
74
|
+
if (len % 3 === 2) {
|
|
75
|
+
base64 = base64.substring(0, base64.length - 1) + "=";
|
|
76
|
+
} else if (len % 3 === 1) {
|
|
77
|
+
base64 = base64.substring(0, base64.length - 2) + "==";
|
|
78
|
+
}
|
|
79
|
+
return base64;
|
|
80
|
+
};
|
|
81
|
+
const lastBlobMap = /* @__PURE__ */ new Map();
|
|
82
|
+
const transparentBlobMap = /* @__PURE__ */ new Map();
|
|
83
|
+
async function getTransparentBlobFor(width, height, dataURLOptions) {
|
|
84
|
+
const id = \`\${width}-\${height}\`;
|
|
85
|
+
if ("OffscreenCanvas" in globalThis) {
|
|
86
|
+
if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);
|
|
87
|
+
const offscreen = new OffscreenCanvas(width, height);
|
|
88
|
+
offscreen.getContext("2d");
|
|
89
|
+
const blob = await offscreen.convertToBlob(dataURLOptions);
|
|
90
|
+
const arrayBuffer = await blob.arrayBuffer();
|
|
91
|
+
const base64 = encode(arrayBuffer);
|
|
92
|
+
transparentBlobMap.set(id, base64);
|
|
93
|
+
return base64;
|
|
94
|
+
} else {
|
|
95
|
+
return "";
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const worker = self;
|
|
99
|
+
worker.onmessage = async function(e) {
|
|
100
|
+
if ("OffscreenCanvas" in globalThis) {
|
|
101
|
+
const { id, bitmap, width, height, dataURLOptions } = e.data;
|
|
102
|
+
const transparentBase64 = getTransparentBlobFor(
|
|
103
|
+
width,
|
|
104
|
+
height,
|
|
105
|
+
dataURLOptions
|
|
106
|
+
);
|
|
107
|
+
const offscreen = new OffscreenCanvas(width, height);
|
|
108
|
+
const ctx = offscreen.getContext("2d");
|
|
109
|
+
ctx.drawImage(bitmap, 0, 0);
|
|
110
|
+
bitmap.close();
|
|
111
|
+
const blob = await offscreen.convertToBlob(dataURLOptions);
|
|
112
|
+
const type = blob.type;
|
|
113
|
+
const arrayBuffer = await blob.arrayBuffer();
|
|
114
|
+
const base64 = encode(arrayBuffer);
|
|
115
|
+
if (!lastBlobMap.has(id) && await transparentBase64 === base64) {
|
|
116
|
+
lastBlobMap.set(id, base64);
|
|
117
|
+
return worker.postMessage({ id });
|
|
118
|
+
}
|
|
119
|
+
if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });
|
|
120
|
+
worker.postMessage({
|
|
121
|
+
id,
|
|
122
|
+
type,
|
|
123
|
+
base64,
|
|
124
|
+
width,
|
|
125
|
+
height
|
|
126
|
+
});
|
|
127
|
+
lastBlobMap.set(id, base64);
|
|
128
|
+
} else {
|
|
129
|
+
return worker.postMessage({ id: e.data.id });
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
})();
|
|
133
|
+
//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
|
|
134
|
+
`,Mi=typeof self<"u"&&self.Blob&&new Blob([bn],{type:"text/javascript;charset=utf-8"});function Ha(e){let t;try{if(t=Mi&&(self.URL||self.webkitURL).createObjectURL(Mi),!t)throw"";let s=new Worker(t,{name:e?.name});return s.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),s}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(bn),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Ur=class{constructor(t){I(this,"pendingCanvasMutations",new Map),I(this,"rafStamps",{latestId:0,invokeId:null}),I(this,"mirror"),I(this,"mutationCb"),I(this,"resetObservers"),I(this,"frozen",!1),I(this,"locked",!1),I(this,"processMutation",(l,d)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(d)});let{sampling:s="all",win:a,blockClass:r,blockSelector:c,recordCanvas:f,dataURLOptions:m}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,f&&s==="all"&&this.initCanvasMutationObserver(a,r,c),f&&typeof s=="number"&&this.initCanvasFPSObserver(s,a,r,c,{dataURLOptions:m})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,s,a,r,c){let f=Ei(s,a,r,!0),m=new Map,l=new Ha;l.onmessage=p=>{let{id:u}=p.data;if(m.set(u,!1),!("base64"in p.data))return;let{base64:g,type:v,width:S,height:b}=p.data;this.mutationCb({id:u,type:Te["2D"],commands:[{property:"clearRect",args:[0,0,S,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:v}]},0,0]}]})};let d=1e3/t,i=0,h,o=()=>{let p=[];return s.document.querySelectorAll("canvas").forEach(u=>{te(u,a,r,!0)||p.push(u)}),p},n=p=>{if(i&&p-i<d){h=requestAnimationFrame(n);return}i=p,o().forEach(async u=>{var g;let v=this.mirror.getId(u);if(m.get(v)||u.width===0||u.height===0)return;if(m.set(v,!0),["webgl","webgl2"].includes(u.__context)){let b=u.getContext(u.__context);((g=b?.getContextAttributes())==null?void 0:g.preserveDrawingBuffer)===!1&&b.clear(b.COLOR_BUFFER_BIT)}let S=await createImageBitmap(u);l.postMessage({id:v,bitmap:S,width:u.width,height:u.height,dataURLOptions:c.dataURLOptions},[S])}),h=requestAnimationFrame(n)};h=requestAnimationFrame(n),this.resetObservers=()=>{f(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,s,a){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let r=Ei(t,s,a,!1),c=Va(this.processMutation.bind(this),t,s,a),f=Ga(this.processMutation.bind(this),t,s,a);this.resetObservers=()=>{r(),c(),f()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=s=>{this.rafStamps.latestId=s,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,s)=>{let a=this.mirror.getId(s);this.flushPendingCanvasMutationFor(s,a)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,s){if(this.frozen||this.locked)return;let a=this.pendingCanvasMutations.get(t);if(!a||s===-1)return;let r=a.map(f=>{let{type:m,...l}=f;return l}),{type:c}=a[0];this.mutationCb({id:s,type:c,commands:r}),this.pendingCanvasMutations.delete(t)}},Br=class{constructor(t){I(this,"trackedLinkElements",new WeakSet),I(this,"mutationCb"),I(this,"adoptedStyleSheetCb"),I(this,"styleMirror",new _r),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,s){"_cssText"in s.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:s.id,attributes:s.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,s){if(t.length===0)return;let a={id:s,styleIds:[]},r=[];for(let c of t){let f;this.styleMirror.has(c)?f=this.styleMirror.getId(c):(f=this.styleMirror.add(c),r.push({styleId:f,rules:Array.from(c.rules||CSSRule,(m,l)=>({rule:Di(m,c.href),index:l}))})),a.styleIds.push(f)}r.length>0&&(a.styles=r),this.adoptedStyleSheetCb(a)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},$r=class{constructor(){I(this,"nodeMap",new WeakMap),I(this,"active",!1)}inOtherBuffer(t,s){let a=this.nodeMap.get(t);return a&&Array.from(a).some(r=>r!==s)}add(t,s){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(s))}destroy(){}},G,Ke,Or,lt=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((ns=e.contentWindow)==null?void 0:ns.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var he=so();function me(e={}){let{emit:t,checkoutEveryNms:s,checkoutEveryNth:a,blockClass:r="rr-block",blockSelector:c=null,ignoreClass:f="rr-ignore",ignoreSelector:m=null,maskTextClass:l="rr-mask",maskTextSelector:d=null,inlineStylesheet:i=!0,maskAllInputs:h,maskInputOptions:o,slimDOMOptions:n,maskInputFn:p,maskTextFn:u,hooks:g,packFn:v,sampling:S={},dataURLOptions:b={},mousemoveWait:E,recordDOM:w=!0,recordCanvas:y=!1,recordCrossOriginIframes:C=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:O=!1,collectFonts:R=!1,inlineImages:D=!1,plugins:A,keepIframeSrcFn:x=()=>!1,ignoreCSSAttributes:ue=new Set([]),errorHandler:se}=e;Ra(se);let U=C?window.parent===window:!0,F=!1;if(!U)try{window.parent.document&&(F=!1)}catch{F=!0}if(U&&!t)throw new Error("emit function is required");if(!U&&!F)return()=>{};E!==void 0&&S.mousemove===void 0&&(S.mousemove=E),he.reset();let H=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:o!==void 0?o:{password:!0},Q=Fi(n);Ca();let Y,B=0,ye=T=>{for(let X of A||[])X.eventProcessor&&(T=X.eventProcessor(T));return v&&!F&&(T=v(T)),T};G=(T,X)=>{var $;let j=T;if(j.timestamp=Ue(),($=Ce[0])!=null&&$.isFrozen()&&j.type!==L.FullSnapshot&&!(j.type===L.IncrementalSnapshot&&j.data.source===k.Mutation)&&Ce.forEach(ie=>ie.unfreeze()),U)t?.(ye(j),X);else if(F){let ie={type:"rrweb",event:ye(j),origin:window.location.origin,isCheckout:X};window.parent.postMessage(ie,"*")}if(j.type===L.FullSnapshot)Y=j,B=0;else if(j.type===L.IncrementalSnapshot){if(j.data.source===k.Mutation&&j.data.isAttachIframe)return;B++;let ie=a&&B>=a,W=s&&j.timestamp-Y.timestamp>s;(ie||W)&&Ke(!0)}};let N=T=>{G({type:L.IncrementalSnapshot,data:{source:k.Mutation,...T}})},pe=T=>G({type:L.IncrementalSnapshot,data:{source:k.Scroll,...T}}),ae=T=>G({type:L.IncrementalSnapshot,data:{source:k.CanvasMutation,...T}}),_e=T=>G({type:L.IncrementalSnapshot,data:{source:k.AdoptedStyleSheet,...T}}),K=new Br({mutationCb:N,adoptedStyleSheetCb:_e}),ce=new Lr({mirror:he,mutationCb:N,stylesheetManager:K,recordCrossOriginIframes:C,wrappedEmit:G});for(let T of A||[])T.getMirror&&T.getMirror({nodeMirror:he,crossOriginIframeMirror:ce.crossOriginIframeMirror,crossOriginIframeStyleMirror:ce.crossOriginIframeStyleMirror});let ve=new $r;Or=new Ur({recordCanvas:y,mutationCb:ae,win:window,blockClass:r,blockSelector:c,mirror:he,sampling:S.canvas,dataURLOptions:b});let we=new Fr({mutationCb:N,scrollCb:pe,bypassOptions:{blockClass:r,blockSelector:c,maskTextClass:l,maskTextSelector:d,inlineStylesheet:i,maskInputOptions:H,dataURLOptions:b,maskTextFn:u,maskInputFn:p,recordCanvas:y,inlineImages:D,sampling:S,slimDOMOptions:Q,iframeManager:ce,stylesheetManager:K,canvasManager:Or,keepIframeSrcFn:x,processedNodeManager:ve},mirror:he});Ke=(T=!1)=>{if(!w)return;G({type:L.Meta,data:{href:window.location.href,width:sn(),height:rn()}},T),K.reset(),we.init(),Ce.forEach($=>$.lock());let X=Oo(document,{mirror:he,blockClass:r,blockSelector:c,maskTextClass:l,maskTextSelector:d,inlineStylesheet:i,maskAllInputs:H,maskTextFn:u,maskInputFn:p,slimDOM:Q,dataURLOptions:b,recordCanvas:y,inlineImages:D,onSerialize:$=>{an($,he)&&ce.addIframe($),ln($,he)&&K.trackLinkElement($),Tr($)&&we.addShadowRoot(_.shadowRoot($),document)},onIframeLoad:($,j)=>{ce.attachIframe($,j),we.observeAttachShadow($)},onStylesheetLoad:($,j)=>{K.attachLinkElement($,j)},keepIframeSrcFn:x});if(!X)return console.warn("Failed to snapshot the document");G({type:L.FullSnapshot,data:{node:X,initialOffset:tn(window)}},T),Ce.forEach($=>$.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&K.adoptStyleSheets(document.adoptedStyleSheets,he.getId(document))};try{let T=[],X=j=>{var ie;return P($a)({mutationCb:N,mousemoveCb:(W,vt)=>G({type:L.IncrementalSnapshot,data:{source:vt,positions:W}}),mouseInteractionCb:W=>G({type:L.IncrementalSnapshot,data:{source:k.MouseInteraction,...W}}),scrollCb:pe,viewportResizeCb:W=>G({type:L.IncrementalSnapshot,data:{source:k.ViewportResize,...W}}),inputCb:W=>G({type:L.IncrementalSnapshot,data:{source:k.Input,...W}}),mediaInteractionCb:W=>G({type:L.IncrementalSnapshot,data:{source:k.MediaInteraction,...W}}),styleSheetRuleCb:W=>G({type:L.IncrementalSnapshot,data:{source:k.StyleSheetRule,...W}}),styleDeclarationCb:W=>G({type:L.IncrementalSnapshot,data:{source:k.StyleDeclaration,...W}}),canvasMutationCb:ae,fontCb:W=>G({type:L.IncrementalSnapshot,data:{source:k.Font,...W}}),selectionCb:W=>{G({type:L.IncrementalSnapshot,data:{source:k.Selection,...W}})},customElementCb:W=>{G({type:L.IncrementalSnapshot,data:{source:k.CustomElement,...W}})},blockClass:r,ignoreClass:f,ignoreSelector:m,maskTextClass:l,maskTextSelector:d,maskInputOptions:H,inlineStylesheet:i,sampling:S,recordDOM:w,recordCanvas:y,inlineImages:D,userTriggeredOnInput:O,collectFonts:R,doc:j,maskInputFn:p,maskTextFn:u,keepIframeSrcFn:x,blockSelector:c,slimDOMOptions:Q,dataURLOptions:b,mirror:he,iframeManager:ce,stylesheetManager:K,shadowDomManager:we,processedNodeManager:ve,canvasManager:Or,ignoreCSSAttributes:ue,plugins:((ie=A?.filter(W=>W.observer))==null?void 0:ie.map(W=>({observer:W.observer,options:W.options,callback:vt=>G({type:L.Plugin,data:{plugin:W.name,payload:vt}})})))||[]},g)};ce.addLoadListener(j=>{try{T.push(X(j.contentDocument))}catch(ie){console.warn(ie)}});let $=()=>{Ke(),T.push(X(document)),lt=!0};return["interactive","complete"].includes(document.readyState)?$():(T.push(ee("DOMContentLoaded",()=>{G({type:L.DomContentLoaded,data:{}}),M==="DOMContentLoaded"&&$()})),T.push(ee("load",()=>{G({type:L.Load,data:{}}),M==="load"&&$()},window))),()=>{T.forEach(j=>{try{j()}catch(ie){String(ie).toLowerCase().includes("cross-origin")||console.warn(ie)}}),ve.destroy(),lt=!1,Na()}}catch(T){console.warn(T)}}me.addCustomEvent=(e,t)=>{if(!lt)throw new Error("please add custom event after start recording");G({type:L.Custom,data:{tag:e,payload:t}})};me.freezePage=()=>{Ce.forEach(e=>e.freeze())};me.takeFullSnapshot=e=>{if(!lt)throw new Error("please take full snapshot after start recording");Ke(e)};me.mirror=he;var Ri;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ri||(Ri={}));var ll=5*1e3;var{addCustomEvent:ul}=me,{freezePage:cl}=me,{takeFullSnapshot:hl}=me;var St=class{prev=[];cur=[];prevSize=0;curSize=0;push(t,s){s&&(this.prev=this.cur,this.prevSize=this.curSize,this.cur=[],this.curSize=0),this.cur.push(t),this.curSize+=t.length,this.prevSize+this.curSize>16e6&&(this.prev=[],this.prevSize=0)}size(){return this.prevSize+this.curSize}take(){let t=this.prev.concat(this.cur);return this.prev=[],this.cur=[],this.prevSize=0,this.curSize=0,t}};function Sn(e,t=1e6){let s=[],a=[],r=2;for(let c of e)a.length>0&&r+c.length+1>t&&(s.push(`[${a.join(",")}]`),a=[],r=2),a.push(c),r+=c.length+1;return a.length>0&&s.push(`[${a.join(",")}]`),s}var Ya=[["Edge",/Edg\/(\d+)/],["Opera",/OPR\/(\d+)/],["Firefox",/Firefox\/(\d+)/],["Chrome",/Chrome\/(\d+)/],["Safari",/Version\/(\d+).*Safari/]],Xa=[["iOS",/iPhone|iPad/],["Android",/Android/],["Windows",/Windows/],["macOS",/Mac OS X/],["ChromeOS",/CrOS/],["Linux",/Linux/]];function vn(e){let t={};for(let[s,a]of Ya){let r=a.exec(e);if(r){t.browser=`${s} ${r[1]}`;break}}return t.os=Xa.find(([,s])=>s.test(e))?.[0],t}var Ja=/token|key|password|secret|auth|session|passwd|api/i;function is(e){let t=e.indexOf("?");if(t===-1)return e.slice(0,2048);let s=e.slice(0,t),r=e.slice(t+1).split("&").map(c=>{let f=c.indexOf("=");if(f===-1)return c;let m=c.slice(0,f);return Ja.test(m)?`${m}=[redacted]`:c}).join("&");return`${s}?${r}`.slice(0,2048)}var rl="img,picture,video,audio,canvas,iframe,object,embed,input[type=password],[data-blipit-block]",Cn=6e4;async function sl(e){if(typeof CompressionStream>"u")return e;try{return await new Response(new Blob([e]).stream().pipeThrough(new CompressionStream("gzip"))).blob()}catch{return e}}function il(e){let t=e.mode,s=!1,a=0,r=0,c=[],f=0,m=Promise.resolve(),l=!1,d=[],i=new St,h=`?key=${encodeURIComponent(e.key)}${e.instance?`&instance=${encodeURIComponent(e.instance)}`:""}`,o=b=>`${new URL(`/api/v1/replays/${e.id}/${b}`,e.endpoint).href}${h}`,n=()=>{s||(s=!0,v?.(),clearInterval(S),c=[])},p=async(b,E,w)=>{let y=typeof E=="string"?E.length:E.size;if(w&&y<Cn&&navigator.sendBeacon)try{let C=typeof E=="string"?new Blob([E],{type:"text/plain"}):E.slice(0,y,"text/plain");if(navigator.sendBeacon(o(b),C))return!0}catch{}try{let C=await fetch(o(b),{method:"POST",headers:{"Content-Type":"text/plain"},body:E,keepalive:y<Cn});return C.status===202||C.status===200?(await C.json().catch(()=>({}))).accepted===!1&&n():C.status>=400&&C.status<500&&C.status!==429&&n(),C.ok}catch{return!1}},u=(b=!1)=>{if(!l||s||a===0)return;l=!1;let E=JSON.stringify({url:is(location.href),duration:Date.now()-r,error_ids:d.slice(-100),...vn(navigator.userAgent)});b?p("meta",E,!0):m=m.then(()=>p("meta",E,!1))},g=(b=!1)=>{if(s||t!=="session"||c.length===0)return;let E=Sn(c);c=[],f=0;for(let w of E){if(a>=500)return n();let y=a++;l=!0,b?p(`segments/${y}`,w,!0):m=m.then(async()=>!s&&p(`segments/${y}`,await sl(w),!1))}u(b),r&&Date.now()-r>36e5&&n()},v=me({emit(b,E){if(s)return;let w=b;w.type===4&&w.data.href&&(w.data.href=is(w.data.href));let y=JSON.stringify(w);if(t==="buffer")return i.push(y,!!E&&w.type===4);r||(r=w.timestamp),c.push(y),f+=y.length,f>=1e6&&g()},checkoutEveryNms:e.mode==="buffer"?6e4:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:b=>"*".repeat(Math.min(b.length,32)),maskTextSelector:"*",blockSelector:rl,recordCanvas:!1,inlineImages:!1,collectFonts:!1,sampling:{scroll:150,input:"last",media:800}}),S=setInterval(()=>g(),1e4);return document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&g()),addEventListener("pagehide",()=>{g(!0),u(!0)}),{active:()=>!s,error(b){s||d.includes(b)||(d.push(b),l=!0,me.addCustomEvent("blipit.error",{event_id:b}),t==="buffer"&&(t="session",c=i.take(),r=c.length>0?JSON.parse(c[0]).timestamp:Date.now()),g(),u())}}}return On(nl);})();
|
|
135
|
+
/*! Bundled license information:
|
|
136
|
+
|
|
137
|
+
rrweb/dist/rrweb.js:
|
|
138
|
+
(*! *****************************************************************************
|
|
139
|
+
Copyright (c) Microsoft Corporation.
|
|
140
|
+
|
|
141
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
142
|
+
purpose with or without fee is hereby granted.
|
|
143
|
+
|
|
144
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
145
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
146
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
147
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
148
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
149
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
150
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
151
|
+
***************************************************************************** *)
|
|
152
|
+
*/
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blipit/browser",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Blipit error monitoring SDK for browsers. Know your app broke before your users tell you.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.cjs",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsup src/index.ts --format esm,cjs,iife --global-name Blipit --dts --minify --clean && tsup src/replay.ts --format iife --global-name BlipitReplay --minify --no-dts",
|
|
23
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
24
|
+
"size": "gzip -c dist/index.global.js | wc -c && gzip -c dist/replay.global.js | wc -c"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@blipit/schema": "workspace:*",
|
|
28
|
+
"rrweb": "2.1.6",
|
|
29
|
+
"tsup": "^8.3.0",
|
|
30
|
+
"typescript": "^5.7.0"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/blipit-io/blipit.git",
|
|
38
|
+
"directory": "packages/sdk-browser"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://docs.blipit.io",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"email": "support@blipit.io"
|
|
43
|
+
},
|
|
44
|
+
"author": "Louward Labs <support@blipit.io>",
|
|
45
|
+
"keywords": [
|
|
46
|
+
"error-monitoring",
|
|
47
|
+
"blipit",
|
|
48
|
+
"errors",
|
|
49
|
+
"logging"
|
|
50
|
+
]
|
|
51
|
+
}
|