ripplo 0.7.19 → 0.7.21
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/dist/chunk-7UWDMECF.js +2 -0
- package/dist/{chunk-WNUKCEN6.js → chunk-BJVAPI4P.js} +1 -1
- package/dist/chunk-EVYYSTR7.js +46 -0
- package/dist/chunk-IHSHBPJY.js +2 -0
- package/dist/chunk-OX6IWNCA.js +206 -0
- package/dist/chunk-R7CQWEBF.js +167 -0
- package/dist/daemon-2E6MKBO7.js +62 -0
- package/dist/daemon-APJHNVIG.js +2 -0
- package/dist/daemon-tunnel-AG6FGNXC.js +2 -0
- package/dist/gifenc.esm-GMV2LJ5K.js +2 -0
- package/dist/index.js +185 -194
- package/package.json +6 -6
- package/dist/chunk-7R7PWDYF.js +0 -137
- package/dist/chunk-APGFYCJC.js +0 -200
- package/dist/chunk-SB7H6IAS.js +0 -2
- package/dist/chunk-Y5IXMRSB.js +0 -46
- package/dist/daemon-EQZROAKJ.js +0 -2
- package/dist/daemon-EUZ4KVQP.js +0 -61
- package/dist/daemon-tunnel-MOYCRSSC.js +0 -2
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as cx}from"./chunk-IHSHBPJY.js";import{a as af,b as ua}from"./chunk-7UWDMECF.js";var Tf=af((Ma,Mf)=>{"use strict";var{hasOwnProperty:xr}=Object.prototype,fn=Pa();fn.configure=Pa;fn.stringify=fn;fn.default=fn;Ma.stringify=fn;Ma.configure=Pa;Mf.exports=fn;var Tx=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Xt(e){return e.length<5e3&&!Tx.test(e)?`"${e}"`:JSON.stringify(e)}function ka(e,t){if(e.length>200||t)return e.sort(t);for(let n=1;n<e.length;n++){let r=e[n],i=n;for(;i!==0&&e[i-1]>r;)e[i]=e[i-1],i--;e[i]=r}return e}var Ox=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Ia(e){return Ox.call(e)!==void 0&&e.length!==0}function If(e,t,n){e.length<n&&(n=e.length);let r=t===","?"":" ",i=`"0":${r}${e[0]}`;for(let o=1;o<n;o++)i+=`${t}"${o}":${r}${e[o]}`;return i}function Nx(e){if(xr.call(e,"circularValue")){let t=e.circularValue;if(typeof t=="string")return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function $x(e){let t;if(xr.call(e,"deterministic")&&(t=e.deterministic,typeof t!="boolean"&&typeof t!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return t===void 0?!0:t}function Lx(e,t){let n;if(xr.call(e,t)&&(n=e[t],typeof n!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return n===void 0?!0:n}function Pf(e,t){let n;if(xr.call(e,t)){if(n=e[t],typeof n!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(n))throw new TypeError(`The "${t}" argument must be an integer`);if(n<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return n===void 0?1/0:n}function dn(e){return e===1?"1 item":`${e} items`}function _x(e){let t=new Set;for(let n of e)(typeof n=="string"||typeof n=="number")&&t.add(String(n));return t}function Dx(e){if(xr.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return n=>{let r=`Object can not safely be stringified. Received type ${typeof n}`;throw typeof n!="function"&&(r+=` (${n.toString()})`),new Error(r)}}}function Pa(e){e={...e};let t=Dx(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let n=Nx(e),r=Lx(e,"bigint"),i=$x(e),o=typeof i=="function"?i:void 0,s=Pf(e,"maximumDepth"),a=Pf(e,"maximumBreadth");function l(p,h,m,y,S,w){let g=h[p];switch(typeof g=="object"&&g!==null&&typeof g.toJSON=="function"&&(g=g.toJSON(p)),g=y.call(h,p,g),typeof g){case"string":return Xt(g);case"object":{if(g===null)return"null";if(m.indexOf(g)!==-1)return n;let x="",I=",",N=w;if(Array.isArray(g)){if(g.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(g),S!==""&&(w+=S,x+=`
|
|
3
|
+
${w}`,I=`,
|
|
4
|
+
${w}`);let ne=Math.min(g.length,a),_=0;for(;_<ne-1;_++){let He=l(String(_),g,m,y,S,w);x+=He!==void 0?He:"null",x+=I}let Me=l(String(_),g,m,y,S,w);if(x+=Me!==void 0?Me:"null",g.length-1>a){let He=g.length-a-1;x+=`${I}"... ${dn(He)} not stringified"`}return S!==""&&(x+=`
|
|
5
|
+
${N}`),m.pop(),`[${x}]`}let $=Object.keys(g),L=$.length;if(L===0)return"{}";if(s<m.length+1)return'"[Object]"';let P="",j="";S!==""&&(w+=S,I=`,
|
|
6
|
+
${w}`,P=" ");let U=Math.min(L,a);i&&!Ia(g)&&($=ka($,o)),m.push(g);for(let ne=0;ne<U;ne++){let _=$[ne],Me=l(_,g,m,y,S,w);Me!==void 0&&(x+=`${j}${Xt(_)}:${P}${Me}`,j=I)}if(L>a){let ne=L-a;x+=`${j}"...":${P}"${dn(ne)} not stringified"`,j=I}return S!==""&&j.length>1&&(x=`
|
|
7
|
+
${w}${x}
|
|
8
|
+
${N}`),m.pop(),`{${x}}`}case"number":return isFinite(g)?String(g):t?t(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(g);default:return t?t(g):void 0}}function u(p,h,m,y,S,w){switch(typeof h=="object"&&h!==null&&typeof h.toJSON=="function"&&(h=h.toJSON(p)),typeof h){case"string":return Xt(h);case"object":{if(h===null)return"null";if(m.indexOf(h)!==-1)return n;let g=w,x="",I=",";if(Array.isArray(h)){if(h.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(h),S!==""&&(w+=S,x+=`
|
|
9
|
+
${w}`,I=`,
|
|
10
|
+
${w}`);let L=Math.min(h.length,a),P=0;for(;P<L-1;P++){let U=u(String(P),h[P],m,y,S,w);x+=U!==void 0?U:"null",x+=I}let j=u(String(P),h[P],m,y,S,w);if(x+=j!==void 0?j:"null",h.length-1>a){let U=h.length-a-1;x+=`${I}"... ${dn(U)} not stringified"`}return S!==""&&(x+=`
|
|
11
|
+
${g}`),m.pop(),`[${x}]`}m.push(h);let N="";S!==""&&(w+=S,I=`,
|
|
12
|
+
${w}`,N=" ");let $="";for(let L of y){let P=u(L,h[L],m,y,S,w);P!==void 0&&(x+=`${$}${Xt(L)}:${N}${P}`,$=I)}return S!==""&&$.length>1&&(x=`
|
|
13
|
+
${w}${x}
|
|
14
|
+
${g}`),m.pop(),`{${x}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(h);default:return t?t(h):void 0}}function c(p,h,m,y,S){switch(typeof h){case"string":return Xt(h);case"object":{if(h===null)return"null";if(typeof h.toJSON=="function"){if(h=h.toJSON(p),typeof h!="object")return c(p,h,m,y,S);if(h===null)return"null"}if(m.indexOf(h)!==-1)return n;let w=S;if(Array.isArray(h)){if(h.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(h),S+=y;let P=`
|
|
15
|
+
${S}`,j=`,
|
|
16
|
+
${S}`,U=Math.min(h.length,a),ne=0;for(;ne<U-1;ne++){let Me=c(String(ne),h[ne],m,y,S);P+=Me!==void 0?Me:"null",P+=j}let _=c(String(ne),h[ne],m,y,S);if(P+=_!==void 0?_:"null",h.length-1>a){let Me=h.length-a-1;P+=`${j}"... ${dn(Me)} not stringified"`}return P+=`
|
|
17
|
+
${w}`,m.pop(),`[${P}]`}let g=Object.keys(h),x=g.length;if(x===0)return"{}";if(s<m.length+1)return'"[Object]"';S+=y;let I=`,
|
|
18
|
+
${S}`,N="",$="",L=Math.min(x,a);Ia(h)&&(N+=If(h,I,a),g=g.slice(h.length),L-=h.length,$=I),i&&(g=ka(g,o)),m.push(h);for(let P=0;P<L;P++){let j=g[P],U=c(j,h[j],m,y,S);U!==void 0&&(N+=`${$}${Xt(j)}: ${U}`,$=I)}if(x>a){let P=x-a;N+=`${$}"...": "${dn(P)} not stringified"`,$=I}return $!==""&&(N=`
|
|
19
|
+
${S}${N}
|
|
20
|
+
${w}`),m.pop(),`{${N}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(h);default:return t?t(h):void 0}}function d(p,h,m){switch(typeof h){case"string":return Xt(h);case"object":{if(h===null)return"null";if(typeof h.toJSON=="function"){if(h=h.toJSON(p),typeof h!="object")return d(p,h,m);if(h===null)return"null"}if(m.indexOf(h)!==-1)return n;let y="",S=h.length!==void 0;if(S&&Array.isArray(h)){if(h.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(h);let N=Math.min(h.length,a),$=0;for(;$<N-1;$++){let P=d(String($),h[$],m);y+=P!==void 0?P:"null",y+=","}let L=d(String($),h[$],m);if(y+=L!==void 0?L:"null",h.length-1>a){let P=h.length-a-1;y+=`,"... ${dn(P)} not stringified"`}return m.pop(),`[${y}]`}let w=Object.keys(h),g=w.length;if(g===0)return"{}";if(s<m.length+1)return'"[Object]"';let x="",I=Math.min(g,a);S&&Ia(h)&&(y+=If(h,",",a),w=w.slice(h.length),I-=h.length,x=","),i&&(w=ka(w,o)),m.push(h);for(let N=0;N<I;N++){let $=w[N],L=d($,h[$],m);L!==void 0&&(y+=`${x}${Xt($)}:${L}`,x=",")}if(g>a){let N=g-a;y+=`${x}"...":"${dn(N)} not stringified"`}return m.pop(),`{${y}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(h);default:return t?t(h):void 0}}function f(p,h,m){if(arguments.length>1){let y="";if(typeof m=="number"?y=" ".repeat(Math.min(m,10)):typeof m=="string"&&(y=m.slice(0,10)),h!=null){if(typeof h=="function")return l("",{"":p},[],h,y,"");if(Array.isArray(h))return u("",p,[],_x(h),y,"")}if(y.length!==0)return c("",p,[],y,"")}return d("",p,[])}return f}});var Pp=af((nj,Pl)=>{"use strict";var mo=process||{},kp=mo.argv||[],po=mo.env||{},tE=!(po.NO_COLOR||kp.includes("--no-color"))&&(!!po.FORCE_COLOR||kp.includes("--color")||mo.platform==="win32"||(mo.stdout||{}).isTTY&&po.TERM!=="dumb"||!!po.CI),nE=(e,t,n=e)=>r=>{let i=""+r,o=i.indexOf(t,e.length);return~o?e+rE(i,t,n,o)+t:e+i+t},rE=(e,t,n,r)=>{let i="",o=0;do i+=e.substring(o,r)+n,o=r+t.length,r=e.indexOf(t,o);while(~r);return i+e.substring(o)},Ip=(e=tE)=>{let t=e?nE:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Pl.exports=Ip();Pl.exports.createColors=Ip});import{z as E}from"zod";var ca=E.enum(["fast","slow","async"]),On=E.object({ref:E.string().min(1)}),Zt=E.union([E.string(),E.number(),E.boolean()]),da=E.object({template:E.array(E.union([E.string(),On])).min(1)}),_e=E.union([On,Zt,da,E.null()]),lf=E.object({kind:E.literal("changed")}),fa=E.union([_e,lf]),It=E.union([E.string(),On,da]),dx=E.object({by:E.literal("role"),name:E.union([It,E.undefined()]).optional().transform(e=>e),role:E.string().min(1)}),fx=E.object({by:E.literal("testId"),value:It}),hx=E.object({by:E.literal("inside"),scope:E.lazy(()=>be),target:E.lazy(()=>be)}),be=E.discriminatedUnion("by",[dx,fx,hx]),Ti=E.enum(["string","number","boolean"]),ha=E.enum(["strict","eventual"]),px=E.object({kind:E.literal("string"),maxLength:E.number().int().positive().optional(),minLength:E.number().int().nonnegative().optional(),pattern:E.string().optional()}),mx=E.object({kind:E.literal("number"),max:E.number().int().optional(),min:E.number().int().optional()}),yx=E.object({kind:E.literal("datetime"),maxOffsetDays:E.number().int(),minOffsetDays:E.number().int()}),uf=E.discriminatedUnion("kind",[px,mx,yx]),cf=E.enum(["company.name","date.iso","internet.email","internet.url","person.fullName","lorem.slug","lorem.word"]),pa=E.object({constraints:uf.optional(),generator:cf,name:E.string().min(1),type:Ti,values:E.array(Zt).min(1).optional()}),df=E.object({consistency:ha.default("strict"),optional:E.boolean(),type:Ti,valueSpace:E.string().min(1).optional()}),ma=E.enum(["backend","client"]),ya=E.object({description:E.string().optional(),identity:E.array(E.string().min(1)).min(1),identityKind:E.enum(["surrogate","natural"]),name:E.string().min(1),props:E.record(E.string().min(1),df),source:ma.default("backend")}),ga=E.object({consistency:ha.default("strict"),default:Zt,description:E.string().optional(),name:E.string().min(1),source:ma.default("backend"),type:Ti,valueSpace:E.string().min(1).optional()}),Pt=E.enum(["url","title","viewport"]);function ba(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${ba(e.scope)} \u25B8 ${ba(e.target)}`:`${e.role} ${e.name??""}`.trim()}import{z as C}from"zod";var gx=C.discriminatedUnion("kind",[C.object({as:C.string().min(1),kind:C.literal("created"),props:C.record(C.string().min(1),_e)}),C.object({as:C.string().min(1),kind:C.literal("updated"),props:C.record(C.string().min(1),fa)}),C.object({kind:C.literal("deleted")})]),bx=C.object({kind:C.literal("is"),value:_e}),ff=C.lazy(()=>C.union([_e,wx])),Sx=C.object({entity:C.string().min(1),where:C.record(C.string().min(1),ff)}),wx=C.object({field:C.string().min(1),kind:C.literal("within"),selection:Sx}),wt=C.union([ca,C.undefined()]).optional().transform(e=>e),hf=C.object({assertion:bx,kind:C.literal("singleton"),singleton:C.string().min(1),wait:wt}),pf=C.object({entity:C.string().min(1),kind:C.literal("count"),value:C.number().int().nonnegative()}),Oi=C.lazy(()=>C.discriminatedUnion("kind",[hf,pf,C.object({kind:C.literal("not"),predicate:Oi}),C.object({kind:C.literal("and"),predicates:C.array(Oi)})])),xx=C.lazy(()=>C.object({condition:C.union([Oi,C.undefined()]).optional().transform(e=>e),consequence:C.array(Nn),name:C.string().min(1)})),Nn=C.lazy(()=>C.discriminatedUnion("kind",[C.object({kind:C.literal("visible"),locator:be,wait:wt}),C.object({kind:C.literal("disabled"),locator:be,wait:wt}),C.object({kind:C.literal("enabled"),locator:be,wait:wt}),C.object({kind:C.literal("focused"),locator:be,wait:wt}),C.object({kind:C.literal("checked"),locator:be,wait:wt}),C.object({kind:C.literal("value"),locator:be,value:It,wait:wt}),C.object({kind:C.literal("text"),locator:be,value:It,wait:wt}),hf,C.object({kind:C.literal("browser"),name:Pt,value:It,wait:wt}),C.object({assertion:gx,entity:C.string().min(1),key:C.record(C.string().min(1),ff),kind:C.literal("state"),wait:wt}),C.object({kind:C.literal("not"),predicate:Nn}),C.object({kind:C.literal("and"),predicates:C.array(Nn)}),pf,C.object({branches:C.array(xx),kind:C.literal("when")})]));import{z as Ni}from"zod";var vx=Ni.object({__codec:Ni.string().min(1),data:Ni.unknown(),version:Ni.number().int().positive()}),$i=class extends Error{codec;currentVersion;gotVersion;constructor(t){super(`Unsupported ${t.codec} version ${String(t.gotVersion)} (current ${String(t.currentVersion)}). Upgrade Ripplo or rebuild with a compatible CLI.`),this.name="CodecVersionError",this.codec=t.codec,this.currentVersion=t.currentVersion,this.gotVersion=t.gotVersion}},Li=class extends Error{constructor(t){super(`Codec mismatch: expected "${t.expected}", got "${t.got}"`),this.name="CodecMismatchError"}};function Sa({name:e,schema:t}){return{currentVersion:1,name:e,decode:n=>Cx({name:e,raw:n,schema:t}),encode:n=>({__codec:e,data:n,version:1})}}function Rx(e,t){return JSON.stringify(e.encode(t))}function Ax(e,t){let n=JSON.parse(t);return e.decode(n)}function Cx({name:e,raw:t,schema:n}){let r=vx.parse(t);if(r.__codec!==e)throw new Li({expected:e,got:r.__codec});if(r.version!==1)throw new $i({codec:e,currentVersion:1,gotVersion:r.version});return n.parse(r.data)}var _i="__ripplo__",wa="__ripplo_seed__";import{z as R}from"zod";var mf=R.discriminatedUnion("kind",[R.object({kind:R.literal("goto"),url:It}),R.object({kind:R.literal("fill"),locator:be,value:_e}),R.object({kind:R.literal("clear"),locator:be}),R.object({kind:R.literal("click"),locator:be}),R.object({kind:R.literal("dblclick"),locator:be}),R.object({kind:R.literal("select"),locator:be,value:_e}),R.object({kind:R.literal("check"),locator:be}),R.object({kind:R.literal("uncheck"),locator:be}),R.object({kind:R.literal("hover"),locator:be}),R.object({files:R.array(R.string().min(1)).min(1),kind:R.literal("upload"),locator:be}),R.object({key:R.string().min(1),kind:R.literal("press"),locator:be.optional()})]),xa=R.object({action:mf,expect:R.array(Nn).default([])}),va=R.object({valueSpace:R.string().min(1)}),Di=R.object({as:R.string().min(1),entity:R.string().min(1),set:R.record(R.string().min(1),_e)}),Ra=R.object({entity:R.string().min(1),where:R.record(R.string().min(1),_e)}),yf=R.object({absent:R.array(Ra).default([]),exclusive:R.array(R.string().min(1)).default([]),intent:R.string().min(1),name:R.string().min(1),params:R.record(R.string().min(1),va),singletons:R.record(R.string().min(1),_e).default({}),slug:R.string().min(1),steps:R.array(xa).default([]),workflow:R.string().min(1),world:R.array(Di).default([])}),gf=R.object({absent:R.array(Ra).default([]),exclusive:R.array(R.string().min(1)).default([]),intent:R.string().min(1),maybe:R.array(Di).default([]),name:R.string().min(1),params:R.record(R.string().min(1),va),singletons:R.record(R.string().min(1),_e).default({}),sourcePath:R.string().min(1).optional(),steps:R.array(xa).default([]),stub:R.boolean().default(!1),tests:R.array(yf).default([]),world:R.array(Di).default([])}),bf=R.object({sha256:R.string().regex(/^[0-9a-f]{64}$/u),size:R.number().int().nonnegative()}),Sf=R.object({entities:R.array(ya),fixtures:R.record(R.string().min(1),bf).default({}),singletons:R.array(ga).default([]),valueSpaces:R.array(pa),workflows:R.array(gf)}),Ex=Sa({name:"ripplo-lockfile",schema:Sf});function kx(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Fi(e,t,n=""){let r=kx(e),i=e?.length,o=t!==void 0;if(!r||o&&i!==t){let s=n&&`"${n}" `,a=o?` of length ${t}`:"",l=r?`length=${i}`:`type=${typeof e}`,u=s+"expected Uint8Array"+a+", got "+l;throw r?new RangeError(u):new TypeError(u)}return e}function Aa(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function wf(e,t){Fi(e,void 0,"digestInto() output");let n=t.outputLen;if(e.length<n)throw new RangeError('"digestInto() output" expected to be of length >='+n)}function wr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Bi(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ot(e,t){return e<<32-t|e>>>t}var Ix=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Px=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function xf(e){if(Fi(e),Ix)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Px[e[n]];return t}function vf(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Rf(e,t={}){let n=(i,o)=>e(o).update(i).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=i=>e(i),Object.assign(n,t),Object.freeze(n)}var Af=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function Cf(e,t,n){return e&t^~e&n}function Ef(e,t,n){return e&t^e&n^t&n}var ji=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,n,r,i){this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=Bi(this.buffer)}update(t){Aa(this),Fi(t);let{view:n,buffer:r,blockLen:i}=this,o=t.length;for(let s=0;s<o;){let a=Math.min(i-this.pos,o-s);if(a===i){let l=Bi(t);for(;i<=o-s;s+=i)this.process(l,s);continue}r.set(t.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Aa(this),wf(t,this),this.finished=!0;let{buffer:n,view:r,blockLen:i,isLE:o}=this,{pos:s}=this;n[s++]=128,wr(this.buffer.subarray(s)),this.padOffset>i-s&&(this.process(r,0),s=0);for(let d=s;d<i;d++)n[d]=0;r.setBigUint64(i-8,BigInt(this.length*8),o),this.process(r,0);let a=Bi(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let u=l/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)a.setUint32(4*d,c[d],o)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||=new this.constructor,t.set(...this.get());let{blockLen:n,buffer:r,length:i,finished:o,destroyed:s,pos:a}=this;return t.destroyed=s,t.finished=o,t.length=i,t.pos=a,i%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}},Mt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var Mx=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Jt=new Uint32Array(64),Ca=class extends ji{constructor(t){super(64,t,8,!1)}get(){let{A:t,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[t,n,r,i,o,s,a,l]}set(t,n,r,i,o,s,a,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(t,n){for(let d=0;d<16;d++,n+=4)Jt[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){let f=Jt[d-15],p=Jt[d-2],h=ot(f,7)^ot(f,18)^f>>>3,m=ot(p,17)^ot(p,19)^p>>>10;Jt[d]=m+Jt[d-7]+h+Jt[d-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:u,H:c}=this;for(let d=0;d<64;d++){let f=ot(a,6)^ot(a,11)^ot(a,25),p=c+f+Cf(a,l,u)+Mx[d]+Jt[d]|0,m=(ot(r,2)^ot(r,13)^ot(r,22))+Ef(r,i,o)|0;c=u,u=l,l=a,a=s+p|0,s=o,o=i,i=r,r=p+m|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,i,o,s,a,l,u,c)}roundClean(){wr(Jt)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),wr(this.buffer)}},Ea=class extends Ca{A=Mt[0]|0;B=Mt[1]|0;C=Mt[2]|0;D=Mt[3]|0;E=Mt[4]|0;F=Mt[5]|0;G=Mt[6]|0;H=Mt[7]|0;constructor(){super(32)}};var kf=Rf(()=>new Ea,Af(1));var Ta=ua(Tf(),1),oD=Ta.default.configure,vr=Ta.default;function Oa(e){return xf(kf(vf(vr(e))))}function V(e){let t=vr(e);if(t==null)throw new Error("structuralKey: value is not serializable");return t}function Na({actionOffsets:e,durationMs:t}){let n=jx({anchors:Fx({actionOffsets:e,durationMs:t}),durationMs:t});return{delayMs:Wx(Math.round(8e3/n.length),500,1800),offsets:n}}function Fx({actionOffsets:e,durationMs:t}){let n=e.map(i=>Math.min(i+150,t)),r=[...new Set([0,...n,t])].toSorted((i,o)=>i-o);return Bx(r)}function Bx(e){return e.reduce((t,n)=>{let r=t.at(-1);return r!=null&&n-r<120?t:[...t,n]},[])}function jx({anchors:e,durationMs:t}){return e.length>60?Ux(e):e.length>=5?e:[...new Set([...e,...Vx(t,5)])].toSorted((n,r)=>n-r)}function Ux(e){return Array.from({length:60},(t,n)=>e[Math.round(n/59*(e.length-1))]??0)}function Vx(e,t){return Array.from({length:t},(n,r)=>Math.round(r/(t-1)*e))}function Wx(e,t,n){return Math.min(n,Math.max(t,e))}import{z as Rr}from"zod";var zx=Rr.object({index:Rr.number().int().nonnegative(),kind:Rr.string(),target:Rr.string(),value:Rr.string()});function Gx(e){let t=qx(e);return{preconditions:e.entities.map(n=>({depends:t.get(n.name)??[],description:n.description??"",name:n.name,returns:n.identity})),singletons:e.singletons.map(n=>({defaultValue:String(n.default),description:n.description??"",name:n.name,type:n.type})),workflows:e.workflows.map(n=>({expectedOutcome:n.intent,name:n.intent,preconditions:Jx(Xx(n),t),requiresKeys:n.world.map(r=>({namespace:r.as,preconditionName:r.entity})),slug:Nf(n.name),sourcePath:n.sourcePath??null,spec:n}))}}function Hx(e,t){return{index:t,kind:e.action.kind,target:Qx(e.action),value:ev(e.action)}}function Nf(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,"-").split("-").filter(t=>t.length>0).join("-")}function qx(e){let t=e.workflows.reduce((n,r)=>Kx(n,r),new Map);return new Map([...t].map(([n,r])=>[n,[...r]]))}function Kx(e,t){let n=[...t.world,...t.maybe],r=new Map(n.map(i=>[i.as,i.entity]));return n.reduce((i,o)=>{let s=Yx(o,r),a=i.get(o.entity)??new Set;return new Map([...i,[o.entity,new Set([...a,...s])]])},e)}function Yx(e,t){return Object.values(e.set).flatMap(n=>Zx(n)).map(n=>t.get(n)).filter(n=>n!=null&&n!==e.entity)}function Zx(e){return e==null||typeof e!="object"?[]:"ref"in e?[Of(e.ref)]:e.template.filter(t=>typeof t!="string").map(t=>Of(t.ref))}function Of(e){let[t]=e.split(".");return t??e}function Jx(e,t){let n=(r,i)=>r.has(i)?r:(t.get(i)??[]).reduce((o,s)=>n(o,s),new Set([...r,i]));return[...e.reduce((r,i)=>n(r,i),new Set)]}function Xx(e){return[...new Set(e.world.map(t=>t.entity))]}function Qx(e){return e.kind==="goto"?Ui(e.url):e.kind==="press"&&e.locator==null?"":Vi(e.locator)}function Ui(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:e.template.map(t=>typeof t=="string"?t:`{${t.ref}}`).join("")}function Vi(e){return e.by==="testId"?`testId=${Ui(e.value)}`:e.by==="inside"?`${Vi(e.scope)} \u25B8 ${Vi(e.target)}`:`${e.role} ${e.name==null?"":Ui(e.name)}`.trim()}function ev(e){return e.kind==="fill"||e.kind==="select"?tv(e.value):e.kind==="press"?e.key:""}function tv(e){return e==null?"":typeof e!="object"?String(e):Ui(e)}import{z as ve}from"zod";var $f=ve.enum(["Strict","Lax","None"]),Lf=ve.object({domain:ve.string().min(1),expires:ve.number(),httpOnly:ve.boolean(),name:ve.string().min(1),path:ve.string().min(1),sameSite:$f,secure:ve.boolean(),value:ve.string()}),_f=ve.object({localStorage:ve.array(ve.object({name:ve.string().min(1),value:ve.string()})),origin:ve.string().min(1)}),$a=ve.object({cookies:ve.array(Lf),headers:ve.record(ve.string().min(1),ve.string()).optional(),origins:ve.array(_f)});import{z as q}from"zod";var La=q.union([Zt,q.null()]),_a=q.record(q.string().min(1),La),Df=q.object({as:q.string().min(1),entity:q.string().min(1),fields:q.record(q.string().min(1),_e)}),nv=q.object({entities:q.array(Df),runId:q.string().min(1),singletons:q.record(q.string().min(1),La).default({})}),Ff=q.object({as:q.string().min(1),row:_a,session:$a.optional()}),Da=q.object({rows:q.array(Ff)}),rv=q.object({entities:q.array(q.string().min(1)),runId:q.string().min(1),singletons:q.array(q.string().min(1)).default([])}),Fa=q.object({entities:q.record(q.string().min(1),q.array(_a)),singletons:q.record(q.string().min(1),La).default({})}),iv=q.object({runId:q.string().min(1)}),Ba=q.object({ok:q.literal(!0)});function Tt(e){let t=new URL(e,"https://ripplo.invalid"),n=[...t.searchParams.entries()].toSorted(([r],[i])=>r.localeCompare(i)).map(([r,i])=>`${r}=${i}`).join("&");return n.length===0?t.pathname:`${t.pathname}?${n}`}function $n(e,t){return e==="url"?Tt(t):t}function ja(e,t,n){return $n(e,String(t))===$n(e,String(n))}function jf(e,t,n){return e!=="url"?ja(e,t,n):Bf(String(t))===Bf(String(n))}function Bf(e){return new URL(e,"https://ripplo.invalid").pathname}function Ua({actual:e,canon:t,pre:n,predicted:r}){return[...[...new Set([...r.entities.keys(),...e.entities.keys()])].flatMap(s=>ov({actual:e.entities.get(s),canon:t,entity:s,pre:n.entities.get(s),predicted:r.entities.get(s)})),...av(n.singletons,r.singletons,e.singletons)]}function ov({actual:e,canon:t,entity:n,pre:r,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>sv({actual:e?.get(s),canon:t,entity:n,key:s,predicted:i?.get(s),preHadKey:r?.has(s)??!1,preRow:r?.get(s)}))}function sv({actual:e,canon:t,entity:n,key:r,predicted:i,preHadKey:o,preRow:s}){if(i==null)return[{mismatch:{entity:n,key:r,kind:"unexpected-row"},pending:o}];if(e==null)return[{mismatch:{entity:n,key:r,kind:"missing-row"},pending:!o}];let a=(u,c,d)=>Wf(t(n,u,c),t(n,u,d));return[...new Set([...Object.keys(i),...Object.keys(e)])].filter(u=>!a(u,i[u],e[u])).map(u=>({mismatch:{entity:n,field:u,key:r,kind:"wrong-value",snapshot:i[u],sut:e[u]},pending:s==null?e[u]===void 0:a(u,s[u],e[u])}))}function Wf(e,t){return Uf(e)===Uf(t)}function Uf(e){return e==null?"\u2205":JSON.stringify(e)}function av(e,t,n){return[...new Set([...Object.keys(t),...Object.keys(n)])].flatMap(i=>{let o=t[i],s=n[i];return o===void 0||s===void 0||Vf(i,o,s)?[]:[{mismatch:{kind:"singleton-mismatch",singleton:i,snapshot:o,sut:s},pending:e[i]!==void 0&&Vf(i,e[i],s)}]})}function Vf(e,t,n){let r=Pt.safeParse(e);return r.success?jf(r.data,t,n):Wf(t,n)}function Wi(e){let t=lv(e.entities),n=uv(e.singletons);return r=>cv(r,t,n)}function lv(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([n,r])=>[zf(t.name,n),r.consistency])))}function zf(e,t){return`${e}.${t}`}function uv(e){return new Map(e.map(t=>[t.name,t.consistency]))}function cv(e,t,n){return e.kind==="singleton-mismatch"?dv(e.singleton,n):e.kind==="unexpected-row"||e.kind==="missing-row"?"strict":t.get(zf(e.entity,e.field))??"strict"}function dv(e,t){return Pt.safeParse(e).success?t.get(e)??"eventual":t.get(e)??"strict"}function zi(e){let t=new Set(e.valueSpaces.filter(n=>n.generator==="date.iso").map(n=>n.name));return(n,r,i)=>{if(!t.has(`${n}.${r}`)||typeof i!="string")return i;let o=Date.parse(i);return Number.isNaN(o)?i:new Date(o).toISOString()}}function Va({onlyFirst:e=!1}={}){let i="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,e?void 0:"g")}var fv=Va();function Wa(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(fv,"")}function Hf(e,t,n){return{detail:n.slice(0,500),kind:"engine-http",path:e,status:t}}function Ar(e,t){return{code:ih(t),kind:"engine-network",message:Cr(t),path:e}}function qf(e){return{kind:"client-mount-missing",mountKey:e}}function Kf(e,t){return{kind:"engine-decode",message:Cr(t),path:e}}function Yf(e,t){return{entity:e,field:t,kind:"state-identity"}}function Zf(e){return{as:e,kind:"setup-missing-row"}}function Jf(e){return{count:e,kind:"conflicting-sessions"}}function Ln(e){return{kind:"driver-launch",message:Cr(e)}}function Xf(e){return{kind:"engine-unreachable",url:e}}function Qf(e,t){return{action:e,kind:"action-failed",message:Cr(t)}}function eh(e){return{kind:"check-failed",message:Cr(e)}}function th(){return{kind:"aborted"}}var Gf=300;function hn(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${rh(e.detail)}${hv(e.status)}`;case"engine-network":return`engine ${e.path} request failed: ${e.message}`;case"client-mount-missing":return`client bridge "${e.mountKey}" never mounted; client singletons unreadable`;case"engine-decode":return`engine ${e.path} response did not match schema: ${e.message}`;case"state-identity":return`row of "${e.entity}" is missing identity field "${e.field}"`;case"setup-missing-row":return`setup returned no row for "${e.as}"`;case"conflicting-sessions":return`world established ${String(e.count)} distinct auth sessions in one browser context; sessions are exclusive \u2014 a single context holds one signed-in user`;case"engine-unreachable":return`the engine at ${e.url} did not respond in time \u2014 the dev server may still be recompiling. Re-run once it settles.`;case"driver-launch":return`browser driver failed to launch: ${e.message}`;case"action-failed":return`action "${e.action}" failed: ${e.message}`;case"check-failed":return`check failed: ${e.message}`;case"aborted":return"run aborted"}}function nh(e){throw new Error(hn(e))}function st(){}function rh(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=Gf?t:`${t.slice(0,Gf)}\u2026 [truncated]`}function hv(e){return e===404?" \u2014 the engine adapter is not mounted at RIPPLO_ENGINE_URL (or the mount path differs). Verify the adapter is wired into the app server and ENABLE_RIPPLO_TESTING=true; `ripplo doctor` checks the endpoint.":e===403||e===401?" \u2014 the adapter rejected the request: ENABLE_RIPPLO_TESTING is not true in the app's env, or RIPPLO_WEBHOOK_SECRET differs between the app and .ripplo env.":""}function ih(e){if(!(typeof e!="object"||e==null))return"code"in e&&typeof e.code=="string"?e.code:"cause"in e?ih(e.cause):void 0}function Cr(e){let t=e instanceof Error?e.message:String(e);return rh(Wa(t))}function Ot(e,t){return[...new Map(e.map(n=>[t(n),n])).values()]}function za(e){return Ot(e,V)}function oh(e){return V(e)}var Er=class extends Error{name="AbortError";constructor(){super("aborted")}};function sh(e){return e instanceof Error&&e.name==="AbortError"}function Qt(e){if(e.aborted)throw new Er}function Ga(e,t){return t.aborted?Promise.reject(new Er):new Promise((n,r)=>{let i=()=>{clearTimeout(o),r(new Er)},o=setTimeout(()=>{t.removeEventListener("abort",i),n()},e);t.addEventListener("abort",i,{once:!0})})}var pv={check:"Check",clear:"Clear",click:"Click",dblclick:"Double-click",fill:"Fill",goto:"Go to",hover:"Hover",press:"Press",select:"Select",uncheck:"Uncheck",upload:"Upload"};function ah(e){let t=pv[e.kind]??e.kind;return e.kind==="press"&&e.key!=null?`${t}: ${e.key}`:t}function lh(e){return e.kind==="data-rule"?"data rule":uh(e.check)}function uh(e){return e.kind==="not"?`not ${uh(e.inner)}`:e.kind==="browser"?e.name:`${ch(e.locator)} ${e.kind}`}function ch(e){return e.by==="testId"?"element":e.by==="inside"?ch(e.target):e.role}function yh(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var mv=()=>[];async function Ya({canon:e,classify:t,initialSnapshot:n,observe:r,onAssertion:i,onStep:o,pageRulePendingChecks:s,steps:a,stopAfterStep:l},u){return gh({acc:[],canon:e,classify:t,index:0,observe:r,onAssertion:i,onStep:o,pageRulePendingChecks:s??mv,signal:u,snapshot:n,steps:a,stopAfterStep:l})}async function gh({acc:e,canon:t,classify:n,index:r,observe:i,onAssertion:o,onStep:s,pageRulePendingChecks:a,signal:l,snapshot:u,steps:c,stopAfterStep:d}){Qt(l);let f=c[r];if(f==null)return{finalModel:u,findings:e};let p=Date.now(),h=await f.targetIds(),m=ah(f.step.action);if(!f.requiredState(u)){let y={kind:"impossible-action",step:f.step};return qa(s,{annotations:[Ha({actionLabel:m,outcome:"failed",rrwebIds:h,startMs:p})],endMs:Date.now(),findings:[y],index:r,post:u,pre:u,source:f.source,startMs:p,url:Ka(u)}),{finalModel:u,findings:[...e,y]}}return f.perform().match(()=>yv({acc:e,actionLabel:m,canon:t,classify:n,index:r,observe:i,onAssertion:o,onStep:s,pageRulePendingChecks:a,rrwebIds:h,signal:l,snapshot:u,startMs:p,step:f,steps:c,stopAfterStep:d}),y=>{let S=Gi(y,f);return qa(s,{annotations:[Ha({actionLabel:m,outcome:"failed",rrwebIds:h,startMs:p})],endMs:Date.now(),findings:[S],index:r,post:u,pre:u,source:f.source,startMs:p,url:Ka(u)}),Promise.resolve({finalModel:u,findings:[...e,S]})})}function Ha({actionLabel:e,outcome:t,rrwebIds:n,startMs:r}){return{atMs:r,kind:"action",label:e,outcome:t,rrwebIds:n}}async function yv({acc:e,actionLabel:t,canon:n,classify:r,index:i,observe:o,onAssertion:s,onStep:a,pageRulePendingChecks:l,rrwebIds:u,signal:c,snapshot:d,startMs:f,step:p,steps:h,stopAfterStep:m}){let y=p.effect(d),S=await vv({canon:n,classify:r,observe:o,pre:d,predicted:y,signal:c,step:p}),w=[...p.pendingChecks,...l(d,S.snapshot)],g=await gv({onAssertion:s,pendingChecks:w,signal:c,step:p}),x=[...g.findings,...S.findings];qa(a,{annotations:[Ha({actionLabel:t,outcome:x.length>0?"failed":"passed",rrwebIds:u,startMs:f}),...g.annotations],endMs:Date.now(),findings:x,index:i,post:S.snapshot,pre:d,source:p.source,startMs:f,url:Ka(S.snapshot)});let I=[...e,...x];return x.length>0?{finalModel:S.snapshot,findings:I}:m!=null&&i+1>=m?{finalModel:S.snapshot,findings:I}:gh({acc:I,canon:n,classify:r,index:i+1,observe:o,onAssertion:s,onStep:a,pageRulePendingChecks:l,signal:c,snapshot:S.snapshot,steps:h,stopAfterStep:m})}async function gv({onAssertion:e,pendingChecks:t,signal:n,step:r}){let i=[...new Map(t.map(s=>[oh(s.source),s])).values()],o=await Promise.all(i.map(async s=>{let a=await bv(s,n),l=Date.now(),u=await s.targetIds();return{atMs:l,outcome:a,pendingCheck:s,rrwebIds:u}}));return o.forEach(s=>{Sv(e,s.pendingCheck,s.outcome,r)}),{annotations:o.filter(s=>s.pendingCheck.source.kind==="step").map(s=>({atMs:s.atMs,kind:"assertion",label:lh(s.pendingCheck.source),outcome:bh(s.outcome),rrwebIds:s.rrwebIds})),findings:o.flatMap(s=>wv(s.pendingCheck,s.outcome,r))}}function bv(e,t){if(e.check.kind==="decided"){let n=e.check.passed?"passed":"failed";return Promise.resolve({kind:n})}return Rv(e.budget,e.check.run,t)}function Sv(e,t,n,r){e?.({outcome:bh(n),source:t.source,step:r.step})}function bh(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function wv(e,t,n){return t.kind==="error"?[Gi(t.error,n)]:t.kind==="failed"?[{budget:e.budget,kind:"pending-check",source:e.source,step:n.step}]:[]}function Gi(e,t){return{error:e,kind:"driver-error",step:t.step}}function qa(e,t){e?.(t)}function Ka(e){let t=e.singletons.url;return typeof t=="string"?t:null}var kr={async:12e4,fast:5e3,slow:3e4},Sh={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:kr.async},fast:{backoffMs:[100,250,500,1e3],timeoutMs:kr.fast},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:kr.slow}};function wh(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function dh(e){return e().match(t=>({observed:t,ok:!0}),t=>({error:t,ok:!1}))}function xv(e,t,n){return n.reconcile==null?e:n.reconcile(e,t)}function fh({canon:e,pre:t,predicted:n,step:r},i){let o=r.verifyChanges==null?[]:r.verifyChanges(n,i),s=xv(n,i,r),a=o.map(l=>({mismatch:l,pending:!0}));return{adopted:s,probed:[...a,...Ua({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function xh(e,t){return{budget:t.sync,kind:"consistency",mismatch:e.mismatch,pending:e.pending,step:t.step}}function hh(e,t,n){let r=e.probed.filter(i=>!i.pending&&n(i.mismatch)==="strict");return r.length>0?{findings:r.map(i=>xh(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function ph(e,t,n){return{findings:[...e.probed.map(r=>xh(r,t)),...n],snapshot:e.adopted}}async function vv({canon:e,classify:t,observe:n,pre:r,predicted:i,signal:o,step:s}){let a=Sh[s.sync],l=Date.now()+a.timeoutMs,u=await dh(n);if(!u.ok)return{findings:[Gi(u.error,s)],snapshot:i};let c=fh({canon:e,pre:r,predicted:i,step:s},u.observed),d=0;for(;Date.now()<l;){Qt(o);let f=hh(c,s,t);if(f!=null)return f;await Ga(wh(a,d),o),d+=1;let p=await dh(n);if(!p.ok)return ph(c,s,[Gi(p.error,s)]);c=fh({canon:e,pre:r,predicted:i,step:s},p.observed)}return hh(c,s,t)??ph(c,s,[])}async function Rv(e,t,n){let r=Sh[e],i=Date.now()+r.timeoutMs,o=await mh(t),s=0;for(;o.kind==="pending"&&Date.now()<i;)Qt(n),await Ga(wh(r,s),n),s+=1,o=await mh(t);return o.kind==="pending"?{kind:"failed"}:o}function mh(e){return e().match(t=>t?{kind:"passed"}:{kind:"pending"},t=>({error:t,kind:"error"}))}import{z as Av}from"zod";var Ja=Av.string().brand(),J=Ja.parse("");function Nt(e){return Ja.parse(e)}function Ke(e,t){return Ja.parse(e.length===0?t:`${e}.${t}`)}function ye(e){return On.safeParse(e).success}function pn(e){let t=e.lastIndexOf(".");return t===-1?void 0:{alias:e.slice(0,t),field:e.slice(t+1)}}function Qe(e){return typeof e=="object"&&e!==null&&"template"in e}function Za(e,t,n){let r=Ke(t,e.ref);if(!n.has(r))throw new Error(`unresolved binding ref "${r}"`);return n.get(r)??null}function vh(e,t,n){return Cv(e).every(r=>n.has(Ke(t,r)))}function at(e,t,n){return typeof e=="string"?e:ye(e)?String(Za(e,t,n)):e.template.map(r=>typeof r=="string"?r:String(Za(r,t,n))).join("")}function et(e,t,n){return e===null||typeof e=="number"||typeof e=="boolean"?e:ye(e)?Za(e,t,n):at(e,t,n)}function Rh(e,t){return et(e,J,t)}function Ir(e){return vr(e)}function _n(e,t,n){return Object.fromEntries(Object.entries(e).map(([r,i])=>[r,et(i,t,n)]))}function Cv(e){return e==null||typeof e!="object"?[]:Qe(e)?e.template.flatMap(t=>typeof t=="string"?[]:[t.ref]):[e.ref]}function en(e){return typeof e=="object"&&e!==null&&"kind"in e}function mn(e){return Object.fromEntries(Object.entries(e).filter(t=>!en(t[1])))}function qi(e,t,n){return t.reduce((r,i)=>Ev(r,i,n,e),e)}function Ah(e,t){return Object.keys(t).length===0?e:{...e,singletons:{...e.singletons,...t}}}function Ev(e,t,n,r){if(!kv(t,n))return e;if(t.assertion.kind==="created"){let o=_n(t.assertion.props,J,n);return Iv(e,t.entity,Ir(o),o)}if(t.assertion.kind==="deleted")return Xa(e,t.entity,Ov(t.key,n,r));let i=_n(mn(t.assertion.props),J,n);return Xa(e,t.entity,Nv(t.key,i,n,r))}function kv(e,t){return("props"in e.assertion?[e.key,mn(e.assertion.props)]:[e.key]).every(r=>Object.values(r).every(i=>kh(i)||!ye(i)||t.has(Nt(i.ref))))}function Iv(e,t,n,r){let i=new Map([...e.entities.get(t)??[],[n,r]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function Xa(e,t,n){let r=n(e.entities.get(t)??new Map);return{...e,entities:new Map([...e.entities,[t,r]])}}function yn(e,t,n,r){let i={env:r,key:n,snapshot:e};return[...(e.entities.get(t)??new Map).values()].filter(o=>Ki(o,i))}function Ch(e,t,n,r,i){let o={env:r,key:n,snapshot:e};return Xa(e,t,s=>new Map([...s].map(([a,l])=>[a,Ki(l,o)?i(l):l])))}function Ki(e,t){return Object.entries(t.key).every(([n,r])=>Eh(e[n],r,t))}function Eh(e,t,n){return kh(t)?Pv(t,n).has(Hi(e)):Hi(e)===Hi(Tv(t,n.env))}function kh(e){return typeof e=="object"&&e!==null&&"kind"in e}function Pv(e,t){let n=t.snapshot.entities.get(e.selection.entity);return n==null?new Set:new Set([...n.values()].filter(r=>Mv(r,e.selection.where,t)).map(r=>Hi(r[e.field])))}function Mv(e,t,n){return Object.entries(t).every(([r,i])=>Eh(e[r],i,n))}function Hi(e){return e==null?"\u2205":e instanceof Date?e.toISOString():JSON.stringify(e)}function Tv(e,t){return et(e,J,t)}function Ov(e,t,n){let r={env:t,key:e,snapshot:n};return i=>new Map([...i].filter(([,o])=>!Ki(o,r)))}function Nv(e,t,n,r){let i={env:n,key:e,snapshot:r};return o=>new Map([...o].map(([s,a])=>Ki(a,i)?[s,{...a,...t}]:[s,a]))}function Mh(e){let t=e.predicates.filter(o=>$h(o)),n=t.filter(o=>o.assertion.kind==="created"),r=Nh(t);if(n.length===0&&r.length===0&&e.deferred.length===0&&e.adopt.length===0)return;let i=t.filter(o=>o.assertion.kind==="updated");return(o,s)=>{let a=n.reduce((c,d)=>jv(c,s,d,e.env),{env:e.env,snapshot:o}),l=r.reduce((c,d)=>Bv(c,s,d,e.env),a.snapshot),u=i.reduce((c,d)=>Lv(c,s,d),a.env);return $v(Wv(l,e.deferred,u),s,e.adopt)}}function $v(e,t,n){if(n.length===0)return e;let r=n.reduce((i,o)=>{let s=t.snapshot.singletons[o];return s===void 0?i:{...i,[o]:s}},e.singletons);return{...e,singletons:r}}function Th(e,t,n){return new Map([...e,...Object.entries(n).map(([r,i])=>[Ke(J,`${t}.${r}`),i])])}function Lv(e,t,n){let r=yn(t.snapshot,n.entity,n.key,e).at(0);return r==null?e:Th(e,n.assertion.as,r)}function Oh(e){let t=Nh(e.predicates.filter(n=>$h(n)));if(t.length!==0)return(n,r)=>t.flatMap(i=>_v(i,n,r,e.env))}function Nh(e){return e.filter(t=>t.assertion.kind==="updated"&&Qa(t.assertion.props).length>0)}function Qa(e){return Object.entries(e).filter(([,t])=>en(t)).map(([t])=>t)}function $h(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function _v(e,t,n,r){let i=yn(t,e.entity,e.key,r).at(0),o=yn(n.snapshot,e.entity,e.key,r).at(0);if(i==null||o==null)return[];let s=Ir(Dv(e.key,r));return Qa(e.assertion.props).flatMap(a=>Ih(i[a])===Ih(o[a])?[{entity:e.entity,field:a,key:s,kind:"expected-change",value:o[a]}]:[])}function Dv(e,t){let n=Object.fromEntries(Object.entries(e).filter(r=>!Fv(r[1])));return _n(n,J,t)}function Fv(e){return typeof e=="object"&&e!==null&&"kind"in e}function Ih(e){return e==null?"\u2205":JSON.stringify(e)}function Bv(e,t,n,r){let i=Qa(n.assertion.props),o=yn(t.snapshot,n.entity,n.key,r).at(0);return o==null?e:Ch(e,n.entity,n.key,r,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function jv(e,t,n,r){if(n.assertion.kind!=="created")return e;let i=_n(n.assertion.props,J,r),o=Ir(i),s=e.snapshot.entities.get(n.entity);if(s==null||!s.has(o))return e;let a=Uv(t.snapshot.entities.get(n.entity),s,i);if(a==null)return e;let[l,u]=a,c=new Map(s);return c.delete(o),c.set(l,{...u,...i}),{env:Th(e.env,n.assertion.as,u),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(n.entity,c)}}}function Uv(e,t,n){if(e==null)return;let r=Object.entries(n),i=[...e].filter(([o])=>!t.has(o)).map(([o,s])=>({entry:[o,s],score:r.filter(([a,l])=>Ph(s[a])===Ph(l)).length}));return Vv(i,r.length)}function Ph(e){return e==null?"\u2205":JSON.stringify(e)}function Vv(e,t){let n=e.reduce((i,o)=>Math.max(i,o.score),0);if(n===0)return;let r=e.filter(i=>i.score===n);if(!(n<t&&r.length!==1))return r[0]?.entry}function Wv(e,t,n){let r=t.reduce((i,o)=>{let s=zv(o.value,n);return s==null?i:{...i,[o.name]:$n(o.name,s)}},e.singletons);return{...e,singletons:r}}function zv(e,t){try{return at(e,J,t)}catch{return}}function Yi(e,t){if(e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked")return{kind:e.kind,locator:Pr(e.locator,t)};if(e.kind==="not"){let n=Yi(e.predicate,t);return n==null?null:{inner:n,kind:"not"}}return e.kind==="value"||e.kind==="text"?{kind:e.kind,locator:Pr(e.locator,t),value:at(e.value,J,t)}:e.kind!=="browser"?null:{kind:"browser",name:e.name,value:at(e.value,J,t)}}function Mr(e,t){let n=e.expect.filter(a=>a.kind==="state"),r=Zv(n),{adopt:i,deferred:o,immediate:s}=Gv(e,t,r);return{action:Jv(e.action,t),label:e.action.kind,pendingChecks:e.expect.flatMap(a=>Qv(a,t)),reconcile:Mh({adopt:i,deferred:o,env:t,predicates:n}),verifyChanges:Oh({adopt:i,deferred:o,env:t,predicates:n}),effect:a=>Ah(qi(a,n,t),s)}}function Pr(e,t){return e.by==="role"?{by:"role",name:e.name==null?void 0:at(e.name,J,t),role:e.role}:e.by==="inside"?{by:"inside",scope:Pr(e.scope,t),target:Pr(e.target,t)}:{by:"testId",value:at(e.value,J,t)}}function Gv(e,t,n){let r=e.action.kind==="goto"&&!e.expect.some(s=>s.kind==="browser"&&s.name==="url"),i=e.action.kind==="goto"&&!r?{url:Tt(at(e.action.url,J,t))}:{},o=r?["url"]:[];return e.expect.reduce((s,a)=>a.kind==="browser"&&Hv(a.value,n)?{...s,deferred:[...s.deferred,{name:a.name,value:a.value}]}:a.kind==="browser"||a.kind==="singleton"?{...s,immediate:{...s.immediate,...Kv(a,t)}}:s,{adopt:o,deferred:[],immediate:i})}function Hv(e,t){return qv(e).some(n=>t.has(n.split(".")[0]??n))}function qv(e){return typeof e=="string"?[]:ye(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function Kv(e,t){if(e.kind==="browser")return{[e.name]:Yv(e,t)};if(e.kind==="singleton")return{[e.singleton]:et(e.assertion.value,J,t)};throw new Error("when() consequence must be a url (browser) or singleton assertion")}function Yv(e,t){return $n(e.name,at(e.value,J,t))}function Zv(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function Jv(e,t){return{files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:Xv(e,t),url:e.kind==="goto"?at(e.url,J,t):void 0,value:"value"in e?Rh(e.value,t):void 0}}function Xv(e,t){if(!(!("locator"in e)||e.locator==null))return Pr(e.locator,t)}function Qv(e,t){if(e.kind==="browser"||e.kind==="singleton")return[];let n=Yi(e,t),r="wait"in e?e.wait??"fast":"fast";return n==null?[]:[{budget:r,check:n}]}import{err as Lh,ok as tl,okAsync as eR,Result as tR}from"neverthrow";function Tr(e,t,n){let r=uR(e),i={env:new Map,generate:n.generate,generatedParams:new Set,indexed:r,overrides:new Map(Object.entries(n.params??{}).map(([s,a])=>[Nt(s),a]))};cR(t.params,J,i);let o=t.world.map(s=>dR(s,J,i));return n.materialize(o).andThen(s=>mR(s,i.env,r).map(a=>rR({base:a,generatedParams:i.generatedParams,lockfile:e,test:t})))}function nR(e,t){let n=new Map(t.map(r=>[r.name,r]));return r=>eR(sR(r,e,n).rows)}function nl(e){return t=>{let n=t.map(r=>({as:r.as,entity:r.entity,fields:r.fields}));return e(n).andThen(r=>oR(t,r))}}function _h(e,t){let n=Zi(t);return Object.fromEntries(Object.entries(e).filter(([r,i])=>n.includes(r)&&i!=null))}function Zi(e){return Object.keys(e.props)}function rR({base:e,generatedParams:t,lockfile:n,test:r}){let i=Object.fromEntries(n.singletons.map(c=>[c.name,c.default])),o=Object.fromEntries(Object.entries(r.singletons).map(([c,d])=>[c,et(d,J,e.env)])),s=Object.entries(r.singletons).filter(([,c])=>iR(c,t)).map(([c])=>c),a={...i,...o},l=new Set(n.singletons.filter(c=>c.source==="client").map(c=>c.name)),u=Object.fromEntries(Object.entries(a).filter(([c])=>l.has(c)));return{...e,clientState:u,generatedSingletons:s,snapshot:{...e.snapshot,singletons:a}}}function iR(e,t){return ye(e)?t.has(Ke(J,e.ref)):Qe(e)?e.template.some(n=>typeof n!="string"&&t.has(Ke(J,n.ref))):!1}function oR(e,t){let n=new Map(t.map(r=>[r.as,r]));return tR.combine(e.map(r=>{let i=n.get(r.as);return i==null?Lh(Zf(r.as)):tl({as:r.as,entity:r.entity,generatedFields:r.generatedFields,row:i.row,session:i.session})}))}function sR(e,t,n){return e.reduce((r,i)=>{let o=aR(i.fields,r.env),s=gR({generate:t,model:i.model,seedPrefix:i.seedPrefix,set:o,valueSpaces:n}),a=Object.entries(s).map(([u,c])=>[`${i.as}.${u}`,c]),l=Object.keys(s).filter(u=>!(u in o));return{env:new Map([...r.env,...a]),rows:[...r.rows,{as:i.as,entity:i.entity,generatedFields:[...new Set([...i.generatedFields,...l])],row:s,session:void 0}]}},{env:new Map,rows:[]})}function aR(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>{if(ye(r))return[n,lR(t,r.ref)];if(Qe(r))throw new Error(`template value not allowed in entity field "${n}"`);return[n,r]}))}function lR(e,t){let n=e.get(t);if(n==null)throw new Error(`setup ref "${t}" was not produced by an earlier entity`);return n}function uR(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function cR(e,t,n){Object.entries(e).forEach(([r,i])=>{let o=Ke(t,r),s=n.indexed.valueSpaces.get(i.valueSpace);if(s==null)throw new Error(`unknown valueSpace "${i.valueSpace}" for param "${o}"`);let a=n.overrides.get(o);a==null&&n.generatedParams.add(o);let l=a??n.generate.value({anchor:void 0,constraints:s.constraints,generator:s.generator,nullable:!1,seed:o,type:s.type,values:s.values,valueSpace:i.valueSpace});n.env.set(o,l)})}function dR(e,t,n){let r=n.indexed.models.get(e.entity);if(r==null)throw new Error(`model "${e.entity}" not found for setup "${e.as}"`);let i=Ke(t,e.as),o=fR(e.set,t,n.env),s=pR(r,o,i,n),a=Object.entries(e.set).filter(([,l])=>ye(l)&&n.generatedParams.has(Ke(t,l.ref))).map(([l])=>l);return{as:i,entity:e.entity,fields:{...s,...o},generatedFields:[...Object.keys(s),...a],model:r,seedPrefix:i}}function fR(e,t,n){return Object.fromEntries(Object.entries(e).map(([r,i])=>[r,hR(i,t,n)]))}function hR(e,t,n){if(!ye(e))return e;let r=Ke(t,e.ref);return n.get(r)??{ref:r}}function pR(e,t,n,r){return Object.fromEntries(Object.entries(e.props).filter(([i,o])=>!o.optional&&!e.identity.includes(i)&&!(i in t)).map(([i,o])=>[i,Dh({field:i,generate:r.generate,model:e,seedPrefix:n,spec:o,valueSpaces:r.indexed.valueSpaces})]))}function mR(e,t,n){let r=new Map,i=e.flatMap(a=>{let l=n.models.get(a.entity);if(l==null)throw new Error(`model "${a.entity}" not found for setup "${a.as}"`);Object.entries(a.row).forEach(([c,d])=>t.set(Ke(Nt(a.as),c),d));let u=r.get(a.entity)??new Map;return u.set(el(a.row,l),_h(a.row,l)),r.set(a.entity,u),a.session==null?[]:[a.session]}),o=e.flatMap(a=>{let l=n.models.get(a.entity);return l==null?[]:[{alias:a.as,entity:a.entity,key:el(a.row,l)}]}),s=e.flatMap(a=>{let l=n.models.get(a.entity);if(l==null)return[];let u=el(a.row,l);return a.generatedFields.map(c=>({entity:a.entity,field:c,key:u}))});return yR(i).map(a=>({aliases:o,auth:a,env:t,generated:s,snapshot:{entities:bR(r),singletons:{}}}))}function yR(e){if(e.length===0)return tl(void 0);let t=new Set(e.map(r=>JSON.stringify(r.cookies))).size;if(t>1)return Lh(Jf(t));let n=e.flatMap(r=>Object.entries(r.headers??{}));return tl({cookies:e.flatMap(r=>r.cookies),headers:n.length===0?void 0:Object.fromEntries(n),origins:e.flatMap(r=>r.origins)})}function gR({generate:e,model:t,seedPrefix:n,set:r,valueSpaces:i}){return{...Object.fromEntries(Object.entries(t.props).filter(([s])=>!(s in r)).map(([s,a])=>[s,Dh({field:s,generate:e,model:t,seedPrefix:n,spec:a,valueSpaces:i})])),...r}}function Dh({field:e,generate:t,model:n,seedPrefix:r,spec:i,valueSpaces:o}){let s=`${n.name}.${e}`;return t.value({anchor:void 0,constraints:o.get(s)?.constraints,generator:o.get(s)?.generator??"lorem.word",nullable:i.optional,seed:Ke(r,e),type:i.type,values:o.get(s)?.values,valueSpace:s})}function el(e,t){return t.identity.map(n=>String(e[n])).join(":")}function bR(e){return new Map([...e].map(([t,n])=>[t,new Map(n)]))}function $t(e){return`${e.workflow}/${e.slug}`}function Lt(e){return e.workflows.flatMap(t=>t.tests.map(n=>({ref:$t(n),test:n,workflow:t})))}function xt(e){return`${e.test}#${String(e.index)}`}function Ji(e){let t=Lt(e).flatMap(n=>Xi(e,n.test));return Ot(t,n=>`${n.test}:${V(n.steps)}`)}function Xi(e,t){let n=jh(t),r=Fh(n,t.singletons),i=VR(t,UR(e)),o=SR(e,t);return wR(r,WR(t.steps),n).reduce((a,{chunk:l,requiredState:u},c)=>({offset:a.offset+l.length,transitions:[...a.transitions,BR({chunk:l,index:c,intent:t.intent,namespace:n.namespace,paramSpaceOf:i,requiredState:u,testRef:$t(t),whenChunk:o.slice(a.offset,a.offset+l.length)})]}),{offset:0,transitions:[]}).transitions}function Fh(e,t){return{absences:_R(e),entities:FR(e),exclusives:e.exclusives,singletons:Object.fromEntries(Object.entries(t).filter(([,n])=>!ye(n)&&!Qe(n)))}}function SR(e,t){let n=e.workflows.find(r=>r.name===t.workflow);return n==null||n.steps.length!==t.steps.length?t.steps:n.steps}function Qi(e,t,n){return Object.values(e).flatMap(r=>ye(r)?il(r.ref,n):[]).find(r=>r.entity===t)?.aliasPath}function wR(e,t,n){return t.reduce((r,i)=>({requiredState:xR(r.requiredState,i,n),withRequiredState:[...r.withRequiredState,{chunk:i,requiredState:NR(r.requiredState,i)}]}),{requiredState:e,withRequiredState:[]}).withRequiredState}function xR(e,t,n){let r=t.flatMap(i=>i.expect.filter(o=>o.kind==="state")).reduce((i,o)=>vR(i,o,n),e);return{...r,singletons:{...r.singletons,...MR(t)}}}function vR(e,t,n){return t.assertion.kind==="deleted"?RR(e,t,n):t.assertion.kind==="created"?ER(e,t.entity,t.assertion.as,t.assertion.props,n):IR(e,t,n)}function RR(e,t,n){let r=Qi(t.key,t.entity,n.namespace),i=e.entities.find(a=>a.alias===r),o=Or(AR(t.key),n),s=i==null?{entity:t.entity,...o}:{entity:i.entity,...CR(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==r)}}function AR(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let n=t[1];return Vh(n)?[]:[[t[0],n]]}))}function CR(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(n=>!t.relations.some(r=>r.field===n.field)),...t.relations]}}function ER(e,t,n,r,i){let o=Or(r,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!kR(o,s)),entities:[...e.entities,{alias:n,entity:t,...o}]}}function kR(e,t){return Object.entries(t.literals).every(([r,i])=>e.literals[r]===i)&&t.relations.every(r=>e.relations.some(i=>i.field===r.field&&i.targetAlias===r.targetAlias&&i.targetField===r.targetField))}function IR(e,t,n){if(t.assertion.kind!=="updated")return e;let r=Qi(t.key,t.entity,n.namespace);if(r==null)return e;let i=Or(mn(t.assertion.props),n),o=Object.entries(t.assertion.props).filter(([,a])=>en(a)).map(([a])=>a),s=a=>a.alias===r?PR(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a))}}function PR(e,t,n){let r=Object.entries(e.literals).filter(([i])=>!n.includes(i)&&!(i in t.literals));return{...e,literals:{...Object.fromEntries(r),...t.literals},relations:[...e.relations.filter(i=>!t.relations.some(o=>o.field===i.field)),...t.relations]}}function MR(e){return e.reduce((t,n)=>({...t,...TR(n),...OR(n)}),{})}function TR(e){return e.action.kind==="goto"?{url:e.action.url}:{}}function OR(e){return Object.fromEntries(e.expect.flatMap(t=>t.kind==="browser"?[[t.name,t.value]]:t.kind==="singleton"?[[t.singleton,t.assertion.value]]:[]))}function NR(e,t){return t[0]?.action.kind!=="goto"?e:{...e,singletons:Object.fromEntries(Object.entries(e.singletons).filter(([n])=>n!=="url"))}}function eo(e,t){let n=jh(t);return{namespace:n.namespace,requiredState:Fh(n,t.singletons)}}function Bh(e,t){return[...new Set(e)].flatMap(n=>il(n,t))}function lt(e){return ye(e)?[e.ref]:Qe(e)?e.template.flatMap(t=>ye(t)?[t.ref]:[]):[]}function gn(e){switch(e.kind){case"visible":case"disabled":case"enabled":case"focused":case"checked":return tn(e.locator);case"value":case"text":return[...tn(e.locator),...lt(e.value)];case"singleton":return lt(e.assertion.value);case"browser":return lt(e.value);case"state":return[...e.assertion.kind==="deleted"?[]:Object.values(mn(e.assertion.props)).flatMap(t=>lt(t)),...Object.values(e.key).flatMap(t=>Uh(t))];case"not":return gn(e.predicate);case"when":return e.branches.flatMap(t=>t.consequence.flatMap(n=>gn(n)));case"and":return e.predicates.flatMap(t=>gn(t));case"count":return[]}}function jh(e){return{absences:e.absent,exclusives:e.exclusive,namespace:new Map(e.world.map(t=>[t.as,t.entity])),setups:e.world}}function tn(e){return e.by==="inside"?[...tn(e.scope),...tn(e.target)]:e.by==="role"?e.name==null?[]:lt(e.name):lt(e.value)}function Uh(e){return Vh(e)?Object.values(e.selection.where).flatMap(t=>Uh(t)):lt(e)}function Vh(e){return typeof e=="object"&&e!==null&&"kind"in e}function $R(e){return e.kind==="goto"?lt(e.url):e.kind==="fill"||e.kind==="select"?[...tn(e.locator),...lt(e.value)]:e.kind==="press"?e.locator==null?[]:tn(e.locator):(e.kind==="upload",tn(e.locator))}function LR(e){return[...$R(e.action),...e.expect.flatMap(t=>gn(t))]}function _R(e){return e.absences.map(t=>({entity:t.entity,...Or(t.where,e)}))}function Or(e,t){let n=Object.entries(e),r=Object.fromEntries(n.flatMap(([o,s])=>ye(s)||Qe(s)?[]:[[o,s]])),i=n.flatMap(o=>{let s=o[1];if(!ye(s))return[];let a=il(s.ref,t.namespace).at(0);return a==null?[]:[{entity:a.entity,field:o[0],targetAlias:a.aliasPath,targetField:a.field}]});return{literals:r,relations:i}}function DR(e,t){return e.map(n=>({alias:n.as,entity:n.entity,...Or(n.set,t)}))}function FR(e){return DR(e.setups,e)}function BR(e){let t=e.chunk.findIndex(s=>s.action.kind!=="goto"),n=t===-1?e.chunk:e.chunk.slice(0,t),r=e.chunk.slice(n.length),i=r.at(-1)??e.chunk.at(-1);if(i==null)throw new Error("empty transition chunk");let o=[...new Set(e.chunk.flatMap(s=>LR(s)))];return{effectStep:i,index:e.index,intent:e.intent,namespace:e.namespace,nav:n,paramSpaces:Object.fromEntries(o.filter(s=>e.paramSpaceOf.has(s)).map(s=>[s,e.paramSpaceOf.get(s)])),requiredState:e.requiredState,steps:r,test:e.testRef,wait:yh(r.flatMap(s=>jR(s))),whenSteps:e.whenChunk}}function jR(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function il(e,t){let n=pn(e);if(n==null)return[];let r=t.get(n.alias);return r==null?[]:[{aliasPath:n.alias,entity:r,field:n.field,ref:e}]}function UR(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function VR(e,t){return new Map(Object.entries(e.params).map(([n,r])=>[n,t.get(r.valueSpace)]))}function WR(e){return rl(e,0,[],[])}function rl(e,t,n,r){let i=e[t];if(i==null)return n.length===0?r:[...r,n];let o=[...n,i];return zR(i)?rl(e,t+1,[],[...r,o]):rl(e,t+1,o,r)}function zR(e){return e.expect.some(t=>t.kind==="state")}function Wh(e){return zh(e,new Map)}function GR(e,t){return e.reduce((n,r)=>n??t(r),null)}function zh(e,t){let n=e.variables.find(r=>!t.has(r));return n==null?t:GR(e.domain(n),r=>{let i=new Map([...t,[n,r]]);return e.consistent(i)?zh(e,i):null})}function vt(e,t){let n=HR(e,t);if(n==null)return null;let r=eA(n);return tA(e.singletons,t,r)?r:null}function HR(e,t){let{absences:n,entities:r,exclusives:i}=e,o=new Map(r.map(a=>[a.alias,a])),s=Wh({variables:r.map(a=>a.alias),consistent:a=>qR(a)&&KR(r,a)&&ZR(n,a,t),domain:a=>XR(o.get(a),t)});return s==null?null:QR(i,r,s,t)?s:null}function qR(e){let t=[...e.values()];return new Set(t).size===t.length}function KR(e,t){return e.every(n=>t.has(n.alias)?n.relations.every(r=>YR(n,r,t)):!0)}function YR(e,t,n){if(!n.has(t.targetAlias))return!0;let r=n.get(t.targetAlias)?.[t.targetField];return r==null?!0:n.get(e.alias)?.[t.field]===r}function ZR(e,t,n){return e.every(r=>![...n.entities.get(r.entity)?.values()??[]].some(i=>JR(i,r,t)))}function JR(e,t,n){return Gh(e,t)?t.relations.every(r=>{if(!n.has(r.targetAlias))return!1;let i=n.get(r.targetAlias)?.[r.targetField];return i!=null&&e[r.field]===i}):!1}function Gh(e,t){return Object.entries(t.literals).every(([n,r])=>r===null?e[n]==null:e[n]===r)}function XR(e,t){return e==null?[]:[...t.entities.get(e.entity)?.values()??[]].filter(n=>Gh(n,e))}function QR(e,t,n,r){return e.every(i=>{let o=t.filter(a=>a.entity===i&&n.has(a.alias)).length;return(r.entities.get(i)?.size??0)===o})}function eA(e){return new Map([...e].flatMap(([t,n])=>Object.entries(n).flatMap(r=>{let i=r[1];return typeof i=="string"||typeof i=="number"||typeof i=="boolean"?[[Nt(`${t}.${r[0]}`),i]]:[]})))}function tA(e,t,n){return Object.entries(e).every(([r,i])=>{if(!vh(i,J,n))return!1;let o=et(i,J,n),s=t.singletons[r],a=Pt.safeParse(r);return a.success?ja(a.data,o,s):s===o})}function qh(e,t,n){return e.reduce((r,i)=>{let o=qi(r.snapshot,nA(i),n);return{resolved:[...r.resolved,rA(i,o,n)],snapshot:o}},{resolved:[],snapshot:t}).resolved}function nA(e){return e.expect.filter(t=>t.kind==="state")}function rA(e,t,n){return e.expect.some(r=>r.kind==="when")?{...e,expect:e.expect.flatMap(r=>Kh(r,{env:n,snapshot:t}))}:e}function Kh(e,t){if(e.kind!=="when")return[e];let n=iA(e,t);return n==null?[]:n.flatMap(r=>Kh(r,t))}function iA(e,t){return e.branches.find(n=>n.condition==null||ol(n.condition,t))?.consequence}function ol(e,t){if(e.kind==="count")return yn(t.snapshot,e.entity,{},t.env).length===e.value;if(e.kind==="singleton"){let n=et(e.assertion.value,J,t.env);return Hh(t.snapshot.singletons[e.singleton])===Hh(n)}return e.kind==="not"?!ol(e.predicate,t):e.predicates.every(n=>ol(n,t))}function Hh(e){return e==null?"\u2205":JSON.stringify(e)}function to(e,t,n){let r=vt(e.requiredState,t);return r==null?null:new Map([...r,...Object.entries(n).map(([i,o])=>[Nt(i),o])])}function no(e,t,n){let r=qh(e.whenSteps,n,t),i=r.at(-1)??e.effectStep,o=Mr(i,t),s=aA(e,t);return{effect:lA(o.effect,s),steps:r.map(a=>{let l=Mr(a,t);return{action:l.action,effect:l.effect,pendingChecks:l.pendingChecks,reconcile:l.reconcile,source:a,verifyChanges:l.verifyChanges}})}}function sl(e,t,n){return vt(e.requiredState,n)==null?!1:bn(t(n))!==bn(n)||uA(e)||oA(e)}function oA(e){return[...e.nav,...e.steps].every(t=>t.expect.every(n=>n.kind!=="state"))}var Yh=new WeakMap;function bn(e){let t=Yh.get(e);if(t!=null)return t;let n=V({entities:[...e.entities].map(([r,i])=>[r,[...i]]),singletons:sA(e.singletons)});return Yh.set(e,n),n}function sA(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>t==="url"&&typeof n=="string"?[t,Tt(n)]:[t,n]))}function aA(e,t){let n=e.nav.at(-1);return n==null?void 0:Mr(n,t).action.url}function lA(e,t){if(t==null)return e;let n=Tt(t);return r=>{let i=e(r);return{...i,singletons:{...i.singletons,url:n}}}}function uA(e){return e.effectStep.expect.some(t=>t.kind==="state"&&t.assertion.kind==="updated"&&Object.values(t.assertion.props).some(n=>en(n)))}function Nr(e,t,n){let r=to(e,t.snapshot,n);if(r==null)return null;let i=cA(e,r,t.snapshot);return i==null||!sl(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function Zh(e,t,n){let r=to(e,t.snapshot,n);if(r==null)return"required-state-unsatisfied";try{return no(e,r,t.snapshot),"no-effect"}catch{return"unresolvable"}}function cA(e,t,n){try{return no(e,t,n)}catch{return null}}function Dn(e,t,n){return e.flatMap((r,i)=>{let o=n(r),s=Nr(r,t,o);return s==null?[]:[{idx:i,label:xt(r),params:o,stepRun:s}]})}var dA={absences:[],entities:[],exclusives:[],singletons:{}};function $r(e){return{...dA,...e}}function Lr(e,t){if(e==null)return new Set;if(e.by==="inside")return new Set([...Lr(e.scope,t),...Lr(e.target,t)]);let n=e.by==="role"?e.name:e.value;return new Set(t(n))}function al(e){return fA(e).flatMap(t=>hA(t))}function fA(e){return[...e.reduce((n,r)=>{let i=V([r.when.singletons,r.consequence]);return new Map([...n,[i,[...n.get(i)??[],r]]])},new Map).values()]}function hA(e){if(e.length<2)return[];let t=e.map(o=>new Set(o.when.entities.map(s=>ll(s)))),[n]=t;if(n==null)return[];let r=[...n].filter(o=>t.every(s=>s.has(o))),i=e.toSorted((o,s)=>o.when.entities.length-s.when.entities.length)[0];return i==null||r.length===i.when.entities.length?[]:pA(e,r)?[]:bA(i,r,wA(e))}function ll(e){return V([e.entity,e.literals])}function pA(e,t){return e.some(n=>{let r=Jh(n.consequence),i=mA(r),o=yA(r);return n.when.entities.some(s=>!t.includes(ll(s))&&(gA(s,i)||o.has(s.alias)))})}function Jh(e){return e.kind==="not"?Jh(e.predicate):"locator"in e?e.locator:void 0}function mA(e){return Lr(e,t=>t==null||ye(t)||Qe(t)?[]:[t])}function yA(e){return Lr(e,t=>{if(t==null||!ye(t))return[];let n=pn(t.ref);return n==null?[]:[n.alias]})}function gA(e,t){return Object.values(e.literals).some(n=>typeof n=="string"&&t.has(n))}function bA(e,t,n){let r=e.when.entities.filter(l=>t.includes(ll(l))),i=e.when.entities.filter(l=>!r.includes(l)).filter(l=>e.when.exclusives.includes(l.entity)).map(l=>({...l,literals:{},relations:[]})),o=[...r,...i],s=new Set(o.map(l=>l.alias));if(![...e.refs].every(l=>s.has(l)))return[];let a=$r({entities:o.map(l=>SA(l,s)),exclusives:e.when.exclusives.filter(l=>o.some(u=>u.entity===l)),singletons:e.when.singletons});return[{consequence:e.consequence,origin:{kind:"generalized",tests:n},refs:e.refs,when:a}]}function SA(e,t){return{...e,relations:e.relations.filter(n=>t.has(n.targetAlias))}}function wA(e){return[...new Set(e.flatMap(t=>t.origin==null?[]:t.origin.kind==="generalized"?t.origin.tests:[t.origin.test]))]}function xA(e){return e.flatMap((t,n)=>e.slice(n+1).flatMap(r=>np(t,r)))}function tp(e,t){return np(e,t).length>0}function np(e,t){let n=Xh(e.when,t.when);return!n&&!Xh(t.when,e.when)||!RA(e.consequence,t.consequence)?[]:[{a:e.consequence,b:t.consequence,when:n?t.when:e.when}]}function Xh(e,t){return Qh(e.entities,t.entities)&&Qh(e.absences,t.absences)&&e.exclusives.every(n=>t.exclusives.includes(n))&&vA(e.singletons,t.singletons)}function Qh(e,t){let n=new Set(t.map(r=>V(r)));return e.every(r=>n.has(V(r)))}function vA(e,t){return Object.entries(e).every(([n,r])=>n in t&&V(t[n])===V(r))}function RA(e,t){return e.kind==="not"?ul(e.predicate,t):t.kind==="not"?ul(e,t.predicate):AA(e,t)||CA(e,t)}function ul(e,t){return e.kind===t.kind&&"locator"in e&&"locator"in t&&rp(e,t)}function rp(e,t){return"locator"in t&&V(e.locator)===V(t.locator)}function AA(e,t){let n=new Set([e.kind,t.kind]);return n.has("enabled")&&n.has("disabled")&&"locator"in e&&"locator"in t?rp(e,t):!1}function CA(e,t){let n=ep(e),r=ep(t);return n==null||r==null||e.kind!==t.kind?!1:ul(e,t)&&V(n)!==V(r)}function ep(e){return e.kind==="value"||e.kind==="text"?e.value:null}function EA(e,t){return e.flatMap(n=>{let r=kA(n),i=new Set(n.requiredState.absences.map(o=>o.entity));return t.flatMap(o=>IA(n,o,r,i))})}function kA(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(n=>n.kind==="state"&&n.assertion.kind==="deleted"?[n.entity]:[])))}function IA(e,t,n,r){let{source:i,target:o}=t.reference;return!n.has(o)||n.has(i)||r.has(i)?[]:[{dataRule:t,source:i,target:o,transition:xt(e)}]}function cl(e){return V({consequence:e.consequence,when:e.when})}function dl(e){let t=[...PA(e),...VA(e)],n=al(t).reduce((r,i)=>[...t,...r].some(s=>tp(i,s))?r:[...r,i],[]);return Ot([...t,...n],cl)}function fl(e,t){return e.filter(n=>!MA(n)||TA(n)===t)}function hl(e){return e.kind==="not"?hl(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked"||e.kind==="value"||e.kind==="text"}function pl(e,t,n){if(vt(e.when,t)!=null)return null;let r=vt(e.when,n);return r==null?null:zA(e,r)}function PA(e){return Ot(Lt(e).flatMap(t=>OA(e,t)),cl)}function MA(e){return e.origin==null||e.origin.kind==="generalized"?!1:gn(e.consequence).some(t=>pn(t)!=null)}function TA(e){let{origin:t}=e;if(!(t==null||t.kind==="generalized"))return t.test}function OA(e,{test:t,workflow:n}){let r=eo(e,t),i=NA(n.steps);return t.steps.reduce((o,s)=>({pageRules:[...o.pageRules,...UA({branchScoped:i,namespace:r.namespace,origin:{kind:"test",test:$t(t)},requiredState:o.requiredState,step:s})],requiredState:$A(o.requiredState,s,r)}),{pageRules:[],requiredState:r.requiredState}).pageRules}function NA(e){let t=e.flatMap(n=>n.expect).flatMap(n=>ro(n)).map(n=>V(n));return new Set(t)}function ro(e){return e.kind==="not"?ro(e.predicate):e.kind==="and"?e.predicates.flatMap(t=>ro(t)):e.kind!=="when"?[]:e.branches.flatMap(t=>t.consequence.flatMap(n=>[n,...ro(n)]))}function $A(e,t,n){return t.expect.reduce((r,i)=>i.kind==="state"?LA(r,i,n):r,e)}function LA(e,t,n){if(t.assertion.kind==="created"){let o=_A(t.assertion.as,t.entity,t.assertion.props,n);return{...e,entities:[...e.entities,o]}}let r=Qi(t.key,t.entity,n.namespace);if(r==null)return e;if(t.assertion.kind==="deleted")return BA(e,r);let i=mn(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===r?op(o,i,n):o)}}function _A(e,t,n,r){return op({alias:e,entity:t,literals:{},relations:[]},n,r)}function op(e,t,n){return Object.entries(t).reduce((r,[i,o])=>{if(Qe(o))return r;if(ye(o)){let s=DA(o.ref,i,n.namespace);return{...r,literals:FA(r.literals,i),relations:s==null?r.relations:[...ip(r.relations,i),s]}}return{...r,literals:{...r.literals,[i]:o},relations:ip(r.relations,i)}},e)}function DA(e,t,n){let r=pn(e);if(r==null)return;let i=n.get(r.alias);return i==null?void 0:{entity:i,field:t,targetAlias:r.alias,targetField:r.field}}function FA(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>n!==t))}function ip(e,t){return e.filter(n=>n.field!==t)}function BA(e,t){let n=e.entities.find(i=>i.alias===t),r=jA(e,t);return n==null?r:{...r,absences:[...r.absences,{entity:n.entity,literals:n.literals,relations:n.relations}]}}function jA(e,t){return{...e,entities:e.entities.filter(n=>n.alias!==t)}}function UA({branchScoped:e,namespace:t,origin:n,requiredState:r,step:i}){if(i.action.kind!=="goto")return[];let o=i.action.url;return i.expect.filter(s=>hl(s)).filter(s=>!e.has(V(s))).map(s=>sp({consequence:s,namespace:t,origin:n,requiredState:r,url:o}))}function sp({consequence:e,namespace:t,origin:n,requiredState:r,url:i}){return{consequence:e,origin:n,refs:new Set(Bh([...lt(i),...gn(e)],t).map(o=>o.aliasPath)),when:{...r,singletons:{...r.singletons,url:i}}}}function VA(e){return Ot(Ji(e).flatMap(t=>WA(t)),cl)}function WA(e){let t=e.nav.at(-1),n=e.steps[0]?.action,r=n!=null&&"locator"in n?n.locator:void 0;return t==null||t.action.kind!=="goto"||r==null?[]:[sp({consequence:{kind:"enabled",locator:r,wait:void 0},namespace:e.namespace,origin:{intent:e.intent,kind:"trigger",test:e.test},requiredState:e.requiredState,url:t.action.url})]}function zA(e,t){try{let n=Yi(e.consequence,t);return n==null?null:{check:n}}catch{return null}}function ml(e){return za(Lt(e).flatMap(t=>GA(e,t.test)))}function yl(e,t){return vt(e.when,t)==null?!1:vt(e.holds,t)==null}function GA(e,t){let n=eo(e,t);return n.requiredState.entities.flatMap(r=>r.relations.flatMap(i=>HA(e,r,i,n.namespace)?YA(r,i,n.namespace):[]))}function HA(e,t,n,r){let i=r.get(n.targetAlias);return i!=null&&!qA(e,t.entity,n.field)&&KA(e,i,n.targetField)}function qA(e,t,n){return e.entities.find(r=>r.name===t)?.props[n]?.optional===!0}function KA(e,t,n){return e.entities.find(r=>r.name===t)?.identity.includes(n)===!0}function YA(e,t,n){let r=n.get(t.targetAlias);if(r==null)return[];let i=ap(e.alias,e.entity),o=ap(t.targetAlias,r);return[{holds:$r({entities:[{...i,relations:[t]},o]}),reference:{field:t.field,source:e.entity,target:r,targetField:t.targetField},when:$r({entities:[i]})}]}function ap(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function lp(e,t){let n=[...t.entities].flatMap(([o,s])=>[...s].map(([a,l])=>ZA({entity:o,key:a,pre:e,row:l}))),r=[...e.entities].flatMap(([o,s])=>[...s].flatMap(([a,l])=>JA({entity:o,key:a,post:t,row:l}))),i=Object.entries(t.singletons).map(([o,s])=>({changed:e.singletons[o]!==s,name:o,value:s}));return{rows:[...n,...r],singletons:i}}function ZA({entity:e,key:t,pre:n,row:r}){let i=XA(n.entities.get(e),t),o=Object.entries(r).map(([s,a])=>({changed:i==null||i[s]!==a,field:s,value:a}));return{changed:i==null||o.some(s=>s.changed),entity:e,fields:o,key:t,status:i==null?"created":"present"}}function JA({entity:e,key:t,post:n,row:r}){if(n.entities.get(e)?.has(t)===!0)return[];let i=Object.entries(r).map(([o,s])=>({changed:!1,field:o,value:s}));return[{changed:!0,entity:e,fields:i,key:t,status:"deleted"}]}function XA(e,t){return e?.get(t)}function gl(e,t,n){return t.steps.map(r=>({effect:r.effect,pendingChecks:r.pendingChecks.map(i=>({budget:i.budget,check:{kind:"poll",run:()=>n.evaluate(i.check)},source:{check:i.check,kind:"step"},targetIds:()=>n.locateIds(io(i.check))})),reconcile:r.reconcile,source:r.source,step:{action:r.action,intent:e.intent,test:e.test},sync:e.wait,verifyChanges:r.verifyChanges,perform:()=>n.perform(r.action),requiredState:()=>!0,targetIds:()=>n.locateIds(r.action.locator)}))}function io(e){if(e.kind==="not")return io(e.inner);if(e.kind!=="browser")return e.locator}async function up(e,t){let{params:n,transition:r}=e.stepRun,i=Nr(r,e.state,n);if(i==null){let s={intent:r.intent,kind:"unrunnable",reason:Zh(r,e.state,n),test:r.test};return{label:xt(r),next:e.state,result:{finalModel:e.state.snapshot,findings:[s]}}}let o=await Ya({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,pageRulePendingChecks:eC(e.pageRules,e.dataRules,e.driver),steps:gl(e.stepRun.transition,i.resolved,e.driver),stopAfterStep:e.stopAfterStep==null?void 0:e.stopAfterStep-e.stepBase},t);return{label:xt(e.stepRun.transition),next:{snapshot:o.finalModel},result:o}}function QA(e,t){return yl(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},source:{dataRule:e,kind:"data-rule"},targetIds:()=>Promise.resolve([])}]:[]}function eC(e,t,n){return(r,i)=>[...e.flatMap(o=>tC(o,r,i,n)),...t.flatMap(o=>QA(o,i))]}function tC(e,t,n,r){let i=pl(e,t,n);return i==null?[]:[{budget:"fast",check:{kind:"poll",run:()=>r.evaluate(i.check)},source:{check:i.check,kind:"page-rule",origin:e.origin},targetIds:()=>r.locateIds(io(i.check))}]}function oo(e,t){return bl({acc:{findings:[],ran:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function bl({acc:e,index:t,params:n,signal:r,state:i,stepBase:o}){Qt(r);let s=n.sequence[t];if(s==null)return e;let a=Date.now(),l=[],u=await up({canon:n.canon,classify:n.classify,dataRules:n.dataRules,driver:n.driver,onAssertion:n.onAssertion,pageRules:n.pageRules,state:i,stepBase:o,stepRun:s,stopAfterStep:n.stopAfterStep,onStep:d=>{l.push(d.index),n.onEvent({annotations:d.annotations,endMs:d.endMs,findings:d.findings,index:o+d.index,kind:"step",source:d.source,startMs:d.startMs,state:lp(d.pre,d.post),url:d.url})}},r);if(u==null)return bl({acc:e,index:t+1,params:n,signal:r,state:i,stepBase:o});n.onEvent({endMs:Date.now(),intent:s.transition.intent,kind:"ran",startMs:a}),u.result.findings.forEach(d=>{n.onEvent({finding:d,kind:"finding"})});let c={findings:[...e.findings,...u.result.findings],ran:[...e.ran,u.label]};return u.result.findings.length>0||n.stopAfterStep!=null&&o+l.length>=n.stopAfterStep?c:bl({acc:c,index:t+1,params:n,signal:r,state:u.next,stepBase:o+l.length})}var nC={value:e=>rC(e)};function wl(e,t){return{value:n=>e.value({...n,seed:`${t}:${n.seed}`})}}function xl(e,t){return{value:n=>e.value({...n,anchor:t})}}function rC({anchor:e,constraints:t,generator:n,nullable:r,seed:i,type:o,values:s,valueSpace:a}){let l=Sl(`${a}:${i}`);return r&&l%4===0?null:s!=null&&s.length>0?s[l%s.length]??s[0]??null:n==="date.iso"?iC({anchor:e,constraints:t,n:l,timeHash:Sl(`${a}:${i}#tod`)}):o==="number"?oC(l,t):o==="boolean"?l%2===0:cC(n,l)}var so=864e5;function iC({anchor:e,constraints:t,n,timeHash:r}){if(t?.kind!=="datetime")throw new Error("datetime value space requires offsetDays constraints");if(e==null)throw new Error("datetime value space requires a run anchor timestamp");let i=Date.parse(e);if(Number.isNaN(i))throw new TypeError(`datetime anchor "${e}" is not a valid ISO timestamp`);let o=t.maxOffsetDays-t.minOffsetDays+1,s=o<=0?t.minOffsetDays:t.minOffsetDays+n%o,a=Math.floor(i/so)*so;return new Date(a+s*so+r%so).toISOString()}function Sl(e,t=0,n=7){return t>=e.length?n>>>0:Sl(e,t+1,n*31+(e.codePointAt(t)??0)>>>0)}function oC(e,t){if(t?.kind!=="number"||t.min==null||t.max==null)throw new Error("number value space requires min and max constraints");let n=t.max-t.min+1;return n<=0?t.min:t.min+e%n}var sC=["ada","bruno","carmen","dario","elena","felix","greta","hugo","iris","jonas","kira","lena","mateo","nadia","oscar","petra","quinn","rosa","stefan","tara","ugo","vera","wim","yara"],aC=["abreu","berg","costa","duval","eriksen","fischer","garza","holm","ito","jansen","kovac","laurent","moreau","novak","okafor","petrov","quist","rossi","sato","tanaka","ueda","vargas","weber","zhang"],lC=["amber","brisk","calm","deep","early","fond","glad","hazel","ivory","jade","keen","lush","mauve","noble","opal","plum","quiet","rapid","sage","teal","umber","vivid","warm","zesty"],uC=["aspen","brook","cedar","dune","ember","fjord","grove","harbor","isle","juniper","knoll","lagoon","meadow","nimbus","orchid","prairie","quartz","ridge","summit","thicket","umbra","vale","willow","zephyr"];function ao(e,t){let n=e[t%e.length];if(n==null)throw new Error("empty word list");return n}function lo(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function cC(e,t){let n=ao(sC,t),r=ao(aC,Math.floor(t/31)),i=ao(lC,t),o=ao(uC,Math.floor(t/29));return e==="internet.email"?`${n}.${r}${String(t%100)}@test.ripplo.ai`:e==="internet.url"?`https://${i}-${o}.example.com`:e==="person.fullName"?`${lo(n)} ${lo(r)}`:e==="company.name"?`${lo(i)} ${lo(o)}`:e==="lorem.slug"?`${i}-${o}`:`${o}-${String(t%1e3)}`}import{ResultAsync as vl}from"neverthrow";var _r=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}};function uo(e){return{read:t=>dC(t,e),seedScript:t=>`globalThis[${JSON.stringify(wa)}] = ${JSON.stringify(t)};`}}async function dC(e,t){let n={title:await e.title(),url:Tt(e.url()),viewport:pC(e.viewportSize())};if(t.length===0)return n;let r=await e.evaluate(hC,{mountKey:_i,names:t,timeoutMs:fC});if(r.kind==="unmounted")throw new _r(_i);return{...n,...r.values}}var fC=5e3;async function hC(e){let t=Date.now()+e.timeoutMs;for(;Reflect.get(globalThis,e.mountKey)==null&&Date.now()<t;)await new Promise(r=>setTimeout(r,25));let n=Reflect.get(globalThis,e.mountKey);return n==null?{kind:"unmounted"}:{kind:"values",values:Object.fromEntries(e.names.map(r=>[r,n.readSingleton(r)??null]))}}function pC(e){return e==null?"":`${String(e.width)}x${String(e.height)}`}function Rl(e,t,n){return{evaluate:r=>vl.fromPromise(fp(mC(e,n,r),`check ${r.kind}`),cp),locateIds:r=>xC(e,r),observe:()=>t.read().andThen(r=>vl.fromPromise(fp(hp(e,n,0),"observe"),cp).map(i=>({snapshot:{...r,singletons:{...r.singletons,...i}}}))),perform:r=>vl.fromPromise(mp(e,r,0),i=>Qf(r.kind,i))}}async function mC(e,t,n){try{return await Sp(e,t,n)}catch(r){if(pp(r))return!1;throw r}}function cp(e){return e instanceof _r?qf(e.mountKey):eh(e)}var yC=[100,250,500];async function hp(e,t,n){try{return await t.read(e)}catch(r){let i=yC[n];if(i==null||!pp(r))throw r;return await bp(i),hp(e,t,n+1)}}function pp(e){let t=e instanceof Error?e.message:String(e);return/Execution context was destroyed|Cannot find context with specified id|[Ff]rame was detached|frame got detached/.test(t)}var dp=35e3;function fp(e,t){let n,r=new Promise((i,o)=>{n=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(dp)}ms`))},dp)});return Promise.race([e,r]).finally(()=>{clearTimeout(n)})}var gC=[250,750,2e3];async function mp(e,t,n){try{await bC(e,t)}catch(r){let i=gC[n];if(i==null||!RC(r))throw r;await bp(i),await mp(e,t,n+1)}}async function bC(e,t){if(t.kind==="goto"){await e.goto(Fn(t.url,t,"url"),{waitUntil:"domcontentloaded"});return}if(t.kind==="press"&&t.locator==null){await e.keyboard.press(Fn(t.key,t,"key"));return}let n=t.kind!=="upload";await SC(e,yp(e,t.locator,{visibleOnly:n}),t)}function Fn(e,t,n){if(e==null)throw new Error(`action "${t.kind}" requires ${n}`);return e}function SC(e,t,n){switch(n.kind){case"goto":throw new Error("goto must not be located");case"fill":return t.fill(String(Fn(n.value,n,"value")));case"clear":return t.clear();case"click":return t.click();case"dblclick":return t.dblclick();case"check":return t.check();case"uncheck":return t.uncheck();case"hover":return t.hover();case"select":return wC(e,t,String(Fn(n.value,n,"value")));case"upload":return t.setInputFiles(Fn(n.files,n,"files"));case"press":return t.press(Fn(n.key,n,"key"))}}async function wC(e,t,n){if(await t.evaluate(i=>i.tagName==="SELECT")){await t.selectOption(n);return}await t.click(),await t.fill(n),await e.locator(gp("option",n)).filter({visible:!0}).click()}async function xC(e,t){if(t==null)return[];try{let n=co(e,t,{visibleOnly:!1});if(await n.count()===0)return[];let r=await n.first().evaluate(vC);return r>0?[r]:[]}catch{return[]}}function vC(e){return globalThis.__ripploRrwebMirror?.getId(e)??-1}function yp(e,t,n){if(t==null)throw new Error("action requires a locator");return co(e,t,n)}function co(e,t,n){if(t.by==="inside"){let i=co(e,t.scope,n);return co(i,t.target,n)}let r=t.by==="testId"?e.getByTestId(t.value):e.locator(gp(t.role,t.name));return n.visibleOnly?r.filter({visible:!0}):r}function gp(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}function RC(e){let t=e instanceof Error?e.message:String(e);return/net::ERR_|ERR_HTTP_RESPONSE_CODE_FAILURE|ECONNREFUSED|ECONNRESET|socket hang up|fetch failed|page\.goto: Timeout/.test(t)}function bp(e){return new Promise(t=>{setTimeout(t,e)})}async function Sp(e,t,n){if(n.kind==="browser")return CC(e,t,n.name,n.value);if(n.kind==="not")return!await Sp(e,t,n.inner);let r=yp(e,n.locator,{visibleOnly:!0});return n.kind==="value"?await r.inputValue()===n.value:n.kind==="text"?(await r.textContent()??"").includes(n.value):AC(r,n.kind)}function AC(e,t){return t==="visible"?e.isVisible():t==="disabled"?e.isDisabled():t==="enabled"?e.isEnabled():t==="checked"?e.isChecked():e.evaluate(n=>n===n.ownerDocument.activeElement)}async function CC(e,t,n,r){let o=(await t.read(e))[n];return typeof o=="string"&&o.includes(r)}import EC from"path";async function fo({baseUrl:e,browser:t,capture:n,clientState:r,engine:i,extraHeaders:o,fixturesDir:s,reader:a,session:l}){let u=await t.newContext({baseURL:e,reducedMotion:"reduce",storageState:l==null?void 0:{cookies:kC(l.cookies,e),origins:l.origins}}),c=IC(o,l?.headers);c!=null&&await u.setExtraHTTPHeaders(c),await u.addInitScript(i.seedScript(r));let d=n==null?PC():await n.hub.attach(u,n.runId),f=await u.newPage();return d.onPage(f),{context:u,driver:OC(MC(Rl(f,a,i),s),d),emitAssertion:d.emitAssertion,close:()=>NC({context:u,handle:d})}}async function Al(e,t){let n=await xp(e);try{return await t(n)}finally{await n.close()}}function kC(e,t){let n=new URL(t).hostname;return e.map(r=>({...r,domain:n}))}function IC(e,t){return e==null?t:t==null?e:{...e,...t}}function PC(){return{emitAction:()=>{},emitAssertion:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function xp(e){let{chromium:t}=await import("playwright");return t.launch({headless:!e})}function ho({headed:e}){let t;return{acquire:async()=>{let i=t;if(i!=null){let o=await i.catch(()=>{});if(o?.isConnected()===!0)return o;t===i&&(t=void 0)}return t??=xp(e),t},close:async()=>{let i=t;t=void 0,i!=null&&await i.then(o=>o.close()).catch(()=>{})}}}function MC(e,t){return{evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:n=>e.perform(TC(n,t))}}function TC(e,t){return e.kind!=="upload"||e.files==null?e:{...e,files:e.files.map(n=>EC.join(t,n))}}function OC(e,t){return{evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:n=>(t.emitAction(n),e.perform(n))}}async function NC({context:e,handle:t}){await wp(t.finish()),await wp(e.close())}var $C=15e3;async function wp(e){let t,n=new Promise(r=>{t=setTimeout(r,$C)});await Promise.race([e.catch(()=>{}),n]).finally(()=>{clearTimeout(t)})}import{err as LC,ok as _C,Result as Cl}from"neverthrow";function El(e,t,n){return{read:()=>n.read(e.map(r=>r.name),t).andThen(r=>DC(e,r))}}function DC(e,t){return Cl.combine(e.map(n=>FC(n,t.entities[n.name]??[]).map(r=>[n.name,r]))).map(n=>({entities:new Map(n),singletons:t.singletons}))}function FC(e,t){let n=Zi(e);return Cl.combine(t.map(r=>BC(r,e).map(i=>[i,jC(r,n)]))).map(r=>new Map(r))}function BC(e,t){return Cl.combine(t.identity.map(n=>{let r=e[n];return r==null?LC(Yf(t.name,n)):_C(String(r))})).map(n=>n.join(":"))}function jC(e,t){let n=t.map(r=>[r,e[r]]).filter(r=>r[1]!=null);return Object.fromEntries(n)}var vp=ua(cx(),1);import UC from"crypto";import{err as VC,errAsync as kl,ok as WC,ResultAsync as Bn}from"neverthrow";var zC=3e4,GC=[250,750,2e3],HC=[500,1e3,2e3,3e3];function Il({baseUrl:e,extraHeaders:t,runId:n,secret:r},i){let o=new vp.Webhook(r),s=(a,l,u)=>qC({baseUrl:e,body:l,extraHeaders:t,path:a,retry:u.retry,schema:u.schema,signal:u.signal,webhook:o});return{query:{read:(a,l)=>s("/state",{entities:a,runId:n,singletons:l},{retry:"transient",schema:Fa,signal:i}).map(u=>({entities:u.entities,singletons:u.singletons}))},ready:()=>Ap(e,t,i,0),setupWorld:a=>s("/setup",{entities:a,runId:n},{retry:"connection",schema:Da,signal:i}).map(l=>l.rows),teardown:()=>s("/teardown",{runId:n},{retry:"connection",schema:Ba,signal:void 0}).map(()=>{})}}function qC(e){return Rp(e.retry,()=>JC(e),0)}function Rp(e,t,n){return t().orElse(r=>{let i=GC[n];return i==null||!YC(r,e)?kl(r):Bn.fromSafePromise(Cp(i)).andThen(()=>Rp(e,t,n+1))})}function Ap(e,t,n,r){return Bn.fromPromise(fetch(e,{headers:t,method:"HEAD",signal:Ep(n)}),i=>Ar("",i)).map(()=>{}).orElse(()=>{let i=HC[r];return i==null||n.aborted?kl(Xf(e)):Bn.fromSafePromise(Cp(i)).andThen(()=>Ap(e,t,n,r+1))})}var KC=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function YC(e,t){return e.kind==="aborted"?!1:ZC(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function ZC(e){return e.kind==="engine-network"&&e.code!=null&&KC.has(e.code)}function Cp(e){return new Promise(t=>{setTimeout(t,e)})}function JC({baseUrl:e,body:t,extraHeaders:n,path:r,schema:i,signal:o,webhook:s}){let a=JSON.stringify(t);return Bn.fromPromise(fetch(`${e}${r}`,{body:a,headers:{...n,"Content-Type":"application/json",...XC(s,a)},method:"PUT",signal:Ep(o)}),l=>Ar(r,l)).andThen(l=>QC(l,r)).andThen(l=>eE(i,l,r)).mapErr(l=>o?.aborted===!0?th():l)}function XC(e,t){let n=`msg_${UC.randomUUID()}`,r=new Date;return{"webhook-id":n,"webhook-signature":e.sign(n,r,t),"webhook-timestamp":String(Math.floor(r.getTime()/1e3))}}function Ep(e){let t=AbortSignal.timeout(zC);return e==null?t:AbortSignal.any([e,t])}function QC(e,t){return e.ok?Bn.fromPromise(e.json(),n=>Ar(t,n)):Bn.fromPromise(e.text().catch(()=>""),n=>Ar(t,n)).andThen(n=>kl(Hf(t,e.status,n)))}function eE(e,t,n){let r=e.safeParse(t);return r.success?WC(r.data):VC(Kf(n,r.error))}var ie=ua(Pp(),1),Ne={actual:e=>ie.default.red(e),bad:e=>ie.default.red(ie.default.bold(e)),bold:e=>ie.default.bold(e),dim:e=>ie.default.dim(e),expected:e=>ie.default.green(e),good:e=>ie.default.green(ie.default.bold(e)),heading:e=>ie.default.bold(ie.default.cyan(e)),path:e=>ie.default.cyan(ie.default.underline(e)),warn:e=>ie.default.yellow(ie.default.bold(e))},iE={assertion:ie.default.yellow,consistency:ie.default.magenta,"data rule":ie.default.yellow,driver:ie.default.red,"impossible action":ie.default.cyan,"page rule":ie.default.yellow,skipped:ie.default.red};function ut(e){return`${ie.default.red(ie.default.bold("\u2717"))} ${iE[e](ie.default.bold(e))}`}var oE=ie.default.red("\u2717"),rj=ie.default.green("\u2713"),sE=ie.default.dim("\u203A"),aE=8;function Mp(e,t,n){let r=n==null?"":` ${Ne.dim(n)}`;return` ${Ne.dim(e.padStart(aE))} ${t}${r}`}function Un(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${Un(e.scope)} \u25B8 ${Un(e.target)}`:e.name==null?e.role:`${e.role} "${e.name}"`}function Tl(e){return e.url!=null?`${e.kind} ${e.url}`:e.locator!=null?`${e.kind} ${Un(e.locator)}`:e.kind}function Vn(e){return e.kind==="not"?`not ${Vn(e.inner)}`:e.kind==="browser"?`${e.name}="${e.value}"`:e.kind==="value"||e.kind==="text"?`${e.kind} ${Un(e.locator)}="${e.value}"`:`${e.kind} ${Un(e.locator)}`}function Dr(e){let{field:t,source:n,target:r,targetField:i}=e.reference;return`${n}.${t} \u2192 ${r}.${i}`}function Op(e){return`${e.intent} \u203A ${Tl(e.action)}`}function Np(e){return e.kind==="data-rule"?`data rule ${Dr(e.dataRule)}`:`${e.kind} ${Vn(e.check)}`}function $e(e){return e==null?"\u2205":JSON.stringify(e)}function $p(e){return e.kind==="unexpected-row"?`${e.entity} "${e.key}" present in the app but the test expected none`:e.kind==="missing-row"?`${e.entity} "${e.key}" expected by the test but missing in the app`:e.kind==="wrong-value"?`${e.entity}.${e.field} [${e.key}] expected=${$e(e.snapshot)} actual=${$e(e.sut)}`:e.kind==="expected-change"?`${e.entity}.${e.field} [${e.key}] expected to change but stayed ${$e(e.value)}`:`${e.singleton} expected=${$e(e.snapshot)} actual=${$e(e.sut)}`}function Ol(e){return{label:Np(e.source),step:Op(e.step)}}function Nl({evidencePath:e,finding:t}){let n=lE(t);return e==null?n:`${n} Evidence: ${Ne.path(e)}`}function Lp(e){return cE(dE(e))}function lE(e){return e.kind==="consistency"?wE(e):e.kind==="pending-check"?RE(e.source,e.step,e.budget):e.kind==="impossible-action"?`${ut("impossible action")} The step "${e.step.intent}" ran ${Tl(e.step.action)} from a state the test says can't happen. Either the test's required state is stricter than the app really is, or the app exposes this action somewhere it shouldn't \u2014 check which before loosening the test.`:e.kind==="unrunnable"?`${ut("skipped")} The planned step "${e.intent}" could not run \u2014 ${_p(e.reason)}. A planned move was skipped, so this run proved less than it claims \u2014 fix the plan or the starting state rather than ignoring the skip.`:`${ut("driver")} The browser failed while running "${e.step.intent}" \u2014 ${hn(e.error)}. This is an environment failure (daemon, dev server, ports), not an app or test bug \u2014 fix the run environment and rerun.`}var uE=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function cE(e){return e.replaceAll(uE,"").replaceAll(/\s+/g," ").trim()}function dE(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${$p(e.mismatch)}${t}`}return e.kind==="pending-check"?`${CE(e.source)} failed at "${e.step.intent}": ${EE(e.source)}`:e.kind==="impossible-action"?`"${e.step.intent}" ran from a state the test says can't happen`:e.kind==="unrunnable"?`planned step "${e.intent}" could not run \u2014 ${_p(e.reason)}`:`driver failed at "${e.step.intent}": ${hn(e.error)}`}var fE={"no-effect":"the action has no observable effect from this state","required-state-unsatisfied":"the live state doesn't satisfy the step's required state",unresolvable:"a step references a value that doesn't exist yet (e.g. a not-yet-created id)"};function _p(e){return fE[e]}function hE({debugDir:e,runId:t}){let n=`${e}/${t}`;return Mp("behavior",Ne.path(`${n}/behavior.jsonl`),void 0)}function pE(e){if(e.kind==="cascade-gap"){let{gap:n}=e;return`${ut("data rule")} ${n.transition} deletes ${n.target} but leaves ${n.source} rows pointing at the deleted row. That breaks the data rule ${Dr(n.dataRule)} \u2014 cascade the delete in the app or declare the cleanup on the deleting step.`}if(e.kind==="create-gap"){let{gap:n}=e,r=n.missing.length===1?"field":"fields",i=n.missing.length===1?"it":"them";return`${ut("data rule")} ${n.transition} creates ${n.entity} without setting the required ${r} ${n.missing.join(", ")}. Set ${i} on the creating step or drop the requirement from the entity.`}let{conflict:t}=e;return`${ut("page rule")} Two page rules contradict each other \u2014 ${t.a.kind} vs ${t.b.kind} when ${JSON.stringify(t.when.singletons)}. They were learned from different tests asserting opposite things about the same page \u2014 one of those tests is wrong, fix it before trusting either rule.`}function mE(e){return"locator"in e&&e.locator!=null?`${e.kind} ${Ml(e.locator)}`:"url"in e?`${e.kind} ${yE(e.url)}`:e.kind}function yE(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:Dp(e)}function Ml(e){return e.by==="role"?e.name==null?e.role:`${e.role} ${Tp(e.name)}`:e.by==="inside"?`${Ml(e.scope)} \u25B8 ${Ml(e.target)}`:Tp(e.value)}function Tp(e){return e===null?"\u2205":typeof e=="string"?`"${e}"`:typeof e!="object"?String(e):"ref"in e?`{${e.ref}}`:Dp(e)}function Dp(e){return e.template.map(t=>typeof t=="string"?t:":id").join("")}function yo(e){return e==null?"At the end of the run":`After ${bE(e.action)} in ${e.intent}`}var gE={click:"clicking",fill:"filling",goto:"opening",hover:"hovering over",press:"pressing",select:"selecting",upload:"uploading to"};function bE(e){return e.url!=null?`opening ${e.url}`:e.locator!=null?`${gE[e.kind]??e.kind} ${jn(e.locator)}`:e.kind}function jn(e){return e.by==="testId"?`the element with testId "${e.value}"`:e.by==="inside"?`${jn(e.target)} inside ${jn(e.scope)}`:e.name==null?`the ${e.role}`:`the "${e.name}" ${e.role}`}function SE(e){return e.kind==="not"&&e.inner.kind==="visible"?`${jn(e.inner.locator)} never disappeared`:e.kind==="visible"?`${jn(e.locator)} never appeared`:e.kind==="value"||e.kind==="text"?`${jn(e.locator)} never showed "${e.value}"`:`the check ${Vn(e)} never held`}function wE(e){let t=e.pending?xE(e):vE(e.mismatch,e.step);return`${ut("consistency")} ${t}`}function xE(e){let t=`${Fp(e.budget)} wait window`,n="If this write is legitimately slow, declare wait: on the expectation or move it to a slower tier.",{mismatch:r}=e,i=yo(e.step);return r.kind==="wrong-value"?`${i}, ${r.entity}.${r.field} on row "${r.key}" never changed within the ${t} \u2014 it still showed ${Ne.actual($e(r.sut))} instead of ${Ne.expected($e(r.snapshot))}, so the write may not have landed at all. ${n}`:r.kind==="unexpected-row"?`${i}, the ${r.entity} row "${r.key}" was still there at the end of the ${t} \u2014 the delete may not have landed. ${n}`:r.kind==="missing-row"?`${i}, the ${r.entity} row "${r.key}" never appeared within the ${t} \u2014 the create may not have landed. ${n}`:r.kind==="expected-change"?`${i}, ${r.entity}.${r.field} on row "${r.key}" was expected to change but stayed ${Ne.actual($e(r.value))} through the ${t}, so the write may not have landed at all. ${n}`:`${i}, ${r.singleton} never changed within the ${t} \u2014 it still showed ${Ne.actual($e(r.sut))} instead of ${Ne.expected($e(r.snapshot))}, so the write may not have landed at all. ${n}`}function Fp(e){return`${String(kr[e]/1e3)}s`}function vE(e,t){let n=yo(t);return e.kind==="wrong-value"?`${n}, ${e.entity}.${e.field} on row "${e.key}" showed ${Ne.actual($e(e.sut))} but the test expected ${Ne.expected($e(e.snapshot))}. This is an app bug if the expected value is the promised behavior \u2014 if the app legitimately owns this value, assert changed() instead.`:e.kind==="singleton-mismatch"?`${n}, ${e.singleton} showed ${Ne.actual($e(e.sut))} but the test expected ${Ne.expected($e(e.snapshot))}. This is an app bug if the expected value is the promised behavior \u2014 otherwise correct the expected value at the step that sets it.`:e.kind==="unexpected-row"?`${n}, the app held a ${e.entity} row "${e.key}" the test never expected. Some step writes this row without declaring it \u2014 declare the effect on the acting step (${e.entity}.created, updated, or deleted), or if this write belongs to a different flow, cover it in that flow's test.`:e.kind==="missing-row"?`${n}, the test expected a ${e.entity} row "${e.key}" but the app had none. This is an app bug if the write was promised \u2014 if it only happens from a different starting state, restrict this test's given and cover that state in its own test.`:`${n}, ${e.entity}.${e.field} on row "${e.key}" was expected to change but stayed ${Ne.actual($e(e.value))}. This is an app bug if this action should change it \u2014 if the change needs other preconditions, split that case into its own test with the right given.`}function RE(e,t,n){let r=`${Fp(n)} wait window`;return e.kind==="data-rule"?`${ut("data rule")} ${yo(t)}, the data rule ${Dr(e.dataRule)} stopped holding \u2014 a referenced row went missing. This is an app bug if the reference should survive this action \u2014 confirm in behavior.jsonl before relaxing the rule.`:e.kind==="page-rule"?`${ut("page rule")} A page rule learned from ${AE(e.origin)} says ${Vn(e.check)} at this URL \u2014 it never held here within the ${r}. Either the rule is broader than the app guarantees or this page regressed \u2014 confirm in behavior.jsonl before narrowing the rule.`:`${ut("assertion")} ${yo(t)}, ${SE(e.check)} within the ${r}. This is usually a wrong accessible name, a UI regression, or a starting state this page doesn't have \u2014 confirm in behavior.jsonl before changing the test.`}function AE(e){return e==null?"another workflow":e.kind==="test"?`an assertion in test "${e.test}"`:e.kind==="trigger"?`the trigger of "${e.intent}" in test "${e.test}"`:`tests ${e.tests.map(n=>JSON.stringify(n)).join(", ")}`}function CE(e){return e.kind==="data-rule"?"data rule":e.kind==="page-rule"?"page rule":"assertion"}function EE(e){return e.kind==="data-rule"?Dr(e.dataRule):Vn(e.check)}import M0 from"path";import{err as es,ok as ts,ResultAsync as T0}from"neverthrow";import{existsSync as wk}from"fs";import{writeFile as xk}from"fs/promises";import vk from"path";import{err as Eo,ok as Rk}from"neverthrow";import{createRequire as kE}from"module";var IE=kE("/"),zn,PE,ME;try{zn=IE("worker_threads"),PE=zn.Worker,ME=zn.isMarkedAsUntransferable}catch{}var De=Uint8Array,Wn=Uint16Array,TE=Int32Array,Bp=new De([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),jp=new De([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),OE=new De([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Up=function(e,t){for(var n=new Wn(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new TE(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},zn=Up(Bp,2),Vp=zn.b,NE=zn.r;Vp[28]=258,NE[258]=28;var Wp=Up(jp,0),$E=Wp.b,dj=Wp.r,Dl=new Wn(32768);for(Z=0;Z<32768;++Z)_t=(Z&43690)>>1|(Z&21845)<<1,_t=(_t&52428)>>2|(_t&13107)<<2,_t=(_t&61680)>>4|(_t&3855)<<4,Dl[Z]=((_t&65280)>>8|(_t&255)<<8)>>1;var _t,Z,Fr=(function(e,t,n){for(var r=e.length,i=0,o=new Wn(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new Wn(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new Wn(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],c=t-e[i],d=s[e[i]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)a[Dl[d]>>l]=u}else for(a=new Wn(r),i=0;i<r;++i)e[i]&&(a[i]=Dl[s[e[i]-1]++]>>15-e[i]);return a}),Br=new De(288);for(Z=0;Z<144;++Z)Br[Z]=8;var Z;for(Z=144;Z<256;++Z)Br[Z]=9;var Z;for(Z=256;Z<280;++Z)Br[Z]=7;var Z;for(Z=280;Z<288;++Z)Br[Z]=8;var Z,zp=new De(32);for(Z=0;Z<32;++Z)zp[Z]=5;var Z;var LE=Fr(Br,9,1);var _E=Fr(zp,5,1),$l=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},ct=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Ll=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},DE=function(e){return(e+7)/8|0},go=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new De(e.subarray(t,n))};var FE=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ze=function(e,t,n){var r=new Error(t||FE[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,ze),!n)throw r;return r},Gp=function(e,t,n,r){var i=e.length,o=r?r.length:0;if(!i||t.f&&!t.l)return n||new De(0);var s=!n,a=s||t.i!=2,l=t.i;s&&(n=new De(i*3));var u=function(Y){var We=n.length;if(Y>We){var ce=new De(Math.max(We*2,Y));ce.set(n),n=ce}},c=t.f||0,d=t.p||0,f=t.b||0,p=t.l,h=t.d,m=t.m,y=t.n,S=i*8;do{if(!p){c=ct(e,d,1);var w=ct(e,d+1,3);if(d+=3,w)if(w==1)p=LE,h=_E,m=9,y=5;else if(w==2){var N=ct(e,d,31)+257,$=ct(e,d+10,15)+4,L=N+ct(e,d+5,31)+1;d+=14;for(var P=new De(L),j=new De(19),U=0;U<$;++U)j[OE[U]]=ct(e,d+U*3,7);d+=$*3;for(var ne=$l(j),_=(1<<ne)-1,Me=Fr(j,ne,1),U=0;U<L;){var He=Me[ct(e,d,_)];d+=He&15;var g=He>>4;if(g<16)P[U++]=g;else{var se=0,Oe=0;for(g==16?(Oe=3+ct(e,d,3),d+=2,se=P[U-1]):g==17?(Oe=3+ct(e,d,7),d+=3):g==18&&(Oe=11+ct(e,d,127),d+=7);Oe--;)P[U++]=se}}var bt=P.subarray(0,N),Ce=P.subarray(N);m=$l(bt),y=$l(Ce),p=Fr(bt,m,1),h=Fr(Ce,y,1)}else ze(1);else{var g=DE(d)+4,x=e[g-4]|e[g-3]<<8,I=g+x;if(I>i){l&&ze(0);break}a&&u(f+x),n.set(e.subarray(g,I),f),t.b=f+=x,t.p=d=I*8,t.f=c;continue}if(d>S){l&&ze(0);break}}a&&u(f+131072);for(var Mi=(1<<m)-1,gr=(1<<y)-1,Pn=d;;Pn=d){var se=p[Ll(e,d)&Mi],rt=se>>4;if(d+=se&15,d>S){l&&ze(0);break}if(se||ze(2),rt<256)n[f++]=rt;else if(rt==256){Pn=d,p=null;break}else{var br=rt-254;if(rt>264){var U=rt-257,Yt=Bp[U];br=ct(e,d,(1<<Yt)-1)+Vp[U],d+=Yt}var Sr=h[Ll(e,d)&gr],it=Sr>>4;Sr||ze(3),d+=Sr&15;var Ce=$E[it];if(it>3){var Yt=jp[it];Ce+=Ll(e,d)&(1<<Yt)-1,d+=Yt}if(d>S){l&&ze(0);break}a&&u(f+131072);var St=f+br;if(f<Ce){var Mn=o-Ce,Tn=Math.min(Ce,St);for(Mn+f<0&&ze(3);f<Tn;++f)n[f]=r[Mn+f]}for(;f<St;++f)n[f]=n[f-Ce]}}t.l=p,t.p=Pn,t.b=f,t.f=c,p&&(c=1,t.m=m,t.d=h,t.n=y)}while(!c);return f!=n.length&&s?go(n,0,f):n.subarray(0,f)};var BE=new De(0);var Hp=function(e,t){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&ze(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&ze(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};var _l=(function(){function e(t,n){typeof t=="function"&&(n=t,t={}),this.ondata=n;var r=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:r?r.length:0},this.o=new De(32768),this.p=new De(0),r&&this.o.set(r)}return e.prototype.e=function(t){if(this.ondata||ze(5),this.d&&ze(4),!this.p.length)this.p=t;else if(t.length){var n=new De(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length),this.p=n}},e.prototype.c=function(t){this.s.i=+(this.d=t||!1);var n=this.s.b,r=Gp(this.p,this.s,this.o);this.ondata(go(r,n,this.s.b),this.d),this.o=go(r,this.s.b-32768),this.s.b=this.o.length,this.p=go(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(t,n){this.e(t),this.c(n)},e})();var Fl=(function(){function e(t,n){_l.call(this,t,n),this.v=t&&t.dictionary?2:1}return e.prototype.push=function(t,n){if(_l.prototype.e.call(this,t),this.v){if(this.p.length<6&&!n)return;this.p=this.p.subarray(Hp(this.p,this.v-1)),this.v=0}n&&(this.p.length<4&&ze(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),_l.prototype.c.call(this,n)},e})();function qp(e,t){return Gp(e.subarray(Hp(e,t&&t.dictionary),-4),{i:2},t&&t.out,t&&t.dictionary)}var jE=typeof TextDecoder<"u"&&new TextDecoder,UE=0;try{jE.decode(BE,{stream:!0}),UE=1}catch{}function Bl(e,t="utf8"){return new TextDecoder(t).decode(e)}var VE=new TextEncoder;function Kp(e){return VE.encode(e)}var WE=1024*8,zE=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),jl={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},jr=class e{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(t=WE,n={}){let r=!1;typeof t=="number"?t=new ArrayBuffer(t):(r=!0,this.lastWrittenByte=t.byteLength);let i=n.offset?n.offset>>>0:0,o=t.byteLength-i,s=i;(ArrayBuffer.isView(t)||t instanceof e)&&(t.byteLength!==t.buffer.byteLength&&(s=t.byteOffset+i),t=t.buffer),r?this.lastWrittenByte=o:this.lastWrittenByte=0,this.buffer=t,this.length=o,this.byteLength=o,this.byteOffset=s,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,s,o),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){let t=this._marks.pop();if(t===void 0)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){let r=(this.offset+t)*2,i=new Uint8Array(r);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=r,this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){return this.readArray(t,"uint8")}readArray(t,n){let r=jl[n].BYTES_PER_ELEMENT*t,i=this.byteOffset+this.offset,o=this.buffer.slice(i,i+r);if(this.littleEndian===zE&&n!=="uint8"&&n!=="int8"){let a=new Uint8Array(this.buffer.slice(i,i+r));a.reverse();let l=new jl[n](a.buffer);return this.offset+=r,l.reverse(),l}let s=new jl[n](o);return this.offset+=r,s}readInt16(){let t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){let t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){let t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){let t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){let t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){let t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){let t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){let t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let n="";for(let r=0;r<t;r++)n+=this.readChar();return n}readUtf8(t=1){return Bl(this.readBytes(t))}decodeText(t=1,n="utf8"){return Bl(this.readBytes(t),n)}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let n=0;n<t.length;n++)this._data.setUint8(this.offset++,t[n]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(t){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(t){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let n=0;n<t.length;n++)this.writeUint8(t.charCodeAt(n));return this}writeUtf8(t){return this.writeBytes(Kp(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}};var Zp=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=3988292384^t>>>1:t=t>>>1;Zp[e]=t}var Yp=4294967295;function GE(e,t,n){let r=e;for(let i=0;i<n;i++)r=Zp[(r^t[i])&255]^r>>>8;return r}function HE(e,t){return(GE(Yp,e,t)^Yp)>>>0}function Ul(e,t,n){let r=e.readUint32(),i=HE(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(i!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${i}`)}function bo(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}function So(e,t,n,r){let i=0;for(;i<r;i++)t[i]=e[i];for(;i<n;i++)t[i]=e[i]+t[i-r]&255}function wo(e,t,n,r){let i=0;if(n.length===0)for(;i<r;i++)t[i]=e[i];else for(;i<r;i++)t[i]=e[i]+n[i]&255}function xo(e,t,n,r,i){let o=0;if(n.length===0){for(;o<i;o++)t[o]=e[o];for(;o<r;o++)t[o]=e[o]+(t[o-i]>>1)&255}else{for(;o<i;o++)t[o]=e[o]+(n[o]>>1)&255;for(;o<r;o++)t[o]=e[o]+(t[o-i]+n[o]>>1)&255}}function vo(e,t,n,r,i){let o=0;if(n.length===0){for(;o<i;o++)t[o]=e[o];for(;o<r;o++)t[o]=e[o]+t[o-i]&255}else{for(;o<i;o++)t[o]=e[o]+n[o]&255;for(;o<r;o++)t[o]=e[o]+qE(t[o-i],n[o],n[o-i])&255}}function qE(e,t,n){let r=e+t-n,i=Math.abs(r-e),o=Math.abs(r-t),s=Math.abs(r-n);return i<=o&&i<=s?e:o<=s?t:n}function Jp(e,t,n,r,i,o){switch(e){case 0:bo(t,n,i);break;case 1:So(t,n,i,o);break;case 2:wo(t,n,r,i);break;case 3:xo(t,n,r,i,o);break;case 4:vo(t,n,r,i,o);break;default:throw new Error(`Unsupported filter: ${e}`)}}var KE=new Uint16Array([255]),YE=new Uint8Array(KE.buffer),ZE=YE[0]===255;function Xp(e){let{data:t,width:n,height:r,channels:i,depth:o}=e,s=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],a=Math.ceil(o/8)*i,l=new Uint8Array(r*n*a),u=0;for(let c=0;c<7;c++){let d=s[c],f=Math.ceil((n-d.x)/d.xStep),p=Math.ceil((r-d.y)/d.yStep);if(f<=0||p<=0)continue;let h=f*a,m=new Uint8Array(h);for(let y=0;y<p;y++){let S=t[u++],w=t.subarray(u,u+h);u+=h;let g=new Uint8Array(h);Jp(S,w,g,m,h,a),m.set(g);for(let x=0;x<f;x++){let I=d.x+x*d.xStep,N=d.y+y*d.yStep;if(!(I>=n||N>=r))for(let $=0;$<a;$++)l[(N*n+I)*a+$]=g[x*a+$]}}}if(o===16){let c=new Uint16Array(l.buffer);if(ZE)for(let d=0;d<c.length;d++)c[d]=JE(c[d]);return c}else return l}function JE(e){return(e&255)<<8|e>>8&255}var XE=new Uint16Array([255]),QE=new Uint8Array(XE.buffer),ek=QE[0]===255,tk=new Uint8Array(0);function Vl(e){let{data:t,width:n,height:r,channels:i,depth:o}=e,s=Math.ceil(o/8)*i,a=Math.ceil(o/8*i*n),l=new Uint8Array(r*a),u=tk,c=0,d,f;for(let p=0;p<r;p++){switch(d=t.subarray(c+1,c+1+a),f=l.subarray(p*a,(p+1)*a),t[c]){case 0:bo(d,f,a);break;case 1:So(d,f,a,s);break;case 2:wo(d,f,u,a);break;case 3:xo(d,f,u,a,s);break;case 4:vo(d,f,u,a,s);break;default:throw new Error(`Unsupported filter: ${t[c]}`)}u=f,c+=a+1}if(o===16){let p=new Uint16Array(l.buffer);if(ek)for(let h=0;h<p.length;h++)p[h]=nk(p[h]);return p}else return l}function nk(e){return(e&255)<<8|e>>8&255}var Ro=Uint8Array.of(137,80,78,71,13,10,26,10);function Wl(e){if(!Qp(e.readBytes(Ro.length)))throw new Error("wrong PNG signature")}function Qp(e){if(e.length<Ro.length)return!1;for(let t=0;t<Ro.length;t++)if(e[t]!==Ro[t])return!1;return!0}var em="tEXt",ik=0,tm=new TextDecoder("latin1");function ok(e){if(ak(e),e.length===0||e.length>79)throw new Error("keyword length must be between 1 and 79")}var sk=/^[\u0000-\u00FF]*$/;function ak(e){if(!sk.test(e))throw new Error("invalid latin1 text")}function nm(e,t,n){let r=zl(t);e[r]=lk(t,n-r.length-1)}function zl(e){for(e.mark();e.readByte()!==ik;);let t=e.offset;e.reset();let n=tm.decode(e.readBytes(t-e.offset-1));return e.skip(1),ok(n),n}function lk(e,t){return tm.decode(e.readBytes(t))}var Fe={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},Ur={UNKNOWN:-1,DEFLATE:0},Ao={UNKNOWN:-1,ADAPTIVE:0},Vr={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},Wr={NONE:0,BACKGROUND:1,PREVIOUS:2},Co={SOURCE:0,OVER:1};var zr=class extends jr{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;_chunks;_inflatorResult;constructor(t,n={}){super(t);let{checkCrc:r=!1}=n;this._checkCrc=r,this._inflator=new Fl((i,o)=>{if(this._chunks.push(i),o){let s=this._chunks.reduce((l,u)=>l+u.length,0);this._inflatorResult=new Uint8Array(s);let a=0;for(let l of this._chunks)this._inflatorResult.set(l,a),a+=l.length;this._chunks=[]}}),this._chunks=[],this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=Ur.UNKNOWN,this._filterMethod=Ao.UNKNOWN,this._interlaceMethod=Vr.UNKNOWN,this._colorType=Fe.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this._inflatorResult=new Uint8Array(0),this.setBigEndian()}decode(){for(Wl(this);!this._end;){let t=this.readUint32(),n=this.readChars(4);this.decodeChunk(t,n)}return this._inflator.push(new Uint8Array(0),!0),this.decodeImage(),this._png}decodeApng(){for(Wl(this);!this._end;){let t=this.readUint32(),n=this.readChars(4);this.decodeApngChunk(t,n)}return this.decodeApngImage(),this._apng}decodeChunk(t,n){let r=this.offset;switch(n){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case em:nm(this._png.text,this,t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t);break}if(this.offset-r!==t)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?Ul(this,t+4,n):this.skip(4)}decodeApngChunk(t,n){let r=this.offset;switch(n!=="fdAT"&&n!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),n){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(t);break;default:this.decodeChunk(t,n),this.offset=r+t;break}if(this.offset-r!==t)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?Ul(this,t+4,n):this.skip(4)}decodeIHDR(){let t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=uk(this.readUint8());let n=this.readUint8();this._colorType=n;let r;switch(n){case Fe.GREYSCALE:r=1;break;case Fe.TRUECOLOUR:r=3;break;case Fe.INDEXED_COLOUR:r=1;break;case Fe.GREYSCALE_ALPHA:r=2;break;case Fe.TRUECOLOUR_ALPHA:r=4;break;case Fe.UNKNOWN:default:throw new Error(`Unknown color type: ${n}`)}if(this._png.channels=r,this._compressionMethod=this.readUint8(),this._compressionMethod!==Ur.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){let t={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(t)}decodePLTE(t){if(t%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);let n=t/3;this._hasPalette=!0;let r=[];this._palette=r;for(let i=0;i<n;i++)r.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(t){this._writingDataChunks=!0;let n=t,r=this.offset+this.byteOffset;try{this._inflator.push(new Uint8Array(this.buffer,r,n),!1)}catch(i){throw new Error("Error while decompressing the data:",{cause:i})}this.skip(t)}decodeFDAT(t){this._writingDataChunks=!0;let n=t,r=this.offset+this.byteOffset;r+=4,n-=4;try{this._inflator.push(new Uint8Array(this.buffer,r,n),!1)}catch(i){throw new Error("Error while decompressing the data:",{cause:i})}this.skip(t)}decodetRNS(t){switch(this._colorType){case Fe.GREYSCALE:case Fe.TRUECOLOUR:{if(t%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${t}`);if(t/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${t/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(t/2);for(let n=0;n<t/2;n++)this._transparency[n]=this.readUint16();break}case Fe.INDEXED_COLOUR:{if(t>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let n=0;for(;n<t;n++){let r=this.readByte();this._palette[n].push(r)}for(;n<this._palette.length;n++)this._palette[n].push(255);break}case Fe.UNKNOWN:case Fe.GREYSCALE_ALPHA:case Fe.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(t){let n=zl(this),r=this.readUint8();if(r!==Ur.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${r}`);let i=this.readBytes(t-n.length-2);this._png.iccEmbeddedProfile={name:n,profile:qp(i)}}decodepHYs(){let t=this.readUint32(),n=this.readUint32(),r=this.readByte();this._png.resolution={x:t,y:n,unit:r}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let t=0;t<this._numberOfFrames;t++){let n={sequenceNumber:this._frames[t].sequenceNumber,delayNumber:this._frames[t].delayNumber,delayDenominator:this._frames[t].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},r=this._frames.at(t);if(r){if(r.data=Vl({data:r.data,width:r.width,height:r.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),t===0||r.xOffset===0&&r.yOffset===0&&r.width===this._png.width&&r.height===this._png.height)n.data=r.data;else{let i=this._apng.frames.at(t-1);this.disposeFrame(r,i,n),this.addFrameDataToCanvas(n,r)}this._apng.frames.push(n)}}return this._apng}disposeFrame(t,n,r){switch(t.disposeOp){case Wr.NONE:break;case Wr.BACKGROUND:for(let i=0;i<this._png.height;i++)for(let o=0;o<this._png.width;o++){let s=(i*t.width+o)*this._png.channels;for(let a=0;a<this._png.channels;a++)r.data[s+a]=0}break;case Wr.PREVIOUS:r.data.set(n.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(t,n){let r=1<<this._png.depth,i=(o,s)=>{let a=((o+n.yOffset)*this._png.width+n.xOffset+s)*this._png.channels,l=(o*n.width+s)*this._png.channels;return{index:a,frameIndex:l}};switch(n.blendOp){case Co.SOURCE:for(let o=0;o<n.height;o++)for(let s=0;s<n.width;s++){let{index:a,frameIndex:l}=i(o,s);for(let u=0;u<this._png.channels;u++)t.data[a+u]=n.data[l+u]}break;case Co.OVER:for(let o=0;o<n.height;o++)for(let s=0;s<n.width;s++){let{index:a,frameIndex:l}=i(o,s);for(let u=0;u<this._png.channels;u++){let c=n.data[l+this._png.channels-1]/r,d=u%(this._png.channels-1)===0?1:n.data[l+u],f=Math.floor(c*d+(1-c)*t.data[a+u]);t.data[a+u]+=f}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){let t=this._inflatorResult;if(this._filterMethod!==Ao.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===Vr.NO_INTERLACE)this._png.data=Vl({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===Vr.ADAM7)this._png.data=Xp({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){this._inflator.push(new Uint8Array(0),!0);let t=this._inflatorResult,n=this._frames.at(-1);n?n.data=t:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:Wr.NONE,blendOp:Co.SOURCE,data:t}),this._inflator=new Fl((r,i)=>{if(this._chunks.push(r),i){let o=this._chunks.reduce((a,l)=>a+l.length,0);this._inflatorResult=new Uint8Array(o);let s=0;for(let a of this._chunks)this._inflatorResult.set(a,s),s+=a.length;this._chunks=[]}}),this._chunks=[],this._writingDataChunks=!1}};function uk(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw new Error(`invalid bit depth: ${e}`);return e}function rm(e,t){return new zr(e,t).decode()}import{createRequire as ck}from"module";import{readFile as Gl}from"fs/promises";import{fileURLToPath as dk}from"url";import{z as Ye}from"zod";var fk={height:800,width:1280},hk=Ye.object({event:Ye.looseObject({timestamp:Ye.number(),type:Ye.number()}),kind:Ye.literal("rrweb")});async function om(e){return(await Gl(e,"utf8")).split(`
|
|
21
|
+
`).filter(n=>n.length>0).map(n=>am(n)).map(n=>hk.safeParse(n)).flatMap(n=>n.success?[n.data.event]:[])}var pk=Ye.object({kind:Ye.literal("action"),timestamp:Ye.number()});async function sm(e){return(await Gl(e,"utf8")).split(`
|
|
22
|
+
`).filter(n=>n.length>0).map(n=>am(n)).map(n=>pk.safeParse(n)).flatMap(n=>n.success?[n.data.timestamp]:[])}function am(e){try{return JSON.parse(e)}catch{return null}}var mk=Ye.object({data:Ye.looseObject({height:Ye.number(),width:Ye.number()}),type:Ye.literal(4)});function lm(e){let t=e.flatMap(n=>{let r=mk.safeParse(n);return r.success?[r.data]:[]})[0];return t==null?fk:{height:t.data.height,width:t.data.width}}var yk='<svg xmlns="http://www.w3.org/2000/svg" width="17" height="22" viewBox="0 0 17 22"><path d="M1 1 L1 17 L5.4 12.8 L8.5 20 L11 19 L8 11.8 L14 11.8 Z" fill="black" stroke="white" stroke-width="1.3"/></svg>',gk=`.replayer-mouse-tail { display: none; }
|
|
23
|
+
.replayer-mouse {
|
|
24
|
+
position: absolute;
|
|
25
|
+
width: 17px;
|
|
26
|
+
height: 22px;
|
|
27
|
+
z-index: 9999;
|
|
28
|
+
background-repeat: no-repeat;
|
|
29
|
+
background-size: contain;
|
|
30
|
+
background-image: url('data:image/svg+xml;utf8,${yk}');
|
|
31
|
+
}`,bk=".replayer-mouse, .replayer-mouse-tail { display: none; }";function um(e){return`<!doctype html><html><head><style>
|
|
32
|
+
html, body { margin: 0; padding: 0; }
|
|
33
|
+
.replayer-wrapper { position: relative; }
|
|
34
|
+
${e?gk:bk}
|
|
35
|
+
iframe { border: none; }
|
|
36
|
+
</style></head><body></body></html>`}var cm="*, *::before, *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition-duration: 0s !important; transition-delay: 0s !important; }";function dm(){return`(async () => {
|
|
37
|
+
const doc = document.querySelector(".replayer-wrapper iframe")?.contentDocument;
|
|
38
|
+
if (doc?.fonts != null) {
|
|
39
|
+
await doc.fonts.ready;
|
|
40
|
+
}
|
|
41
|
+
await new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)));
|
|
42
|
+
})()`}function fm(){return import("playwright").then(({chromium:e})=>e.launch({args:["--no-sandbox"],headless:!0})).catch(()=>null)}var im;function hm(){return im??=Gl(Sk(),"utf8"),im}function Sk(){let e=ck(import.meta.url);try{return e.resolve("@ripplo/rrweb-bundle/replay")}catch{return dk(new URL("assets/rrweb-replay.js",import.meta.url))}}var Ak=1,Ck=1500,Hl=8,Ek=997;async function pm({jsonlPath:e,outDir:t,runId:n,scale:r}){if(!wk(e))return Eo({kind:"run-not-found",runId:n});let i=await om(e),o=i[0],s=i.at(-1);if(o==null||s==null)return Eo({kind:"no-rrweb-events",runId:n});let a=s.timestamp-o.timestamp,u=(await sm(e)).map(h=>h-o.timestamp).filter(h=>h>=0&&h<=a),{delayMs:c,offsets:d}=Na({actionOffsets:u,durationMs:a}),f=vk.join(t,"clip.gif");return(await kk({delayMs:c,events:i,gifPath:f,offsets:d,scale:r??Ak})).map(()=>({durationMs:a,frameCount:d.length,gifPath:f}))}async function kk({delayMs:e,events:t,gifPath:n,offsets:r,scale:i}){let o=await fm();if(o==null)return Eo({detail:"chromium launch",kind:"browser-failed"});try{let s=await Ik({browser:o,delayMs:e,events:t,offsets:r,scale:i});return await xk(n,s),Rk(void 0)}catch(s){return Eo({detail:s instanceof Error?s.message:String(s),kind:"browser-failed"})}finally{await o.close()}}async function Ik({browser:e,delayMs:t,events:n,offsets:r,scale:i}){let o=lm(n),s=await e.newPage({deviceScaleFactor:i,viewport:o});await s.setContent(um(!0)),await s.addScriptTag({content:await hm()}),await s.evaluate(Pk(n));let{applyPalette:a,GIFEncoder:l,quantize:u}=await import("./gifenc.esm-GMV2LJ5K.js"),c=l(),d=r.length-1;return await r.reduce(async(f,p,h)=>{let m=await f,y=await Mk({offsetMs:p,page:s});return Ok({applyPalette:a,delayMs:t,gif:c,hold:h===d,png:y,quantize:u,started:m})},Promise.resolve(!1)),c.finish(),c.bytes()}function Pk(e){return`(() => {
|
|
43
|
+
const replayer = new globalThis.__RipploReplayer(${JSON.stringify(e)}, {
|
|
44
|
+
insertStyleRules: [${JSON.stringify(cm)}],
|
|
45
|
+
mouseTail: false,
|
|
46
|
+
root: document.body,
|
|
47
|
+
showWarning: false,
|
|
48
|
+
});
|
|
49
|
+
globalThis.__ripploClipReplayer = replayer;
|
|
50
|
+
})()`}async function Mk({offsetMs:e,page:t}){await t.evaluate(Tk(e)),await t.evaluate(dm());let n=t.locator(".replayer-wrapper").first();return(await n.count()>0?n:t).screenshot({type:"png"})}function Tk(e){return`globalThis.__ripploClipReplayer?.pause(${String(e+.5)})`}function Ok({applyPalette:e,delayMs:t,gif:n,hold:r,png:i,quantize:o,started:s}){let{channels:a,data:l,height:u,width:c}=rm(i);if(!(l instanceof Uint8Array))throw new TypeError("clip frame is not 8-bit");let d=$k({channels:a,data:l,height:u,width:c});if(!s&&!r&&Nk(d))return!1;let f=o(d,256),p=e(d,f);return n.writeFrame(p,c,u,{delay:r?t+Ck:t,palette:f}),!0}function Nk(e){let t=e[0]??0,n=e[1]??0,r=e[2]??0,i=4*Ek,o=Math.floor(e.length/i);return Array.from({length:o}).every((s,a)=>{let l=a*i;return Math.abs((e[l]??0)-t)<=Hl&&Math.abs((e[l+1]??0)-n)<=Hl&&Math.abs((e[l+2]??0)-r)<=Hl})}function $k({channels:e,data:t,height:n,width:r}){if(e===4)return t;if(e!==3)throw new TypeError(`unsupported clip frame channel count: ${String(e)}`);let i=r*n,o=new Uint8Array(i*4);return Array.from({length:i}).forEach((s,a)=>{o.set(t.subarray(a*3,a*3+3),a*4),o[a*4+3]=255}),o}function ko(e){return{dataRules:ml(e),pageRules:dl(e)}}var mm=Object.defineProperty,ym=(e,t)=>{let n={};for(var r in e)mm(n,r,{get:e[r],enumerable:!0});return t||mm(n,Symbol.toStringTag,{value:"Module"}),n};var Lk=class gm{constructor(t){this.seed=t}clone(){return new gm(this.seed)}next(){let t=ql(this.seed),n=Kl(t),r=ql(t),i=Kl(r);return this.seed=ql(r),Kl(this.seed)+(i+(n<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function ql(e){return Math.imul(e,214013)+2531011&4294967295}function Kl(e){return(e&-2147483649)>>16}function bm(e){return new Lk(e)}var _k="SUSgbA\\W`E[]KN2RUSo8XVU?HKBFRl11E\\KoWOg5B]XEWG;BE;1:oVK[`B^Z9Qd23^XTnhL>]Unda4f[X;_j9H5QD=cN<5H`3bW>9bk1mjoI2fK0obmAAINOV:>Mek_V9dd<hZ\\gC3?Fm7FEk07QH_3PLm^@?^i\\QMkgP<]oLHmFnlecg5F@7U^@4jhZ?WZS0k@GHehmM36:5^9;>Hmm`co>k:KOSkSbIINb1VFf>LXgP>GUAQTD>Ci>XMGkUflLlb?_FaFUk@?5N7i70@;1o68ah@I<HFH7R2^J:G][Gf962ITWID9GWK8ElD2G5=DcHcL]cA]P2n7A=[<bInM;IHDQnJMReRXDWbVldnGEIPij`E08Xdci3@0c:IBbD4:Nk]?lEN9j^;T`0blZX7eiWE8c`<ak7j05FZi>AjUDh?M1B?^??FAXKThf<aBOXZf7jXYGK>R<;NHk3S9YhM7STJ6`:MIE`S@7298X8W>PNK=@;lLX<i\\TXLL<W@X[X54H]in8M;;n?kkQbajgAMY=Tf9b;ZKf0QUB2FHYWfnfkDoU9YkcLd95T>lK6GM1YL\\lid:J>KYS=iJ]Y>QlF>?R5_[5QeYC=66;A32Ac>OHk_ne^0g>bK:g;KFPgbGUcPR_Z=TX3H9d03bKZ2IhEPKBo>LSGWd0iFdV8C<Y:<>T[O6lC\\blaZ>GoAYP4clf^j1IfnZJ]QeDe2X<HE[LJNWnaCg[P]Co^:IRbWPY?97UePBlZNNHY6LOBM8P>=h?Ye:_f_Sb9Ki5GDYBF4dWeMfdg^ccPllNWM7G1\\UMdoYeOOD5^e@foA22G?ADYo5:FVG[bWo96;>3kc_c1Ab30>30;1@4F8g2hY?DJ4[LOL;ZLLKo2]jo>[KMDUcR279N_kF=3WL@Dd620bMTdA\\U9k``ef2iD9JgJ8CZBHS>F^Uk;<laeaeHS<15OSeS`PcSSKBRBFY]aQ=EgUXGNg=?d56`KA@2BejY0^[_DCX`L=CGMT=BW^6S1i@2ATBVk>3_ocRA>2U:4GPQ6o>5jX2HIcV3S@On6KB<[SKB?FC_AAji9agbBFkAi\\;4I\\UJ]c36Ub@[;gQACVGY<V]SDJBUU]La\\_a@JdOO8gm2T0DJMa:8Hf7>E]noQ[1Kambn??QQ]S?1i0oMGOijb\\aGY6lQ^CJ?9bFle8<eH4UUjBINX;n8@VOA5ah^URV49B[A?ONHhHAC1J5;;h0SXYlG^0W=eJdHh^K4SGe=1HZLLam;D<Q3AOdbPcdX``82\\jo0En8jRVGC73WMCF9`d:0heS?80?C188cSn7H9<daZ]MgS4Pb^1HkA:1PU^5>^h_g[RQV@PnYBRI_]`B]Bh@Uk03eXGY`I16L76H28X`R>IROMeNVUdU[:lghLhPCQZ:4a<30YBZCYnXe[?;jc8gKI2QH2MjnWBm4nGCZW`aVU2a;P<AMI25mlW_Nm][2?b6o851X@lAm]YZ`bWRF1g<Ga:T]1NXH5Veja5P9S9>:aNg:Th1Y=5o78K>LQ8hW@5S?I83Lk5Xk;j5@I3o[d:4RjE^oS30:WP9gC\\i8aSI>QRE@4lP:7lDg8g2`Ql[2I8aBU\\BQ?B4_clL9Q]S;^e1Ob5[>3JER2`c7B=o]fPOWO<DGi;Niba1PoWPPE_Q3aX0OB0mZej\\f_M[J4Y6]1`h2MkF[GiW8Q^d3^_=<I1N2Q7]2<2j[iP7V3V821FaI]A`93bC^Z\\G=WJ;^Ih?B97_iIF@\\Dl<eK1je8SNTWo_=XFMZH<<JYLZ^YQMPgYOV45K_:]kSI8^XlO0]GY=VUfe_C_F6TOcoAlVUH:o=WhhT@K`2KFhe<3\\KXQ>W:M?S_4S5d@J^`[AGA7@3]DnGSCO`\\?E8HT75^d9\\:m\\m1egIfk8cd6bD9\\eU8\\n[Pb0Cgd^S0n9kGJHb]i5XodlKHc34Fhi9K>0U5WK`>7Ff2^KL=WC6:kc?e5C^a1T1:4:^S5flXlGNIj08AfO?Dh7T7dWO>E]NI9?ob7B7P_h[4TEP[EU;GllFTnSmg9:\\[N]<SAoKP_kPlG56A:I3T6EG8Hj=XnUE`KT5U@OQ?]7[N^MFN1_NU4KO_3::Le`8IL9[1Z1H1;V3SC\\N3]S@4U[F2mhT5dYM7[4Pg_Na0_8WTH0`bgceQS8]EG;XgD4Ib4iLTP@kE79Mn>AYRJA1U5^Blhgno:aHVYc03c3J0Vc9FjEV^M75Zfd8kVC9>iJDk`AJ[6f7DK2D^DL\\AX:6b5h31XH;RQB\\N<ZSM=J;6L[`UW^eOIFc1Y]6_dfedIe4ARh72mTXC0WND_IDHVCZRDE0eODARCEETQI5TPUQE=jEH5bS?LP[ai`F5ABRYDo2o\\@=]GT?_9;hc4Lm:\\SF9k1T<0E@fX9BG[]g0nY7k[Qmi@la8`PF0j6@Q?Ii7bLkXQ<lLHf]`:DCh@9JY5>hEVLTdhL\\b1EB0lLh<=WaO@F<;8g<d:@e:LA:cFIEdmQh7hNHfSRToW?8N4:Z1K;XEDRO;OIDh<UdVln?bjgL>?VE98[B\\K<BVjkG8LiSX;fb>jf?DUK00Aih<WY6QD6cEnHBZ8iN_fd<G8Ci`11RUW2QlW]IXV:m?;J0GXXHfGNQ>:D`=fLPbO?VOTEYLj^cNj5PM>jKB5HVjJ4U7lXaTQNL9<@\\1`m\\Ug@VQHd7>jW=ca0`miF7;N0F=GjoQ`RFchKMGTmn8cF@Oh4GGCm7m2`U9j93Tb>=kSERjE_J939F01I1;`<ijk_=_Vn=7RVAI6fnQI5KlF:C44bN<<8K=Z<2TP<1]5?<dB>^LA=ebloE2Y2:9lkh0\\<YKbHD97iE`<C5oj^1>X:??`H6BXF2hG1Q[dF0Q=>W=J?7C\\k1T?<;R44oW?1hY^G8Zm]ZKnfOf0eCFYo6?=D8?<`6HU5SXh1;=:23LmV_FSi;OJfV<^?GkIDPISeHg1LaGE:V3Y3K3H<QJfbY?=;ldZRhnhQT_mGXDLFXXhSONE6Do_0iNZagB:BPGOTH;VhHUTd6LhQm^[;dO]5Hlkg<R:F<Kn\\:I:EGojgWZ2X@SYO_dlH;G8S<>oEKabY`:oU;=JW7ig?S?EYb86b7n8ce\\]IRa]koiWY<RfO;5kUI;7lVeC?[@ZaXDiF04B8R]bg@>O<mQDoUcBLcf^f>m2kMBUloD>Ze@NN^Z11TM`inXYhE_I=kA`:ZF4d\\>`L@;ZP[`ENU5cL[BV6\\Z?Di76:jg3hE6oG6jFc8kP=[GS1;WSedYQW1:U4\\OF32GgmMC<AjO]872bdBb`bKAA?8j78b>T3VfcUB2m4J^CPRU;8dScI]LU]^bBYA5_3:Y0N5i^?200000",Dk=class wm{constructor(t,n){this.states=t,this.index=n}clone(){return new wm(this.states.slice(),this.index)}next(){let t=this.states[this.index];return t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,this.index=Io(this.states,this.index),t}getState(){return[this.index,...this.states]}jump(){let t=this.states.slice(),n=this.index;this.index=Io(this.states,this.index);for(let r=19932;r>0;--r)_k.charCodeAt(r/6|0)-48&1<<r%6&&Sm(this.states,this.index,t,n),this.index=Io(this.states,this.index);Sm(this.states,this.index,t,n)}};function Sm(e,t,n,r){let i=0;if(r>=t){for(;i<624-r;i++)e[i+t]^=n[i+r];for(;i<624-t;i++)e[i+t]^=n[i+r-624];for(;i<624;i++)e[i+t-624]^=n[i+r-624]}else{for(;i<624-t;i++)e[i+t]^=n[i+r];for(;i<624-r;i++)e[i+t-624]^=n[i+r];for(;i<624;i++)e[i+t-624]^=n[i+r-624]}}function Io(e,t){if(t<227){let n=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397]^n>>>1^-(n&1)&2567483615,t+1}else if(t<623){let n=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397-624]^n>>>1^-(n&1)&2567483615,t+1}else{let n=e[t]&2147483648|e[0]&2147483647;return e[t]=e[396]^n>>>1^-(n&1)&2567483615,0}}function Fk(e){for(let t=0;t!==624;++t)Io(e,t)}function xm(e){let t=[e|0];for(let n=1;n!==624;++n){let r=t[n-1]^t[n-1]>>>30;t.push(Math.imul(1812433253,r)+n|0)}return Fk(t),new Dk(t,0)}var Bk=class vm{constructor(t,n,r,i){this.s01=t,this.s00=n,this.s11=r,this.s10=i}clone(){return new vm(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00^this.s00<<23,n=this.s01^(this.s01<<23|this.s00>>>9),r=t^this.s10^(t>>>18|n<<14)^(this.s10>>>5|this.s11<<27),i=n^this.s11^n>>>18^this.s11>>>5,o=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=i,this.s10=r,o}jump(){let t=0,n=0,r=0,i=0,o=[1667051007,2321340297,1548169110,304075285];for(let s=0;s!==4;++s)for(let a=1;a;a<<=1)o[s]&a&&(t^=this.s01,n^=this.s00,r^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=n,this.s11=r,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Yl(e){return new Bk(-1,~e,e|0,0)}var jk=class Rm{constructor(t,n,r,i){this.s01=t,this.s00=n,this.s11=r,this.s10=i}clone(){return new Rm(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00+this.s10|0,n=this.s10^this.s00,r=this.s11^this.s01,i=this.s00,o=this.s01;return this.s00=i<<24^o>>>8^n^n<<16,this.s01=o<<24^i>>>8^r^(r<<16|n>>>16),this.s10=r<<5^n>>>27,this.s11=n<<5^r>>>27,t}jump(){let t=0,n=0,r=0,i=0,o=[3639956645,3750757012,1261568508,386426335];for(let s=0;s!==4;++s)for(let a=1;a;a<<=1)o[s]&a&&(t^=this.s01,n^=this.s00,r^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=n,this.s11=r,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Am(e){return new jk(-1,~e,e|0,0)}function Cm(e,t){for(let n=0;n!==t;++n)e.next()}var Em=BigInt,Uk=4294967296n;function Im(e,t,n){let r=n-t+1n,i=Uk,o=1;for(;i<r;)i<<=32n,++o;let s=km(o,e);if(s<r)return s+t;if(s+r<i)return s%r+t;let a=i-i%r;for(;s>=a;)s=km(o,e);return s%r+t}function km(e,t){let n=Em(t.next()+2147483648);for(let r=1;r<e;++r){let i=t.next();n=(n<<32n)+Em(i+2147483648)}return n}function Gr(e,t){let n=t>2?~~(4294967296/t)*t:4294967296,r=e.next()+2147483648;for(;r>=n;)r=e.next()+2147483648;return r%t}function Zl(e,t){if(t<0){let n=-t;e.sign=-1,e.data[0]=~~(n/4294967296),e.data[1]=n>>>0}else e.sign=1,e.data[0]=~~(t/4294967296),e.data[1]=t>>>0;return e}function Vk(e,t,n){let r=t.data[1],i=t.data[0],o=t.sign,s=n.data[1],a=n.data[0],l=n.sign;if(e.sign=1,o===1&&l===-1){let m=r+s,y=i+a+(m>4294967295?1:0);return e.data[0]=y>>>0,e.data[1]=m>>>0,e}let u=r,c=i,d=s,f=a;o===-1&&(u=s,c=a,d=r,f=i);let p=0,h=u-d;return h<0&&(p=1,h=h>>>0),e.data[0]=c-f-p,e.data[1]=h,e}function Wk(e,t,n){let r=n[0]+1;for(t[0]=Gr(e,r),t[1]=Gr(e,4294967296);t[0]>=n[0]&&(t[0]!==n[0]||t[1]>=n[1]);)t[0]=Gr(e,r),t[1]=Gr(e,4294967296);return t}var zk=Number.MAX_SAFE_INTEGER,Gk={sign:1,data:[0,0]},Hk={sign:1,data:[0,0]},Pm={sign:1,data:[0,0]},Jl=[0,0];function qk(e,t,n,r){let i=r<=zk?Zl(Pm,r):Vk(Pm,Zl(Gk,n),Zl(Hk,t));return i.data[1]===4294967295?(i.data[0]+=1,i.data[1]=0):i.data[1]+=1,Wk(e,Jl,i.data),Jl[0]*4294967296+Jl[1]+t}function Po(e,t,n){let r=n-t;return r<=4294967295?Gr(e,r+1)+t:qk(e,t,n,r)}var Mm=Symbol.for("fast-check/PreconditionFailure"),un=class extends Error{constructor(e=!1){super(),this.interruptExecution=e,this.footprint=Mm}static isFailure(e){return e!=null&&e.footprint===Mm}};function Kk(e){if(!e)throw new un}var Yk=class{[Symbol.iterator](){return this}next(e){return{value:e,done:!0}}},Zk=new Yk;function Jk(){return Zk}function*Xk(e,t){for(let n of e)yield t(n)}function*Qk(e,t){for(let n of e)yield*t(n)}function*e2(e,t){for(let n of e)t(n)&&(yield n)}function*t2(e,t){for(let n=0;n<t;++n){let r=e.next();if(r.done)break;yield r.value}}function*n2(e,t){let n=e.next();for(;!n.done&&t(n.value);)yield n.value,n=e.next()}function*r2(e,t){for(let n=e.next();!n.done;n=e.next())yield n.value;for(let n of t)for(let r=n.next();!r.done;r=n.next())yield r.value}var i2=Symbol.iterator,D=class Dt{static nil(){return new Dt(Jk())}static of(...t){return new Dt(t[i2]())}constructor(t){this.g=t}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(t){return new Dt(Xk(this.g,t))}flatMap(t){return new Dt(Qk(this.g,t))}dropWhile(t){let n=!1;function*r(i){(n||!t(i))&&(n=!0,yield i)}return this.flatMap(r)}drop(t){if(t<=0)return this;let n=0;function r(){return n++<t}return this.dropWhile(r)}takeWhile(t){return new Dt(n2(this.g,t))}take(t){return new Dt(t2(this.g,t))}filter(t){return new Dt(e2(this.g,t))}every(t){for(let n of this.g)if(!t(n))return!1;return!0}has(t){for(let n of this.g)if(t(n))return[!0,n];return[!1,null]}join(...t){return new Dt(r2(this.g,t))}getNthOrLast(t){let n=t,r=null;for(let i of this.g){if(n--===0)return i;r=i}return r}};function an(e){return new D(e)}var ke=Symbol.for("fast-check/cloneMethod");function wn(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&ke in e&&typeof e[ke]=="function"}function Yn(e){return wn(e)?e[ke]():e}var o2=Object.defineProperty,O=class{constructor(e,t,n){this.value_=e,this.context=t,this.hasToBeCloned=n!==void 0||wn(e),this.readOnce=!1,this.value=e,this.hasToBeCloned&&o2(this,"value",{get:n!==void 0?n:this.getValue,enumerable:!1,configurable:!1})}getValue(){return this.hasToBeCloned?this.readOnce?this.value_[ke]():(this.readOnce=!0,this.value_):this.value_}},le=class{filter(e){return new l2(this,e)}map(e,t){return new a2(this,e,t)}chain(e){return new s2(this,e)}},s2=class extends le{constructor(e,t){super(),this.arb=e,this.chainer=t}generate(e,t){let n=e.clone(),r=this.arb.generate(e,t);return this.valueChainer(r,e,n,t)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?(t.stoppedForOriginal?D.nil():this.arb.shrink(t.originalValue,t.originalContext).map(n=>this.valueChainer(n,t.clonedMrng.clone(),t.clonedMrng,t.originalBias))).join(t.chainedArbitrary.shrink(e,t.chainedContext).map(n=>{let r={...t,chainedContext:n.context,stoppedForOriginal:!0};return new O(n.value_,r)})):D.nil()}valueChainer(e,t,n,r){let i=this.chainer(e.value_),o=i.generate(t,r),s={originalBias:r,originalValue:e.value_,originalContext:e.context,stoppedForOriginal:!1,chainedArbitrary:i,chainedContext:o.context,clonedMrng:n};return new O(o.value_,s)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalBias"in e&&"originalValue"in e&&"originalContext"in e&&"stoppedForOriginal"in e&&"chainedArbitrary"in e&&"chainedContext"in e&&"clonedMrng"in e}},a2=class extends le{constructor(e,t,n){super(),this.arb=e,this.mapper=t,this.unmapper=n,this.bindValueMapper=r=>this.valueMapper(r)}generate(e,t){let n=this.arb.generate(e,t);return this.valueMapper(n)}canShrinkWithoutContext(e){if(this.unmapper!==void 0)try{let t=this.unmapper(e);return this.arb.canShrinkWithoutContext(t)}catch{return!1}return!1}shrink(e,t){if(this.isSafeContext(t))return this.arb.shrink(t.originalValue,t.originalContext).map(this.bindValueMapper);if(this.unmapper!==void 0){let n=this.unmapper(e);return this.arb.shrink(n,void 0).map(this.bindValueMapper)}return D.nil()}mapperWithCloneIfNeeded(e){let t=e.value,n=this.mapper(t);return e.hasToBeCloned&&(typeof n=="object"&&n!==null||typeof n=="function")&&Object.isExtensible(n)&&!wn(n)&&Object.defineProperty(n,ke,{get:()=>()=>this.mapperWithCloneIfNeeded(e)[0]}),[n,t]}valueMapper(e){let[t,n]=this.mapperWithCloneIfNeeded(e);return new O(t,{originalValue:n,originalContext:e.context})}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalValue"in e&&"originalContext"in e}},l2=class extends le{constructor(e,t){super(),this.arb=e,this.refinement=t,this.bindRefinementOnValue=n=>this.refinementOnValue(n)}generate(e,t){for(;;){let n=this.arb.generate(e,t);if(this.refinementOnValue(n))return n}}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)&&this.refinement(e)}shrink(e,t){return this.arb.shrink(e,t).filter(this.bindRefinementOnValue)}refinementOnValue(e){return this.refinement(e.value)}};function Mg(e){return typeof e=="object"&&e!==null&&"generate"in e&&"shrink"in e&&"canShrinkWithoutContext"in e}function Tg(e){if(!Mg(e))throw new Error("Unexpected value received: not an instance of Arbitrary")}var Og=Function.prototype.apply,Xl=Symbol("apply");function u2(e){try{return e.apply}catch{return}}function c2(e,t,n){let r=e;r[Xl]=Og;let i=r[Xl](t,n);return delete r[Xl],i}function G(e,t,n){return u2(e)===Og?e.apply(t,n):c2(e,t,n)}var Ng=Array,k=BigInt,d2=BigInt64Array,f2=BigUint64Array,$g=Boolean,zo=Date,M=Error,Lg=Float32Array,_g=Float64Array,h2=Int8Array,p2=Int16Array,m2=Int32Array,Bt=Number,Be=String,Zn=Set,y2=Uint8Array,g2=Uint8ClampedArray,b2=Uint16Array,S2=Uint32Array,w2=encodeURIComponent,jt=Map,Do=Symbol,Tm=Array.prototype.forEach,Om=Array.prototype.indexOf,Nm=Array.prototype.join,$m=Array.prototype.map,Lm=Array.prototype.flat,_m=Array.prototype.filter,Dm=Array.prototype.push,Fm=Array.prototype.pop,Bm=Array.prototype.splice,jm=Array.prototype.slice,Um=Array.prototype.sort,Vm=Array.prototype.every;function x2(e){try{return e.forEach}catch{return}}function v2(e){try{return e.indexOf}catch{return}}function R2(e){try{return e.join}catch{return}}function A2(e){try{return e.map}catch{return}}function C2(e){try{return e.flat}catch{return}}function E2(e){try{return e.filter}catch{return}}function k2(e){try{return e.push}catch{return}}function I2(e){try{return e.pop}catch{return}}function P2(e){try{return e.splice}catch{return}}function M2(e){try{return e.slice}catch{return}}function T2(e){try{return e.sort}catch{return}}function O2(e){try{return e.every}catch{return}}function Dg(e,t){return x2(e)===Tm?e.forEach(t):G(Tm,e,[t])}function Ft(e,...t){return v2(e)===Om?e.indexOf(...t):G(Om,e,t)}function ae(e,...t){return R2(e)===Nm?e.join(...t):G(Nm,e,t)}function W(e,t){return A2(e)===$m?e.map(t):G($m,e,[t])}function N2(e,t){return C2(e)===Lm?([].flat(),e.flat(t)):G(Lm,e,[t])}function $2(e,t){return E2(e)===_m?e.filter(t):G(_m,e,[t])}function T(e,...t){return k2(e)===Dm?e.push(...t):G(Dm,e,t)}function Fg(e){return I2(e)===Fm?e.pop():G(Fm,e,[])}function Bg(e,...t){return P2(e)===Bm?e.splice(...t):G(Bm,e,t)}function Te(e,...t){return M2(e)===jm?e.slice(...t):G(jm,e,t)}function jg(e,...t){return T2(e)===Um?e.sort(...t):G(Um,e,t)}function Ug(e,...t){return O2(e)===Vm?e.every(...t):G(Vm,e,t)}var Wm=Date.prototype.getTime,zm=Date.prototype.toISOString;function L2(e){try{return e.getTime}catch{return}}function _2(e){try{return e.toISOString}catch{return}}function Go(e){return L2(e)===Wm?e.getTime():G(Wm,e,[])}function D2(e){return _2(e)===zm?e.toISOString():G(zm,e,[])}var Gm=Set.prototype.add,Hm=Set.prototype.has;function F2(e){try{return e.add}catch{return}}function B2(e){try{return e.has}catch{return}}function Zr(e,t){return F2(e)===Gm?e.add(t):G(Gm,e,[t])}function Ho(e,t){return B2(e)===Hm?e.has(t):G(Hm,e,[t])}var qm=WeakMap.prototype.set,Km=WeakMap.prototype.get;function j2(e){try{return e.set}catch{return}}function U2(e){try{return e.get}catch{return}}function V2(e,t,n){return j2(e)===qm?e.set(t,n):G(qm,e,[t,n])}function W2(e,t){return U2(e)===Km?e.get(t):G(Km,e,[t])}var Ym=Map.prototype.set,Zm=Map.prototype.get,Jm=Map.prototype.has;function z2(e){try{return e.set}catch{return}}function G2(e){try{return e.get}catch{return}}function H2(e){try{return e.has}catch{return}}function dt(e,t,n){return z2(e)===Ym?e.set(t,n):G(Ym,e,[t,n])}function Xe(e,t){return G2(e)===Zm?e.get(t):G(Zm,e,[t])}function q2(e,t){return H2(e)===Jm?e.has(t):G(Jm,e,[t])}var Xm=String.prototype.split,Qm=String.prototype.startsWith,ey=String.prototype.endsWith,ty=String.prototype.substring,ny=String.prototype.toLowerCase,ry=String.prototype.toUpperCase,iy=String.prototype.padStart,oy=String.prototype.charCodeAt,sy=String.prototype.normalize,ay=String.prototype.replace;function K2(e){try{return e.split}catch{return}}function Y2(e){try{return e.startsWith}catch{return}}function Z2(e){try{return e.endsWith}catch{return}}function J2(e){try{return e.substring}catch{return}}function X2(e){try{return e.toLowerCase}catch{return}}function Q2(e){try{return e.toUpperCase}catch{return}}function eI(e){try{return e.padStart}catch{return}}function tI(e){try{return e.charCodeAt}catch{return}}function nI(e){try{return e.normalize}catch{return}}function rI(e){try{return e.replace}catch{return}}function je(e,...t){return K2(e)===Xm?e.split(...t):G(Xm,e,t)}function iI(e,...t){return Y2(e)===Qm?e.startsWith(...t):G(Qm,e,t)}function oI(e,...t){return Z2(e)===ey?e.endsWith(...t):G(ey,e,t)}function he(e,...t){return J2(e)===ty?e.substring(...t):G(ty,e,t)}function Ru(e){return X2(e)===ny?e.toLowerCase():G(ny,e,[])}function Yu(e){return Q2(e)===ry?e.toUpperCase():G(ry,e,[])}function sI(e,...t){return eI(e)===iy?e.padStart(...t):G(iy,e,t)}function Jn(e,t){return tI(e)===oy?e.charCodeAt(t):G(oy,e,[t])}function aI(e,t){return nI(e)===sy?e.normalize(t):G(sy,e,[t])}function lI(e,t,n){return rI(e)===ay?e.replace(t,n):G(ay,e,[t,n])}var ly=Number.prototype.toString;function uI(e){try{return e.toString}catch{return}}function Jr(e,...t){return uI(e)===ly?e.toString(...t):G(ly,e,t)}var cI=Object.prototype.hasOwnProperty,dI=Object.prototype.toString;function Vg(e,t){return G(cI,e,[t])}function Au(e){return G(dI,e,[])}var fI=Error.prototype.toString;function hI(e){return G(fI,e,[])}var pI=class{constructor(e){this.producer=e}[Symbol.iterator](){return this.it===void 0&&(this.it=this.producer()),this.it}next(){return this.it===void 0&&(this.it=this.producer()),this.it.next()}};function sn(e){return new pI(e)}var Wg=Array.isArray,mI=Object.defineProperty;function zg(e,t){return mI(e,ke,{value:()=>{let n=[];for(let r=0;r!==t.length;++r)T(n,t[r].value);return zg(n,t),n}})}function Gg(e){let t=!1,n=[],r=[];for(let i=0;i!==e.length;++i){let o=e[i];t=t||o.hasToBeCloned,T(n,o.value),T(r,o.context)}return t&&zg(n,e),new O(n,r)}function Hg(e,t,n){let r=[],i=Wg(n)?n:[];for(let o=0;o!==e.length;++o)T(r,sn(()=>e[o].shrink(t[o],i[o]).map(s=>{let a=W(t,(l,u)=>new O(Yn(l),i[u]));return[...Te(a,0,o),s,...Te(a,o+1)]}).map(Gg)));return D.nil().join(...r)}var yI=class extends le{constructor(e){super(),this.arbs=e;for(let t=0;t!==e.length;++t){let n=e[t];if(n==null||n.generate===null||n.generate===void 0)throw new Error(`Invalid parameter encountered at index ${t}: expecting an Arbitrary`)}}generate(e,t){let n=[];for(let r=0;r!==this.arbs.length;++r)T(n,this.arbs[r].generate(e,t));return Gg(n)}canShrinkWithoutContext(e){if(!Wg(e)||e.length!==this.arbs.length)return!1;for(let t=0;t!==this.arbs.length;++t)if(!this.arbs[t].canShrinkWithoutContext(e[t]))return!1;return!0}shrink(e,t){return Hg(this.arbs,e,t)}};function F(...e){return new yI(e)}var gI=Math.log;function qg(e){return 2+~~(gI(e+1)*.4342944819032518)}var Zu={};function bI(e){Zu=e}function ft(){return Zu}function SI(){Zu={}}var Xr=Symbol("UndefinedContextPlaceholder");function Xn(e){return e.context!==void 0?e:e.hasToBeCloned?new O(e.value_,Xr,()=>e.value):new O(e.value_,Xr)}var uy=()=>{},wI=class{constructor(e,t){this.arb=e,this.predicate=t;let{asyncBeforeEach:n,asyncAfterEach:r,beforeEach:i,afterEach:o}=ft()||{};if(n!==void 0&&i!==void 0)throw M(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if(r!==void 0&&o!==void 0)throw M(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=n||i||uy,this.afterEachHook=r||o||uy}isAsync(){return!0}generate(e,t){return Xn(this.arb.generate(e,t!==void 0?qg(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return D.nil();let t=e.context!==Xr?e.context:void 0;return this.arb.shrink(e.value_,t).map(Xn)}async runBeforeEach(){await this.beforeEachHook()}async runAfterEach(){await this.afterEachHook()}async run(e){try{let t=await this.predicate(e);return t===void 0||t===!0?null:{error:new M("Property failed by returning false")}}catch(t){return un.isFailure(t)?t:{error:t}}}beforeEach(e){let t=this.beforeEachHook;return this.beforeEachHook=()=>e(t),this}afterEach(e){let t=this.afterEachHook;return this.afterEachHook=()=>e(t),this}},Kg=class extends le{constructor(e){super(),this.arb=e}generate(e,t){return Xn(this.arb.generate(e,t))}canShrinkWithoutContext(e){return!0}shrink(e,t){if(t===void 0&&!this.arb.canShrinkWithoutContext(e))return D.nil();let n=t!==Xr?t:void 0;return this.arb.shrink(e,n).map(Xn)}};function xI(...e){if(e.length<2)throw new Error("asyncProperty expects at least two parameters");let t=Te(e,0,e.length-1),n=e[e.length-1];return Dg(t,Tg),new wI(F(...W(t,r=>new Kg(r))),r=>n(...r))}var cy=()=>{},Yg=class{constructor(e,t){this.arb=e,this.predicate=t;let{beforeEach:n=cy,afterEach:r=cy,asyncBeforeEach:i,asyncAfterEach:o}=ft()||{};if(i!==void 0)throw M(`"asyncBeforeEach" can't be set when running synchronous properties`);if(o!==void 0)throw M(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=n,this.afterEachHook=r}isAsync(){return!1}generate(e,t){return Xn(this.arb.generate(e,t!==void 0?qg(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return D.nil();let t=e.context!==Xr?e.context:void 0;return this.arb.shrink(e.value_,t).map(Xn)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(e){try{let t=this.predicate(e);return t===void 0||t===!0?null:{error:new M("Property failed by returning false")}}catch(t){return un.isFailure(t)?t:{error:t}}}beforeEach(e){let t=this.beforeEachHook;return this.beforeEachHook=()=>e(t),this}afterEach(e){let t=this.afterEachHook;return this.afterEachHook=()=>e(t),this}};function vI(...e){if(e.length<2)throw new Error("property expects at least two parameters");let t=Te(e,0,e.length-1),n=e[e.length-1];return Dg(t,Tg),new Yg(F(...W(t,r=>new Kg(r))),r=>n(...r))}var RI=(function(e){return e[e.None=0]="None",e[e.Verbose=1]="Verbose",e[e.VeryVerbose=2]="VeryVerbose",e})({});function Cu(e){return"unsafeNext"in e?e.unsafeJump===void 0?{clone:()=>Cu(e),next:()=>e.unsafeNext(),getState:()=>e.getState()}:{clone:()=>Cu(e),next:()=>e.unsafeNext(),jump:()=>e.unsafeJump(),getState:()=>e.getState()}:e}function Zg(e){return"jump"in e&&typeof e.jump=="function"?e:{clone:()=>Zg(e),next:()=>e.next(),jump:()=>Cm(e,42),getState:()=>e.getState()}}function Zo(e){return Zg(Cu(e))}var AI=Date.now,CI=Math.min,EI=Math.random,kI=class{constructor(e){let t=e||{};this.seed=II(t),this.randomType=PI(t),this.numRuns=MI(t),this.verbose=TI(t),this.maxSkipsPerRun=t.maxSkipsPerRun!==void 0?t.maxSkipsPerRun:100,this.timeout=eu(t.timeout),this.skipAllAfterTimeLimit=eu(t.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=eu(t.interruptAfterTimeLimit),this.markInterruptAsFailure=t.markInterruptAsFailure===!0,this.skipEqualValues=t.skipEqualValues===!0,this.ignoreEqualValues=t.ignoreEqualValues===!0,this.logger=t.logger!==void 0?t.logger:n=>{console.log(n)},this.path=t.path!==void 0?t.path:"",this.unbiased=t.unbiased===!0,this.examples=t.examples!==void 0?t.examples:[],this.endOnFailure=t.endOnFailure===!0,this.reporter=t.reporter,this.asyncReporter=t.asyncReporter,this.includeErrorInReport=t.includeErrorInReport===!0}toParameters(){return{seed:this.seed,randomType:this.randomType,numRuns:this.numRuns,maxSkipsPerRun:this.maxSkipsPerRun,timeout:this.timeout,skipAllAfterTimeLimit:this.skipAllAfterTimeLimit,interruptAfterTimeLimit:this.interruptAfterTimeLimit,markInterruptAsFailure:this.markInterruptAsFailure,skipEqualValues:this.skipEqualValues,ignoreEqualValues:this.ignoreEqualValues,path:this.path,logger:this.logger,unbiased:this.unbiased,verbose:this.verbose,examples:this.examples,endOnFailure:this.endOnFailure,reporter:this.reporter,asyncReporter:this.asyncReporter,includeErrorInReport:this.includeErrorInReport}}};function Ql(e){return t=>Zo(e(t))}function II(e){if(e.seed===void 0)return AI()^EI()*4294967296;let t=e.seed|0;return e.seed===t?t:t^(e.seed-t)*4294967296}function PI(e){if(e.randomType===void 0)return Yl;if(typeof e.randomType=="string")switch(e.randomType){case"mersenne":return Ql(xm);case"congruential":case"congruential32":return Ql(bm);case"xorshift128plus":return Yl;case"xoroshiro128plus":return Am;default:throw new Error(`Invalid random specified: '${e.randomType}'`)}let t=e.randomType(0);if("min"in t&&t.min!==-2147483648)throw new Error(`Invalid random number generator: min must equal -0x80000000, got ${String(t.min)}`);if("max"in t&&t.max!==2147483647)throw new Error(`Invalid random number generator: max must equal 0x7fffffff, got ${String(t.max)}`);return t===Zo(t)?e.randomType:Ql(e.randomType)}function MI(e){return e.numRuns!==void 0?e.numRuns:e.num_runs!==void 0?e.num_runs:100}function TI(e){return e.verbose===void 0?0:typeof e.verbose=="boolean"?e.verbose===!0?1:0:e.verbose<=0?0:e.verbose>=2?2:e.verbose|0}function eu(e){if(e!==void 0)return CI(e,2147483647)}function Ju(e){return new kI(e)}function OI(e,t,n){let r=null;return{clear:()=>n(r),promise:new Promise(i=>{r=t(()=>{i(new un(!0))},e)})}}var dy=class{constructor(e,t,n,r,i,o){this.property=e,this.getTime=t,this.interruptExecution=r,this.setTimeoutSafe=i,this.clearTimeoutSafe=o,this.skipAfterTime=this.getTime()+n}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}run(e){let t=this.skipAfterTime-this.getTime();if(t<=0){let n=new un(this.interruptExecution);return this.isAsync()?Promise.resolve(n):n}if(this.interruptExecution&&this.isAsync()){let n=OI(t,this.setTimeoutSafe,this.clearTimeoutSafe),r=Promise.race([this.property.run(e),n.promise]);return r.then(n.clear,n.clear),r}return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},NI=(e,t,n)=>{let r=null;return{clear:()=>n(r),promise:new Promise(i=>{r=t(()=>{i({error:new M(`Property timeout: exceeded limit of ${e} milliseconds`)})},e)})}},$I=class{constructor(e,t,n,r){this.property=e,this.timeMs=t,this.setTimeoutSafe=n,this.clearTimeoutSafe=r}isAsync(){return!0}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}async run(e){let t=NI(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),n=Promise.race([this.property.run(e),t.promise]);return n.then(t.clear,t.clear),n}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},Jg=class{constructor(e){this.property=e}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,void 0)}shrink(e){return this.property.shrink(e)}run(e){return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},fy=Array.from,hy=typeof Buffer<"u"?Buffer.isBuffer:void 0,Gn=JSON.stringify,py=Number.isNaN,LI=Object.keys,_I=Object.getOwnPropertySymbols,DI=Object.getOwnPropertyDescriptor,my=Object.getPrototypeOf,yy=Number.NEGATIVE_INFINITY,FI=Number.POSITIVE_INFINITY,ht=Symbol.for("fast-check/toStringMethod");function Xu(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&ht in e&&typeof e[ht]=="function"}var Ut=Symbol.for("fast-check/asyncToStringMethod");function Qu(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Ut in e&&typeof e[Ut]=="function"}var BI=/^Symbol\((.*)\)$/;function jI(e){if(e.description!==void 0)return e.description;let t=BI.exec(Be(e));return t&&t[1].length?t[1]:null}function gy(e){switch(e){case 0:return 1/e===yy?"-0":"0";case yy:return"Number.NEGATIVE_INFINITY";case FI:return"Number.POSITIVE_INFINITY";default:return e===e?Be(e):"Number.NaN"}}function UI(e){let t=-1;for(let n in e){let r=Number(n);if(r!==t+1)return!0;t=r}return t+1!==e.length}function Je(e,t,n){let r=[...t,e];if(typeof e=="object"&&Ft(t,e)!==-1)return"[cyclic]";if(Qu(e)){let i=n(e);if(i.state==="fulfilled")return i.value}if(Xu(e))try{return e[ht]()}catch{}switch(Au(e)){case"[object Array]":{let i=e;if(i.length>=50&&UI(i)){let s=[];for(let a in i)py(Number(a))||T(s,`${a}:${Je(i[a],r,n)}`);return s.length!==0?`Object.assign(Array(${i.length}),{${ae(s,",")}})`:`Array(${i.length})`}let o=ae(W(i,s=>Je(s,r,n)),",");return i.length===0||i.length-1 in i?`[${o}]`:`[${o},]`}case"[object BigInt]":return`${e}n`;case"[object Boolean]":{let i=e==!0?"true":"false";return typeof e=="boolean"?i:`new Boolean(${i})`}case"[object Date]":{let i=e;return py(Go(i))?"new Date(NaN)":`new Date(${Gn(D2(i))})`}case"[object Map]":return`new Map(${Je(Array.from(e),r,n)})`;case"[object Null]":return"null";case"[object Number]":return typeof e=="number"?gy(e):`new Number(${gy(Number(e))})`;case"[object Object]":{try{let o=e.toString;if(typeof o=="function"&&o!==Object.prototype.toString)return e.toString()}catch{return"[object Object]"}let i=o=>`${o==="__proto__"?'["__proto__"]':typeof o=="symbol"?`[${Je(o,r,n)}]`:Gn(o)}:${Je(e[o],r,n)}`;return"{"+ae([...my(e)===null?["__proto__:null"]:[],...W(LI(e),i),...W($2(_I(e),o=>{let s=DI(e,o);return s&&s.enumerable}),i)],",")+"}"}case"[object Set]":return`new Set(${Je(Array.from(e),r,n)})`;case"[object String]":return typeof e=="string"?Gn(e):`new String(${Gn(e)})`;case"[object Symbol]":{let i=e;if(Do.keyFor(i)!==void 0)return`Symbol.for(${Gn(Do.keyFor(i))})`;let o=jI(i);return o===null?"Symbol()":i===(o.startsWith("Symbol.")&&Do[o.substring(7)])?o:`Symbol(${Gn(o)})`}case"[object Promise]":{let i=n(e);switch(i.state){case"fulfilled":return`Promise.resolve(${Je(i.value,r,n)})`;case"rejected":return`Promise.reject(${Je(i.value,r,n)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(e instanceof Error)return`new Error(${Je(e.message,r,n)})`;break;case"[object Undefined]":return"undefined";case"[object Int8Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Int16Array]":case"[object Uint16Array]":case"[object Int32Array]":case"[object Uint32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object BigInt64Array]":case"[object BigUint64Array]":{if(typeof hy=="function"&&hy(e))return`Buffer.from(${e.buffer.detached?"/*detached ArrayBuffer*/":Je(fy(e.values()),r,n)})`;let i=my(e),o=i&&i.constructor&&i.constructor.name;if(typeof o=="string"){let s=e;return s.buffer.detached?`${o}.from(/*detached ArrayBuffer*/)`:`${o}.from(${Je(fy(s.values()),r,n)})`}break}}try{return e.toString()}catch{return Au(e)}}function we(e){return Je(e,[],()=>({state:"unknown",value:void 0}))}function Xg(e){let t=Do(),n=[],r=new jt;function i(){let l=null,u=()=>{l!==null&&clearTimeout(l)};return{delay:new Promise(c=>{l=setTimeout(()=>{l=null,c(t)},0)}),cancel:u}}let o={state:"unknown",value:void 0},s=function(u){let c=u;if(r.has(c))return r.get(c);let d=i(),f=Ut in u?Promise.resolve().then(()=>u[Ut]()):u;return f.catch(()=>{}),n.push(Promise.race([f,d.delay]).then(p=>{p===t?r.set(c,{state:"pending",value:void 0}):r.set(c,{state:"fulfilled",value:p}),d.cancel()},p=>{r.set(c,{state:"rejected",value:p}),d.cancel()})),r.set(c,o),o};function a(){let l=Je(e,[],s);return n.length===0?l:Promise.all(n.splice(0)).then(a)}return a()}async function ec(e){return Promise.resolve(Xg(e))}function by(e){return e===null?new un:e}function VI(...e){return e[1]?e[0].then(by):by(e[0])}function WI(e,t){return VI(e,t)}var Sy=class{constructor(e,t){this.property=e,this.skipRuns=t,this.coveredCases=new Map}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}run(e){let t=we(e);if(this.coveredCases.has(t)){let r=this.coveredCases.get(t);return this.skipRuns?WI(r,this.property.isAsync()):r}let n=this.property.run(e);return this.coveredCases.set(t,n),n}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},wy=Date.now,tu=setTimeout,nu=clearTimeout;function zI(e,t){let n=e;return e.isAsync()&&t.timeout!==void 0&&(n=new $I(n,t.timeout,tu,nu)),t.unbiased&&(n=new Jg(n)),t.skipAllAfterTimeLimit!==void 0&&(n=new dy(n,wy,t.skipAllAfterTimeLimit,!1,tu,nu)),t.interruptAfterTimeLimit!==void 0&&(n=new dy(n,wy,t.interruptAfterTimeLimit,!0,tu,nu)),t.skipEqualValues&&(n=new Sy(n,!0)),t.ignoreEqualValues&&(n=new Sy(n,!1)),n}var GI=(function(e){return e[e.Success=0]="Success",e[e.Skipped=-1]="Skipped",e[e.Failure=1]="Failure",e})({}),HI=class Qg{constructor(t,n){this.verbosity=t,this.interruptedAsFailure=n,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(t,n){let r={status:t,value:n,children:[]};return this.currentLevelExecutionTrees.push(r),r}fail(t,n,r){if(this.verbosity>=1){let i=this.appendExecutionTree(1,t);this.currentLevelExecutionTrees=i.children}this.pathToFailure===void 0?this.pathToFailure=`${n}`:this.pathToFailure+=`:${n}`,this.value=t,this.failure=r}skip(t){this.verbosity>=2&&this.appendExecutionTree(-1,t),this.pathToFailure===void 0&&++this.numSkips}success(t){this.verbosity>=2&&this.appendExecutionTree(0,t),this.pathToFailure===void 0&&++this.numSuccesses}interrupt(){this.interrupted=!0}isSuccess(){return this.pathToFailure===void 0}firstFailure(){return this.pathToFailure!==void 0?+je(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?je(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let t=[],n=this.rootExecutionTrees;for(;n.length>0&&n[n.length-1].status===1;){let r=n[n.length-1];t.push(r.value),n=r.children}return t}static mergePaths(t,n){if(t.length===0)return n;let r=t.split(":"),i=n.split(":"),o=+r[r.length-1]+ +i[0];return[...r.slice(0,r.length-1),`${o}`,...i.slice(1)].join(":")}toRunDetails(t,n,r,i){if(!this.isSuccess())return{failed:!0,interrupted:this.interrupted,numRuns:this.firstFailure()+1-this.numSkips,numSkips:this.numSkips,numShrinks:this.numShrinks(),seed:t,counterexample:this.value,counterexamplePath:Qg.mergePaths(n,this.pathToFailure),errorInstance:this.failure.error,failures:this.extractFailures(),executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:i.toParameters()};let o=this.interruptedAsFailure||this.numSuccesses===0;return{failed:this.numSkips>r||this.interrupted&&o,interrupted:this.interrupted,numRuns:this.numSuccesses,numSkips:this.numSkips,numShrinks:0,seed:t,counterexample:null,counterexamplePath:null,error:null,errorInstance:null,failures:[],executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:i.toParameters()}}},eb=class{constructor(e,t,n,r){this.sourceValues=e,this.shrink=t,this.runExecution=new HI(n,r),this.currentIdx=-1,this.nextValues=e}[Symbol.iterator](){return this}next(){let e=this.nextValues.next();return e.done||this.runExecution.interrupted?{done:!0,value:void 0}:(this.currentValue=e.value,++this.currentIdx,{done:!1,value:e.value.value_})}handleResult(e){e!==null&&typeof e=="object"&&!un.isFailure(e)?(this.runExecution.fail(this.currentValue.value_,this.currentIdx,e),this.currentIdx=-1,this.nextValues=this.shrink(this.currentValue)):e!==null?e.interruptExecution?this.runExecution.interrupt():(this.runExecution.skip(this.currentValue.value_),this.sourceValues.skippedOne()):this.runExecution.success(this.currentValue.value_)}},qI=class{constructor(e,t,n){this.initialValues=e,this.maxInitialIterations=t,this.remainingSkips=n}[Symbol.iterator](){return this}next(){if(--this.maxInitialIterations!==-1&&this.remainingSkips>=0){let e=this.initialValues.next();if(!e.done)return{value:e.value,done:!1}}return{value:void 0,done:!0}}skippedOne(){--this.remainingSkips,++this.maxInitialIterations}},KI=-2147483648,YI=2147483647,ZI=Math.pow(2,27),JI=Math.pow(2,-53),tc=class tb{constructor(t){this.internalRng=Zo(t.clone())}clone(){return new tb(this.internalRng)}next(t){return Po(this.internalRng,0,(1<<t)-1)}nextBoolean(){return Po(this.internalRng,0,1)===1}nextInt(t,n){return Po(this.internalRng,t===void 0?KI:t,n===void 0?YI:n)}nextBigInt(t,n){return Im(this.internalRng,t,n)}nextDouble(){let t=this.next(26),n=this.next(27);return(t*ZI+n)*JI}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState=="function")return this.internalRng.getState()}};function XI(e,t,n){return t.jump(),e.generate(new tc(t),n)}function*nb(e,t,n,r){for(let i=0;i!==r.length;++i)yield new O(r[i],void 0);for(let i=0,o=n(t);;++i)yield XI(e,o,i)}function QI(e,t,n){return()=>e.generate(new tc(t),n)}function*rb(e,t,n,r){yield*W(r,s=>()=>new O(s,void 0));let i=0,o=Zo(n(t));for(;;)o.jump(),yield QI(e,o,i++)}function xy(e){return e()}function ib(e,t,n){let r=t,i=e.split(":").map(s=>+s);if(i.length===0)return r.map(xy);if(!i.every(s=>!Number.isNaN(s)))throw new Error(`Unable to replay, got invalid path=${e}`);let o=r.drop(i[0]).map(xy);for(let s of i.slice(1)){let a=o.getNthOrLast(0);if(a===null)throw new Error(`Unable to replay, got wrong path=${e}`);o=n(a).drop(s)}return o}var eP=Object.assign;function tP(e){return e.length===1?`Hint: ${e[0]}`:e.map((t,n)=>`Hint (${n+1}): ${t}`).join(`
|
|
51
|
+
`)}function nP(e,t){return`Encountered failures were:
|
|
52
|
+
- ${e.map(t).join(`
|
|
53
|
+
- `)}`}function nc(e,t){let n=[],r=[];for(let i=e.length-1;i>=0;--i)r.push({depth:1,tree:e[i]});for(;r.length!==0;){let i=r.pop(),o=i.tree,s=i.depth,a=o.status===0?"\x1B[32m\u221A\x1B[0m":o.status===1?"\x1B[31m\xD7\x1B[0m":"\x1B[33m!\x1B[0m",l=s!==0?". ".repeat(s-1):"";n.push(`${l}${a} ${t(o.value)}`);for(let u=o.children.length-1;u>=0;--u)r.push({depth:s+1,tree:o.children[u]})}return`Execution summary:
|
|
54
|
+
${n.join(`
|
|
55
|
+
`)}`}function rP(e,t){let n=`Failed to run property, too many pre-condition failures encountered
|
|
56
|
+
{ seed: ${e.seed} }
|
|
57
|
+
|
|
58
|
+
Ran ${e.numRuns} time(s)
|
|
59
|
+
Skipped ${e.numSkips} time(s)`,r=null,i=["Try to reduce the number of rejected values by combining map, chain and built-in arbitraries","Increase failure tolerance by setting maxSkipsPerRun to an higher value"];return e.verbose>=2?r=nc(e.executionSummary,t):T(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:n,details:r,hints:i}}function iP(e){if(e instanceof M&&e.stack!==void 0)return e.stack;try{return Be(e)}catch{}if(e instanceof M)try{return hI(e)}catch{}if(e!==null&&typeof e=="object")try{return Au(e)}catch{}return"Failed to serialize errorInstance"}function oP(e,t){let n=e.runConfiguration.includeErrorInReport?`
|
|
60
|
+
Got ${lI(iP(e.errorInstance),/^Error: /,"error: ")}`:"",r=`Property failed after ${e.numRuns} tests
|
|
61
|
+
{ seed: ${e.seed}, path: "${e.counterexamplePath}", endOnFailure: true }
|
|
62
|
+
Counterexample: ${t(e.counterexample)}
|
|
63
|
+
Shrunk ${e.numShrinks} time(s)${n}`,i=null,o=[];return e.verbose>=2?i=nc(e.executionSummary,t):e.verbose===1?i=nP(e.failures,t):T(o,"Enable verbose mode in order to have the list of all failing values encountered during the run"),{message:r,details:i,hints:o}}function sP(e,t){let n=`Property interrupted after ${e.numRuns} tests
|
|
64
|
+
{ seed: ${e.seed} }`,r=null,i=[];return e.verbose>=2?r=nc(e.executionSummary,t):T(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:n,details:r,hints:i}}function Eu(e,t){if(!e.failed)return;let{message:n,details:r,hints:i}=e.counterexamplePath===null?e.interrupted?sP(e,t):rP(e,t):oP(e,t),o=n;return r!==null&&(o+=`
|
|
65
|
+
|
|
66
|
+
${r}`),i.length>0&&(o+=`
|
|
67
|
+
|
|
68
|
+
${tP(i)}`),o}function ob(e){return Eu(e,we)}async function sb(e){let t=[];function n(s){let a=Xg(s);return typeof a=="string"?a:(t.push(Promise.all([s,a])),"\u2026")}let r=Eu(e,n);if(t.length===0)return r;let i=new jt(await Promise.all(t));function o(s){let a=Xe(i,s);return a!==void 0?a:we(s)}return Eu(e,o)}function ab(e,t){if(t.runConfiguration.includeErrorInReport)throw new M(e);let n=new M(e,{cause:t.errorInstance});return"cause"in n||eP(n,{cause:t.errorInstance}),n}function aP(e){if(e.failed)throw ab(ob(e),e)}async function lP(e){if(e.failed)throw ab(await sb(e),e)}function uP(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):aP(e)}async function cP(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):lP(e)}function dP(e,t,n,r,i){let o=new eb(n,t,r,i);for(let s of o){e.runBeforeEach();let a=e.run(s);e.runAfterEach(),o.handleResult(a)}return o.runExecution}async function fP(e,t,n,r,i){let o=new eb(n,t,r,i);for(let s of o){await e.runBeforeEach();let a=await e.run(s);await e.runAfterEach(),o.handleResult(a)}return o.runExecution}function lb(e,t){if(e==null||e.generate===null||e.generate===void 0)throw new Error("Invalid property encountered, please use a valid property");if(e.run===null||e.run===void 0)throw new Error("Invalid property encountered, please use a valid property not an arbitrary");let n=Ju({...ft(),...t});if(n.reporter!==void 0&&n.asyncReporter!==void 0)throw new Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(n.asyncReporter!==void 0&&!e.isAsync())throw new Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let r=zI(e,n),i=n.path.length===0||n.path.indexOf(":")===-1?n.numRuns:-1,o=n.numRuns*n.maxSkipsPerRun,s=(...u)=>r.shrink(...u),a=new qI(n.path.length===0?nb(r,n.seed,n.randomType,n.examples):ib(n.path,an(rb(r,n.seed,n.randomType,n.examples)),s),i,o),l=n.endOnFailure?D.nil:s;return r.isAsync()?fP(r,l,a,n.verbose,n.markInterruptAsFailure).then(u=>u.toRunDetails(n.seed,n.path,o,n)):dP(r,l,a,n.verbose,n.markInterruptAsFailure).toRunDetails(n.seed,n.path,o,n)}function hP(e,t){let n=lb(e,t);if(e.isAsync())return n.then(cP);uP(n)}function pP(e,t){let n=Object.prototype.hasOwnProperty.call(e,"isAsync")?e:new Yg(e,()=>!0);return t.unbiased===!0?new Jg(n):n}function ub(e,t){let n=Ju(typeof t=="number"?{...ft(),numRuns:t}:{...ft(),...t}),r=pP(e,n),i=r.shrink.bind(r);return(n.path.length===0?an(nb(r,n.seed,n.randomType,n.examples)):ib(n.path,an(rb(r,n.seed,n.randomType,n.examples)),i)).take(n.numRuns).map(o=>o.value_)}function mP(e,t){return[...ub(e,t)]}function yP(e){return(Math.round(e*100)/100).toFixed(2)}function gP(e,t,n){let r=Ju(typeof n=="number"?{...ft(),numRuns:n}:{...ft(),...n}),i={};for(let l of ub(e,n)){let u=t(l),c=Array.isArray(u)?u:[u];for(let d of c)i[d]=(i[d]||0)+1}let o=Object.entries(i).sort((l,u)=>u[1]-l[1]).map(l=>[l[0],`${yP(l[1]*100/r.numRuns)}%`]),s=o.map(l=>l[0].length).reduce((l,u)=>Math.max(l,u),0),a=o.map(l=>l[1].length).reduce((l,u)=>Math.max(l,u),0);for(let l of o)r.logger(`${l[0].padEnd(s,".")}..${l[1].padStart(a,".")}`)}var bP=Object.assign;function ku(e,t,n,r){let i=n(),o=e.clone(),s={mrng:e.clone(),biasFactor:t,history:[]},a=u=>{let c=i[s.history.length];if(c!==void 0&&c.arb===u){let f=c.value;return T(s.history,{arb:u,value:f,context:c.context,mrng:c.mrng}),o=c.mrng.clone(),f}let d=u.generate(o,t);return T(s.history,{arb:u,value:d.value_,context:d.context,mrng:o.clone()}),d.value},l=(u,...c)=>a(r(u,c));return new O(bP(l,{values(){return W(s.history,u=>u.value)},[ke](){return ku(e,t,n,r).value},[ht](){return we(W(s.history,u=>u.value))}}),s)}var ru=Array.isArray,vy=Object.keys,SP=Object.is;function wP(e){let t=new jt;return function(r,i){let o=Xe(t,r);if(o===void 0){let l=r(...i);return dt(t,r,[{args:i,value:l}]),l}let s=o;for(let l of s)if(e(i,l.args))return l.value;let a=r(...i);return T(s,{args:i,value:a}),a}}function cb(e,t){if(e!==null&&typeof e=="object"&&t!==null&&typeof t=="object"){if(ru(e)){if(!ru(t)||e.length!==t.length)return!1}else if(ru(t))return!1;if(vy(e).length!==vy(t).length)return!1;for(let n in e)if(!(n in t)||!cb(e[n],t[n]))return!1;return!0}else return SP(e,t)}var xP=class extends le{constructor(...e){super(...e),this.arbitraryCache=wP(cb)}generate(e,t){return ku(e,t,()=>[],this.arbitraryCache)}canShrinkWithoutContext(e){return!1}shrink(e,t){if(t===void 0)return D.nil();let n=t,r=n.mrng,i=n.biasFactor,o=n.history;return Hg(o.map(s=>s.arb),o.map(s=>s.value),o.map(s=>s.context)).map(s=>{function a(){let l=s.value,u=s.context;return W(o,(c,d)=>({arb:c.arb,value:l[d],context:u[d],mrng:c.mrng}))}return ku(r,i,a,this.arbitraryCache)})}};function vP(){return new xP}var RP=Math.floor,Ry=Math.log;function AP(e){return RP(Ry(e)/Ry(2))}function CP(e){return e===k(0)?k(0):k(Be(e).length)}function db(e,t,n){if(e===t)return[{min:e,max:t}];if(e<0&&t>0){let s=n(-e),a=n(t);return[{min:-s,max:a},{min:t-a,max:t},{min:e,max:e+s}]}let r=n(t-e),i={min:e,max:e+r},o={min:t-r,max:t};return e<0?[o,i]:[i,o]}var EP=Math.ceil,kP=Math.floor;function Ay(e){return kP(e/2)}function Cy(e){return EP(e/2)}function Ey(e,t,n){let r=e-t;function*i(){let s=n?void 0:t,a=n?r:Ay(r);for(let l=a;l>0;l=Ay(l)){let u=l===r?t:e-l;yield new O(u,s),s=u}}function*o(){let s=n?void 0:t,a=n?r:Cy(r);for(let l=a;l<0;l=Cy(l)){let u=l===r?t:e-l;yield new O(u,s),s=u}}return r>0?an(i()):an(o())}var ky=Math.sign,IP=Number.isInteger,PP=Object.is,Qn=class fb extends le{constructor(t,n){super(),this.min=t,this.max=n}generate(t,n){let r=this.computeGenerateRange(t,n);return new O(t.nextInt(r.min,r.max),void 0)}canShrinkWithoutContext(t){return typeof t=="number"&&IP(t)&&!PP(t,-0)&&this.min<=t&&t<=this.max}shrink(t,n){return fb.isValidContext(t,n)?this.isLastChanceTry(t,n)?D.of(new O(n,void 0)):Ey(t,n,!1):Ey(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?0:this.min<0?this.max:this.min}computeGenerateRange(t,n){if(n===void 0||t.nextInt(1,n)!==1)return{min:this.min,max:this.max};let r=db(this.min,this.max,AP);if(r.length===1)return r[0];let i=t.nextInt(-2*(r.length-1),r.length-2);return i<0?r[0]:r[i+1]}isLastChanceTry(t,n){return t>0?t===n+1&&t>this.min:t<0?t===n-1&&t<this.max:!1}static isValidContext(t,n){if(n===void 0)return!1;if(typeof n!="number")throw new Error("Invalid context type passed to IntegerArbitrary (#1)");if(n!==0&&ky(t)!==ky(n))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},Iy=Number.isInteger;function MP(e){return{min:e.min!==void 0?e.min:-2147483648,max:e.max!==void 0?e.max:2147483647}}function X(e={}){let t=MP(e);if(t.min>t.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!Iy(t.min))throw new Error("fc.integer minimum value should be an integer");if(!Iy(t.max))throw new Error("fc.integer maximum value should be an integer");return new Qn(t.min,t.max)}var Py=new Map;function rc(e){if(e===void 0)return{depth:0};if(typeof e!="string")return e;let t=Xe(Py,e);if(t!==void 0)return t;let n={depth:0};return dt(Py,e,n),n}function ic(){return{depth:0}}var TP=class{constructor(e,t,n){this.arb=e,this.mrng=t,this.biasFactor=n}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},OP=Math.min,NP=Math.max,$P=class{constructor(e,t,n,r){this.arb=e,this.mrng=t,this.slices=n,this.biasFactor=r,this.activeSliceIndex=0,this.nextIndexInSlice=0,this.lastIndexInSlice=-1}attemptExact(e){if(e!==0&&this.mrng.nextInt(1,this.biasFactor)===1){let t=[];for(let n=0;n!==this.slices.length;++n)this.slices[n].length===e&&T(t,n);if(t.length===0)return;this.activeSliceIndex=t[this.mrng.nextInt(0,t.length-1)],this.nextIndexInSlice=0,this.lastIndexInSlice=e-1}}next(){if(this.nextIndexInSlice<=this.lastIndexInSlice)return new O(this.slices[this.activeSliceIndex][this.nextIndexInSlice++],void 0);if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.arb.generate(this.mrng,this.biasFactor);this.activeSliceIndex=this.mrng.nextInt(0,this.slices.length-1);let e=this.slices[this.activeSliceIndex];if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.nextIndexInSlice=1,this.lastIndexInSlice=e.length-1,new O(e[0],void 0);let t=this.mrng.nextInt(0,e.length-1),n=this.mrng.nextInt(0,e.length-1);return this.nextIndexInSlice=OP(t,n),this.lastIndexInSlice=NP(t,n),new O(e[this.nextIndexInSlice++],void 0)}};function My(e,t,n,r){return r===void 0||n.length===0||t.nextInt(1,r)!==1?new TP(e,t,r):new $P(e,t,n,r)}var LP=Math.floor,Ty=Math.log,Oy=Math.max,_P=Array.isArray;function iu(e,t){return e===t?e:e+LP(Ty(t-e)/Ty(2))}var hb=class pb extends le{constructor(t,n,r,i,o,s,a){super(),this.arb=t,this.minLength=n,this.maxGeneratedLength=r,this.maxLength=i,this.setBuilder=s,this.customSlices=a,this.lengthArb=X({min:n,max:r}),this.depthContext=rc(o)}preFilter(t){if(this.setBuilder===void 0)return t;let n=this.setBuilder();for(let r=0;r!==t.length;++r)n.tryAdd(t[r]);return n.getData()}static makeItCloneable(t,n){return t[ke]=()=>{let r=[];for(let i=0;i!==n.length;++i)T(r,n[i].value);return this.makeItCloneable(r,n),r},t}generateNItemsNoDuplicates(t,n,r,i){let o=0,s=t(),a=My(this.arb,r,this.customSlices,i);for(;s.size()<n&&o<this.maxGeneratedLength;){let l=a.next();s.tryAdd(l)?o=0:o+=1}return s.getData()}safeGenerateNItemsNoDuplicates(t,n,r,i){let o=Oy(0,n-iu(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=o;try{return this.generateNItemsNoDuplicates(t,n,r,i)}finally{this.depthContext.depth-=o}}generateNItems(t,n,r){let i=[],o=My(this.arb,n,this.customSlices,r);o.attemptExact(t);for(let s=0;s!==t;++s)T(i,o.next());return i}safeGenerateNItems(t,n,r){let i=Oy(0,t-iu(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=i;try{return this.generateNItems(t,n,r)}finally{this.depthContext.depth-=i}}wrapper(t,n,r,i){let o=n?this.preFilter(t):t,s=!1,a=[],l=[];for(let u=0;u!==o.length;++u){let c=o[u];s=s||c.hasToBeCloned,T(a,c.value),T(l,c.context)}return s&&pb.makeItCloneable(a,o),new O(a,{shrunkOnce:n,lengthContext:t.length===o.length&&r!==void 0?r:void 0,itemsContexts:l,startIndex:i})}generate(t,n){let r=this.applyBias(t,n),i=r.size,o=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,i,t,r.biasFactorItems):this.safeGenerateNItems(i,t,r.biasFactorItems);return this.wrapper(o,!1,void 0,0)}applyBias(t,n){if(n===void 0)return{size:this.lengthArb.generate(t,void 0).value};if(this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:n};if(t.nextInt(1,n)!==1)return{size:this.lengthArb.generate(t,void 0).value};if(t.nextInt(1,n)!==1||this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:n};let r=iu(this.minLength,this.maxGeneratedLength);return{size:X({min:this.minLength,max:r}).generate(t,void 0).value,biasFactorItems:n}}canShrinkWithoutContext(t){if(!_P(t)||this.minLength>t.length||t.length>this.maxLength)return!1;for(let n=0;n!==t.length;++n)if(!(n in t)||!this.arb.canShrinkWithoutContext(t[n]))return!1;return this.preFilter(W(t,n=>new O(n,void 0))).length===t.length}shrinkItemByItem(t,n,r){let i=[];for(let o=n.startIndex;o<r;++o)T(i,sn(()=>this.arb.shrink(t[o],n.itemsContexts[o]).map(s=>{let a=W(Te(t,0,o),(u,c)=>new O(Yn(u),n.itemsContexts[c])),l=W(Te(t,o+1),(u,c)=>new O(Yn(u),n.itemsContexts[c+o+1]));return[[...a,s,...l],void 0,o]})));return D.nil().join(...i)}shrinkImpl(t,n){if(t.length===0)return D.nil();let r=n!==void 0?n:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(t.length,r.lengthContext).drop(r.shrunkOnce&&r.lengthContext===void 0&&t.length>this.minLength+1?1:0).map(i=>{let o=t.length-i.value;return[W(Te(t,o),(s,a)=>new O(Yn(s),r.itemsContexts[a+o])),i.context,0]}).join(sn(()=>t.length>this.minLength?this.shrinkItemByItem(t,r,1):this.shrinkItemByItem(t,r,t.length))).join(t.length>this.minLength?sn(()=>{let i={shrunkOnce:!1,lengthContext:void 0,itemsContexts:Te(r.itemsContexts,1),startIndex:0};return this.shrinkImpl(Te(t,1),i).filter(o=>this.minLength<=o[0].length+1).map(o=>[[new O(Yn(t[0]),r.itemsContexts[0]),...o[0]],void 0,0])}):D.nil())}shrink(t,n){return this.shrinkImpl(t,n).map(r=>this.wrapper(r[0],!0,r[1],r[2]))}},DP=Math.floor,FP=Math.min,xn=2147483647,Hn=["xsmall","small","medium","large","xlarge"],BP=["-4","-3","-2","-1","=","+1","+2","+3","+4"],oc="small";function jP(e,t){switch(t){case"xsmall":return DP(1.1*e)+1;case"small":return 2*e+10;case"medium":return 11*e+100;case"large":return 101*e+1e3;case"xlarge":return 1001*e+1e4;default:throw new Error(`Unable to compute lengths based on received size: ${t}`)}}function ti(e,t){let n=Ft(BP,e);if(n===-1)return e;let r=Ft(Hn,t);if(r===-1)throw new Error(`Unable to offset size based on the unknown defaulted one: ${t}`);let i=r+n-4;return i<0?Hn[0]:i>=Hn.length?Hn[Hn.length-1]:Hn[i]}function Qr(e,t,n,r){let{baseSize:i=oc,defaultSizeToMaxWhenMaxSpecified:o}=ft()||{},s=e!==void 0?e:r&&o?"max":i;return s==="max"?n:FP(jP(t,ti(s,i)),n)}function UP(e,t){if(typeof e=="number")return 1/e;let{baseSize:n=oc,defaultSizeToMaxWhenMaxSpecified:r}=ft()||{},i=e!==void 0?e:t&&r?"max":n;if(i==="max")return 0;switch(ti(i,n)){case"xsmall":return 1;case"small":return .5;case"medium":return .25;case"large":return .125;case"xlarge":return .0625}}function sc(e){let{baseSize:t=oc}=ft()||{};return e===void 0?t:ti(e,t)}function oe(e,t={}){let n=t.size,r=t.minLength||0,i=t.maxLength,o=t.depthIdentifier,s=i!==void 0?i:xn;return new hb(e,r,Qr(n,r,s,i!==void 0),s,o,void 0,t.experimentalCustomSlices||[])}function Mo(e){return e/k(2)}function Ny(e,t,n){let r=e-t;function*i(){let s=n?void 0:t,a=n?r:Mo(r);for(let l=a;l>0;l=Mo(l)){let u=e-l;yield new O(u,s),s=u}}function*o(){let s=n?void 0:t,a=n?r:Mo(r);for(let l=a;l<0;l=Mo(l)){let u=e-l;yield new O(u,s),s=u}}return r>0?an(i()):an(o())}var VP=class mb extends le{constructor(t,n){super(),this.min=t,this.max=n}generate(t,n){let r=this.computeGenerateRange(t,n);return new O(t.nextBigInt(r.min,r.max),void 0)}computeGenerateRange(t,n){if(n===void 0||t.nextInt(1,n)!==1)return{min:this.min,max:this.max};let r=db(this.min,this.max,CP);if(r.length===1)return r[0];let i=t.nextInt(-2*(r.length-1),r.length-2);return i<0?r[0]:r[i+1]}canShrinkWithoutContext(t){return typeof t=="bigint"&&this.min<=t&&t<=this.max}shrink(t,n){return mb.isValidContext(t,n)?this.isLastChanceTry(t,n)?D.of(new O(n,void 0)):Ny(t,n,!1):Ny(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?k(0):this.min<0?this.max:this.min}isLastChanceTry(t,n){return t>0?t===n+k(1)&&t>this.min:t<0?t===n-k(1)&&t<this.max:!1}static isValidContext(t,n){if(n===void 0)return!1;if(typeof n!="bigint")throw new Error("Invalid context type passed to BigIntArbitrary (#1)");let r=t>0&&n<0||t<0&&n>0;if(n!==k(0)&&r)throw new Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function WP(e){let n=k(-1)<<k(255),r=(k(1)<<k(255))-k(1),i=e.min,o=e.max;return{min:i!==void 0?i:n-(o!==void 0&&o<k(0)?o*o:k(0)),max:o!==void 0?o:r+(i!==void 0&&i>k(0)?i*i:k(0))}}function zP(e){return e[0]===void 0?{}:e[1]===void 0?e[0]:{min:e[0],max:e[1]}}function ln(...e){let t=WP(zP(e));if(t.min>t.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new VP(t.min,t.max)}var GP=Object.getPrototypeOf,Hr=class extends le{constructor(e){super(),this.arb=e}generate(e,t){return this.arb.generate(e,void 0)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return this.arb.shrink(e,t)}};function qo(e){return GP(e)===Hr.prototype&&e.generate===Hr.prototype.generate&&e.canShrinkWithoutContext===Hr.prototype.canShrinkWithoutContext&&e.shrink===Hr.prototype.shrink?e:new Hr(e)}function HP(e){return e===1}function qP(e){if(typeof e!="boolean")throw new Error("Unsupported input type");return e===!0?1:0}function ni(){return qo(X({min:0,max:1}).map(HP,qP))}var Yr=Object.is,KP=class{constructor(e){this.values=e,this.fastValues=new Zn(this.values);let t=!1,n=!1;if(Ho(this.fastValues,0))for(let r=0;r!==this.values.length;++r){let i=this.values[r];t=t||Yr(i,-0),n=n||Yr(i,0)}this.hasMinusZero=t,this.hasPlusZero=n}has(e){return e===0?Yr(e,0)?this.hasPlusZero:this.hasMinusZero:Ho(this.fastValues,e)}},yb=class extends le{constructor(e){super(),this.values=e}generate(e,t){let n=this.values.length===1?0:e.nextInt(0,this.values.length-1),r=this.values[n];return wn(r)?new O(r,n,()=>r[ke]()):new O(r,n)}canShrinkWithoutContext(e){return this.values.length===1?Yr(this.values[0],e):(this.fastValues===void 0&&(this.fastValues=new KP(this.values)),this.fastValues.has(e))}shrink(e,t){return t===0||Yr(e,this.values[0])?D.nil():D.of(new O(this.values[0],0))}};function At(...e){if(e.length===0)throw new Error("fc.constantFrom expects at least one parameter");return new yb(e)}function YP(e){return!e||!e.withBigInt?At(!1,null,void 0,0,"",NaN):At(!1,null,void 0,0,"",NaN,k(0))}function Se(e){return new yb([e])}var ZP=class gb{constructor(){this.receivedLogs=[]}log(t){this.receivedLogs.push(t)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[ke](){return new gb}};function JP(){return Se(new ZP)}var XP=NaN,QP=Number.isNaN;function bb(e){return new zo(e)}function Sb(e){if(!(e instanceof zo)||e.constructor!==zo)throw new M("Not a valid value for date unmapper");return Go(e)}function e6(e){return t=>t===e?new zo(XP):bb(t)}function t6(e){return t=>{let n=Sb(t);return QP(n)?e:n}}var $y=Number.isNaN;function wb(e={}){let t=e.min!==void 0?Go(e.min):-864e13,n=e.max!==void 0?Go(e.max):864e13,r=e.noInvalidDate;if($y(t))throw new Error("fc.date min must be valid instance of Date");if($y(n))throw new Error("fc.date max must be valid instance of Date");if(t>n)throw new Error("fc.date max must be greater or equal to min");if(r)return X({min:t,max:n}).map(bb,Sb);let i=n+1;return X({min:t,max:n+1}).map(e6(i),t6(i))}var n6=class extends le{constructor(e,t){super(),this.startArb=e,this.chainer=t}generate(e,t){let n=[],r=e.clone(),i=this.startArb.generate(e,t);for(n.push({arbitrary:this.startArb,value:i.value_,context:i.context,clonedMrng:r});;){let s=this.chainer(i.value_);if(s===void 0)break;let a=e.clone();i=s.generate(e,t),n.push({arbitrary:s,value:i.value_,context:i.context,clonedMrng:a})}let o={biasFactor:t,entries:n,currentShrinkLevel:0};return new O(i.value_,o)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?new D(this.shrinkIterator(t)):D.nil()}*shrinkIterator(e){let{entries:t,currentShrinkLevel:n,biasFactor:r}=e;for(let i=n;i<t.length;++i){let o=t[i],s=o.arbitrary.shrink(o.value,o.context);for(let a of s){let l=t.slice(0,i);l.push({arbitrary:o.arbitrary,value:a.value_,context:a.context,clonedMrng:o.clonedMrng});let u=a,c=o.clonedMrng.clone();for(;;){let p=this.chainer(u.value_);if(p===void 0)break;let h=c.clone(),m=p.generate(c,r);l.push({arbitrary:p,value:m.value_,context:m.context,clonedMrng:h}),u=m}let d=l[l.length-1],f={biasFactor:r,entries:l,currentShrinkLevel:i};yield new O(d.value,f)}}}isSafeContext(e){return e!=null&&typeof e=="object"&&"biasFactor"in e&&"entries"in e&&"currentShrinkLevel"in e}};function r6(e,t){return new n6(e,t)}var i6=Symbol.iterator,o6=Array.isArray,s6=Object.is,a6=class xb extends le{constructor(t,n){super(),this.arb=t,this.numValues=n}generate(t,n){let r=[];if(this.numValues<=0)return this.wrapper(r);for(let i=0;i!==this.numValues-1;++i)T(r,this.arb.generate(t.clone(),n));return T(r,this.arb.generate(t,n)),this.wrapper(r)}canShrinkWithoutContext(t){if(!o6(t)||t.length!==this.numValues)return!1;if(t.length===0)return!0;for(let n=1;n<t.length;++n)if(!s6(t[0],t[n]))return!1;return this.arb.canShrinkWithoutContext(t[0])}shrink(t,n){return t.length===0?D.nil():new D(this.shrinkImpl(t,n!==void 0?n:[])).map(r=>this.wrapper(r))}*shrinkImpl(t,n){let r=W(t,(o,s)=>this.arb.shrink(o,n[s])[i6]()),i=W(r,o=>o.next());for(;!i[0].done;)yield W(i,o=>o.value),i=W(r,o=>o.next())}static makeItCloneable(t,n){return t[ke]=()=>{let r=[];for(let i=0;i!==n.length;++i)T(r,n[i].value);return this.makeItCloneable(r,n),r},t}wrapper(t){let n=!1,r=[],i=[];for(let o=0;o!==t.length;++o){let s=t[o];n=n||s.hasToBeCloned,T(r,s.value),T(i,s.context)}return n&&xb.makeItCloneable(r,t),new O(r,i)}};function l6(e,t){return new a6(e,t)}var Ly=class{constructor(e){this.isEqual=e,this.data=[]}tryAdd(e){for(let t=0;t!==this.data.length;++t)if(this.isEqual(this.data[t],e))return!1;return T(this.data,e),!0}size(){return this.data.length}getData(){return this.data}},u6=Number.isNaN,c6=class{constructor(e){this.selector=e,this.selectedItemsExceptNaN=new Zn,this.data=[]}tryAdd(e){let t=this.selector(e);if(u6(t))return T(this.data,e),!0;let n=this.selectedItemsExceptNaN.size;return Zr(this.selectedItemsExceptNaN,t),n!==this.selectedItemsExceptNaN.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},d6=Object.is,f6=class{constructor(e){this.selector=e,this.selectedItemsExceptMinusZero=new Zn,this.data=[],this.hasMinusZero=!1}tryAdd(e){let t=this.selector(e);if(d6(t,-0))return this.hasMinusZero?!1:(T(this.data,e),this.hasMinusZero=!0,!0);let n=this.selectedItemsExceptMinusZero.size;return Zr(this.selectedItemsExceptMinusZero,t),n!==this.selectedItemsExceptMinusZero.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},h6=class{constructor(e){this.selector=e,this.selectedItems=new Zn,this.data=[]}tryAdd(e){let t=this.selector(e),n=this.selectedItems.size;return Zr(this.selectedItems,t),n!==this.selectedItems.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}};function p6(e){if(typeof e.comparator=="function"){if(e.selector===void 0){let a=e.comparator,l=(u,c)=>a(u.value_,c.value_);return()=>new Ly(l)}let r=e.comparator,i=e.selector,o=a=>i(a.value_),s=(a,l)=>r(o(a),o(l));return()=>new Ly(s)}let t=e.selector||(r=>r),n=r=>t(r.value_);switch(e.comparator){case"IsStrictlyEqual":return()=>new c6(n);case"SameValueZero":return()=>new h6(n);case"SameValue":case void 0:return()=>new f6(n)}}function vn(e,t={}){let n=t.minLength!==void 0?t.minLength:0,r=t.maxLength!==void 0?t.maxLength:xn,i=Qr(t.size,n,r,t.maxLength!==void 0),o=t.depthIdentifier,s=new hb(e,n,i,r,o,p6(t),[]);return n===0?s:s.filter(a=>a.length>=n)}var m6=Object.create,y6=Object.defineProperty,g6=Object.getOwnPropertyDescriptor,_y=Object.getPrototypeOf,b6=Object.prototype,S6=Reflect.ownKeys;function w6(e){let t=e[1]?m6(null):{};for(let n of e[0])y6(t,n[0],{enumerable:!0,configurable:!0,writable:!0,value:n[1]});return t}function x6(e){return e!==void 0&&!!e.configurable&&!!e.enumerable&&!!e.writable&&e.get===void 0&&e.set===void 0}function v6(e){if(typeof e!="object"||e===null)throw new M("Incompatible instance received: should be a non-null object");let t=_y(e)===null,n=_y(e)===b6;if(!t&&!n)throw new M("Incompatible instance received: should be of exact type Object");let r=W(S6(e),i=>[i,g6(e,i)]);if(!Ug(r,([,i])=>x6(i)))throw new M("Incompatible instance received: should contain only c/e/w properties without get/set");return[W(r,([i,o])=>[i,o.value]),t]}function R6(e){return e[0]}function ac(e,t,n={}){let r=!!n.noNullPrototype;return F(vn(F(e,t),{minLength:n.minKeys,maxLength:n.maxKeys,size:n.size,selector:R6,depthIdentifier:n.depthIdentifier}),r?Se(!1):ni()).map(w6,v6)}var A6=Number.POSITIVE_INFINITY,C6=Number.MAX_SAFE_INTEGER,E6=Number.isInteger,k6=Math.floor,I6=Math.pow,P6=Math.min,Iu=class vb extends le{static from(t,n,r){if(t.length===0)throw new Error(`${r} expects at least one weighted arbitrary`);let i=0;for(let o=0;o!==t.length;++o){if(t[o].arbitrary===void 0)throw new Error(`${r} expects arbitraries to be specified`);let s=t[o].weight;if(i+=s,!E6(s))throw new Error(`${r} expects weights to be integer values`);if(s<0)throw new Error(`${r} expects weights to be superior or equal to 0`)}if(i<=0)throw new Error(`${r} expects the sum of weights to be strictly superior to 0`);return new vb(t,{depthBias:UP(n.depthSize,n.maxDepth!==void 0),maxDepth:n.maxDepth!==void 0?n.maxDepth:A6,withCrossShrink:!!n.withCrossShrink},rc(n.depthIdentifier))}constructor(t,n,r){super(),this.warbs=t,this.constraints=n,this.context=r;let i=0;this.cumulatedWeights=[];for(let o=0;o!==t.length;++o)i+=t[o].weight,T(this.cumulatedWeights,i);this.totalWeight=i}generate(t,n){if(this.mustGenerateFirst())return this.safeGenerateForIndex(t,0,n);let r=t.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let i=0;i!==this.cumulatedWeights.length;++i)if(r<this.cumulatedWeights[i])return this.safeGenerateForIndex(t,i,n);throw new Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(t){return this.canShrinkWithoutContextIndex(t)!==-1}shrink(t,n){if(n!==void 0){let i=n,o=i.selectedIndex,s=i.originalBias,a=this.warbs[o].arbitrary.shrink(t,i.originalContext).map(l=>this.mapIntoValue(o,l,null,s));if(i.clonedMrngForFallbackFirst!==null){i.cachedGeneratedForFirst===void 0&&(i.cachedGeneratedForFirst=this.safeGenerateForIndex(i.clonedMrngForFallbackFirst,0,s));let l=i.cachedGeneratedForFirst;return D.of(l).join(a)}return a}let r=this.canShrinkWithoutContextIndex(t);return r===-1?D.nil():this.defaultShrinkForFirst(r).join(this.warbs[r].arbitrary.shrink(t,void 0).map(i=>this.mapIntoValue(r,i,null,void 0)))}defaultShrinkForFirst(t){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(t)||this.warbs[0].fallbackValue===void 0)return D.nil()}finally{--this.context.depth}let n=new O(this.warbs[0].fallbackValue.default,void 0);return D.of(this.mapIntoValue(0,n,null,void 0))}canShrinkWithoutContextIndex(t){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(t)?0:-1;try{++this.context.depth;for(let n=0;n!==this.warbs.length;++n){let r=this.warbs[n];if(r.weight!==0&&r.arbitrary.canShrinkWithoutContext(t))return n}return-1}finally{--this.context.depth}}mapIntoValue(t,n,r,i){let o={selectedIndex:t,originalBias:i,originalContext:n.context,clonedMrngForFallbackFirst:r};return new O(n.value,o)}safeGenerateForIndex(t,n,r){++this.context.depth;try{let i=this.warbs[n].arbitrary.generate(t,r),o=this.mustFallbackToFirstInShrink(n)?t.clone():null;return this.mapIntoValue(n,i,o,r)}finally{--this.context.depth}}mustGenerateFirst(){return this.constraints.maxDepth<=this.context.depth}mustFallbackToFirstInShrink(t){return t!==0&&this.constraints.withCrossShrink&&this.warbs[0].weight!==0}computeNegDepthBenefit(){let t=this.constraints.depthBias;if(t<=0||this.warbs[0].weight===0)return 0;let n=k6(I6(1+t,this.context.depth))-1;return-P6(this.totalWeight*n,C6)||0}};function M6(e){return e!=null&&typeof e=="object"&&!("generate"in e)&&!("arbitrary"in e)&&!("weight"in e)}function Dy(e){return Mg(e)?{arbitrary:e,weight:1}:e}function Ee(...e){let t=e[0];if(M6(t)){let r=W(Te(e,1),Dy);return Iu.from(r,t,"fc.oneof")}let n=W(e,Dy);return Iu.from(n,{},"fc.oneof")}var T6=Number.isInteger;function on(e){let t=typeof e=="number"?e:e&&e.max!==void 0?e.max:2147483647;if(t<0)throw new Error("fc.nat value should be greater than or equal to 0");if(!T6(t))throw new Error("fc.nat maximum value should be an integer");return new Qn(0,t)}var O6=Object.is;function N6(e){let t=0,n=[];for(let r of e){let i=t;t=i+r.num;let o=t-1;n.push({from:i,to:o,entry:r})}return n}function $6(e,t){let n=0,r=e.length;for(;r-n>1;){let i=~~((n+r)/2);t<e[i].from?r=i:n=i}return e[n]}function L6(e){let t=N6(e);return function(r){let i=$6(t,r);return i.entry.build(r-i.from)}}function _6(e){let t={mapping:new jt,negativeZeroIndex:void 0},n=0;for(let r=0;r!==e.length;++r){let i=e[r];for(let o=0;o!==i.num;++o){let s=i.build(o);s===0&&1/s===Bt.NEGATIVE_INFINITY?t.negativeZeroIndex=n:dt(t.mapping,s,n),++n}}return t}function D6(e){let t=null;return function(r){t===null&&(t=_6(e));let i=O6(r,-0)?t.negativeZeroIndex:Xe(t.mapping,r);if(i===void 0)throw new M("Unknown value encountered cannot be built using this mapToConstant");return i}}function F6(e){if(e.length===0)throw new M("fc.mapToConstant expects at least one option");let t=0;for(let n=0;n!==e.length;++n){if(e[n].num<0)throw new M("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");t+=e[n].num}if(t===0)throw new M("fc.mapToConstant expects at least one choice among options");return t}function er(...e){return on({max:F6(e)-1}).map(L6(e),D6(e))}function Rb(e,t,n,r){if(t.length===0)return n>0?void 0:[];if(r<=0)return;let i=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];for(;i.length>0;){let o=Fg(i);for(let s=o.nextStartIndex;s<=t.length;++s){let a=he(t,o.endIndexChunks,s);if(e.canShrinkWithoutContext(a)){let l=[...o.chunks,a];if(s===t.length){if(l.length<n)break;return l}T(i,{endIndexChunks:o.endIndexChunks,nextStartIndex:s+1,chunks:o.chunks}),l.length<r&&T(i,{endIndexChunks:s,nextStartIndex:s+1,chunks:l});break}}}}function B6(e){return ae(e,"")}function Ab(e){return e.minLength!==void 0?e.minLength:0}function Cb(e){return e.maxLength!==void 0?e.maxLength:xn}function j6(e,t){return Ab(t)<=e.length&&e.length<=Cb(t)}function U6(e,t){return function(r){if(typeof r!="string")throw new M("Unsupported value");let i=Rb(e,r,Ab(t),Cb(t));if(i===void 0)throw new M("Unable to unmap received string");return i}}var Eb=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function V6(e,t,n){let r;try{r=n(e)}catch{return}for(let i of r)if(!t.canShrinkWithoutContext(i))return;return r}function W6(e,t){let n=[];for(let r of Eb){let i=V6(r,e,t);i!==void 0&&T(n,i)}return n}var Fy=new WeakMap;function z6(e){let t=[];for(let n of Eb){let r=Rb(e,n,0,xn);r!==void 0&&T(t,r)}return t}function G6(e,t){let n=W2(Fy,e);n===void 0&&(n=z6(e),V2(Fy,e,n));let r=[];for(let i of n)j6(i,t)&&T(r,i);return r}var H6=[[0,127]],q6=[[0,55295],[57344,1114111]],K6=[[32,126],[160,172],[174,767],[880,887],[890,895],[900,906],[908],[910,929],[931,1154],[1162,1327],[1329,1366],[1369,1418],[1421,1423],[1470],[1472],[1475],[1478],[1488,1514],[1519,1524],[1542,1551],[1563],[1565,1610],[1632,1647],[1649,1749],[1758],[1765,1766],[1769],[1774,1805],[1808],[1810,1839],[1869,1957],[1969],[1984,2026],[2036,2042],[2046,2069],[2074],[2084],[2088],[2096,2110],[2112,2136],[2142],[2144,2154],[2160,2190],[2208,2249],[2308,2361],[2365],[2384],[2392,2401],[2404,2432],[2437,2444],[2447,2448],[2451,2472],[2474,2480],[2482],[2486,2489],[2493],[2510],[2524,2525],[2527,2529],[2534,2557],[2565,2570],[2575,2576],[2579,2600],[2602,2608],[2610,2611],[2613,2614],[2616,2617],[2649,2652],[2654],[2662,2671],[2674,2676],[2678],[2693,2701],[2703,2705],[2707,2728],[2730,2736],[2738,2739],[2741,2745],[2749],[2768],[2784,2785],[2790,2801],[2809],[2821,2828],[2831,2832],[2835,2856],[2858,2864],[2866,2867],[2869,2873],[2877],[2908,2909],[2911,2913],[2918,2935],[2947],[2949,2954],[2958,2960],[2962,2965],[2969,2970],[2972],[2974,2975],[2979,2980],[2984,2986],[2990,3001],[3024],[3046,3066],[3077,3084],[3086,3088],[3090,3112],[3114,3129],[3133],[3160,3162],[3165],[3168,3169],[3174,3183],[3191,3200],[3204,3212],[3214,3216],[3218,3240],[3242,3251],[3253,3257],[3261],[3293,3294],[3296,3297],[3302,3311],[3313,3314],[3332,3340],[3342,3344],[3346,3386],[3389],[3407],[3412,3414],[3416,3425],[3430,3455],[3461,3478],[3482,3505],[3507,3515],[3517],[3520,3526],[3558,3567],[3572],[3585,3632],[3634],[3647,3654],[3663,3675],[3713,3714],[3716],[3718,3722],[3724,3747],[3749],[3751,3760],[3762],[3773],[3776,3780],[3782],[3792,3801],[3804,3807],[3840,3863],[3866,3892],[3894],[3896],[3898,3901],[3904,3911],[3913,3948],[3973],[3976,3980],[4030,4037],[4039,4044],[4046,4058],[4096,4138],[4159,4181],[4186,4189],[4193],[4197,4198],[4206,4208],[4213,4225],[4238],[4240,4249],[4254,4293],[4295],[4301],[4304,4351],[4608,4680],[4682,4685],[4688,4694],[4696],[4698,4701],[4704,4744],[4746,4749],[4752,4784],[4786,4789],[4792,4798],[4800],[4802,4805],[4808,4822],[4824,4880],[4882,4885],[4888,4954],[4960,4988],[4992,5017],[5024,5109],[5112,5117],[5120,5788],[5792,5880],[5888,5905],[5919,5937],[5941,5942],[5952,5969],[5984,5996],[5998,6e3],[6016,6067],[6100,6108],[6112,6121],[6128,6137],[6144,6154],[6160,6169],[6176,6264],[6272,6276],[6279,6312],[6314],[6320,6389],[6400,6430],[6464],[6468,6509],[6512,6516],[6528,6571],[6576,6601],[6608,6618],[6622,6678],[6686,6740],[6784,6793],[6800,6809],[6816,6829],[6917,6963],[6981,6988],[6992,7018],[7028,7038],[7043,7072],[7086,7141],[7164,7203],[7227,7241],[7245,7304],[7312,7354],[7357,7367],[7379],[7401,7404],[7406,7411],[7413,7414],[7418],[7424,7615],[7680,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8061],[8064,8116],[8118,8132],[8134,8147],[8150,8155],[8157,8175],[8178,8180],[8182,8190],[8192,8202],[8208,8233],[8239,8287],[8304,8305],[8308,8334],[8336,8348],[8352,8384],[8448,8587],[8592,9254],[9280,9290],[9312,11123],[11126,11157],[11159,11502],[11506,11507],[11513,11557],[11559],[11565],[11568,11623],[11631,11632],[11648,11670],[11680,11686],[11688,11694],[11696,11702],[11704,11710],[11712,11718],[11720,11726],[11728,11734],[11736,11742],[11776,11869],[11904,11929],[11931,12019],[12032,12245],[12272,12329],[12336,12351],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12771],[12783,12830],[12832,13312],[19903,19968],[40959,42124],[42128,42182],[42192,42539],[42560,42606],[42611],[42622,42653],[42656,42735],[42738,42743],[42752,42954],[42960,42961],[42963],[42965,42969],[42994,43009],[43011,43013],[43015,43018],[43020,43042],[43048,43051],[43056,43065],[43072,43127],[43138,43187],[43214,43225],[43250,43262],[43264,43301],[43310,43334],[43359],[43396,43442],[43457,43469],[43471,43481],[43486,43492],[43494,43518],[43520,43560],[43584,43586],[43588,43595],[43600,43609],[43612,43642],[43646,43695],[43697],[43701,43702],[43705,43709],[43712],[43714],[43739,43754],[43760,43764],[43777,43782],[43785,43790],[43793,43798],[43808,43814],[43816,43822],[43824,43883],[43888,44002],[44011],[44016,44025],[44032],[55203],[63744,64109],[64112,64217],[64256,64262],[64275,64279],[64285],[64287,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64450],[64467,64911],[64914,64967],[64975],[65008,65023],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65136,65140],[65142,65276],[65281,65437],[65440,65470],[65474,65479],[65482,65487],[65490,65495],[65498,65500],[65504,65510],[65512,65518],[65532,65533],[65536,65547],[65549,65574],[65576,65594],[65596,65597],[65599,65613],[65616,65629],[65664,65786],[65792,65794],[65799,65843],[65847,65934],[65936,65948],[65952],[66e3,66044],[66176,66204],[66208,66256],[66273,66299],[66304,66339],[66349,66378],[66384,66421],[66432,66461],[66463,66499],[66504,66517],[66560,66717],[66720,66729],[66736,66771],[66776,66811],[66816,66855],[66864,66915],[66927,66938],[66940,66954],[66956,66962],[66964,66965],[66967,66977],[66979,66993],[66995,67001],[67003,67004],[67072,67382],[67392,67413],[67424,67431],[67456,67461],[67463,67504],[67506,67514],[67584,67589],[67592],[67594,67637],[67639,67640],[67644],[67647,67669],[67671,67742],[67751,67759],[67808,67826],[67828,67829],[67835,67867],[67871,67897],[67903],[67968,68023],[68028,68047],[68050,68096],[68112,68115],[68117,68119],[68121,68149],[68160,68168],[68176,68184],[68192,68255],[68288,68324],[68331,68342],[68352,68405],[68409,68437],[68440,68466],[68472,68497],[68505,68508],[68521,68527],[68608,68680],[68736,68786],[68800,68850],[68858,68899],[68912,68921],[69216,69246],[69248,69289],[69293],[69296,69297],[69376,69415],[69424,69445],[69457,69465],[69488,69505],[69510,69513],[69552,69579],[69600,69622],[69635,69687],[69703,69709],[69714,69743],[69745,69746],[69749],[69763,69807],[69819,69820],[69822,69825],[69840,69864],[69872,69881],[69891,69926],[69942,69956],[69959],[69968,70002],[70004,70006],[70019,70066],[70081],[70084,70088],[70093],[70096,70111],[70113,70132],[70144,70161],[70163,70187],[70200,70205],[70207,70208],[70272,70278],[70280],[70282,70285],[70287,70301],[70303,70313],[70320,70366],[70384,70393],[70405,70412],[70415,70416],[70419,70440],[70442,70448],[70450,70451],[70453,70457],[70461],[70480],[70493,70497],[70656,70708],[70727,70747],[70749],[70751,70753],[70784,70831],[70852,70855],[70864,70873],[71040,71086],[71105,71131],[71168,71215],[71233,71236],[71248,71257],[71264,71276],[71296,71338],[71352,71353],[71360,71369],[71424,71450],[71472,71494],[71680,71723],[71739],[71840,71922],[71935,71942],[71945],[71948,71955],[71957,71958],[71960,71983],[72004,72006],[72016,72025],[72096,72103],[72106,72144],[72161,72163],[72192],[72203,72242],[72255,72262],[72272],[72284,72323],[72346,72354],[72368,72440],[72448,72457],[72704,72712],[72714,72750],[72768,72773],[72784,72812],[72816,72847],[72960,72966],[72968,72969],[72971,73008],[73040,73049],[73056,73061],[73063,73064],[73066,73097],[73112],[73120,73129],[73440,73458],[73463,73464],[73476,73488],[73490,73523],[73539,73561],[73648],[73664,73713],[73727,74649],[74752,74862],[74864,74868],[74880,75075],[77712,77810],[77824,78895],[78913,78918],[82944,83526],[92160,92728],[92736,92766],[92768,92777],[92782,92862],[92864,92873],[92880,92909],[92917],[92928,92975],[92983,92997],[93008,93017],[93019,93025],[93027,93047],[93053,93071],[93760,93850],[93952,94026],[94032],[94099,94111],[94176,94179],[94208],[100343],[100352,101589],[101632],[101640],[110576,110579],[110581,110587],[110589,110590],[110592,110882],[110898],[110928,110930],[110933],[110948,110951],[110960,111355],[113664,113770],[113776,113788],[113792,113800],[113808,113817],[113820],[113823],[118608,118723],[118784,119029],[119040,119078],[119081,119140],[119146,119148],[119171,119172],[119180,119209],[119214,119274],[119296,119361],[119365],[119488,119507],[119520,119539],[119552,119638],[119648,119672],[119808,119892],[119894,119964],[119966,119967],[119970],[119973,119974],[119977,119980],[119982,119993],[119995],[119997,120003],[120005,120069],[120071,120074],[120077,120084],[120086,120092],[120094,120121],[120123,120126],[120128,120132],[120134],[120138,120144],[120146,120485],[120488,120779],[120782,121343],[121399,121402],[121453,121460],[121462,121475],[121477,121483],[122624,122654],[122661,122666],[122928,122989],[123136,123180],[123191,123197],[123200,123209],[123214,123215],[123536,123565],[123584,123627],[123632,123641],[123647],[124112,124139],[124144,124153],[124896,124902],[124904,124907],[124909,124910],[124912,124926],[124928,125124],[125127,125135],[125184,125251],[125259],[125264,125273],[125278,125279],[126065,126132],[126209,126269],[126464,126467],[126469,126495],[126497,126498],[126500],[126503],[126505,126514],[126516,126519],[126521],[126523],[126530],[126535],[126537],[126539],[126541,126543],[126545,126546],[126548],[126551],[126553],[126555],[126557],[126559],[126561,126562],[126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[126704,126705],[126976,127019],[127024,127123],[127136,127150],[127153,127167],[127169,127183],[127185,127221],[127232,127405],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127994],[128e3,128727],[128732,128748],[128752,128764],[128768,128886],[128891,128985],[128992,129003],[129008],[129024,129035],[129040,129095],[129104,129113],[129120,129159],[129168,129197],[129200,129201],[129280,129619],[129632,129645],[129648,129660],[129664,129672],[129680,129725],[129727,129733],[129742,129755],[129760,129768],[129776,129784],[129792,129938],[129940,129994],[130032,130041],[131072],[173791],[173824],[177977],[177984],[178205],[178208],[183969],[183984],[191456],[191472],[192093],[194560,195101],[196608],[201546],[201552],[205743]],Y6=[[192,197],[199,207],[209,214],[217,221],[224,229],[231,239],[241,246],[249,253],[255,271],[274,293],[296,304],[308,311],[313,318],[323,328],[332,337],[340,357],[360,382],[416,417],[431,432],[461,476],[478,483],[486,496],[500,501],[504,539],[542,543],[550,563],[901,902],[904,906],[908],[910,912],[938,944],[970,974],[979,980],[1024,1025],[1027],[1031],[1036,1038],[1049],[1081],[1104,1105],[1107],[1111],[1116,1118],[1142,1143],[1217,1218],[1232,1235],[1238,1239],[1242,1247],[1250,1255],[1258,1269],[1272,1273],[1570,1574],[1728],[1730],[1747],[2345],[2353],[2356],[2392,2399],[2524,2525],[2527],[2611],[2614],[2649,2651],[2654],[2908,2909],[2964],[3907],[3917],[3922],[3927],[3932],[3945],[4134],[6918],[6920],[6922],[6924],[6926],[6930],[7680,7833],[7835],[7840,7929],[7936,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8048],[8050],[8052],[8054],[8056],[8058],[8060],[8064,8116],[8118,8122],[8124],[8129,8132],[8134,8136],[8138],[8140,8146],[8150,8154],[8157,8162],[8164,8170],[8172,8173],[8178,8180],[8182,8184],[8186],[8188],[8602,8603],[8622],[8653,8655],[8708],[8713],[8716],[8740],[8742],[8769],[8772],[8775],[8777],[8800],[8802],[8813,8817],[8820,8821],[8824,8825],[8832,8833],[8836,8837],[8840,8841],[8876,8879],[8928,8931],[8938,8941],[10972],[12364],[12366],[12368],[12370],[12372],[12374],[12376],[12378],[12380],[12382],[12384],[12386],[12389],[12391],[12393],[12400,12401],[12403,12404],[12406,12407],[12409,12410],[12412,12413],[12436],[12446],[12460],[12462],[12464],[12466],[12468],[12470],[12472],[12474],[12476],[12478],[12480],[12482],[12485],[12487],[12489],[12496,12497],[12499,12500],[12502,12503],[12505,12506],[12508,12509],[12532],[12535,12538],[12542],[44032],[55203],[64285],[64287],[64298,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64334],[69786],[69788],[69803],[119134,119140],[119227,119232]],By=String.fromCodePoint,Z6=Math.min,J6=Math.max;function Pu(e){if(e.length===1){let n=By(e[0]);return{num:1,build:()=>n}}let t=e[0];return{num:e[1]-e[0]+1,build:n=>By(t+n)}}function jy(e,t){let n=[],r=0,i=0;for(;r<e.length&&i<t.length;){let o=e[r],s=o[0],a=o.length===1?o[0]:o[1],l=t[i],u=l[0],c=l.length===1?l[0]:l[1];if(a<u)r+=1;else if(c<s)i+=1;else{let d=J6(s,u),f=Z6(a,c);if(n.length>=1){let p=n[n.length-1];(p.length===1?p[0]:p[1])+1===d&&(d=p[0],Fg(n))}T(n,d===f?[d]:[d,f]),a<=f&&(r+=1),c<=f&&(i+=1)}}return n}var Uy=Object.create(null);function X6(e){switch(e){case"full":return q6;case"ascii":return H6}}function Q6(e,t){let n=`${e}:${t}`,r=Uy[n];if(r!==void 0)return r;let i=X6(t),o=e==="binary"?i:jy(i,K6),s=[];for(let l of o)T(s,Pu(l));if(e==="grapheme"){let l=jy(i,Y6);for(let u of l){let c=Pu(u);T(s,{num:c.num,build:d=>aI(c.build(d),"NFD")})}}let a=er(...s);return Uy[n]=a,a}function qr(e,t){return Q6(e,t)}function e4(e){if(typeof e.unit=="object")return e.unit;switch(e.unit){case"grapheme":return qr("grapheme","full");case"grapheme-composite":return qr("composite","full");case"grapheme-ascii":case void 0:return qr("grapheme","ascii");case"binary":return qr("binary","full");case"binary-ascii":return qr("binary","ascii")}}function Ae(e={}){let t=e4(e),n=U6(t,e),r=G6(t,e);return oe(t,{...e,experimentalCustomSlices:r}).map(B6,n)}var kb=Map,lc=String.fromCharCode,uc={num:26,build:e=>lc(e+97)},t4={num:26,build:e=>lc(e+65)},Ib={num:10,build:e=>lc(e+48)};function n4(e){let t=w2(e);return e!==t?t:`%${Jr(Jn(e,0),16)}`}function r4(e){if(typeof e!="string")throw new Error("Unsupported");return decodeURIComponent(e)}var i4=()=>Ae({unit:"binary",minLength:1,maxLength:1}).map(n4,r4),ou;function o4(){return ou===void 0&&(ou=er(uc)),ou}var To;function Mu(e){To===void 0&&(To=new kb);let t=Xe(To,e);return t===void 0&&(t=er(uc,Ib,{num:e.length,build:n=>e[n]}),dt(To,e,t)),t}function s4(e){return er(uc,t4,Ib,{num:e.length,build:t=>e[t]})}var Oo;function cc(e){Oo===void 0&&(Oo=new kb);let t=Xe(Oo,e);return t===void 0&&(t=Ee({weight:10,arbitrary:s4(e)},{weight:1,arbitrary:i4()}),dt(Oo,e,t)),t}function Vt(e,t={}){let n=t.freq===void 0?6:t.freq,r=Vg(t,"nil")?t.nil:null,i=[{arbitrary:Se(r),weight:1,fallbackValue:{default:r}},{arbitrary:e,weight:n-1}],o={withCrossShrink:!0,depthSize:t.depthSize,maxDepth:t.maxDepth,depthIdentifier:t.depthIdentifier};return Iu.from(i,o,"fc.option")}function a4(e){return e.length>63?!1:e.length<4||e[0]!=="x"||e[1]!=="n"||e[2]!=="-"||e[3]!=="-"}var Pb=Symbol("adapted-value");function l4(e,t){let n=t(e.value_);return n.adapted?new O(n.value,Pb):e}var u4=class extends le{constructor(e,t){super(),this.sourceArb=e,this.adapter=t,this.adaptValue=n=>l4(n,t)}generate(e,t){let n=this.sourceArb.generate(e,t);return this.adaptValue(n)}canShrinkWithoutContext(e){return this.sourceArb.canShrinkWithoutContext(e)&&!this.adapter(e).adapted}shrink(e,t){return t===Pb?this.sourceArb.canShrinkWithoutContext(e)?this.sourceArb.shrink(e,void 0).map(this.adaptValue):D.nil():this.sourceArb.shrink(e,t).map(this.adaptValue)}};function Mb(e,t){return new u4(e,t)}function c4([e,t]){return t===null?e:`${e}${t[0]}${t[1]}`}function d4(e){if(typeof e!="string"||e.length===0)throw new Error("Unsupported");return e.length===1?[e[0],null]:[e[0],[he(e,1,e.length-1),e[e.length-1]]]}function f4(e){let t=Mu("");return F(t,Vt(F(Ae({unit:Mu("-"),size:e,maxLength:61}),t))).map(c4,d4).filter(a4)}function h4(e){return`${ae(e[0],".")}.${e[1]}`}function p4(e){if(typeof e!="string")throw new Error("Unsupported type");let t=e.lastIndexOf(".");return[je(he(e,0,t),"."),he(e,t+1)]}function m4(e){let[t,n]=e,r=n.length;for(let i=0;i!==t.length;++i)if(r+=1+t[i].length,r>255)return{adapted:!0,value:[Te(t,0,i),n]};return{adapted:!1,value:e}}function dc(e={}){let t=sc(e.size),n=ti("-1",t),r=Ae({unit:o4(),minLength:2,maxLength:63,size:n});return Mb(F(oe(f4(t),{size:n,minLength:1,maxLength:127}),r),m4).map(h4,p4)}function y4(e){let t=e[0].length;for(let n=1;n!==e.length;++n)if(t+=1+e[n].length,t>64)return{adapted:!0,value:Te(e,0,n)};return{adapted:!1,value:e}}function g4(e){return ae(e,".")}function b4(e){if(typeof e!="string")throw new Error("Unsupported");return je(e,".")}function S4(e){return`${e[0]}@${e[1]}`}function w4(e){if(typeof e!="string")throw new Error("Unsupported");return je(e,"@",2)}function x4(e={}){return F(Mb(oe(Ae({unit:Mu("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:e.size}),{minLength:1,maxLength:32,size:e.size}),y4).map(g4,b4),dc({size:e.size})).map(S4,w4)}var v4=Bt.NEGATIVE_INFINITY,Tu=Bt.POSITIVE_INFINITY,Tb=Bt.EPSILON,fc=k(2146435072)*k(4294967296),R4=-fc-k(1),Vy=4503599627370496,A4=k(0xfffffffffffff),Wy=k("9007199254740992"),Ou=new Float64Array(1),zy=new Uint32Array(Ou.buffer,Ou.byteOffset);function C4(e){return Ou[0]=e,[zy[1],zy[0]]}function E4(e){let{0:t,1:n}=C4(e),r=t>>>31,i=t>>>20&2047,o=(t&1048575)*4294967296+n,s=i===0?-1022:i-1023,a=i===0?0:1;return a+=o*Tb,a*=r===0?1:-1,{exponent:s,significand:a}}function Gy(e,t){return e===-1022?k(t*Vy):k((t-1)*Vy)+(k(e+1023)<<k(52))}function hc(e){if(e===Tu)return fc;if(e===v4)return R4;let t=E4(e),n=t.exponent,r=t.significand;return e>0||e===0&&1/e===Tu?Gy(n,r):-Gy(n,-r)-k(1)}function Nu(e){if(e<0)return-Nu(-e-k(1));if(e===fc)return Tu;if(e<Wy)return Bt(e)*2**-1074;let t=e-Wy,n=-1021+Bt(t>>k(52));return(1+Bt(t&A4)*Tb)*2**n}var Hy=Number.isInteger,qy=Object.is,su=Number.NEGATIVE_INFINITY,au=Number.POSITIVE_INFINITY;function Ob(e,t,n,r){let{noDefaultInfinity:i=!1,minExcluded:o=!1,maxExcluded:s=!1,min:a=i?-t:su,max:l=i?t:au}=e,u=o?a<-n?-r:Math.max(a,-n):a===su?Math.max(a,-r):Math.max(a,-n),c=s?l>n?r:Math.min(l,n):l===au?Math.min(l,r):Math.min(l,n);return{noDefaultInfinity:!1,minExcluded:o||(a!==su||o)&&Hy(u),maxExcluded:s||(l!==au||s)&&Hy(c),min:qy(u,-0)?0:u,max:qy(c,0)?-0:c,noNaN:e.noNaN||!1}}var Nb=Number.NEGATIVE_INFINITY,$b=Number.POSITIVE_INFINITY,k4=Number.MAX_VALUE,I4=45035996273704955e-1,$u=4503599627370496;function P4(e){return Ob(e,k4,I4,$u)}function M4(e){return e===4503599627370496?$b:e===-4503599627370496?Nb:e}function T4(e){if(typeof e!="number")throw new Error("Unsupported type");return e===$b?$u:e===Nb?-$u:e}var O4=Number.isInteger,Lb=Number.isNaN,N4=Number.NEGATIVE_INFINITY,$4=Number.POSITIVE_INFINITY,Ky=Number.MAX_VALUE,L4=NaN;function Yy(e,t){if(Lb(e))throw new Error("fc.double constraints."+t+" must be a 64-bit float");return hc(e)}function _4(e){if(typeof e!="number")throw new Error("Unsupported type");return hc(e)}function D4(e){return!O4(e)}function Zy(e){let{noDefaultInfinity:t=!1,noNaN:n=!1,minExcluded:r=!1,maxExcluded:i=!1,min:o=t?-Ky:N4,max:s=t?Ky:$4}=e,a=Yy(o,"min"),l=r?a+k(1):a,u=Yy(s,"max"),c=i?u-k(1):u;if(c<l)throw new Error("fc.double constraints.min must be smaller or equal to constraints.max");if(n)return ln({min:l,max:c}).map(Nu,_4);let d=c>k(0),f=d?l:l-k(1),p=d?c+k(1):c;return ln({min:f,max:p}).map(h=>c<h||h<l?L4:Nu(h),h=>{if(typeof h!="number")throw new Error("Unsupported type");return Lb(h)?c!==p?p:f:hc(h)})}function Jo(e={}){return e.noInteger?Zy(P4(e)).map(M4,T4).filter(D4):Zy(e)}var F4=Number.NEGATIVE_INFINITY,Lu=Number.POSITIVE_INFINITY,B4=Math.imul,_u=2**127*(1+(2**23-1)/2**23),_b=2139095040,j4=-2139095041,Du=new Float32Array(1),U4=new Uint32Array(Du.buffer,Du.byteOffset);function V4(e){return Du[0]=e,U4[0]}function W4(e){let t=V4(e),n=t>>>31,r=t>>>23&255,i=t&8388607,o=r===0?-126:r-127,s=r===0?0:1;return s+=i/2**23,s*=n===0?1:-1,{exponent:o,significand:s}}function Jy(e,t){return e===-126?t*8388608:B4(e+127,8388608)+(t-1)*8388608}function pc(e){if(e===Lu)return _b;if(e===F4)return j4;let t=W4(e),n=t.exponent,r=t.significand;return e>0||e===0&&1/e===Lu?Jy(n,r):-Jy(n,-r)-1}function Fu(e){if(e<0)return-Fu(-e-1);if(e===_b)return Lu;if(e<16777216)return e*2**-149;let t=e-16777216,n=-125+(t>>23);return(1+(t&8388607)/8388608)*2**n}var Db=Number.NEGATIVE_INFINITY,Fb=Number.POSITIVE_INFINITY,z4=_u,G4=83886075e-1,Bu=8388608;function H4(e){return Ob(e,z4,G4,Bu)}function q4(e){return e===8388608?Fb:e===-8388608?Db:e}function K4(e){if(typeof e!="number")throw new Error("Unsupported type");return e===Fb?Bu:e===Db?-Bu:e}var Y4=Number.isInteger,Bb=Number.isNaN,Z4=Math.fround,J4=Number.NEGATIVE_INFINITY,X4=Number.POSITIVE_INFINITY,Q4=NaN;function Xy(e,t){let n="fc.float constraints."+t+" must be a 32-bit float - you can convert any double to a 32-bit float by using `Math.fround(myDouble)`";if(Bb(e)||Z4(e)!==e)throw new Error(n);return pc(e)}function eM(e){if(typeof e!="number")throw new Error("Unsupported type");return pc(e)}function tM(e){return!Y4(e)}function Qy(e){let{noDefaultInfinity:t=!1,noNaN:n=!1,minExcluded:r=!1,maxExcluded:i=!1,min:o=t?-_u:J4,max:s=t?_u:X4}=e,a=Xy(o,"min"),l=r?a+1:a,u=Xy(s,"max"),c=i?u-1:u;if(l>c)throw new Error("fc.float constraints.min must be smaller or equal to constraints.max");if(n)return X({min:l,max:c}).map(Fu,eM);let d=c>0?l:l-1,f=c>0?c+1:c;return X({min:d,max:f}).map(p=>p>c||p<l?Q4:Fu(p),p=>{if(typeof p!="number")throw new Error("Unsupported type");return Bb(p)?c!==f?f:d:pc(p)})}function jb(e={}){return e.noInteger?Qy(H4(e)).map(q4,K4).filter(tM):Qy(e)}function nM(e){return e.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function Ub(e){return e.replace(/\*\//g,"*\\/")}var Ze=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function Ko(e){let t=4294967295;for(let n=0;n<e.length;++n){let r=Jn(e,n);if(r<128)t=Ze[t&255^r]^t>>8;else if(r<2048)t=Ze[t&255^(192|r>>6&31)]^t>>8,t=Ze[t&255^(128|r&63)]^t>>8;else if(r>=55296&&r<57344){let i=Jn(e,++n);if(r>=56320||i<56320||i>57343||Number.isNaN(i))n-=1,t=Ze[t&255^239]^t>>8,t=Ze[t&255^191]^t>>8,t=Ze[t&255^189]^t>>8;else{let o=(r&1023)+64,s=i&1023;t=Ze[t&255^(240|o>>8&7)]^t>>8,t=Ze[t&255^(128|o>>2&63)]^t>>8,t=Ze[t&255^(128|s>>6&15|(o&3)<<4)]^t>>8,t=Ze[t&255^(128|s&63)]^t>>8}}else t=Ze[t&255^(224|r>>12&15)]^t>>8,t=Ze[t&255^(128|r>>6&63)]^t>>8,t=Ze[t&255^(128|r&63)]^t>>8}return(t|0)+2147483648}var rM=Object.getPrototypeOf,Kr=class extends le{constructor(e){super(),this.arb=e}generate(e,t){return this.arb.generate(e,t)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return D.nil()}};function Yo(e){return rM(e)===Kr.prototype&&e.generate===Kr.prototype.generate&&e.canShrinkWithoutContext===Kr.prototype.canShrinkWithoutContext&&e.shrink===Kr.prototype.shrink?e:new Kr(e)}var iM=Object.assign,oM=Object.keys;function Vb(e){return F(Yo(X()),Yo(X({min:1,max:4294967295}))).map(([t,n])=>{let r=()=>{let i={};return iM((s,a)=>{let l=we(s),u=we(a),c=e(Ko(`${t}${l}`)%n,Ko(`${t}${u}`)%n);return i[`[${l},${u}]`]=c,c},{toString:()=>{let s=oM(i).sort().map(a=>`${a} => ${we(i[a])}`).map(a=>`/* ${Ub(a)} */`);return`function(a, b) {
|
|
69
|
+
// With hash and stringify coming from fast-check${s.length!==0?`
|
|
70
|
+
${ae(s,`
|
|
71
|
+
`)}`:""}
|
|
72
|
+
const cmp = ${e};
|
|
73
|
+
const hA = hash('${t}' + stringify(a)) % ${n};
|
|
74
|
+
const hB = hash('${t}' + stringify(b)) % ${n};
|
|
75
|
+
return cmp(hA, hB);
|
|
76
|
+
}`},[ke]:r})};return r()})}var sM=Object.assign;function aM(){return Vb(sM((e,t)=>e<t,{toString(){return"(hA, hB) => hA < hB"}}))}var lM=Object.assign;function uM(){return Vb(lM((e,t)=>e-t,{toString(){return"(hA, hB) => hA - hB"}}))}var cM=Object.defineProperties,dM=Object.keys;function fM(e){return F(oe(e,{minLength:1}),Yo(X())).map(([t,n])=>{let r=()=>{let i={},o=(...a)=>{let l=we(a),u=t[Ko(`${n}${l}`)%t.length];return i[l]=u,wn(u)?u[ke]():u};function s(a){let l=W(W(jg(dM(i)),u=>`${u} => ${we(i[u])}`),u=>`/* ${Ub(u)} */`);return`function(...args) {
|
|
77
|
+
// With hash and stringify coming from fast-check${l.length!==0?`
|
|
78
|
+
${l.join(`
|
|
79
|
+
`)}`:""}
|
|
80
|
+
const outs = ${a};
|
|
81
|
+
return outs[hash('${n}' + stringify(args)) % outs.length];
|
|
82
|
+
}`}return cM(o,{toString:{value:()=>s(we(t))},[ht]:{value:()=>s(we(t))},[Ut]:{value:async()=>s(await ec(t))},[ke]:{value:r,configurable:!0}})};return r()})}var hM=Number.MIN_SAFE_INTEGER,pM=Number.MAX_SAFE_INTEGER;function Wb(){return new Qn(hM,pM)}var mM=Number.MAX_SAFE_INTEGER;function yM(){return new Qn(0,mM)}var gM=Number.parseInt;function bM(e){let[t,n]=e;switch(t){case"oct":return`0${Jr(n,8)}`;case"hex":return`0x${Jr(n,16)}`;default:return`${n}`}}function Fo(e,t){let n=gM(e,t);if(Jr(n,t)!==e)throw new Error("Invalid value");return n}function SM(e){if(typeof e!="string")throw new Error("Invalid type");return e.length>=2&&e[0]==="0"?e[1]==="x"?["hex",Fo(he(e,2),16)]:["oct",Fo(he(e,1),8)]:["dec",Fo(e,10)]}function wM(e){return ae(e,".")}function xM(e){if(typeof e!="string")throw new Error("Invalid type");return W(je(e,"."),t=>Fo(t,10))}function mc(){return F(on(255),on(255),on(255),on(255)).map(wM,xM)}function Rt(e){return F(At("dec","oct","hex"),on(e)).map(bM,SM)}function lu(e){return ae(e,".")}function uu(e){if(typeof e!="string")throw new Error("Invalid type");return je(e,".")}function zb(){return Ee(F(Rt(255),Rt(255),Rt(255),Rt(255)).map(lu,uu),F(Rt(255),Rt(255),Rt(65535)).map(lu,uu),F(Rt(255),Rt(16777215)).map(lu,uu),Rt(4294967295))}function yc(e){return e.length===0?[]:je(e,":")}function gc(e){let t=je(e,":");return t.length>=2&&t[t.length-1].length<=4?[Te(t,0,t.length-2),`${t[t.length-2]}:${t[t.length-1]}`]:[Te(t,0,t.length-1),t[t.length-1]]}function vM(e){return`${ae(e[0],":")}:${e[1]}`}function RM(e){if(typeof e!="string")throw new Error("Invalid type");return gc(e)}function AM(e){return`::${ae(e[0],":")}:${e[1]}`}function CM(e){if(typeof e!="string")throw new Error("Invalid type");if(!iI(e,"::"))throw new Error("Invalid value");return gc(he(e,2))}function Bo(e){return`${ae(e[0],":")}::${ae(e[1],":")}:${e[2]}`}function jo(e){if(typeof e!="string")throw new Error("Invalid type");let[t,n]=je(e,"::",2),[r,i]=gc(n);return[yc(t),r,i]}function EM(e){return Bo([e[0],[e[1]],e[2]])}function kM(e){let t=jo(e);return[t[0],ae(t[1],":"),t[2]]}function eg(e){return`${ae(e[0],":")}::${e[1]}`}function tg(e){if(typeof e!="string")throw new Error("Invalid type");let[t,n]=je(e,"::",2);return[yc(t),n]}function IM(e){return`${ae(e[0],":")}::`}function PM(e){if(typeof e!="string")throw new Error("Invalid type");if(!oI(e,"::"))throw new Error("Invalid value");return[yc(he(e,0,e.length-2))]}function MM([e,t]){return`${e}:${t}`}function TM(e){if(typeof e!="string")throw new M("Invalid type");if(!e.includes(":"))throw new M("Invalid value");return e.split(":",2)}var OM="0123456789abcdef",cu;function NM(){return cu===void 0&&(cu=X({min:0,max:15}).map(e=>OM[e],e=>{if(typeof e!="string")throw new M("Not a string");if(e.length!==1)throw new M("Invalid length");let t=Jn(e,0);if(t<=57)return t-48;if(t<97)throw new M("Invalid character");return t-87})),cu}function Gb(){let e=Ae({unit:NM(),minLength:1,maxLength:4,size:"max"}),t=Ee(F(e,e).map(MM,TM),mc());return Ee(F(oe(e,{minLength:6,maxLength:6,size:"max"}),t).map(vM,RM),F(oe(e,{minLength:5,maxLength:5,size:"max"}),t).map(AM,CM),F(oe(e,{minLength:0,maxLength:1,size:"max"}),oe(e,{minLength:4,maxLength:4,size:"max"}),t).map(Bo,jo),F(oe(e,{minLength:0,maxLength:2,size:"max"}),oe(e,{minLength:3,maxLength:3,size:"max"}),t).map(Bo,jo),F(oe(e,{minLength:0,maxLength:3,size:"max"}),oe(e,{minLength:2,maxLength:2,size:"max"}),t).map(Bo,jo),F(oe(e,{minLength:0,maxLength:4,size:"max"}),e,t).map(EM,kM),F(oe(e,{minLength:0,maxLength:5,size:"max"}),t).map(eg,tg),F(oe(e,{minLength:0,maxLength:6,size:"max"}),e).map(eg,tg),F(oe(e,{minLength:0,maxLength:7,size:"max"})).map(IM,PM))}var $M=class extends le{constructor(e){super(),this.name=e,this.underlying=null}generate(e,t){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.generate(e,t)}canShrinkWithoutContext(e){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.canShrinkWithoutContext(e)}shrink(e,t){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.shrink(e,t)}},LM=Object.getOwnPropertyNames;function _M(){let e=new jt;return n=>{let r=Xe(e,n);return r!==void 0||(r=new $M(String(n)),dt(e,n,r)),r}}function Hb(e){let t=_M(),n=e(t),r=LM(n);for(let i of r){let o=t(i);o.underlying=n[i]}return n}function DM(e,t){for(let n of e){let r=t[n]||{};if(r.maxLength===void 0||r.maxLength>0)return!0}return!1}function FM(e,t){if(e.length===0)return Se([]);if(!DM(e,t))throw new M("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return F(...e.map(n=>oe(Se(n),t[n]))).map(n=>N2(n)).filter(n=>n.length>0)}var ng=Object.assign,Uo=Object.create,qb=Object.defineProperty,rg=Object.getPrototypeOf,BM=Object.prototype;function jM(e){return qb(Uo(null),ht,{configurable:!1,enumerable:!1,writable:!1,value:()=>e})}function ig(e,t){return jM(`<${Be(e)}#${t}>`)}function UM(e,t){let n=Uo(BM);for(let r in e){let i=e[r],o=[];for(let s of i){let a=ng(Uo(rg(s)),s);o.push(a)}n[r]=o}for(let r in t){let i=t[r];for(let o=0;o!==i.length;++o){let s=i[o],a=n[r][o];for(let l in s){let u=s[l];a[l]=u.index===void 0?void 0:typeof u.index=="number"?n[u.type][u.index]:W(u.index,c=>n[u.type][c])}qb(a,ht,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let l=e[r][o],u=ng(Uo(rg(l)),l);for(let c in s){let d=s[c];u[c]=d.index===void 0?void 0:typeof d.index=="number"?ig(d.type,d.index):W(d.index,f=>ig(d.type,f))}return we(u)}})}}return n}function VM(e){let t=0,n=new jt;for(let i in e){let o=e[i];for(let s in o){let a=o[s];if(a.arity!=="inverse")continue;let l=Xe(n,a.type);if(l===void 0&&(l=new jt,dt(n,a.type,l)),q2(l,a.forwardRelationship))throw new M(`Cannot declare multiple inverse relationships for the same forward relationship ${Be(a.forwardRelationship)} on type ${Be(a.type)}`);dt(l,a.forwardRelationship,{type:i,property:s}),t+=1}}let r=new jt;if(t===0)return r;for(let i in e){let o=e[i],s=Xe(n,i);if(s!==void 0)for(let a in o){let l=o[a];if(l.arity==="inverse")continue;let u=Xe(s,a);if(u!==void 0){if(u.type!==l.type)throw new M(`Inverse relationship ${Be(u.property)} on type ${Be(u.type)} references forward relationship ${Be(a)} but types do not match`);dt(r,l,u)}}}if(r.size!==t)throw new M("Some inverse relationships could not be matched with their corresponding forward relationships");return r}var og=Object.create;function WM(e,t,n){switch(e){case"exclusive":return Se(n);case"successor":return qo(X({min:t!==void 0?t+1:0,max:n}));case"any":return qo(X({min:0,max:n}))}}function zM(e,t,n,r,i,o,s){let a=WM(t,n,r);switch(e){case"0-1":return Vt(a,{nil:void 0,depthIdentifier:i}).generate(o,s).value;case"1":return a.generate(o,s).value;case"many":{let l=0,u=Vt(vn(a,{depthIdentifier:i,selector:d=>d===r?d+ ++l:d,minLength:1}),{nil:[],depthIdentifier:i}).generate(o,s).value,c=0;return W(u,d=>d===r?d+c++:d)}}}var GM=class extends le{constructor(e,t){super(),this.relations=e,this.defaultEntities=t;let n=new Zn,r=new Zn;for(let i in e){let o=e[i];for(let s in o){let a=o[s];if(a.arity!=="inverse"){if(a.strategy==="exclusive"){if(Ho(n,a.type))throw new M(`Cannot mix exclusive with other strategies for type ${Be(a.type)}`);Zr(r,a.type)}else{if(Ho(r,a.type))throw new M(`Cannot mix exclusive with other strategies for type ${Be(a.type)}`);Zr(n,a.type)}if(a.strategy==="successor"&&a.type!==i)throw new M("Cannot mix types for the strategy successor");if(a.strategy==="successor"&&a.arity==="1")throw new M("Cannot use an arity of 1 for the strategy successor")}}}this.inversedRelations=VM(e)}createEmptyLinksInstanceFor(e){let t=og(null),n=this.relations[e];for(let r in n){let i=n[r];i.arity==="inverse"&&(t[r]={type:i.type,index:[]})}return t}generate(e,t){let n=og(null);for(let o in this.relations)n[o]=[];let r=[];for(let o of this.defaultEntities)T(r,{type:o,indexInType:n[o].length,depth:0}),T(n[o],this.createEmptyLinksInstanceFor(o));let i=-1;for(;++i<r.length;){let o=r[i],s=this.relations[o.type],a=n[o.type][o.indexInType],l=ic();l.depth=o.depth;for(let u in s){let c=s[u];if(c.arity==="inverse")continue;let d=c.type,f=n[d],p=f.length,h=zM(c.arity,c.strategy||"any",d===o.type?o.indexInType:void 0,f.length,l,e,t);a[u]={type:d,index:h};let m=h===void 0?[]:typeof h=="number"?[h]:h;for(let y of m){y>=p&&(T(r,{type:d,indexInType:y,depth:o.depth+1}),T(f,this.createEmptyLinksInstanceFor(d)));let S=Xe(this.inversedRelations,c);if(S!==void 0){let w=f[y][S.property].index;T(w,o.indexInType)}}}}return r.length=0,new O(n,void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return D.nil()}};function HM(e,t){return new GM(e,t)}var qM=Object.keys,KM=Object.getOwnPropertySymbols,YM=Object.getOwnPropertyDescriptor;function ZM(e){let t=qM(e),n=KM(e);for(let r=0;r!==n.length;++r){let i=n[r],o=YM(e,i);o&&o.enumerable&&t.push(i)}return t}var JM=Object.create,XM=Object.defineProperty,QM=Object.getOwnPropertyDescriptor,e3=Object.getOwnPropertyNames,t3=Object.getOwnPropertySymbols;function n3(e,t){return function(r){let i=r[1]?JM(null):{};for(let o=0;o!==e.length;++o){let s=r[0][o];s!==t&&XM(i,e[o],{value:s,configurable:!0,enumerable:!0,writable:!0})}return i}}function r3(e,t){return function(r){if(typeof r!="object"||r===null)throw new Error("Incompatible instance received: should be a non-null object");let i=Object.getPrototypeOf(r)===null,o="constructor"in r&&r.constructor===Object;if(!i&&!o)throw new Error("Incompatible instance received: should be of exact type Object");let s=0,a=[];for(let c=0;c!==e.length;++c){let d=QM(r,e[c]);if(d!==void 0){if(!d.configurable||!d.enumerable||!d.writable)throw new Error("Incompatible instance received: should contain only c/e/w properties");if(d.get!==void 0||d.set!==void 0)throw new Error("Incompatible instance received: should contain only no get/set properties");++s,T(a,d.value)}else T(a,t)}let l=e3(r).length,u=t3(r).length;if(s!==l+u)throw new Error("Incompatible instance received: should not contain extra properties");return[a,i]}}var du=Symbol("no-key");function fu(e,t,n){let r=ZM(e),i=[];for(let o=0;o!==r.length;++o){let s=r[o],a=e[s];t===void 0||Ft(t,s)!==-1?T(i,a):T(i,Vt(a,{nil:du}))}return F(F(...i),n?Se(!1):ni()).map(n3(r,du),r3(r,du))}function ju(e,t){let n=t!==void 0&&!!t.noNullPrototype;if(t===void 0||!("requiredKeys"in t&&t.requiredKeys!==void 0))return fu(e,void 0,n);let r=("requiredKeys"in t?t.requiredKeys:void 0)||[];for(let i=0;i!==r.length;++i){let o=Object.getOwnPropertyDescriptor(e,r[i]);if(o===void 0)throw new Error("requiredKeys cannot reference keys that have not been defined in recordModel");if(!o.enumerable)throw new Error("requiredKeys cannot reference keys that are not enumerable in recordModel")}return fu(e,r,n)}var i3=Object.create;function o3(e,t,n,r){let i=i3(null);for(let o in e){let s=e[o],a=ju(s,r),l=t(o),u=n(o),c={minLength:l,maxLength:l};i[o]=u!==void 0?vn(a,{...c,selector:u}):oe(a,c)}return ju(i)}var sg=Object.create,s3=Object.keys;function a3(e,t,n={}){let r=s3(e),i=n.initialPoolConstraints||sg(null),o=n.unicityConstraints||sg(null),s={noNullPrototype:n.noNullPrototype};return FM(r,i).chain(a=>HM(t,a).chain(l=>o3(e,u=>l[u].length,u=>o[u],s).map(u=>UM(u,l))))}function l3(e){return ae(W(e,t=>t[t.length-1]===","?he(t,0,t.length-1):t)," ")}function u3(e){return function(n){if(typeof n!="string")throw new Error("Unsupported type");let r=[];for(let i of je(n," "))if(e.canShrinkWithoutContext(i))T(r,i);else if(e.canShrinkWithoutContext(i+","))T(r,i+",");else throw new Error("Unsupported word");return r}}function c3(e){let t=ae(e," ");return t[t.length-1]===","&&(t=he(t,0,t.length-1)),Yu(t[0])+he(t,1)+"."}function d3(e){return function(n){if(typeof n!="string")throw new Error("Unsupported type");if(n.length<2||n[n.length-1]!=="."||n[n.length-2]===","||Yu(Ru(n[0]))!==n[0])throw new Error("Unsupported value");let r=Ru(n[0])+he(n,1,n.length-1),i=[],o=je(r," ");for(let s=0;s!==o.length;++s){let a=o[s];if(e.canShrinkWithoutContext(a))T(i,a);else if(s===o.length-1&&e.canShrinkWithoutContext(a+","))T(i,a+",");else throw new Error("Unsupported word")}return i}}function f3(e){return ae(e," ")}function h3(e){if(typeof e!="string")throw new Error("Unsupported type");let t=je(e,". ");for(let n=0;n<t.length-1;++n)t[n]+=".";return t}var b=(e,t)=>({arbitrary:Se(e),weight:t});function p3(){return Ee(b("non",6),b("adipiscing",5),b("ligula",5),b("enim",5),b("pellentesque",5),b("in",5),b("augue",5),b("et",5),b("nulla",5),b("lorem",4),b("sit",4),b("sed",4),b("diam",4),b("fermentum",4),b("ut",4),b("eu",4),b("aliquam",4),b("mauris",4),b("vitae",4),b("felis",4),b("ipsum",3),b("dolor",3),b("amet,",3),b("elit",3),b("euismod",3),b("mi",3),b("orci",3),b("erat",3),b("praesent",3),b("egestas",3),b("leo",3),b("vel",3),b("sapien",3),b("integer",3),b("curabitur",3),b("convallis",3),b("purus",3),b("risus",2),b("suspendisse",2),b("lectus",2),b("nec,",2),b("ultricies",2),b("sed,",2),b("cras",2),b("elementum",2),b("ultrices",2),b("maecenas",2),b("massa,",2),b("varius",2),b("a,",2),b("semper",2),b("proin",2),b("nec",2),b("nisl",2),b("amet",2),b("duis",2),b("congue",2),b("libero",2),b("vestibulum",2),b("pede",2),b("blandit",2),b("sodales",2),b("ante",2),b("nibh",2),b("ac",2),b("aenean",2),b("massa",2),b("suscipit",2),b("sollicitudin",2),b("fusce",2),b("tempus",2),b("aliquam,",2),b("nunc",2),b("ullamcorper",2),b("rhoncus",2),b("metus",2),b("faucibus,",2),b("justo",2),b("magna",2),b("at",2),b("tincidunt",2),b("consectetur",1),b("tortor,",1),b("dignissim",1),b("congue,",1),b("non,",1),b("porttitor,",1),b("nonummy",1),b("molestie,",1),b("est",1),b("eleifend",1),b("mi,",1),b("arcu",1),b("scelerisque",1),b("vitae,",1),b("consequat",1),b("in,",1),b("pretium",1),b("volutpat",1),b("pharetra",1),b("tempor",1),b("bibendum",1),b("odio",1),b("dui",1),b("primis",1),b("faucibus",1),b("luctus",1),b("posuere",1),b("cubilia",1),b("curae,",1),b("hendrerit",1),b("velit",1),b("mauris,",1),b("gravida",1),b("ornare",1),b("ut,",1),b("pulvinar",1),b("varius,",1),b("turpis",1),b("nibh,",1),b("eros",1),b("id",1),b("aliquet",1),b("quis",1),b("lobortis",1),b("consectetuer",1),b("morbi",1),b("vehicula",1),b("tortor",1),b("tellus,",1),b("id,",1),b("eu,",1),b("quam",1),b("feugiat,",1),b("posuere,",1),b("iaculis",1),b("lectus,",1),b("tristique",1),b("mollis,",1),b("nisl,",1),b("vulputate",1),b("sem",1),b("vivamus",1),b("placerat",1),b("imperdiet",1),b("cursus",1),b("rutrum",1),b("iaculis,",1),b("augue,",1),b("lacus",1))}function m3(e={}){let{maxCount:t,mode:n="words",size:r}=e;if(t!==void 0&&t<1)throw new Error("lorem has to produce at least one word/sentence");let i=p3();return n==="sentences"?oe(oe(i,{minLength:1,size:"small"}).map(c3,d3(i)),{minLength:1,maxLength:t,size:r}).map(f3,h3):oe(i,{minLength:1,maxLength:t,size:r}).map(l3,u3(i))}function y3(e){return new Map(e)}function g3(e){if(typeof e!="object"||e===null)throw new Error("Incompatible instance received: should be a non-null object");if(!("constructor"in e)||e.constructor!==Map)throw new Error("Incompatible instance received: should be of exact type Map");return Array.from(e)}function b3(e){return e[0]}function Uu(e,t,n={}){return vn(F(e,t),{minLength:n.minKeys,maxLength:n.maxKeys,size:n.size,selector:b3,depthIdentifier:n.depthIdentifier,comparator:"SameValueZero"}).map(y3,g3)}var No=10;function S3(e){let t={};return(n=>{let r=n!==void 0?n:No;if(!Vg(t,r)){let i=No;No=r-1,t[r]=e(r),No=i}return t[r]})}function w3(e){let t=0;for(;e>k(0);)e&k(1)&&++t,e>>=k(1);return t}function x3(e,t){let n=(k(1)<<k(t))-k(1),r=e&n,i=w3(e-r),o=r;for(let s=k(1);s<=n&&i!==0;s<<=k(1))o&s||(o|=s,--i);return o}function $o(e,t){let n=[];for(let r=e.length-1;r!==-1;--r)t(e[r])!==e[r]&&T(n,r);return n}function v3(e,t,n){let r=k(0);for(let i=0,o=k(1);i!==n.length;++i,o<<=k(1))e[n[i]]!==t[n[i]]&&(r|=o);return r}function hu(e,t,n,r){for(let i=0,o=k(1);i!==n.length;++i,o<<=k(1))t&o&&(e[n[i]]=r(e[n[i]]))}var R3=class extends le{constructor(e,t,n){super(),this.stringArb=e,this.toggleCase=t,this.untoggleAll=n}buildContextFor(e,t){return{rawString:e.value,rawStringContext:e.context,flags:t.value,flagsContext:t.context}}generate(e,t){let n=this.stringArb.generate(e,t),r=[...n.value],i=$o(r,this.toggleCase),o=ln(k(0),(k(1)<<k(i.length))-k(1)).generate(e,void 0);return hu(r,o.value,i,this.toggleCase),new O(ae(r,""),this.buildContextFor(n,o))}canShrinkWithoutContext(e){return typeof e!="string"?!1:this.untoggleAll!==void 0?this.stringArb.canShrinkWithoutContext(this.untoggleAll(e)):this.stringArb.canShrinkWithoutContext(e)}shrink(e,t){let n;if(t!==void 0)n=t;else if(this.untoggleAll!==void 0){let o=this.untoggleAll(e),s=[...e],a=[...o];n={rawString:o,rawStringContext:void 0,flags:v3(a,s,$o(a,this.toggleCase)),flagsContext:void 0}}else n={rawString:e,rawStringContext:void 0,flags:k(0),flagsContext:void 0};let r=n.rawString,i=n.flags;return this.stringArb.shrink(r,n.rawStringContext).map(o=>{let s=[...o.value],a=$o(s,this.toggleCase),l=x3(i,a.length);return hu(s,l,a,this.toggleCase),new O(ae(s,""),this.buildContextFor(o,new O(l,void 0)))}).join(sn(()=>{let o=[...r],s=$o(o,this.toggleCase);return ln(k(0),(k(1)<<k(s.length))-k(1)).shrink(i,n.flagsContext).map(a=>{let l=Te(o);return hu(l,a.value,s,this.toggleCase),new O(ae(l,""),this.buildContextFor(new O(r,n.rawStringContext),a))})}))}};function A3(e){let t=Yu(e);return t!==e?t:Ru(e)}function C3(e,t){return new R3(e,t&&t.toggleCase||A3,t&&t.untoggleAll)}function E3(e){return Lg.from(e)}function k3(e){if(!(e instanceof Lg))throw new Error("Unexpected type");return[...e]}function Kb(e={}){return oe(jb(e),e).map(E3,k3)}function I3(e){return _g.from(e)}function P3(e){if(!(e instanceof _g))throw new Error("Unexpected type");return[...e]}function Yb(e={}){return oe(Jo(e),e).map(I3,P3)}function Wt(e,t,n,r,i){let o=r.name,{min:s=t,max:a=n,...l}=e;if(s>a)throw new Error(`Invalid range passed to ${o}: min must be lower than or equal to max`);if(s<t)throw new Error(`Invalid min value passed to ${o}: min must be greater than or equal to ${t}`);if(a>n)throw new Error(`Invalid max value passed to ${o}: max must be lower than or equal to ${n}`);return oe(i({min:s,max:a}),l).map(u=>r.from(u),u=>{if(!(u instanceof r))throw new Error("Invalid type");return[...u]})}function Zb(e={}){return Wt(e,-32768,32767,p2,X)}function Jb(e={}){return Wt(e,-2147483648,2147483647,m2,X)}function Xb(e={}){return Wt(e,-128,127,h2,X)}function Qb(e={}){return Wt(e,0,65535,b2,X)}function e0(e={}){return Wt(e,0,4294967295,S2,X)}function t0(e={}){return Wt(e,0,255,y2,X)}function n0(e={}){return Wt(e,0,255,g2,X)}function M3(e){return e!==void 0}function ag(e){return e.hasToBeCloned?new O(e.value_,{generatorContext:e.context},()=>e.value):new O(e.value_,{generatorContext:e.context})}function lg(e){return e.hasToBeCloned?new O(e.value_,{shrinkerContext:e.context},()=>e.value):new O(e.value_,{shrinkerContext:e.context})}var T3=class extends le{constructor(e,t){super(),this.generatorArbitrary=e,this.shrinkerArbitrary=t}generate(e,t){return ag(this.generatorArbitrary.generate(e,t))}canShrinkWithoutContext(e){return this.shrinkerArbitrary.canShrinkWithoutContext(e)}shrink(e,t){return M3(t)?"generatorContext"in t?this.generatorArbitrary.shrink(e,t.generatorContext).map(ag):this.shrinkerArbitrary.shrink(e,t.shrinkerContext).map(lg):this.shrinkerArbitrary.shrink(e,void 0).map(lg)}};function Vu(e,t,n){let r=X({min:e,max:t});return t===n?r:new T3(r,X({min:e,max:n}))}var O3=Math.min,Wu=Math.max,ug=Ng.isArray,N3=Object.entries;function $3(e){let t=-1;for(let n=0;n!==e.length;++n)t=Wu(t,e[n][0]);return t}function L3(e,t){let n=Ng(e);for(let r=0;r!==t.length;++r){let i=t[r];i[0]<e&&(n[i[0]]=i[1])}return n}function r0(e,t={}){let{size:n,minNumElements:r=0,maxLength:i=xn,maxNumElements:o=i,noTrailingHole:s,depthIdentifier:a}=t,l=Qr(n,Qr(n,r,o,t.maxNumElements!==void 0),i,t.maxLength!==void 0);if(r>i)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if(r>o)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let u=O3(o,i),c=t.maxNumElements!==void 0||n!==void 0?n:"=",d=vn(F(Vu(0,Wu(l-1,0),Wu(i-1,0)),e),{size:c,minLength:r,maxLength:u,selector:f=>f[0],depthIdentifier:a}).map(f=>L3($3(f)+1,f),f=>{if(!ug(f))throw new Error("Not supported entry type");if(s&&f.length!==0&&!(f.length-1 in f))throw new Error("No trailing hole");return W(N3(f),p=>[Number(p[0]),p[1]])});return s||i===r?d:F(d,Vu(r,l,i)).map(f=>{let p=f[0],h=f[1];if(p.length>=h)return p;let m=Te(p);return m.length=h,m},f=>{if(!ug(f))throw new Error("Not supported entry type");return[f,f.length]})}function _3(e){return new Set(e)}function D3(e){if(typeof e!="object"||e===null)throw new Error("Incompatible instance received: should be a non-null object");if(!("constructor"in e)||e.constructor!==Set)throw new Error("Incompatible instance received: should be of exact type Set");return Array.from(e)}function i0(e,t={}){return vn(e,{minLength:t.minLength,maxLength:t.maxLength,size:t.size,depthIdentifier:t.depthIdentifier,comparator:"SameValueZero"}).map(_3,D3)}function F3(e,t,n,r,i,o){return ac(e,t,{maxKeys:n,noNullPrototype:!o,size:r,depthIdentifier:i})}function B3(e){return Ee(Xb(e),t0(e),n0(e),Zb(e),Qb(e),Jb(e),e0(e),Kb(e),Yb(e))}function o0(e){let t=e.values,n=e.depthSize,r=ic(),i=e.maxDepth,o=e.maxKeys,s=e.size,a=Ee(...t,...e.withBigInt?[ln()]:[],...e.withDate?[wb()]:[]);return Hb(l=>({anything:Ee({maxDepth:i,depthSize:n,depthIdentifier:r},a,l("array"),l("object"),...e.withMap?[l("map")]:[],...e.withSet?[l("set")]:[],...e.withObjectString?[l("anything").map(u=>we(u))]:[],...e.withTypedArray?[B3({maxLength:o,size:s})]:[],...e.withSparseArray?[r0(l("anything"),{maxNumElements:o,size:s,depthIdentifier:r})]:[]),keys:e.withObjectString?Ee({arbitrary:e.key,weight:10},{arbitrary:l("anything").map(u=>we(u)),weight:1}):e.key,array:oe(l("anything"),{maxLength:o,size:s,depthIdentifier:r}),set:i0(l("anything"),{maxLength:o,size:s,depthIdentifier:r}),map:Ee(Uu(l("keys"),l("anything"),{maxKeys:o,size:s,depthIdentifier:r}),Uu(l("anything"),l("anything"),{maxKeys:o,size:s,depthIdentifier:r})),object:F3(l("keys"),l("anything"),o,s,r,e.withNullPrototype)})).anything}function j3(e){switch(typeof e){case"boolean":return new $g(e);case"number":return new Bt(e);case"string":return new Be(e);default:return e}}function U3(e){return typeof e!="object"||e===null||!("constructor"in e)?e:e.constructor===$g||e.constructor===Bt||e.constructor===Be?e.valueOf():e}function V3(e){return e.map(j3,U3)}function W3(e,t){return[ni(),Wb(),Jo(),t(e),Ee(t(e),Se(null),Se(void 0))]}function z3(e){return e.map(t=>V3(t))}function G3(e,t){return t?z3(e).concat(e):e}function s0(e={}){let t={size:e.size,unit:"stringUnit"in e?e.stringUnit:e.withUnicodeString?"binary":void 0};return{key:e.key!==void 0?e.key:Ae(t),values:G3(e.values!==void 0?e.values:W3(t,Ae),e.withBoxedValues===!0),depthSize:e.depthSize,maxDepth:e.maxDepth,maxKeys:e.maxKeys,size:e.size,withSet:e.withSet===!0,withMap:e.withMap===!0,withObjectString:e.withObjectString===!0,withNullPrototype:e.withNullPrototype===!0,withBigInt:e.withBigInt===!0,withDate:e.withDate===!0,withTypedArray:e.withTypedArray===!0,withSparseArray:e.withSparseArray===!0}}function H3(e){return ac(e.key,o0(e),{maxKeys:e.maxKeys,noNullPrototype:!e.withNullPrototype,size:e.size})}function q3(e){return H3(s0(e))}function K3(e,t){let{depthSize:n,maxDepth:r}=t;return{key:e,values:[ni(),Jo({noDefaultInfinity:!0,noNaN:!0}),e,Se(null)],depthSize:n,maxDepth:r}}function a0(e){return o0(s0(e))}function l0(e={}){let t=e.noUnicodeString===void 0||e.noUnicodeString===!0;return a0(K3("stringUnit"in e?Ae({unit:e.stringUnit}):t?Ae():Ae({unit:"binary"}),e))}var Y3=JSON.stringify,Z3=JSON.parse;function J3(e){if(typeof e!="string")throw new M("Cannot unmap the passed value");return Z3(e)}function X3(e={}){return l0(e).map(Y3,J3)}var Q3=Object.defineProperties;function pu(e,t){return`Stream(${t!==void 0?`${ae(t,",")}\u2026`:`${e} emitted`})`}var eT=class extends le{constructor(e,t){super(),this.arb=e,this.history=t}generate(e,t){let n=t!==void 0&&e.nextInt(1,t)===1?t:void 0,r=()=>{let i=this.history?[]:null,o=0,s=function*(a,l){for(;;){let u=a.generate(l,n).value;o++,i!==null&&T(i,u),yield u}};return Q3(new D(s(this.arb,e.clone())),{toString:{value:()=>pu(o,i!==null?i.map(we):void 0)},[ht]:{value:()=>pu(o,i!==null?i.map(we):void 0)},[Ut]:{value:async()=>pu(o,i!==null?await Promise.all(i.map(ec)):void 0)},[ke]:{value:r,enumerable:!0}})};return new O(r(),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return D.nil()}};function tT(e,t){return new eT(e,t!==void 0&&typeof t=="object"&&"noHistory"in t?!t.noHistory:!0)}function nT(e){return ae(e,"")}function cg(e){if(typeof e!="string")throw new Error("Cannot unmap the passed value");return[...e]}function rT(e){switch(e.length%4){case 0:return e;case 3:return`${e}=`;case 2:return`${e}==`;default:return he(e,1)}}function iT(e){if(typeof e!="string"||e.length%4!==0)throw new Error("Invalid string received");let t=e.indexOf("=");if(t===-1)return e;if(e.length-t>2)throw new Error("Cannot unmap the passed value");return he(e,0,t)}var mu=String.fromCharCode;function oT(e){return e<26?mu(e+65):e<52?mu(e+97-26):e<62?mu(e+48-52):e===62?"+":"/"}function sT(e){if(typeof e!="string"||e.length!==1)throw new M("Invalid entry");let t=Jn(e,0);return t>=65&&t<=90?t-65:t>=97&&t<=122?t-97+26:t>=48&&t<=57?t-48+52:t===43?62:t===47?63:-1}function aT(){return X({min:0,max:63}).map(oT,sT)}function lT(e={}){let{minLength:t=0,maxLength:n=xn,size:r}=e,i=t+3-(t+3)%4,o=n-n%4,s=e.maxLength===void 0&&r===void 0?"=":r;if(i>o)throw new M("Minimal length should be inferior or equal to maximal length");if(i%4!==0)throw new M("Minimal length of base64 strings must be a multiple of 4");if(o%4!==0)throw new M("Maximal length of base64 strings must be a multiple of 4");let a=aT();return oe(a,{minLength:i,maxLength:o,size:s,experimentalCustomSlices:W6(a,cg)}).map(nT,cg).map(rT,iT)}var dg=Object.is;function uT(e,t){let n=new jt,r=0;for(let i of e)dg(i,-0)?++r:dt(n,i,(Xe(n,i)||0)+1);for(let i=0;i!==t.length;++i){if(!(i in t))return!1;let o=t[i];if(dg(o,-0)){if(r===0)return!1;--r}else{let s=Xe(n,o)||0;if(s===0)return!1;dt(n,o,s-1)}}return!0}var cT=Math.floor,fg=Math.log,dT=Array.isArray,u0=class extends le{constructor(e,t,n,r){if(super(),this.originalArray=e,this.isOrdered=t,this.minLength=n,this.maxLength=r,n<0||n>e.length)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be between 0 and the size of the original array");if(r<0||r>e.length)throw new Error("fc.*{s|S}ubarrayOf expects the maximal length to be between 0 and the size of the original array");if(n>r)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new Qn(n,r),this.biasedLengthArb=n!==r?new Qn(n,n+cT(fg(r-n)/fg(2))):this.lengthArb}generate(e,t){let n=(t!==void 0&&e.nextInt(1,t)===1?this.biasedLengthArb:this.lengthArb).generate(e,void 0),r=n.value,i=W(this.originalArray,(s,a)=>a),o=[];for(let s=0;s!==r;++s){let a=e.nextInt(0,i.length-1);T(o,i[a]),Bg(i,a,1)}return this.isOrdered&&jg(o,(s,a)=>s-a),new O(W(o,s=>this.originalArray[s]),n.context)}canShrinkWithoutContext(e){return!dT(e)||!this.lengthArb.canShrinkWithoutContext(e.length)?!1:uT(this.originalArray,e)}shrink(e,t){return e.length===0?D.nil():this.lengthArb.shrink(e.length,t).map(n=>new O(Te(e,e.length-n.value),n.context)).join(e.length>this.minLength?sn(()=>this.shrink(Te(e,1),void 0).filter(n=>this.minLength<=n.value.length+1).map(n=>new O([e[0],...n.value],void 0))):D.nil())}};function fT(e,t={}){let{minLength:n=0,maxLength:r=e.length}=t;return new u0(e,!0,n,r)}function hT(e,t={}){let{minLength:n=0,maxLength:r=e.length}=t;return new u0(e,!1,n,r)}var pT={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F",16:"G",17:"H",18:"J",19:"K",20:"M",21:"N",22:"P",23:"Q",24:"R",25:"S",26:"T",27:"V",28:"W",29:"X",30:"Y",31:"Z"},mT={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,J:18,K:19,M:20,N:21,P:22,Q:23,R:24,S:25,T:26,V:27,W:28,X:29,Y:30,Z:31};function yT(e){return e<10?Be(e):pT[e]}function hg(e,t){let n="";for(;e.length+n.length<t;)n+="0";return n+e}function pg(e){let t="";for(let n=e;n!==0;){let r=n>>5;t=yT(n-(r<<5))+t,n=r}return t}function gT(e,t){let n=~~(e/1073741824),r=e&1073741823;return hg(pg(n),t-6)+hg(pg(r),6)}function c0(e){return function(n){return gT(n,e)}}function yu(e){if(typeof e!="string")throw new M("Unsupported type");let t=0,n=1;for(let r=e.length-1;r>=0;--r){let i=mT[e[r]];if(i===void 0)throw new M("Unsupported type");t+=i*n,n*=32}return t}var bT=c0(10),mg=c0(8);function ST(e){return bT(e[0])+mg(e[1])+mg(e[2])}function wT(e){if(typeof e!="string"||e.length!==26)throw new Error("Unsupported type");return[yu(e.slice(0,10)),yu(e.slice(10,18)),yu(e.slice(18))]}function xT(){return F(X({min:0,max:0xffffffffffff}),X({min:0,max:0xffffffffff}),X({min:0,max:0xffffffffff})).map(ST,wT)}function d0(e){return sI(Jr(e,16),8,"0")}function vT(e){if(typeof e!="string")throw new Error("Unsupported type");if(e.length!==8)throw new Error("Unsupported value: invalid length");let t=parseInt(e,16);if(e!==d0(t))throw new Error("Unsupported value: invalid content");return t}function gu(e,t){return X({min:e,max:t}).map(d0,vT)}function RT(e){return`${e[0]}-${he(e[1],4)}-${he(e[1],0,4)}-${he(e[2],0,4)}-${he(e[2],4)}${e[3]}`}var AT=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function CT(e){if(typeof e!="string")throw new Error("Unsupported type");let t=AT.exec(e);if(t===null)throw new Error("Unsupported type");return[t[1],t[3]+t[2],t[4]+he(t[5],0,4),he(t[5],4)]}var yg="0123456789abcdef";function ET(e){let t={},n={};for(let o=0;o!==e.length;++o){let s=yg[o],a=yg[e[o]];t[s]=a,n[a]=s}function r(o){return t[o[0]]+he(o,1)}function i(o){if(typeof o!="string")throw new M("Cannot produce non-string values");let s=n[o[0]];if(s===void 0)throw new M("Cannot produce strings not starting by the version in hexa code");return s+he(o,1)}return{versionsApplierMapper:r,versionsApplierUnmapper:i}}function kT(e){let t={};for(let n of e){if(t[n])throw new M(`Version ${n} has been requested at least twice for uuid`);if(t[n]=!0,n<1||n>15)throw new M(`Version must be a value in [1-15] for uuid, but received ${n}`);if(~~n!==n)throw new M(`Version must be an integer value for uuid, but received ${n}`)}if(e.length===0)throw new M("Must provide at least one version for uuid")}function IT(e={}){let t=gu(0,4294967295),n=e.version!==void 0?typeof e.version=="number"?[e.version]:e.version:[1,2,3,4,5,6,7,8];kT(n);let{versionsApplierMapper:r,versionsApplierUnmapper:i}=ET(n);return F(t,gu(0,268435456*n.length-1).map(r,i),gu(2147483648,3221225471),t).map(RT,CT)}function PT(e){return Ae({unit:cc("-._~!$&'()*+,;=:"),size:e})}function MT([e,t,n]){return(e===null?"":`${e}@`)+t+(n===null?"":`:${n}`)}function TT(e){if(typeof e!="string")throw new Error("Unsupported");let t=e.indexOf("@"),n=t!==-1?e.substring(0,t):null,r=/:(\d+)$/.exec(e),i=r!==null?Number(r[1]):null;return[n,r!==null?e.substring(t+1,e.length-r[1].length-1):e.substring(t+1),i]}function OT(e){return`[${e}]`}function NT(e){if(typeof e!="string"||e[0]!=="["||e[e.length-1]!=="]")throw new Error("Unsupported");return e.substring(1,e.length-1)}function f0(e){let t=e||{},n=t.size,r=[dc({size:n}),...t.withIPv4===!0?[mc()]:[],...t.withIPv6===!0?[Gb().map(OT,NT)]:[],...t.withIPv4Extended===!0?[zb()]:[]];return F(t.withUserInfo===!0?Vt(PT(n)):Se(null),Ee(...r),t.withPort===!0?Vt(on(65535)):Se(null)).map(MT,TT)}function h0(e){return Ae({unit:cc("-._~!$&'()*+,;=:@/?"),size:e})}function p0(e={}){return h0(e.size)}function m0(e={}){return Ae({unit:cc("-._~!$&'()*+,;=:@"),size:e.size})}function $T(e){return ae(W(e,t=>`/${t}`),"")}function LT(e){if(typeof e!="string")throw new Error("Incompatible value received: type");if(e.length!==0&&e[0]!=="/")throw new Error("Incompatible value received: start");return Bg(je(e,"/"),1)}function _T(e){switch(e){case"xsmall":return["xsmall","xsmall"];case"small":return["small","xsmall"];case"medium":return["small","small"];case"large":return["medium","small"];case"xlarge":return["medium","medium"]}}function bu(e,t){return oe(m0({size:e}),{size:t}).map($T,LT)}function DT(e){let[t,n]=_T(e);return t===n?bu(t,n):Ee(bu(t,n),bu(n,t))}function y0(e){return DT(sc((e||{}).size))}function g0(e={}){return h0(e.size)}function FT(e){let[t,n,r]=e;return`${t}://${n}${r}${e[3]===null?"":`?${e[3]}`}${e[4]===null?"":`#${e[4]}`}`}var BT=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function jT(e){if(typeof e!="string")throw new Error("Incompatible value received: type");let t=BT.exec(e);if(t===null)throw new Error("Incompatible value received");let n=t[1],r=t[2],i=t[3],o=t[4],s=t[5];return[n,r,i,o!==void 0?o.substring(1):null,s!==void 0?s.substring(1):null]}function UT(e){let t=e||{},n=sc(t.size),r=t.authoritySettings!==void 0&&t.authoritySettings.size!==void 0?ti(t.authoritySettings.size,n):n,i={...t.authoritySettings,size:r};return F(At(...t.validSchemes||["http","https"]),f0(i),y0({size:n}),t.withQueryParameters===!0?Vt(g0({size:n})):Se(null),t.withFragments===!0?Vt(p0({size:n})):Se(null)).map(FT,jT)}var VT=class b0{constructor(t,n){this.commands=t,this.metadataForReplay=n,this[ke]=function(){return new b0(this.commands.map(r=>r.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let t=this.commands.filter(r=>r.hasRan).map(r=>r.toString()).join(","),n=this.metadataForReplay();return n.length!==0?`${t} /*${n}*/`:t}},WT=class zu{constructor(t){if(this.cmd=t,this.hasRan=!1,Xu(t)){let n=t[ht];this[ht]=function(){return n.call(t)}}if(Qu(t)){let n=t[Ut];this[Ut]=function(){return n.call(t)}}}check(t){return this.cmd.check(t)}run(t,n){return this.hasRan=!0,this.cmd.run(t,n)}clone(){return wn(this.cmd)?new zu(this.cmd[ke]()):new zu(this.cmd)}toString(){return this.cmd.toString()}},gg=class{static parse(e){let[t,n]=e.split(":"),r=this.parseCounts(t),i=this.parseChanges(n);return this.parseOccurences(r,i)}static stringify(e){let t=this.countOccurences(e);return`${this.stringifyCounts(t)}:${this.stringifyChanges(t)}`}static intToB64(e){return e<26?String.fromCharCode(e+65):e<52?String.fromCharCode(e+97-26):e<62?String.fromCharCode(e+48-52):String.fromCharCode(e===62?43:47)}static b64ToInt(e){return e>="a"?e.charCodeAt(0)-97+26:e>="A"?e.charCodeAt(0)-65:e>="0"?e.charCodeAt(0)-48+52:e==="+"?62:63}static countOccurences(e){return e.reduce((t,n)=>(t.length===0||t[t.length-1].count===64||t[t.length-1].value!==n?t.push({value:n,count:1}):t[t.length-1].count+=1,t),[])}static parseOccurences(e,t){let n=[];for(let r=0;r!==e.length;++r){let i=e[r],o=t[r];for(let s=0;s!==i;++s)n.push(o)}return n}static stringifyChanges(e){let t="";for(let n=0;n<e.length;n+=6){let r=e.slice(n,n+6).reduceRight((i,o)=>(i<<1)+(o.value?1:0),0);t+=this.intToB64(r)}return t}static parseChanges(e){let t=e.split("").map(r=>this.b64ToInt(r)),n=[];for(let r=0;r!==t.length;++r){let i=t[r];for(let o=0;o!==6;++o,i>>=1)n.push(i%2===1)}return n}static stringifyCounts(e){return e.map(({count:t})=>this.intToB64(t-1)).join("")}static parseCounts(e){return e.split("").map(t=>this.b64ToInt(t)+1)}},zT=class extends le{constructor(e,t,n,r,i){super(),this.sourceReplayPath=r,this.disableReplayLog=i,this.oneCommandArb=Ee(...e).map(o=>new WT(o)),this.lengthArb=Vu(0,t,n),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(gg.stringify(this.replayPath))}`}buildValueFor(e,t){let n=e.map(i=>i.value_),r={shrunkOnce:t,items:e};return new O(new VT(n,()=>this.metadataForReplay()),r)}generate(e){let t=this.lengthArb.generate(e,void 0).value,n=Array(t);for(let r=0;r!==t;++r)n[r]=this.oneCommandArb.generate(e,void 0);return this.replayPathPosition=0,this.buildValueFor(n,!1)}canShrinkWithoutContext(e){return!1}filterOnExecution(e){let t=[];for(let n of e)n.value_.hasRan?(this.replayPath.push(!0),t.push(n)):this.replayPath.push(!1);return t}filterOnReplay(e){return e.filter((t,n)=>{let r=this.replayPath[this.replayPathPosition+n];if(r===void 0)throw new Error("Too short replayPath");if(!r&&t.value_.hasRan)throw new Error("Mismatch between replayPath and real execution");return r})}filterForShrinkImpl(e){this.replayPathPosition===0&&(this.replayPath=this.sourceReplayPath!==null?gg.parse(this.sourceReplayPath):[]);let t=this.replayPathPosition<this.replayPath.length?this.filterOnReplay(e):this.filterOnExecution(e);return this.replayPathPosition+=e.length,t}shrink(e,t){if(t===void 0)return D.nil();let n=t,r=n.shrunkOnce,i=n.items,o=this.filterForShrinkImpl(i);if(o.length===0)return D.nil();let s=r?D.nil():new D([[]][Symbol.iterator]()),a=[];for(let l=0;l!==o.length;++l)a.push(sn(()=>{let u=o.slice(0,l);return this.lengthArb.shrink(o.length-1-l,void 0).map(c=>u.concat(o.slice(o.length-(c.value+1))))}));for(let l=0;l!==o.length;++l)a.push(sn(()=>this.oneCommandArb.shrink(o[l].value_,o[l].context).map(u=>o.slice(0,l).concat([u],o.slice(l+1)))));return s.join(...a).map(l=>this.buildValueFor(l.map(u=>new O(u.value_.clone(),u.context)),!0))}};function GT(e,t={}){let{size:n,maxCommands:r=xn,disableReplayLog:i=!1,replayPath:o=null}=t;return new zT(e,Qr(n,0,r,t.maxCommands!==void 0),r,o,i)}var HT=class{constructor(e,t){this.s=e,this.cmd=t}async check(e){let t=null,n=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{n=await Promise.resolve(this.cmd.check(e))}catch(r){throw t=r,r}}}]).task).faulty)throw t;return n}async run(e,t){let n=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run(e,t)}catch(r){throw n=r,r}}}]).task).faulty)throw n}},qT=function*(e,t){for(let n of t)yield new HT(e,n)},S0=(e,t,n,r,i)=>e.then(o=>{let{model:s,real:a}=o,l=n;for(let u of t)l=i(l,()=>r(u,s,a));return l}),KT=(e,t)=>S0({then:o=>{o(e())}},t,void 0,(o,s,a)=>{o.check(s)&&o.run(s,a)},(o,s)=>s()),YT=e=>typeof e.then=="function",w0=async(e,t,n=Promise.resolve())=>await S0({then:s=>{let a=e();return YT(a)?a.then(s):s(a)}},t,n,async(s,a,l)=>{await s.check(a)&&await s.run(a,l)},(s,a)=>s.then(a));function ZT(e,t){KT(e,t)}async function JT(e,t){await w0(e,t)}async function XT(e,t,n){let r=w0(t,qT(e,n),e.schedule(Promise.resolve(),"startModel"));await e.waitFor(r),await e.waitAll()}var Lo=e=>e(),x0=class Gu{constructor(t,n){this.act=t,this.taskSelector=n,this.lastTaskId=0,this.sourceTaskSelector=n.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[ke]=function(){return new Gu(this.act,this.sourceTaskSelector)}}static buildLog(t){return`[task\${${t.taskId}}] ${t.label.length!==0?`${t.schedulingType}::${t.label}`:t.schedulingType} ${t.status}${t.outputValue!==void 0?` with value ${nM(t.outputValue)}`:""}`}log(t,n,r,i,o,s){this.triggeredTasks.push({status:o,schedulingType:t,taskId:n,label:r,metadata:i,outputValue:s!==void 0?we(s):void 0})}scheduleInternal(t,n,r,i,o,s){let a=++this.lastTaskId,l,u=new Promise((c,d)=>{l=()=>{let f=Promise.resolve(s!==void 0?r.then(()=>s()):r);return f.then(p=>{this.log(t,a,n,i,"resolved",p),c(p)},p=>{this.log(t,a,n,i,"rejected",p),d(p)}),f}});return this.scheduledTasks.push({original:r,trigger:l,schedulingType:t,taskId:a,label:n,metadata:i,customAct:o}),this.scheduledWatchers.length!==0&&this.scheduledWatchers[0](),u}schedule(t,n,r,i){return this.scheduleInternal("promise",n||"",t,r,i||Lo)}scheduleFunction(t,n){return(...r)=>this.scheduleInternal("function",`${t.name}(${r.map(we).join(",")})`,t(...r),void 0,n||Lo)}scheduleSequence(t,n){let r={done:!1,faulty:!1},i={then:c=>c()},o=()=>{},s=new Promise(c=>{o=()=>c({done:r.done,faulty:r.faulty})}),a=()=>{r.faulty=!0,o()},l=()=>{r.done=!0,o()},u=(c,d)=>{if(c>=t.length){d.then(l,a);return}d.then(()=>{let f=t[c],[p,h,m]=typeof f=="function"?[f,f.name,void 0]:[f.builder,f.label,f.metadata],y=this.scheduleInternal("sequence",h,i,m,n||Lo,()=>p());u(c+1,y)},a)};return u(0,i),Object.assign(r,{task:s})}count(){return this.scheduledTasks.length}internalWaitOne(){if(this.scheduledTasks.length===0)throw new Error("No task scheduled");let t=this.taskSelector.nextTaskIndex(this.scheduledTasks),[n]=this.scheduledTasks.splice(t,1);return n.customAct(()=>n.trigger().catch(r=>{}))}waitOne(t){let n=t||Lo;return this.act(()=>n(()=>this.internalWaitOne()))}async waitAll(t){for(;this.scheduledTasks.length>0;)await this.waitOne(t)}async internalWaitFor(t,n){let r=!1,i=n.customAct,o=n.onWaitStart,s=n.onWaitIdle,a=n.launchAwaiterOnInit,l,u,c=0,d=null,f=null,p=async()=>{for(c=50,c=50;!r&&c>0;--c)await Promise.resolve();if(!r&&this.scheduledTasks.length>0)return o!==void 0&&o(),f=this.waitOne(i),f.then(()=>(f=null,p()),S=>{throw f=null,r=!0,u(S),S});!r&&s!==void 0&&s(),d=null},h=()=>{if(d!==null){c=51;return}d=p().catch(()=>{})},m=()=>{let S=this.scheduledWatchers.indexOf(h);S!==-1&&this.scheduledWatchers.splice(S,1),S===0&&this.scheduledWatchers.length!==0&&this.scheduledWatchers[0]()},y=new Promise((S,w)=>{l=g=>{m(),S(g)},u=g=>{m(),w(g)}});return t.then(S=>{r=!0,f===null?l(S):f.then(()=>l(S),w=>u(w))},S=>{r=!0,f===null?u(S):f.then(()=>u(S),()=>u(S))}),(this.scheduledTasks.length>0||a)&&this.scheduledWatchers.length===0&&h(),this.scheduledWatchers.push(h),y}waitNext(t,n){let r,i=t,o=i<=0?Promise.resolve():new Promise(s=>{r=()=>{--i<=0&&s()}});return this.internalWaitFor(o,{customAct:n,onWaitStart:r,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(t){let n,r=new Promise(i=>n=i);return this.internalWaitFor(r,{customAct:t,onWaitStart:void 0,onWaitIdle:n,launchAwaiterOnInit:!0})}waitFor(t,n){return this.internalWaitFor(t,{customAct:n,onWaitStart:void 0,onWaitIdle:void 0,launchAwaiterOnInit:!1})}report(){return[...this.triggeredTasks,...this.scheduledTasks.map(t=>({status:"pending",schedulingType:t.schedulingType,taskId:t.taskId,label:t.label,metadata:t.metadata}))]}toString(){return"schedulerFor()`\n"+this.report().map(Gu.buildLog).map(t=>`-> ${t}`).join(`
|
|
83
|
+
`)+"`"}};function v0(e){let t=0;return{clone:()=>v0(e),nextTaskIndex:n=>{if(e.length<=t)throw new Error("Invalid schedulerFor defined: too many tasks have been scheduled");let r=n.findIndex(i=>i.taskId===e[t]);if(r===-1)throw new Error("Invalid schedulerFor defined: unable to find next task");return++t,r}}}function bg(e,t){return new x0(e,v0(t))}function R0(e){let t=e.clone();return{clone:()=>R0(t),nextTaskIndex:n=>e.nextInt(0,n.length-1)}}var QT=class extends le{constructor(e){super(),this.act=e}generate(e,t){return new O(new x0(this.act,R0(e.clone())),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return D.nil()}};function eO(e){let{act:t=n=>n()}=e||{};return new QT(t)}function tO(e,t){let{act:n=r=>r()}=Array.isArray(e)?t||{}:e||{};return Array.isArray(e)?bg(n,e):function(r,...i){return bg(n,i)}}function nO(e={}){return Wt(e,k("-9223372036854775808"),k("9223372036854775807"),d2,ln)}function rO(e={}){return Wt(e,k(0),k("18446744073709551615"),f2,ln)}function iO(e,t){return t}var Su=Math.floor,oO=Math.min;function tt(e,t){switch(e.type){case"Char":return{astNode:e,minLength:1};case"Repetition":switch(e.quantifier.kind){case"*":{let n=tt(e.expression,t);return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:t},expression:n.astNode},minLength:0}}case"+":{let n=tt(e.expression,t),r=n.minLength>1?n.minLength:1;return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:1,to:Su(t/r)},expression:n.astNode},minLength:n.minLength}}case"?":{let n=tt(e.expression,t);return t<n.minLength?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:0},expression:n.astNode},minLength:0}:{astNode:{...e,expression:n.astNode},minLength:0}}case"Range":{let n=e.quantifier.from>1?Su(t/e.quantifier.from):t,r=tt(e.expression,n),i=r.minLength>1?r.minLength:1;return e.quantifier.to===void 0||e.quantifier.to*i>t?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",to:Su(t/i)},expression:r.astNode},minLength:e.quantifier.from*r.minLength}:{astNode:{...e,expression:r.astNode},minLength:e.quantifier.from*r.minLength}}default:return iO(e.quantifier,{astNode:e,minLength:0})}case"Quantifier":return{astNode:e,minLength:0};case"Alternative":{let n=0,r=[];for(let o=0;o!==e.expressions.length;++o){let s=t-n,a=tt(e.expressions[o],s);n+=a.minLength,T(r,{value:a,allowance:s})}let i=[];for(let o=0;o!==r.length;++o){let s=r[o].value,a=r[o].allowance,l=t-n+s.minLength;T(i,(l!==a?tt(s.astNode,l):s).astNode)}return{astNode:{...e,expressions:i},minLength:n}}case"CharacterClass":return{astNode:e,minLength:1};case"ClassRange":return{astNode:e,minLength:1};case"Group":{let n=tt(e.expression,t);return{astNode:{...e,expression:n.astNode},minLength:n.minLength}}case"Disjunction":{if(e.left===null){if(e.right===null)return{astNode:e,minLength:0};let i=tt(e.right,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:null,right:o},minLength:0}}if(e.right===null){let i=tt(e.left,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:o,right:null},minLength:0}}let n=tt(e.left,t),r=tt(e.right,t);return n.minLength>t?r:r.minLength>t?n:{astNode:{...e,left:n.astNode,right:r.astNode},minLength:oO(n.minLength,r.minLength)}}case"Assertion":return{astNode:e,minLength:0};case"Backreference":return{astNode:e,minLength:0};case"UnicodeProperty":return{astNode:e,minLength:1}}}function sO(e,t){return tt(e,t).astNode}function aO(e){return new Error(`Unsupported AST node! Received: ${we(e)}`)}function Vo(e,t,n){if(!t&&!n)return e;let r={hasStart:!1,hasEnd:!1},i=A0(e,t,n,r),o=t&&!r.hasStart,s=n&&!r.hasEnd;if(!o&&!s)return i;let a=[];return o&&(a.push({type:"Assertion",kind:"^"}),a.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}})),a.push(i),s&&(a.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}}),a.push({type:"Assertion",kind:"$"})),{type:"Group",capturing:!1,expression:{type:"Alternative",expressions:a}}}function A0(e,t,n,r){switch(e.type){case"Char":return e;case"Repetition":return e;case"Quantifier":throw new Error("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return r.hasStart=!0,r.hasEnd=!0,{...e,expressions:e.expressions.map((i,o)=>Vo(i,t&&o===0,n&&o===e.expressions.length-1))};case"CharacterClass":return e;case"ClassRange":return e;case"Group":return{...e,expression:A0(e.expression,t,n,r)};case"Disjunction":return r.hasStart=!0,r.hasEnd=!0,{...e,left:e.left!==null?Vo(e.left,t,n):null,right:e.right!==null?Vo(e.right,t,n):null};case"Assertion":if(e.kind==="^"||e.kind==="Lookahead")return r.hasStart=!0,e;if(e.kind==="$"||e.kind==="Lookbehind")return r.hasEnd=!0,e;throw new Error(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":return e;case"UnicodeProperty":return e;default:throw aO(e)}}function lO(e){return Vo(e,!0,!0)}function Sg(e,t){return e[t]>="\uD800"&&e[t]<="\uDBFF"&&e[t+1]>="\uDC00"&&e[t+1]<="\uDFFF"?2:1}function Re(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Hu(e){return e>="0"&&e<="9"}function C0(e,t){for(let n=t;n!==e.length;++n){let r=e[n];if(r==="\\")n+=1;else if(r==="]")return n}throw new Error("Missing closing ']'")}function uO(e,t){let n=0;for(let r=t;r!==e.length;++r){let i=e[r];if(i==="\\")r+=1;else if(i===")"){if(n===0)return r;n-=1}else i==="["?r=C0(e,r):i==="("&&(n+=1)}throw new Error("Missing closing ')'")}function cO(e,t){let n=!1;for(let r=t;r!==e.length;++r){let i=e[r];if(!Hu(i)){if(t===r)return-1;if(i===","){if(n)return-1;n=!0}else return i==="}"?r:-1}}return-1}function dO(e,t,n,r){switch(e[t]){case"[":return r===1?t+1:C0(e,t+1)+1;case"{":{if(r===1)return t+1;let i=cO(e,t+1);return i===-1?t+1:i+1}case"(":return r===1?t+1:uO(e,t+1)+1;case"]":case"}":case")":return t+1;case"\\":{let i=e[t+1];switch(i){case"x":if(Re(e[t+2])&&Re(e[t+3]))return t+4;throw new Error(`Unexpected token '${e.substring(t,t+4)}' found`);case"u":if(e[t+2]==="{"){if(!n)return t+2;if(e[t+4]==="}"){if(Re(e[t+3]))return t+5;throw new Error(`Unexpected token '${e.substring(t,t+5)}' found`)}if(e[t+5]==="}"){if(Re(e[t+3])&&Re(e[t+4]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`)}if(e[t+6]==="}"){if(Re(e[t+3])&&Re(e[t+4])&&Re(e[t+5]))return t+7;throw new Error(`Unexpected token '${e.substring(t,t+7)}' found`)}if(e[t+7]==="}"){if(Re(e[t+3])&&Re(e[t+4])&&Re(e[t+5])&&Re(e[t+6]))return t+8;throw new Error(`Unexpected token '${e.substring(t,t+8)}' found`)}if(e[t+8]==="}"&&Re(e[t+3])&&Re(e[t+4])&&Re(e[t+5])&&Re(e[t+6])&&Re(e[t+7]))return t+9;throw new Error(`Unexpected token '${e.substring(t,t+9)}' found`)}if(Re(e[t+2])&&Re(e[t+3])&&Re(e[t+4])&&Re(e[t+5]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`);case"p":case"P":{if(!n)return t+2;let o=t+2;for(;o<e.length&&e[o]!=="}";o+=e[o]==="\\"?2:1);if(e[o]!=="}")throw new Error("Invalid \\P definition");return o+1}case"k":{let o=t+2;for(;o<e.length&&e[o]!==">";++o);if(e[o]!==">"){if(!n)return t+2;throw new Error("Invalid \\k definition")}return o+1}default:if(Hu(i)){let o=n?e.length:Math.min(t+4,e.length),s=t+2;for(;s<o&&Hu(e[s]);++s);return s}return t+(n?Sg(e,t+1):1)+1}}default:return t+(n?Sg(e,t):1)}}function _o(e,t,n,r){let i=dO(e,t,n,r);return e.substring(t,i)}var wg={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},Xo={ASCII:"ASCII",ASCII_Hex_Digit:"AHex",Alphabetic:"Alpha",Any:"Any",Assigned:"Assigned",Bidi_Control:"Bidi_C",Bidi_Mirrored:"Bidi_M",Case_Ignorable:"CI",Cased:"Cased",Changes_When_Casefolded:"CWCF",Changes_When_Casemapped:"CWCM",Changes_When_Lowercased:"CWL",Changes_When_NFKC_Casefolded:"CWKCF",Changes_When_Titlecased:"CWT",Changes_When_Uppercased:"CWU",Dash:"Dash",Default_Ignorable_Code_Point:"DI",Deprecated:"Dep",Diacritic:"Dia",Emoji:"Emoji",Emoji_Component:"Emoji_Component",Emoji_Modifier:"Emoji_Modifier",Emoji_Modifier_Base:"Emoji_Modifier_Base",Emoji_Presentation:"Emoji_Presentation",Extended_Pictographic:"Extended_Pictographic",Extender:"Ext",Grapheme_Base:"Gr_Base",Grapheme_Extend:"Gr_Ext",Hex_Digit:"Hex",IDS_Binary_Operator:"IDSB",IDS_Trinary_Operator:"IDST",ID_Continue:"IDC",ID_Start:"IDS",Ideographic:"Ideo",Join_Control:"Join_C",Logical_Order_Exception:"LOE",Lowercase:"Lower",Math:"Math",Noncharacter_Code_Point:"NChar",Pattern_Syntax:"Pat_Syn",Pattern_White_Space:"Pat_WS",Quotation_Mark:"QMark",Radical:"Radical",Regional_Indicator:"RI",Sentence_Terminal:"STerm",Soft_Dotted:"SD",Terminal_Punctuation:"Term",Unified_Ideograph:"UIdeo",Uppercase:"Upper",Variation_Selector:"VS",White_Space:"space",XID_Continue:"XIDC",XID_Start:"XIDS"},ei=Sc(Xo),bc={Cased_Letter:"LC",Close_Punctuation:"Pe",Connector_Punctuation:"Pc",Control:["Cc","cntrl"],Currency_Symbol:"Sc",Dash_Punctuation:"Pd",Decimal_Number:["Nd","digit"],Enclosing_Mark:"Me",Final_Punctuation:"Pf",Format:"Cf",Initial_Punctuation:"Pi",Letter:"L",Letter_Number:"Nl",Line_Separator:"Zl",Lowercase_Letter:"Ll",Mark:["M","Combining_Mark"],Math_Symbol:"Sm",Modifier_Letter:"Lm",Modifier_Symbol:"Sk",Nonspacing_Mark:"Mn",Number:"N",Open_Punctuation:"Ps",Other:"C",Other_Letter:"Lo",Other_Number:"No",Other_Punctuation:"Po",Other_Symbol:"So",Paragraph_Separator:"Zp",Private_Use:"Co",Punctuation:["P","punct"],Separator:"Z",Space_Separator:"Zs",Spacing_Mark:"Mc",Surrogate:"Cs",Symbol:"S",Titlecase_Letter:"Lt",Unassigned:"Cn",Uppercase_Letter:"Lu"},qu=Sc(bc),E0={Adlam:"Adlm",Ahom:"Ahom",Anatolian_Hieroglyphs:"Hluw",Arabic:"Arab",Armenian:"Armn",Avestan:"Avst",Balinese:"Bali",Bamum:"Bamu",Bassa_Vah:"Bass",Batak:"Batk",Bengali:"Beng",Bhaiksuki:"Bhks",Bopomofo:"Bopo",Brahmi:"Brah",Braille:"Brai",Buginese:"Bugi",Buhid:"Buhd",Canadian_Aboriginal:"Cans",Carian:"Cari",Caucasian_Albanian:"Aghb",Chakma:"Cakm",Cham:"Cham",Cherokee:"Cher",Common:"Zyyy",Coptic:["Copt","Qaac"],Cuneiform:"Xsux",Cypriot:"Cprt",Cyrillic:"Cyrl",Deseret:"Dsrt",Devanagari:"Deva",Dogra:"Dogr",Duployan:"Dupl",Egyptian_Hieroglyphs:"Egyp",Elbasan:"Elba",Ethiopic:"Ethi",Georgian:"Geor",Glagolitic:"Glag",Gothic:"Goth",Grantha:"Gran",Greek:"Grek",Gujarati:"Gujr",Gunjala_Gondi:"Gong",Gurmukhi:"Guru",Han:"Hani",Hangul:"Hang",Hanifi_Rohingya:"Rohg",Hanunoo:"Hano",Hatran:"Hatr",Hebrew:"Hebr",Hiragana:"Hira",Imperial_Aramaic:"Armi",Inherited:["Zinh","Qaai"],Inscriptional_Pahlavi:"Phli",Inscriptional_Parthian:"Prti",Javanese:"Java",Kaithi:"Kthi",Kannada:"Knda",Katakana:"Kana",Kayah_Li:"Kali",Kharoshthi:"Khar",Khmer:"Khmr",Khojki:"Khoj",Khudawadi:"Sind",Lao:"Laoo",Latin:"Latn",Lepcha:"Lepc",Limbu:"Limb",Linear_A:"Lina",Linear_B:"Linb",Lisu:"Lisu",Lycian:"Lyci",Lydian:"Lydi",Mahajani:"Mahj",Makasar:"Maka",Malayalam:"Mlym",Mandaic:"Mand",Manichaean:"Mani",Marchen:"Marc",Medefaidrin:"Medf",Masaram_Gondi:"Gonm",Meetei_Mayek:"Mtei",Mende_Kikakui:"Mend",Meroitic_Cursive:"Merc",Meroitic_Hieroglyphs:"Mero",Miao:"Plrd",Modi:"Modi",Mongolian:"Mong",Mro:"Mroo",Multani:"Mult",Myanmar:"Mymr",Nabataean:"Nbat",New_Tai_Lue:"Talu",Newa:"Newa",Nko:"Nkoo",Nushu:"Nshu",Ogham:"Ogam",Ol_Chiki:"Olck",Old_Hungarian:"Hung",Old_Italic:"Ital",Old_North_Arabian:"Narb",Old_Permic:"Perm",Old_Persian:"Xpeo",Old_Sogdian:"Sogo",Old_South_Arabian:"Sarb",Old_Turkic:"Orkh",Oriya:"Orya",Osage:"Osge",Osmanya:"Osma",Pahawh_Hmong:"Hmng",Palmyrene:"Palm",Pau_Cin_Hau:"Pauc",Phags_Pa:"Phag",Phoenician:"Phnx",Psalter_Pahlavi:"Phlp",Rejang:"Rjng",Runic:"Runr",Samaritan:"Samr",Saurashtra:"Saur",Sharada:"Shrd",Shavian:"Shaw",Siddham:"Sidd",SignWriting:"Sgnw",Sinhala:"Sinh",Sogdian:"Sogd",Sora_Sompeng:"Sora",Soyombo:"Soyo",Sundanese:"Sund",Syloti_Nagri:"Sylo",Syriac:"Syrc",Tagalog:"Tglg",Tagbanwa:"Tagb",Tai_Le:"Tale",Tai_Tham:"Lana",Tai_Viet:"Tavt",Takri:"Takr",Tamil:"Taml",Tangut:"Tang",Telugu:"Telu",Thaana:"Thaa",Thai:"Thai",Tibetan:"Tibt",Tifinagh:"Tfng",Tirhuta:"Tirh",Ugaritic:"Ugar",Vai:"Vaii",Warang_Citi:"Wara",Yi:"Yiii",Zanabazar_Square:"Zanb"},xg=Sc(E0);function Sc(e){let t={};for(let n of Object.keys(e)){let r=e[n];if(Array.isArray(r))for(let i=0;i!==r.length;++i)t[r[i]]=n;else t[r]=n}return t}function fO(e){return e in bc||e in qu}function hO(e){return e in Xo||e in ei}function vg(e){if(e in wg)return wg[e];if(e in ei)return ei[e];if(e in Xo||e==="General_Category"||e==="Script"||e==="Script_Extensions")return e;throw new Error(`Unknown Unicode property name: ${e}`)}function Rg(e){if(e in qu)return qu[e];if(e in xg)return xg[e];if(e in ei)return ei[e];if(e in bc||e in E0||e in Xo)return e;throw new Error(`Unknown Unicode property value: ${e}`)}function pO(e,t){let n=e.indexOf("=");if(n!==-1){let r=e.substring(0,n),i=e.substring(n+1);return{type:"UnicodeProperty",name:r,value:i,negative:t,shorthand:!1,binary:!1,canonicalName:vg(r),canonicalValue:Rg(i)}}if(fO(e))return{type:"UnicodeProperty",name:"General_Category",value:e,negative:t,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:Rg(e)};if(hO(e)){let r=vg(e);return{type:"UnicodeProperty",name:e,value:e,negative:t,shorthand:!1,binary:!0,canonicalName:r,canonicalValue:r}}throw new Error(`Invalid Unicode property: ${e}`)}var wu=String.fromCodePoint;function xu(e){let t=e.pop();if(t===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return t}function k0(e){return e>="0"&&e<="9"}function Wo(e,t){return{type:"Char",kind:"simple",symbol:e,value:e,codePoint:e.codePointAt(0)||-1,escaped:t}}function qn(e,t){return{type:"Char",kind:"meta",symbol:t,value:e,codePoint:t.codePointAt(0)||-1}}function nn(e,t){if(e.length>1)return{type:"Alternative",expressions:e};if(!t&&e.length===0)throw new Error("Unsupported no token");return e[0]}function vu(e){if(e[0]==="\\"){let t=e[1];switch(t){case"x":{let n=e.substring(2),r=Number.parseInt(n,16);return{type:"Char",kind:"hex",symbol:wu(r),value:e,codePoint:r}}case"u":{if(e==="\\u")return Wo("u",!0);let n=e[2]==="{"?e.substring(3,e.length-1):e.substring(2),r=Number.parseInt(n,16);return{type:"Char",kind:"unicode",symbol:wu(r),value:e,codePoint:r}}case"0":return qn(e,"\0");case"n":return qn(e,`
|
|
84
|
+
`);case"f":return qn(e,"\f");case"r":return qn(e,"\r");case"t":return qn(e," ");case"v":return qn(e,"\v");case"w":case"W":case"d":case"D":case"s":case"S":case"b":case"B":return{type:"Char",kind:"meta",symbol:void 0,value:e,codePoint:NaN};default:if(k0(t)){let n=e.substring(1),r=Number(n);return{type:"Char",kind:"decimal",symbol:wu(r),value:e,codePoint:r}}if(e.length>2&&(t==="p"||t==="P")){let n=t==="P";return pO(e.substring(3,e.length-1),n)}return Wo(e.substring(1),!0)}}return Wo(e)}function Kn(e,t,n,r){let i=null;for(let o=0,s=_o(t,o,n,0);o!==t.length;o+=s.length,s=_o(t,o,n,0)){let a=s[0];switch(a){case"|":i===null&&(i=[]),i.push(nn(e.splice(0),!0)||null);break;case".":e.push({type:"Char",kind:"meta",symbol:s,value:s,codePoint:NaN});break;case"*":case"+":{let l=xu(e);e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"?":{let l=xu(e);l.type==="Repetition"?(l.quantifier.greedy=!1,e.push(l)):e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"{":{if(s==="{"){e.push(Wo(s));break}let l=xu(e),u=s.substring(1,s.length-1).split(","),c=Number(u[0]),d=u.length===1?c:u[1].length!==0?Number(u[1]):void 0;e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:"Range",greedy:!0,from:c,to:d}});break}case"[":{let l=s.substring(1,s.length-1),u=[],c,d=!1;for(let f=0,p=_o(l,f,n,1);f!==l.length;f+=p.length,p=_o(l,f,n,1)){if(f===0&&p==="^"){c=!0;continue}let h=vu(p);if(p==="-")u.push(h),d=!0;else{let m=u.length>=2?u[u.length-2]:void 0;d&&m!==void 0&&m.type==="Char"&&h.type==="Char"?(u.pop(),u.pop(),u.push({type:"ClassRange",from:m,to:h})):u.push(h),d=!1}}e.push({type:"CharacterClass",expressions:u,negative:c});break}case"(":{let l=s.substring(1,s.length-1),u=[];if(l[0]==="?")if(l[1]===":")Kn(u,l.substring(2),n,r),e.push({type:"Group",capturing:!1,expression:nn(u)});else if(l[1]==="="||l[1]==="!")Kn(u,l.substring(2),n,r),e.push({type:"Assertion",kind:"Lookahead",negative:l[1]==="!"?!0:void 0,assertion:nn(u)});else if(l[1]==="<"&&(l[2]==="="||l[2]==="!"))Kn(u,l.substring(3),n,r),e.push({type:"Assertion",kind:"Lookbehind",negative:l[2]==="!"?!0:void 0,assertion:nn(u)});else{let c=l.split(">");if(c.length<2||c[0][1]!=="<")throw new Error(`Unsupported regex content found at ${JSON.stringify(s)}`);let d=++r.lastIndex,f=c[0].substring(2);r.named.set(f,d),Kn(u,c.slice(1).join(">"),n,r),e.push({type:"Group",capturing:!0,nameRaw:f,name:f,number:d,expression:nn(u)})}else{let c=++r.lastIndex;Kn(u,l,n,r),e.push({type:"Group",capturing:!0,number:c,expression:nn(u)})}break}default:if(s==="^")e.push({type:"Assertion",kind:s});else if(s==="$")e.push({type:"Assertion",kind:s});else if(s[0]==="\\"&&k0(s[1])){let l=Number(s.substring(1));n||l<=r.lastIndex?e.push({type:"Backreference",kind:"number",number:l,reference:l}):e.push(vu(s))}else if(s[0]==="\\"&&s[1]==="k"&&s.length!==2){let l=s.substring(3,s.length-1);e.push({type:"Backreference",kind:"name",number:r.named.get(l)||0,referenceRaw:l,reference:l})}else e.push(vu(s));break}}if(i!==null){i.push(nn(e.splice(0),!0)||null);let o={type:"Disjunction",left:i[0],right:i[1]};for(let s=2;s<i.length;++s)o={type:"Disjunction",left:o,right:i[s]};e.push(o)}}function mO(e){let t=Ft([...e.flags],"u")!==-1,n=e.source,r=[];return Kn(r,n,t,{lastIndex:0,named:new Map}),nn(r)}var yO=String.fromCodePoint;function gO(e){return e.binary||e.shorthand?e.canonicalValue:`${e.canonicalName}=${e.canonicalValue}`}function Ag(e,t,n,r){let i=-1;for(let o=t;o<=n;++o)if(e.test(yO(o)))i===-1&&(i=o);else if(i!==-1){let s=o-1;r.push(i===s?[s]:[i,s]),i=-1}i!==-1&&r.push(i===n?[n]:[i,n])}function bO(e,t){let n=new RegExp(`^\\${t?"P":"p"}{${e}}$`,"u"),r=[];return Ag(n,0,55295,r),Ag(n,57344,1114111,r),r}var Cg=new Map;function SO(e,t){let n=`${t?"P":"p"}:${e}`,r=Cg.get(n);if(r!==void 0)return r;let i=bO(e,t);return Cg.set(n,i),i}function wO(e){return er(...W(SO(gO(e),e.negative),t=>Pu(t)))}var xO=String.fromCodePoint,Eg=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],kg=[..."0123456789"],Ig=[...` \r
|
|
85
|
+
\v\f`],Ku=[...`\r
|
|
86
|
+
`],I0=[...""],vO=[...Ku,...I0],Sn=()=>Ae({unit:"grapheme-ascii",minLength:1,maxLength:1});function Pg(e){return new M(`Unsupported AST node! Received: ${we(e)}`)}function rn(e,t,n){switch(e.type){case"Char":if(e.kind==="meta")switch(e.value){case"\\w":return At(...Eg);case"\\W":return Sn().filter(r=>Ft(Eg,r)===-1);case"\\d":return At(...kg);case"\\D":return Sn().filter(r=>Ft(kg,r)===-1);case"\\s":return At(...Ig);case"\\S":return Sn().filter(r=>Ft(Ig,r)===-1);case"\\b":case"\\B":throw new M(`Meta character ${e.value} not implemented yet!`);case".":{let r=n.dotAll?I0:vO;return Sn().filter(i=>Ft(r,i)===-1)}}if(e.symbol===void 0)throw new M(`Unexpected undefined symbol received for non-meta Char! Received: ${we(e)}`);return Se(e.symbol);case"Repetition":{let r=rn(e.expression,t,n);switch(e.quantifier.kind){case"*":return Ae({...t,unit:r});case"+":return Ae({...t,minLength:1,unit:r});case"?":return Ae({...t,minLength:0,maxLength:1,unit:r});case"Range":return Ae({...t,minLength:e.quantifier.from,maxLength:e.quantifier.to,unit:r});default:throw Pg(e.quantifier)}}case"Quantifier":throw new M("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return F(...W(e.expressions,r=>rn(r,t,n))).map(r=>ae(r,""));case"CharacterClass":if(e.negative){let r=W(e.expressions,i=>rn(i,t,n));return Sn().filter(i=>Ug(r,o=>!o.canShrinkWithoutContext(i)))}return Ee(...W(e.expressions,r=>rn(r,t,n)));case"ClassRange":{let r=e.from.codePoint,i=e.to.codePoint;return X({min:r,max:i}).map(o=>xO(o),o=>{if(typeof o!="string")throw new M("Invalid type");if([...o].length!==1)throw new M("Invalid length");return Jn(o,0)})}case"Group":return rn(e.expression,t,n);case"Disjunction":return Ee(e.left!==null?rn(e.left,t,n):Se(""),e.right!==null?rn(e.right,t,n):Se(""));case"Assertion":if(e.kind==="^"||e.kind==="$")return n.multiline?e.kind==="^"?Ee(Se(""),F(Ae({unit:Sn()}),At(...Ku)).map(r=>`${r[0]}${r[1]}`,r=>{if(typeof r!="string"||r.length===0)throw new M("Invalid type");return[he(r,0,r.length-1),r[r.length-1]]})):Ee(Se(""),F(At(...Ku),Ae({unit:Sn()})).map(r=>`${r[0]}${r[1]}`,r=>{if(typeof r!="string"||r.length===0)throw new M("Invalid type");return[r[0],he(r,1)]})):Se("");throw new M(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":throw new M("Backreference nodes not implemented yet!");case"UnicodeProperty":return wO(e);default:throw Pg(e)}}function RO(e,t={}){for(let a of e.flags)if(a!=="d"&&a!=="g"&&a!=="m"&&a!=="s"&&a!=="u")throw new M(`Unable to use "stringMatching" against a regex using the flag ${a}`);let n=t.maxLength,r={size:t.size,maxLength:n},i={multiline:e.multiline,dotAll:e.dotAll},o=lO(mO(e));n!==void 0&&(o=sO(o,n));let s=rn(o,r,i);return n!==void 0?s.filter(a=>[...a].length<=n):s}function AO(e){let t=[];for(let n=0;n!==e.length;++n)t.push(e[n].next());return t}function CO(e,t){for(let n=0;n!==e.length;++n)t[n]=e[n].next()}function EO(e){for(let t=0;t!==e.length;++t)if(e[t].done)return!0;return!1}function*kO(...e){let t=AO(e);for(;!EO(t);)yield t.map(n=>n.value),CO(e,t)}function*IO(e){let t=e;for(;;)yield t,++t}var PO=class extends le{constructor(e,t){super(),this.arb=e,this.maxShrinks=t}generate(e,t){let n=this.arb.generate(e,t);return this.valueMapper(n,0)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return this.isSafeContext(t)?this.safeShrink(e,t.originalContext,t.length):this.safeShrink(e,void 0,0)}safeShrink(e,t,n){let r=this.maxShrinks-n;return r<=0?D.nil():new D(kO(this.arb.shrink(e,t),IO(n+1))).take(r).map(i=>this.valueMapper(i[0],i[1]))}valueMapper(e,t){let n={originalContext:e.context,length:t};return new O(e.value,n)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalContext"in e&&"length"in e}};function MO(e,t){return new PO(e,t)}var TO=ym({Arbitrary:()=>le,ExecutionStatus:()=>GI,PreconditionFailure:()=>un,Random:()=>tc,Stream:()=>D,Value:()=>O,VerbosityLevel:()=>RI,__commitHash:()=>$O,__type:()=>OO,__version:()=>NO,anything:()=>a0,array:()=>oe,assert:()=>hP,asyncDefaultReportMessage:()=>sb,asyncModelRun:()=>JT,asyncProperty:()=>xI,asyncStringify:()=>ec,asyncToStringMethod:()=>Ut,base64String:()=>lT,bigInt:()=>ln,bigInt64Array:()=>nO,bigUint64Array:()=>rO,boolean:()=>ni,chainUntil:()=>r6,check:()=>lb,clone:()=>l6,cloneIfNeeded:()=>Yn,cloneMethod:()=>ke,commands:()=>GT,compareBooleanFunc:()=>aM,compareFunc:()=>uM,configureGlobal:()=>bI,constant:()=>Se,constantFrom:()=>At,context:()=>JP,createDepthIdentifier:()=>ic,date:()=>wb,defaultReportMessage:()=>ob,dictionary:()=>ac,domain:()=>dc,double:()=>Jo,emailAddress:()=>x4,entityGraph:()=>a3,falsy:()=>YP,float:()=>jb,float32Array:()=>Kb,float64Array:()=>Yb,func:()=>fM,gen:()=>vP,getDepthContextFor:()=>rc,hasAsyncToStringMethod:()=>Qu,hasCloneMethod:()=>wn,hasToStringMethod:()=>Xu,hash:()=>Ko,infiniteStream:()=>tT,int16Array:()=>Zb,int32Array:()=>Jb,int8Array:()=>Xb,integer:()=>X,ipV4:()=>mc,ipV4Extended:()=>zb,ipV6:()=>Gb,json:()=>X3,jsonValue:()=>l0,letrec:()=>Hb,limitShrink:()=>MO,lorem:()=>m3,map:()=>Uu,mapToConstant:()=>er,maxSafeInteger:()=>Wb,maxSafeNat:()=>yM,memo:()=>S3,mixedCase:()=>C3,modelRun:()=>ZT,nat:()=>on,noBias:()=>qo,noShrink:()=>Yo,object:()=>q3,oneof:()=>Ee,option:()=>Vt,pre:()=>Kk,property:()=>vI,readConfigureGlobal:()=>ft,record:()=>ju,resetConfigureGlobal:()=>SI,sample:()=>mP,scheduledModelRun:()=>XT,scheduler:()=>eO,schedulerFor:()=>tO,set:()=>i0,shuffledSubarray:()=>hT,sparseArray:()=>r0,statistics:()=>gP,stream:()=>an,string:()=>Ae,stringMatching:()=>RO,stringify:()=>we,subarray:()=>fT,toStringMethod:()=>ht,tuple:()=>F,uint16Array:()=>Qb,uint32Array:()=>e0,uint8Array:()=>t0,uint8ClampedArray:()=>n0,ulid:()=>xT,uniqueArray:()=>vn,uuid:()=>IT,webAuthority:()=>f0,webFragments:()=>p0,webPath:()=>y0,webQueryParameters:()=>g0,webSegment:()=>m0,webUrl:()=>UT}),OO="module",NO="4.8.0",$O="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c",Ie=TO;function Qo(e){return e?.values!=null&&e.values.length>0?Ie.constantFrom(...e.values):LO(e)}function LO(e){if(e?.type==="number")return Ie.integer();if(e?.type==="boolean")return Ie.boolean();let t=e?.generator==null?void 0:DO[e.generator];if(t!=null)return t;let n=e?.constraints?.kind==="string"?e.constraints:void 0;return Ie.string({maxLength:n?.maxLength,minLength:n?.minLength??1}).filter(r=>r.trim().length>0&&r===r.trim())}var _O="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],tr=e=>Ie.array(Ie.constantFrom(..._O),{maxLength:e,minLength:1}).map(t=>t.join("")),wc=(e,t)=>Ie.array(tr(10),{maxLength:t,minLength:1}).map(n=>n.join(e)),DO={"company.name":wc(" ",3),"date.iso":FO(),"internet.email":BO(),"internet.url":jO(),"lorem.slug":wc("-",3),"lorem.word":tr(10),"person.fullName":wc(" ",2)};function FO(){return Ie.date({max:new Date("2030-12-31T23:59:59.999Z"),min:new Date("2020-01-01T00:00:00.000Z"),noInvalidDate:!0}).map(e=>e.toISOString())}function BO(){return Ie.tuple(tr(12),tr(10),Ie.constantFrom("com","dev","io","org","ai")).map(([e,t,n])=>`${e}@${t}.${n}`)}function jO(){return Ie.tuple(Ie.constantFrom("http","https"),tr(12),Ie.constantFrom("app","com","dev","io","org"),Ie.array(tr(8),{maxLength:3})).map(([e,t,n,r])=>{let i=r.length===0?"":`/${r.join("/")}`;return`${e}://${t}.${n}${i}`})}var P0=new WeakMap;function xc(e){let t=P0.get(e);if(t!=null)return t;let n=Object.fromEntries(Object.entries(e.paramSpaces).map(([r,i])=>[r,VO(i)]));return P0.set(e,n),n}var UO=24301;function VO(e){let[t]=Ie.sample(Qo(e),{numRuns:1,seed:UO});if(t==null)throw new Error("arbitrary produced no sample");return t}function ri(e){return{aborted:!0,findings:[],ran:[],teardown:e}}function vc(e,t){return new T0(KO(e,t))}function WO(e,t){return new T0(zO(e,t))}async function zO(e,t){let n=GO(e),r=$0({lockfile:e.lockfile,options:e.options,runId:e.runId,signal:t}),i=async o=>{try{return ts(await HO({established:o,params:e,signal:t}))}catch(s){return await o.teardown().match(st,st),es(Ln(s))}};return N0(r,n).match(i,async o=>(await Rc(r.teardown),es(o)))}function GO(e){return{capture:!1,lockfile:e.lockfile,onEvent:void 0,options:e.options,params:e.params,runId:e.runId,sequence:void 0,test:e.test}}async function HO({established:e,params:t,signal:n}){let r=ho({headed:!0}),i=await r.acquire(),o=await fo({baseUrl:t.options.baseUrl,browser:i,capture:null,clientState:e.clientState,engine:uo(L0(t.lockfile)),extraHeaders:Ac(t.options.tunnelAuth),fixturesDir:t.options.fixturesDir,reader:e.reader,session:e.auth}),s=ko(t.lockfile),a=await oo({canon:zi(t.lockfile),classify:Wi(t.lockfile),dataRules:s.dataRules,driver:o.driver,initialState:{snapshot:e.snapshot},onAssertion:o.emitAssertion,onEvent:st,pageRules:fl(s.pageRules,$t(t.test)),sequence:O0(t.lockfile,t.test,t.params),stopAfterStep:t.stopAfterStep},n);return a.findings.length>0?(await o.close(),await r.close(),await e.teardown().match(st,st),{findings:a.findings,kind:"failed"}):(await qO(o.context),await e.teardown().match(st,st),await r.close(),{kind:"handed-over",ran:a.ran.length})}function qO(e){return new Promise(t=>{e.on("close",()=>{t()})})}async function KO({browser:e,hub:t,request:n},r){if(r.aborted)return ts(ri("skipped"));let i=$0({lockfile:n.lockfile,options:n.options,runId:n.runId,signal:r}),o=async s=>{try{return ts(await ZO({browser:e,established:s,hub:t,request:n,signal:r}))}catch(a){return es(Ln(a))}};return N0(i,n).match(o,s=>YO(s,i.teardown))}async function YO(e,t){return e.kind!=="aborted"?es(e):ts(ri(await Rc(t)))}function Rc(e){return e().match(()=>"done",()=>"failed")}async function ZO(e){let t=await XO(e);if(t.kind==="completed")return await e.established.teardown().match(st,nh),e.request.capture&&await JO(e.hub,e.request.runId),{aborted:!1,...t.result};let n=await Rc(e.established.teardown);if(t.kind==="aborted")return ri(n);throw t.error}async function JO(e,t){let n=M0.join(e.debugDir,t);await pm({jsonlPath:M0.join(n,"behavior.jsonl"),outDir:n,runId:t,scale:void 0})}async function XO({browser:e,established:t,hub:n,request:r,signal:i}){try{Qt(i);let{close:o,driver:s,emitAssertion:a}=await fo({baseUrl:r.options.baseUrl,browser:e,capture:r.capture?{hub:n,runId:r.runId}:null,clientState:t.clientState,engine:uo(L0(r.lockfile)),extraHeaders:Ac(r.options.tunnelAuth),fixturesDir:r.options.fixturesDir,reader:t.reader,session:t.auth});try{r.onEvent?.({aliases:t.aliases,generated:t.generated,generatedSingletons:t.generatedSingletons,kind:"world"});let l=ko(r.lockfile);return{kind:"completed",result:await oo({canon:zi(r.lockfile),classify:Wi(r.lockfile),dataRules:l.dataRules,driver:s,initialState:{snapshot:t.snapshot},onAssertion:a,onEvent:r.onEvent??st,pageRules:fl(l.pageRules,$t(r.test)),sequence:r.sequence??O0(r.lockfile,r.test,r.params),stopAfterStep:void 0},i)}}finally{await o()}}catch(o){return sh(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function O0(e,t,n){return Xi(e,t).map(r=>({params:{...xc(r),...n},transition:r}))}function N0(e,t){return e.ready().andThen(()=>Tr(t.lockfile,t.test,{generate:xl(wl(t.options.generate,t.runId),new Date().toISOString()),materialize:e.materialize,params:t.params}).map(n=>({aliases:n.aliases,auth:n.auth,clientState:n.clientState,generated:n.generated,generatedSingletons:n.generatedSingletons,reader:e.reader,snapshot:n.snapshot,teardown:e.teardown})))}function $0({lockfile:e,options:t,runId:n,signal:r}){let i=Il({baseUrl:t.engineUrl,extraHeaders:Ac(t.tunnelAuth),runId:n,secret:t.secret},r);return{materialize:nl(i.setupWorld),reader:El(e.entities,QO(e),i.query),ready:i.ready,teardown:i.teardown}}function Ac(e){if(e!=null)return{"CF-Access-Client-Id":e.clientId,"CF-Access-Client-Secret":e.clientSecret}}function QO(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function L0(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}import{err as pL,ok as mL,ResultAsync as yL}from"neverthrow";import zw from"path";import{z as gt}from"zod";import e8 from"path";import{z as ii}from"zod";var t8=["unspecified","internal","server","client","producer","consumer"],n8=["unset","ok","error"];function _0(e){return t8[e]??"unspecified"}function D0(e){return n8[e]??"unset"}var eW=ii.looseObject({data:ii.looseObject({source:ii.number().optional()}).optional(),timestamp:ii.number(),type:ii.number()});function F0({debugDir:e,runId:t,worker:n}){let r=e8.join(e,t,"behavior.jsonl");return n.open({file:r,runId:t}),{close:i=>n.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(r8(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:i8(i.timeNanos)};n.line({line:JSON.stringify(o),runId:t,timeNanos:i.timeNanos})},emitRrwebBatch:i=>{n.rrwebBatch({data:i,runId:t})}}}function nr(e){return String(BigInt(Math.round(e))*1000000n)}function r8(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function i8(e){return Number(BigInt(e)/1000000n)}import{existsSync as o8}from"fs";import{createRequire as s8}from"module";import{fileURLToPath as a8}from"url";import{Worker as l8}from"worker_threads";var u8=s8(import.meta.url);function B0(e){let t=new l8(c8(),{workerData:e});t.unref();let n=new Map,r={next:0};t.on("message",o=>{let s=n.get(o.seq);s!=null&&(n.delete(o.seq),s())});let i=o=>{t.postMessage(o)};return{close:({noticeLineIfNoRrweb:o,runId:s})=>{let a=r.next;return r.next+=1,new Promise(l=>{n.set(a,l),i({noticeLineIfNoRrweb:o,runId:s,seq:a,t:"close"})})},line:({line:o,runId:s,timeNanos:a})=>{i({line:o,runId:s,t:"line",timeNanos:a})},open:({file:o,runId:s})=>{i({file:o,runId:s,t:"open"})},rrwebBatch:({data:o,runId:s})=>{i({data:o,runId:s,t:"rrweb-batch"})},terminate:async()=>{await t.terminate()}}}function c8(){try{return u8.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(n=>a8(new URL(n,import.meta.url))),t=e.find(n=>o8(n));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}import{readFile as d8}from"fs/promises";import{createRequire as f8}from"module";import{fileURLToPath as h8}from"url";var p8=f8(import.meta.url);function Cc(e,t){try{return p8.resolve(e)}catch{return h8(new URL(`assets/${t}`,import.meta.url))}}var m8=Cc("@ripplo/browser-trace/bundle","browser-trace.js");async function U0(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await y8())}var j0;function y8(){return j0??=d8(m8,{encoding:"utf8"}),j0}import{createServer as g8}from"http";import{mkdir as b8,rm as S8,writeFile as w8}from"fs/promises";import x8 from"path";import{z as Q}from"zod";var v8="otlp-port",W0=Q.object({key:Q.string(),value:Q.object({boolValue:Q.boolean().optional(),doubleValue:Q.number().optional(),intValue:Q.union([Q.string(),Q.number()]).optional(),stringValue:Q.string().optional()})}),R8=Q.object({attributes:Q.array(W0).default([]),endTimeUnixNano:Q.string(),kind:Q.number().default(0),name:Q.string(),parentSpanId:Q.string().optional(),spanId:Q.string(),startTimeUnixNano:Q.string(),status:Q.object({code:Q.number(),message:Q.string().optional()}).optional(),traceId:Q.string()}),A8=Q.object({resourceSpans:Q.array(Q.object({resource:Q.object({attributes:Q.array(W0).default([])}).optional(),scopeSpans:Q.array(Q.object({spans:Q.array(R8).default([])})).default([])})).default([])});async function Ec({localDir:e,onRrwebBatch:t,onSpan:n,writePortFile:r}){let{port:i,server:o}=await C8({onRrwebBatch:t,onSpan:n}),s=x8.join(e,v8);return r&&(await b8(e,{recursive:!0}),await w8(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{r&&await S8(s,{force:!0}),await M8(o)}}}function C8(e){return new Promise((t,n)=>{let r=g8((i,o)=>{E8(i,o,e)});r.on("error",n),r.listen(0,()=>{let i=r.address();if(i==null||typeof i=="string"){n(new Error("otlp_receiver_no_port"));return}t({port:i.port,server:r})})})}function E8(e,t,n){let r=k8(e.url);if(r!=null){V0(e).then(i=>{n.onRrwebBatch(r,i),ns(t)}).catch(()=>{ns(t)});return}V0(e).then(i=>{I8(A8.parse(JSON.parse(i.toString("utf8"))),n.onSpan),ns(t)}).catch(()=>{ns(t)})}function k8(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function V0(e){return new Promise((t,n)=>{let r=[];e.on("data",i=>{r.push(i)}),e.on("end",()=>{t(Buffer.concat(r))}),e.on("error",n)})}function ns(e){e.writeHead(200,{"content-type":"application/json"}),e.end("{}")}function I8(e,t){e.resourceSpans.flatMap(n=>n.scopeSpans).flatMap(n=>n.spans).forEach(n=>{t({attributes:P8(n.attributes),durationMs:Number((BigInt(n.endTimeUnixNano)-BigInt(n.startTimeUnixNano))/1000000n),kind:"span",name:n.name,parentSpanId:n.parentSpanId,source:"server",spanId:n.spanId,spanKind:_0(n.kind),status:{code:D0(n.status?.code??0),message:n.status?.message},timeNanos:n.startTimeUnixNano,traceId:n.traceId})})}function P8(e){return Object.fromEntries(e.map(({key:t,value:n})=>[t,String(n.stringValue??n.intValue??n.doubleValue??n.boolValue??"")]))}function M8(e){return new Promise((t,n)=>{e.close(r=>{if(r==null){t();return}n(r)}),e.closeAllConnections()})}import{readFile as Q9}from"fs/promises";var T8=Object.defineProperty,O8=(e,t,n)=>t in e?T8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A=(e,t,n)=>O8(e,typeof t!="symbol"?t+"":t,n),z0,N8=Object.defineProperty,$8=(e,t,n)=>t in e?N8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G0=(e,t,n)=>$8(e,typeof t!="symbol"?t+"":t,n),Pe=(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))(Pe||{}),H0={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},q0={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},rs={},L8=()=>!!globalThis.Zone;function Md(e){if(rs[e])return rs[e];let t=globalThis[e],n=t.prototype,r=e in H0?H0[e]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(n,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in q0?q0[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof n[a]=="function"&&((l=n[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!L8())return rs[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let u=l[e].prototype;return document.body.removeChild(a),u?rs[e]=u:n}catch{return n}}var kc={};function qt(e,t,n){var r;let i=`${e}.${String(n)}`;if(kc[i])return kc[i].call(t);let o=Md(e),s=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return s?(kc[i]=s,s.call(t)):t[n]}var Ic={};function z1(e,t,n){let r=`${e}.${String(n)}`;if(Ic[r])return Ic[r].bind(t);let o=Md(e)[n];return typeof o!="function"?t[n]:(Ic[r]=o,o.bind(t))}function _8(e){return qt("Node",e,"ownerDocument")}function D8(e){return qt("Node",e,"childNodes")}function F8(e){return qt("Node",e,"parentNode")}function B8(e){return qt("Node",e,"parentElement")}function j8(e){return qt("Node",e,"textContent")}function U8(e,t){return z1("Node",e,"contains")(t)}function V8(e){return z1("Node",e,"getRootNode")()}function W8(e){return!e||!("host"in e)?null:qt("ShadowRoot",e,"host")}function z8(e){return e.styleSheets}function G8(e){return!e||!("shadowRoot"in e)?null:qt("Element",e,"shadowRoot")}function H8(e,t){return qt("Element",e,"querySelector")(t)}function q8(e,t){return qt("Element",e,"querySelectorAll")(t)}function K8(){return Md("MutationObserver").constructor}function Y8(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var Le={ownerDocument:_8,childNodes:D8,parentNode:F8,parentElement:B8,textContent:j8,contains:U8,getRootNode:V8,host:W8,styleSheets:z8,shadowRoot:G8,querySelector:H8,querySelectorAll:q8,mutationObserver:K8,patch:Y8};function G1(e){return e.nodeType===e.ELEMENT_NODE}function ci(e){let t=e&&"host"in e&&"mode"in e&&Le.host(e)||null;return!!(t&&"shadowRoot"in t&&Le.shadowRoot(t)===e)}function di(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Z8(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 J8(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function Uc(e){try{let t=e.rules||e.cssRules;if(!t)return null;let n=e.href;!n&&e.ownerNode&&(n=e.ownerNode.baseURI);let r=Array.from(t,i=>H1(i,n)).join("");return Z8(r)}catch{return null}}function H1(e,t){if(Q8(e)){let n;try{n=Uc(e.styleSheet)||J8(e)}catch{n=e.cssText}return e.styleSheet.href?Ls(n,e.styleSheet.href):n}else{let n=e.cssText;return eN(e)&&e.selectorText.includes(":")&&(n=X8(n)),t?Ls(n,t):n}}function X8(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Q8(e){return"styleSheet"in e}function eN(e){return"selectorText"in e}var Os=class{constructor(){G0(this,"idNodeMap",new Map),G0(this,"nodeMetaMap",new WeakMap)}getId(t){var n;return t?((n=this.getMeta(t))==null?void 0:n.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 n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){let r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){let r=this.getNode(t);if(r){let i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function tN(){return new Os}function Ns({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:o}){let s=i||"",a=r&&An(r);return(t[n.toLowerCase()]||a&&t[a])&&(o?s=o(s,e):s="*".repeat(s.length)),s}function An(e){return e.toLowerCase()}var K0="__rrweb_original__";function nN(e){let t=e.getContext("2d");if(!t)return!0;let n=50;for(let r=0;r<e.width;r+=n)for(let i=0;i<e.height;i+=n){let o=t.getImageData,s=K0 in o?o[K0]:o;if(new Uint32Array(s.call(t,r,i,Math.min(n,e.width-r),Math.min(n,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function $s(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?An(t):null}function q1(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i,i=n.pathname.match(r);return i?.[1]??null}function rN(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var iN=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,oN=/^(?:[a-z+]+:)?\/\//i,sN=/^www\..*/i,aN=/^(data:)([^,]*),(.*)/i;function Ls(e,t){return(e||"").replace(iN,(n,r,i,o,s,a)=>{let l=i||s||a,u=r||o||"";if(!l)return n;if(oN.test(l)||sN.test(l))return`url(${u}${l}${u})`;if(aN.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${rN(t)+l}${u})`;let c=t.split("/"),d=l.split("/");c.pop();for(let f of d)f!=="."&&(f===".."?c.pop():c.push(f));return`url(${u}${c.join("/")}${u})`})}function is(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function lN(e,t,n=!1){let r=Array.from(t.childNodes),i=[],o=0;if(r.length>1&&e&&typeof e=="string"){let s=is(e,n),a=s.length/e.length;for(let l=1;l<r.length;l++)if(r[l].textContent&&typeof r[l].textContent=="string"){let u=is(r[l].textContent,n),c=100,d=3;for(;d<u.length&&(u[d].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,d),1)!==-1);d++);for(;d<u.length;d++){let f=u.substring(0,d),p=s.split(f),h=-1;if(p.length===2)h=p[0].length;else if(p.length>2&&p[0]===""&&r[l-1].textContent!=="")h=s.indexOf(f,1);else if(p.length===1){if(f=f.substring(0,f.length-1),p=s.split(f),p.length<=1)return i.push(e),i;d=c+1}else d===u.length-1&&(h=s.indexOf(f));if(p.length>=2&&d>c){let m=r[l-1].textContent;if(m&&typeof m=="string"){let y=is(m).length;h=s.indexOf(f,y)}h===-1&&(h=p[0].length)}if(h!==-1){let m=Math.floor(h/a);for(;m>0&&m<e.length;){if(o+=1,o>50*r.length)return i.push(e),i;let y=is(e.substring(0,m),n);if(y.length===h){i.push(e.substring(0,m)),e=e.substring(m),s=s.substring(h);break}else y.length<h?m+=Math.max(1,Math.floor((h-y.length)/a)):m-=Math.max(1,Math.floor((y.length-h)*a))}break}}}}return i.push(e),i}function uN(e,t){return lN(e,t).join("/* rr_split */")}var cN=1,dN=new RegExp("[^a-z0-9-_:]"),hi=-2;function K1(){return cN++}function fN(e){if(e instanceof HTMLFormElement)return"form";let t=An(e.tagName);return dN.test(t)?"div":t}var rr,Y0,hN=/^[^ \t\n\r\u000c]+/,pN=/^[, \t\n\r\u000c]+/;function mN(e,t){if(t.trim()==="")return t;let n=0;function r(o){let s,a=o.exec(t.substring(n));return a?(s=a[0],n+=s.length,s):""}let i=[];for(;r(pN),!(n>=t.length);){let o=r(hN);if(o.slice(-1)===",")o=sr(e,o.substring(0,o.length-1)),i.push(o);else{let s="";o=sr(e,o);let a=!1;for(;;){let l=t.charAt(n);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){n+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,n+=1}}}return i.join(", ")}var Z0=new WeakMap;function sr(e,t){return!t||t.trim()===""?t:Td(e,t)}function yN(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Td(e,t){let n=Z0.get(e);if(n||(n=e.createElement("a"),Z0.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function Y1(e,t,n,r){return r&&(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&["table","td","th"].includes(t)?sr(e,r):n==="srcset"?mN(e,r):n==="style"?Ls(r,Td(e)):t==="object"&&n==="data"?sr(e,r):r)}function Z1(e,t,n){return["video","audio"].includes(e)&&t==="autoplay"}function gN(e,t,n){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){let i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function _s(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?_s(Le.parentNode(e),t,n):!1;for(let r=e.classList.length;r--;){let i=e.classList[r];if(t.test(i))return!0}return n?_s(Le.parentNode(e),t,n):!1}function J1(e,t,n,r){let i;if(G1(e)){if(i=e,!Le.childNodes(i).length)return!1}else{if(Le.parentElement(e)===null)return!1;i=Le.parentElement(e)}try{if(typeof t=="string"){if(r){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(_s(i,t,r))return!0;if(n){if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}}catch{}return!1}function bN(e,t,n){let r=e.contentWindow;if(!r)return;let i=!1,o;try{o=r.document.readyState}catch{return}if(o!=="complete"){let a=setTimeout(()=>{i||(t(),i=!0)},n);e.addEventListener("load",()=>{clearTimeout(a),i=!0,t()});return}let s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function SN(e,t,n){let r=!1,i;try{i=e.sheet}catch{return}if(i)return;let o=setTimeout(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{clearTimeout(o),r=!0,t()})}function wN(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:f,recordCanvas:p,keepIframeSrcFn:h,newlyAddedElement:m=!1,cssCaptured:y=!1}=t,S=xN(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Pe.Document,childNodes:[],compatMode:e.compatMode}:{type:Pe.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Pe.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return RN(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:f,recordCanvas:p,keepIframeSrcFn:h,newlyAddedElement:m,rootId:S});case e.TEXT_NODE:return vN(e,{doc:n,needsMask:s,maskTextFn:u,rootId:S,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:Pe.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Pe.Comment,textContent:Le.textContent(e)||"",rootId:S};default:return!1}}function xN(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function vN(e,t){let{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:o}=t,s=Le.parentNode(e),a=s&&s.tagName,l="",u=a==="STYLE"?!0:void 0,c=a==="SCRIPT"?!0:void 0;return c?l="SCRIPT_PLACEHOLDER":o||(l=Le.textContent(e),u&&l&&(l=Ls(l,Td(t.doc)))),!u&&!c&&l&&n&&(l=r?r(l,Le.parentElement(e)):l.replace(/[\S]/g,"*")),{type:Pe.Text,textContent:l||"",rootId:i}}function RN(e,t){let{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:d,newlyAddedElement:f=!1,rootId:p}=t,h=gN(e,r,i),m=fN(e),y={},S=e.attributes.length;for(let g=0;g<S;g++){let x=e.attributes[g];Z1(m,x.name,x.value)||(y[x.name]=Y1(n,m,An(x.name),x.value))}if(m==="link"&&o){let g=Array.from(n.styleSheets).find(I=>I.href===e.href),x=null;g&&(x=Uc(g)),x&&(delete y.rel,delete y.href,y._cssText=x)}if(m==="style"&&e.sheet){let g=Uc(e.sheet);g&&(e.childNodes.length>1&&(g=uN(g,e)),y._cssText=g)}if(["input","textarea","select"].includes(m)){let g=e.value,x=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&g?y.value=Ns({element:e,type:$s(e),tagName:m,value:g,maskInputOptions:s,maskInputFn:a}):x&&(y.checked=x)}if(m==="option"&&(e.selected&&!s.select?y.selected=!0:delete y.selected),m==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&c){if(e.__context==="2d")nN(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let g=e.toDataURL(l.type,l.quality),x=n.createElement("canvas");x.width=e.width,x.height=e.height;let I=x.toDataURL(l.type,l.quality);g!==I&&(y.rr_dataURL=g)}}if(m==="img"&&u){rr||(rr=n.createElement("canvas"),Y0=rr.getContext("2d"));let g=e,x=g.currentSrc||g.getAttribute("src")||"<unknown-src>",I=g.crossOrigin,N=()=>{g.removeEventListener("load",N);try{rr.width=g.naturalWidth,rr.height=g.naturalHeight,Y0.drawImage(g,0,0),y.rr_dataURL=rr.toDataURL(l.type,l.quality)}catch($){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?N():g.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${x}! Error: ${$}`)}g.crossOrigin==="anonymous"&&(I?y.crossOrigin=I:g.removeAttribute("crossorigin"))};g.complete&&g.naturalWidth!==0?N():g.addEventListener("load",N)}if(["audio","video"].includes(m)){let g=y;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume}if(f||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),h){let{width:g,height:x}=e.getBoundingClientRect();y={class:y.class,rr_width:`${g}px`,rr_height:`${x}px`}}m==="iframe"&&!d(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(m)&&(w=!0)}catch{}return{type:Pe.Element,tagName:m,attributes:y,childNodes:[],isSVG:yN(e)||void 0,needBlock:h,rootId:p,isCustom:w}}function ue(e){return e==null?"":e.toLowerCase()}function X1(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 AN(e,t){if(t.comment&&e.type===Pe.Comment)return!0;if(e.type===Pe.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"&&q1(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ue(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ue(e.attributes.name)==="application-name"||ue(e.attributes.rel)==="icon"||ue(e.attributes.rel)==="apple-touch-icon"||ue(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ue(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ue(e.attributes.property).match(/^(og|twitter|fb):/)||ue(e.attributes.name).match(/^(og|twitter):/)||ue(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ue(e.attributes.name)==="robots"||ue(e.attributes.name)==="googlebot"||ue(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ue(e.attributes.name)==="author"||ue(e.attributes.name)==="generator"||ue(e.attributes.name)==="framework"||ue(e.attributes.name)==="publisher"||ue(e.attributes.name)==="progid"||ue(e.attributes.property).match(/^article:/)||ue(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ue(e.attributes.name)==="google-site-verification"||ue(e.attributes.name)==="yandex-verification"||ue(e.attributes.name)==="csrf-token"||ue(e.attributes.name)==="p:domain_verify"||ue(e.attributes.name)==="verify-v1"||ue(e.attributes.name)==="verification"||ue(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function ar(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:h={},inlineImages:m=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:$=!1,cssCaptured:L=!1}=t,{needsMask:P}=t,{preserveWhiteSpace:j=!0}=t;P||(P=J1(e,s,a,P===void 0));let U=wN(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:P,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:f,dataURLOptions:h,inlineImages:m,recordCanvas:y,keepIframeSrcFn:N,newlyAddedElement:$,cssCaptured:L});if(!U)return console.warn(e,"not serialized"),null;let ne;r.hasNode(e)?ne=r.getId(e):AN(U,p)||!j&&U.type===Pe.Text&&!U.textContent.replace(/^\s+|\s+$/gm,"").length?ne=hi:ne=K1();let _=Object.assign(U,{id:ne});if(r.add(e,_),ne===hi)return null;S&&S(e);let Me=!l;if(_.type===Pe.Element){Me=Me&&!_.needBlock,delete _.needBlock;let se=Le.shadowRoot(e);se&&di(se)&&(_.isShadowHost=!0)}if((_.type===Pe.Document||_.type===Pe.Element)&&Me){p.headWhitespace&&_.type===Pe.Element&&_.tagName==="head"&&(j=!1);let se={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:P,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:h,inlineImages:m,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:x,stylesheetLoadTimeout:I,keepIframeSrcFn:N,cssCaptured:!1};if(!(_.type===Pe.Element&&_.tagName==="textarea"&&_.attributes.value!==void 0)){_.type===Pe.Element&&_.attributes._cssText!==void 0&&typeof _.attributes._cssText=="string"&&(se.cssCaptured=!0);for(let bt of Array.from(Le.childNodes(e))){let Ce=ar(bt,se);Ce&&_.childNodes.push(Ce)}}let Oe=null;if(G1(e)&&(Oe=Le.shadowRoot(e)))for(let bt of Array.from(Le.childNodes(Oe))){let Ce=ar(bt,se);Ce&&(di(Oe)&&(Ce.isShadow=!0),_.childNodes.push(Ce))}}let He=Le.parentNode(e);return He&&ci(He)&&di(He)&&(_.isShadow=!0),_.type===Pe.Element&&_.tagName==="iframe"&&bN(e,()=>{let se=e.contentDocument;if(se&&w){let Oe=ar(se,{doc:se,mirror:r,blockClass:i,blockSelector:o,needsMask:P,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:h,inlineImages:m,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:x,stylesheetLoadTimeout:I,keepIframeSrcFn:N});Oe&&w(e,Oe)}},g),_.type===Pe.Element&&_.tagName==="link"&&typeof _.attributes.rel=="string"&&(_.attributes.rel==="stylesheet"||_.attributes.rel==="preload"&&typeof _.attributes.href=="string"&&q1(_.attributes.href)==="css")&&SN(e,()=>{if(x){let se=ar(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:P,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:f,slimDOMOptions:p,dataURLOptions:h,inlineImages:m,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:x,stylesheetLoadTimeout:I,keepIframeSrcFn:N});se&&x(e,se)}},I),_}function CN(e,t){let{mirror:n=new Os,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:f,slimDOM:p=!1,dataURLOptions:h,preserveWhiteSpace:m,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:x,keepIframeSrcFn:I=()=>!1}=t||{},N=c===!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}:c===!1?{password:!0}:c,$=X1(p);return ar(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:N,maskTextFn:d,maskInputFn:f,slimDOMOptions:$,dataURLOptions:h,inlineImages:l,recordCanvas:u,preserveWhiteSpace:m,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:x,keepIframeSrcFn:I,newlyAddedElement:!1})}var EN=/(max|min)-device-(width|height)/,gW=new RegExp(EN.source,"g");function kN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function IN(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Od={exports:{}},de=String,Q1=function(){return{isColorSupported:!1,reset:de,bold:de,dim:de,italic:de,underline:de,inverse:de,hidden:de,strikethrough:de,black:de,red:de,green:de,yellow:de,blue:de,magenta:de,cyan:de,white:de,gray:de,bgBlack:de,bgRed:de,bgGreen:de,bgYellow:de,bgBlue:de,bgMagenta:de,bgCyan:de,bgWhite:de}};Od.exports=Q1();Od.exports.createColors=Q1;var PN=Od.exports,MN={},TN=Object.freeze(Object.defineProperty({__proto__:null,default:MN},Symbol.toStringTag,{value:"Module"})),mt=IN(TN),J0=PN,X0=mt,Vc=class eS extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,eS)}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(t){if(!this.source)return"";let n=this.source;t==null&&(t=J0.isColorSupported),X0&&t&&(n=X0(n));let r=n.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=J0.createColors(!0);a=f=>u(d(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let d=i+1+c,f=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let p=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+`
|
|
87
|
+
`+p+a("^")}return" "+l(f)+u}).join(`
|
|
88
|
+
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
89
|
+
|
|
90
|
+
`+t+`
|
|
91
|
+
`),this.name+": "+this.message+t}},Nd=Vc;Vc.default=Vc;var Ri={};Ri.isClean=Symbol("isClean");Ri.my=Symbol("my");var Q0={after:`
|
|
92
|
+
`,beforeClose:`
|
|
93
|
+
`,beforeComment:`
|
|
94
|
+
`,beforeDecl:`
|
|
95
|
+
`,beforeOpen:" ",beforeRule:`
|
|
96
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function ON(e){return e[0].toUpperCase()+e.slice(1)}var Wc=class{constructor(t){this.builder=t}atrule(t,n){let r="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?r+=t.raws.afterName:i&&(r+=" "),t.nodes)this.block(t,r+i);else{let o=(t.raws.between||"")+(n?";":"");this.builder(r+i+o,t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
|
|
97
|
+
`)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)r+=s}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(n+r+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let n=t.nodes.length-1;for(;n>0&&t.nodes[n].type==="comment";)n-=1;let r=this.raw(t,"semicolon");for(let i=0;i<t.nodes.length;i++){let o=t.nodes[i],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,n!==i||r)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder("/*"+n+t.text+r+"*/",t)}decl(t,n){let r=this.raw(t,"between","colon"),i=t.prop+r+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),n&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return Q0[r];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[r]<"u")return s.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let a="raw"+ON(r);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=Q0[r]),s.rawCache[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`
|
|
98
|
+
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
|
|
99
|
+
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(t,n){let r;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
|
|
100
|
+
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(t){let n;return t.walk(r=>{if(r.type!=="decl"&&(n=r.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return n=r.raws.before,n.includes(`
|
|
101
|
+
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawColon(t){let n;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return n=r.raws.between.replace(/[^\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(n=r.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(r=>{let i=r.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof r.raws.before<"u"){let o=r.raws.before.split(`
|
|
102
|
+
`);return n=o[o.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],i=t.raws[n];return i&&i.value===r?i.raw:r}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}},tS=Wc;Wc.default=Wc;var NN=tS;function zc(e,t){new NN(t).stringify(e)}var Ys=zc;zc.default=zc;var{isClean:os,my:$N}=Ri,LN=Nd,_N=tS,DN=Ys;function Gc(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let i=e[r],o=typeof i;r==="parent"&&o==="object"?t&&(n[r]=t):r==="source"?n[r]=i:Array.isArray(i)?n[r]=i.map(s=>Gc(s,n)):(o==="object"&&i!==null&&(i=Gc(i)),n[r]=i)}return n}var Hc=class{constructor(t={}){this.raws={},this[os]=!1,this[$N]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let n=Gc(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new LN(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markDirty(){if(this[os]){this[os]=!1;let t=this;for(;t=t.parent;)t[os]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,n){let r=this.source.start;if(t.index)r=this.positionInside(t.index,n);else if(t.word){n=this.toString();let i=n.indexOf(t.word);i!==-1&&(r=this.positionInside(i,n))}return r}positionInside(t,n){let r=n||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)r[s]===`
|
|
103
|
+
`?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let n={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:n.column+1,line:n.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(n=this.positionInside(o,i),r=this.positionInside(o+t.word.length,i))}else t.start?n={column:t.start.column,line:t.start.line}:t.index&&(n=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<n.line||r.line===n.line&&r.column<=n.column)&&(r={column:n.column+1,line:n.line}),{end:r,start:n}}raw(t,n){return new _N().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r={},i=n==null;n=n||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let a=this[s];if(Array.isArray(a))r[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,n):l);else if(typeof a=="object"&&a.toJSON)r[s]=a.toJSON(null,n);else if(s==="source"){let l=n.get(a.input);l==null&&(l=o,n.set(a.input,o),o++),r[s]={end:a.end,inputId:l,start:a.start}}else r[s]=a}return i&&(r.inputs=[...n.keys()].map(s=>s.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=DN){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}get proxyOf(){return this}},Zs=Hc;Hc.default=Hc;var FN=Zs,qc=class extends FN{constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},Js=qc;qc.default=qc;var BN="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",jN=(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r},UN=(e=21)=>{let t="",n=e;for(;n--;)t+=BN[Math.random()*64|0];return t},VN={nanoid:UN,customAlphabet:jN},{SourceMapConsumer:e1,SourceMapGenerator:t1}=mt,{existsSync:WN,readFileSync:zN}=mt,{dirname:Pc,join:GN}=mt;function HN(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Kc=class{constructor(t,n){if(n.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Pc(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new e1(this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(t)||o.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(n.test(t)||r.test(t))return HN(t.substr(RegExp.lastMatch.length));let s=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let r=t.lastIndexOf(n.pop()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t){if(this.root=Pc(t),WN(t))return this.mapFile=t,zN(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof e1)return t1.fromSourceMap(n).toString();if(n instanceof t1)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return t&&(r=GN(Pc(t),r)),this.loadFile(r)}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},nS=Kc;Kc.default=Kc;var{SourceMapConsumer:qN,SourceMapGenerator:KN}=mt,{fileURLToPath:n1,pathToFileURL:ss}=mt,{isAbsolute:Yc,resolve:Zc}=mt,{nanoid:YN}=VN,Mc=mt,r1=Nd,ZN=nS,Tc=Symbol("fromOffsetCache"),JN=!!(qN&&KN),i1=!!(Zc&&Yc),Ds=class{constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!i1||/^\w+:\/\//.test(n.from)||Yc(n.from)?this.file=n.from:this.file=Zc(n.from)),i1&&JN){let r=new ZN(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+YN(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,s,a;if(n&&typeof n=="object"){let u=n,c=r;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);n=d.line,r=d.col}else n=u.line,r=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);s=d.line,a=d.col}else s=c.line,a=c.column}else if(!r){let u=this.fromOffset(n);n=u.line,r=u.col}let l=this.origin(n,r,s,a);return l?o=new r1(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):o=new r1(t,s===void 0?n:{column:r,line:n},s===void 0?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:n,source:this.css},this.file&&(ss&&(o.input.url=ss(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let n,r;if(this[Tc])r=this[Tc];else{let o=this.css.split(`
|
|
104
|
+
`);r=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)r[a]=s,s+=o[a].length+1;this[Tc]=r}n=r[r.length-1];let i=0;if(t>=n)i=r.length-1;else{let o=r.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<r[s])o=s-1;else if(t>=r[s+1])i=s+1;else{i=s;break}}return{col:t-r[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:Zc(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:n,line:t});if(!s.source)return!1;let a;typeof r=="number"&&(a=o.originalPositionFor({column:i,line:r}));let l;Yc(s.source)?l=ss(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||ss(this.map.mapFile));let u={column:s.column,endColumn:a&&a.column,endLine:a&&a.line,line:s.line,url:l.toString()};if(l.protocol==="file:")if(n1)u.file=n1(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(s.source);return c&&(u.source=c),u}toJSON(){let t={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},Xs=Ds;Ds.default=Ds;Mc&&Mc.registerInput&&Mc.registerInput(Ds);var{SourceMapConsumer:rS,SourceMapGenerator:Es}=mt,{dirname:ks,relative:iS,resolve:oS,sep:sS}=mt,{pathToFileURL:o1}=mt,XN=Xs,QN=!!(rS&&Es),e7=!!(ks&&oS&&iS&&sS),t7=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`
|
|
105
|
+
`;this.css.includes(`\r
|
|
106
|
+
`)&&(n=`\r
|
|
107
|
+
`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||ks(t.file),i;this.mapOpts.sourcesContent===!1?(i=new rS(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),e7&&QN&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Es.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Es({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 Es({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=t,i.generated.column=n-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
|
|
108
|
+
`),n=a.length-s):n+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=t,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!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(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?ks(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=ks(oS(r,this.mapOpts.annotation)));let i=iS(r,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new XN(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,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(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let n=this.memoizedFileURLs.get(t);if(n)return n;if(o1){let r=o1(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;sS==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}},aS=t7,n7=Zs,Jc=class extends n7{constructor(t){super(t),this.type="comment"}},Qs=Jc;Jc.default=Jc;var{isClean:lS,my:uS}=Ri,cS=Js,dS=Qs,r7=Zs,fS,$d,Ld,hS;function pS(e){return e.map(t=>(t.nodes&&(t.nodes=pS(t.nodes)),delete t.source,t))}function mS(e){if(e[lS]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)mS(t)}var Gt=class yS extends r7{append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let s of i)this.proxyOf.nodes.splice(r+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],r<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let a of o)this.proxyOf.nodes.splice(r,0,a);let s;for(let a in this.indexes)s=this.indexes[a],r<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=pS(fS(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new cS(t)]}else if(t.selector)t=[new $d(t)];else if(t.name)t=[new Ld(t)];else if(t.text)t=[new dS(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[uS]||yS.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[lS]&&mS(i),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,i)}))}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]}};Gt.registerParse=e=>{fS=e};Gt.registerRule=e=>{$d=e};Gt.registerAtRule=e=>{Ld=e};Gt.registerRoot=e=>{hS=e};var Cn=Gt;Gt.default=Gt;Gt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Ld.prototype):e.type==="rule"?Object.setPrototypeOf(e,$d.prototype):e.type==="decl"?Object.setPrototypeOf(e,cS.prototype):e.type==="comment"?Object.setPrototypeOf(e,dS.prototype):e.type==="root"&&Object.setPrototypeOf(e,hS.prototype),e[uS]=!0,e.nodes&&e.nodes.forEach(t=>{Gt.rebuild(t)})};var i7=Cn,gS,bS,pi=class extends i7{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new gS(new bS,this,t).stringify()}};pi.registerLazyResult=e=>{gS=e};pi.registerProcessor=e=>{bS=e};var _d=pi;pi.default=pi;var s1={},SS=function(t){s1[t]||(s1[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Xc=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[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}},wS=Xc;Xc.default=Xc;var o7=wS,Qc=class{constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new o7(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},Dd=Qc;Qc.default=Qc;var Oc=39,a1=34,as=92,l1=47,ls=10,oi=32,us=12,cs=9,ds=13,s7=91,a7=93,l7=40,u7=41,c7=123,d7=125,f7=59,h7=42,p7=58,m7=64,fs=/[\t\n\f\r "#'()/;[\\\]{}]/g,hs=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,y7=/.[\r\n"'(/\\]/,u1=/[\da-f]/i,g7=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,s,a,l,u,c,d,f,p,h,m=r.length,y=0,S=[],w=[];function g(){return y}function x(L){throw t.error("Unclosed "+L,y)}function I(){return w.length===0&&y>=m}function N(L){if(w.length)return w.pop();if(y>=m)return;let P=L?L.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case ls:case oi:case cs:case ds:case us:{s=y;do s+=1,o=r.charCodeAt(s);while(o===oi||o===ls||o===cs||o===ds||o===us);h=["space",r.slice(y,s)],y=s-1;break}case s7:case a7:case c7:case d7:case p7:case f7:case u7:{let j=String.fromCharCode(o);h=[j,j,y];break}case l7:{if(f=S.length?S.pop()[1]:"",p=r.charCodeAt(y+1),f==="url"&&p!==Oc&&p!==a1&&p!==oi&&p!==ls&&p!==cs&&p!==us&&p!==ds){s=y;do{if(c=!1,s=r.indexOf(")",s+1),s===-1)if(i||P){s=y;break}else x("bracket");for(d=s;r.charCodeAt(d-1)===as;)d-=1,c=!c}while(c);h=["brackets",r.slice(y,s+1),y,s],y=s}else s=r.indexOf(")",y+1),l=r.slice(y,s+1),s===-1||y7.test(l)?h=["(","(",y]:(h=["brackets",l,y,s],y=s);break}case Oc:case a1:{a=o===Oc?"'":'"',s=y;do{if(c=!1,s=r.indexOf(a,s+1),s===-1)if(i||P){s=y+1;break}else x("string");for(d=s;r.charCodeAt(d-1)===as;)d-=1,c=!c}while(c);h=["string",r.slice(y,s+1),y,s],y=s;break}case m7:{fs.lastIndex=y+1,fs.test(r),fs.lastIndex===0?s=r.length-1:s=fs.lastIndex-2,h=["at-word",r.slice(y,s+1),y,s],y=s;break}case as:{for(s=y,u=!0;r.charCodeAt(s+1)===as;)s+=1,u=!u;if(o=r.charCodeAt(s+1),u&&o!==l1&&o!==oi&&o!==ls&&o!==cs&&o!==ds&&o!==us&&(s+=1,u1.test(r.charAt(s)))){for(;u1.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===oi&&(s+=1)}h=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===l1&&r.charCodeAt(y+1)===h7?(s=r.indexOf("*/",y+2)+1,s===0&&(i||P?s=r.length:x("comment")),h=["comment",r.slice(y,s+1),y,s],y=s):(hs.lastIndex=y+1,hs.test(r),hs.lastIndex===0?s=r.length-1:s=hs.lastIndex-2,h=["word",r.slice(y,s+1),y,s],S.push(h),y=s);break}}return y++,h}function $(L){w.push(L)}return{back:$,endOfFile:I,nextToken:N,position:g}},xS=Cn,Fs=class extends xS{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}},Fd=Fs;Fs.default=Fs;xS.registerAtRule(Fs);var vS=Cn,RS,AS,ur=class extends vS{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let i=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let o of i)o.raws.before=n.raws.before}return i}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new RS(new AS,this,t).stringify()}};ur.registerLazyResult=e=>{RS=e};ur.registerProcessor=e=>{AS=e};var Ai=ur;ur.default=ur;vS.registerRoot(ur);var mi={comma(e){return mi.split(e,[","],!0)},space(e){let t=[" ",`
|
|
109
|
+
`," "];return mi.split(e,t)},split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let c of e)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?s+=1:c===")"?s>0&&(s-=1):s===0&&t.includes(c)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(n||i!=="")&&r.push(i.trim()),r}},CS=mi;mi.default=mi;var ES=Cn,b7=CS,Bs=class extends ES{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return b7.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}},Bd=Bs;Bs.default=Bs;ES.registerRule(Bs);var S7=Js,w7=g7,x7=Qs,v7=Fd,R7=Ai,c1=Bd,d1={empty:!0,space:!0};function A7(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var C7=class{constructor(t){this.input=t,this.root=new R7,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let n=new v7;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(n.source.end=this.getPosition(i[3]||i[2]),n.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(n.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(n,"params",l),s&&(t=l[l.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),a&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[s,a]of t.entries()){if(r=a,i=r[0],i==="("&&(n+=1),i===")"&&(n-=1),n===0&&i===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=r}return!1}comment(t){let n=new x7;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(/^\s*$/.test(r))n.text="",n.raws.left=r,n.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=w7(this.input)}decl(t,n){let r=new S7;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||A7(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let s=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)s.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let f=u;f>0;f--){let p=c[f][0];if(d.trim().indexOf("!")===0&&p!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(r,"value",s.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new c1;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")o||(o=u),s.push(r==="("?")":"]");else if(a&&i&&r==="{")o||(o=u),s.push("}");else if(s.length===0)if(r===";")if(i){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),n=!0;break}else r===":"&&(i=!0);else r===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),s.length>0&&this.unclosedBracket(o),n&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,n,r,i){let o,s,a=r.length,l="",u=!0,c,d;for(let f=0;f<a;f+=1)o=r[f],s=o[0],s==="space"&&f===a-1&&!i?u=!1:s==="comment"?(d=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!d1[d]&&!d1[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let f=r.reduce((p,h)=>p+h[1],"");t.raws[n]={raw:f,value:l}}t[n]=l}rule(t){t.pop();let n=new c1;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let i=n;i<t.length;i++)r+=t[i][1];return t.splice(n,t.length-n),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}},E7=C7,k7=Cn,I7=E7,P7=Xs;function js(e,t){let n=new P7(e,t),r=new I7(n);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
|
|
110
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
|
|
111
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
|
|
112
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var jd=js;js.default=js;k7.registerParse(js);var{isClean:Ct,my:M7}=Ri,T7=aS,O7=Ys,N7=Cn,$7=_d,L7=SS,f1=Dd,_7=jd,D7=Ai,F7={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},B7={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},j7={Once:!0,postcssPlugin:!0,prepare:!0},cr=0;function si(e){return typeof e=="object"&&typeof e.then=="function"}function kS(e){let t=!1,n=F7[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,cr,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,cr,n+"Exit"]:[n,n+"Exit"]}function h1(e){let t;return e.type==="document"?t=["Document",cr,"DocumentExit"]:e.type==="root"?t=["Root",cr,"RootExit"]:t=kS(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ed(e){return e[Ct]=!1,e.nodes&&e.nodes.forEach(t=>ed(t)),e}var td={},dr=class IS{constructor(t,n,r){this.stringified=!1,this.processed=!1;let i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=ed(n);else if(n instanceof IS||n instanceof f1)i=ed(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=_7;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(s){this.processed=!0,this.error=s}i&&!i[M7]&&N7.rebuild(i)}this.result=new f1(t,i,r),this.helpers={...td,postcss:td,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(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let r=this.result.lastPlugin;try{if(n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=r.postcssPlugin,t.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,o=r.postcssVersion,s=this.result.processor.version,a=o.split("."),l=s.split(".");(a[0]!==l[0]||parseInt(a[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!B7[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!j7[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(si(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ct];){t[Ct]=!0;let n=[h1(t)];for(;n.length>0;){let r=this.visitTick(n);if(si(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return si(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=O7;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let i=new T7(n,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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 t of this.plugins){let n=this.runOnRoot(t);if(si(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ct];)t[Ct]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this.opts||L7("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(t,n)}toString(){return this.css}visitSync(t,n){for(let[r,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(s){throw this.handleError(s,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(si(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[s,a]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=s;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(n.iterator!==0){let s=n.iterator,a;for(;a=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!a[Ct]){a[Ct]=!0,t.push(h1(a));return}n.iterator=0,delete r.indexes[s]}let o=n.events;for(;n.eventIndex<o.length;){let s=o[n.eventIndex];if(n.eventIndex+=1,s===cr){r.nodes&&r.nodes.length&&(r[Ct]=!0,n.iterator=r.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[Ct]=!0;let n=kS(t);for(let r of n)if(r===cr)t.nodes&&t.each(i=>{i[Ct]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,t.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"}};dr.registerPostcss=e=>{td=e};var PS=dr;dr.default=dr;D7.registerLazyResult(dr);$7.registerLazyResult(dr);var U7=aS,V7=Ys,W7=SS,z7=jd,G7=Dd,nd=class{constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let i,o=V7;this.result=new G7(this._processor,i,this._opts),this.result.css=n;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new U7(o,i,this._opts,n);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this._opts||W7("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(t,n)}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 t,n=z7;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},H7=nd;nd.default=nd;var q7=H7,K7=PS,Y7=_d,Z7=Ai,yi=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(typeof r=="object"&&(r.parse||r.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(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new q7(this,t,n):new K7(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},J7=yi;yi.default=yi;Z7.registerProcessor(yi);Y7.registerProcessor(yi);var X7=Js,Q7=nS,e5=Qs,t5=Fd,n5=Xs,r5=Ai,i5=Bd;function gi(e,t){if(Array.isArray(e))return e.map(i=>gi(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:n5.prototype};o.map&&(o.map={...o.map,__proto__:Q7.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>gi(i,t))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=t[i])}if(r.type==="root")return new r5(r);if(r.type==="decl")return new X7(r);if(r.type==="rule")return new i5(r);if(r.type==="comment")return new e5(r);if(r.type==="atrule")return new t5(r);throw new Error("Unknown node type: "+e.type)}var o5=gi;gi.default=gi;var s5=Nd,MS=Js,a5=PS,l5=Cn,Ud=J7,u5=Ys,c5=o5,TS=_d,d5=wS,OS=Qs,NS=Fd,f5=Dd,h5=Xs,p5=jd,m5=CS,$S=Bd,LS=Ai,y5=Zs;function ee(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Ud(e)}ee.plugin=function(t,n){let r=!1;function i(...s){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
113
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
114
|
+
https://www.w3ctech.com/topic/2226`));let a=n(...s);return a.postcssPlugin=t,a.postcssVersion=new Ud().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return ee([i(l)]).process(s,a)},i};ee.stringify=u5;ee.parse=p5;ee.fromJSON=c5;ee.list=m5;ee.comment=e=>new OS(e);ee.atRule=e=>new NS(e);ee.decl=e=>new MS(e);ee.rule=e=>new $S(e);ee.root=e=>new LS(e);ee.document=e=>new TS(e);ee.CssSyntaxError=s5;ee.Declaration=MS;ee.Container=l5;ee.Processor=Ud;ee.Document=TS;ee.Comment=OS;ee.Warning=d5;ee.AtRule=NS;ee.Result=f5;ee.Input=h5;ee.Rule=$S;ee.Root=LS;ee.Node=y5;a5.registerPostcss(ee);var g5=ee;ee.default=ee;var pe=kN(g5);pe.stringify;pe.fromJSON;pe.plugin;pe.parse;pe.list;pe.document;pe.comment;pe.atRule;pe.rule;pe.decl;pe.root;pe.CssSyntaxError;pe.Declaration;pe.Container;pe.Processor;pe.Document;pe.Comment;pe.Warning;pe.AtRule;pe.Result;pe.Input;pe.Rule;pe.Root;pe.Node;var b5=Object.defineProperty,S5=(e,t,n)=>t in e?b5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nt=(e,t,n)=>S5(e,typeof t!="symbol"?t+"":t,n);function w5(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function x5(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Vd={exports:{}},fe=String,_S=function(){return{isColorSupported:!1,reset:fe,bold:fe,dim:fe,italic:fe,underline:fe,inverse:fe,hidden:fe,strikethrough:fe,black:fe,red:fe,green:fe,yellow:fe,blue:fe,magenta:fe,cyan:fe,white:fe,gray:fe,bgBlack:fe,bgRed:fe,bgGreen:fe,bgYellow:fe,bgBlue:fe,bgMagenta:fe,bgCyan:fe,bgWhite:fe}};Vd.exports=_S();Vd.exports.createColors=_S;var v5=Vd.exports,R5={},A5=Object.freeze(Object.defineProperty({__proto__:null,default:R5},Symbol.toStringTag,{value:"Module"})),yt=x5(A5),p1=v5,m1=yt,rd=class DS extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,DS)}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(t){if(!this.source)return"";let n=this.source;t==null&&(t=p1.isColorSupported),m1&&t&&(n=m1(n));let r=n.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=p1.createColors(!0);a=f=>u(d(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let d=i+1+c,f=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let p=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+`
|
|
115
|
+
`+p+a("^")}return" "+l(f)+u}).join(`
|
|
116
|
+
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
117
|
+
|
|
118
|
+
`+t+`
|
|
119
|
+
`),this.name+": "+this.message+t}},Wd=rd;rd.default=rd;var Ci={};Ci.isClean=Symbol("isClean");Ci.my=Symbol("my");var y1={after:`
|
|
120
|
+
`,beforeClose:`
|
|
121
|
+
`,beforeComment:`
|
|
122
|
+
`,beforeDecl:`
|
|
123
|
+
`,beforeOpen:" ",beforeRule:`
|
|
124
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function C5(e){return e[0].toUpperCase()+e.slice(1)}var id=class{constructor(t){this.builder=t}atrule(t,n){let r="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?r+=t.raws.afterName:i&&(r+=" "),t.nodes)this.block(t,r+i);else{let o=(t.raws.between||"")+(n?";":"");this.builder(r+i+o,t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
|
|
125
|
+
`)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)r+=s}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(n+r+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let n=t.nodes.length-1;for(;n>0&&t.nodes[n].type==="comment";)n-=1;let r=this.raw(t,"semicolon");for(let i=0;i<t.nodes.length;i++){let o=t.nodes[i],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,n!==i||r)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder("/*"+n+t.text+r+"*/",t)}decl(t,n){let r=this.raw(t,"between","colon"),i=t.prop+r+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),n&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return y1[r];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[r]<"u")return s.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let a="raw"+C5(r);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=y1[r]),s.rawCache[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`
|
|
126
|
+
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
|
|
127
|
+
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(t,n){let r;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
|
|
128
|
+
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(t){let n;return t.walk(r=>{if(r.type!=="decl"&&(n=r.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return n=r.raws.before,n.includes(`
|
|
129
|
+
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawColon(t){let n;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return n=r.raws.between.replace(/[^\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(n=r.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(r=>{let i=r.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof r.raws.before<"u"){let o=r.raws.before.split(`
|
|
130
|
+
`);return n=o[o.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],i=t.raws[n];return i&&i.value===r?i.raw:r}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}},FS=id;id.default=id;var E5=FS;function od(e,t){new E5(t).stringify(e)}var ea=od;od.default=od;var{isClean:ps,my:k5}=Ci,I5=Wd,P5=FS,M5=ea;function sd(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let i=e[r],o=typeof i;r==="parent"&&o==="object"?t&&(n[r]=t):r==="source"?n[r]=i:Array.isArray(i)?n[r]=i.map(s=>sd(s,n)):(o==="object"&&i!==null&&(i=sd(i)),n[r]=i)}return n}var ad=class{constructor(t={}){this.raws={},this[ps]=!1,this[k5]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let n=sd(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new I5(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markDirty(){if(this[ps]){this[ps]=!1;let t=this;for(;t=t.parent;)t[ps]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,n){let r=this.source.start;if(t.index)r=this.positionInside(t.index,n);else if(t.word){n=this.toString();let i=n.indexOf(t.word);i!==-1&&(r=this.positionInside(i,n))}return r}positionInside(t,n){let r=n||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)r[s]===`
|
|
131
|
+
`?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let n={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:n.column+1,line:n.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(n=this.positionInside(o,i),r=this.positionInside(o+t.word.length,i))}else t.start?n={column:t.start.column,line:t.start.line}:t.index&&(n=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<n.line||r.line===n.line&&r.column<=n.column)&&(r={column:n.column+1,line:n.line}),{end:r,start:n}}raw(t,n){return new P5().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r={},i=n==null;n=n||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let a=this[s];if(Array.isArray(a))r[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,n):l);else if(typeof a=="object"&&a.toJSON)r[s]=a.toJSON(null,n);else if(s==="source"){let l=n.get(a.input);l==null&&(l=o,n.set(a.input,o),o++),r[s]={end:a.end,inputId:l,start:a.start}}else r[s]=a}return i&&(r.inputs=[...n.keys()].map(s=>s.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=M5){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}get proxyOf(){return this}},ta=ad;ad.default=ad;var T5=ta,ld=class extends T5{constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},na=ld;ld.default=ld;var O5="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",N5=(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r},$5=(e=21)=>{let t="",n=e;for(;n--;)t+=O5[Math.random()*64|0];return t},L5={nanoid:$5,customAlphabet:N5},{SourceMapConsumer:g1,SourceMapGenerator:b1}=yt,{existsSync:_5,readFileSync:D5}=yt,{dirname:Nc,join:F5}=yt;function B5(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var ud=class{constructor(t,n){if(n.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Nc(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new g1(this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(t)||o.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(n.test(t)||r.test(t))return B5(t.substr(RegExp.lastMatch.length));let s=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let r=t.lastIndexOf(n.pop()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t){if(this.root=Nc(t),_5(t))return this.mapFile=t,D5(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof g1)return b1.fromSourceMap(n).toString();if(n instanceof b1)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return t&&(r=F5(Nc(t),r)),this.loadFile(r)}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},BS=ud;ud.default=ud;var{SourceMapConsumer:j5,SourceMapGenerator:U5}=yt,{fileURLToPath:S1,pathToFileURL:ms}=yt,{isAbsolute:cd,resolve:dd}=yt,{nanoid:V5}=L5,$c=yt,w1=Wd,W5=BS,Lc=Symbol("fromOffsetCache"),z5=!!(j5&&U5),x1=!!(dd&&cd),Us=class{constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!x1||/^\w+:\/\//.test(n.from)||cd(n.from)?this.file=n.from:this.file=dd(n.from)),x1&&z5){let r=new W5(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+V5(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,s,a;if(n&&typeof n=="object"){let u=n,c=r;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);n=d.line,r=d.col}else n=u.line,r=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);s=d.line,a=d.col}else s=c.line,a=c.column}else if(!r){let u=this.fromOffset(n);n=u.line,r=u.col}let l=this.origin(n,r,s,a);return l?o=new w1(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):o=new w1(t,s===void 0?n:{column:r,line:n},s===void 0?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:n,source:this.css},this.file&&(ms&&(o.input.url=ms(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let n,r;if(this[Lc])r=this[Lc];else{let o=this.css.split(`
|
|
132
|
+
`);r=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)r[a]=s,s+=o[a].length+1;this[Lc]=r}n=r[r.length-1];let i=0;if(t>=n)i=r.length-1;else{let o=r.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<r[s])o=s-1;else if(t>=r[s+1])i=s+1;else{i=s;break}}return{col:t-r[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:dd(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:n,line:t});if(!s.source)return!1;let a;typeof r=="number"&&(a=o.originalPositionFor({column:i,line:r}));let l;cd(s.source)?l=ms(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||ms(this.map.mapFile));let u={column:s.column,endColumn:a&&a.column,endLine:a&&a.line,line:s.line,url:l.toString()};if(l.protocol==="file:")if(S1)u.file=S1(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(s.source);return c&&(u.source=c),u}toJSON(){let t={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},ra=Us;Us.default=Us;$c&&$c.registerInput&&$c.registerInput(Us);var{SourceMapConsumer:jS,SourceMapGenerator:Is}=yt,{dirname:Ps,relative:US,resolve:VS,sep:WS}=yt,{pathToFileURL:v1}=yt,G5=ra,H5=!!(jS&&Is),q5=!!(Ps&&VS&&US&&WS),K5=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`
|
|
133
|
+
`;this.css.includes(`\r
|
|
134
|
+
`)&&(n=`\r
|
|
135
|
+
`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||Ps(t.file),i;this.mapOpts.sourcesContent===!1?(i=new jS(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),q5&&H5&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Is.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Is({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 Is({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=t,i.generated.column=n-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
|
|
136
|
+
`),n=a.length-s):n+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=t,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!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(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?Ps(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Ps(VS(r,this.mapOpts.annotation)));let i=US(r,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new G5(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,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(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let n=this.memoizedFileURLs.get(t);if(n)return n;if(v1){let r=v1(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;WS==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}},zS=K5,Y5=ta,fd=class extends Y5{constructor(t){super(t),this.type="comment"}},ia=fd;fd.default=fd;var{isClean:GS,my:HS}=Ci,qS=na,KS=ia,Z5=ta,YS,zd,Gd,ZS;function JS(e){return e.map(t=>(t.nodes&&(t.nodes=JS(t.nodes)),delete t.source,t))}function XS(e){if(e[GS]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)XS(t)}var Ht=class QS extends Z5{append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let s of i)this.proxyOf.nodes.splice(r+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],r<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let a of o)this.proxyOf.nodes.splice(r,0,a);let s;for(let a in this.indexes)s=this.indexes[a],r<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=JS(YS(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new qS(t)]}else if(t.selector)t=[new zd(t)];else if(t.name)t=[new Gd(t)];else if(t.text)t=[new KS(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[HS]||QS.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[GS]&&XS(i),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,i)}))}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]}};Ht.registerParse=e=>{YS=e};Ht.registerRule=e=>{zd=e};Ht.registerAtRule=e=>{Gd=e};Ht.registerRoot=e=>{ZS=e};var En=Ht;Ht.default=Ht;Ht.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Gd.prototype):e.type==="rule"?Object.setPrototypeOf(e,zd.prototype):e.type==="decl"?Object.setPrototypeOf(e,qS.prototype):e.type==="comment"?Object.setPrototypeOf(e,KS.prototype):e.type==="root"&&Object.setPrototypeOf(e,ZS.prototype),e[HS]=!0,e.nodes&&e.nodes.forEach(t=>{Ht.rebuild(t)})};var J5=En,ew,tw,bi=class extends J5{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new ew(new tw,this,t).stringify()}};bi.registerLazyResult=e=>{ew=e};bi.registerProcessor=e=>{tw=e};var Hd=bi;bi.default=bi;var R1={},nw=function(t){R1[t]||(R1[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},hd=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[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}},rw=hd;hd.default=hd;var X5=rw,pd=class{constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new X5(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},qd=pd;pd.default=pd;var _c=39,A1=34,ys=92,C1=47,gs=10,ai=32,bs=12,Ss=9,ws=13,Q5=91,e$=93,t$=40,n$=41,r$=123,i$=125,o$=59,s$=42,a$=58,l$=64,xs=/[\t\n\f\r "#'()/;[\\\]{}]/g,vs=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,u$=/.[\r\n"'(/\\]/,E1=/[\da-f]/i,c$=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,s,a,l,u,c,d,f,p,h,m=r.length,y=0,S=[],w=[];function g(){return y}function x(L){throw t.error("Unclosed "+L,y)}function I(){return w.length===0&&y>=m}function N(L){if(w.length)return w.pop();if(y>=m)return;let P=L?L.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case gs:case ai:case Ss:case ws:case bs:{s=y;do s+=1,o=r.charCodeAt(s);while(o===ai||o===gs||o===Ss||o===ws||o===bs);h=["space",r.slice(y,s)],y=s-1;break}case Q5:case e$:case r$:case i$:case a$:case o$:case n$:{let j=String.fromCharCode(o);h=[j,j,y];break}case t$:{if(f=S.length?S.pop()[1]:"",p=r.charCodeAt(y+1),f==="url"&&p!==_c&&p!==A1&&p!==ai&&p!==gs&&p!==Ss&&p!==bs&&p!==ws){s=y;do{if(c=!1,s=r.indexOf(")",s+1),s===-1)if(i||P){s=y;break}else x("bracket");for(d=s;r.charCodeAt(d-1)===ys;)d-=1,c=!c}while(c);h=["brackets",r.slice(y,s+1),y,s],y=s}else s=r.indexOf(")",y+1),l=r.slice(y,s+1),s===-1||u$.test(l)?h=["(","(",y]:(h=["brackets",l,y,s],y=s);break}case _c:case A1:{a=o===_c?"'":'"',s=y;do{if(c=!1,s=r.indexOf(a,s+1),s===-1)if(i||P){s=y+1;break}else x("string");for(d=s;r.charCodeAt(d-1)===ys;)d-=1,c=!c}while(c);h=["string",r.slice(y,s+1),y,s],y=s;break}case l$:{xs.lastIndex=y+1,xs.test(r),xs.lastIndex===0?s=r.length-1:s=xs.lastIndex-2,h=["at-word",r.slice(y,s+1),y,s],y=s;break}case ys:{for(s=y,u=!0;r.charCodeAt(s+1)===ys;)s+=1,u=!u;if(o=r.charCodeAt(s+1),u&&o!==C1&&o!==ai&&o!==gs&&o!==Ss&&o!==ws&&o!==bs&&(s+=1,E1.test(r.charAt(s)))){for(;E1.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===ai&&(s+=1)}h=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===C1&&r.charCodeAt(y+1)===s$?(s=r.indexOf("*/",y+2)+1,s===0&&(i||P?s=r.length:x("comment")),h=["comment",r.slice(y,s+1),y,s],y=s):(vs.lastIndex=y+1,vs.test(r),vs.lastIndex===0?s=r.length-1:s=vs.lastIndex-2,h=["word",r.slice(y,s+1),y,s],S.push(h),y=s);break}}return y++,h}function $(L){w.push(L)}return{back:$,endOfFile:I,nextToken:N,position:g}},iw=En,Vs=class extends iw{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}},Kd=Vs;Vs.default=Vs;iw.registerAtRule(Vs);var ow=En,sw,aw,fr=class extends ow{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let i=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let o of i)o.raws.before=n.raws.before}return i}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new sw(new aw,this,t).stringify()}};fr.registerLazyResult=e=>{sw=e};fr.registerProcessor=e=>{aw=e};var Ei=fr;fr.default=fr;ow.registerRoot(fr);var Si={comma(e){return Si.split(e,[","],!0)},space(e){let t=[" ",`
|
|
137
|
+
`," "];return Si.split(e,t)},split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let c of e)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?s+=1:c===")"?s>0&&(s-=1):s===0&&t.includes(c)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(n||i!=="")&&r.push(i.trim()),r}},lw=Si;Si.default=Si;var uw=En,d$=lw,Ws=class extends uw{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return d$.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}},Yd=Ws;Ws.default=Ws;uw.registerRule(Ws);var f$=na,h$=c$,p$=ia,m$=Kd,y$=Ei,k1=Yd,I1={empty:!0,space:!0};function g$(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var b$=class{constructor(t){this.input=t,this.root=new y$,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let n=new m$;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(n.source.end=this.getPosition(i[3]||i[2]),n.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(n.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(n,"params",l),s&&(t=l[l.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),a&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[s,a]of t.entries()){if(r=a,i=r[0],i==="("&&(n+=1),i===")"&&(n-=1),n===0&&i===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=r}return!1}comment(t){let n=new p$;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(/^\s*$/.test(r))n.text="",n.raws.left=r,n.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=h$(this.input)}decl(t,n){let r=new f$;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||g$(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let s=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)s.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let f=u;f>0;f--){let p=c[f][0];if(d.trim().indexOf("!")===0&&p!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(r,"value",s.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new k1;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")o||(o=u),s.push(r==="("?")":"]");else if(a&&i&&r==="{")o||(o=u),s.push("}");else if(s.length===0)if(r===";")if(i){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),n=!0;break}else r===":"&&(i=!0);else r===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),s.length>0&&this.unclosedBracket(o),n&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,n,r,i){let o,s,a=r.length,l="",u=!0,c,d;for(let f=0;f<a;f+=1)o=r[f],s=o[0],s==="space"&&f===a-1&&!i?u=!1:s==="comment"?(d=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!I1[d]&&!I1[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let f=r.reduce((p,h)=>p+h[1],"");t.raws[n]={raw:f,value:l}}t[n]=l}rule(t){t.pop();let n=new k1;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let i=n;i<t.length;i++)r+=t[i][1];return t.splice(n,t.length-n),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}},S$=b$,w$=En,x$=S$,v$=ra;function zs(e,t){let n=new v$(e,t),r=new x$(n);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
|
|
138
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
|
|
139
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
|
|
140
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Zd=zs;zs.default=zs;w$.registerParse(zs);var{isClean:Et,my:R$}=Ci,A$=zS,C$=ea,E$=En,k$=Hd,I$=nw,P1=qd,P$=Zd,M$=Ei,T$={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},O$={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},N$={Once:!0,postcssPlugin:!0,prepare:!0},hr=0;function li(e){return typeof e=="object"&&typeof e.then=="function"}function cw(e){let t=!1,n=T$[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,hr,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,hr,n+"Exit"]:[n,n+"Exit"]}function M1(e){let t;return e.type==="document"?t=["Document",hr,"DocumentExit"]:e.type==="root"?t=["Root",hr,"RootExit"]:t=cw(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function md(e){return e[Et]=!1,e.nodes&&e.nodes.forEach(t=>md(t)),e}var yd={},pr=class dw{constructor(t,n,r){this.stringified=!1,this.processed=!1;let i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=md(n);else if(n instanceof dw||n instanceof P1)i=md(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=P$;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(s){this.processed=!0,this.error=s}i&&!i[R$]&&E$.rebuild(i)}this.result=new P1(t,i,r),this.helpers={...yd,postcss:yd,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(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let r=this.result.lastPlugin;try{if(n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=r.postcssPlugin,t.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,o=r.postcssVersion,s=this.result.processor.version,a=o.split("."),l=s.split(".");(a[0]!==l[0]||parseInt(a[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!O$[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!N$[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(li(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Et];){t[Et]=!0;let n=[M1(t)];for(;n.length>0;){let r=this.visitTick(n);if(li(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return li(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=C$;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let i=new A$(n,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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 t of this.plugins){let n=this.runOnRoot(t);if(li(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Et];)t[Et]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this.opts||I$("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(t,n)}toString(){return this.css}visitSync(t,n){for(let[r,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(s){throw this.handleError(s,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(li(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[s,a]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=s;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(n.iterator!==0){let s=n.iterator,a;for(;a=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!a[Et]){a[Et]=!0,t.push(M1(a));return}n.iterator=0,delete r.indexes[s]}let o=n.events;for(;n.eventIndex<o.length;){let s=o[n.eventIndex];if(n.eventIndex+=1,s===hr){r.nodes&&r.nodes.length&&(r[Et]=!0,n.iterator=r.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[Et]=!0;let n=cw(t);for(let r of n)if(r===hr)t.nodes&&t.each(i=>{i[Et]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,t.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"}};pr.registerPostcss=e=>{yd=e};var fw=pr;pr.default=pr;M$.registerLazyResult(pr);k$.registerLazyResult(pr);var $$=zS,L$=ea,_$=nw,D$=Zd,F$=qd,gd=class{constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let i,o=L$;this.result=new F$(this._processor,i,this._opts),this.result.css=n;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new $$(o,i,this._opts,n);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this._opts||_$("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(t,n)}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 t,n=D$;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},B$=gd;gd.default=gd;var j$=B$,U$=fw,V$=Hd,W$=Ei,wi=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(typeof r=="object"&&(r.parse||r.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(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new j$(this,t,n):new U$(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},z$=wi;wi.default=wi;W$.registerProcessor(wi);V$.registerProcessor(wi);var G$=na,H$=BS,q$=ia,K$=Kd,Y$=ra,Z$=Ei,J$=Yd;function xi(e,t){if(Array.isArray(e))return e.map(i=>xi(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:Y$.prototype};o.map&&(o.map={...o.map,__proto__:H$.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>xi(i,t))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=t[i])}if(r.type==="root")return new Z$(r);if(r.type==="decl")return new G$(r);if(r.type==="rule")return new J$(r);if(r.type==="comment")return new q$(r);if(r.type==="atrule")return new K$(r);throw new Error("Unknown node type: "+e.type)}var X$=xi;xi.default=xi;var Q$=Wd,hw=na,e9=fw,t9=En,Jd=z$,n9=ea,r9=X$,pw=Hd,i9=rw,mw=ia,yw=Kd,o9=qd,s9=ra,a9=Zd,l9=lw,gw=Yd,bw=Ei,u9=ta;function te(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Jd(e)}te.plugin=function(t,n){let r=!1;function i(...s){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
141
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
142
|
+
https://www.w3ctech.com/topic/2226`));let a=n(...s);return a.postcssPlugin=t,a.postcssVersion=new Jd().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return te([i(l)]).process(s,a)},i};te.stringify=n9;te.parse=a9;te.fromJSON=r9;te.list=l9;te.comment=e=>new mw(e);te.atRule=e=>new yw(e);te.decl=e=>new hw(e);te.rule=e=>new gw(e);te.root=e=>new bw(e);te.document=e=>new pw(e);te.CssSyntaxError=Q$;te.Declaration=hw;te.Container=t9;te.Processor=Jd;te.Document=pw;te.Comment=mw;te.Warning=i9;te.AtRule=yw;te.Result=o9;te.Input=s9;te.Rule=gw;te.Root=bw;te.Node=u9;e9.registerPostcss(te);var c9=te;te.default=te;var me=w5(c9);me.stringify;me.fromJSON;me.plugin;me.parse;me.list;me.document;me.comment;me.atRule;me.rule;me.decl;me.root;me.CssSyntaxError;me.Declaration;me.Container;me.Processor;me.Document;me.Comment;me.Warning;me.AtRule;me.Result;me.Input;me.Rule;me.Root;me.Node;var bd=class e{constructor(...t){nt(this,"parentElement",null),nt(this,"parentNode",null),nt(this,"ownerDocument"),nt(this,"firstChild",null),nt(this,"lastChild",null),nt(this,"previousSibling",null),nt(this,"nextSibling",null),nt(this,"ELEMENT_NODE",1),nt(this,"TEXT_NODE",3),nt(this,"nodeType"),nt(this,"nodeName"),nt(this,"RRNodeType")}get childNodes(){let t=[],n=this.firstChild;for(;n;)t.push(n),n=n.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,n){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 T1={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},O1={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Rs={},d9=()=>!!globalThis.Zone;function Xd(e){if(Rs[e])return Rs[e];let t=globalThis[e],n=t.prototype,r=e in T1?T1[e]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(n,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in O1?O1[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof n[a]=="function"&&((l=n[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!d9())return Rs[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let u=l[e].prototype;return document.body.removeChild(a),u?Rs[e]=u:n}catch{return n}}var Dc={};function Kt(e,t,n){var r;let i=`${e}.${String(n)}`;if(Dc[i])return Dc[i].call(t);let o=Xd(e),s=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return s?(Dc[i]=s,s.call(t)):t[n]}var Fc={};function Sw(e,t,n){let r=`${e}.${String(n)}`;if(Fc[r])return Fc[r].bind(t);let o=Xd(e)[n];return typeof o!="function"?t[n]:(Fc[r]=o,o.bind(t))}function f9(e){return Kt("Node",e,"ownerDocument")}function h9(e){return Kt("Node",e,"childNodes")}function p9(e){return Kt("Node",e,"parentNode")}function m9(e){return Kt("Node",e,"parentElement")}function y9(e){return Kt("Node",e,"textContent")}function g9(e,t){return Sw("Node",e,"contains")(t)}function b9(e){return Sw("Node",e,"getRootNode")()}function S9(e){return!e||!("host"in e)?null:Kt("ShadowRoot",e,"host")}function w9(e){return e.styleSheets}function x9(e){return!e||!("shadowRoot"in e)?null:Kt("Element",e,"shadowRoot")}function v9(e,t){return Kt("Element",e,"querySelector")(t)}function R9(e,t){return Kt("Element",e,"querySelectorAll")(t)}function ww(){return Xd("MutationObserver").constructor}function kn(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var B={ownerDocument:f9,childNodes:h9,parentNode:p9,parentElement:m9,textContent:y9,contains:g9,getRootNode:b9,host:S9,styleSheets:w9,shadowRoot:x9,querySelector:v9,querySelectorAll:R9,mutationObserver:ww,patch:kn};function Ue(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var ir=`Please stop import mirror directly. Instead of that,\r
|
|
143
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
144
|
+
or you can use record.mirror to access the mirror instance during recording.`,N1={map:{},getId(){return console.error(ir),-1},getNode(){return console.error(ir),null},removeNodeFromMap(){console.error(ir)},has(){return console.error(ir),!1},reset(){console.error(ir)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(N1=new Proxy(N1,{get(e,t,n){return t==="map"&&console.error(ir),Reflect.get(e,t,n)}}));function vi(e,t,n={}){let r=null,i=0;return function(...o){let s=Date.now();!i&&n.leading===!1&&(i=s);let a=t-(s-i),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=s,e.apply(l,o)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(l,o)},a))}}function oa(e,t,n,r,i=window){let o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(s){setTimeout(()=>{n.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>oa(e,t,o||{},!0)}var Gs=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Gs=()=>new Date().getTime());function xw(e){var t,n,r,i;let o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||o?.body&&((t=B.parentElement(o.body))==null?void 0:t.scrollLeft)||((n=o?.body)==null?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:o?.documentElement.scrollTop||o?.body&&((r=B.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o?.body)==null?void 0:i.scrollTop)||0}}function vw(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Rw(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Aw(e){return e?e.nodeType===e.ELEMENT_NODE?e:B.parentElement(e):null}function Ve(e,t,n,r){if(!e)return!1;let i=Aw(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||r&&i.closest("."+t)!==null)return!0}else if(_s(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function A9(e,t){return t.getId(e)!==-1}function Bc(e,t,n){return e.tagName==="TITLE"&&n.headTitleMutations?!0:t.getId(e)===hi}function Cw(e,t){if(ci(e))return!1;let n=t.getId(e);if(!t.has(n))return!0;let r=B.parentNode(e);return r&&r.nodeType===e.DOCUMENT_NODE?!1:r?Cw(r,t):!0}function Sd(e){return!!e.changedTouches}function C9(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 Ew(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function kw(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function wd(e){return e?e instanceof bd&&"shadowRoot"in e?!!e.shadowRoot:!!B.shadowRoot(e):!1}var xd=class{constructor(){A(this,"id",1),A(this,"styleIDMap",new WeakMap),A(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}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 Iw(e){var t;let n=null;return"getRootNode"in e&&((t=B.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&B.host(B.getRootNode(e))&&(n=B.host(B.getRootNode(e))),n}function E9(e){let t=e,n;for(;n=Iw(t);)t=n;return t}function k9(e){let t=B.ownerDocument(e);if(!t)return!1;let n=E9(e);return B.contains(t,n)}function Pw(e){let t=B.ownerDocument(e);return t?B.contains(t,e)||k9(e):!1}var H=(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))(H||{}),z=(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))(z||{}),Ge=(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))(Ge||{}),zt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(zt||{}),mr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(mr||{}),or=(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))(or||{});var Mw=(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))(Mw||{});function $1(e){return"__ln"in e}var vd=class{constructor(){A(this,"length",0),A(this,"head",null),A(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){let n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&$1(t.previousSibling)){let r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&$1(t.nextSibling)&&t.nextSibling.__ln.previous){let r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){let n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},L1=(e,t)=>`${e}@${t}`,Rd=class{constructor(){A(this,"frozen",!1),A(this,"locked",!1),A(this,"texts",[]),A(this,"attributes",[]),A(this,"attributeMap",new WeakMap),A(this,"removes",[]),A(this,"mapRemoves",[]),A(this,"movedMap",{}),A(this,"addedSet",new Set),A(this,"movedSet",new Set),A(this,"droppedSet",new Set),A(this,"removesSubTreeCache",new Set),A(this,"mutationCb"),A(this,"blockClass"),A(this,"blockSelector"),A(this,"maskTextClass"),A(this,"maskTextSelector"),A(this,"inlineStylesheet"),A(this,"maskInputOptions"),A(this,"maskTextFn"),A(this,"maskInputFn"),A(this,"keepIframeSrcFn"),A(this,"recordCanvas"),A(this,"inlineImages"),A(this,"slimDOMOptions"),A(this,"dataURLOptions"),A(this,"doc"),A(this,"mirror"),A(this,"iframeManager"),A(this,"stylesheetManager"),A(this,"shadowDomManager"),A(this,"canvasManager"),A(this,"processedNodeManager"),A(this,"unattachedDoc"),A(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),A(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],n=new Set,r=new vd,i=l=>{let u=l,c=hi;for(;c===hi;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{let u=B.parentNode(l);if(!u||!Pw(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){let h=u.tagName;if(h==="TEXTAREA")return;h==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let d=ci(u)?this.mirror.getId(Iw(l)):this.mirror.getId(u),f=i(l);if(d===-1||f===-1)return r.addNode(l);let p=ar(l,{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:h=>{Ew(h,this.mirror)&&this.iframeManager.addIframe(h),kw(h,this.mirror)&&this.stylesheetManager.trackLinkElement(h),wd(l)&&this.shadowDomManager.addShadowRoot(B.shadowRoot(l),this.doc)},onIframeLoad:(h,m)=>{this.iframeManager.attachIframe(h,m),this.shadowDomManager.observeAttachShadow(h)},onStylesheetLoad:(h,m)=>{this.stylesheetManager.attachLinkElement(h,m)},cssCaptured:c});p&&(t.push({parentId:d,nextId:f,node:p}),n.add(p.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)_1(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(B.parentNode(l))||o(l);for(let l of this.addedSet)!D1(this.droppedSet,l)&&!_1(this.removesSubTreeCache,l,this.mirror)||D1(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;r.length;){let l=null;if(s){let u=this.mirror.getId(B.parentNode(s.value)),c=i(s.value);u!==-1&&c!==-1&&(l=s)}if(!l){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let d=this.mirror.getId(B.parentNode(c.value));if(i(c.value)===-1)continue;if(d!==-1){l=c;break}else{let p=c.value,h=B.parentNode(p);if(h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=B.host(h);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}s=l.previous,r.removeNode(l.value),o(l.value)}let a={texts:this.texts.map(l=>{let u=l.node,c=B.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{let{attributes:u}=l;if(typeof u.style=="string"){let c=JSON.stringify(l.styleDiff),d=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+d).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.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(a))}),A(this,"genTextAreaValueMutation",t=>{let n=this.attributeMap.get(t);n||(n={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(t,n));let r=Array.from(B.childNodes(t),i=>B.textContent(i)||"").join("");n.attributes.value=Ns({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:$s(t),value:r,maskInputFn:this.maskInputFn})}),A(this,"processMutation",t=>{if(!Bc(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let n=B.textContent(t.target);!Ve(t.target,this.blockClass,this.blockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:J1(t.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,Aw(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{let n=t.target,r=t.attributeName,i=t.target.getAttribute(r);if(r==="value"){let s=$s(n);i=Ns({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:s,value:i,maskInputFn:this.maskInputFn})}if(Ve(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!n.contentDocument)r="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!Z1(n.tagName,r))if(o.attributes[r]=Y1(this.doc,An(n.tagName),An(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let s=this.unattachedDoc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue);for(let a of Array.from(n.style)){let l=n.style.getPropertyValue(a),u=n.style.getPropertyPriority(a);l!==s.style.getPropertyValue(a)||u!==s.style.getPropertyPriority(a)?u===""?o.styleDiff[a]=l:o.styleDiff[a]=[l,u]:o._unchangedStyles[a]=[l,u]}for(let a of Array.from(s.style))n.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else r==="open"&&n.tagName==="DIALOG"&&(n.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(Ve(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{let r=this.mirror.getId(n),i=ci(t.target)?this.mirror.getId(B.host(t.target)):this.mirror.getId(t.target);Ve(t.target,this.blockClass,this.blockSelector,!1)||Bc(n,this.mirror,this.slimDOMOptions)||!A9(n,this.mirror)||(this.addedSet.has(n)?(Ad(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||Cw(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[L1(r,i)]?Ad(this.movedSet,n):(this.removes.push({parentId:i,id:r,isShadow:ci(t.target)&&di(t.target)?!0:void 0}),I9(n,this.removesSubTreeCache))),this.mapRemoves.push(n))});break}}}),A(this,"genAdds",(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Bc(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[L1(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ve(t,this.blockClass,this.blockSelector,!1)||(B.childNodes(t).forEach(r=>this.genAdds(r)),wd(t)&&B.childNodes(B.shadowRoot(t)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,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(n=>{this[n]=t[n]})}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 Ad(e,t){e.delete(t),B.childNodes(t).forEach(n=>Ad(e,n))}function I9(e,t){let n=[e];for(;n.length;){let r=n.pop();t.has(r)||(t.add(r),B.childNodes(r).forEach(i=>n.push(i)))}}function _1(e,t,n){return e.size===0?!1:P9(e,t)}function P9(e,t,n){let r=B.parentNode(t);return r?e.has(r):!1}function D1(e,t){return e.size===0?!1:Tw(e,t)}function Tw(e,t){let n=B.parentNode(t);return n?e.has(n)?!0:Tw(e,n):!1}var fi;function M9(e){fi=e}function T9(){fi=void 0}var K=e=>fi?(...n)=>{try{return e(...n)}catch(r){if(fi&&fi(r)===!0)return;throw r}}:e,Rn=[];function ki(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 Ow(e,t){let n=new Rd;Rn.push(n),n.init(e);let r=new(ww())(K(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function O9({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=vi(K(d=>{let f=Date.now()-a;e(s.map(p=>(p.timeOffset-=f,p)),d),s=[],a=null}),o),u=K(vi(K(d=>{let f=ki(d),{clientX:p,clientY:h}=Sd(d)?d.changedTouches[0]:d;a||(a=Gs()),s.push({x:p,y:h,id:r.getId(f),timeOffset:Gs()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?z.Drag:d instanceof MouseEvent?z.MouseMove:z.TouchMove)}),i,{trailing:!1})),c=[Ue("mousemove",u,n),Ue("touchmove",u,n),Ue("drag",u,n)];return K(()=>{c.forEach(d=>d())})}function N9({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=null,u=c=>d=>{let f=ki(d);if(Ve(f,r,i,!0))return;let p=null,h=c;if("pointerType"in d){switch(d.pointerType){case"mouse":p=zt.Mouse;break;case"touch":p=zt.Touch;break;case"pen":p=zt.Pen;break}p===zt.Touch?Ge[c]===Ge.MouseDown?h="TouchStart":Ge[c]===Ge.MouseUp&&(h="TouchEnd"):zt.Pen}else Sd(d)&&(p=zt.Touch);p!==null?(l=p,(h.startsWith("Touch")&&p===zt.Touch||h.startsWith("Mouse")&&p===zt.Mouse)&&(p=null)):Ge[c]===Ge.Click&&(p=l,l=null);let m=Sd(d)?d.changedTouches[0]:d;if(!m)return;let y=n.getId(f),{clientX:S,clientY:w}=m;K(e)({type:Ge[h],id:y,x:S,y:w,...p!==null&&{pointerType:p}})};return Object.keys(Ge).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let d=An(c),f=u(c);if(window.PointerEvent)switch(Ge[c]){case Ge.MouseDown:case Ge.MouseUp:d=d.replace("mouse","pointer");break;case Ge.TouchStart:case Ge.TouchEnd:return}a.push(Ue(d,f,t))}),K(()=>{a.forEach(c=>c())})}function Nw({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){let s=K(vi(K(a=>{let l=ki(a);if(!l||Ve(l,r,i,!0))return;let u=n.getId(l);if(l===t&&t.defaultView){let c=xw(t.defaultView);e({id:u,x:c.left,y:c.top})}else e({id:u,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return Ue("scroll",s,t)}function $9({viewportResizeCb:e},{win:t}){let n=-1,r=-1,i=K(vi(K(()=>{let o=vw(),s=Rw();(n!==o||r!==s)&&(e({width:Number(s),height:Number(o)}),n=o,r=s)}),200));return Ue("resize",i,t)}var L9=["INPUT","TEXTAREA","SELECT"],F1=new WeakMap;function _9({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(w){let g=ki(w),x=w.isTrusted,I=g&&g.tagName;if(g&&I==="OPTION"&&(g=B.parentElement(g)),!g||!I||L9.indexOf(I)<0||Ve(g,r,i,!0)||g.classList.contains(o)||s&&g.matches(s))return;let N=g.value,$=!1,L=$s(g)||"";L==="radio"||L==="checkbox"?$=g.checked:(a[I.toLowerCase()]||a[L])&&(N=Ns({element:g,maskInputOptions:a,tagName:I,type:L,value:N,maskInputFn:l})),f(g,c?{text:N,isChecked:$,userTriggered:x}:{text:N,isChecked:$});let P=g.name;L==="radio"&&P&&$&&t.querySelectorAll(`input[type="radio"][name="${P}"]`).forEach(j=>{if(j!==g){let U=j.value;f(j,c?{text:U,isChecked:!$,userTriggered:!1}:{text:U,isChecked:!$})}})}function f(w,g){let x=F1.get(w);if(!x||x.text!==g.text||x.isChecked!==g.isChecked){F1.set(w,g);let I=n.getId(w);K(e)({...g,id:I})}}let h=(u.input==="last"?["change"]:["input","change"]).map(w=>Ue(w,K(d),t)),m=t.defaultView;if(!m)return()=>{h.forEach(w=>w())};let y=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),S=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&h.push(...S.map(w=>oa(w[0],w[1],{set(){K(d)({target:this,isTrusted:!1})}},!1,m))),K(()=>{h.forEach(w=>w())})}function Hs(e){let t=[];function n(r,i){if(As("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||As("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||As("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||As("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let s=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(s)}else if(r.parentStyleSheet){let s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(s)}return i}return n(e,t)}function cn(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function D9({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:K((c,d,f)=>{let[p,h]=f,{id:m,styleId:y}=cn(d,t,n.styleMirror);return(m&&m!==-1||y&&y!==-1)&&e({id:m,styleId:y,adds:[{rule:p,index:h}]}),c.apply(d,f)})}),r.CSSStyleSheet.prototype.addRule=function(c,d,f=this.cssRules.length){let p=`${c} { ${d} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[p,f])};let o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:K((c,d,f)=>{let[p]=f,{id:h,styleId:m}=cn(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:p}]}),c.apply(d,f)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:K((c,d,f)=>{let[p]=f,{id:h,styleId:m}=cn(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:p}),c.apply(d,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:K((c,d,f)=>{let[p]=f,{id:h,styleId:m}=cn(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:p}),c.apply(d,f)})}));let l={};Cs("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Cs("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Cs("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Cs("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(l).forEach(([c,d])=>{u[c]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(u[c].insertRule,{apply:K((f,p,h)=>{let[m,y]=h,{id:S,styleId:w}=cn(p.parentStyleSheet,t,n.styleMirror);return(S&&S!==-1||w&&w!==-1)&&e({id:S,styleId:w,adds:[{rule:m,index:[...Hs(p),y||0]}]}),f.apply(p,h)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:K((f,p,h)=>{let[m]=h,{id:y,styleId:S}=cn(p.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,removes:[{index:[...Hs(p),m]}]}),f.apply(p,h)})})}),K(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,d])=>{d.prototype.insertRule=u[c].insertRule,d.prototype.deleteRule=u[c].deleteRule})})}function $w({mirror:e,stylesheetManager:t},n){var r,i,o;let s=null;n.nodeName==="#document"?s=e.getId(n):s=e.getId(B.host(n));let a=n.nodeName==="#document"?(r=n.defaultView)==null?void 0:r.Document:(o=(i=n.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,l=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)==null?void 0:u.call(this)},set(u){var c;let d=(c=l.set)==null?void 0:c.call(this,u);if(s!==null&&s!==-1)try{t.adoptStyleSheets(u,s)}catch{}return d}}),K(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function F9({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:K((a,l,u)=>{var c;let[d,f,p]=u;if(n.has(d))return o.apply(l,[d,f,p]);let{id:h,styleId:m}=cn((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,set:{property:d,value:f,priority:p},index:Hs(l.parentRule)}),a.apply(l,u)})});let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:K((a,l,u)=>{var c;let[d]=u;if(n.has(d))return s.apply(l,[d]);let{id:f,styleId:p}=cn((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,r.styleMirror);return(f&&f!==-1||p&&p!==-1)&&e({id:f,styleId:p,remove:{property:d},index:Hs(l.parentRule)}),a.apply(l,u)})}),K(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}function B9({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){let s=K(l=>vi(K(u=>{let c=ki(u);if(!c||Ve(c,t,n,!0))return;let{currentTime:d,volume:f,muted:p,playbackRate:h,loop:m}=c;e({type:l,id:r.getId(c),currentTime:d,volume:f,muted:p,playbackRate:h,loop:m})}),i.media||500)),a=[Ue("play",s(or.Play),o),Ue("pause",s(or.Pause),o),Ue("seeked",s(or.Seeked),o),Ue("volumechange",s(or.VolumeChange),o),Ue("ratechange",s(or.RateChange),o)];return K(()=>{a.forEach(l=>l())})}function j9({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(l,u,c){let d=new o(l,u,c);return i.set(d,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),d};let s=kn(t.fonts,"add",function(a){return function(l){return setTimeout(K(()=>{let u=i.get(l);u&&(e(u),i.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{n.FontFace=o}),r.push(s),K(()=>{r.forEach(a=>a())})}function U9(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e,s=!0,a=K(()=>{let l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;let u=[],c=l.rangeCount||0;for(let d=0;d<c;d++){let f=l.getRangeAt(d),{startContainer:p,startOffset:h,endContainer:m,endOffset:y}=f;Ve(p,r,i,!0)||Ve(m,r,i,!0)||u.push({start:n.getId(p),startOffset:h,end:n.getId(m),endOffset:y})}o({ranges:u})});return a(),Ue("selectionchange",a)}function V9({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:kn(n.customElements,"define",function(i){return function(o,s,a){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,s,a])}})}function W9(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:f,selectionCb:p,customElementCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),n(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),r(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),i(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),o(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),s(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),a(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),l(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),u(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),c(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),f(...m)},e.selectionCb=(...m)=>{t.selection&&t.selection(...m),p(...m)},e.customElementCb=(...m)=>{t.customElement&&t.customElement(...m),h(...m)}}function z9(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};W9(e,t);let r;e.recordDOM&&(r=Ow(e,e.doc));let i=O9(e),o=N9(e),s=Nw(e),a=$9(e,{win:n}),l=_9(e),u=B9(e),c=()=>{},d=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(c=D9(e,{win:n}),d=$w(e,e.doc),f=F9(e,{win:n}),e.collectFonts&&(p=j9(e)));let h=U9(e),m=V9(e),y=[];for(let S of e.plugins)y.push(S.observer(S.callback,n,S.options));return K(()=>{Rn.forEach(S=>S.reset()),r?.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),f(),p(),h(),m(),y.forEach(S=>S())})}function As(e){return typeof window[e]<"u"}function Cs(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var qs=class{constructor(t){A(this,"iframeIdToRemoteIdMap",new WeakMap),A(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,n,r,i){let o=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=o.get(n);return a||(a=this.generateIdFn(),o.set(n,a),s.set(a,n)),a}getIds(t,n){let r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return n.map(o=>this.getId(t,o,r,i))}getRemoteId(t,n,r){let i=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;let o=i.get(n);return o||-1}getRemoteIds(t,n){let r=this.getRemoteIdToIdMap(t);return n.map(i=>this.getRemoteId(t,i,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}},Cd=class{constructor(t){A(this,"iframes",new WeakMap),A(this,"crossOriginIframeMap",new WeakMap),A(this,"crossOriginIframeMirror",new qs(K1)),A(this,"crossOriginIframeStyleMirror"),A(this,"crossOriginIframeRootIdMap",new WeakMap),A(this,"mirror"),A(this,"mutationCb"),A(this,"wrappedEmit"),A(this,"loadListener"),A(this,"stylesheetManager"),A(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new qs(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,n){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=t.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.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 n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;let i=this.crossOriginIframeMap.get(t.source);if(!i)return;let o=this.transformCrossOriginEvent(i,n.data.event);o&&this.wrappedEmit(o,n.data.isCheckout)}transformCrossOriginEvent(t,n){var r;switch(n.type){case H.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);let i=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(n.data.node,i),{timestamp:n.timestamp,type:H.IncrementalSnapshot,data:{source:z.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case H.Meta:case H.Load:case H.DomContentLoaded:return!1;case H.Plugin:return n;case H.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case H.IncrementalSnapshot:switch(n.data.source){case z.Mutation:return n.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),n.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),n.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),n.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case z.Drag:case z.TouchMove:case z.MouseMove:return n.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case z.ViewportResize:return!1;case z.MediaInteraction:case z.MouseInteraction:case z.Scroll:case z.CanvasMutation:case z.Input:return this.replaceIds(n.data,t,["id"]),n;case z.StyleSheetRule:case z.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case z.Font:return n;case z.Selection:return n.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),n;case z.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),n}}return!1}replace(t,n,r,i){for(let o of i)!Array.isArray(n[o])&&typeof n[o]!="number"||(Array.isArray(n[o])?n[o]=t.getIds(r,n[o]):n[o]=t.getId(r,n[o]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==Mw.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},Ed=class{constructor(t){A(this,"shadowDoms",new WeakSet),A(this,"mutationCb"),A(this,"scrollCb"),A(this,"bypassOptions"),A(this,"mirror"),A(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,n){if(!di(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let r=Ow({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Nw({...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(B.host(t))),this.restoreHandlers.push($w({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,n){let r=this;this.restoreHandlers.push(kn(t.prototype,"attachShadow",function(i){return function(o){let s=i.call(this,o),a=B.shadowRoot(this);return a&&Pw(this)&&r.addShadowRoot(a,n),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},lr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",G9=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(ui=0;ui<lr.length;ui++)G9[lr.charCodeAt(ui)]=ui;var ui,H9=function(e){var t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=lr[t[n]>>2],i+=lr[(t[n]&3)<<4|t[n+1]>>4],i+=lr[(t[n+1]&15)<<2|t[n+2]>>6],i+=lr[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var B1=new Map;function q9(e,t){let n=B1.get(e);return n||(n=new Map,B1.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var Lw=(e,t,n)=>{if(!e||!(Dw(e,t)||typeof e=="object"))return;let r=e.constructor.name,i=q9(n,r),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Ms(e,t,n){if(e instanceof Array)return e.map(r=>Ms(r,t,n));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 r=e.constructor.name,i=H9(e);return{rr_type:r,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ms(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let r=e.constructor.name,{src:i}=e;return{rr_type:r,src:i}}else if(e instanceof HTMLCanvasElement){let r="HTMLImageElement",i=e.toDataURL();return{rr_type:r,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Ms(e.data,t,n),e.width,e.height]};if(Dw(e,t)||typeof e=="object"){let r=e.constructor.name,i=Lw(e,t,n);return{rr_type:r,index:i}}}}return e}var _w=(e,t,n)=>e.map(r=>Ms(r,t,n)),Dw=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i]);function K9(e,t,n,r){let i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=kn(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...u){return Ve(this.canvas,n,r,!0)||setTimeout(()=>{let c=_w(u,t,this);e(this.canvas,{type:mr["2D"],property:s,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=oa(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:mr["2D"],property:s,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(s=>s())}}function Y9(e){return e==="experimental-webgl"?"webgl":e}function j1(e,t,n,r){let i=[];try{let o=kn(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!Ve(this,t,n,!0)){let u=Y9(a);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){let c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[a,...l])}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function U1(e,t,n,r,i,o){let s=[],a=Object.getOwnPropertyNames(e);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let u=kn(e,l,function(c){return function(...d){let f=c.apply(this,d);if(Lw(f,o,this),"tagName"in this.canvas&&!Ve(this.canvas,r,i,!0)){let p=_w(d,o,this),h={type:t,property:l,args:p};n(this.canvas,h)}return f}});s.push(u)}catch{let u=oa(e,l,{set(c){n(this.canvas,{type:t,property:l,args:[c],setter:!0})}});s.push(u)}return s}function Z9(e,t,n,r){let i=[];return i.push(...U1(t.WebGLRenderingContext.prototype,mr.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...U1(t.WebGL2RenderingContext.prototype,mr.WebGL2,e,n,r,t)),()=>{i.forEach(o=>o())}}var Fw="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",J9=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),V1=typeof window<"u"&&window.Blob&&new Blob([J9(Fw)],{type:"text/javascript;charset=utf-8"});function X9(e){let t;try{if(t=V1&&(window.URL||window.webkitURL).createObjectURL(V1),!t)throw"";let n=new Worker(t,{name:e?.name});return n.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker("data:text/javascript;base64,"+Fw,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var kd=class{constructor(t){A(this,"pendingCanvasMutations",new Map),A(this,"rafStamps",{latestId:0,invokeId:null}),A(this,"mirror"),A(this,"mutationCb"),A(this,"resetObservers"),A(this,"frozen",!1),A(this,"locked",!1),A(this,"processMutation",(l,u)=>{(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(u)});let{sampling:n="all",win:r,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&n==="all"&&this.initCanvasMutationObserver(r,i,o),s&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,i,o,{dataURLOptions:a})}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,n,r,i,o){let s=j1(n,r,i,!0),a=new Map,l=new X9;l.onmessage=h=>{let{id:m}=h.data;if(a.set(m,!1),!("base64"in h.data))return;let{base64:y,type:S,width:w,height:g}=h.data;this.mutationCb({id:m,type:mr["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};let u=1e3/t,c=0,d,f=()=>{let h=[];return n.document.querySelectorAll("canvas").forEach(m=>{Ve(m,r,i,!0)||h.push(m)}),h},p=h=>{if(c&&h-c<u){d=requestAnimationFrame(p);return}c=h,f().forEach(async m=>{var y;let S=this.mirror.getId(m);if(a.get(S)||m.width===0||m.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(m.__context)){let g=m.getContext(m.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}let w=await createImageBitmap(m);l.postMessage({id:S,bitmap:w,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[w])}),d=requestAnimationFrame(p)};d=requestAnimationFrame(p),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=j1(t,n,r,!1),o=K9(this.processMutation.bind(this),t,n,r),s=Z9(this.processMutation.bind(this),t,n,r);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{let r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;let i=r.map(s=>{let{type:a,...l}=s;return l}),{type:o}=r[0];this.mutationCb({id:n,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}},Id=class{constructor(t){A(this,"trackedLinkElements",new WeakSet),A(this,"mutationCb"),A(this,"adoptedStyleSheetCb"),A(this,"styleMirror",new xd),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;let r={id:n,styleIds:[]},i=[];for(let o of t){let s;this.styleMirror.has(o)?s=this.styleMirror.getId(o):(s=this.styleMirror.add(o),i.push({styleId:s,rules:Array.from(o.rules||CSSRule,(a,l)=>({rule:H1(a,o.href),index:l}))})),r.styleIds.push(s)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Pd=class{constructor(){A(this,"nodeMap",new WeakMap),A(this,"active",!1)}inOtherBuffer(t,n){let r=this.nodeMap.get(t);return r&&Array.from(r).some(i=>i!==n)}add(t,n){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}},xe,Ts,jc,Ks=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((z0=e.contentWindow)==null?void 0:z0.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var pt=tN();function In(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:f,slimDOMOptions:p,maskInputFn:h,maskTextFn:m,hooks:y,packFn:S,sampling:w={},dataURLOptions:g={},mousemoveWait:x,recordDOM:I=!0,recordCanvas:N=!1,recordCrossOriginIframes:$=!1,recordAfter:L=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:P=!1,collectFonts:j=!1,inlineImages:U=!1,plugins:ne,keepIframeSrcFn:_=()=>!1,ignoreCSSAttributes:Me=new Set([]),errorHandler:He}=e;M9(He);let se=$?window.parent===window:!0,Oe=!1;if(!se)try{window.parent.document&&(Oe=!1)}catch{Oe=!0}if(se&&!t)throw new Error("emit function is required");if(!se&&!Oe)return()=>{};x!==void 0&&w.mousemove===void 0&&(w.mousemove=x),pt.reset();let bt=d===!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}:f!==void 0?f:{password:!0},Ce=X1(p);C9();let Mi,gr=0,Pn=Y=>{for(let We of ne||[])We.eventProcessor&&(Y=We.eventProcessor(Y));return S&&!Oe&&(Y=S(Y)),Y};xe=(Y,We)=>{var ce;let ge=Y;if(ge.timestamp=Gs(),(ce=Rn[0])!=null&&ce.isFrozen()&&ge.type!==H.FullSnapshot&&!(ge.type===H.IncrementalSnapshot&&ge.data.source===z.Mutation)&&Rn.forEach(qe=>qe.unfreeze()),se)t?.(Pn(ge),We);else if(Oe){let qe={type:"rrweb",event:Pn(ge),origin:window.location.origin,isCheckout:We};window.parent.postMessage(qe,"*")}if(ge.type===H.FullSnapshot)Mi=ge,gr=0;else if(ge.type===H.IncrementalSnapshot){if(ge.data.source===z.Mutation&&ge.data.isAttachIframe)return;gr++;let qe=r&&gr>=r,re=n&&ge.timestamp-Mi.timestamp>n;(qe||re)&&Ts(!0)}};let rt=Y=>{xe({type:H.IncrementalSnapshot,data:{source:z.Mutation,...Y}})},br=Y=>xe({type:H.IncrementalSnapshot,data:{source:z.Scroll,...Y}}),Yt=Y=>xe({type:H.IncrementalSnapshot,data:{source:z.CanvasMutation,...Y}}),Sr=Y=>xe({type:H.IncrementalSnapshot,data:{source:z.AdoptedStyleSheet,...Y}}),it=new Id({mutationCb:rt,adoptedStyleSheetCb:Sr}),St=new Cd({mirror:pt,mutationCb:rt,stylesheetManager:it,recordCrossOriginIframes:$,wrappedEmit:xe});for(let Y of ne||[])Y.getMirror&&Y.getMirror({nodeMirror:pt,crossOriginIframeMirror:St.crossOriginIframeMirror,crossOriginIframeStyleMirror:St.crossOriginIframeStyleMirror});let Mn=new Pd;jc=new kd({recordCanvas:N,mutationCb:Yt,win:window,blockClass:i,blockSelector:o,mirror:pt,sampling:w.canvas,dataURLOptions:g});let Tn=new Ed({mutationCb:rt,scrollCb:br,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:bt,dataURLOptions:g,maskTextFn:m,maskInputFn:h,recordCanvas:N,inlineImages:U,sampling:w,slimDOMOptions:Ce,iframeManager:St,stylesheetManager:it,canvasManager:jc,keepIframeSrcFn:_,processedNodeManager:Mn},mirror:pt});Ts=(Y=!1)=>{if(!I)return;xe({type:H.Meta,data:{href:window.location.href,width:Rw(),height:vw()}},Y),it.reset(),Tn.init(),Rn.forEach(ce=>ce.lock());let We=CN(document,{mirror:pt,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:bt,maskTextFn:m,maskInputFn:h,slimDOM:Ce,dataURLOptions:g,recordCanvas:N,inlineImages:U,onSerialize:ce=>{Ew(ce,pt)&&St.addIframe(ce),kw(ce,pt)&&it.trackLinkElement(ce),wd(ce)&&Tn.addShadowRoot(B.shadowRoot(ce),document)},onIframeLoad:(ce,ge)=>{St.attachIframe(ce,ge),Tn.observeAttachShadow(ce)},onStylesheetLoad:(ce,ge)=>{it.attachLinkElement(ce,ge)},keepIframeSrcFn:_});if(!We)return console.warn("Failed to snapshot the document");xe({type:H.FullSnapshot,data:{node:We,initialOffset:xw(window)}},Y),Rn.forEach(ce=>ce.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&it.adoptStyleSheets(document.adoptedStyleSheets,pt.getId(document))};try{let Y=[],We=ge=>{var qe;return K(z9)({mutationCb:rt,mousemoveCb:(re,la)=>xe({type:H.IncrementalSnapshot,data:{source:la,positions:re}}),mouseInteractionCb:re=>xe({type:H.IncrementalSnapshot,data:{source:z.MouseInteraction,...re}}),scrollCb:br,viewportResizeCb:re=>xe({type:H.IncrementalSnapshot,data:{source:z.ViewportResize,...re}}),inputCb:re=>xe({type:H.IncrementalSnapshot,data:{source:z.Input,...re}}),mediaInteractionCb:re=>xe({type:H.IncrementalSnapshot,data:{source:z.MediaInteraction,...re}}),styleSheetRuleCb:re=>xe({type:H.IncrementalSnapshot,data:{source:z.StyleSheetRule,...re}}),styleDeclarationCb:re=>xe({type:H.IncrementalSnapshot,data:{source:z.StyleDeclaration,...re}}),canvasMutationCb:Yt,fontCb:re=>xe({type:H.IncrementalSnapshot,data:{source:z.Font,...re}}),selectionCb:re=>{xe({type:H.IncrementalSnapshot,data:{source:z.Selection,...re}})},customElementCb:re=>{xe({type:H.IncrementalSnapshot,data:{source:z.CustomElement,...re}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:bt,inlineStylesheet:c,sampling:w,recordDOM:I,recordCanvas:N,inlineImages:U,userTriggeredOnInput:P,collectFonts:j,doc:ge,maskInputFn:h,maskTextFn:m,keepIframeSrcFn:_,blockSelector:o,slimDOMOptions:Ce,dataURLOptions:g,mirror:pt,iframeManager:St,stylesheetManager:it,shadowDomManager:Tn,processedNodeManager:Mn,canvasManager:jc,ignoreCSSAttributes:Me,plugins:((qe=ne?.filter(re=>re.observer))==null?void 0:qe.map(re=>({observer:re.observer,options:re.options,callback:la=>xe({type:H.Plugin,data:{plugin:re.name,payload:la}})})))||[]},y)};St.addLoadListener(ge=>{try{Y.push(We(ge.contentDocument))}catch(qe){console.warn(qe)}});let ce=()=>{Ts(),Y.push(We(document)),Ks=!0};return["interactive","complete"].includes(document.readyState)?ce():(Y.push(Ue("DOMContentLoaded",()=>{xe({type:H.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&ce()})),Y.push(Ue("load",()=>{xe({type:H.Load,data:{}}),L==="load"&&ce()},window))),()=>{Y.forEach(ge=>{try{ge()}catch(qe){String(qe).toLowerCase().includes("cross-origin")||console.warn(qe)}}),Mn.destroy(),Ks=!1,T9()}}catch(Y){console.warn(Y)}}In.addCustomEvent=(e,t)=>{if(!Ks)throw new Error("please add custom event after start recording");xe({type:H.Custom,data:{tag:e,payload:t}})};In.freezePage=()=>{Rn.forEach(e=>e.freeze())};In.takeFullSnapshot=e=>{if(!Ks)throw new Error("please take full snapshot after start recording");Ts(e)};In.mirror=pt;var W1;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(W1||(W1={}));var ZW=5*1e3;var{addCustomEvent:JW}=In,{freezePage:XW}=In,{takeFullSnapshot:QW}=In;var Uw="__ripploEmitRrwebEvent";function Vw(){return{eventTypes:Bw(H),incrementalSources:Bw(z)}}function Bw(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,n])=>[n,t]))}var eL=Cc("@ripplo/rrweb-bundle/bundle","rrweb.js"),jw;function Ww(){return jw??=Q9(eL,{encoding:"utf8"}),jw}async function ef({clientVersion:e,debugDir:t,writeOtlpPortFile:n}){let r=new Map,i=B0(Vw()),o=await Ec({localDir:zw.join(zw.dirname(t),".local"),writePortFile:n,onRrwebBatch:(l,u)=>{r.get(l)?.emitRrwebBatch(u)},onSpan:l=>{let u=l.attributes["ripplo.run"];u!=null&&r.get(u)?.emit(l)}}),s=await Ww();return{attach:async(l,u)=>{let c=F0({debugDir:t,runId:u,worker:i});c.emit({clientVersion:e,kind:"meta",source:"capture",timeNanos:"0"}),r.set(u,c),await U0(l,u),await l.addInitScript(`globalThis.__ripploCapturePort = ${String(o.port)};`),await nL(l,c),await oL(l,c);let d=[];return{emitAction:f=>{lL(c,f)},emitAssertion:f=>{uL(c,f)},finish:()=>sL(c,{pages:d,registry:r,runId:u}),onPage:f=>{d.push(f),aL(c,s,f)}}},debugDir:t,close:async()=>{await o.stop(),await i.terminate()},injectSpan:(l,u)=>{r.get(l)?.emit(u)}}}async function tL(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function nL(e,t){await e.exposeBinding(Uw,(n,r)=>{let i=typeof r=="string"?r:JSON.stringify(r);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}var rL="__ripploEventPush",iL=gt.discriminatedUnion("kind",[gt.object({kind:gt.literal("console"),level:gt.string(),text:gt.string(),timestamp:gt.number()}),gt.object({kind:gt.literal("error"),message:gt.string(),stack:gt.string().optional(),timestamp:gt.number()})]);async function oL(e,t){await e.exposeBinding(rL,(n,r)=>{let i=iL.safeParse(r);if(!i.success)return;let o=i.data;if(o.kind==="console"){t.emit({kind:"console",level:o.level,source:"browser",text:o.text,timeNanos:nr(o.timestamp)});return}t.emit({kind:"error",message:o.message,source:"browser",stack:o.stack,timeNanos:nr(o.timestamp)})})}async function sL(e,t){await tL(t.pages),t.registry.delete(t.runId),await e.close({noticeIfNoRrweb:"rrweb capture unavailable: recorder never pushed an event \u2014 page never loaded the recorder (blank page, failed navigation, or CSP block)"})}function aL(e,t,n){n.on("load",()=>{n.addScriptTag({content:t}).catch(()=>{})}),n.on("response",r=>{hL(e,r)})}function lL(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:cL(t),timeNanos:nr(Date.now()),value:dL(t)})}function uL(e,t){let n=Ol(t);e.emit({kind:"assertion",label:n.label,outcome:t.outcome,source:"test",step:n.step,timeNanos:nr(Date.now())})}function cL(e){if(e.url!=null)return e.url;if(e.locator!=null)return Qd(e.locator)}function Qd(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${Qd(e.scope)} \u25B8 ${Qd(e.target)}`:`${e.role} ${e.name??""}`.trim()}function dL(e){return e.value!=null?typeof e.value=="object"?JSON.stringify(e.value):String(e.value):e.key}var fL=/^http:\/\/127\.0\.0\.1:\d+\/rrweb\//;function hL(e,t){let n=t.request(),r=n.resourceType();if(r!=="fetch"&&r!=="xhr"||fL.test(n.url()))return;let i=n.headers().traceparent?.split("-"),o=n.timing().startTime;e.emit({kind:"network",method:n.method(),resourceType:r,source:"browser",spanId:i?.[2],status:t.status(),timeNanos:nr(o>0?o:Date.now()),traceId:i?.[1],url:t.url()})}function gL({clientVersion:e,debugDir:t,headed:n,writeOtlpPortFile:r}){let i=ho({headed:n}),o,s,a=async()=>(o??=ef({clientVersion:e,debugDir:t,writeOtlpPortFile:r}),s=await o,s),l=async(d,f)=>{if(f.aborted)return mL(ri("skipped"));try{let p=await a();return d.options.headed&&!n?await Al(!0,async h=>vc({browser:h,hub:p,request:d},f)):await vc({browser:await i.acquire(),hub:p,request:d},f)}catch(p){return pL(Ln(p))}};return{close:async()=>{await i.close();let d=o;o=void 0,s=void 0,d!=null&&await d.then(f=>f.close()).catch(()=>{})},prewarm:async()=>{await a(),await i.acquire()},injectSpan:(d,f)=>{s?.injectSpan(d,f)},runOnce:(d,f)=>new yL(l(d,f))}}function Ii(e,t){let n=e.axes.flatMap(r=>r.classify(t).map(([i,o])=>`${i}:${o}`));return[t.label,...n.toSorted((r,i)=>r.localeCompare(i))].join("|")}function bL(e){return e.axes.map(t=>t.name).join("+")}function SL(e){return{name:`counts(${e})`,classify:({pre:t})=>[...t.entities].flatMap(([n,r])=>r.size===0?[]:[[n,vL(e,r.size)]])}}function wL(e){let t=Gw(e);return{name:"enum-fields",classify:({pre:n})=>[...n.entities].flatMap(([r,i])=>[...i.values()].flatMap(o=>xL(r,o,t)))}}function xL(e,t,n){return Object.entries(t).flatMap(([r,i])=>n.has(`${e}.${r}`)?[[`${e}.${r}`,RL(i)]]:[])}function Gw(e){let t=e.valueSpaces.flatMap(r=>r.values==null?[]:[r.name]),n=new Set(t);return new Set(e.entities.flatMap(r=>Object.entries(r.props).flatMap(([i,o])=>o.type==="boolean"||o.valueSpace!=null&&n.has(o.valueSpace)?[`${r.name}.${i}`]:[])))}function vL(e,t){return e==="presence"?"1+":e==="unit"?t===1?"1":"2+":t<=2?String(t):"3+"}function RL(e){return e==null?"\u2205":String(e)}import{createHash as AL}from"crypto";import{appendFile as CL,mkdir as qw,readFile as EL,writeFile as kL}from"fs/promises";import Kw from"path";import{ResultAsync as tf}from"neverthrow";import{z as v}from"zod";var yr=v.enum(["crash","data-rule","page-rule","frame"]),Hw=v.object({intent:v.string().min(1),test:v.string().min(1)}),IL=v.union([v.object({kind:v.literal("singleton-mismatch"),singleton:v.string().min(1)}),v.object({entity:v.string().min(1),kind:v.string().min(1)})]),Yw=v.discriminatedUnion("kind",[v.object({kind:v.literal("consistency"),layer:yr,mismatch:IL,step:Hw.nullable()}),v.object({kind:v.literal("pending-check"),layer:yr,source:v.string().min(1),step:Hw}),v.object({intent:v.string().min(1),kind:v.literal("unrunnable"),layer:yr,reason:v.string().min(1),test:v.string().min(1)}),v.object({error:v.string().min(1),kind:v.literal("driver-error"),layer:yr,step:v.string().min(1)}),v.object({kind:v.literal("impossible-action"),layer:yr,step:v.string().min(1)})]),PL=v.object({actionHash:v.string().min(1),at:v.string().min(1),kind:v.literal("covered"),lensId:v.string().min(1),targetKey:v.string().min(1)}),ML=v.object({actionHash:v.string().min(1),at:v.string().min(1),baseState:v.string().min(1),evidence:v.array(v.string().min(1)),kind:v.literal("finding"),lensId:v.string().min(1),lockfileHash:v.string().min(1),parts:v.array(Yw),runId:v.string().min(1).optional(),signature:v.string().min(1),targetKey:v.string().min(1),trail:v.array(v.string().min(1)),trailParams:v.array(v.record(v.string(),v.union([Zt,v.null()]))),verifierLayer:yr}),TL=v.object({actionHash:v.string().min(1),at:v.string().min(1),baseState:v.string().min(1),evidence:v.array(v.string().min(1)),kind:v.literal("flaky-candidate"),lensId:v.string().min(1),parts:v.array(Yw),signature:v.string().min(1),targetKey:v.string().min(1),trail:v.array(v.string().min(1))}),OL=v.object({at:v.string().min(1),kind:v.literal("saturation"),lensId:v.string().min(1),lockfileHash:v.string().min(1),ring:v.number().int().nonnegative()}),NL=v.object({at:v.string().min(1),kind:v.literal("resolution"),signature:v.string().min(1)}),$L=v.object({arrangement:v.string().min(1),at:v.string().min(1),canonicalKey:v.string().min(1),kind:v.literal("derived-baseState")}),Zw=v.discriminatedUnion("kind",[PL,ML,TL,OL,NL,$L]);function LL(e){return Jw(e).slice(0,12)}function kt(e){return`${e.lensId} ${e.actionHash} ${e.targetKey}`}function _L(e){return e.reduce((t,n)=>HL(t,n),GL())}function DL(e){return tf.fromPromise(UL(e),t=>({error:t,kind:"io"})).map(t=>WL(t))}function FL(e,t){let n=t.map(r=>`${JSON.stringify(r)}
|
|
145
|
+
`).join("");return tf.fromPromise(qw(Kw.dirname(e),{recursive:!0}).then(()=>CL(e,n)),r=>({error:r,kind:"io"}))}function BL(e,t){let n=t.map(r=>`${JSON.stringify(r)}
|
|
146
|
+
`).join("");return tf.fromPromise(qw(Kw.dirname(e),{recursive:!0}).then(()=>kL(e,n)),r=>({error:r,kind:"io"}))}function jL(e,t){let n=V({effect:t.effectStep,nav:t.nav,params:t.paramSpaces,requiredState:t.requiredState,steps:t.steps}),r=e.entities.filter(i=>n.includes(`"${i.name}"`));return Jw(V({entities:r,spec:n}))}async function UL(e){return(await EL(e,"utf8").catch(n=>{if(VL(n))return"";throw n})).split(`
|
|
147
|
+
`).filter(n=>n.length>0)}function VL(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"}function WL(e){return e.flatMap(t=>{let n=Zw.safeParse(zL(t));return n.success?[n.data]:[]})}function zL(e){try{return JSON.parse(e)}catch{return null}}function Jw(e){return AL("sha256").update(e).digest("hex")}function GL(){return{covered:new Set,findings:new Map,flaky:new Map,saturations:new Map}}function HL(e,t){if(t.kind==="covered")return{...e,covered:new Set([...e.covered,kt(t)])};if(t.kind==="flaky-candidate")return{...e,covered:new Set([...e.covered,kt(t)]),flaky:qL(e.flaky,t)};if(t.kind==="finding")return{...e,covered:new Set([...e.covered,kt(t)]),findings:KL(e.findings,t)};if(t.kind==="resolution")return{...e,findings:YL(e.findings,t)};if(t.kind==="saturation"){let n=`${t.lensId} ${String(t.ring)}`;return{...e,saturations:new Map([...e.saturations,[n,t]])}}return e}function qL(e,t){let n=e.get(t.signature),r=n==null?{first:t,occurrences:1}:{first:n.first,occurrences:n.occurrences+1};return new Map([...e,[t.signature,r]])}function KL(e,t){let n=e.get(t.signature),r=n==null?{first:t,latest:t,occurrences:1,resolvedAt:void 0}:{first:n.first,latest:t,occurrences:n.occurrences+1,resolvedAt:void 0};return new Map([...e,[t.signature,r]])}function YL(e,t){let n=e.get(t.signature);return n==null?e:new Map([...e,[t.signature,{...n,resolvedAt:t.at}]])}function ZL(e){let t={edges:new Map,saturationDepth:0,seen:new Set,states:0,targets:new Map},n=e.baseStates.map(r=>(t.seen.add(bn(r.snapshot)),{baseState:r.name,lastLabel:null,snapshot:r.snapshot,trail:[]}));return XL(e,n,t),{edges:t.edges,saturationDepth:t.saturationDepth,states:t.seen.size,targets:t.targets}}var JL=24301,Xw=new WeakMap;function sa(e,t){let n=Xw.get(e)??new Map;Xw.set(e,n);let r=n.get(t);if(r!=null)return r;let i=Object.fromEntries(Object.entries(e.paramSpaces).map(([o,s])=>[o,i_(s,t)]));return n.set(t,i),i}function XL(e,t,n){let r=[...t],i=0;for(;i<r.length;){let o=r[i];i+=1,o!=null&&QL(e,o,n).forEach(s=>r.push(s))}}function QL(e,t,n){let r={snapshot:t.snapshot},i=o=>sa(o,r_(t.trail,e.corpus,o));return Dn(e.corpus,r,i).flatMap(o=>{let s=e.corpus[o.idx];if(s==null)return[];let a=[...t.trail,{idx:o.idx,params:o.params}],l={baseState:t.baseState,trail:a,transitionIndex:o.idx};return e_({acc:n,node:t,option:o,params:e,transition:s,witness:l}),t_({acc:n,node:t,option:o,params:e,trail:a})})}function e_({acc:e,node:t,option:n,params:r,transition:i,witness:o}){let s={label:n.label,params:n.params,pre:t.snapshot,spaces:i.paramSpaces},a=Ii(r.lens,s);if(e.targets.has(a)||(e.targets.set(a,o),e.saturationDepth=Math.max(e.saturationDepth,o.trail.length)),t.lastLabel!=null){let l=`${t.lastLabel} \u2192 ${n.label}`;e.edges.has(l)||e.edges.set(l,o)}}function t_({acc:e,node:t,option:n,params:r,trail:i}){if(i.length>=r.maxDepth)return[];let o=n.stepRun.next.snapshot;if(n_(t.snapshot,o,r.maxCount))return[];let s=bn(o);return e.seen.has(s)?[]:(e.seen.add(s),[{baseState:t.baseState,lastLabel:n.label,snapshot:o,trail:i}])}function n_(e,t,n){return[...t.entities].some(([r,i])=>{let o=e.entities.get(r)?.size??0;return i.size>o&&i.size>n})}function r_(e,t,n){return e.filter(r=>t[r.idx]===n).length}function i_(e,t){let[n]=Ie.sample(Qo(e),{numRuns:1,seed:JL+t});if(n==null)throw new Error("arbitrary produced no sample");return n}var o_=10;function s_(e){return nf(e).reduce((t,n)=>t+ex(e,n).length,0)}function a_(e){return e.targets.size+e.edges.size}function l_(e){let t=nf(e).map(o=>ex(e,o)),n=u_(e,t);if(n!=null)return n;let r=t.find(o=>o.length>0);return r==null?{kind:"saturated",ring:t.length}:{kind:"cover",target:r.reduce((o,s)=>Qw(e,s)>Qw(e,o)?s:o)}}function nf(e){return[{entries:e.graph.targets,index:1},{entries:e.graph.edges,index:2}]}function ex(e,t){return[...t.entries].flatMap(([n,r])=>{let i=tx({params:e,ring:t.index,targetKey:n,witness:r});return e.covered.has(nx(e,i))?[]:[i]})}function tx({params:e,ring:t,targetKey:n,witness:r}){let i=e.actionHashes[r.transitionIndex];if(i==null)throw new Error("transition index out of corpus range");return{actionHash:i,ring:t,targetKey:n,witness:r}}function nx(e,t){return kt({actionHash:t.actionHash,lensId:e.lensId,targetKey:t.targetKey})}function u_(e,t){if(e.tick===0||e.tick%o_!==0)return null;let n=nf(e).flatMap(i=>[...i.entries].flatMap(([o,s])=>{let a=tx({params:e,ring:i.index,targetKey:o,witness:s});return e.covered.has(nx(e,a))?[a]:[]}));if(n.length===0||t.every(i=>i.length===0))return null;let r=n[e.tick%n.length];return r==null?null:{kind:"revalidate",target:r}}var c_=/delete|remove|cancel|deactivate|revoke|archive/i;function Qw(e,t){let n=t.ring===2&&d_(e,t)?4:0,r=c_.test(t.targetKey)?2:0,i=1/(1+t.witness.trail.length);return n+r+i}function d_(e,t){return new Set(t.witness.trail.flatMap(r=>{let i=e.corpus[r.idx];return i==null?[]:[i.test]})).size>1}function f_(e){let t=h_(e,e.witnessTrail);return t==null?{covers:[],stepRuns:[]}:m_(e,t)}function h_(e,t){return t.reduce((n,r)=>n==null?null:p_(e,n,r),{covers:[],snapshot:e.baseStateSnapshot,stepRuns:[]})}function p_(e,t,n){let r=e.corpus[n.idx];if(r==null)return null;let i=Nr(r,{snapshot:t.snapshot},n.params);if(i==null)return null;let o=rx({params:e,planned:n,pre:t.snapshot,transition:r});return{covers:[...t.covers,o],snapshot:i.next.snapshot,stepRuns:[...t.stepRuns,n]}}function rx({params:e,planned:t,pre:n,transition:r}){let i={label:`${r.test}#${String(r.index)}`,params:t.params,pre:n,spaces:r.paramSpaces},o=e.actionHashes[t.idx];if(o==null)throw new Error("transition index out of corpus range");return{actionHash:o,targetKey:Ii(e.lens,i)}}function m_(e,t){let n=new Set([...e.covered,...t.covers.map(i=>kt({...i,lensId:e.lensId}))]),r=ix({params:e,seen:n,state:t});return{covers:r.covers,stepRuns:r.stepRuns}}function ix({params:e,seen:t,state:n}){if(n.stepRuns.length>=e.maxLength)return n;let r=y_({params:e,seen:t,state:n});return r==null?n:(t.add(kt({...r.coverage,lensId:e.lensId})),ix({params:e,seen:t,state:{covers:[...n.covers,r.coverage],snapshot:r.snapshot,stepRuns:[...n.stepRuns,r.planned]}}))}function y_({params:e,seen:t,state:n}){let r=o=>sa(o,g_(n.stepRuns,e.corpus,o));return Dn(e.corpus,{snapshot:n.snapshot},r).map(o=>{let s=e.corpus[o.idx];if(s==null)return null;let a={idx:o.idx,params:o.params};return{coverage:rx({params:e,planned:a,pre:n.snapshot,transition:s}),planned:a,snapshot:o.stepRun.next.snapshot}}).find(o=>o!=null&&!t.has(kt({...o.coverage,lensId:e.lensId})))??null}function g_(e,t,n){return e.filter(r=>t[r.idx]===n).length}function b_(e,{sweep:t}){let n=Ot(Lt(e),r=>V({s:r.test.singletons,w:r.test.world})).map(r=>({name:r.ref,test:r.test}));return t?[...n,...n.flatMap(r=>w_(r))]:n}function S_(e,t,n){return Tr(e,t.test,n)}function w_(e){return x_(e.test).map(t=>{let n={...t,as:`${t.as}~2`},r=`${e.name} +${t.entity}`;return{name:r,test:{...e.test,name:r,world:[...e.test.world,n]}}})}function x_(e){return e.world.filter(t=>{let n=V({...e,world:e.world.filter(r=>r!==t)});return!n.includes(`"${t.as}.`)&&!n.includes(`"ref":"${t.as}"`)})}async function v_(e,t){let n=await aa({attemptIndex:0,capture:!1,params:e,stepRuns:e.trail.stepRuns},t);return n.kind!=="completed"?sx(n):n.findings.length===0?{kind:"clean",rows:P_(e)}:R_(e,Pi(e.baseState.name,n.findings),t)}function sx(e){return e.kind==="error"?{error:e.error,kind:"error"}:{kind:e.kind}}async function R_(e,t,n){let r=await aa({attemptIndex:1,capture:!1,params:e,stepRuns:e.trail.stepRuns},n);return r.kind!=="completed"?sx(r):Pi(e.baseState.name,r.findings).signature!==t.signature?{kind:"flaky",rows:[lx(e,t)]}:A_({digest:t,params:e,signal:n})}async function aa({attemptIndex:e,capture:t,params:n,stepRuns:r},i){let o=n.runIdFor(e),s=[];return(await n.session.runOnce({capture:t,lockfile:n.lockfile,onEvent:t?l=>{s.push(l)}:void 0,options:n.options,params:void 0,runId:o,sequence:I_(n,r),test:n.baseState.test},i)).match(l=>l.aborted?{kind:"aborted"}:{events:s,findings:l.findings,kind:"completed",runId:o},l=>({error:l,kind:"error"}))}async function A_({digest:e,params:t,signal:n}){let r=await of({attemptIndex:2,budget:t.shrinkBudget,chunks:2,params:t,runId:t.runIdFor(1),signal:n,signature:e.signature,stepRuns:t.trail.stepRuns});if(r.kind!=="shrunk")return r.outcome;let i=await C_({params:t,signal:n,signature:e.signature,stepRuns:r.stepRuns});if(i.kind==="aborted")return{kind:"aborted"};if(i.kind!=="reproduced")return{kind:"flaky",rows:[lx(t,e)]};let o=N_({digest:e,minimal:r.stepRuns,params:t,runId:i.runId});return{captureEvents:i.events,finding:o,kind:"finding",minimal:r.stepRuns,rows:[o],runId:i.runId}}async function C_({params:e,signal:t,signature:n,stepRuns:r}){let i=await aa({attemptIndex:e.shrinkBudget+2,capture:!0,params:e,stepRuns:r},t);return i.kind==="aborted"?{kind:"aborted"}:i.kind==="completed"&&Pi(e.baseState.name,i.findings).signature===n?{events:i.events,kind:"reproduced",runId:i.runId}:{kind:"no-repro"}}async function of(e){return e.budget<=0||e.stepRuns.length<=1?sf(e):ax(e,k_(e.stepRuns,e.chunks))}function sf(e){return{kind:"shrunk",runId:e.runId,stepRuns:e.stepRuns}}async function ax(e,t){let[n,...r]=t;if(n==null)return E_(e);if(e.budget<=0)return sf(e);let i=await aa({attemptIndex:e.attemptIndex,capture:!1,params:e.params,stepRuns:n},e.signal);if(i.kind==="aborted")return{kind:"halted",outcome:{kind:"aborted"}};let o={...e,attemptIndex:e.attemptIndex+1,budget:e.budget-1};return i.kind==="completed"&&Pi(e.params.baseState.name,i.findings).signature===e.signature?of({...o,chunks:2,runId:i.runId,stepRuns:n}):ax(o,r)}function E_(e){return e.chunks>=e.stepRuns.length?Promise.resolve(sf(e)):of({...e,chunks:e.chunks*2})}function k_(e,t){let n=Math.min(t,e.length),r=Math.ceil(e.length/n);return Array.from({length:n},(i,o)=>e.filter((s,a)=>a<o*r||a>=(o+1)*r)).filter(i=>i.length>0&&i.length<e.length)}function I_(e,t){return t.map(n=>{let r=e.corpus[n.idx];if(r==null)throw new Error("transition index out of corpus range");return{params:n.params,transition:r}})}function P_(e){return e.trail.covers.map(t=>({actionHash:t.actionHash,at:e.now(),kind:"covered",lensId:e.lensId,targetKey:t.targetKey}))}function lx(e,t){return{actionHash:rf(e).actionHash,at:e.now(),baseState:e.baseState.name,evidence:[...t.evidence],kind:"flaky-candidate",lensId:e.lensId,parts:[...t.parts],signature:t.signature,targetKey:rf(e).targetKey,trail:e.trail.covers.map(n=>n.targetKey)}}function ux(e){return e.kind==="driver-error"||e.kind==="unrunnable"?"crash":e.kind==="pending-check"?e.source.kind==="data-rule"?"data-rule":e.source.kind==="page-rule"?"page-rule":"frame":"frame"}function Pi(e,t){let n=t.map(i=>({line:Lp(i),part:T_(i)})).toSorted((i,o)=>V(i.part).localeCompare(V(o.part))),r=n.map(i=>i.part);return{evidence:n.map(i=>i.line),layer:M_(r),parts:r,signature:V({baseState:e,parts:r.map(i=>V(i))})}}var ox={crash:0,"data-rule":1,frame:3,"page-rule":2};function M_(e){return e.map(n=>n.layer).toSorted((n,r)=>ox[n]-ox[r]).at(0)??"frame"}function T_(e){let t=ux(e);switch(e.kind){case"consistency":return{kind:"consistency",layer:t,mismatch:O_(e.mismatch),step:e.step==null?null:{intent:e.step.intent,test:e.step.test}};case"pending-check":return{kind:"pending-check",layer:t,source:e.source.kind,step:{intent:e.step.intent,test:e.step.test}};case"unrunnable":return{intent:e.intent,kind:"unrunnable",layer:t,reason:e.reason,test:e.test};case"driver-error":return{error:e.error.kind,kind:"driver-error",layer:t,step:e.step.intent};case"impossible-action":return{kind:"impossible-action",layer:t,step:e.step.intent}}}function O_(e){return e.kind==="singleton-mismatch"?{kind:e.kind,singleton:e.singleton}:{entity:e.entity,kind:e.kind}}function N_({digest:e,minimal:t,params:n,runId:r}){let i=rf(n);return{actionHash:i.actionHash,at:n.now(),baseState:n.baseState.name,evidence:[...e.evidence],kind:"finding",lensId:n.lensId,lockfileHash:n.lockfileHash,parts:[...e.parts],runId:r,signature:e.signature,targetKey:i.targetKey,trail:t.map(o=>{let s=n.corpus[o.idx];if(s==null)throw new Error("transition index out of corpus range");return`${s.test}#${String(s.index)}`}),trailParams:t.map(o=>o.params),verifierLayer:e.layer}}function rf(e){let t=e.trail.covers.at(-1);if(t==null)throw new Error("trail has no coverage");return t}function iH(e){switch(e.kind){case"empty-response":return"ripplo daemon: cloud tunnel provisioning returned no result. Check server logs and retry.";case"server-error":return`ripplo daemon: cloud tunnel provisioning failed (${e.typename}). Run \`npx ripplo doctor\` to check your setup.`}}function oH(e){switch(e.kind){case"already-running":return`ripplo daemon: daemon already running (socket ${e.socketPath}).`;case"bind-failed":return`ripplo daemon: failed to bind IPC socket: ${e.message}`}}function sH({projectId:e,serverUrl:t}){return[`Project "${e}" (from .ripplo/project.json) was not found on ${t}, or this account does not have access to it.`,"Run `npx ripplo projects list` to see your projects, then update .ripplo/project.json (or re-run `npx ripplo init --project <id>`)."].join(`
|
|
148
|
+
`)}function aH(){return"Not signed in. Run `npx ripplo auth login`, then start the daemon again."}function lH({devSessionId:e,executor:t,tunnelHostname:n,version:r}){let i=t==="cloud"?`cloud executor via ${n??"?"}`:"local executor";return`ripplo daemon: v${r} ready as ${i} for session ${e} (syncs on every \`npx ripplo run\` \u2014 Ctrl-C to stop)`}function uH({cwd:e,pid:t}){return`ripplo daemon: another daemon is already running for this project${t==null?"":` (pid ${String(t)})`} (cwd ${e}).`}function cH(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project. Shutting down."}function dH(e){if(e.kind==="not-running")return"daemon: not running";if(e.kind==="unresponsive")return`daemon: running but no reply within ${String(e.timeoutMs/1e3)}s \u2014 likely busy executing runs, retry when the batch drains`;let{status:t}=e,n=t.version==null?"version unknown (pre-0.7.8)":`v${t.version}`,r=`${String(t.active)} active, ${String(t.queued)} queued`,i=`explorer: ${t.explorer}, ${String(t.exploring)} exploring`,o=`daemon: running (${n} | ${r} | ${i} | ${$_(t.progress)})`;if(t.sseHealth!=null&&!t.sseHealth.ok){let s=t.sseHealth.detail==null?"":`: ${t.sseHealth.detail}`;return`${o}
|
|
149
|
+
daemon: cannot subscribe to run dispatch${s} \u2014 server-side, restarting the daemon will not help`}return o}function $_(e){if(e.total===0)return"explore: idle";let t=`covered ${String(e.covered)}/${String(e.total)} targets`,n=e.deferred===0?"":` (${String(e.deferred)} deferred \u2014 timed out or errored, retried after cooldown)`,r=L_(e);return`explore: ${t}${n}, ${String(e.findings)} findings, ${r}`}function fH(e){let t=e.daemonVersion==null?"an older version":`v${e.daemonVersion}`;return e.kind==="restarted"?`ripplo: daemon was ${t} \u2014 restarted on the current version`:`ripplo: daemon ${t} is older than this CLI but has runs in flight \u2014 restart it when idle to update`}function hH(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:e.findings.map(t=>Nl({evidencePath:`.ripplo/debug/${e.runId}/behavior.jsonl`,finding:t})),kind:"findings"};case"error":return{detail:hn(e.error),kind:"error"};case"dispatch-failed":return{kind:"dispatch-error",reason:{detail:e.reason,type:"generic"}}}}function L_(e){return e.saturated?e.deferred===0?"saturated":"waiting \u2014 every open target is deferred, retrying after cooldown":"searching"}export{Zt as a,ba as b,Rx as c,Ax as d,yf as e,Sf as f,Ex as g,Oa as h,Gx as i,Hx as j,Nf as k,hn as l,nR as m,$t as n,Lt as o,Ji as p,xA as q,EA as r,nC as s,Ne as t,Nl as u,hE as v,pE as w,mE as x,om as y,lm as z,um as A,cm as B,dm as C,fm as D,hm as E,ko as F,WO as G,Ec as H,gL as I,bL as J,SL as K,wL as L,Zw as M,LL as N,kt as O,_L as P,DL as Q,FL as R,BL as S,jL as T,ZL as U,s_ as V,a_ as W,l_ as X,f_ as Y,b_ as Z,S_ as _,v_ as $,iH as aa,oH as ba,sH as ca,aH as da,lH as ea,uH as fa,cH as ga,dH as ha,$_ as ia,fH as ja,hH as ka};
|
|
150
|
+
/*! Bundled license information:
|
|
151
|
+
|
|
152
|
+
rrweb/dist/rrweb.js:
|
|
153
|
+
(*! *****************************************************************************
|
|
154
|
+
Copyright (c) Microsoft Corporation.
|
|
155
|
+
|
|
156
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
157
|
+
purpose with or without fee is hereby granted.
|
|
158
|
+
|
|
159
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
160
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
161
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
162
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
163
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
164
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
165
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
166
|
+
***************************************************************************** *)
|
|
167
|
+
*/
|