ripplo 0.7.48 → 0.7.49
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-4J4T7534.js → chunk-3BYXC7SY.js} +1 -1
- package/dist/{chunk-5BVPW4SP.js → chunk-3W2KCWPN.js} +4 -4
- package/dist/{chunk-4K4VY5OR.js → chunk-B7VRWN2U.js} +3 -3
- package/dist/{chunk-CUMINXFQ.js → chunk-R2QYFBGQ.js} +38 -38
- package/dist/{chunk-KSMKOJFZ.js → chunk-UBPGO5KY.js} +1 -1
- package/dist/{chunk-PATBTEVW.js → chunk-UX4XVD54.js} +1 -1
- package/dist/daemon-S5L6HCUY.js +137 -0
- package/dist/{daemon-22CT3QG5.js → daemon-YXH443NG.js} +1 -1
- package/dist/daemon-lock-K6KZL4X2.js +2 -0
- package/dist/index.js +46 -46
- package/dist/status-BRJFECSM.js +2 -0
- package/package.json +7 -4
- package/dist/daemon-CVEOZQ4B.js +0 -125
- package/dist/daemon-lock-K6AMMNIJ.js +0 -2
- package/dist/status-K5YQY3ZG.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as Qf,b as Xa,c as
|
|
2
|
+
import{a as Qf,b as Xa,c as j0}from"./chunk-SB7H6IAS.js";var yp=Qf((xl,mp)=>{"use strict";var{hasOwnProperty:Ur}=Object.prototype,Cn=wl();Cn.configure=wl;Cn.stringify=Cn;Cn.default=Cn;xl.stringify=Cn;xl.configure=wl;mp.exports=Cn;var mv=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function on(e){return e.length<5e3&&!mv.test(e)?`"${e}"`:JSON.stringify(e)}function bl(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 yv=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Sl(e){return yv.call(e)!==void 0&&e.length!==0}function pp(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 gv(e){if(Ur.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 bv(e){let t;if(Ur.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 Sv(e,t){let n;if(Ur.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 hp(e,t){let n;if(Ur.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 An(e){return e===1?"1 item":`${e} items`}function wv(e){let t=new Set;for(let n of e)(typeof n=="string"||typeof n=="number")&&t.add(String(n));return t}function xv(e){if(Ur.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 wl(e){e={...e};let t=xv(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let n=gv(e),r=Sv(e,"bigint"),i=bv(e),o=typeof i=="function"?i:void 0,s=hp(e,"maximumDepth"),a=hp(e,"maximumBreadth");function l(m,f,h,y,S,x){let b=f[m];switch(typeof b=="object"&&b!==null&&typeof b.toJSON=="function"&&(b=b.toJSON(m)),b=y.call(f,m,b),typeof b){case"string":return on(b);case"object":{if(b===null)return"null";if(h.indexOf(b)!==-1)return n;let v="",N=",",$=x;if(Array.isArray(b)){if(b.length===0)return"[]";if(s<h.length+1)return'"[Array]"';h.push(b),S!==""&&(x+=S,v+=`
|
|
3
3
|
${x}`,N=`,
|
|
4
4
|
${x}`);let pe=Math.min(b.length,a),F=0;for(;F<pe-1;F++){let Rt=l(String(F),b,h,y,S,x);v+=Rt!==void 0?Rt:"null",v+=N}let _e=l(String(F),b,h,y,S,x);if(v+=_e!==void 0?_e:"null",b.length-1>a){let Rt=b.length-a-1;v+=`${N}"... ${An(Rt)} not stringified"`}return S!==""&&(v+=`
|
|
5
5
|
${$}`),h.pop(),`[${v}]`}let L=Object.keys(b),D=L.length;if(D===0)return"{}";if(s<h.length+1)return'"[Object]"';let M="",V="";S!==""&&(x+=S,N=`,
|
|
@@ -17,25 +17,25 @@ ${S}`,se=Math.min(f.length,a),pe=0;for(;pe<se-1;pe++){let _e=c(String(pe),f[pe],
|
|
|
17
17
|
${x}`,h.pop(),`[${M}]`}let b=Object.keys(f),v=b.length;if(v===0)return"{}";if(s<h.length+1)return'"[Object]"';S+=y;let N=`,
|
|
18
18
|
${S}`,$="",L="",D=Math.min(v,a);Sl(f)&&($+=pp(f,N,a),b=b.slice(f.length),D-=f.length,L=N),i&&(b=bl(b,o)),h.push(f);for(let M=0;M<D;M++){let V=b[M],se=c(V,f[V],h,y,S);se!==void 0&&($+=`${L}${on(V)}: ${se}`,L=N)}if(v>a){let M=v-a;$+=`${L}"...": "${An(M)} not stringified"`,L=N}return L!==""&&($=`
|
|
19
19
|
${S}${$}
|
|
20
|
-
${x}`),h.pop(),`{${$}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(f);default:return t?t(f):void 0}}function d(m,f,h){switch(typeof f){case"string":return on(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(m),typeof f!="object")return d(m,f,h);if(f===null)return"null"}if(h.indexOf(f)!==-1)return n;let y="",S=f.length!==void 0;if(S&&Array.isArray(f)){if(f.length===0)return"[]";if(s<h.length+1)return'"[Array]"';h.push(f);let $=Math.min(f.length,a),L=0;for(;L<$-1;L++){let M=d(String(L),f[L],h);y+=M!==void 0?M:"null",y+=","}let D=d(String(L),f[L],h);if(y+=D!==void 0?D:"null",f.length-1>a){let M=f.length-a-1;y+=`,"... ${An(M)} not stringified"`}return h.pop(),`[${y}]`}let x=Object.keys(f),b=x.length;if(b===0)return"{}";if(s<h.length+1)return'"[Object]"';let v="",N=Math.min(b,a);S&&Sl(f)&&(y+=pp(f,",",a),x=x.slice(f.length),N-=f.length,v=","),i&&(x=bl(x,o)),h.push(f);for(let $=0;$<N;$++){let L=x[$],D=d(L,f[L],h);D!==void 0&&(y+=`${v}${on(L)}:${D}`,v=",")}if(b>a){let $=b-a;y+=`${v}"...":"${An($)} not stringified"`}return h.pop(),`{${y}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(f);default:return t?t(f):void 0}}function p(m,f,h){if(arguments.length>1){let y="";if(typeof h=="number"?y=" ".repeat(Math.min(h,10)):typeof h=="string"&&(y=h.slice(0,10)),f!=null){if(typeof f=="function")return l("",{"":m},[],f,y,"");if(Array.isArray(f))return u("",m,[],xv(f),y,"")}if(y.length!==0)return c("",m,[],y,"")}return d("",m,[])}return p}});var lm=Qf((PU,wu)=>{"use strict";var es=process||{},sm=es.argv||[],Qo=es.env||{},YA=!(Qo.NO_COLOR||sm.includes("--no-color"))&&(!!Qo.FORCE_COLOR||sm.includes("--color")||es.platform==="win32"||(es.stdout||{}).isTTY&&Qo.TERM!=="dumb"||!!Qo.CI),ZA=(e,t,n=e)=>r=>{let i=""+r,o=i.indexOf(t,e.length);return~o?e+JA(i,t,n,o)+t:e+i+t},JA=(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)},am=(e=YA)=>{let t=e?ZA:()=>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")}};wu.exports=am();wu.exports.createColors=am});import{z as A}from"zod";var Qa=A.enum(["fast","slow","async"]),qn=A.object({ref:A.string().min(1)}),Ft=A.union([A.string(),A.number(),A.boolean()]),el=A.object({template:A.array(A.union([A.string(),qn])).min(1)}),Ve=A.union([qn,Ft,el,A.null()]),ep=A.object({kind:A.literal("changed")}),tl=A.union([Ve,ep]),_t=A.union([A.string(),qn,el]),V0=A.object({by:A.literal("role"),name:A.union([_t,A.undefined()]).optional().transform(e=>e),role:A.string().min(1)}),U0=A.object({by:A.literal("testId"),value:_t}),W0=A.object({by:A.literal("inside"),scope:A.lazy(()=>he),target:A.lazy(()=>he)}),he=A.discriminatedUnion("by",[V0,U0,W0]),no=A.enum(["string","number","boolean"]),nl=A.enum(["strict","eventual"]),z0=A.object({kind:A.literal("string"),maxLength:A.number().int().positive().optional(),minLength:A.number().int().nonnegative().optional(),pattern:A.string().optional()}),G0=A.object({kind:A.literal("number"),max:A.number().int().optional(),min:A.number().int().optional()}),K0=A.object({kind:A.literal("datetime"),maxOffsetDays:A.number().int(),minOffsetDays:A.number().int()}),tp=A.discriminatedUnion("kind",[z0,G0,K0]),np=A.enum(["company.name","date.iso","internet.email","internet.url","person.fullName","lorem.slug","lorem.word"]),rl=A.object({constraints:tp.optional(),generator:np,name:A.string().min(1),type:no,values:A.array(Ft).min(1).optional()}),rp=A.object({consistency:nl.default("strict"),optional:A.boolean(),type:no,valueSpace:A.string().min(1).optional()}),il=A.enum(["backend","client"]),ol=A.object({description:A.string().optional(),identity:A.array(A.string().min(1)).min(1),identityKind:A.enum(["surrogate","natural"]),name:A.string().min(1),props:A.record(A.string().min(1),rp),source:il.default("backend")}),sl=A.object({consistency:nl.default("strict"),default:Ft,description:A.string().optional(),name:A.string().min(1),source:il.default("backend"),type:no,valueSpace:A.string().min(1).optional()}),al=A.enum(["url","title","viewport"]);function ro(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${ro(e.scope)} \u25B8 ${ro(e.target)}`:`${e.role} ${e.name??""}`.trim()}import{z as R}from"zod";var ll=["unspecified","internal","server","client","producer","consumer"],ul=["unset","ok","error"],ip=R.looseObject({data:R.looseObject({source:R.number().optional()}).optional(),timestamp:R.number(),type:R.number()}),Et=R.string(),H0=R.object({action:R.string(),kind:R.literal("action"),source:R.literal("test"),target:R.string().optional(),timeNanos:Et,value:R.string().optional()}),q0=R.object({kind:R.literal("assertion"),label:R.string(),outcome:R.enum(["passed","failed","error"]),source:R.literal("test"),step:R.string(),timeNanos:Et,wait:R.enum(["fast","slow","async"]).optional(),waitMs:R.number().optional()}),Y0=R.object({event:ip,kind:R.literal("rrweb"),rrwebType:R.string(),source:R.literal("browser"),timeNanos:Et}),Z0=R.object({kind:R.literal("network"),method:R.string(),requestBody:R.string().optional(),resourceType:R.string(),responseBody:R.string().optional(),source:R.literal("browser"),spanId:R.string().optional(),status:R.number(),timeNanos:Et,traceId:R.string().optional(),url:R.string()}),J0=R.object({kind:R.literal("console"),level:R.string(),source:R.literal("browser"),text:R.string(),timeNanos:Et}),X0=R.object({kind:R.literal("error"),message:R.string(),source:R.literal("browser"),stack:R.string().optional(),timeNanos:Et}),Q0=R.object({clientVersion:R.string(),kind:R.literal("meta"),source:R.literal("capture"),timeNanos:Et}),ev=R.object({kind:R.literal("notice"),message:R.string(),source:R.literal("capture"),timeNanos:Et}),tv=R.object({actual:R.string().optional(),expected:R.string().optional(),findingKind:R.string(),kind:R.literal("finding"),mismatchKind:R.string().optional(),pending:R.boolean().optional(),source:R.literal("verifier"),step:R.string(),subject:R.string(),timeNanos:Et,wait:R.enum(["fast","slow","async"]).optional(),waitMs:R.number().optional()}),op=R.object({attributes:R.record(R.string(),R.string()),durationMs:R.number(),kind:R.literal("span"),name:R.string(),parentSpanId:R.string().optional(),source:R.literal("server"),spanId:R.string(),spanKind:R.enum(ll),status:R.object({code:R.enum(ul),message:R.string().optional()}),timeNanos:Et,traceId:R.string()}),sp=R.discriminatedUnion("kind",[H0,q0,Y0,Z0,J0,X0,Q0,ev,tv,op]);function nv(e){let t=iv(e);if(t==null)return null;let n=sp.safeParse(t);return n.success?n.data:null}function rv(e){return Number(BigInt(e)/1000000n)}function cl(e){return ll[e]??"unspecified"}function dl(e){return ul[e]??"unset"}function iv(e){try{return JSON.parse(e)}catch{return null}}import{z as w}from"zod";function jt(e){return e.kind==="not"?jt(e.predicate):"ephemeral"in e&&e.ephemeral===!0}var ov=w.discriminatedUnion("kind",[w.object({as:w.string().min(1),kind:w.literal("created"),props:w.record(w.string().min(1),Ve)}),w.object({as:w.string().min(1),kind:w.literal("updated"),props:w.record(w.string().min(1),tl)}),w.object({kind:w.literal("deleted")})]),sv=w.object({kind:w.literal("is"),value:Ve}),av=w.discriminatedUnion("kind",[w.object({kind:w.literal("path")}),w.object({key:w.string().min(1),kind:w.literal("query")}),w.object({kind:w.literal("hash")})]),ap=w.lazy(()=>w.union([Ve,uv])),lv=w.object({entity:w.string().min(1),where:w.record(w.string().min(1),ap)}),uv=w.object({field:w.string().min(1),kind:w.literal("within"),selection:lv}),Xe=w.union([Qa,w.undefined()]).optional().transform(e=>e),At=w.union([w.boolean(),w.undefined()]).optional().transform(e=>e),lp=w.object({assertion:sv,kind:w.literal("singleton"),singleton:w.string().min(1),wait:Xe}),up=w.object({entity:w.string().min(1),kind:w.literal("count"),value:w.number().int().nonnegative()}),io=w.lazy(()=>w.discriminatedUnion("kind",[lp,up,w.object({kind:w.literal("not"),predicate:io}),w.object({kind:w.literal("and"),predicates:w.array(io)})])),cv=w.lazy(()=>w.object({condition:w.union([io,w.undefined()]).optional().transform(e=>e),consequence:w.array(Yn),name:w.string().min(1)})),Yn=w.lazy(()=>w.discriminatedUnion("kind",[w.object({ephemeral:At,kind:w.literal("visible"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("unobstructed"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("disabled"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("enabled"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("focused"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("checked"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("expanded"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("pressed"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("value"),locator:he,value:_t,wait:Xe}),w.object({ephemeral:At,kind:w.literal("text"),locator:he,value:_t,wait:Xe}),lp,w.object({kind:w.literal("browser"),name:al,part:w.union([av,w.undefined()]).optional().transform(e=>e),value:w.union([_t,w.null()]),wait:Xe}),w.object({assertion:ov,entity:w.string().min(1),key:w.record(w.string().min(1),ap),kind:w.literal("state"),wait:Xe}),w.object({kind:w.literal("not"),predicate:Yn}),w.object({kind:w.literal("and"),predicates:w.array(Yn)}),up,w.object({branches:w.array(cv),kind:w.literal("when")})]));import{z as oo}from"zod";var dv=oo.object({__codec:oo.string().min(1),data:oo.unknown(),version:oo.number().int().positive()}),so=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}},ao=class extends Error{constructor(t){super(`Codec mismatch: expected "${t.expected}", got "${t.got}"`),this.name="CodecMismatchError"}};function fl({name:e,schema:t}){return{currentVersion:1,name:e,decode:n=>hv({name:e,raw:n,schema:t}),encode:n=>({__codec:e,data:n,version:1})}}function fv(e,t){return JSON.stringify(e.encode(t))}function pv(e,t){let n=JSON.parse(t);return e.decode(n)}function hv({name:e,raw:t,schema:n}){let r=dv.parse(t);if(r.__codec!==e)throw new ao({expected:e,got:r.__codec});if(r.version!==1)throw new so({codec:e,currentVersion:1,gotVersion:r.version});return n.parse(r.data)}var lo="__ripplo__",pl="__ripplo_seed__",Vr="__ripplo_ready__";import{z as k}from"zod";var cp=k.discriminatedUnion("kind",[k.object({kind:k.literal("goto"),url:_t}),k.object({kind:k.literal("fill"),locator:he,value:Ve}),k.object({kind:k.literal("clear"),locator:he}),k.object({kind:k.literal("click"),locator:he}),k.object({kind:k.literal("dblclick"),locator:he}),k.object({kind:k.literal("select"),locator:he,value:Ve}),k.object({kind:k.literal("check"),locator:he}),k.object({kind:k.literal("uncheck"),locator:he}),k.object({kind:k.literal("hover"),locator:he}),k.object({files:k.array(k.string().min(1)).min(1),kind:k.literal("upload"),locator:he}),k.object({key:k.string().min(1),kind:k.literal("press"),locator:he.optional()})]),hl=k.object({action:cp,expect:k.array(Yn).default([])}),ml=k.object({valueSpace:k.string().min(1)}),uo=k.object({as:k.string().min(1),entity:k.string().min(1),set:k.record(k.string().min(1),Ve)}),yl=k.object({entity:k.string().min(1),where:k.record(k.string().min(1),Ve)}),co=k.object({absent:k.array(yl).default([]),exclusive:k.array(k.string().min(1)).default([]),intent:k.string().min(1),name:k.string().min(1),params:k.record(k.string().min(1),ml),singletons:k.record(k.string().min(1),Ve).default({}),slug:k.string().min(1),steps:k.array(hl).default([]),workflow:k.string().min(1),world:k.array(uo).default([])}),gl=k.object({absent:k.array(yl).default([]),exclusive:k.array(k.string().min(1)).default([]),intent:k.string().min(1),maybe:k.array(uo).default([]),name:k.string().min(1),params:k.record(k.string().min(1),ml),singletons:k.record(k.string().min(1),Ve).default({}),sourcePath:k.string().min(1).optional(),steps:k.array(hl).default([]),stub:k.boolean().default(!1),tests:k.array(co).default([]),world:k.array(uo).default([])}),dp=k.object({sha256:k.string().regex(/^[0-9a-f]{64}$/u),size:k.number().int().nonnegative()}),fp=k.object({entities:k.array(ol),fixtures:k.record(k.string().min(1),dp).default({}),singletons:k.array(sl).default([]),valueSpaces:k.array(rl),workflows:k.array(gl)}),mv=fl({name:"ripplo-lockfile",schema:fp});var vl=Xa(yp(),1),J8=vl.default.configure,fo=vl.default;function C(e){let t=fo(e,Rv);if(t==null)throw new Error("structuralKey: value is not serializable");return t}function Rv(e,t){if(t instanceof Map||t instanceof Set)throw new TypeError(`structuralKey: opaque collection at "${e}" \u2014 expand it before keying`);return t}var Qe={display:void 0,name:"label"},ue={display:void 0,name:"screen"},bp={alert:ue,alertdialog:ue,banner:ue,button:Qe,cell:ue,checkbox:Qe,columnheader:ue,combobox:Qe,complementary:ue,contentinfo:ue,dialog:ue,form:ue,grid:ue,group:ue,heading:ue,img:ue,link:Qe,list:ue,listitem:ue,main:ue,menu:ue,menuitem:{display:"menu item",name:"label"},menuitemcheckbox:{display:"menu item checkbox",name:"label"},menuitemradio:{display:"menu item radio",name:"label"},navigation:ue,option:Qe,progressbar:ue,radio:Qe,radiogroup:ue,region:ue,row:ue,searchbox:Qe,slider:Qe,spinbutton:Qe,status:ue,switch:Qe,tab:Qe,table:ue,tablist:ue,tabpanel:ue,textbox:Qe,toolbar:ue,treeitem:Qe},a5=new Map(Object.entries(bp));import{z as Wr}from"zod";var Ev=Wr.object({index:Wr.number().int().nonnegative(),kind:Wr.string(),target:Wr.string(),value:Wr.string()});function Av(e){let t=Cv(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:Tv(Ov(n),t),requiresKeys:n.world.map(r=>({namespace:r.as,preconditionName:r.entity})),slug:xp(n.name),sourcePath:n.sourcePath??null,spec:n}))}}function wp(e,t){return{index:t,kind:e.action.kind,target:Nv(e.action),value:$v(e.action)}}function xp(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,"-").split("-").filter(t=>t.length>0).join("-")}function Cv(e){let t=e.workflows.reduce((n,r)=>Pv(n,r),new Map);return new Map([...t].map(([n,r])=>[n,[...r]]))}function Pv(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=Iv(o,r),a=i.get(o.entity)??new Set;return new Map([...i,[o.entity,new Set([...a,...s])]])},e)}function Iv(e,t){return Object.values(e.set).flatMap(n=>Mv(n)).map(n=>t.get(n)).filter(n=>n!=null&&n!==e.entity)}function Mv(e){return e==null||typeof e!="object"?[]:"ref"in e?[Sp(e.ref)]:e.template.filter(t=>typeof t!="string").map(t=>Sp(t.ref))}function Sp(e){let[t]=e.split(".");return t??e}function Tv(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 Ov(e){return[...new Set(e.world.map(t=>t.entity))]}function Nv(e){return e.kind==="goto"?po(e.url):e.kind==="press"&&e.locator==null?"":ho(e.locator)}function po(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:e.template.map(t=>typeof t=="string"?t:`{${t.ref}}`).join("")}function ho(e){return e.by==="testId"?`testId=${po(e.value)}`:e.by==="inside"?`${ho(e.scope)} \u25B8 ${ho(e.target)}`:`${e.role} ${e.name==null?"":po(e.name)}`.trim()}function $v(e){return e.kind==="fill"||e.kind==="select"?Lv(e.value):e.kind==="press"?e.key:""}function Lv(e){return e==null?"":typeof e!="object"?String(e):po(e)}import{z as Ae}from"zod";var vp=Ae.enum(["Strict","Lax","None"]),Rp=Ae.object({domain:Ae.string().min(1),expires:Ae.number(),httpOnly:Ae.boolean(),name:Ae.string().min(1),path:Ae.string().min(1),sameSite:vp,secure:Ae.boolean(),value:Ae.string()}),kp=Ae.object({localStorage:Ae.array(Ae.object({name:Ae.string().min(1),value:Ae.string()})),origin:Ae.string().min(1)}),kl=Ae.object({cookies:Ae.array(Rp),headers:Ae.record(Ae.string().min(1),Ae.string()).optional(),origins:Ae.array(kp)});import{z as Y}from"zod";var El=Y.union([Ft,Y.null()]),Al=Y.record(Y.string().min(1),El),Ep=Y.object({as:Y.string().min(1),entity:Y.string().min(1),fields:Y.record(Y.string().min(1),Ve)}),Dv=Y.object({entities:Y.array(Ep),runId:Y.string().min(1),singletons:Y.record(Y.string().min(1),El).default({})}),Ap=Y.object({as:Y.string().min(1),row:Al,session:kl.optional()}),Cl=Y.object({rows:Y.array(Ap)}),Fv=Y.object({entities:Y.array(Y.string().min(1)),runId:Y.string().min(1),singletons:Y.array(Y.string().min(1)).default([])}),Pl=Y.object({entities:Y.record(Y.string().min(1),Y.array(Al)),singletons:Y.record(Y.string().min(1),El).default({})}),_v=Y.object({runId:Y.string().min(1)}),Il=Y.object({ok:Y.literal(!0)});import{z as Bv}from"zod";var Tl=Bv.string().brand(),Z=Tl.parse("");function dt(e){return Tl.parse(e)}function et(e,t){return Tl.parse(e.length===0?t:`${e}.${t}`)}function X(e){return qn.safeParse(e).success}function zr(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 Ml(e,t,n){let r=et(t,e.ref);if(!n.has(r))throw new Error(`unresolved binding ref "${r}"`);return n.get(r)??null}function Gr(e,t,n){return Vv(e).every(r=>n.has(et(t,r)))}function Ct(e,t,n){return typeof e=="string"?e:X(e)?String(Ml(e,t,n)):e.template.map(r=>typeof r=="string"?r:String(Ml(r,t,n))).join("")}function tt(e,t,n){return e===null||typeof e=="number"||typeof e=="boolean"?e:X(e)?Ml(e,t,n):Ct(e,t,n)}function Cp(e,t){return tt(e,Z,t)}function Kr(e){return fo(e)}function Zn(e,t,n){return Object.fromEntries(Object.entries(e).map(([r,i])=>[r,tt(i,t,n)]))}function Vv(e){return e==null||typeof e!="object"?[]:qe(e)?e.template.flatMap(t=>typeof t=="string"?[]:[t.ref]):[e.ref]}function ft(e,t){return e.by==="role"?{by:"role",name:e.name==null?void 0:Ct(e.name,Z,t),role:e.role}:e.by==="inside"?{by:"inside",scope:ft(e.scope,t),target:ft(e.target,t)}:{by:"testId",value:Ct(e.value,Z,t)}}function Pn(e,t){if(e==null)return new Set;if(e.by==="inside")return new Set([...Pn(e.scope,t),...Pn(e.target,t)]);let n=e.by==="role"?e.name:e.value;return new Set(t(n))}var Uv="https://ripplo.invalid";var Pp={hash:void 0,path:void 0,query:{},title:void 0,viewport:void 0};function Mp(e){return e.kind!=="title"&&e.kind!=="viewport"}function Jn(e){return e.kind==="query"?`url query "${e.key}"`:e.kind==="title"||e.kind==="viewport"?e.kind:`url ${e.kind}`}function mo(e,t){return e==="title"?{kind:"title"}:e==="viewport"?{kind:"viewport"}:t===void 0||t.kind==="path"?{kind:"path"}:t.kind==="hash"?{kind:"hash"}:{key:t.key,kind:"query"}}function Hr(e){let t=new URL(e,Uv),n=Object.fromEntries(t.searchParams.entries());return{hash:t.hash.length>0?t.hash.slice(1):void 0,path:t.pathname,query:n,title:void 0,viewport:void 0}}function Tp(e){if(typeof e=="string")return Ip(Hr(e));let t=X(e)?[e]:e.template,n=t.findIndex(u=>typeof u=="string"&&/[?#]/.test(u)),r=t[n];if(n===-1||typeof r!="string")return{...Pp,path:e};let i=[...t.slice(0,n),r.slice(0,r.search(/[?#]/))],o=t.slice(n),s={template:i};if(o.some(u=>typeof u!="string"))return{...Pp,path:s};let a=o.filter(u=>typeof u=="string").join(""),l=Hr(`/p${a.slice(a.search(/[?#]/))}`);return{...Ip(l),path:s}}function Op(e){let n=[[{kind:"path"},e.path],[{kind:"hash"},e.hash],[{kind:"title"},e.title],[{kind:"viewport"},e.viewport]].flatMap(([i,o])=>o===void 0?[]:[{clause:o,key:i}]),r=Object.entries(e.query).map(([i,o])=>({clause:o,key:{key:i,kind:"query"}}));return[...n,...r]}function Ip(e){return{hash:e.hash,path:e.path,query:e.query,title:e.title,viewport:e.viewport}}var Bt=new Map,In=new Map;function K(e){return C(e)}function Mn(e,t){let n=Wv(t)?zv(e,t.subject):e;return new Map([...n,[K(t.subject),t]])}function Ol(e,t){return new Map([...e,[K(t.subject),t]])}function Ue(e,t){return new Map([...e,...t])}function Nl(e){return e.kind==="element"}function Xn(e){return e.kind==="path"||e.kind==="query"||e.kind==="hash"}function $e(e,t){let n=e.get(K(t));return n==null||n.expect.expect!=="is"?void 0:n.expect.value}function Qn(e){let t=Hr(e),n=[[{kind:"path"},t.path],[{kind:"hash"},t.hash],...Object.entries(t.query).map(r=>[{key:r[0],kind:"query"},r[1]])];return new Map(n.flatMap(([r,i])=>i===void 0?[]:[[K(r),{declared:!0,expect:{expect:"is",value:i},subject:r}]]))}function qr(e){return[...e].toSorted(([t],[n])=>t.localeCompare(n))}function $l(e){return[...e].toSorted(([t],[n])=>t.localeCompare(n))}function Wv(e){return e.subject.kind==="element"&&e.subject.state==="visible"&&e.expect.expect==="is"&&e.expect.value===!1}function zv(e,t){if(t.kind!=="element")return e;let n=C(t.locator);return new Map([...e].filter(([,r])=>r.subject.kind!=="element"||C(r.subject.locator)!==n||r.subject.state!=="text"&&r.subject.state!=="value"))}function Yr({declared:e,entry:t,env:n}){let r=t.subject.kind==="element"?{...t.subject,locator:ft(t.subject.locator,n)}:t.subject;if(t.expect.expect==="absent")return{declared:e,expect:{expect:"absent"},subject:r};let i=tt(t.expect.value,Z,n),o=Hv(r)&&typeof i=="number"?String(i):i;return{declared:e,expect:{expect:t.expect.expect,value:o},subject:r}}function er({got:e,subject:t,want:n}){if(n.expect==="absent")return e===void 0;if(Gv(t)){let r=Kv(e,n.value);return n.expect==="is"?r:!r}return n.expect==="is"?e===n.value:e!==n.value}function Gv(e){return e.kind==="element"&&e.state==="text"}function Kv(e,t){return typeof e=="string"&&typeof t=="string"&&e.includes(t)}function Hv(e){return e.kind==="element"&&(e.state==="value"||e.state==="text")}function tr(e){let t=$e(e.scalars,{kind:"path"});return typeof t=="string"?t:null}function yo({actual:e,canon:t,pre:n,predicted:r}){return[...[...new Set([...r.entities.keys(),...e.entities.keys()])].flatMap(s=>Yv({actual:e.entities.get(s),canon:t,entity:s,pre:n.entities.get(s),predicted:r.entities.get(s)})),...qv(n.scalars,r.scalars,e.scalars)]}function qv(e,t,n){return[...t.entries()].flatMap(([r,i])=>{let o=Np(n,r);if(!i.declared||o===void 0||er({got:o,subject:i.subject,want:i.expect}))return[];let s=Np(e,r);return[{mismatch:{kind:"scalar-mismatch",subject:i.subject,sut:o,want:i.expect},pending:s!==void 0&&Lp(s,o)}]})}function Np(e,t){let n=e.get(t);return n==null||n.expect.expect!=="is"?void 0:n.expect.value}function Yv({actual:e,canon:t,entity:n,pre:r,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>Zv({actual:e?.get(s),canon:t,entity:n,key:s,predicted:i?.get(s),preHadKey:r?.has(s)??!1,preRow:r?.get(s)}))}function Zv({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",row:e},pending:o}];if(e==null)return[{mismatch:{entity:n,key:r,kind:"missing-row"},pending:!o}];let a=(u,c,d)=>Lp(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 Lp(e,t){return $p(e)===$p(t)}function $p(e){return e==null?"\u2205":JSON.stringify(e)}function go(e){let t=Jv(e.entities),n=Xv(e.singletons);return r=>Qv(r,t,n)}function Jv(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([n,r])=>[Dp(t.name,n),r.consistency])))}function Dp(e,t){return`${e}.${t}`}function Xv(e){return new Map(e.map(t=>[t.name,t.consistency]))}function Qv(e,t,n){return e.kind==="scalar-mismatch"?eR(e.subject,n):e.kind==="unexpected-row"||e.kind==="missing-row"?"strict":t.get(Dp(e.entity,e.field))??"strict"}function eR(e,t){return e.kind==="variable"?t.get(e.name)??"strict":"eventual"}function bo(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 Ll({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 tR=Ll();function Dl(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(tR,"")}function Fl(e,t,n){return{detail:n.slice(0,500),kind:"engine-http",path:e,status:t}}function nr(e,t){return{code:Wp(t),kind:"engine-network",message:Zr(t),path:e}}function So(e){return{kind:"client-mount-missing",mountKey:e}}function _l(e,t){return{kind:"app-not-ready",readyKey:e,timeoutMs:t}}function jl(e,t){return{kind:"engine-decode",message:Zr(t),path:e}}function Bl(e,t){return{entity:e,field:t,kind:"state-identity"}}function _p(e){return{as:e,kind:"setup-missing-row"}}function jp(e){return{count:e,kind:"conflicting-sessions"}}function Vt(e){return{kind:"driver-launch",message:Zr(e)}}function Vl(e){return{kind:"engine-unreachable",url:e}}function Ul(e,t){return{action:e,kind:"action-failed",message:Zr(t)}}function Wl(e){return{kind:"check-failed",message:Zr(e)}}function zl(){return{kind:"aborted"}}var nR=["app-not-ready","client-mount-missing","driver-launch","engine-decode","engine-http","engine-network","engine-unreachable"],Bp=new Set(nR);function wo(e){return Bp.has(e.kind)}function Vp(e){return Bp.has(e)}var Fp=300;function Pt(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${Up(e.detail)}${sR(e.status)}`;case"engine-network":return`engine ${e.path} request failed: ${e.message}${rR(e.code)}${oR(e.code)}`;case"client-mount-missing":return`this test reads client-side state, but the app never mounted the client engine ("${e.mountKey}"). Call mountClientEngine() where your app boots.`;case"app-not-ready":return`the app never called ready() within ${String(e.timeoutMs)}ms of loading the page. Call ready() from @ripplo/testing once your app is interactive \u2014 see setup.`;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 Gl(e){throw new Error(Pt(e))}function pt(){}function Up(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=Fp?t:`${t.slice(0,Fp)}\u2026 [truncated]`}function rR(e){return e==null?"":` (${e})`}var iR=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function oR(e){return e!=null&&iR.has(e)?" \u2014 nothing accepted the connection at the engine URL. Check that the app's dev server is running and RIPPLO_ENGINE_URL points at it.":" \u2014 the app dropped the connection while handling this request. A crash in the app's engine route or a thrown error in a seed/read impl can cause this. Check the app server logs."}function sR(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 Wp(e){if(!(typeof e!="object"||e==null))return"code"in e&&typeof e.code=="string"?e.code:"cause"in e?Wp(e.cause):void 0}function Zr(e){let t=e instanceof Error?e.message:String(e);return Up(Dl(t))}function zp(e){return Gp(e,new Map)}function aR(e,t){return e.reduce((n,r)=>n??t(r),null)}function Gp(e,t){let n=e.variables.find(r=>!t.has(r));return n==null?t:aR(e.domain(n),r=>{let i=new Map([...t,[n,r]]);return e.consistent(i)?Gp(e,i):null})}function It(e,t){let n=Kp(e,t);return n==null?null:mR(e.scalars,t,kR(n))}function Kp(e,t){let{absences:n,entities:r,exclusives:i}=e,o=new Map(r.map(a=>[a.alias,a])),s=zp({variables:r.map(a=>a.alias),consistent:a=>lR(a)&&uR(r,a)&&dR(n,a,t),domain:a=>pR(o.get(a),t)});return s==null?null:hR(i,r,s,t)?s:null}function lR(e){let t=[...e.values()];return new Set(t).size===t.length}function uR(e,t){return e.every(n=>t.has(n.alias)?n.relations.every(r=>cR(n,r,t)):!0)}function cR(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 dR(e,t,n){return e.every(r=>![...n.entities.get(r.entity)?.values()??[]].some(i=>fR(i,r,t)))}function fR(e,t,n){return Hp(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 Hp(e,t){return Object.entries(t.literals).every(([n,r])=>r===null?e[n]==null:e[n]===r)}function pR(e,t){return e==null?[]:[...t.entities.get(e.entity)?.values()??[]].filter(n=>Hp(n,e))}function hR(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 mR(e,t,n){return[...e.values()].reduce((r,i)=>r==null?null:yR(i,t,r),n)}function yR(e,t,n){let r=wR(e.subject,n);if(r==null)return null;let i=vR(t,r);return e.expect.expect==="absent"?i===void 0?n:null:e.expect.expect==="not"?RR({clause:e.expect.value,env:n,got:i,subject:r}):gR({clause:e.expect.value,env:n,got:i,subject:r})}function gR({clause:e,env:t,got:n,subject:r}){if(bR(r,e,t))return n===void 0?null:new Map([...t,[dt(SR(e)),n]]);if(!Gr(e,Z,t))return null;let i=tt(e,Z,t);return er({got:n,subject:r,want:{expect:"is",value:i}})?t:null}function bR(e,t,n){return e.kind==="element"&&(e.state==="value"||e.state==="text")&&X(t)&&!Gr(t,Z,n)}function SR(e){if(!X(e))throw new Error("expected a ref clause");return e.ref}function wR(e,t){return e.kind!=="element"?e:xR(e.locator,t)?{...e,locator:ft(e.locator,t)}:null}function xR(e,t){return[...Pn(e,n=>n==null?[]:[n])].every(n=>Gr(n,Z,t))}function vR(e,t){let n=e.scalars.get(K(t));return n==null||n.expect.expect!=="is"?void 0:n.expect.value}function RR({clause:e,env:t,got:n,subject:r}){if(!Gr(e,Z,t))return null;let i=tt(e,Z,t);return er({got:n,subject:r,want:{expect:"not",value:i}})?t:null}function kR(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"?[[dt(`${t}.${r[0]}`),i]]:[]})))}var ER={absences:[],entities:[],exclusives:[],scalars:In};function rr(e){return{...ER,...e}}function Ut(e,t){return[...new Map(e.map(n=>[t(n),n])).values()]}function qp(e){return Jr(e.expect).some(t=>t.assertion.kind==="deleted")}var Yp=new Set(["created","updated","deleted"]);function ql(e){return Jr(e.expect).some(t=>Yp.has(t.assertion.kind))}function Zp(e){return new Set(Jr(e.expect).flatMap(t=>Yp.has(t.assertion.kind)?[t.entity]:[]))}function Yl(e){return Kl(e.expect).length>0}function sn(e){return typeof e=="object"&&e!==null&&"kind"in e}function an(e){return Object.fromEntries(Object.entries(e).filter(t=>!sn(t[1])))}function Zl(e){return new Map(e.entities.filter(t=>t.identityKind==="surrogate").map(t=>[t.name,t.identity]))}function Xr(e,t,n){return t.reduce((r,i)=>CR(r,i,n,e),e)}function Jp(e,{clears:t,forget:n,sets:r}){let i=new Set(t),o=AR(e,n,r),s=[...e.scalars].filter(([a,l])=>!i.has(a)&&!(o&&Nl(l.subject)));return{...e,scalars:Ue(new Map(s),r)}}function AR(e,t,n){if(t==="hard")return!0;if(t==="none")return!1;let r=$e(e.scalars,{kind:"path"}),i=$e(n,{kind:"path"});return i!==void 0&&i!==r}function CR(e,t,n,r){let{env:i,identities:o}=n;if(!MR(t,i))return e;if(t.assertion.kind==="created"){let a=Zn(t.assertion.props,Z,i),l=PR({entity:t.entity,identities:o,props:a},e);return TR(e,t.entity,Kr(l),l)}if(t.assertion.kind==="deleted")return Hl(e,t.entity,LR(t.key,i,r));let s=Zn(an(t.assertion.props),Z,i);return Hl(e,t.entity,DR(t.key,s,i,r))}function Kl(e){return e.flatMap(t=>t.kind==="singleton"?[t]:t.kind==="and"?Kl(t.predicates):t.kind==="when"?Kl(t.branches.flatMap(n=>n.consequence)):[])}var Jl="#surrogate#";function Xp(e){return typeof e=="string"&&e.includes(Jl)}function PR({entity:e,identities:t,props:n},r){let i=(t.get(e)??[]).filter(a=>!(a in n));if(i.length===0)return n;let o=IR(r.entities.get(e),e),s=Object.fromEntries(i.map(a=>[a,`${e}${Jl}${String(o)}`]));return{...n,...s}}function IR(e,t){let n=`${t}${Jl}`;return[...(e??new Map).values()].flatMap(i=>Object.values(i)).filter(i=>typeof i=="string"&&i.startsWith(n)).map(i=>Number(i.slice(n.length))).filter(i=>Number.isFinite(i)).reduce((i,o)=>Math.max(i,o),0)+1}function MR(e,t){return("props"in e.assertion?[e.key,an(e.assertion.props)]:[e.key]).every(r=>Object.values(r).every(i=>th(i)||!X(i)||t.has(dt(i.ref))))}function TR(e,t,n,r){let i=new Map([...e.entities.get(t)??[],[n,r]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function Hl(e,t,n){let r=n(e.entities.get(t)??new Map);return{...e,entities:new Map([...e.entities,[t,r]])}}function Jr(e){return e.flatMap(t=>t.kind==="state"?[t]:t.kind==="and"?Jr(t.predicates):t.kind==="when"?Jr(t.branches.flatMap(n=>n.consequence)):[])}function Tn(e,t,n,r){let i={env:r,key:n,snapshot:e};return[...(e.entities.get(t)??new Map).values()].filter(o=>vo(o,i))}function Qp(e,t,n,r,i){let o={env:r,key:n,snapshot:e};return Hl(e,t,s=>new Map([...s].map(([a,l])=>[a,vo(l,o)?i(l):l])))}function vo(e,t){return Object.entries(t.key).every(([n,r])=>eh(e[n],r,t))}function eh(e,t,n){return th(t)?OR(t,n).has(xo(e)):xo(e)===xo($R(t,n.env))}function th(e){return typeof e=="object"&&e!==null&&"kind"in e}function OR(e,t){let n=t.snapshot.entities.get(e.selection.entity);return n==null?new Set:new Set([...n.values()].filter(r=>NR(r,e.selection.where,t)).map(r=>xo(r[e.field])))}function NR(e,t,n){return Object.entries(t).every(([r,i])=>eh(e[r],i,n))}function xo(e){return e==null?"\u2205":e instanceof Date?e.toISOString():JSON.stringify(e)}function $R(e,t){return tt(e,Z,t)}function LR(e,t,n){let r={env:t,key:e,snapshot:n};return i=>new Map([...i].filter(([,o])=>!vo(o,r)))}function DR(e,t,n,r){let i={env:n,key:e,snapshot:r};return o=>new Map([...o].map(([s,a])=>vo(a,i)?[s,{...a,...t}]:[s,a]))}function nh(e){return[...FR(e.action),...e.expect.flatMap(t=>ln(t))]}function Ye(e){return X(e)?[e.ref]:qe(e)?e.template.flatMap(t=>X(t)?[t.ref]:[]):[]}function nt(e){return e.by==="inside"?[...nt(e.scope),...nt(e.target)]:e.by==="role"?e.name==null?[]:Ye(e.name):Ye(e.value)}function ln(e){switch(e.kind){case"visible":case"unobstructed":case"disabled":case"enabled":case"focused":case"checked":case"expanded":case"pressed":return nt(e.locator);case"value":case"text":return[...nt(e.locator),...Ye(e.value)];case"singleton":return Ye(e.assertion.value);case"browser":return Ye(e.value);case"state":return[...e.assertion.kind==="deleted"?[]:Object.values(an(e.assertion.props)).flatMap(t=>Ye(t)),...Object.values(e.key).flatMap(t=>rh(t))];case"not":return ln(e.predicate);case"when":return e.branches.flatMap(t=>t.consequence.flatMap(n=>ln(n)));case"and":return e.predicates.flatMap(t=>ln(t));case"count":return[]}}function FR(e){return e.kind==="goto"?Ye(e.url):e.kind==="fill"||e.kind==="select"?[...nt(e.locator),...Ye(e.value)]:e.kind==="press"?e.locator==null?[]:nt(e.locator):(e.kind==="upload",nt(e.locator))}function rh(e){return _R(e)?Object.values(e.selection.where).flatMap(t=>rh(t)):Ye(e)}function _R(e){return typeof e=="object"&&e!==null&&"kind"in e}function Ro(e){return e.flatMap(t=>t.kind==="and"?Ro(t.predicates):[t])}function un(e){return Ro(e).filter(t=>!jt(t))}function ko(e){return e.action.kind==="goto"?!0:Xl(e.expect).some(t=>t.kind==="browser"&&t.name==="url"&&t.value!==null)}function On(e){return e.action.kind==="goto"?!0:Xl(e.expect).some(t=>t.kind==="browser"&&t.name==="url"&&t.value!==null&&(t.part===void 0||t.part.kind==="path"))}function Xl(e){return e.flatMap(t=>t.kind==="and"?Xl(t.predicates):[t])}function cn(e,t){return t.reduce((n,r)=>{let i=[...zR(r),...ei(r),...GR(r)],o=jR(r,n,i)?WR(n):n;return i.reduce((s,a)=>Ol(s,a),o)},e)}function ht(e){return e.kind==="not"?BR(e.predicate):e.kind==="singleton"?{expect:{expect:"is",value:e.assertion.value},subject:{kind:"variable",name:e.singleton}}:e.kind==="browser"?{expect:e.value===null?{expect:"absent"}:{expect:"is",value:e.value},subject:mo(e.name,e.part)}:ih(e,!1)}function Qr(e){return Op(Tp(e)).map(({clause:t,key:n})=>({expect:t===null?{expect:"absent"}:{expect:"is",value:t},subject:n}))}function jR(e,t,n){if(e.action.kind==="goto")return!0;if(!On(e))return!1;let r=t.get(K({kind:"path"})),i=n.find(o=>o.subject.kind==="path");return i==null?!1:r==null||C(r.expect)!==C(i.expect)}function BR(e){return e.kind==="value"||e.kind==="text"?{expect:{expect:"not",value:e.value},subject:{kind:"element",locator:e.locator,state:e.kind}}:ih(e,!0)}function ih(e,t){if(e.kind==="value"||e.kind==="text")return{expect:{expect:"is",value:e.value},subject:{kind:"element",locator:e.locator,state:e.kind}};let n=VR(e);return n==null?null:{expect:{expect:"is",value:n.value!==t},subject:{kind:"element",locator:n.locator,state:n.state}}}function ei(e){let t=e.action;return!("locator"in t)||t.locator==null?[]:t.kind==="check"||t.kind==="uncheck"?[{expect:{expect:"is",value:t.kind==="check"},subject:{kind:"element",locator:t.locator,state:"checked"}}]:t.kind==="clear"?[{expect:{expect:"is",value:""},subject:{kind:"element",locator:t.locator,state:"value"}}]:t.kind==="fill"||t.kind==="select"?[{expect:{expect:"is",value:t.value},subject:{kind:"element",locator:t.locator,state:"value"}}]:[]}function VR(e){return UR(e)?e.kind==="disabled"?{locator:e.locator,state:"enabled",value:!1}:{locator:e.locator,state:e.kind,value:!0}:null}function UR(e){return e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked"||e.kind==="expanded"||e.kind==="pressed"}function WR(e){return new Map([...e].filter(([,t])=>t.subject.kind==="variable"))}function zR(e){return e.action.kind==="goto"?Qr(e.action.url):[]}function GR(e){return un(e.expect).flatMap(t=>{let n=ht(t);return n==null?[]:[n]})}function Ql(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var Mt={async:12e4,fast:5e3,slow:3e4},eu={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:Mt.async},fast:{backoffMs:[100,250,500,1e3],timeoutMs:Mt.fast},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:Mt.slow}};function oh(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function We(e){return`${e.workflow}/${e.slug}`}function Le(e){return e.workflows.flatMap(t=>t.tests.map(n=>({ref:We(n),test:n,workflow:t})))}function Tt(e){return`${e.test}#${String(e.index)}`}function ti(e){let t=Le(e).flatMap(n=>ni(e,n.test));return Ut(t,n=>`${n.test}:${C(n.steps)}`)}function ni(e,t){let n=ah(t),r=sh(n,t.singletons),i=fk(t,dk(e)),o=KR(e,t),s=Zl(e);return HR(r,pk(t.steps),n).reduce((l,{chunk:u,requiredState:c},d)=>({offset:l.offset+u.length,transitions:[...l.transitions,lk({chunk:u,identities:s,index:d,intent:t.intent,namespace:n.namespace,paramSpaceOf:i,requiredState:c,testRef:We(t),whenChunk:o.slice(l.offset,l.offset+u.length)})]}),{offset:0,transitions:[]}).transitions}function sh(e,t){return{absences:ok(e),entities:ak(e),exclusives:e.exclusives,scalars:new Map(Object.entries(t).filter(([,n])=>!X(n)&&!qe(n)).map(([n,r])=>[K({kind:"variable",name:n}),{expect:{expect:"is",value:r},subject:{kind:"variable",name:n}}]))}}function KR(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 Eo(e,t,n){return Object.values(e).flatMap(r=>X(r)?ii(r.ref,n):[]).find(r=>r.entity===t)?.aliasPath}function HR(e,t,n){return t.reduce((r,i)=>({requiredState:qR(r.requiredState,i,n),withRequiredState:[...r.withRequiredState,{chunk:i,requiredState:rk(r.requiredState,i)}]}),{requiredState:e,withRequiredState:[]}).withRequiredState}function qR(e,t,n){let r=t.flatMap(i=>i.expect.filter(o=>o.kind==="state")).reduce((i,o)=>YR(i,o,n),e);return{...r,scalars:cn(r.scalars,t)}}function YR(e,t,n){return t.assertion.kind==="deleted"?ZR(e,t,n):t.assertion.kind==="created"?QR(e,t.entity,t.assertion.as,t.assertion.props,n):tk(e,t,n)}function ZR(e,t,n){let r=Eo(t.key,t.entity,n.namespace),i=e.entities.find(a=>a.alias===r),o=ri(JR(t.key),n),s=i==null?{entity:t.entity,...o}:{entity:i.entity,...XR(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==r)}}function JR(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let n=t[1];return ik(n)?[]:[[t[0],n]]}))}function XR(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(n=>!t.relations.some(r=>r.field===n.field)),...t.relations]}}function QR(e,t,n,r,i){let o=ri(r,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!ek(o,s)),entities:[...e.entities,{alias:n,entity:t,...o}]}}function ek(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 tk(e,t,n){if(t.assertion.kind!=="updated")return e;let r=Eo(t.key,t.entity,n.namespace);if(r==null)return e;let i=ri(an(t.assertion.props),n),o=Object.entries(t.assertion.props).filter(([,a])=>sn(a)).map(([a])=>a),s=a=>a.alias===r?nk(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a))}}function nk(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 rk(e,t){return t[0]?.action.kind!=="goto"?e:{...e,scalars:new Map([...e.scalars].filter(([,n])=>n.subject.kind==="variable"))}}function Ao(e,t){let n=ah(t);return{namespace:n.namespace,requiredState:sh(n,t.singletons)}}function nu(e,t){return[...new Set(e)].flatMap(n=>ii(n,t))}function ah(e){return{absences:e.absent,exclusives:e.exclusive,namespace:new Map(e.world.map(t=>[t.as,t.entity])),setups:e.world}}function ik(e){return typeof e=="object"&&e!==null&&"kind"in e}function ok(e){return e.absences.map(t=>({entity:t.entity,...ri(t.where,e)}))}function ri(e,t){let n=Object.entries(e),r=Object.fromEntries(n.flatMap(([o,s])=>X(s)||qe(s)?[]:[[o,s]])),i=n.flatMap(o=>{let s=o[1];if(!X(s))return[];let a=ii(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 sk(e,t){return e.map(n=>({alias:n.as,entity:n.entity,...ri(n.set,t)}))}function ak(e){return sk(e.setups,e)}function ii(e,t){let n=zr(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 lk(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=>nh(s)))];return{effectStep:i,identities:e.identities,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:Ql(e.chunk.flatMap(s=>[...uk(s),...ck(s)])),whenSteps:e.whenChunk}}function uk(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function ck(e){return ko(e)?["slow"]:[]}function dk(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function fk(e,t){return new Map(Object.entries(e.params).map(([n,r])=>[n,t.get(r.valueSpace)]))}function pk(e){return tu(e,0,[],[])}function tu(e,t,n,r){let i=e[t];if(i==null)return n.length===0?r:[...r,n];let o=[...n,i];return hk(i)?tu(e,t+1,[],[...r,o]):tu(e,t+1,o,r)}function hk(e){return e.expect.some(t=>t.kind==="state")}function Po(e){let t=e.filter(r=>!r.localConsequence),n=mk(t).flatMap(r=>gk(r));return yk(n)}function mk(e){return[...e.reduce((n,r)=>{let i=C(r.consequence);return new Map([...n,[i,[...n.get(i)??[],r]]])},new Map).values()]}function yk(e){return[...new Map(e.map(n=>[C([Co(n.when),n.consequence]),n])).values()]}function gk(e){return e.length<2?[]:[e,...bk(e),...Sk(e)].flatMap(t=>wk(t))}function bk(e){let n=[...new Set(e.flatMap(r=>r.when.entities.map(i=>i.entity)))].map(r=>e.filter(i=>i.when.entities.some(o=>o.entity===r)));return uh(e,n)}function uh(e,t){let n=t.filter(i=>i.length>=2&&i.length<e.length);return[...new Map(n.map(i=>[C(i.map(o=>C([Co(o.when),o.consequence]))),i])).values()]}function Co(e){return C([e.entities,e.absences,e.exclusives,ch(e.scalars)])}function ch(e){return[...e].toSorted((t,n)=>t[0].localeCompare(n[0])).map(([t,n])=>[t,n.expect])}function Sk(e){let n=[...new Set(e.map(r=>ru(r.when.scalars)))].map(r=>e.filter(i=>ru(i.when.scalars)===r));return uh(e,n)}function ru(e){return C(ch(new Map([...e].filter(([,t])=>Xn(t.subject)))))}function wk(e){if(e.length<2)return[];let t=e.toSorted((r,i)=>lh(r.when)-lh(i.when))[0];if(t==null)return[];let n={absences:Rk(e),entities:kk(e),presenceTypes:Ek(e),scalars:Ak(e,t)};return Ck(e,n.entities)?[]:Tk(t,n,Dk(e)).filter(r=>vk(r,e))}var xk=3;function vk(e,t){return[...e.when.scalars.values()].some(i=>Xn(i.subject))?!0:new Set(t.map(i=>ru(i.when.scalars))).size>=xk}function lh(e){return e.entities.length+e.absences.length+e.scalars.size}function Rk(e){let t=e.map(r=>new Set(r.when.absences.map(i=>dh(i)))),[n]=t;return n==null?[]:[...n].filter(r=>t.every(i=>i.has(r)))}function dh(e){return C([e.entity,e.literals,e.relations])}function kk(e){let t=e.map(r=>new Set(r.when.entities.map(i=>iu(i)))),[n]=t;return n==null?[]:[...n].filter(r=>t.every(i=>i.has(r)))}function iu(e){return C([e.entity,e.literals])}function Ek(e){let t=e.map(r=>new Set(r.when.entities.map(i=>i.entity))),[n]=t;return n==null?[]:[...n].filter(r=>t.every(i=>i.has(r)))}function Ak(e,t){let n=[...t.when.scalars].filter(([r,i])=>e.every(o=>{let s=o.when.scalars.get(r);return s!=null&&C(s.expect)===C(i.expect)}));return new Map(n)}function Ck(e,t){return e.some(n=>{let r=fh(n.consequence),i=Pk(r),o=Ik(r);return n.when.entities.some(s=>!t.includes(iu(s))&&(Mk(s,i)||o.has(s.alias)))})}function fh(e){return e.kind==="not"?fh(e.predicate):"locator"in e?e.locator:void 0}function Pk(e){return Pn(e,t=>t==null||X(t)||qe(t)?[]:[t])}function Ik(e){return Pn(e,t=>{if(t==null||!X(t))return[];let n=zr(t.ref);return n==null?[]:[n.alias]})}function Mk(e,t){return Object.values(e.literals).some(n=>typeof n=="string"&&t.has(n))}function Tk(e,t,n){let r=e.when.entities.filter(u=>t.entities.includes(iu(u))),i=new Set(r.map(u=>u.entity)),o=Ok(e,t.presenceTypes,i),s=[...r,...o],a=new Set(s.map(u=>u.alias));if(![...e.refs].every(u=>a.has(u)))return[];let l=rr({absences:e.when.absences.filter(u=>t.absences.includes(dh(u))),entities:s.map(u=>Nk(u,a)),exclusives:e.when.exclusives.filter(u=>s.some(c=>c.entity===u)),scalars:$k(t.scalars,a)});return Co(l)===Co(e.when)?[]:[{consequence:e.consequence,localConsequence:!1,origin:{kind:"generalized",tests:n},refs:e.refs,when:l}]}function Ok(e,t,n){return t.filter(r=>!n.has(r)).flatMap(r=>{let i=e.when.entities.find(o=>o.entity===r);return i==null?[]:[{...i,literals:{},relations:[]}]})}function Nk(e,t){return{...e,relations:e.relations.filter(n=>t.has(n.targetAlias))}}function $k(e,t){return new Map([...e].filter(([,n])=>Lk(n,t)))}function Lk(e,t){let n=e.expect.expect==="absent"?[]:Ye(e.expect.value);return[...e.subject.kind==="element"?nt(e.subject.locator):[],...n].every(i=>{let o=zr(i);return o==null||t.has(o.alias)})}function Dk(e){return[...new Set(e.flatMap(t=>t.origin==null?[]:t.origin.kind==="generalized"?t.origin.tests:[t.origin.test]))]}function hh(e){return e.flatMap((t,n)=>e.slice(n+1).flatMap(r=>yh(t,r)))}function Nn(e,t){return Fk(e.entities,t.entities)&&gh(e.absences,t.absences)&&e.exclusives.every(n=>t.exclusives.includes(n))&&Bk(e.scalars,t.scalars)}function mh(e,t){return yh(e,t).length>0}function Io(e,t){return Nn(e.when,t.when)&&bh(e.consequence,t.consequence)}function yh(e,t){return!(Nn(e.when,t.when)&&Nn(t.when,e.when))||!bh(e.consequence,t.consequence)?[]:[{a:e.consequence,b:t.consequence,when:e.when}]}function gh(e,t){let n=new Set(t.map(r=>C(r)));return e.every(r=>n.has(C(r)))}function Fk(e,t){return e.every(n=>t.some(r=>_k(n,r)))}function _k(e,t){return e.entity===t.entity&&jk(e.literals,t.literals)&&gh(e.relations,t.relations)}function jk(e,t){return Object.entries(e).every(([n,r])=>n in t&&C(t[n])===C(r))}function Bk(e,t){return[...e].every(([n,r])=>{let i=t.get(n);return i!=null&&C(i.expect)===C(r.expect)})}function bh(e,t){let n=ht(e),r=ht(t);return n==null||r==null||K(n.subject)!==K(r.subject)?!1:Vk(n,r)}function Vk(e,t){return Uk(e)?ph(e,t):e.expect.expect==="is"&&t.expect.expect==="is"?C(e.expect.value)!==C(t.expect.value):ph(e,t)}function Uk(e){return e.subject.kind==="element"&&e.subject.state==="text"}function ph(e,t){let n=[e.expect,t.expect],r=n.find(o=>o.expect==="is"),i=n.find(o=>o.expect==="not");return r==null||i==null?!1:C(r.value)===C(i.value)}function Sh(e,t){return e.flatMap(n=>{let r=Wk(n),i=new Set(n.requiredState.absences.map(o=>o.entity));return t.flatMap(o=>zk(n,o,r,i))})}function Wk(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(n=>n.kind==="state"&&n.assertion.kind==="deleted"?[n.entity]:[])))}function zk(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:Tt(e)}]}function oi(e){return C({consequence:e.consequence,when:ir(e.when)})}function si(e){let t=Hk(e),n=new Set(t.map(i=>oi(i))),r=Po(t).filter(i=>!n.has(oi(i))).reduce((i,o)=>{let s=t.some(l=>Io(o,l)),a=i.some(l=>mh(o,l));return s||a?i:[...i,o]},[]);return[...t,...Ut(r,oi)]}function ou(e,t){return e.filter(n=>!qk(n)||Yk(n)===t)}function To(e){return e.kind==="not"?To(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked"||e.kind==="expanded"||e.kind==="pressed"||e.kind==="value"||e.kind==="text"}function Oo(e,t){if(e.length===0)return t;let n=ai(e,t);return n.size===0?t:{...t,scalars:Ue(n,t.scalars)}}function ai(e,t){let n=e.flatMap(r=>{let i=It(r.when,t);if(i==null)return[];let o=Gk(r.consequence,i);return o==null?[]:[{entry:o,key:K(o.subject),when:r.when}]});return n.reduce((r,i)=>Kk(i,n)?r:Mn(r,i.entry),Bt)}function Gk(e,t){let n=ht(e);if(n==null)return null;try{return Yr({declared:!0,entry:n,env:t})}catch{return null}}function Kk(e,t){return t.some(n=>n.key===e.key&&Nn(e.when,n.when)&&!Nn(n.when,e.when))}function Hk(e){return Ut(Le(e).flatMap(t=>oE(e,t)),oi)}function qk(e){return e.origin?.kind==="test"&&e.localConsequence}function Yk(e){let{origin:t}=e;if(!(t==null||t.kind==="generalized"))return t.test}function vh(e,{test:t,workflow:n}){let r=Ao(e,t),i=Zk(n.steps),o=t.steps.reduce((s,a)=>{let l=Jk(s.requiredState,a,r),u=sE({branchScoped:i,namespace:r.namespace,origin:{kind:"test",test:We(t)},paramNames:new Set(Object.keys(t.params)),post:l,pre:s.requiredState,step:a});return{requiredState:l,steps:[...s.steps,{facts:u,post:l}]}},{requiredState:r.requiredState,steps:[]});return{initial:r.requiredState,steps:o.steps}}function Zk(e){let t=e.flatMap(n=>n.expect).flatMap(n=>Mo(n)).map(n=>C(n));return new Set(t)}function Mo(e){return e.kind==="not"?Mo(e.predicate):e.kind==="and"?e.predicates.flatMap(t=>Mo(t)):e.kind!=="when"?[]:e.branches.flatMap(t=>t.consequence.flatMap(n=>[n,...Mo(n)]))}function Jk(e,t,n){return{...Xk(e,t,n),scalars:cn(e.scalars,[t])}}function Xk(e,t,n){return t.expect.reduce((r,i)=>i.kind==="state"?Qk(r,i,n):r,e)}function Qk(e,t,n){if(t.assertion.kind==="created"){let o=eE(t.assertion.as,t.entity,t.assertion.props,n);return{...e,entities:[...e.entities,o]}}let r=Eo(t.key,t.entity,n.namespace);if(r==null)return e;if(t.assertion.kind==="deleted")return rE(e,r);let i=an(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===r?Rh(o,i,n):o)}}function eE(e,t,n,r){return Rh({alias:e,entity:t,literals:{},relations:[]},n,r)}function Rh(e,t,n){return Object.entries(t).reduce((r,[i,o])=>{if(qe(o))return r;if(X(o)){let s=tE(o.ref,i,n.namespace);return{...r,literals:nE(r.literals,i),relations:s==null?r.relations:[...wh(r.relations,i),s]}}return{...r,literals:{...r.literals,[i]:o},relations:wh(r.relations,i)}},e)}function tE(e,t,n){let[r]=ii(e,n);return r==null?void 0:{entity:r.entity,field:t,targetAlias:r.aliasPath,targetField:r.field}}function nE(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>n!==t))}function wh(e,t){return e.filter(n=>n.field!==t)}function rE(e,t){let n=e.entities.find(i=>i.alias===t),r=iE(e,t);return n==null?r:{...r,absences:[...r.absences,{entity:n.entity,literals:n.literals,relations:n.relations}]}}function iE(e,t){return{...e,entities:e.entities.filter(n=>n.alias!==t)}}function oE(e,t){return vh(e,t).steps.flatMap(n=>n.facts)}function ir(e){return C([e.entities,e.absences,e.exclusives,$l(e.scalars).map(([t,n])=>[t,n.expect])])}function sE(e){return un(e.step.expect).filter(t=>To(t)&&!e.branchScoped.has(C(t))).flatMap(t=>aE(t,e))}function aE(e,t){let n=ht(e);if(n==null)return[];if(ln(e).some(s=>t.paramNames.has(s)))return[];let r=K(n.subject),i={...t.post,scalars:new Map([...t.post.scalars].filter(([s])=>s!==r))},o=lE(i,t.pre,t.paramNames);return o==null?[]:ir(o)===ir(t.pre)?[]:[{consequence:e,localConsequence:nu(ln(e),t.namespace).length>0,origin:t.origin,refs:new Set(nu([...cE(o),...ln(e)],t.namespace).map(s=>s.aliasPath)),when:o}]}function lE(e,t,n){let r=[...e.scalars.values()].map(i=>uE(i,t,n));return r.some(i=>i==null)?null:{...e,scalars:new Map(r.flatMap(i=>i==null?[]:[[K(i.subject),i]]))}}function uE(e,t,n){if(!xh(e,n))return e;if(e.subject.kind!=="element"||e.expect.expect==="absent"||nt(e.subject.locator).some(i=>n.has(i)))return null;let r=t.scalars.get(K(e.subject));return r==null||r.expect.expect!=="is"||xh(r,n)?null:{expect:{expect:"not",value:r.expect.value},subject:e.subject}}function xh(e,t){let n=e.expect.expect==="absent"?[]:Ye(e.expect.value);return[...e.subject.kind==="element"?nt(e.subject.locator):[],...n].some(i=>t.has(i))}function cE(e){return[...e.scalars.values()].flatMap(t=>Xn(t.subject)&&t.expect.expect!=="absent"?Ye(t.expect.value):[])}function No(e){return Ut(Le(e).flatMap(t=>dE(e,t.test)),su)}function su(e){return C({holds:ir(e.holds),reference:e.reference,when:ir(e.when)})}function $o(e,t){return It(e.when,t)==null?!1:It(e.holds,t)==null}function dE(e,t){let n=Ao(e,t);return n.requiredState.entities.flatMap(r=>r.relations.flatMap(i=>fE(e,r,i,n.namespace)?mE(r,i,n.namespace):[]))}function fE(e,t,n,r){let i=r.get(n.targetAlias);return i!=null&&!pE(e,t.entity,n.field)&&hE(e,i,n.targetField)}function pE(e,t,n){return e.entities.find(r=>r.name===t)?.props[n]?.optional===!0}function hE(e,t,n){return e.entities.find(r=>r.name===t)?.identity.includes(n)===!0}function mE(e,t,n){let r=n.get(t.targetAlias);if(r==null)return[];let i=kh(e.alias,e.entity),o=kh(t.targetAlias,r);return[{holds:rr({entities:[{...i,relations:[t]},o]}),reference:{field:t.field,source:e.entity,target:r,targetField:t.targetField},when:rr({entities:[i]})}]}function kh(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function Eh(e){return e.kind==="data-rule"?C({kind:e.kind,rule:su(e.dataRule)}):C(e)}var mt=class extends Error{name="AbortError";constructor(){super("aborted")}};function li(e){return e instanceof Error&&e.name==="AbortError"}function rt(e){if(e.aborted)throw new mt}function dn(e,t){return t.aborted?Promise.reject(new mt):new Promise((n,r)=>{let i=()=>{clearTimeout(o),r(new mt)},o=setTimeout(()=>{t.removeEventListener("abort",i),n()},e);t.addEventListener("abort",i,{once:!0})})}var yE={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=yE[e.kind]??e.kind;return e.kind==="press"&&e.key!=null?`${t}: ${e.key}`:t}function Lo(e){return e.kind==="data-rule"?"data rule":Ch(e.check)}function Ch(e){return e.kind==="not"?`not ${Ch(e.inner)}`:e.kind==="browser"?Jn(e.key):`${Ph(e.locator)} ${e.kind}`}function Ph(e){return e.by==="testId"?"element":e.by==="inside"?Ph(e.target):e.role}function Ih(e){return e.kind==="goto"?e.url:e.kind==="press"?e.key:e.value==null?void 0:String(e.value)}function Do(e){return e.kind==="data-rule"?void 0:Th(e.check)}function Mh(e){return e.kind==="data-rule"?!1:Fo(e.check)}function Fo(e){return e.kind==="not"?Fo(e.inner):e.kind==="browser"&&Mp(e.key)}function Th(e){if(e.kind==="not")return Th(e.inner);if(e.kind==="value"||e.kind==="text"||e.kind==="browser")return e.value??void 0}function Oh({atMs:e,findings:t,step:n}){return n.urlChecks.map(r=>({atMs:e,ephemeral:!1,kind:"assertion",label:Lo({check:r,kind:"step"}),outcome:t.length>0?"failed":"passed",rrwebIds:[],url:!0,value:Do({check:r,kind:"step"})}))}function _o({action:e,actionLabel:t,outcome:n,rrwebIds:r,startMs:i}){return{atMs:i,ephemeral:!1,kind:"action",label:t,outcome:n,rrwebIds:r,url:!1,value:Ih(e)}}var gE=()=>[],bE=()=>Bt;async function Bo({canon:e,classify:t,dataRuleChecks:n,derive:r,initialSnapshot:i,observe:o,onAssertion:s,onStep:a,steps:l,stopAfterStep:u},c){return Fh({acc:[],canon:e,classify:t,dataRuleChecks:n??gE,derive:r??bE,index:0,observe:o,onAssertion:s,onStep:a,signal:c,snapshot:i,steps:l,stopAfterStep:u})}async function Fh({acc:e,canon:t,classify:n,dataRuleChecks:r,derive:i,index:o,observe:s,onAssertion:a,onStep:l,signal:u,snapshot:c,steps:d,stopAfterStep:p}){rt(u);let m=d[o];if(m==null)return{finalModel:c,findings:e};let f=Date.now(),h=await m.targetIds(),y=Ah(m.step.action);if(!m.requiredState(c)){let S={kind:"impossible-action",step:m.step};return au(l,{annotations:[_o({action:m.step.action,actionLabel:y,outcome:"failed",rrwebIds:h,startMs:f})],endMs:Date.now(),findings:[S],index:o,post:c,pre:c,source:m.source,startMs:f,url:tr(c)}),{finalModel:c,findings:[...e,S]}}return m.perform().match(()=>SE({acc:e,actionLabel:y,canon:t,classify:n,dataRuleChecks:r,derive:i,index:o,observe:s,onAssertion:a,onStep:l,rrwebIds:h,signal:u,snapshot:c,startMs:f,step:m,steps:d,stopAfterStep:p}),S=>{let x=jo(S,m);return au(l,{annotations:[_o({action:m.step.action,actionLabel:y,outcome:"failed",rrwebIds:h,startMs:f})],endMs:Date.now(),findings:[x],index:o,post:c,pre:c,source:m.source,startMs:f,url:tr(c)}),Promise.resolve({finalModel:c,findings:[...e,x]})})}async function SE({acc:e,actionLabel:t,canon:n,classify:r,dataRuleChecks:i,derive:o,index:s,observe:a,onAssertion:l,onStep:u,rrwebIds:c,signal:d,snapshot:p,startMs:m,step:f,steps:h,stopAfterStep:y}){let S=f.effect(p),x=o(S),b={...S,scalars:Ue(x,S.scalars)},v=await EE({canon:n,claimed:new Set([...f.assertedScalars,...x.keys()]),classify:r,observe:a,pre:p,predicted:b,signal:d,step:f}),N={...v.snapshot,scalars:new Map([...[...v.snapshot.scalars].filter(([,se])=>se.subject.kind!=="element"),...[...S.scalars].filter(([,se])=>se.subject.kind==="element")])},$=Date.now(),L=[...f.pendingChecks,...i(p,v.snapshot)],D=await wE({onAssertion:l,pendingChecks:L,signal:d,step:f}),M=[...D.findings,...v.findings];au(u,{annotations:[_o({action:f.step.action,actionLabel:t,outcome:M.length>0?"failed":"passed",rrwebIds:c,startMs:m}),...Oh({atMs:$,findings:v.findings,step:f}),...D.annotations],endMs:Date.now(),findings:M,index:s,post:v.snapshot,pre:p,source:f.source,startMs:m,url:tr(v.snapshot)});let V=[...e,...M];return M.length>0?{finalModel:N,findings:V}:y!=null&&s+1>=y?{finalModel:N,findings:V}:Fh({acc:V,canon:n,classify:r,dataRuleChecks:i,derive:o,index:s+1,observe:a,onAssertion:l,onStep:u,signal:d,snapshot:N,steps:h,stopAfterStep:y})}async function wE({onAssertion:e,pendingChecks:t,signal:n,step:r}){let i=[...new Map(t.map(s=>[Eh(s.source),s])).values()],o=await Promise.all(i.map(async s=>{let a=await xE(s,n),l=Date.now(),u=await s.targetIds();return{atMs:l,outcome:a,pendingCheck:s,rrwebIds:u}}));return o.forEach(s=>{vE(e,s.pendingCheck,s.outcome,r)}),{annotations:o.filter(s=>s.pendingCheck.source.kind==="step").map(s=>({atMs:s.atMs,ephemeral:s.pendingCheck.ephemeral,kind:"assertion",label:Lo(s.pendingCheck.source),outcome:_h(s.outcome),rrwebIds:s.rrwebIds,url:Mh(s.pendingCheck.source),value:Do(s.pendingCheck.source)})),findings:o.flatMap(s=>RE(s.pendingCheck,s.outcome,r))}}function xE(e,t){if(e.check.kind==="decided"){let n=e.check.passed?"passed":"failed";return Promise.resolve({kind:n})}return e.check.wait(eu[e.budget].timeoutMs).match(n=>n?{kind:"passed"}:{kind:"failed"},n=>{if(n.kind==="aborted")throw new mt;return{error:n,kind:"error"}})}function vE(e,t,n,r){e?.({outcome:_h(n),source:t.source,step:r.step,waitBudget:t.budget,waitMs:Mt[t.budget]})}function _h(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function RE(e,t,n){return t.kind==="error"?[jo(t.error,n)]:t.kind==="failed"?[{budget:e.budget,kind:"pending-check",source:e.source,step:n.step}]:[]}function jo(e,t){return{error:e,kind:"driver-error",step:t.step}}function au(e,t){e?.(t)}function Nh(e){return e().match(t=>({observed:t,ok:!0}),t=>({error:t,ok:!1}))}function kE(e,t,n){return n.reconcile==null?e:n.reconcile(e,t)}function $h({canon:e,pre:t,predicted:n,step:r},i){let o=r.verifyChanges==null?[]:r.verifyChanges(n,i),s=kE(n,i,r),a=o.map(l=>({mismatch:l,pending:!0}));return{adopted:s,probed:[...a,...yo({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function jh(e,t){return{budget:t.sync,kind:"consistency",mismatch:e.mismatch,pending:e.pending,step:t.step}}function Lh(e,t,n){let r=e.probed.filter(i=>!i.pending&&n(i.mismatch)==="strict");return r.length>0?{findings:r.map(i=>jh(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function Dh(e,t,n){return{findings:[...e.probed.map(r=>jh(r,t)),...n],snapshot:e.adopted}}async function EE({canon:e,claimed:t,classify:n,observe:r,pre:i,predicted:o,signal:s,step:a}){let l=eu[a.sync],u=Date.now()+l.timeoutMs,c=Ue(i.scalars,o.scalars),d=new Map([...c].filter(([y,S])=>S.declared&&(S.subject.kind!=="element"||t.has(y)))),p=()=>r(d),m=await Nh(p);if(!m.ok)return{findings:[jo(m.error,a)],snapshot:o};let f=$h({canon:e,pre:i,predicted:o,step:a},m.observed),h=0;for(;Date.now()<u;){rt(s);let y=Lh(f,a,n);if(y!=null)return y;await dn(oh(l,h),s),h+=1;let S=await Nh(p);if(!S.ok)return Dh(f,a,[jo(S.error,a)]);f=$h({canon:e,pre:i,predicted:o,step:a},S.observed)}return Lh(f,a,n)??Dh(f,a,[])}function lu(e){let t=e.predicates.filter(o=>Wh(o)),n=t.filter(o=>o.assertion.kind==="created"),r=Uh(t);if(n.length===0&&r.length===0&&e.deferred.length===0)return;let i=t.filter(o=>o.assertion.kind==="updated");return(o,s)=>{let a=n.reduce((c,d)=>TE(c,s,d,e),{env:e.env,snapshot:o}),l=r.reduce((c,d)=>ME(c,s,d,e.env),a.snapshot),u=i.reduce((c,d)=>AE(c,s,d),a.env);return LE(l,e.deferred,u)}}function Vh(e,t,n){return new Map([...e,...Object.entries(n).map(([r,i])=>[et(Z,`${t}.${r}`),i])])}function AE(e,t,n){let r=Tn(t.snapshot,n.entity,n.key,e).at(0);return r==null?e:Vh(e,n.assertion.as,r)}function uu(e){let t=Uh(e.predicates.filter(n=>Wh(n)));if(t.length!==0)return(n,r)=>t.flatMap(i=>CE(i,n,r,e.env))}function Uh(e){return e.filter(t=>t.assertion.kind==="updated"&&cu(t.assertion.props).length>0)}function cu(e){return Object.entries(e).filter(([,t])=>sn(t)).map(([t])=>t)}function Wh(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function CE(e,t,n,r){let i=Tn(t,e.entity,e.key,r).at(0),o=Tn(n.snapshot,e.entity,e.key,r).at(0);if(i==null||o==null)return[];let s=Kr(PE(e.key,r));return cu(e.assertion.props).flatMap(a=>Bh(i[a])===Bh(o[a])?[{entity:e.entity,field:a,key:s,kind:"expected-change",value:o[a]}]:[])}function PE(e,t){let n=Object.fromEntries(Object.entries(e).filter(r=>!IE(r[1])));return Zn(n,Z,t)}function IE(e){return typeof e=="object"&&e!==null&&"kind"in e}function Bh(e){return e==null?"\u2205":JSON.stringify(e)}function ME(e,t,n,r){let i=cu(n.assertion.props),o=Tn(t.snapshot,n.entity,n.key,r).at(0);return o==null?e:Qp(e,n.entity,n.key,r,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function TE(e,t,n,r){if(n.assertion.kind!=="created")return e;let i=Zn(n.assertion.props,Z,r.env),o=e.snapshot.entities.get(n.entity);if(o==null)return e;let s=OE({identityFields:r.identities.get(n.entity)??[],props:i,set:o});if(s==null)return e;let a=NE(t.snapshot.entities.get(n.entity),o,i);if(a==null)return e;let[l,u]=a,c=new Map(o);return c.delete(s),c.set(l,{...u,...i}),{env:Vh(e.env,n.assertion.as,u),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(n.entity,c)}}}function OE({identityFields:e,props:t,set:n}){let r=Kr(t);if(n.has(r))return r;if(e.length===0)return null;let i=Object.entries(t),o=[...n].find(([,s])=>e.every(a=>Xp(s[a]))&&i.every(([a,l])=>Vo(s[a])===Vo(l)));return o==null?null:o[0]}function NE(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])=>Vo(s[a])===Vo(l)).length}));return $E(i,r.length)}function Vo(e){return e==null?"\u2205":JSON.stringify(e)}function $E(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 LE(e,t,n){let r=t.reduce((i,o)=>{let s=DE(o.value,n);return s==null||typeof s!="string"?i:Mn(i,{declared:!0,expect:{expect:"is",value:s},subject:o.key})},e.scalars);return{...e,scalars:r}}function DE(e,t){try{return Ct(e,Z,t)}catch{return}}function du(e,t){if(e.kind==="visible"||e.kind==="unobstructed"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked"||e.kind==="expanded"||e.kind==="pressed")return{kind:e.kind,locator:ft(e.locator,t)};if(e.kind==="not"){let n=du(e.predicate,t);return n==null?null:{inner:n,kind:"not"}}return e.kind==="value"||e.kind==="text"?{kind:e.kind,locator:ft(e.locator,t),value:Ct(e.value,Z,t)}:e.kind!=="browser"?null:{key:mo(e.name,e.part),kind:"browser",value:e.value===null?null:Ct(e.value,Z,t)}}function or(e,t){let{env:n,identities:r}=t,i=e.expect.filter(p=>p.kind==="state"),o=zE(i),{clears:s,deferred:a,sets:l}=_E(e,n,o),u=ko(e),c=GE(e.action,n),d=FE(e);return{action:c,assertedScalars:[...l.keys()],label:e.action.kind,pendingChecks:e.expect.flatMap(p=>qE(p,n,u)),reconcile:lu({deferred:a,env:n,identities:r,predicates:i}),urlChecks:e.expect.flatMap(p=>HE(p,n)),verifyChanges:uu({deferred:a,env:n,identities:r,predicates:i}),effect:p=>Jp(Xr(p,i,t),{clears:s,forget:d,sets:l})}}function FE(e){return e.action.kind==="goto"?"hard":On(e)?"soft-path":"none"}function _E(e,t,n){let r=e.action.kind==="goto"?Qr(e.action.url):[],i=un(e.expect).flatMap(a=>{let l=ht(a);return l==null?[]:[l]}),o=[...r,...i].map(a=>({declared:!0,entry:a}));return[...ei(e).map(a=>({declared:!1,entry:a})),...o].reduce((a,{declared:l,entry:u})=>jE({acc:a,captures:n,declared:l,entry:u,env:t}),{clears:[],deferred:[],sets:Bt})}function jE({acc:e,captures:t,declared:n,entry:r,env:i}){if(BE(r,t))return r.expect.expect==="is"&&zh(r.expect.value)?{...e,deferred:[...e.deferred,{key:WE(r.subject),value:r.expect.value}]}:e;let o=Yr({declared:n,entry:r,env:i});return o.expect.expect==="absent"?{...e,clears:[...e.clears,K(o.subject)]}:{...e,sets:Mn(e.sets,o)}}function BE(e,t){return e.subject.kind==="element"||e.subject.kind==="variable"?!1:e.expect.expect==="is"&&zh(e.expect.value)&&VE(e.expect.value,t)}function zh(e){return typeof e=="string"||typeof e=="object"}function VE(e,t){return UE(e).some(n=>t.has(n.split(".")[0]??n))}function UE(e){return typeof e=="string"?[]:X(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function WE(e){if(e.kind==="element"||e.kind==="variable")throw new Error("expected a browser subject");return e}function zE(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function GE(e,t){return{files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:KE(e,t),url:e.kind==="goto"?Ct(e.url,Z,t):void 0,value:"value"in e?Cp(e.value,t):void 0}}function KE(e,t){if(!(!("locator"in e)||e.locator==null))return ft(e.locator,t)}function HE(e,t){if(e.kind!=="browser"&&e.kind!=="not")return[];try{let n=du(e,t);return n!=null&&Fo(n)?[n]:[]}catch{return[]}}function qE(e,t,n){if(e.kind==="browser"||e.kind==="singleton")return[];let r=du(e,t),i=n?"slow":"fast",o="wait"in e?e.wait??i:i;return r==null?[]:[{budget:o,check:r,ephemeral:jt(e)}]}import{err as Gh,ok as pu,okAsync as YE,Result as ZE}from"neverthrow";function sr(e,t,n){let r=rA(e),i={env:new Map,generate:n.generate,generatedParams:new Set,indexed:r,overrides:new Map(Object.entries(n.params??{}).map(([s,a])=>[dt(s),a]))};iA(t.params,Z,i);let o=t.world.map(s=>oA(s,Z,i));return n.materialize(o).andThen(s=>uA(s,i.env,r).map(a=>JE({base:a,generatedParams:i.generatedParams,lockfile:e,test:t})))}function Uo(e,t){let n=new Map(t.map(r=>[r.name,r]));return r=>YE(eA(r,e,n).rows)}function Wo(e){return t=>{let n=t.map(r=>({as:r.as,entity:r.entity,fields:r.fields}));return e(n).andThen(r=>QE(t,r))}}function hu(e,t){let n=ui(t);return Object.fromEntries(Object.entries(e).filter(([r,i])=>n.includes(r)&&i!=null))}function ui(e){return Object.keys(e.props)}function JE({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,tt(d,Z,e.env)])),s=Object.entries(r.singletons).filter(([,c])=>XE(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,scalars:Ue(e.snapshot.scalars,new Map(Object.entries(a).map(([c,d])=>[K({kind:"variable",name:c}),{declared:!0,expect:{expect:"is",value:d},subject:{kind:"variable",name:c}}])))}}}function XE(e,t){return X(e)?t.has(et(Z,e.ref)):qe(e)?e.template.some(n=>typeof n!="string"&&t.has(et(Z,n.ref))):!1}function QE(e,t){let n=new Map(t.map(r=>[r.as,r]));return ZE.combine(e.map(r=>{let i=n.get(r.as);return i==null?Gh(_p(r.as)):pu({as:r.as,entity:r.entity,generatedFields:r.generatedFields,row:i.row,session:i.session})}))}function eA(e,t,n){return e.reduce((r,i)=>{let o=tA(i.fields,r.env),s=dA({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 tA(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>{if(X(r))return[n,nA(t,r.ref)];if(qe(r))throw new Error(`template value not allowed in entity field "${n}"`);return[n,r]}))}function nA(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 rA(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function iA(e,t,n){Object.entries(e).forEach(([r,i])=>{let o=et(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 oA(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=et(t,e.as),o=sA(e.set,t,n.env),s=lA(r,o,i,n),a=Object.entries(e.set).filter(([,l])=>X(l)&&n.generatedParams.has(et(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 sA(e,t,n){return Object.fromEntries(Object.entries(e).map(([r,i])=>[r,aA(i,t,n)]))}function aA(e,t,n){if(!X(e))return e;let r=et(t,e.ref);return n.get(r)??{ref:r}}function lA(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,Kh({field:i,generate:r.generate,model:e,seedPrefix:n,spec:o,valueSpaces:r.indexed.valueSpaces})]))}function uA(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(et(dt(a.as),c),d));let u=r.get(a.entity)??new Map;return u.set(fu(a.row,l),hu(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:fu(a.row,l)}]}),s=e.flatMap(a=>{let l=n.models.get(a.entity);if(l==null)return[];let u=fu(a.row,l);return a.generatedFields.map(c=>({entity:a.entity,field:c,key:u}))});return cA(i).map(a=>({aliases:o,auth:a,env:t,generated:s,snapshot:{entities:fA(r),scalars:Bt}}))}function cA(e){if(e.length===0)return pu(void 0);let t=new Set(e.map(r=>JSON.stringify(r.cookies))).size;if(t>1)return Gh(jp(t));let n=e.flatMap(r=>Object.entries(r.headers??{}));return pu({cookies:e.flatMap(r=>r.cookies),headers:n.length===0?void 0:Object.fromEntries(n),origins:e.flatMap(r=>r.origins)})}function dA({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,Kh({field:s,generate:e,model:t,seedPrefix:n,spec:a,valueSpaces:i})])),...r}}function Kh({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:et(r,e),type:i.type,values:o.get(s)?.values,valueSpace:s})}function fu(e,t){return t.identity.map(n=>String(e[n])).join(":")}function fA(e){return new Map([...e].map(([t,n])=>[t,new Map(n)]))}function qh(e,t,n){return e.reduce((r,i)=>{let o=Xr(r.snapshot,pA(i),n);return{resolved:[...r.resolved,hA(i,o,n.env)],snapshot:o}},{resolved:[],snapshot:t}).resolved}function pA(e){return e.expect.filter(t=>t.kind==="state")}function hA(e,t,n){return e.expect.some(r=>r.kind==="when")?{...e,expect:e.expect.flatMap(r=>Yh(r,{env:n,snapshot:t}))}:e}function Yh(e,t){if(e.kind!=="when")return[e];let n=mA(e,t);return n==null?[]:n.flatMap(r=>Yh(r,t))}function mA(e,t){return e.branches.find(n=>n.condition==null||mu(n.condition,t))?.consequence}function mu(e,t){if(e.kind==="count")return Tn(t.snapshot,e.entity,{},t.env).length===e.value;if(e.kind==="singleton"){let n=tt(e.assertion.value,Z,t.env);return Hh($e(t.snapshot.scalars,{kind:"variable",name:e.singleton}))===Hh(n)}return e.kind==="not"?!mu(e.predicate,t):e.predicates.every(n=>mu(n,t))}function Hh(e){return e==null?"\u2205":JSON.stringify(e)}function ci(e,t,n){let r=It(e.requiredState,t);return r==null?null:new Map([...Object.entries(n).map(([i,o])=>[dt(i),o]),...r])}function di(e,t,n){let r={env:t,identities:e.identities},i=qh(e.whenSteps,n,r),o=i.at(-1)??e.effectStep,s=or(o,r),a=gA(e,t);return{effect:bA(s.effect,a),steps:i.map(l=>{let u=or(l,r);return{action:u.action,assertedScalars:u.assertedScalars,effect:u.effect,pendingChecks:u.pendingChecks,reconcile:u.reconcile,source:l,urlChecks:u.urlChecks,verifyChanges:u.verifyChanges}})}}function Go(e,t,n){return It(e.requiredState,n)==null?!1:zo(t(n))!==zo(n)||SA(e)||yA(e)}function yA(e){return[...e.nav,...e.steps].every(t=>t.expect.every(n=>n.kind!=="state"))}var Zh=new WeakMap;function zo(e){let t=Zh.get(e);if(t!=null)return t;let n=C({entities:[...e.entities].toSorted(([r],[i])=>r.localeCompare(i)).map(([r,i])=>[r,[...i].toSorted(([o],[s])=>o.localeCompare(s))]),scalars:qr(e.scalars).map(([r,i])=>[r,i.expect])});return Zh.set(e,n),n}function gA(e,t){let n=e.nav.at(-1);if(n!=null)return or(n,{env:t,identities:e.identities}).action.url}function bA(e,t){if(t==null)return e;let n=Qn(t);return r=>{let i=e(r);return{...i,scalars:Ue(i.scalars,n)}}}function SA(e){return e.effectStep.expect.some(t=>t.kind==="state"&&t.assertion.kind==="updated"&&Object.values(t.assertion.props).some(n=>sn(n)))}function ar(e,t,n){let r=ci(e,t.snapshot,n);if(r==null)return null;let i=wA(e,r,t.snapshot);return i==null||!Go(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function Jh(e,t,n){let r=ci(e,t.snapshot,n);if(r==null)return"required-state-unsatisfied";try{return di(e,r,t.snapshot),"no-effect"}catch{return"unresolvable"}}function wA(e,t,n){try{return di(e,t,n)}catch{return null}}function Ko(e,t,n){return e.flatMap((r,i)=>{let o=n(r),s=ar(r,t,o);return s==null?[]:[{idx:i,label:Tt(r),params:o,stepRun:s}]})}function yu(e,t){let n=[...t.entities].flatMap(([o,s])=>[...s].map(([a,l])=>xA({entity:o,key:a,pre:e,row:l}))),r=[...e.entities].flatMap(([o,s])=>[...s].flatMap(([a,l])=>vA({entity:o,key:a,post:t,row:l}))),i=[...t.scalars.values()].flatMap(o=>{if(o.subject.kind!=="variable"||o.expect.expect!=="is")return[];let s=o.subject.name;return[{changed:$e(e.scalars,o.subject)!==o.expect.value,name:s,value:o.expect.value}]});return{rows:[...n,...r],singletons:i}}function xA({entity:e,key:t,pre:n,row:r}){let i=RA(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 vA({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 RA(e,t){return e?.get(t)}function lr(e,t,n){return t.steps.map(r=>({assertedScalars:r.assertedScalars,effect:r.effect,pendingChecks:r.pendingChecks.map(i=>({budget:i.budget,check:{kind:"poll",wait:o=>n.awaitCheck(i.check,o)},ephemeral:i.ephemeral,source:{check:i.check,kind:"step"},targetIds:()=>n.locateIds(Xh(i.check))})),reconcile:r.reconcile,source:r.source,step:{action:r.action,intent:e.intent,test:e.test},sync:e.wait,urlChecks:r.urlChecks,verifyChanges:r.verifyChanges,perform:()=>n.perform(r.action),requiredState:()=>!0,targetIds:()=>n.locateIds(r.action.locator)}))}function Xh(e){if(e.kind==="not")return Xh(e.inner);if(e.kind!=="browser")return e.locator}async function Qh({current:e,driver:t,index:n,next:r,state:i}){if(r==null||kA(r))return[];if(On(e.transition.effectStep))return[];let o=ar(r.transition,i,r.params);if(o==null)return[];let s=lr(r.transition,o.resolved,t).flatMap(u=>u.pendingChecks.flatMap(c=>{let d=EA(c.source);return d==null?[]:[d]}));if(s.length===0)return[];let a=new Map(s.map(u=>{let c={kind:"element",locator:u,state:"visible"};return[K(c),{declared:!0,expect:{expect:"is",value:!0},subject:c}]})),l=await t.observe(a).match(u=>u,()=>null);return l==null?[]:s.filter(u=>$e(l.snapshot.scalars,{kind:"element",locator:u,state:"visible"})===!0).map(u=>({declaredIndex:n+1,kind:"lift-visibility",locator:u,visibleIndex:n}))}function kA(e){return e.transition.nav.length>0||e.transition.steps.some(t=>t.action.kind==="goto"||On(t))}function EA(e){if(e.kind!=="data-rule")return e.check.kind==="visible"?e.check.locator:void 0}async function bu(e,t){let{params:n,transition:r}=e.stepRun,i={snapshot:Oo(e.facts,e.state.snapshot)},o=ar(r,i,n);if(o==null){let a={intent:r.intent,kind:"unrunnable",reason:Jh(r,i,n),test:r.test};return{label:Tt(r),next:e.state,result:{finalModel:e.state.snapshot,findings:[a]}}}let s=await Bo({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,steps:lr(e.stepRun.transition,o.resolved,e.driver),stopAfterStep:e.stopAfterStep==null?void 0:e.stopAfterStep-e.stepBase,dataRuleChecks:(a,l)=>e.dataRules.flatMap(u=>tm(u,l)),derive:a=>ai(e.facts,a)},t);return{label:Tt(e.stepRun.transition),next:{snapshot:s.finalModel},result:s}}function tm(e,t){return $o(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},ephemeral:!1,source:{dataRule:e,kind:"data-rule"},targetIds:()=>Promise.resolve([])}]:[]}function Ho(e,t){return gu({acc:{findings:[],ran:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function gu({acc:e,index:t,params:n,signal:r,state:i,stepBase:o}){rt(r);let s=n.sequence[t];if(s==null)return e;let a=Date.now(),l=[],u=await bu({canon:n.canon,classify:n.classify,dataRules:n.dataRules,driver:n.driver,facts:n.facts,onAssertion:n.onAssertion,state:i,stepBase:o,stepRun:s,stopAfterStep:n.stopAfterStep,onStep:p=>{l.push(p.index),n.onEvent({annotations:p.annotations,endMs:p.endMs,findings:p.findings,index:o+p.index,kind:"step",source:p.source,startMs:p.startMs,state:yu(p.pre,p.post),url:p.url})}},r);if(u==null)return gu({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});let c=await AA({index:t,outcome:u,params:n,signal:r,state:i,stepBase:o,stepRun:s},l),d={findings:[...e.findings,...u.result.findings,...c],ran:[...e.ran,u.label]};return u.result.findings.length>0||c.length>0||n.stopAfterStep!=null&&o+l.length>=n.stopAfterStep?d:gu({acc:d,index:t+1,params:n,signal:r,state:u.next,stepBase:o+l.length})}async function AA(e,t){let{index:n,outcome:r,params:i,stepBase:o,stepRun:s}=e,a=t.length>0;!a&&r.result.findings.length>0&&em(i,s,e.state,o,r.result.findings);let l=i.sequence[n+1],u=a?await Qh({current:s,driver:i.driver,index:n,next:l,state:r.next}):[];return r.result.findings.forEach(c=>{i.onEvent({finding:c,kind:"finding"})}),u.length>0&&l!=null&&em(i,l,r.next,o+t.length,u),u}function em(e,t,n,r,i){let o=Date.now(),s=$e(n.snapshot.scalars,{kind:"path"});e.onEvent({annotations:[],endMs:o,findings:i,index:r,kind:"step",source:t.transition.steps[0]??t.transition.effectStep,startMs:o,state:yu(n.snapshot,n.snapshot),url:typeof s=="string"?s:null})}var fi={value:e=>CA(e)};function Jo(e,t){return{value:n=>e.value({...n,seed:`${t}:${n.seed}`})}}function Xo(e,t){return{value:n=>e.value({...n,anchor:t})}}function CA({anchor:e,constraints:t,generator:n,nullable:r,seed:i,type:o,values:s,valueSpace:a}){let l=Su(`${a}:${i}`);return r&&l%4===0?null:s!=null&&s.length>0?s[l%s.length]??s[0]??null:n==="date.iso"?PA({anchor:e,constraints:t,n:l,timeHash:Su(`${a}:${i}#tod`)}):o==="number"?IA(l,t):o==="boolean"?l%2===0:$A(n,l)}var qo=864e5;function PA({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/qo)*qo;return new Date(a+s*qo+r%qo).toISOString()}function Su(e,t=0,n=7){return t>=e.length?n>>>0:Su(e,t+1,n*31+(e.codePointAt(t)??0)>>>0)}function IA(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 MA=["ada","bruno","carmen","dario","elena","felix","greta","hugo","iris","jonas","kira","lena","mateo","nadia","oscar","petra","quinn","rosa","stefan","tara","ugo","vera","wim","yara"],TA=["abreu","berg","costa","duval","eriksen","fischer","garza","holm","ito","jansen","kovac","laurent","moreau","novak","okafor","petrov","quist","rossi","sato","tanaka","ueda","vargas","weber","zhang"],OA=["amber","brisk","calm","deep","early","fond","glad","hazel","ivory","jade","keen","lush","mauve","noble","opal","plum","quiet","rapid","sage","teal","umber","vivid","warm","zesty"],NA=["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 Yo(e,t){let n=e[t%e.length];if(n==null)throw new Error("empty word list");return n}function Zo(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function $A(e,t){let n=Yo(MA,t),r=Yo(TA,Math.floor(t/31)),i=Yo(OA,t),o=Yo(NA,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"?`${Zo(n)} ${Zo(r)}`:e==="company.name"?`${Zo(i)} ${Zo(o)}`:e==="lorem.slug"?`${i}-${o}`:`${o}-${String(t%1e3)}`}function nm(e){return Le(e).flatMap(t=>LA(t.test))}function LA(e){let t=new Map(e.world.map(r=>[r.as,r])),n=_A(e.steps);return e.steps.flatMap((r,i)=>r.expect.filter(o=>jA(o)).flatMap(o=>DA({createdAliases:n,predicate:o,setByAlias:t,stepIndex:i,test:e})))}function DA(e){let{createdAliases:t,predicate:n,setByAlias:r,stepIndex:i,test:o}=e,s=FA(n);if(s==null||t.has(s))return[];let a=r.get(s);return a==null?[]:Object.keys(n.assertion.props).filter(l=>!(l in a.set)).map(l=>({entity:n.entity,field:l,stepIndex:i,test:`${o.workflow}/${o.slug}`}))}function FA(e){return Object.values(e.key).flatMap(t=>X(t)?[t.ref.split(".")[0]]:[]).find(t=>t!=null)}function _A(e){return new Set(e.flatMap(t=>t.expect.flatMap(n=>n.kind==="state"&&n.assertion.kind==="created"?[n.assertion.as]:[])))}function jA(e){return e.kind==="state"&&e.assertion.kind==="updated"}function rm(e){return Le(e).flatMap(({test:t})=>BA(t.steps,We(t)))}function BA(e,t){return e.reduce((n,r)=>{let i=VA(r.action),o=i!=null&&!UA(i,n.pre)?[{action:r.action,ephemeralOnly:n.ephemeralKeys.has(C(i)),target:i,test:t}]:[];return{ephemeralKeys:new Set([...n.ephemeralKeys,...WA(r)]),pre:cn(n.pre,[r]),violations:[...n.violations,...o]}},{ephemeralKeys:new Set,pre:In,violations:[]}).violations}function VA(e){if(!(e.kind==="goto"||e.kind==="upload"))return"locator"in e&&e.locator!=null?e.locator:void 0}function UA(e,t){let n=C(e),r=[...t.values()].filter(o=>o.subject.kind==="element"&&C(o.subject.locator)===n);if(r.length===0)return!1;let i=o=>r.some(s=>s.subject.kind==="element"&&s.subject.state===o&&s.expect.expect==="is"&&s.expect.value===!1);return!i("visible")&&!i("enabled")}function WA(e){return Ro(e.expect).filter(t=>jt(t)).flatMap(t=>im(t)).map(t=>C(t))}function im(e){return e.kind==="not"?im(e.predicate):"locator"in e?[e.locator]:[]}function om(e){return Le(e).flatMap(({test:t})=>zA(t.steps,We(t)))}function zA(e,t){return e.reduce((n,r,i)=>{let o=qA(r),s=GA({acc:n,assertions:o,stepIndex:i,test:t}),a=cn(n.pattern,[r]);return{assertedKeys:KA({acc:n,assertions:o,pattern:a,step:r}),pattern:a,redundant:[...n.redundant,...s]}},{assertedKeys:new Set,pattern:In,redundant:[]}).redundant}function GA({acc:e,assertions:t,stepIndex:n,test:r}){return t.reduce((i,{entry:o,predicate:s})=>{let a=K(o.subject),l=C(o.expect),u=e.pattern.get(a),c=u!=null&&e.assertedKeys.has(a)&&C(u.expect)===l,d=i.seen.get(a)===l;return{flagged:c||d?[...i.flagged,{predicate:s,stepIndex:n,test:r}]:i.flagged,seen:new Map([...i.seen,[a,l]])}},{flagged:[],seen:new Map}).flagged}function KA({acc:e,assertions:t,pattern:n,step:r}){let i=new Set([...HA(r),...ei(r)].map(a=>K(a.subject))),o=[...e.assertedKeys].filter(a=>n.has(a)&&!i.has(a)),s=t.map(({entry:a})=>K(a.subject)).filter(a=>n.has(a));return new Set([...o,...s])}function HA(e){return e.action.kind==="goto"?Qr(e.action.url):[]}function qA(e){return un(e.expect).flatMap(t=>{let n=ht(t);return n==null?[]:[{entry:n,predicate:t}]})}var Q=Xa(lm(),1),De={actual:e=>Q.default.red(e),bad:e=>Q.default.red(Q.default.bold(e)),bold:e=>Q.default.bold(e),dim:e=>Q.default.dim(e),expected:e=>Q.default.green(e),good:e=>Q.default.green(Q.default.bold(e)),heading:e=>Q.default.bold(Q.default.cyan(e)),path:e=>Q.default.cyan(Q.default.underline(e)),warn:e=>Q.default.yellow(Q.default.bold(e))},XA={assertion:Q.default.yellow,consistency:Q.default.magenta,"data rule":Q.default.yellow,driver:Q.default.red,fact:Q.default.yellow,"impossible action":Q.default.cyan,precondition:Q.default.yellow,reachability:Q.default.yellow,redundancy:Q.default.yellow,skipped:Q.default.red};function Fe(e){return`${Q.default.red(Q.default.bold("\u2717"))} ${XA[e](Q.default.bold(e))}`}var QA=Q.default.red("\u2717"),IU=Q.default.green("\u2713"),eC=Q.default.dim("\u203A"),tC=8;function um(e,t,n){let r=n==null?"":` ${De.dim(n)}`;return` ${De.dim(e.padStart(tC))} ${t}${r}`}function fn(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${fn(e.scope)} \u25B8 ${fn(e.target)}`:e.name==null?e.role:`${e.role} "${e.name}"`}function Wt(e){return e.kind==="variable"?`global variable "${e.name}"`:e.kind==="element"?`${e.state} ${fn(e.locator)}`:e.kind==="query"?`url query "${e.key}"`:e.kind==="title"||e.kind==="viewport"?e.kind:`url ${e.kind}`}function ns(e){return e.url!=null?`${e.kind} ${e.url}`:e.locator!=null?`${e.kind} ${fn(e.locator)}`:e.kind}function zt(e){if(e.kind==="not")return`not ${zt(e.inner)}`;if(e.kind==="browser"){let t=Jn(e.key);return e.value===null?`${t} absent`:`${t}="${e.value}"`}return e.kind==="value"||e.kind==="text"?`${e.kind} ${fn(e.locator)}="${e.value}"`:`${e.kind} ${fn(e.locator)}`}function Ln(e){let{field:t,source:n,target:r,targetField:i}=e.reference;return`${n}.${t} \u2192 ${r}.${i}`}function Gt(e){return`${e.intent} \u203A ${ns(e.action)}`}function xu(e){return e.kind==="data-rule"?`data rule ${Ln(e.dataRule)}`:`${e.kind} ${zt(e.check)}`}function we(e){return e==null?"\u2205":JSON.stringify(e)}function vu(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=${we(e.snapshot)} actual=${we(e.sut)}`:e.kind==="expected-change"?`${e.entity}.${e.field} [${e.key}] expected to change but stayed ${we(e.value)}`:`${Wt(e.subject)} expected=${Ru(e.want)} actual=${we(e.sut)}`}function rs(e){return{label:xu(e.source),step:Gt(e.step)}}function is(e){return e.expect==="absent"?"absent":e.expect==="not"?`not ${we(e.value)}`:we(e.value)}function Ru(e){return e.expect==="absent"?"absent":e.expect==="not"?`anything but ${we(e.value)}`:we(e.value)}function nC(e){return e==null?"{ \u2026 }":`{ ${Object.entries(e).map(([n,r])=>`${n}: ${JSON.stringify(r)}`).join(", ")} }`}function os({evidencePath:e,finding:t}){let n=rC(t);return e==null?n:`${n} Evidence: ${De.path(e)}`}function ku(e){return oC(sC(e))}function rC(e){return e.kind==="consistency"?yC(e):e.kind==="pending-check"?SC(e.source,e.step,e.budget):e.kind==="impossible-action"?`${Fe("impossible action")} The step "${e.step.intent}" ran ${ns(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"?`${Fe("skipped")} The planned step "${e.intent}" could not run \u2014 ${dm(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.`:e.kind==="lift-visibility"?`${Fe("reachability")} ${Ot(e.locator)} is already visible at step ${String(e.visibleIndex+1)} but the test doesn't declare it until step ${String(e.declaredIndex+1)}. Lift the visible(...) assertion up to the earlier step so the model learns it's reachable as soon as it is \u2014 a late declaration makes its reachability fact too narrow for the explorer.`:`${Fe("driver")} The browser failed while running "${e.step.intent}" \u2014 ${Pt(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 iC=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function oC(e){return e.replaceAll(iC,"").replaceAll(/\s+/g," ").trim()}function sC(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${vu(e.mismatch)}${t}`}return e.kind==="pending-check"?`${xC(e.source)} failed at "${e.step.intent}": ${vC(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 ${dm(e.reason)}`:e.kind==="lift-visibility"?`visible(${Ot(e.locator)}) declared at step ${String(e.declaredIndex+1)} but already visible at step ${String(e.visibleIndex+1)}`:`driver failed at "${e.step.intent}": ${Pt(e.error)}`}var aC={"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 dm(e){return aC[e]}function fm({debugDir:e,runId:t}){let n=`${e}/${t}`;return um("behavior",De.path(`${n}/behavior.jsonl`),void 0)}function pi(e){return"locator"in e&&e.locator!=null?`${e.kind} ${Ot(e.locator)}`:"url"in e?`${e.kind} ${lC(e.url)}`:e.kind}function lC(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:hm(e)}function pn(e){return e.kind==="not"?`not ${pn(e.predicate)}`:e.kind==="and"?e.predicates.map(t=>pn(t)).join(" \u2227 "):e.kind==="when"?e.branches.map(t=>t.name).join(" | "):uC(e)}function Ot(e){return e.by==="role"?e.name==null?e.role:`${e.role} ${$n(e.name)}`:e.by==="inside"?`${Ot(e.scope)} \u25B8 ${Ot(e.target)}`:$n(e.value)}function pm(e){let t=[...e.scalars.values()].find(n=>n.subject.kind==="path"&&n.expect.expect==="is")?.expect;return t==null||t.expect==="absent"?"(any view)":cC(t.value)}function ss(e){let t=[...e.entities.map(n=>cm(n)),...e.absences.map(n=>`no ${cm(n)}`),...[...e.scalars.values()].filter(n=>n.subject.kind!=="path").map(n=>Eu(n))];return t.length===0?"always":t.join(" \u2227 ")}function Eu(e){let t=dC(e.subject);return e.expect.expect==="absent"?`${t} absent`:e.subject.kind==="element"&&fC(e.expect.value)?e.expect.value?t:`not ${t}`:`${t} ${e.expect.expect==="not"?"\u2260":"="} ${$n(e.expect.value)}`}function uC(e){if("locator"in e){let t=Ot(e.locator);return e.kind==="value"||e.kind==="text"?`${e.kind} ${t}=${$n(e.value)}`:`${e.kind} ${t}`}return e.kind==="browser"?`${e.name}=${$n(e.value)}`:e.kind==="singleton"?`${e.singleton}=${$n(e.assertion.value)}`:e.kind==="count"?`${e.entity} count ${String(e.value)}`:""}function $n(e){return e===null?"\u2205":typeof e=="string"?`"${e}"`:typeof e!="object"?String(e):"ref"in e?`{${e.ref}}`:hm(e)}function hm(e){return e.template.map(t=>typeof t=="string"?t:":id").join("")}function cC(e){return typeof e!="object"||e==null?String(e):"template"in e?e.template.map(t=>typeof t=="string"?t:`{${t.ref}}`).join(""):`{${e.ref}}`}function dC(e){return e.kind==="variable"?e.name:e.kind==="element"?`${e.state} ${Ot(e.locator)}`:e.kind==="query"?`url query "${e.key}"`:e.kind==="title"||e.kind==="viewport"?e.kind:`url ${e.kind}`}function fC(e){return typeof e=="boolean"}function cm(e){let t=Object.entries(e.literals).map(([n,r])=>`${n}=${$n(r)}`);return t.length===0?e.entity:`${e.entity}(${t.join(", ")})`}function ts(e){return e==null?"At the end of the run":`After ${hC(e.action)} in ${e.intent}`}var pC={click:"clicking",fill:"filling",goto:"opening",hover:"hovering over",press:"pressing",select:"selecting",upload:"uploading to"};function hC(e){return e.url!=null?`opening ${e.url}`:e.locator!=null?`${pC[e.kind]??e.kind} ${ur(e.locator)}`:e.kind}function ur(e){return e.by==="testId"?`the element with testId "${e.value}"`:e.by==="inside"?`${ur(e.target)} inside ${ur(e.scope)}`:e.name==null?`the ${e.role}`:`the "${e.name}" ${e.role}`}function mC(e){return e.kind==="not"&&e.inner.kind==="visible"?`${ur(e.inner.locator)} never disappeared`:e.kind==="visible"?`${ur(e.locator)} never appeared`:e.kind==="value"||e.kind==="text"?`${ur(e.locator)} never showed "${e.value}"`:`the check ${zt(e)} never held`}function yC(e){let t=e.pending?gC(e):bC(e.mismatch,e.step);return`${Fe("consistency")} ${t}`}function gC(e){let t=`${mm(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=ts(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 ${De.actual(we(r.sut))} instead of ${De.expected(we(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 ${De.actual(we(r.value))} through the ${t}, so the write may not have landed at all. ${n}`:`${i}, ${Wt(r.subject)} never changed within the ${t} \u2014 it still showed ${De.actual(we(r.sut))} instead of ${De.expected(Ru(r.want))}, so the change may not have landed. ${n}`}function mm(e){return`${String(Mt[e]/1e3)}s`}function bC(e,t){let n=ts(t);return e.kind==="wrong-value"?`${n}, ${e.entity}.${e.field} on row "${e.key}" showed ${De.actual(we(e.sut))} but the test expected ${De.expected(we(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==="scalar-mismatch"?`${n}, ${Wt(e.subject)} showed ${De.actual(we(e.sut))} but the test expected ${De.expected(Ru(e.want))}. 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 if the app creating this row is expected behavior, declare it on the acting step with ${e.entity}.created(${nC(e.row)}), 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 ${De.actual(we(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 SC(e,t,n){let r=`${mm(n)} wait window`;if(e.kind==="data-rule")return`${Fe("data rule")} ${ts(t)}, the data rule ${Ln(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.`;if(e.kind==="fact")return`${Fe("fact")} A fact learned from ${wC(e.origin)} says ${zt(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.`;let i=`${Fe("assertion")} ${ts(t)}, ${mC(e.check)} within the ${r}.`;return t.action.locator!=null?`${i} If the page never changed after this action \u2014 the recording goes quiet right after it \u2014 the interaction was likely lost: its target re-rendered or unmounted as it fired, so the click landed on nothing. That is an unstable-render bug in the app, not a missing element. Otherwise it is a wrong accessible name, a UI regression, or a starting state this page doesn't have. Confirm in behavior.jsonl before changing the test.`:`${i} 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 wC(e){return e==null?"another workflow":e.kind==="test"?`an assertion in test "${e.test}"`:`tests ${e.tests.map(n=>JSON.stringify(n)).join(", ")}`}function xC(e){return e.kind==="data-rule"?"data rule":e.kind==="fact"?"fact":"assertion"}function vC(e){return e.kind==="data-rule"?Ln(e.dataRule):zt(e.check)}function ym(e){switch(e.kind){case"cascade-gap":{let{gap:t}=e;return`${Fe("data rule")} ${t.transition} deletes ${t.target} but leaves ${t.source} rows pointing at the deleted row. That breaks the data rule ${Ln(t.dataRule)} \u2014 cascade the delete in the app or declare the cleanup on the deleting step.`}case"create-gap":return RC(e.gap);case"unreachable-interaction":{let{violation:t}=e;return t.ephemeralOnly?`${Fe("reachability")} ${t.test}: ${pi(t.action)}, but ${Ot(t.target)} was only declared inside ephemeral(...). Ephemeral checks are transient and grant no reachability \u2014 assert a durable visible(...) on it before interacting.`:`${Fe("reachability")} ${t.test}: ${pi(t.action)}, but no prior step declared ${Ot(t.target)} reachable. Assert visible(...) (or any state) on it first \u2014 an element isn't interactable until its presence is declared.`}case"redundant-assertion":{let{redundancy:t}=e;return`${Fe("redundancy")} ${t.test}: step ${String(t.stepIndex+1)} restates "${pn(t.predicate)}" \u2014 a prior step already asserted it and nothing changed it since. Delete the restatement, an assertion must state new information.`}case"missing-precondition":{let{missing:t}=e;return`${Fe("precondition")} ${t.test}: step ${String(t.stepIndex+1)} updates ${t.entity}.${t.field} but the world never states what it was before. Seed it explicitly \u2014 a value, arbitrary(...), or null \u2014 so the flow only runs where its starting state actually holds.`}case"fact-conflict":{let{conflict:t}=e;return`${Fe("fact")} Two facts contradict each other \u2014 "${pn(t.a)}" vs "${pn(t.b)}" when ${ss(t.when)}. 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 RC(e){let t=e.missing.length===1?"field":"fields",n=e.missing.length===1?"it":"them";return`${Fe("data rule")} ${e.transition} creates ${e.entity} without setting the required ${t} ${e.missing.join(", ")}. Set ${n} on the creating step or drop the requirement from the entity.`}function gm(e){let t;return n=>{if(t!==void 0&&t.input===n)return t.output;let r=e(n);return t={input:n,output:r},r}}var cr=gm(e=>({dataRules:No(e),facts:si(e)}));var bm=Object.defineProperty,Sm=(e,t)=>{let n={};for(var r in e)bm(n,r,{get:e[r],enumerable:!0});return t||bm(n,Symbol.toStringTag,{value:"Module"}),n};var kC=class wm{constructor(t){this.seed=t}clone(){return new wm(this.seed)}next(){let t=Au(this.seed),n=Cu(t),r=Au(t),i=Cu(r);return this.seed=Au(r),Cu(this.seed)+(i+(n<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function Au(e){return Math.imul(e,214013)+2531011&4294967295}function Cu(e){return(e&-2147483649)>>16}function xm(e){return new kC(e)}var EC="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",AC=class Rm{constructor(t,n){this.states=t,this.index=n}clone(){return new Rm(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=as(this.states,this.index),t}getState(){return[this.index,...this.states]}jump(){let t=this.states.slice(),n=this.index;this.index=as(this.states,this.index);for(let r=19932;r>0;--r)EC.charCodeAt(r/6|0)-48&1<<r%6&&vm(this.states,this.index,t,n),this.index=as(this.states,this.index);vm(this.states,this.index,t,n)}};function vm(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 as(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 CC(e){for(let t=0;t!==624;++t)as(e,t)}function km(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 CC(t),new AC(t,0)}var PC=class Em{constructor(t,n,r,i){this.s01=t,this.s00=n,this.s11=r,this.s10=i}clone(){return new Em(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 Pu(e){return new PC(-1,~e,e|0,0)}var IC=class Am{constructor(t,n,r,i){this.s01=t,this.s00=n,this.s11=r,this.s10=i}clone(){return new Am(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 Cm(e){return new IC(-1,~e,e|0,0)}function Pm(e,t){for(let n=0;n!==t;++n)e.next()}var Im=BigInt,MC=4294967296n;function Tm(e,t,n){let r=n-t+1n,i=MC,o=1;for(;i<r;)i<<=32n,++o;let s=Mm(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=Mm(o,e);return s%r+t}function Mm(e,t){let n=Im(t.next()+2147483648);for(let r=1;r<e;++r){let i=t.next();n=(n<<32n)+Im(i+2147483648)}return n}function hi(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 Iu(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 TC(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 h=r+s,y=i+a+(h>4294967295?1:0);return e.data[0]=y>>>0,e.data[1]=h>>>0,e}let u=r,c=i,d=s,p=a;o===-1&&(u=s,c=a,d=r,p=i);let m=0,f=u-d;return f<0&&(m=1,f=f>>>0),e.data[0]=c-p-m,e.data[1]=f,e}function OC(e,t,n){let r=n[0]+1;for(t[0]=hi(e,r),t[1]=hi(e,4294967296);t[0]>=n[0]&&(t[0]!==n[0]||t[1]>=n[1]);)t[0]=hi(e,r),t[1]=hi(e,4294967296);return t}var NC=Number.MAX_SAFE_INTEGER,$C={sign:1,data:[0,0]},LC={sign:1,data:[0,0]},Om={sign:1,data:[0,0]},Mu=[0,0];function DC(e,t,n,r){let i=r<=NC?Iu(Om,r):TC(Om,Iu($C,n),Iu(LC,t));return i.data[1]===4294967295?(i.data[0]+=1,i.data[1]=0):i.data[1]+=1,OC(e,Mu,i.data),Mu[0]*4294967296+Mu[1]+t}function ls(e,t,n){let r=n-t;return r<=4294967295?hi(e,r+1)+t:DC(e,t,n,r)}var Nm=Symbol.for("fast-check/PreconditionFailure"),wn=class extends Error{constructor(e=!1){super(),this.interruptExecution=e,this.footprint=Nm}static isFailure(e){return e!=null&&e.footprint===Nm}};function FC(e){if(!e)throw new wn}var _C=class{[Symbol.iterator](){return this}next(e){return{value:e,done:!0}}},jC=new _C;function BC(){return jC}function*VC(e,t){for(let n of e)yield t(n)}function*UC(e,t){for(let n of e)yield*t(n)}function*WC(e,t){for(let n of e)t(n)&&(yield n)}function*zC(e,t){for(let n=0;n<t;++n){let r=e.next();if(r.done)break;yield r.value}}function*GC(e,t){let n=e.next();for(;!n.done&&t(n.value);)yield n.value,n=e.next()}function*KC(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 HC=Symbol.iterator,_=class Kt{static nil(){return new Kt(BC())}static of(...t){return new Kt(t[HC]())}constructor(t){this.g=t}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(t){return new Kt(VC(this.g,t))}flatMap(t){return new Kt(UC(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 Kt(GC(this.g,t))}take(t){return new Kt(zC(this.g,t))}filter(t){return new Kt(WC(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 Kt(KC(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 bn(e){return new _(e)}var Te=Symbol.for("fast-check/cloneMethod");function Fn(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Te in e&&typeof e[Te]=="function"}function mr(e){return Fn(e)?e[Te]():e}var qC=Object.defineProperty,O=class{constructor(e,t,n){this.value_=e,this.context=t,this.hasToBeCloned=n!==void 0||Fn(e),this.readOnce=!1,this.value=e,this.hasToBeCloned&&qC(this,"value",{get:n!==void 0?n:this.getValue,enumerable:!1,configurable:!1})}getValue(){return this.hasToBeCloned?this.readOnce?this.value_[Te]():(this.readOnce=!0,this.value_):this.value_}},de=class{filter(e){return new JC(this,e)}map(e,t){return new ZC(this,e,t)}chain(e){return new YC(this,e)}},YC=class extends de{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?_.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)})):_.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}},ZC=class extends de{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 _.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)&&!Fn(n)&&Object.defineProperty(n,Te,{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}},JC=class extends de{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 Ng(e){return typeof e=="object"&&e!==null&&"generate"in e&&"shrink"in e&&"canShrinkWithoutContext"in e}function $g(e){if(!Ng(e))throw new Error("Unexpected value received: not an instance of Arbitrary")}var Lg=Function.prototype.apply,Tu=Symbol("apply");function XC(e){try{return e.apply}catch{return}}function QC(e,t,n){let r=e;r[Tu]=Lg;let i=r[Tu](t,n);return delete r[Tu],i}function H(e,t,n){return XC(e)===Lg?e.apply(t,n):QC(e,t,n)}var Dg=Array,P=BigInt,eP=BigInt64Array,tP=BigUint64Array,Fg=Boolean,Rs=Date,I=Error,_g=Float32Array,jg=Float64Array,nP=Int8Array,rP=Int16Array,iP=Int32Array,qt=Number,ze=String,yr=Set,oP=Uint8Array,sP=Uint8ClampedArray,aP=Uint16Array,lP=Uint32Array,uP=encodeURIComponent,Yt=Map,ys=Symbol,$m=Array.prototype.forEach,Lm=Array.prototype.indexOf,Dm=Array.prototype.join,Fm=Array.prototype.map,_m=Array.prototype.flat,jm=Array.prototype.filter,Bm=Array.prototype.push,Vm=Array.prototype.pop,Um=Array.prototype.splice,Wm=Array.prototype.slice,zm=Array.prototype.sort,Gm=Array.prototype.every;function cP(e){try{return e.forEach}catch{return}}function dP(e){try{return e.indexOf}catch{return}}function fP(e){try{return e.join}catch{return}}function pP(e){try{return e.map}catch{return}}function hP(e){try{return e.flat}catch{return}}function mP(e){try{return e.filter}catch{return}}function yP(e){try{return e.push}catch{return}}function gP(e){try{return e.pop}catch{return}}function bP(e){try{return e.splice}catch{return}}function SP(e){try{return e.slice}catch{return}}function wP(e){try{return e.sort}catch{return}}function xP(e){try{return e.every}catch{return}}function Bg(e,t){return cP(e)===$m?e.forEach(t):H($m,e,[t])}function Ht(e,...t){return dP(e)===Lm?e.indexOf(...t):H(Lm,e,t)}function ce(e,...t){return fP(e)===Dm?e.join(...t):H(Dm,e,t)}function U(e,t){return pP(e)===Fm?e.map(t):H(Fm,e,[t])}function vP(e,t){return hP(e)===_m?([].flat(),e.flat(t)):H(_m,e,[t])}function RP(e,t){return mP(e)===jm?e.filter(t):H(jm,e,[t])}function T(e,...t){return yP(e)===Bm?e.push(...t):H(Bm,e,t)}function Vg(e){return gP(e)===Vm?e.pop():H(Vm,e,[])}function Ug(e,...t){return bP(e)===Um?e.splice(...t):H(Um,e,t)}function Ne(e,...t){return SP(e)===Wm?e.slice(...t):H(Wm,e,t)}function Wg(e,...t){return wP(e)===zm?e.sort(...t):H(zm,e,t)}function zg(e,...t){return xP(e)===Gm?e.every(...t):H(Gm,e,t)}var Km=Date.prototype.getTime,Hm=Date.prototype.toISOString;function kP(e){try{return e.getTime}catch{return}}function EP(e){try{return e.toISOString}catch{return}}function ks(e){return kP(e)===Km?e.getTime():H(Km,e,[])}function AP(e){return EP(e)===Hm?e.toISOString():H(Hm,e,[])}var qm=Set.prototype.add,Ym=Set.prototype.has;function CP(e){try{return e.add}catch{return}}function PP(e){try{return e.has}catch{return}}function Si(e,t){return CP(e)===qm?e.add(t):H(qm,e,[t])}function Es(e,t){return PP(e)===Ym?e.has(t):H(Ym,e,[t])}var Zm=WeakMap.prototype.set,Jm=WeakMap.prototype.get;function IP(e){try{return e.set}catch{return}}function MP(e){try{return e.get}catch{return}}function TP(e,t,n){return IP(e)===Zm?e.set(t,n):H(Zm,e,[t,n])}function OP(e,t){return MP(e)===Jm?e.get(t):H(Jm,e,[t])}var Xm=Map.prototype.set,Qm=Map.prototype.get,ey=Map.prototype.has;function NP(e){try{return e.set}catch{return}}function $P(e){try{return e.get}catch{return}}function LP(e){try{return e.has}catch{return}}function yt(e,t,n){return NP(e)===Xm?e.set(t,n):H(Xm,e,[t,n])}function st(e,t){return $P(e)===Qm?e.get(t):H(Qm,e,[t])}function DP(e,t){return LP(e)===ey?e.has(t):H(ey,e,[t])}var ty=String.prototype.split,ny=String.prototype.startsWith,ry=String.prototype.endsWith,iy=String.prototype.substring,oy=String.prototype.toLowerCase,sy=String.prototype.toUpperCase,ay=String.prototype.padStart,ly=String.prototype.charCodeAt,uy=String.prototype.normalize,cy=String.prototype.replace;function FP(e){try{return e.split}catch{return}}function _P(e){try{return e.startsWith}catch{return}}function jP(e){try{return e.endsWith}catch{return}}function BP(e){try{return e.substring}catch{return}}function VP(e){try{return e.toLowerCase}catch{return}}function UP(e){try{return e.toUpperCase}catch{return}}function WP(e){try{return e.padStart}catch{return}}function zP(e){try{return e.charCodeAt}catch{return}}function GP(e){try{return e.normalize}catch{return}}function KP(e){try{return e.replace}catch{return}}function Ge(e,...t){return FP(e)===ty?e.split(...t):H(ty,e,t)}function HP(e,...t){return _P(e)===ny?e.startsWith(...t):H(ny,e,t)}function qP(e,...t){return jP(e)===ry?e.endsWith(...t):H(ry,e,t)}function ge(e,...t){return BP(e)===iy?e.substring(...t):H(iy,e,t)}function nc(e){return VP(e)===oy?e.toLowerCase():H(oy,e,[])}function Pc(e){return UP(e)===sy?e.toUpperCase():H(sy,e,[])}function YP(e,...t){return WP(e)===ay?e.padStart(...t):H(ay,e,t)}function gr(e,t){return zP(e)===ly?e.charCodeAt(t):H(ly,e,[t])}function ZP(e,t){return GP(e)===uy?e.normalize(t):H(uy,e,[t])}function JP(e,t,n){return KP(e)===cy?e.replace(t,n):H(cy,e,[t,n])}var dy=Number.prototype.toString;function XP(e){try{return e.toString}catch{return}}function wi(e,...t){return XP(e)===dy?e.toString(...t):H(dy,e,t)}var QP=Object.prototype.hasOwnProperty,eI=Object.prototype.toString;function Gg(e,t){return H(QP,e,[t])}function rc(e){return H(eI,e,[])}var tI=Error.prototype.toString;function nI(e){return H(tI,e,[])}var rI=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 gn(e){return new rI(e)}var Kg=Array.isArray,iI=Object.defineProperty;function Hg(e,t){return iI(e,Te,{value:()=>{let n=[];for(let r=0;r!==t.length;++r)T(n,t[r].value);return Hg(n,t),n}})}function qg(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&&Hg(n,e),new O(n,r)}function Yg(e,t,n){let r=[],i=Kg(n)?n:[];for(let o=0;o!==e.length;++o)T(r,gn(()=>e[o].shrink(t[o],i[o]).map(s=>{let a=U(t,(l,u)=>new O(mr(l),i[u]));return[...Ne(a,0,o),s,...Ne(a,o+1)]}).map(qg)));return _.nil().join(...r)}var oI=class extends de{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 qg(n)}canShrinkWithoutContext(e){if(!Kg(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 Yg(this.arbs,e,t)}};function j(...e){return new oI(e)}var sI=Math.log;function Zg(e){return 2+~~(sI(e+1)*.4342944819032518)}var Ic={};function aI(e){Ic=e}function gt(){return Ic}function lI(){Ic={}}var xi=Symbol("UndefinedContextPlaceholder");function br(e){return e.context!==void 0?e:e.hasToBeCloned?new O(e.value_,xi,()=>e.value):new O(e.value_,xi)}var fy=()=>{},uI=class{constructor(e,t){this.arb=e,this.predicate=t;let{asyncBeforeEach:n,asyncAfterEach:r,beforeEach:i,afterEach:o}=gt()||{};if(n!==void 0&&i!==void 0)throw I(`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 I(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=n||i||fy,this.afterEachHook=r||o||fy}isAsync(){return!0}generate(e,t){return br(this.arb.generate(e,t!==void 0?Zg(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return _.nil();let t=e.context!==xi?e.context:void 0;return this.arb.shrink(e.value_,t).map(br)}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 I("Property failed by returning false")}}catch(t){return wn.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}},Jg=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return br(this.arb.generate(e,t))}canShrinkWithoutContext(e){return!0}shrink(e,t){if(t===void 0&&!this.arb.canShrinkWithoutContext(e))return _.nil();let n=t!==xi?t:void 0;return this.arb.shrink(e,n).map(br)}};function cI(...e){if(e.length<2)throw new Error("asyncProperty expects at least two parameters");let t=Ne(e,0,e.length-1),n=e[e.length-1];return Bg(t,$g),new uI(j(...U(t,r=>new Jg(r))),r=>n(...r))}var py=()=>{},Xg=class{constructor(e,t){this.arb=e,this.predicate=t;let{beforeEach:n=py,afterEach:r=py,asyncBeforeEach:i,asyncAfterEach:o}=gt()||{};if(i!==void 0)throw I(`"asyncBeforeEach" can't be set when running synchronous properties`);if(o!==void 0)throw I(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=n,this.afterEachHook=r}isAsync(){return!1}generate(e,t){return br(this.arb.generate(e,t!==void 0?Zg(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return _.nil();let t=e.context!==xi?e.context:void 0;return this.arb.shrink(e.value_,t).map(br)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(e){try{let t=this.predicate(e);return t===void 0||t===!0?null:{error:new I("Property failed by returning false")}}catch(t){return wn.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 dI(...e){if(e.length<2)throw new Error("property expects at least two parameters");let t=Ne(e,0,e.length-1),n=e[e.length-1];return Bg(t,$g),new Xg(j(...U(t,r=>new Jg(r))),r=>n(...r))}var fI=(function(e){return e[e.None=0]="None",e[e.Verbose=1]="Verbose",e[e.VeryVerbose=2]="VeryVerbose",e})({});function ic(e){return"unsafeNext"in e?e.unsafeJump===void 0?{clone:()=>ic(e),next:()=>e.unsafeNext(),getState:()=>e.getState()}:{clone:()=>ic(e),next:()=>e.unsafeNext(),jump:()=>e.unsafeJump(),getState:()=>e.getState()}:e}function Qg(e){return"jump"in e&&typeof e.jump=="function"?e:{clone:()=>Qg(e),next:()=>e.next(),jump:()=>Pm(e,42),getState:()=>e.getState()}}function Is(e){return Qg(ic(e))}var pI=Date.now,hI=Math.min,mI=Math.random,yI=class{constructor(e){let t=e||{};this.seed=gI(t),this.randomType=bI(t),this.numRuns=SI(t),this.verbose=wI(t),this.maxSkipsPerRun=t.maxSkipsPerRun!==void 0?t.maxSkipsPerRun:100,this.timeout=Nu(t.timeout),this.skipAllAfterTimeLimit=Nu(t.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=Nu(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 Ou(e){return t=>Is(e(t))}function gI(e){if(e.seed===void 0)return pI()^mI()*4294967296;let t=e.seed|0;return e.seed===t?t:t^(e.seed-t)*4294967296}function bI(e){if(e.randomType===void 0)return Pu;if(typeof e.randomType=="string")switch(e.randomType){case"mersenne":return Ou(km);case"congruential":case"congruential32":return Ou(xm);case"xorshift128plus":return Pu;case"xoroshiro128plus":return Cm;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===Is(t)?e.randomType:Ou(e.randomType)}function SI(e){return e.numRuns!==void 0?e.numRuns:e.num_runs!==void 0?e.num_runs:100}function wI(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 Nu(e){if(e!==void 0)return hI(e,2147483647)}function Mc(e){return new yI(e)}function xI(e,t,n){let r=null;return{clear:()=>n(r),promise:new Promise(i=>{r=t(()=>{i(new wn(!0))},e)})}}var hy=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 wn(this.interruptExecution);return this.isAsync()?Promise.resolve(n):n}if(this.interruptExecution&&this.isAsync()){let n=xI(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()}},vI=(e,t,n)=>{let r=null;return{clear:()=>n(r),promise:new Promise(i=>{r=t(()=>{i({error:new I(`Property timeout: exceeded limit of ${e} milliseconds`)})},e)})}},RI=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=vI(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())}},eb=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()}},my=Array.from,yy=typeof Buffer<"u"?Buffer.isBuffer:void 0,dr=JSON.stringify,gy=Number.isNaN,kI=Object.keys,EI=Object.getOwnPropertySymbols,AI=Object.getOwnPropertyDescriptor,by=Object.getPrototypeOf,Sy=Number.NEGATIVE_INFINITY,CI=Number.POSITIVE_INFINITY,bt=Symbol.for("fast-check/toStringMethod");function Tc(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&bt in e&&typeof e[bt]=="function"}var Zt=Symbol.for("fast-check/asyncToStringMethod");function Oc(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Zt in e&&typeof e[Zt]=="function"}var PI=/^Symbol\((.*)\)$/;function II(e){if(e.description!==void 0)return e.description;let t=PI.exec(ze(e));return t&&t[1].length?t[1]:null}function wy(e){switch(e){case 0:return 1/e===Sy?"-0":"0";case Sy:return"Number.NEGATIVE_INFINITY";case CI:return"Number.POSITIVE_INFINITY";default:return e===e?ze(e):"Number.NaN"}}function MI(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 ot(e,t,n){let r=[...t,e];if(typeof e=="object"&&Ht(t,e)!==-1)return"[cyclic]";if(Oc(e)){let i=n(e);if(i.state==="fulfilled")return i.value}if(Tc(e))try{return e[bt]()}catch{}switch(rc(e)){case"[object Array]":{let i=e;if(i.length>=50&&MI(i)){let s=[];for(let a in i)gy(Number(a))||T(s,`${a}:${ot(i[a],r,n)}`);return s.length!==0?`Object.assign(Array(${i.length}),{${ce(s,",")}})`:`Array(${i.length})`}let o=ce(U(i,s=>ot(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 gy(ks(i))?"new Date(NaN)":`new Date(${dr(AP(i))})`}case"[object Map]":return`new Map(${ot(Array.from(e),r,n)})`;case"[object Null]":return"null";case"[object Number]":return typeof e=="number"?wy(e):`new Number(${wy(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"?`[${ot(o,r,n)}]`:dr(o)}:${ot(e[o],r,n)}`;return"{"+ce([...by(e)===null?["__proto__:null"]:[],...U(kI(e),i),...U(RP(EI(e),o=>{let s=AI(e,o);return s&&s.enumerable}),i)],",")+"}"}case"[object Set]":return`new Set(${ot(Array.from(e),r,n)})`;case"[object String]":return typeof e=="string"?dr(e):`new String(${dr(e)})`;case"[object Symbol]":{let i=e;if(ys.keyFor(i)!==void 0)return`Symbol.for(${dr(ys.keyFor(i))})`;let o=II(i);return o===null?"Symbol()":i===(o.startsWith("Symbol.")&&ys[o.substring(7)])?o:`Symbol(${dr(o)})`}case"[object Promise]":{let i=n(e);switch(i.state){case"fulfilled":return`Promise.resolve(${ot(i.value,r,n)})`;case"rejected":return`Promise.reject(${ot(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(${ot(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 yy=="function"&&yy(e))return`Buffer.from(${e.buffer.detached?"/*detached ArrayBuffer*/":ot(my(e.values()),r,n)})`;let i=by(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(${ot(my(s.values()),r,n)})`}break}}try{return e.toString()}catch{return rc(e)}}function ke(e){return ot(e,[],()=>({state:"unknown",value:void 0}))}function tb(e){let t=ys(),n=[],r=new Yt;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(),p=Zt in u?Promise.resolve().then(()=>u[Zt]()):u;return p.catch(()=>{}),n.push(Promise.race([p,d.delay]).then(m=>{m===t?r.set(c,{state:"pending",value:void 0}):r.set(c,{state:"fulfilled",value:m}),d.cancel()},m=>{r.set(c,{state:"rejected",value:m}),d.cancel()})),r.set(c,o),o};function a(){let l=ot(e,[],s);return n.length===0?l:Promise.all(n.splice(0)).then(a)}return a()}async function Nc(e){return Promise.resolve(tb(e))}function xy(e){return e===null?new wn:e}function TI(...e){return e[1]?e[0].then(xy):xy(e[0])}function OI(e,t){return TI(e,t)}var vy=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=ke(e);if(this.coveredCases.has(t)){let r=this.coveredCases.get(t);return this.skipRuns?OI(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()}},Ry=Date.now,$u=setTimeout,Lu=clearTimeout;function NI(e,t){let n=e;return e.isAsync()&&t.timeout!==void 0&&(n=new RI(n,t.timeout,$u,Lu)),t.unbiased&&(n=new eb(n)),t.skipAllAfterTimeLimit!==void 0&&(n=new hy(n,Ry,t.skipAllAfterTimeLimit,!1,$u,Lu)),t.interruptAfterTimeLimit!==void 0&&(n=new hy(n,Ry,t.interruptAfterTimeLimit,!0,$u,Lu)),t.skipEqualValues&&(n=new vy(n,!0)),t.ignoreEqualValues&&(n=new vy(n,!1)),n}var $I=(function(e){return e[e.Success=0]="Success",e[e.Skipped=-1]="Skipped",e[e.Failure=1]="Failure",e})({}),LI=class nb{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?+Ge(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?Ge(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:nb.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()}}},rb=class{constructor(e,t,n,r){this.sourceValues=e,this.shrink=t,this.runExecution=new LI(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"&&!wn.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_)}},DI=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}},FI=-2147483648,_I=2147483647,jI=Math.pow(2,27),BI=Math.pow(2,-53),$c=class ib{constructor(t){this.internalRng=Is(t.clone())}clone(){return new ib(this.internalRng)}next(t){return ls(this.internalRng,0,(1<<t)-1)}nextBoolean(){return ls(this.internalRng,0,1)===1}nextInt(t,n){return ls(this.internalRng,t===void 0?FI:t,n===void 0?_I:n)}nextBigInt(t,n){return Tm(this.internalRng,t,n)}nextDouble(){let t=this.next(26),n=this.next(27);return(t*jI+n)*BI}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState=="function")return this.internalRng.getState()}};function VI(e,t,n){return t.jump(),e.generate(new $c(t),n)}function*ob(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 VI(e,o,i)}function UI(e,t,n){return()=>e.generate(new $c(t),n)}function*sb(e,t,n,r){yield*U(r,s=>()=>new O(s,void 0));let i=0,o=Is(n(t));for(;;)o.jump(),yield UI(e,o,i++)}function ky(e){return e()}function ab(e,t,n){let r=t,i=e.split(":").map(s=>+s);if(i.length===0)return r.map(ky);if(!i.every(s=>!Number.isNaN(s)))throw new Error(`Unable to replay, got invalid path=${e}`);let o=r.drop(i[0]).map(ky);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 WI=Object.assign;function zI(e){return e.length===1?`Hint: ${e[0]}`:e.map((t,n)=>`Hint (${n+1}): ${t}`).join(`
|
|
21
|
-
`)}function
|
|
20
|
+
${x}`),h.pop(),`{${$}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(f);default:return t?t(f):void 0}}function d(m,f,h){switch(typeof f){case"string":return on(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(m),typeof f!="object")return d(m,f,h);if(f===null)return"null"}if(h.indexOf(f)!==-1)return n;let y="",S=f.length!==void 0;if(S&&Array.isArray(f)){if(f.length===0)return"[]";if(s<h.length+1)return'"[Array]"';h.push(f);let $=Math.min(f.length,a),L=0;for(;L<$-1;L++){let M=d(String(L),f[L],h);y+=M!==void 0?M:"null",y+=","}let D=d(String(L),f[L],h);if(y+=D!==void 0?D:"null",f.length-1>a){let M=f.length-a-1;y+=`,"... ${An(M)} not stringified"`}return h.pop(),`[${y}]`}let x=Object.keys(f),b=x.length;if(b===0)return"{}";if(s<h.length+1)return'"[Object]"';let v="",N=Math.min(b,a);S&&Sl(f)&&(y+=pp(f,",",a),x=x.slice(f.length),N-=f.length,v=","),i&&(x=bl(x,o)),h.push(f);for(let $=0;$<N;$++){let L=x[$],D=d(L,f[L],h);D!==void 0&&(y+=`${v}${on(L)}:${D}`,v=",")}if(b>a){let $=b-a;y+=`${v}"...":"${An($)} not stringified"`}return h.pop(),`{${y}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(f);default:return t?t(f):void 0}}function p(m,f,h){if(arguments.length>1){let y="";if(typeof h=="number"?y=" ".repeat(Math.min(h,10)):typeof h=="string"&&(y=h.slice(0,10)),f!=null){if(typeof f=="function")return l("",{"":m},[],f,y,"");if(Array.isArray(f))return u("",m,[],wv(f),y,"")}if(y.length!==0)return c("",m,[],y,"")}return d("",m,[])}return p}});var lm=Qf((CU,wu)=>{"use strict";var es=process||{},sm=es.argv||[],Qo=es.env||{},qA=!(Qo.NO_COLOR||sm.includes("--no-color"))&&(!!Qo.FORCE_COLOR||sm.includes("--color")||es.platform==="win32"||(es.stdout||{}).isTTY&&Qo.TERM!=="dumb"||!!Qo.CI),YA=(e,t,n=e)=>r=>{let i=""+r,o=i.indexOf(t,e.length);return~o?e+ZA(i,t,n,o)+t:e+i+t},ZA=(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)},am=(e=qA)=>{let t=e?YA:()=>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")}};wu.exports=am();wu.exports.createColors=am});import{z as A}from"zod";var Qa=A.enum(["fast","slow","async"]),qn=A.object({ref:A.string().min(1)}),Ft=A.union([A.string(),A.number(),A.boolean()]),el=A.object({template:A.array(A.union([A.string(),qn])).min(1)}),Ve=A.union([qn,Ft,el,A.null()]),ep=A.object({kind:A.literal("changed")}),tl=A.union([Ve,ep]),_t=A.union([A.string(),qn,el]),B0=A.object({by:A.literal("role"),name:A.union([_t,A.undefined()]).optional().transform(e=>e),role:A.string().min(1)}),V0=A.object({by:A.literal("testId"),value:_t}),U0=A.object({by:A.literal("inside"),scope:A.lazy(()=>he),target:A.lazy(()=>he)}),he=A.discriminatedUnion("by",[B0,V0,U0]),no=A.enum(["string","number","boolean"]),nl=A.enum(["strict","eventual"]),W0=A.object({kind:A.literal("string"),maxLength:A.number().int().positive().optional(),minLength:A.number().int().nonnegative().optional(),pattern:A.string().optional()}),z0=A.object({kind:A.literal("number"),max:A.number().int().optional(),min:A.number().int().optional()}),G0=A.object({kind:A.literal("datetime"),maxOffsetDays:A.number().int(),minOffsetDays:A.number().int()}),tp=A.discriminatedUnion("kind",[W0,z0,G0]),np=A.enum(["company.name","date.iso","internet.email","internet.url","person.fullName","lorem.slug","lorem.word"]),rl=A.object({constraints:tp.optional(),generator:np,name:A.string().min(1),type:no,values:A.array(Ft).min(1).optional()}),rp=A.object({consistency:nl.default("strict"),optional:A.boolean(),type:no,valueSpace:A.string().min(1).optional()}),il=A.enum(["backend","client"]),ol=A.object({description:A.string().optional(),identity:A.array(A.string().min(1)).min(1),identityKind:A.enum(["surrogate","natural"]),name:A.string().min(1),props:A.record(A.string().min(1),rp),source:il.default("backend")}),sl=A.object({consistency:nl.default("strict"),default:Ft,description:A.string().optional(),name:A.string().min(1),source:il.default("backend"),type:no,valueSpace:A.string().min(1).optional()}),al=A.enum(["url","title","viewport"]);function ro(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${ro(e.scope)} \u25B8 ${ro(e.target)}`:`${e.role} ${e.name??""}`.trim()}import{z as R}from"zod";var ll=["unspecified","internal","server","client","producer","consumer"],ul=["unset","ok","error"],ip=R.looseObject({data:R.looseObject({source:R.number().optional()}).optional(),timestamp:R.number(),type:R.number()}),Et=R.string(),K0=R.object({action:R.string(),kind:R.literal("action"),source:R.literal("test"),target:R.string().optional(),timeNanos:Et,value:R.string().optional()}),H0=R.object({kind:R.literal("assertion"),label:R.string(),outcome:R.enum(["passed","failed","error"]),source:R.literal("test"),step:R.string(),timeNanos:Et,wait:R.enum(["fast","slow","async"]).optional(),waitMs:R.number().optional()}),q0=R.object({event:ip,kind:R.literal("rrweb"),rrwebType:R.string(),source:R.literal("browser"),timeNanos:Et}),Y0=R.object({kind:R.literal("network"),method:R.string(),requestBody:R.string().optional(),resourceType:R.string(),responseBody:R.string().optional(),source:R.literal("browser"),spanId:R.string().optional(),status:R.number(),timeNanos:Et,traceId:R.string().optional(),url:R.string()}),Z0=R.object({kind:R.literal("console"),level:R.string(),source:R.literal("browser"),text:R.string(),timeNanos:Et}),J0=R.object({kind:R.literal("error"),message:R.string(),source:R.literal("browser"),stack:R.string().optional(),timeNanos:Et}),X0=R.object({clientVersion:R.string(),kind:R.literal("meta"),source:R.literal("capture"),timeNanos:Et}),Q0=R.object({kind:R.literal("notice"),message:R.string(),source:R.literal("capture"),timeNanos:Et}),ev=R.object({actual:R.string().optional(),expected:R.string().optional(),findingKind:R.string(),kind:R.literal("finding"),mismatchKind:R.string().optional(),pending:R.boolean().optional(),source:R.literal("verifier"),step:R.string(),subject:R.string(),timeNanos:Et,wait:R.enum(["fast","slow","async"]).optional(),waitMs:R.number().optional()}),op=R.object({attributes:R.record(R.string(),R.string()),durationMs:R.number(),kind:R.literal("span"),name:R.string(),parentSpanId:R.string().optional(),source:R.literal("server"),spanId:R.string(),spanKind:R.enum(ll),status:R.object({code:R.enum(ul),message:R.string().optional()}),timeNanos:Et,traceId:R.string()}),sp=R.discriminatedUnion("kind",[K0,H0,q0,Y0,Z0,J0,X0,Q0,ev,op]);function tv(e){let t=rv(e);if(t==null)return null;let n=sp.safeParse(t);return n.success?n.data:null}function nv(e){return Number(BigInt(e)/1000000n)}function cl(e){return ll[e]??"unspecified"}function dl(e){return ul[e]??"unset"}function rv(e){try{return JSON.parse(e)}catch{return null}}import{z as w}from"zod";function jt(e){return e.kind==="not"?jt(e.predicate):"ephemeral"in e&&e.ephemeral===!0}var iv=w.discriminatedUnion("kind",[w.object({as:w.string().min(1),kind:w.literal("created"),props:w.record(w.string().min(1),Ve)}),w.object({as:w.string().min(1),kind:w.literal("updated"),props:w.record(w.string().min(1),tl)}),w.object({kind:w.literal("deleted")})]),ov=w.object({kind:w.literal("is"),value:Ve}),sv=w.discriminatedUnion("kind",[w.object({kind:w.literal("path")}),w.object({key:w.string().min(1),kind:w.literal("query")}),w.object({kind:w.literal("hash")})]),ap=w.lazy(()=>w.union([Ve,lv])),av=w.object({entity:w.string().min(1),where:w.record(w.string().min(1),ap)}),lv=w.object({field:w.string().min(1),kind:w.literal("within"),selection:av}),Xe=w.union([Qa,w.undefined()]).optional().transform(e=>e),At=w.union([w.boolean(),w.undefined()]).optional().transform(e=>e),lp=w.object({assertion:ov,kind:w.literal("singleton"),singleton:w.string().min(1),wait:Xe}),up=w.object({entity:w.string().min(1),kind:w.literal("count"),value:w.number().int().nonnegative()}),io=w.lazy(()=>w.discriminatedUnion("kind",[lp,up,w.object({kind:w.literal("not"),predicate:io}),w.object({kind:w.literal("and"),predicates:w.array(io)})])),uv=w.lazy(()=>w.object({condition:w.union([io,w.undefined()]).optional().transform(e=>e),consequence:w.array(Yn),name:w.string().min(1)})),Yn=w.lazy(()=>w.discriminatedUnion("kind",[w.object({ephemeral:At,kind:w.literal("visible"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("unobstructed"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("disabled"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("enabled"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("focused"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("checked"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("expanded"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("pressed"),locator:he,wait:Xe}),w.object({ephemeral:At,kind:w.literal("value"),locator:he,value:_t,wait:Xe}),w.object({ephemeral:At,kind:w.literal("text"),locator:he,value:_t,wait:Xe}),lp,w.object({kind:w.literal("browser"),name:al,part:w.union([sv,w.undefined()]).optional().transform(e=>e),value:w.union([_t,w.null()]),wait:Xe}),w.object({assertion:iv,entity:w.string().min(1),key:w.record(w.string().min(1),ap),kind:w.literal("state"),wait:Xe}),w.object({kind:w.literal("not"),predicate:Yn}),w.object({kind:w.literal("and"),predicates:w.array(Yn)}),up,w.object({branches:w.array(uv),kind:w.literal("when")})]));import{z as oo}from"zod";var cv=oo.object({__codec:oo.string().min(1),data:oo.unknown(),version:oo.number().int().positive()}),so=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}},ao=class extends Error{constructor(t){super(`Codec mismatch: expected "${t.expected}", got "${t.got}"`),this.name="CodecMismatchError"}};function fl({name:e,schema:t}){return{currentVersion:1,name:e,decode:n=>pv({name:e,raw:n,schema:t}),encode:n=>({__codec:e,data:n,version:1})}}function dv(e,t){return JSON.stringify(e.encode(t))}function fv(e,t){let n=JSON.parse(t);return e.decode(n)}function pv({name:e,raw:t,schema:n}){let r=cv.parse(t);if(r.__codec!==e)throw new ao({expected:e,got:r.__codec});if(r.version!==1)throw new so({codec:e,currentVersion:1,gotVersion:r.version});return n.parse(r.data)}var lo="__ripplo__",pl="__ripplo_seed__",Vr="__ripplo_ready__";import{z as k}from"zod";var cp=k.discriminatedUnion("kind",[k.object({kind:k.literal("goto"),url:_t}),k.object({kind:k.literal("fill"),locator:he,value:Ve}),k.object({kind:k.literal("clear"),locator:he}),k.object({kind:k.literal("click"),locator:he}),k.object({kind:k.literal("dblclick"),locator:he}),k.object({kind:k.literal("select"),locator:he,value:Ve}),k.object({kind:k.literal("check"),locator:he}),k.object({kind:k.literal("uncheck"),locator:he}),k.object({kind:k.literal("hover"),locator:he}),k.object({files:k.array(k.string().min(1)).min(1),kind:k.literal("upload"),locator:he}),k.object({key:k.string().min(1),kind:k.literal("press"),locator:he.optional()})]),hl=k.object({action:cp,expect:k.array(Yn).default([])}),ml=k.object({valueSpace:k.string().min(1)}),uo=k.object({as:k.string().min(1),entity:k.string().min(1),set:k.record(k.string().min(1),Ve)}),yl=k.object({entity:k.string().min(1),where:k.record(k.string().min(1),Ve)}),co=k.object({absent:k.array(yl).default([]),exclusive:k.array(k.string().min(1)).default([]),intent:k.string().min(1),name:k.string().min(1),params:k.record(k.string().min(1),ml),singletons:k.record(k.string().min(1),Ve).default({}),slug:k.string().min(1),steps:k.array(hl).default([]),workflow:k.string().min(1),world:k.array(uo).default([])}),gl=k.object({absent:k.array(yl).default([]),exclusive:k.array(k.string().min(1)).default([]),intent:k.string().min(1),maybe:k.array(uo).default([]),name:k.string().min(1),params:k.record(k.string().min(1),ml),singletons:k.record(k.string().min(1),Ve).default({}),sourcePath:k.string().min(1).optional(),steps:k.array(hl).default([]),stub:k.boolean().default(!1),tests:k.array(co).default([]),world:k.array(uo).default([])}),dp=k.object({sha256:k.string().regex(/^[0-9a-f]{64}$/u),size:k.number().int().nonnegative()}),fp=k.object({entities:k.array(ol),fixtures:k.record(k.string().min(1),dp).default({}),singletons:k.array(sl).default([]),valueSpaces:k.array(rl),workflows:k.array(gl)}),hv=fl({name:"ripplo-lockfile",schema:fp});var vl=Xa(yp(),1),Z8=vl.default.configure,fo=vl.default;function C(e){let t=fo(e,vv);if(t==null)throw new Error("structuralKey: value is not serializable");return t}function vv(e,t){if(t instanceof Map||t instanceof Set)throw new TypeError(`structuralKey: opaque collection at "${e}" \u2014 expand it before keying`);return t}var Qe={display:void 0,name:"label"},ue={display:void 0,name:"screen"},bp={alert:ue,alertdialog:ue,banner:ue,button:Qe,cell:ue,checkbox:Qe,columnheader:ue,combobox:Qe,complementary:ue,contentinfo:ue,dialog:ue,form:ue,grid:ue,group:ue,heading:ue,img:ue,link:Qe,list:ue,listitem:ue,main:ue,menu:ue,menuitem:{display:"menu item",name:"label"},menuitemcheckbox:{display:"menu item checkbox",name:"label"},menuitemradio:{display:"menu item radio",name:"label"},navigation:ue,option:Qe,progressbar:ue,radio:Qe,radiogroup:ue,region:ue,row:ue,searchbox:Qe,slider:Qe,spinbutton:Qe,status:ue,switch:Qe,tab:Qe,table:ue,tablist:ue,tabpanel:ue,textbox:Qe,toolbar:ue,treeitem:Qe},s5=new Map(Object.entries(bp));import{z as Wr}from"zod";var kv=Wr.object({index:Wr.number().int().nonnegative(),kind:Wr.string(),target:Wr.string(),value:Wr.string()});function Ev(e){let t=Av(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:Mv(Tv(n),t),requiresKeys:n.world.map(r=>({namespace:r.as,preconditionName:r.entity})),slug:xp(n.name),sourcePath:n.sourcePath??null,spec:n}))}}function wp(e,t){return{index:t,kind:e.action.kind,target:Ov(e.action),value:Nv(e.action)}}function xp(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,"-").split("-").filter(t=>t.length>0).join("-")}function Av(e){let t=e.workflows.reduce((n,r)=>Cv(n,r),new Map);return new Map([...t].map(([n,r])=>[n,[...r]]))}function Cv(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=Pv(o,r),a=i.get(o.entity)??new Set;return new Map([...i,[o.entity,new Set([...a,...s])]])},e)}function Pv(e,t){return Object.values(e.set).flatMap(n=>Iv(n)).map(n=>t.get(n)).filter(n=>n!=null&&n!==e.entity)}function Iv(e){return e==null||typeof e!="object"?[]:"ref"in e?[Sp(e.ref)]:e.template.filter(t=>typeof t!="string").map(t=>Sp(t.ref))}function Sp(e){let[t]=e.split(".");return t??e}function Mv(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 Tv(e){return[...new Set(e.world.map(t=>t.entity))]}function Ov(e){return e.kind==="goto"?po(e.url):e.kind==="press"&&e.locator==null?"":ho(e.locator)}function po(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:e.template.map(t=>typeof t=="string"?t:`{${t.ref}}`).join("")}function ho(e){return e.by==="testId"?`testId=${po(e.value)}`:e.by==="inside"?`${ho(e.scope)} \u25B8 ${ho(e.target)}`:`${e.role} ${e.name==null?"":po(e.name)}`.trim()}function Nv(e){return e.kind==="fill"||e.kind==="select"?$v(e.value):e.kind==="press"?e.key:""}function $v(e){return e==null?"":typeof e!="object"?String(e):po(e)}import{z as Ae}from"zod";var vp=Ae.enum(["Strict","Lax","None"]),Rp=Ae.object({domain:Ae.string().min(1),expires:Ae.number(),httpOnly:Ae.boolean(),name:Ae.string().min(1),path:Ae.string().min(1),sameSite:vp,secure:Ae.boolean(),value:Ae.string()}),kp=Ae.object({localStorage:Ae.array(Ae.object({name:Ae.string().min(1),value:Ae.string()})),origin:Ae.string().min(1)}),kl=Ae.object({cookies:Ae.array(Rp),headers:Ae.record(Ae.string().min(1),Ae.string()).optional(),origins:Ae.array(kp)});import{z as Y}from"zod";var El=Y.union([Ft,Y.null()]),Al=Y.record(Y.string().min(1),El),Ep=Y.object({as:Y.string().min(1),entity:Y.string().min(1),fields:Y.record(Y.string().min(1),Ve)}),Lv=Y.object({entities:Y.array(Ep),runId:Y.string().min(1),singletons:Y.record(Y.string().min(1),El).default({})}),Ap=Y.object({as:Y.string().min(1),row:Al,session:kl.optional()}),Cl=Y.object({rows:Y.array(Ap)}),Dv=Y.object({entities:Y.array(Y.string().min(1)),runId:Y.string().min(1),singletons:Y.array(Y.string().min(1)).default([])}),Pl=Y.object({entities:Y.record(Y.string().min(1),Y.array(Al)),singletons:Y.record(Y.string().min(1),El).default({})}),Fv=Y.object({runId:Y.string().min(1)}),Il=Y.object({ok:Y.literal(!0)});import{z as jv}from"zod";var Tl=jv.string().brand(),Z=Tl.parse("");function dt(e){return Tl.parse(e)}function et(e,t){return Tl.parse(e.length===0?t:`${e}.${t}`)}function X(e){return qn.safeParse(e).success}function zr(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 Ml(e,t,n){let r=et(t,e.ref);if(!n.has(r))throw new Error(`unresolved binding ref "${r}"`);return n.get(r)??null}function Gr(e,t,n){return Bv(e).every(r=>n.has(et(t,r)))}function Ct(e,t,n){return typeof e=="string"?e:X(e)?String(Ml(e,t,n)):e.template.map(r=>typeof r=="string"?r:String(Ml(r,t,n))).join("")}function tt(e,t,n){return e===null||typeof e=="number"||typeof e=="boolean"?e:X(e)?Ml(e,t,n):Ct(e,t,n)}function Cp(e,t){return tt(e,Z,t)}function Kr(e){return fo(e)}function Zn(e,t,n){return Object.fromEntries(Object.entries(e).map(([r,i])=>[r,tt(i,t,n)]))}function Bv(e){return e==null||typeof e!="object"?[]:qe(e)?e.template.flatMap(t=>typeof t=="string"?[]:[t.ref]):[e.ref]}function ft(e,t){return e.by==="role"?{by:"role",name:e.name==null?void 0:Ct(e.name,Z,t),role:e.role}:e.by==="inside"?{by:"inside",scope:ft(e.scope,t),target:ft(e.target,t)}:{by:"testId",value:Ct(e.value,Z,t)}}function Pn(e,t){if(e==null)return new Set;if(e.by==="inside")return new Set([...Pn(e.scope,t),...Pn(e.target,t)]);let n=e.by==="role"?e.name:e.value;return new Set(t(n))}var Vv="https://ripplo.invalid";var Pp={hash:void 0,path:void 0,query:{},title:void 0,viewport:void 0};function Mp(e){return e.kind!=="title"&&e.kind!=="viewport"}function Jn(e){return e.kind==="query"?`url query "${e.key}"`:e.kind==="title"||e.kind==="viewport"?e.kind:`url ${e.kind}`}function mo(e,t){return e==="title"?{kind:"title"}:e==="viewport"?{kind:"viewport"}:t===void 0||t.kind==="path"?{kind:"path"}:t.kind==="hash"?{kind:"hash"}:{key:t.key,kind:"query"}}function Hr(e){let t=new URL(e,Vv),n=Object.fromEntries(t.searchParams.entries());return{hash:t.hash.length>0?t.hash.slice(1):void 0,path:t.pathname,query:n,title:void 0,viewport:void 0}}function Tp(e){if(typeof e=="string")return Ip(Hr(e));let t=X(e)?[e]:e.template,n=t.findIndex(u=>typeof u=="string"&&/[?#]/.test(u)),r=t[n];if(n===-1||typeof r!="string")return{...Pp,path:e};let i=[...t.slice(0,n),r.slice(0,r.search(/[?#]/))],o=t.slice(n),s={template:i};if(o.some(u=>typeof u!="string"))return{...Pp,path:s};let a=o.filter(u=>typeof u=="string").join(""),l=Hr(`/p${a.slice(a.search(/[?#]/))}`);return{...Ip(l),path:s}}function Op(e){let n=[[{kind:"path"},e.path],[{kind:"hash"},e.hash],[{kind:"title"},e.title],[{kind:"viewport"},e.viewport]].flatMap(([i,o])=>o===void 0?[]:[{clause:o,key:i}]),r=Object.entries(e.query).map(([i,o])=>({clause:o,key:{key:i,kind:"query"}}));return[...n,...r]}function Ip(e){return{hash:e.hash,path:e.path,query:e.query,title:e.title,viewport:e.viewport}}var Bt=new Map,In=new Map;function K(e){return C(e)}function Mn(e,t){let n=Uv(t)?Wv(e,t.subject):e;return new Map([...n,[K(t.subject),t]])}function Ol(e,t){return new Map([...e,[K(t.subject),t]])}function Ue(e,t){return new Map([...e,...t])}function Nl(e){return e.kind==="element"}function Xn(e){return e.kind==="path"||e.kind==="query"||e.kind==="hash"}function $e(e,t){let n=e.get(K(t));return n==null||n.expect.expect!=="is"?void 0:n.expect.value}function Qn(e){let t=Hr(e),n=[[{kind:"path"},t.path],[{kind:"hash"},t.hash],...Object.entries(t.query).map(r=>[{key:r[0],kind:"query"},r[1]])];return new Map(n.flatMap(([r,i])=>i===void 0?[]:[[K(r),{declared:!0,expect:{expect:"is",value:i},subject:r}]]))}function qr(e){return[...e].toSorted(([t],[n])=>t.localeCompare(n))}function $l(e){return[...e].toSorted(([t],[n])=>t.localeCompare(n))}function Uv(e){return e.subject.kind==="element"&&e.subject.state==="visible"&&e.expect.expect==="is"&&e.expect.value===!1}function Wv(e,t){if(t.kind!=="element")return e;let n=C(t.locator);return new Map([...e].filter(([,r])=>r.subject.kind!=="element"||C(r.subject.locator)!==n||r.subject.state!=="text"&&r.subject.state!=="value"))}function Yr({declared:e,entry:t,env:n}){let r=t.subject.kind==="element"?{...t.subject,locator:ft(t.subject.locator,n)}:t.subject;if(t.expect.expect==="absent")return{declared:e,expect:{expect:"absent"},subject:r};let i=tt(t.expect.value,Z,n),o=Kv(r)&&typeof i=="number"?String(i):i;return{declared:e,expect:{expect:t.expect.expect,value:o},subject:r}}function er({got:e,subject:t,want:n}){if(n.expect==="absent")return e===void 0;if(zv(t)){let r=Gv(e,n.value);return n.expect==="is"?r:!r}return n.expect==="is"?e===n.value:e!==n.value}function zv(e){return e.kind==="element"&&e.state==="text"}function Gv(e,t){return typeof e=="string"&&typeof t=="string"&&e.includes(t)}function Kv(e){return e.kind==="element"&&(e.state==="value"||e.state==="text")}function tr(e){let t=$e(e.scalars,{kind:"path"});return typeof t=="string"?t:null}function yo({actual:e,canon:t,pre:n,predicted:r}){return[...[...new Set([...r.entities.keys(),...e.entities.keys()])].flatMap(s=>qv({actual:e.entities.get(s),canon:t,entity:s,pre:n.entities.get(s),predicted:r.entities.get(s)})),...Hv(n.scalars,r.scalars,e.scalars)]}function Hv(e,t,n){return[...t.entries()].flatMap(([r,i])=>{let o=Np(n,r);if(!i.declared||o===void 0||er({got:o,subject:i.subject,want:i.expect}))return[];let s=Np(e,r);return[{mismatch:{kind:"scalar-mismatch",subject:i.subject,sut:o,want:i.expect},pending:s!==void 0&&Lp(s,o)}]})}function Np(e,t){let n=e.get(t);return n==null||n.expect.expect!=="is"?void 0:n.expect.value}function qv({actual:e,canon:t,entity:n,pre:r,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>Yv({actual:e?.get(s),canon:t,entity:n,key:s,predicted:i?.get(s),preHadKey:r?.has(s)??!1,preRow:r?.get(s)}))}function Yv({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",row:e},pending:o}];if(e==null)return[{mismatch:{entity:n,key:r,kind:"missing-row"},pending:!o}];let a=(u,c,d)=>Lp(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 Lp(e,t){return $p(e)===$p(t)}function $p(e){return e==null?"\u2205":JSON.stringify(e)}function go(e){let t=Zv(e.entities),n=Jv(e.singletons);return r=>Xv(r,t,n)}function Zv(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([n,r])=>[Dp(t.name,n),r.consistency])))}function Dp(e,t){return`${e}.${t}`}function Jv(e){return new Map(e.map(t=>[t.name,t.consistency]))}function Xv(e,t,n){return e.kind==="scalar-mismatch"?Qv(e.subject,n):e.kind==="unexpected-row"||e.kind==="missing-row"?"strict":t.get(Dp(e.entity,e.field))??"strict"}function Qv(e,t){return e.kind==="variable"?t.get(e.name)??"strict":"eventual"}function bo(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 Ll({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 eR=Ll();function Dl(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(eR,"")}function Fl(e,t,n){return{detail:n.slice(0,500),kind:"engine-http",path:e,status:t}}function nr(e,t){return{code:Wp(t),kind:"engine-network",message:Zr(t),path:e}}function So(e){return{kind:"client-mount-missing",mountKey:e}}function _l(e,t){return{kind:"app-not-ready",readyKey:e,timeoutMs:t}}function jl(e,t){return{kind:"engine-decode",message:Zr(t),path:e}}function Bl(e,t){return{entity:e,field:t,kind:"state-identity"}}function _p(e){return{as:e,kind:"setup-missing-row"}}function jp(e){return{count:e,kind:"conflicting-sessions"}}function Vt(e){return{kind:"driver-launch",message:Zr(e)}}function Vl(e){return{kind:"engine-unreachable",url:e}}function Ul(e,t){return{action:e,kind:"action-failed",message:Zr(t)}}function Wl(e){return{kind:"check-failed",message:Zr(e)}}function zl(){return{kind:"aborted"}}var tR=["app-not-ready","client-mount-missing","driver-launch","engine-decode","engine-http","engine-network","engine-unreachable"],Bp=new Set(tR);function wo(e){return Bp.has(e.kind)}function Vp(e){return Bp.has(e)}var Fp=300;function Pt(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${Up(e.detail)}${oR(e.status)}`;case"engine-network":return`engine ${e.path} request failed: ${e.message}${nR(e.code)}${iR(e.code)}`;case"client-mount-missing":return`this test reads client-side state, but the app never mounted the client engine ("${e.mountKey}"). Call mountClientEngine() where your app boots.`;case"app-not-ready":return`the app never called ready() within ${String(e.timeoutMs)}ms of loading the page. Call ready() from @ripplo/testing once your app is interactive \u2014 see setup.`;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 Gl(e){throw new Error(Pt(e))}function pt(){}function Up(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=Fp?t:`${t.slice(0,Fp)}\u2026 [truncated]`}function nR(e){return e==null?"":` (${e})`}var rR=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function iR(e){return e!=null&&rR.has(e)?" \u2014 nothing accepted the connection at the engine URL. Check that the app's dev server is running and RIPPLO_ENGINE_URL points at it.":" \u2014 the app dropped the connection while handling this request. A crash in the app's engine route or a thrown error in a seed/read impl can cause this. Check the app server logs."}function oR(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 Wp(e){if(!(typeof e!="object"||e==null))return"code"in e&&typeof e.code=="string"?e.code:"cause"in e?Wp(e.cause):void 0}function Zr(e){let t=e instanceof Error?e.message:String(e);return Up(Dl(t))}function zp(e){return Gp(e,new Map)}function sR(e,t){return e.reduce((n,r)=>n??t(r),null)}function Gp(e,t){let n=e.variables.find(r=>!t.has(r));return n==null?t:sR(e.domain(n),r=>{let i=new Map([...t,[n,r]]);return e.consistent(i)?Gp(e,i):null})}function It(e,t){let n=Kp(e,t);return n==null?null:hR(e.scalars,t,RR(n))}function Kp(e,t){let{absences:n,entities:r,exclusives:i}=e,o=new Map(r.map(a=>[a.alias,a])),s=zp({variables:r.map(a=>a.alias),consistent:a=>aR(a)&&lR(r,a)&&cR(n,a,t),domain:a=>fR(o.get(a),t)});return s==null?null:pR(i,r,s,t)?s:null}function aR(e){let t=[...e.values()];return new Set(t).size===t.length}function lR(e,t){return e.every(n=>t.has(n.alias)?n.relations.every(r=>uR(n,r,t)):!0)}function uR(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 cR(e,t,n){return e.every(r=>![...n.entities.get(r.entity)?.values()??[]].some(i=>dR(i,r,t)))}function dR(e,t,n){return Hp(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 Hp(e,t){return Object.entries(t.literals).every(([n,r])=>r===null?e[n]==null:e[n]===r)}function fR(e,t){return e==null?[]:[...t.entities.get(e.entity)?.values()??[]].filter(n=>Hp(n,e))}function pR(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 hR(e,t,n){return[...e.values()].reduce((r,i)=>r==null?null:mR(i,t,r),n)}function mR(e,t,n){let r=SR(e.subject,n);if(r==null)return null;let i=xR(t,r);return e.expect.expect==="absent"?i===void 0?n:null:e.expect.expect==="not"?vR({clause:e.expect.value,env:n,got:i,subject:r}):yR({clause:e.expect.value,env:n,got:i,subject:r})}function yR({clause:e,env:t,got:n,subject:r}){if(gR(r,e,t))return n===void 0?null:new Map([...t,[dt(bR(e)),n]]);if(!Gr(e,Z,t))return null;let i=tt(e,Z,t);return er({got:n,subject:r,want:{expect:"is",value:i}})?t:null}function gR(e,t,n){return e.kind==="element"&&(e.state==="value"||e.state==="text")&&X(t)&&!Gr(t,Z,n)}function bR(e){if(!X(e))throw new Error("expected a ref clause");return e.ref}function SR(e,t){return e.kind!=="element"?e:wR(e.locator,t)?{...e,locator:ft(e.locator,t)}:null}function wR(e,t){return[...Pn(e,n=>n==null?[]:[n])].every(n=>Gr(n,Z,t))}function xR(e,t){let n=e.scalars.get(K(t));return n==null||n.expect.expect!=="is"?void 0:n.expect.value}function vR({clause:e,env:t,got:n,subject:r}){if(!Gr(e,Z,t))return null;let i=tt(e,Z,t);return er({got:n,subject:r,want:{expect:"not",value:i}})?t:null}function RR(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"?[[dt(`${t}.${r[0]}`),i]]:[]})))}var kR={absences:[],entities:[],exclusives:[],scalars:In};function rr(e){return{...kR,...e}}function Ut(e,t){return[...new Map(e.map(n=>[t(n),n])).values()]}function qp(e){return Jr(e.expect).some(t=>t.assertion.kind==="deleted")}var Yp=new Set(["created","updated","deleted"]);function ql(e){return Jr(e.expect).some(t=>Yp.has(t.assertion.kind))}function Zp(e){return new Set(Jr(e.expect).flatMap(t=>Yp.has(t.assertion.kind)?[t.entity]:[]))}function Yl(e){return Kl(e.expect).length>0}function sn(e){return typeof e=="object"&&e!==null&&"kind"in e}function an(e){return Object.fromEntries(Object.entries(e).filter(t=>!sn(t[1])))}function Zl(e){return new Map(e.entities.filter(t=>t.identityKind==="surrogate").map(t=>[t.name,t.identity]))}function Xr(e,t,n){return t.reduce((r,i)=>AR(r,i,n,e),e)}function Jp(e,{clears:t,forget:n,sets:r}){let i=new Set(t),o=ER(e,n,r),s=[...e.scalars].filter(([a,l])=>!i.has(a)&&!(o&&Nl(l.subject)));return{...e,scalars:Ue(new Map(s),r)}}function ER(e,t,n){if(t==="hard")return!0;if(t==="none")return!1;let r=$e(e.scalars,{kind:"path"}),i=$e(n,{kind:"path"});return i!==void 0&&i!==r}function AR(e,t,n,r){let{env:i,identities:o}=n;if(!IR(t,i))return e;if(t.assertion.kind==="created"){let a=Zn(t.assertion.props,Z,i),l=CR({entity:t.entity,identities:o,props:a},e);return MR(e,t.entity,Kr(l),l)}if(t.assertion.kind==="deleted")return Hl(e,t.entity,$R(t.key,i,r));let s=Zn(an(t.assertion.props),Z,i);return Hl(e,t.entity,LR(t.key,s,i,r))}function Kl(e){return e.flatMap(t=>t.kind==="singleton"?[t]:t.kind==="and"?Kl(t.predicates):t.kind==="when"?Kl(t.branches.flatMap(n=>n.consequence)):[])}var Jl="#surrogate#";function Xp(e){return typeof e=="string"&&e.includes(Jl)}function CR({entity:e,identities:t,props:n},r){let i=(t.get(e)??[]).filter(a=>!(a in n));if(i.length===0)return n;let o=PR(r.entities.get(e),e),s=Object.fromEntries(i.map(a=>[a,`${e}${Jl}${String(o)}`]));return{...n,...s}}function PR(e,t){let n=`${t}${Jl}`;return[...(e??new Map).values()].flatMap(i=>Object.values(i)).filter(i=>typeof i=="string"&&i.startsWith(n)).map(i=>Number(i.slice(n.length))).filter(i=>Number.isFinite(i)).reduce((i,o)=>Math.max(i,o),0)+1}function IR(e,t){return("props"in e.assertion?[e.key,an(e.assertion.props)]:[e.key]).every(r=>Object.values(r).every(i=>th(i)||!X(i)||t.has(dt(i.ref))))}function MR(e,t,n,r){let i=new Map([...e.entities.get(t)??[],[n,r]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function Hl(e,t,n){let r=n(e.entities.get(t)??new Map);return{...e,entities:new Map([...e.entities,[t,r]])}}function Jr(e){return e.flatMap(t=>t.kind==="state"?[t]:t.kind==="and"?Jr(t.predicates):t.kind==="when"?Jr(t.branches.flatMap(n=>n.consequence)):[])}function Tn(e,t,n,r){let i={env:r,key:n,snapshot:e};return[...(e.entities.get(t)??new Map).values()].filter(o=>vo(o,i))}function Qp(e,t,n,r,i){let o={env:r,key:n,snapshot:e};return Hl(e,t,s=>new Map([...s].map(([a,l])=>[a,vo(l,o)?i(l):l])))}function vo(e,t){return Object.entries(t.key).every(([n,r])=>eh(e[n],r,t))}function eh(e,t,n){return th(t)?TR(t,n).has(xo(e)):xo(e)===xo(NR(t,n.env))}function th(e){return typeof e=="object"&&e!==null&&"kind"in e}function TR(e,t){let n=t.snapshot.entities.get(e.selection.entity);return n==null?new Set:new Set([...n.values()].filter(r=>OR(r,e.selection.where,t)).map(r=>xo(r[e.field])))}function OR(e,t,n){return Object.entries(t).every(([r,i])=>eh(e[r],i,n))}function xo(e){return e==null?"\u2205":e instanceof Date?e.toISOString():JSON.stringify(e)}function NR(e,t){return tt(e,Z,t)}function $R(e,t,n){let r={env:t,key:e,snapshot:n};return i=>new Map([...i].filter(([,o])=>!vo(o,r)))}function LR(e,t,n,r){let i={env:n,key:e,snapshot:r};return o=>new Map([...o].map(([s,a])=>vo(a,i)?[s,{...a,...t}]:[s,a]))}function nh(e){return[...DR(e.action),...e.expect.flatMap(t=>ln(t))]}function Ye(e){return X(e)?[e.ref]:qe(e)?e.template.flatMap(t=>X(t)?[t.ref]:[]):[]}function nt(e){return e.by==="inside"?[...nt(e.scope),...nt(e.target)]:e.by==="role"?e.name==null?[]:Ye(e.name):Ye(e.value)}function ln(e){switch(e.kind){case"visible":case"unobstructed":case"disabled":case"enabled":case"focused":case"checked":case"expanded":case"pressed":return nt(e.locator);case"value":case"text":return[...nt(e.locator),...Ye(e.value)];case"singleton":return Ye(e.assertion.value);case"browser":return Ye(e.value);case"state":return[...e.assertion.kind==="deleted"?[]:Object.values(an(e.assertion.props)).flatMap(t=>Ye(t)),...Object.values(e.key).flatMap(t=>rh(t))];case"not":return ln(e.predicate);case"when":return e.branches.flatMap(t=>t.consequence.flatMap(n=>ln(n)));case"and":return e.predicates.flatMap(t=>ln(t));case"count":return[]}}function DR(e){return e.kind==="goto"?Ye(e.url):e.kind==="fill"||e.kind==="select"?[...nt(e.locator),...Ye(e.value)]:e.kind==="press"?e.locator==null?[]:nt(e.locator):(e.kind==="upload",nt(e.locator))}function rh(e){return FR(e)?Object.values(e.selection.where).flatMap(t=>rh(t)):Ye(e)}function FR(e){return typeof e=="object"&&e!==null&&"kind"in e}function Ro(e){return e.flatMap(t=>t.kind==="and"?Ro(t.predicates):[t])}function un(e){return Ro(e).filter(t=>!jt(t))}function ko(e){return e.action.kind==="goto"?!0:Xl(e.expect).some(t=>t.kind==="browser"&&t.name==="url"&&t.value!==null)}function On(e){return e.action.kind==="goto"?!0:Xl(e.expect).some(t=>t.kind==="browser"&&t.name==="url"&&t.value!==null&&(t.part===void 0||t.part.kind==="path"))}function Xl(e){return e.flatMap(t=>t.kind==="and"?Xl(t.predicates):[t])}function cn(e,t){return t.reduce((n,r)=>{let i=[...WR(r),...ei(r),...zR(r)],o=_R(r,n,i)?UR(n):n;return i.reduce((s,a)=>Ol(s,a),o)},e)}function ht(e){return e.kind==="not"?jR(e.predicate):e.kind==="singleton"?{expect:{expect:"is",value:e.assertion.value},subject:{kind:"variable",name:e.singleton}}:e.kind==="browser"?{expect:e.value===null?{expect:"absent"}:{expect:"is",value:e.value},subject:mo(e.name,e.part)}:ih(e,!1)}function Qr(e){return Op(Tp(e)).map(({clause:t,key:n})=>({expect:t===null?{expect:"absent"}:{expect:"is",value:t},subject:n}))}function _R(e,t,n){if(e.action.kind==="goto")return!0;if(!On(e))return!1;let r=t.get(K({kind:"path"})),i=n.find(o=>o.subject.kind==="path");return i==null?!1:r==null||C(r.expect)!==C(i.expect)}function jR(e){return e.kind==="value"||e.kind==="text"?{expect:{expect:"not",value:e.value},subject:{kind:"element",locator:e.locator,state:e.kind}}:ih(e,!0)}function ih(e,t){if(e.kind==="value"||e.kind==="text")return{expect:{expect:"is",value:e.value},subject:{kind:"element",locator:e.locator,state:e.kind}};let n=BR(e);return n==null?null:{expect:{expect:"is",value:n.value!==t},subject:{kind:"element",locator:n.locator,state:n.state}}}function ei(e){let t=e.action;return!("locator"in t)||t.locator==null?[]:t.kind==="check"||t.kind==="uncheck"?[{expect:{expect:"is",value:t.kind==="check"},subject:{kind:"element",locator:t.locator,state:"checked"}}]:t.kind==="clear"?[{expect:{expect:"is",value:""},subject:{kind:"element",locator:t.locator,state:"value"}}]:t.kind==="fill"||t.kind==="select"?[{expect:{expect:"is",value:t.value},subject:{kind:"element",locator:t.locator,state:"value"}}]:[]}function BR(e){return VR(e)?e.kind==="disabled"?{locator:e.locator,state:"enabled",value:!1}:{locator:e.locator,state:e.kind,value:!0}:null}function VR(e){return e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked"||e.kind==="expanded"||e.kind==="pressed"}function UR(e){return new Map([...e].filter(([,t])=>t.subject.kind==="variable"))}function WR(e){return e.action.kind==="goto"?Qr(e.action.url):[]}function zR(e){return un(e.expect).flatMap(t=>{let n=ht(t);return n==null?[]:[n]})}function Ql(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var Mt={async:12e4,fast:5e3,slow:3e4},eu={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:Mt.async},fast:{backoffMs:[100,250,500,1e3],timeoutMs:Mt.fast},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:Mt.slow}};function oh(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function We(e){return`${e.workflow}/${e.slug}`}function Le(e){return e.workflows.flatMap(t=>t.tests.map(n=>({ref:We(n),test:n,workflow:t})))}function Tt(e){return`${e.test}#${String(e.index)}`}function ti(e){let t=Le(e).flatMap(n=>ni(e,n.test));return Ut(t,n=>`${n.test}:${C(n.steps)}`)}function ni(e,t){let n=ah(t),r=sh(n,t.singletons),i=dk(t,ck(e)),o=GR(e,t),s=Zl(e);return KR(r,fk(t.steps),n).reduce((l,{chunk:u,requiredState:c},d)=>({offset:l.offset+u.length,transitions:[...l.transitions,ak({chunk:u,identities:s,index:d,intent:t.intent,namespace:n.namespace,paramSpaceOf:i,requiredState:c,testRef:We(t),whenChunk:o.slice(l.offset,l.offset+u.length)})]}),{offset:0,transitions:[]}).transitions}function sh(e,t){return{absences:ik(e),entities:sk(e),exclusives:e.exclusives,scalars:new Map(Object.entries(t).filter(([,n])=>!X(n)&&!qe(n)).map(([n,r])=>[K({kind:"variable",name:n}),{expect:{expect:"is",value:r},subject:{kind:"variable",name:n}}]))}}function GR(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 Eo(e,t,n){return Object.values(e).flatMap(r=>X(r)?ii(r.ref,n):[]).find(r=>r.entity===t)?.aliasPath}function KR(e,t,n){return t.reduce((r,i)=>({requiredState:HR(r.requiredState,i,n),withRequiredState:[...r.withRequiredState,{chunk:i,requiredState:nk(r.requiredState,i)}]}),{requiredState:e,withRequiredState:[]}).withRequiredState}function HR(e,t,n){let r=t.flatMap(i=>i.expect.filter(o=>o.kind==="state")).reduce((i,o)=>qR(i,o,n),e);return{...r,scalars:cn(r.scalars,t)}}function qR(e,t,n){return t.assertion.kind==="deleted"?YR(e,t,n):t.assertion.kind==="created"?XR(e,t.entity,t.assertion.as,t.assertion.props,n):ek(e,t,n)}function YR(e,t,n){let r=Eo(t.key,t.entity,n.namespace),i=e.entities.find(a=>a.alias===r),o=ri(ZR(t.key),n),s=i==null?{entity:t.entity,...o}:{entity:i.entity,...JR(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==r)}}function ZR(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let n=t[1];return rk(n)?[]:[[t[0],n]]}))}function JR(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(n=>!t.relations.some(r=>r.field===n.field)),...t.relations]}}function XR(e,t,n,r,i){let o=ri(r,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!QR(o,s)),entities:[...e.entities,{alias:n,entity:t,...o}]}}function QR(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 ek(e,t,n){if(t.assertion.kind!=="updated")return e;let r=Eo(t.key,t.entity,n.namespace);if(r==null)return e;let i=ri(an(t.assertion.props),n),o=Object.entries(t.assertion.props).filter(([,a])=>sn(a)).map(([a])=>a),s=a=>a.alias===r?tk(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a))}}function tk(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 nk(e,t){return t[0]?.action.kind!=="goto"?e:{...e,scalars:new Map([...e.scalars].filter(([,n])=>n.subject.kind==="variable"))}}function Ao(e,t){let n=ah(t);return{namespace:n.namespace,requiredState:sh(n,t.singletons)}}function nu(e,t){return[...new Set(e)].flatMap(n=>ii(n,t))}function ah(e){return{absences:e.absent,exclusives:e.exclusive,namespace:new Map(e.world.map(t=>[t.as,t.entity])),setups:e.world}}function rk(e){return typeof e=="object"&&e!==null&&"kind"in e}function ik(e){return e.absences.map(t=>({entity:t.entity,...ri(t.where,e)}))}function ri(e,t){let n=Object.entries(e),r=Object.fromEntries(n.flatMap(([o,s])=>X(s)||qe(s)?[]:[[o,s]])),i=n.flatMap(o=>{let s=o[1];if(!X(s))return[];let a=ii(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 ok(e,t){return e.map(n=>({alias:n.as,entity:n.entity,...ri(n.set,t)}))}function sk(e){return ok(e.setups,e)}function ii(e,t){let n=zr(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 ak(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=>nh(s)))];return{effectStep:i,identities:e.identities,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:Ql(e.chunk.flatMap(s=>[...lk(s),...uk(s)])),whenSteps:e.whenChunk}}function lk(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function uk(e){return ko(e)?["slow"]:[]}function ck(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function dk(e,t){return new Map(Object.entries(e.params).map(([n,r])=>[n,t.get(r.valueSpace)]))}function fk(e){return tu(e,0,[],[])}function tu(e,t,n,r){let i=e[t];if(i==null)return n.length===0?r:[...r,n];let o=[...n,i];return pk(i)?tu(e,t+1,[],[...r,o]):tu(e,t+1,o,r)}function pk(e){return e.expect.some(t=>t.kind==="state")}function Po(e){let t=e.filter(r=>!r.localConsequence),n=hk(t).flatMap(r=>yk(r));return mk(n)}function hk(e){return[...e.reduce((n,r)=>{let i=C(r.consequence);return new Map([...n,[i,[...n.get(i)??[],r]]])},new Map).values()]}function mk(e){return[...new Map(e.map(n=>[C([Co(n.when),n.consequence]),n])).values()]}function yk(e){return e.length<2?[]:[e,...gk(e),...bk(e)].flatMap(t=>Sk(t))}function gk(e){let n=[...new Set(e.flatMap(r=>r.when.entities.map(i=>i.entity)))].map(r=>e.filter(i=>i.when.entities.some(o=>o.entity===r)));return uh(e,n)}function uh(e,t){let n=t.filter(i=>i.length>=2&&i.length<e.length);return[...new Map(n.map(i=>[C(i.map(o=>C([Co(o.when),o.consequence]))),i])).values()]}function Co(e){return C([e.entities,e.absences,e.exclusives,ch(e.scalars)])}function ch(e){return[...e].toSorted((t,n)=>t[0].localeCompare(n[0])).map(([t,n])=>[t,n.expect])}function bk(e){let n=[...new Set(e.map(r=>ru(r.when.scalars)))].map(r=>e.filter(i=>ru(i.when.scalars)===r));return uh(e,n)}function ru(e){return C(ch(new Map([...e].filter(([,t])=>Xn(t.subject)))))}function Sk(e){if(e.length<2)return[];let t=e.toSorted((r,i)=>lh(r.when)-lh(i.when))[0];if(t==null)return[];let n={absences:vk(e),entities:Rk(e),presenceTypes:kk(e),scalars:Ek(e,t)};return Ak(e,n.entities)?[]:Mk(t,n,Lk(e)).filter(r=>xk(r,e))}var wk=3;function xk(e,t){return[...e.when.scalars.values()].some(i=>Xn(i.subject))?!0:new Set(t.map(i=>ru(i.when.scalars))).size>=wk}function lh(e){return e.entities.length+e.absences.length+e.scalars.size}function vk(e){let t=e.map(r=>new Set(r.when.absences.map(i=>dh(i)))),[n]=t;return n==null?[]:[...n].filter(r=>t.every(i=>i.has(r)))}function dh(e){return C([e.entity,e.literals,e.relations])}function Rk(e){let t=e.map(r=>new Set(r.when.entities.map(i=>iu(i)))),[n]=t;return n==null?[]:[...n].filter(r=>t.every(i=>i.has(r)))}function iu(e){return C([e.entity,e.literals])}function kk(e){let t=e.map(r=>new Set(r.when.entities.map(i=>i.entity))),[n]=t;return n==null?[]:[...n].filter(r=>t.every(i=>i.has(r)))}function Ek(e,t){let n=[...t.when.scalars].filter(([r,i])=>e.every(o=>{let s=o.when.scalars.get(r);return s!=null&&C(s.expect)===C(i.expect)}));return new Map(n)}function Ak(e,t){return e.some(n=>{let r=fh(n.consequence),i=Ck(r),o=Pk(r);return n.when.entities.some(s=>!t.includes(iu(s))&&(Ik(s,i)||o.has(s.alias)))})}function fh(e){return e.kind==="not"?fh(e.predicate):"locator"in e?e.locator:void 0}function Ck(e){return Pn(e,t=>t==null||X(t)||qe(t)?[]:[t])}function Pk(e){return Pn(e,t=>{if(t==null||!X(t))return[];let n=zr(t.ref);return n==null?[]:[n.alias]})}function Ik(e,t){return Object.values(e.literals).some(n=>typeof n=="string"&&t.has(n))}function Mk(e,t,n){let r=e.when.entities.filter(u=>t.entities.includes(iu(u))),i=new Set(r.map(u=>u.entity)),o=Tk(e,t.presenceTypes,i),s=[...r,...o],a=new Set(s.map(u=>u.alias));if(![...e.refs].every(u=>a.has(u)))return[];let l=rr({absences:e.when.absences.filter(u=>t.absences.includes(dh(u))),entities:s.map(u=>Ok(u,a)),exclusives:e.when.exclusives.filter(u=>s.some(c=>c.entity===u)),scalars:Nk(t.scalars,a)});return Co(l)===Co(e.when)?[]:[{consequence:e.consequence,localConsequence:!1,origin:{kind:"generalized",tests:n},refs:e.refs,when:l}]}function Tk(e,t,n){return t.filter(r=>!n.has(r)).flatMap(r=>{let i=e.when.entities.find(o=>o.entity===r);return i==null?[]:[{...i,literals:{},relations:[]}]})}function Ok(e,t){return{...e,relations:e.relations.filter(n=>t.has(n.targetAlias))}}function Nk(e,t){return new Map([...e].filter(([,n])=>$k(n,t)))}function $k(e,t){let n=e.expect.expect==="absent"?[]:Ye(e.expect.value);return[...e.subject.kind==="element"?nt(e.subject.locator):[],...n].every(i=>{let o=zr(i);return o==null||t.has(o.alias)})}function Lk(e){return[...new Set(e.flatMap(t=>t.origin==null?[]:t.origin.kind==="generalized"?t.origin.tests:[t.origin.test]))]}function hh(e){return e.flatMap((t,n)=>e.slice(n+1).flatMap(r=>yh(t,r)))}function Nn(e,t){return Dk(e.entities,t.entities)&&gh(e.absences,t.absences)&&e.exclusives.every(n=>t.exclusives.includes(n))&&jk(e.scalars,t.scalars)}function mh(e,t){return yh(e,t).length>0}function Io(e,t){return Nn(e.when,t.when)&&bh(e.consequence,t.consequence)}function yh(e,t){return!(Nn(e.when,t.when)&&Nn(t.when,e.when))||!bh(e.consequence,t.consequence)?[]:[{a:e.consequence,b:t.consequence,when:e.when}]}function gh(e,t){let n=new Set(t.map(r=>C(r)));return e.every(r=>n.has(C(r)))}function Dk(e,t){return e.every(n=>t.some(r=>Fk(n,r)))}function Fk(e,t){return e.entity===t.entity&&_k(e.literals,t.literals)&&gh(e.relations,t.relations)}function _k(e,t){return Object.entries(e).every(([n,r])=>n in t&&C(t[n])===C(r))}function jk(e,t){return[...e].every(([n,r])=>{let i=t.get(n);return i!=null&&C(i.expect)===C(r.expect)})}function bh(e,t){let n=ht(e),r=ht(t);return n==null||r==null||K(n.subject)!==K(r.subject)?!1:Bk(n,r)}function Bk(e,t){return Vk(e)?ph(e,t):e.expect.expect==="is"&&t.expect.expect==="is"?C(e.expect.value)!==C(t.expect.value):ph(e,t)}function Vk(e){return e.subject.kind==="element"&&e.subject.state==="text"}function ph(e,t){let n=[e.expect,t.expect],r=n.find(o=>o.expect==="is"),i=n.find(o=>o.expect==="not");return r==null||i==null?!1:C(r.value)===C(i.value)}function Sh(e,t){return e.flatMap(n=>{let r=Uk(n),i=new Set(n.requiredState.absences.map(o=>o.entity));return t.flatMap(o=>Wk(n,o,r,i))})}function Uk(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(n=>n.kind==="state"&&n.assertion.kind==="deleted"?[n.entity]:[])))}function Wk(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:Tt(e)}]}function oi(e){return C({consequence:e.consequence,when:ir(e.when)})}function si(e){let t=Kk(e),n=new Set(t.map(i=>oi(i))),r=Po(t).filter(i=>!n.has(oi(i))).reduce((i,o)=>{let s=t.some(l=>Io(o,l)),a=i.some(l=>mh(o,l));return s||a?i:[...i,o]},[]);return[...t,...Ut(r,oi)]}function ou(e,t){return e.filter(n=>!Hk(n)||qk(n)===t)}function To(e){return e.kind==="not"?To(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked"||e.kind==="expanded"||e.kind==="pressed"||e.kind==="value"||e.kind==="text"}function Oo(e,t){if(e.length===0)return t;let n=ai(e,t);return n.size===0?t:{...t,scalars:Ue(n,t.scalars)}}function ai(e,t){let n=e.flatMap(r=>{let i=It(r.when,t);if(i==null)return[];let o=zk(r.consequence,i);return o==null?[]:[{entry:o,key:K(o.subject),when:r.when}]});return n.reduce((r,i)=>Gk(i,n)?r:Mn(r,i.entry),Bt)}function zk(e,t){let n=ht(e);if(n==null)return null;try{return Yr({declared:!0,entry:n,env:t})}catch{return null}}function Gk(e,t){return t.some(n=>n.key===e.key&&Nn(e.when,n.when)&&!Nn(n.when,e.when))}function Kk(e){return Ut(Le(e).flatMap(t=>iE(e,t)),oi)}function Hk(e){return e.origin?.kind==="test"&&e.localConsequence}function qk(e){let{origin:t}=e;if(!(t==null||t.kind==="generalized"))return t.test}function vh(e,{test:t,workflow:n}){let r=Ao(e,t),i=Yk(n.steps),o=t.steps.reduce((s,a)=>{let l=Zk(s.requiredState,a,r),u=oE({branchScoped:i,namespace:r.namespace,origin:{kind:"test",test:We(t)},paramNames:new Set(Object.keys(t.params)),post:l,pre:s.requiredState,step:a});return{requiredState:l,steps:[...s.steps,{facts:u,post:l}]}},{requiredState:r.requiredState,steps:[]});return{initial:r.requiredState,steps:o.steps}}function Yk(e){let t=e.flatMap(n=>n.expect).flatMap(n=>Mo(n)).map(n=>C(n));return new Set(t)}function Mo(e){return e.kind==="not"?Mo(e.predicate):e.kind==="and"?e.predicates.flatMap(t=>Mo(t)):e.kind!=="when"?[]:e.branches.flatMap(t=>t.consequence.flatMap(n=>[n,...Mo(n)]))}function Zk(e,t,n){return{...Jk(e,t,n),scalars:cn(e.scalars,[t])}}function Jk(e,t,n){return t.expect.reduce((r,i)=>i.kind==="state"?Xk(r,i,n):r,e)}function Xk(e,t,n){if(t.assertion.kind==="created"){let o=Qk(t.assertion.as,t.entity,t.assertion.props,n);return{...e,entities:[...e.entities,o]}}let r=Eo(t.key,t.entity,n.namespace);if(r==null)return e;if(t.assertion.kind==="deleted")return nE(e,r);let i=an(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===r?Rh(o,i,n):o)}}function Qk(e,t,n,r){return Rh({alias:e,entity:t,literals:{},relations:[]},n,r)}function Rh(e,t,n){return Object.entries(t).reduce((r,[i,o])=>{if(qe(o))return r;if(X(o)){let s=eE(o.ref,i,n.namespace);return{...r,literals:tE(r.literals,i),relations:s==null?r.relations:[...wh(r.relations,i),s]}}return{...r,literals:{...r.literals,[i]:o},relations:wh(r.relations,i)}},e)}function eE(e,t,n){let[r]=ii(e,n);return r==null?void 0:{entity:r.entity,field:t,targetAlias:r.aliasPath,targetField:r.field}}function tE(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>n!==t))}function wh(e,t){return e.filter(n=>n.field!==t)}function nE(e,t){let n=e.entities.find(i=>i.alias===t),r=rE(e,t);return n==null?r:{...r,absences:[...r.absences,{entity:n.entity,literals:n.literals,relations:n.relations}]}}function rE(e,t){return{...e,entities:e.entities.filter(n=>n.alias!==t)}}function iE(e,t){return vh(e,t).steps.flatMap(n=>n.facts)}function ir(e){return C([e.entities,e.absences,e.exclusives,$l(e.scalars).map(([t,n])=>[t,n.expect])])}function oE(e){return un(e.step.expect).filter(t=>To(t)&&!e.branchScoped.has(C(t))).flatMap(t=>sE(t,e))}function sE(e,t){let n=ht(e);if(n==null)return[];if(ln(e).some(s=>t.paramNames.has(s)))return[];let r=K(n.subject),i={...t.post,scalars:new Map([...t.post.scalars].filter(([s])=>s!==r))},o=aE(i,t.pre,t.paramNames);return o==null?[]:ir(o)===ir(t.pre)?[]:[{consequence:e,localConsequence:nu(ln(e),t.namespace).length>0,origin:t.origin,refs:new Set(nu([...uE(o),...ln(e)],t.namespace).map(s=>s.aliasPath)),when:o}]}function aE(e,t,n){let r=[...e.scalars.values()].map(i=>lE(i,t,n));return r.some(i=>i==null)?null:{...e,scalars:new Map(r.flatMap(i=>i==null?[]:[[K(i.subject),i]]))}}function lE(e,t,n){if(!xh(e,n))return e;if(e.subject.kind!=="element"||e.expect.expect==="absent"||nt(e.subject.locator).some(i=>n.has(i)))return null;let r=t.scalars.get(K(e.subject));return r==null||r.expect.expect!=="is"||xh(r,n)?null:{expect:{expect:"not",value:r.expect.value},subject:e.subject}}function xh(e,t){let n=e.expect.expect==="absent"?[]:Ye(e.expect.value);return[...e.subject.kind==="element"?nt(e.subject.locator):[],...n].some(i=>t.has(i))}function uE(e){return[...e.scalars.values()].flatMap(t=>Xn(t.subject)&&t.expect.expect!=="absent"?Ye(t.expect.value):[])}function No(e){return Ut(Le(e).flatMap(t=>cE(e,t.test)),su)}function su(e){return C({holds:ir(e.holds),reference:e.reference,when:ir(e.when)})}function $o(e,t){return It(e.when,t)==null?!1:It(e.holds,t)==null}function cE(e,t){let n=Ao(e,t);return n.requiredState.entities.flatMap(r=>r.relations.flatMap(i=>dE(e,r,i,n.namespace)?hE(r,i,n.namespace):[]))}function dE(e,t,n,r){let i=r.get(n.targetAlias);return i!=null&&!fE(e,t.entity,n.field)&&pE(e,i,n.targetField)}function fE(e,t,n){return e.entities.find(r=>r.name===t)?.props[n]?.optional===!0}function pE(e,t,n){return e.entities.find(r=>r.name===t)?.identity.includes(n)===!0}function hE(e,t,n){let r=n.get(t.targetAlias);if(r==null)return[];let i=kh(e.alias,e.entity),o=kh(t.targetAlias,r);return[{holds:rr({entities:[{...i,relations:[t]},o]}),reference:{field:t.field,source:e.entity,target:r,targetField:t.targetField},when:rr({entities:[i]})}]}function kh(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function Eh(e){return e.kind==="data-rule"?C({kind:e.kind,rule:su(e.dataRule)}):C(e)}var mt=class extends Error{name="AbortError";constructor(){super("aborted")}};function li(e){return e instanceof Error&&e.name==="AbortError"}function rt(e){if(e.aborted)throw new mt}function dn(e,t){return t.aborted?Promise.reject(new mt):new Promise((n,r)=>{let i=()=>{clearTimeout(o),r(new mt)},o=setTimeout(()=>{t.removeEventListener("abort",i),n()},e);t.addEventListener("abort",i,{once:!0})})}var mE={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=mE[e.kind]??e.kind;return e.kind==="press"&&e.key!=null?`${t}: ${e.key}`:t}function Lo(e){return e.kind==="data-rule"?"data rule":Ch(e.check)}function Ch(e){return e.kind==="not"?`not ${Ch(e.inner)}`:e.kind==="browser"?Jn(e.key):`${Ph(e.locator)} ${e.kind}`}function Ph(e){return e.by==="testId"?"element":e.by==="inside"?Ph(e.target):e.role}function Ih(e){return e.kind==="goto"?e.url:e.kind==="press"?e.key:e.value==null?void 0:String(e.value)}function Do(e){return e.kind==="data-rule"?void 0:Th(e.check)}function Mh(e){return e.kind==="data-rule"?!1:Fo(e.check)}function Fo(e){return e.kind==="not"?Fo(e.inner):e.kind==="browser"&&Mp(e.key)}function Th(e){if(e.kind==="not")return Th(e.inner);if(e.kind==="value"||e.kind==="text"||e.kind==="browser")return e.value??void 0}function Oh({atMs:e,findings:t,step:n}){return n.urlChecks.map(r=>({atMs:e,ephemeral:!1,kind:"assertion",label:Lo({check:r,kind:"step"}),outcome:t.length>0?"failed":"passed",rrwebIds:[],url:!0,value:Do({check:r,kind:"step"})}))}function _o({action:e,actionLabel:t,outcome:n,rrwebIds:r,startMs:i}){return{atMs:i,ephemeral:!1,kind:"action",label:t,outcome:n,rrwebIds:r,url:!1,value:Ih(e)}}var yE=()=>[],gE=()=>Bt;async function Bo({canon:e,classify:t,dataRuleChecks:n,derive:r,initialSnapshot:i,observe:o,onAssertion:s,onStep:a,steps:l,stopAfterStep:u},c){return Fh({acc:[],canon:e,classify:t,dataRuleChecks:n??yE,derive:r??gE,index:0,observe:o,onAssertion:s,onStep:a,signal:c,snapshot:i,steps:l,stopAfterStep:u})}async function Fh({acc:e,canon:t,classify:n,dataRuleChecks:r,derive:i,index:o,observe:s,onAssertion:a,onStep:l,signal:u,snapshot:c,steps:d,stopAfterStep:p}){rt(u);let m=d[o];if(m==null)return{finalModel:c,findings:e};let f=Date.now(),h=await m.targetIds(),y=Ah(m.step.action);if(!m.requiredState(c)){let S={kind:"impossible-action",step:m.step};return au(l,{annotations:[_o({action:m.step.action,actionLabel:y,outcome:"failed",rrwebIds:h,startMs:f})],endMs:Date.now(),findings:[S],index:o,post:c,pre:c,source:m.source,startMs:f,url:tr(c)}),{finalModel:c,findings:[...e,S]}}return m.perform().match(()=>bE({acc:e,actionLabel:y,canon:t,classify:n,dataRuleChecks:r,derive:i,index:o,observe:s,onAssertion:a,onStep:l,rrwebIds:h,signal:u,snapshot:c,startMs:f,step:m,steps:d,stopAfterStep:p}),S=>{let x=jo(S,m);return au(l,{annotations:[_o({action:m.step.action,actionLabel:y,outcome:"failed",rrwebIds:h,startMs:f})],endMs:Date.now(),findings:[x],index:o,post:c,pre:c,source:m.source,startMs:f,url:tr(c)}),Promise.resolve({finalModel:c,findings:[...e,x]})})}async function bE({acc:e,actionLabel:t,canon:n,classify:r,dataRuleChecks:i,derive:o,index:s,observe:a,onAssertion:l,onStep:u,rrwebIds:c,signal:d,snapshot:p,startMs:m,step:f,steps:h,stopAfterStep:y}){let S=f.effect(p),x=o(S),b={...S,scalars:Ue(x,S.scalars)},v=await kE({canon:n,claimed:new Set([...f.assertedScalars,...x.keys()]),classify:r,observe:a,pre:p,predicted:b,signal:d,step:f}),N={...v.snapshot,scalars:new Map([...[...v.snapshot.scalars].filter(([,se])=>se.subject.kind!=="element"),...[...S.scalars].filter(([,se])=>se.subject.kind==="element")])},$=Date.now(),L=[...f.pendingChecks,...i(p,v.snapshot)],D=await SE({onAssertion:l,pendingChecks:L,signal:d,step:f}),M=[...D.findings,...v.findings];au(u,{annotations:[_o({action:f.step.action,actionLabel:t,outcome:M.length>0?"failed":"passed",rrwebIds:c,startMs:m}),...Oh({atMs:$,findings:v.findings,step:f}),...D.annotations],endMs:Date.now(),findings:M,index:s,post:v.snapshot,pre:p,source:f.source,startMs:m,url:tr(v.snapshot)});let V=[...e,...M];return M.length>0?{finalModel:N,findings:V}:y!=null&&s+1>=y?{finalModel:N,findings:V}:Fh({acc:V,canon:n,classify:r,dataRuleChecks:i,derive:o,index:s+1,observe:a,onAssertion:l,onStep:u,signal:d,snapshot:N,steps:h,stopAfterStep:y})}async function SE({onAssertion:e,pendingChecks:t,signal:n,step:r}){let i=[...new Map(t.map(s=>[Eh(s.source),s])).values()],o=await Promise.all(i.map(async s=>{let a=await wE(s,n),l=Date.now(),u=await s.targetIds();return{atMs:l,outcome:a,pendingCheck:s,rrwebIds:u}}));return o.forEach(s=>{xE(e,s.pendingCheck,s.outcome,r)}),{annotations:o.filter(s=>s.pendingCheck.source.kind==="step").map(s=>({atMs:s.atMs,ephemeral:s.pendingCheck.ephemeral,kind:"assertion",label:Lo(s.pendingCheck.source),outcome:_h(s.outcome),rrwebIds:s.rrwebIds,url:Mh(s.pendingCheck.source),value:Do(s.pendingCheck.source)})),findings:o.flatMap(s=>vE(s.pendingCheck,s.outcome,r))}}function wE(e,t){if(e.check.kind==="decided"){let n=e.check.passed?"passed":"failed";return Promise.resolve({kind:n})}return e.check.wait(eu[e.budget].timeoutMs).match(n=>n?{kind:"passed"}:{kind:"failed"},n=>{if(n.kind==="aborted")throw new mt;return{error:n,kind:"error"}})}function xE(e,t,n,r){e?.({outcome:_h(n),source:t.source,step:r.step,waitBudget:t.budget,waitMs:Mt[t.budget]})}function _h(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function vE(e,t,n){return t.kind==="error"?[jo(t.error,n)]:t.kind==="failed"?[{budget:e.budget,kind:"pending-check",source:e.source,step:n.step}]:[]}function jo(e,t){return{error:e,kind:"driver-error",step:t.step}}function au(e,t){e?.(t)}function Nh(e){return e().match(t=>({observed:t,ok:!0}),t=>({error:t,ok:!1}))}function RE(e,t,n){return n.reconcile==null?e:n.reconcile(e,t)}function $h({canon:e,pre:t,predicted:n,step:r},i){let o=r.verifyChanges==null?[]:r.verifyChanges(n,i),s=RE(n,i,r),a=o.map(l=>({mismatch:l,pending:!0}));return{adopted:s,probed:[...a,...yo({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function jh(e,t){return{budget:t.sync,kind:"consistency",mismatch:e.mismatch,pending:e.pending,step:t.step}}function Lh(e,t,n){let r=e.probed.filter(i=>!i.pending&&n(i.mismatch)==="strict");return r.length>0?{findings:r.map(i=>jh(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function Dh(e,t,n){return{findings:[...e.probed.map(r=>jh(r,t)),...n],snapshot:e.adopted}}async function kE({canon:e,claimed:t,classify:n,observe:r,pre:i,predicted:o,signal:s,step:a}){let l=eu[a.sync],u=Date.now()+l.timeoutMs,c=Ue(i.scalars,o.scalars),d=new Map([...c].filter(([y,S])=>S.declared&&(S.subject.kind!=="element"||t.has(y)))),p=()=>r(d),m=await Nh(p);if(!m.ok)return{findings:[jo(m.error,a)],snapshot:o};let f=$h({canon:e,pre:i,predicted:o,step:a},m.observed),h=0;for(;Date.now()<u;){rt(s);let y=Lh(f,a,n);if(y!=null)return y;await dn(oh(l,h),s),h+=1;let S=await Nh(p);if(!S.ok)return Dh(f,a,[jo(S.error,a)]);f=$h({canon:e,pre:i,predicted:o,step:a},S.observed)}return Lh(f,a,n)??Dh(f,a,[])}function lu(e){let t=e.predicates.filter(o=>Wh(o)),n=t.filter(o=>o.assertion.kind==="created"),r=Uh(t);if(n.length===0&&r.length===0&&e.deferred.length===0)return;let i=t.filter(o=>o.assertion.kind==="updated");return(o,s)=>{let a=n.reduce((c,d)=>ME(c,s,d,e),{env:e.env,snapshot:o}),l=r.reduce((c,d)=>IE(c,s,d,e.env),a.snapshot),u=i.reduce((c,d)=>EE(c,s,d),a.env);return $E(l,e.deferred,u)}}function Vh(e,t,n){return new Map([...e,...Object.entries(n).map(([r,i])=>[et(Z,`${t}.${r}`),i])])}function EE(e,t,n){let r=Tn(t.snapshot,n.entity,n.key,e).at(0);return r==null?e:Vh(e,n.assertion.as,r)}function uu(e){let t=Uh(e.predicates.filter(n=>Wh(n)));if(t.length!==0)return(n,r)=>t.flatMap(i=>AE(i,n,r,e.env))}function Uh(e){return e.filter(t=>t.assertion.kind==="updated"&&cu(t.assertion.props).length>0)}function cu(e){return Object.entries(e).filter(([,t])=>sn(t)).map(([t])=>t)}function Wh(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function AE(e,t,n,r){let i=Tn(t,e.entity,e.key,r).at(0),o=Tn(n.snapshot,e.entity,e.key,r).at(0);if(i==null||o==null)return[];let s=Kr(CE(e.key,r));return cu(e.assertion.props).flatMap(a=>Bh(i[a])===Bh(o[a])?[{entity:e.entity,field:a,key:s,kind:"expected-change",value:o[a]}]:[])}function CE(e,t){let n=Object.fromEntries(Object.entries(e).filter(r=>!PE(r[1])));return Zn(n,Z,t)}function PE(e){return typeof e=="object"&&e!==null&&"kind"in e}function Bh(e){return e==null?"\u2205":JSON.stringify(e)}function IE(e,t,n,r){let i=cu(n.assertion.props),o=Tn(t.snapshot,n.entity,n.key,r).at(0);return o==null?e:Qp(e,n.entity,n.key,r,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function ME(e,t,n,r){if(n.assertion.kind!=="created")return e;let i=Zn(n.assertion.props,Z,r.env),o=e.snapshot.entities.get(n.entity);if(o==null)return e;let s=TE({identityFields:r.identities.get(n.entity)??[],props:i,set:o});if(s==null)return e;let a=OE(t.snapshot.entities.get(n.entity),o,i);if(a==null)return e;let[l,u]=a,c=new Map(o);return c.delete(s),c.set(l,{...u,...i}),{env:Vh(e.env,n.assertion.as,u),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(n.entity,c)}}}function TE({identityFields:e,props:t,set:n}){let r=Kr(t);if(n.has(r))return r;if(e.length===0)return null;let i=Object.entries(t),o=[...n].find(([,s])=>e.every(a=>Xp(s[a]))&&i.every(([a,l])=>Vo(s[a])===Vo(l)));return o==null?null:o[0]}function OE(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])=>Vo(s[a])===Vo(l)).length}));return NE(i,r.length)}function Vo(e){return e==null?"\u2205":JSON.stringify(e)}function NE(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 $E(e,t,n){let r=t.reduce((i,o)=>{let s=LE(o.value,n);return s==null||typeof s!="string"?i:Mn(i,{declared:!0,expect:{expect:"is",value:s},subject:o.key})},e.scalars);return{...e,scalars:r}}function LE(e,t){try{return Ct(e,Z,t)}catch{return}}function du(e,t){if(e.kind==="visible"||e.kind==="unobstructed"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked"||e.kind==="expanded"||e.kind==="pressed")return{kind:e.kind,locator:ft(e.locator,t)};if(e.kind==="not"){let n=du(e.predicate,t);return n==null?null:{inner:n,kind:"not"}}return e.kind==="value"||e.kind==="text"?{kind:e.kind,locator:ft(e.locator,t),value:Ct(e.value,Z,t)}:e.kind!=="browser"?null:{key:mo(e.name,e.part),kind:"browser",value:e.value===null?null:Ct(e.value,Z,t)}}function or(e,t){let{env:n,identities:r}=t,i=e.expect.filter(p=>p.kind==="state"),o=WE(i),{clears:s,deferred:a,sets:l}=FE(e,n,o),u=ko(e),c=zE(e.action,n),d=DE(e);return{action:c,assertedScalars:[...l.keys()],label:e.action.kind,pendingChecks:e.expect.flatMap(p=>HE(p,n,u)),reconcile:lu({deferred:a,env:n,identities:r,predicates:i}),urlChecks:e.expect.flatMap(p=>KE(p,n)),verifyChanges:uu({deferred:a,env:n,identities:r,predicates:i}),effect:p=>Jp(Xr(p,i,t),{clears:s,forget:d,sets:l})}}function DE(e){return e.action.kind==="goto"?"hard":On(e)?"soft-path":"none"}function FE(e,t,n){let r=e.action.kind==="goto"?Qr(e.action.url):[],i=un(e.expect).flatMap(a=>{let l=ht(a);return l==null?[]:[l]}),o=[...r,...i].map(a=>({declared:!0,entry:a}));return[...ei(e).map(a=>({declared:!1,entry:a})),...o].reduce((a,{declared:l,entry:u})=>_E({acc:a,captures:n,declared:l,entry:u,env:t}),{clears:[],deferred:[],sets:Bt})}function _E({acc:e,captures:t,declared:n,entry:r,env:i}){if(jE(r,t))return r.expect.expect==="is"&&zh(r.expect.value)?{...e,deferred:[...e.deferred,{key:UE(r.subject),value:r.expect.value}]}:e;let o=Yr({declared:n,entry:r,env:i});return o.expect.expect==="absent"?{...e,clears:[...e.clears,K(o.subject)]}:{...e,sets:Mn(e.sets,o)}}function jE(e,t){return e.subject.kind==="element"||e.subject.kind==="variable"?!1:e.expect.expect==="is"&&zh(e.expect.value)&&BE(e.expect.value,t)}function zh(e){return typeof e=="string"||typeof e=="object"}function BE(e,t){return VE(e).some(n=>t.has(n.split(".")[0]??n))}function VE(e){return typeof e=="string"?[]:X(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function UE(e){if(e.kind==="element"||e.kind==="variable")throw new Error("expected a browser subject");return e}function WE(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function zE(e,t){return{files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:GE(e,t),url:e.kind==="goto"?Ct(e.url,Z,t):void 0,value:"value"in e?Cp(e.value,t):void 0}}function GE(e,t){if(!(!("locator"in e)||e.locator==null))return ft(e.locator,t)}function KE(e,t){if(e.kind!=="browser"&&e.kind!=="not")return[];try{let n=du(e,t);return n!=null&&Fo(n)?[n]:[]}catch{return[]}}function HE(e,t,n){if(e.kind==="browser"||e.kind==="singleton")return[];let r=du(e,t),i=n?"slow":"fast",o="wait"in e?e.wait??i:i;return r==null?[]:[{budget:o,check:r,ephemeral:jt(e)}]}import{err as Gh,ok as pu,okAsync as qE,Result as YE}from"neverthrow";function sr(e,t,n){let r=nA(e),i={env:new Map,generate:n.generate,generatedParams:new Set,indexed:r,overrides:new Map(Object.entries(n.params??{}).map(([s,a])=>[dt(s),a]))};rA(t.params,Z,i);let o=t.world.map(s=>iA(s,Z,i));return n.materialize(o).andThen(s=>lA(s,i.env,r).map(a=>ZE({base:a,generatedParams:i.generatedParams,lockfile:e,test:t})))}function Uo(e,t){let n=new Map(t.map(r=>[r.name,r]));return r=>qE(QE(r,e,n).rows)}function Wo(e){return t=>{let n=t.map(r=>({as:r.as,entity:r.entity,fields:r.fields}));return e(n).andThen(r=>XE(t,r))}}function hu(e,t){let n=ui(t);return Object.fromEntries(Object.entries(e).filter(([r,i])=>n.includes(r)&&i!=null))}function ui(e){return Object.keys(e.props)}function ZE({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,tt(d,Z,e.env)])),s=Object.entries(r.singletons).filter(([,c])=>JE(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,scalars:Ue(e.snapshot.scalars,new Map(Object.entries(a).map(([c,d])=>[K({kind:"variable",name:c}),{declared:!0,expect:{expect:"is",value:d},subject:{kind:"variable",name:c}}])))}}}function JE(e,t){return X(e)?t.has(et(Z,e.ref)):qe(e)?e.template.some(n=>typeof n!="string"&&t.has(et(Z,n.ref))):!1}function XE(e,t){let n=new Map(t.map(r=>[r.as,r]));return YE.combine(e.map(r=>{let i=n.get(r.as);return i==null?Gh(_p(r.as)):pu({as:r.as,entity:r.entity,generatedFields:r.generatedFields,row:i.row,session:i.session})}))}function QE(e,t,n){return e.reduce((r,i)=>{let o=eA(i.fields,r.env),s=cA({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 eA(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>{if(X(r))return[n,tA(t,r.ref)];if(qe(r))throw new Error(`template value not allowed in entity field "${n}"`);return[n,r]}))}function tA(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 nA(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function rA(e,t,n){Object.entries(e).forEach(([r,i])=>{let o=et(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 iA(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=et(t,e.as),o=oA(e.set,t,n.env),s=aA(r,o,i,n),a=Object.entries(e.set).filter(([,l])=>X(l)&&n.generatedParams.has(et(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 oA(e,t,n){return Object.fromEntries(Object.entries(e).map(([r,i])=>[r,sA(i,t,n)]))}function sA(e,t,n){if(!X(e))return e;let r=et(t,e.ref);return n.get(r)??{ref:r}}function aA(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,Kh({field:i,generate:r.generate,model:e,seedPrefix:n,spec:o,valueSpaces:r.indexed.valueSpaces})]))}function lA(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(et(dt(a.as),c),d));let u=r.get(a.entity)??new Map;return u.set(fu(a.row,l),hu(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:fu(a.row,l)}]}),s=e.flatMap(a=>{let l=n.models.get(a.entity);if(l==null)return[];let u=fu(a.row,l);return a.generatedFields.map(c=>({entity:a.entity,field:c,key:u}))});return uA(i).map(a=>({aliases:o,auth:a,env:t,generated:s,snapshot:{entities:dA(r),scalars:Bt}}))}function uA(e){if(e.length===0)return pu(void 0);let t=new Set(e.map(r=>JSON.stringify(r.cookies))).size;if(t>1)return Gh(jp(t));let n=e.flatMap(r=>Object.entries(r.headers??{}));return pu({cookies:e.flatMap(r=>r.cookies),headers:n.length===0?void 0:Object.fromEntries(n),origins:e.flatMap(r=>r.origins)})}function cA({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,Kh({field:s,generate:e,model:t,seedPrefix:n,spec:a,valueSpaces:i})])),...r}}function Kh({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:et(r,e),type:i.type,values:o.get(s)?.values,valueSpace:s})}function fu(e,t){return t.identity.map(n=>String(e[n])).join(":")}function dA(e){return new Map([...e].map(([t,n])=>[t,new Map(n)]))}function qh(e,t,n){return e.reduce((r,i)=>{let o=Xr(r.snapshot,fA(i),n);return{resolved:[...r.resolved,pA(i,o,n.env)],snapshot:o}},{resolved:[],snapshot:t}).resolved}function fA(e){return e.expect.filter(t=>t.kind==="state")}function pA(e,t,n){return e.expect.some(r=>r.kind==="when")?{...e,expect:e.expect.flatMap(r=>Yh(r,{env:n,snapshot:t}))}:e}function Yh(e,t){if(e.kind!=="when")return[e];let n=hA(e,t);return n==null?[]:n.flatMap(r=>Yh(r,t))}function hA(e,t){return e.branches.find(n=>n.condition==null||mu(n.condition,t))?.consequence}function mu(e,t){if(e.kind==="count")return Tn(t.snapshot,e.entity,{},t.env).length===e.value;if(e.kind==="singleton"){let n=tt(e.assertion.value,Z,t.env);return Hh($e(t.snapshot.scalars,{kind:"variable",name:e.singleton}))===Hh(n)}return e.kind==="not"?!mu(e.predicate,t):e.predicates.every(n=>mu(n,t))}function Hh(e){return e==null?"\u2205":JSON.stringify(e)}function ci(e,t,n){let r=It(e.requiredState,t);return r==null?null:new Map([...Object.entries(n).map(([i,o])=>[dt(i),o]),...r])}function di(e,t,n){let r={env:t,identities:e.identities},i=qh(e.whenSteps,n,r),o=i.at(-1)??e.effectStep,s=or(o,r),a=yA(e,t);return{effect:gA(s.effect,a),steps:i.map(l=>{let u=or(l,r);return{action:u.action,assertedScalars:u.assertedScalars,effect:u.effect,pendingChecks:u.pendingChecks,reconcile:u.reconcile,source:l,urlChecks:u.urlChecks,verifyChanges:u.verifyChanges}})}}function Go(e,t,n){return It(e.requiredState,n)==null?!1:zo(t(n))!==zo(n)||bA(e)||mA(e)}function mA(e){return[...e.nav,...e.steps].every(t=>t.expect.every(n=>n.kind!=="state"))}var Zh=new WeakMap;function zo(e){let t=Zh.get(e);if(t!=null)return t;let n=C({entities:[...e.entities].toSorted(([r],[i])=>r.localeCompare(i)).map(([r,i])=>[r,[...i].toSorted(([o],[s])=>o.localeCompare(s))]),scalars:qr(e.scalars).map(([r,i])=>[r,i.expect])});return Zh.set(e,n),n}function yA(e,t){let n=e.nav.at(-1);if(n!=null)return or(n,{env:t,identities:e.identities}).action.url}function gA(e,t){if(t==null)return e;let n=Qn(t);return r=>{let i=e(r);return{...i,scalars:Ue(i.scalars,n)}}}function bA(e){return e.effectStep.expect.some(t=>t.kind==="state"&&t.assertion.kind==="updated"&&Object.values(t.assertion.props).some(n=>sn(n)))}function ar(e,t,n){let r=ci(e,t.snapshot,n);if(r==null)return null;let i=SA(e,r,t.snapshot);return i==null||!Go(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function Jh(e,t,n){let r=ci(e,t.snapshot,n);if(r==null)return"required-state-unsatisfied";try{return di(e,r,t.snapshot),"no-effect"}catch{return"unresolvable"}}function SA(e,t,n){try{return di(e,t,n)}catch{return null}}function Ko(e,t,n){return e.flatMap((r,i)=>{let o=n(r),s=ar(r,t,o);return s==null?[]:[{idx:i,label:Tt(r),params:o,stepRun:s}]})}function yu(e,t){let n=[...t.entities].flatMap(([o,s])=>[...s].map(([a,l])=>wA({entity:o,key:a,pre:e,row:l}))),r=[...e.entities].flatMap(([o,s])=>[...s].flatMap(([a,l])=>xA({entity:o,key:a,post:t,row:l}))),i=[...t.scalars.values()].flatMap(o=>{if(o.subject.kind!=="variable"||o.expect.expect!=="is")return[];let s=o.subject.name;return[{changed:$e(e.scalars,o.subject)!==o.expect.value,name:s,value:o.expect.value}]});return{rows:[...n,...r],singletons:i}}function wA({entity:e,key:t,pre:n,row:r}){let i=vA(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 xA({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 vA(e,t){return e?.get(t)}function lr(e,t,n){return t.steps.map(r=>({assertedScalars:r.assertedScalars,effect:r.effect,pendingChecks:r.pendingChecks.map(i=>({budget:i.budget,check:{kind:"poll",wait:o=>n.awaitCheck(i.check,o)},ephemeral:i.ephemeral,source:{check:i.check,kind:"step"},targetIds:()=>n.locateIds(Xh(i.check))})),reconcile:r.reconcile,source:r.source,step:{action:r.action,intent:e.intent,test:e.test},sync:e.wait,urlChecks:r.urlChecks,verifyChanges:r.verifyChanges,perform:()=>n.perform(r.action),requiredState:()=>!0,targetIds:()=>n.locateIds(r.action.locator)}))}function Xh(e){if(e.kind==="not")return Xh(e.inner);if(e.kind!=="browser")return e.locator}async function Qh({current:e,driver:t,index:n,next:r,state:i}){if(r==null||RA(r))return[];if(On(e.transition.effectStep))return[];let o=ar(r.transition,i,r.params);if(o==null)return[];let s=lr(r.transition,o.resolved,t).flatMap(u=>u.pendingChecks.flatMap(c=>{let d=kA(c.source);return d==null?[]:[d]}));if(s.length===0)return[];let a=new Map(s.map(u=>{let c={kind:"element",locator:u,state:"visible"};return[K(c),{declared:!0,expect:{expect:"is",value:!0},subject:c}]})),l=await t.observe(a).match(u=>u,()=>null);return l==null?[]:s.filter(u=>$e(l.snapshot.scalars,{kind:"element",locator:u,state:"visible"})===!0).map(u=>({declaredIndex:n+1,kind:"lift-visibility",locator:u,visibleIndex:n}))}function RA(e){return e.transition.nav.length>0||e.transition.steps.some(t=>t.action.kind==="goto"||On(t))}function kA(e){if(e.kind!=="data-rule")return e.check.kind==="visible"?e.check.locator:void 0}async function bu(e,t){let{params:n,transition:r}=e.stepRun,i={snapshot:Oo(e.facts,e.state.snapshot)},o=ar(r,i,n);if(o==null){let a={intent:r.intent,kind:"unrunnable",reason:Jh(r,i,n),test:r.test};return{label:Tt(r),next:e.state,result:{finalModel:e.state.snapshot,findings:[a]}}}let s=await Bo({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,steps:lr(e.stepRun.transition,o.resolved,e.driver),stopAfterStep:e.stopAfterStep==null?void 0:e.stopAfterStep-e.stepBase,dataRuleChecks:(a,l)=>e.dataRules.flatMap(u=>tm(u,l)),derive:a=>ai(e.facts,a)},t);return{label:Tt(e.stepRun.transition),next:{snapshot:s.finalModel},result:s}}function tm(e,t){return $o(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},ephemeral:!1,source:{dataRule:e,kind:"data-rule"},targetIds:()=>Promise.resolve([])}]:[]}function Ho(e,t){return gu({acc:{findings:[],ran:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function gu({acc:e,index:t,params:n,signal:r,state:i,stepBase:o}){rt(r);let s=n.sequence[t];if(s==null)return e;let a=Date.now(),l=[],u=await bu({canon:n.canon,classify:n.classify,dataRules:n.dataRules,driver:n.driver,facts:n.facts,onAssertion:n.onAssertion,state:i,stepBase:o,stepRun:s,stopAfterStep:n.stopAfterStep,onStep:p=>{l.push(p.index),n.onEvent({annotations:p.annotations,endMs:p.endMs,findings:p.findings,index:o+p.index,kind:"step",source:p.source,startMs:p.startMs,state:yu(p.pre,p.post),url:p.url})}},r);if(u==null)return gu({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});let c=await EA({index:t,outcome:u,params:n,signal:r,state:i,stepBase:o,stepRun:s},l),d={findings:[...e.findings,...u.result.findings,...c],ran:[...e.ran,u.label]};return u.result.findings.length>0||c.length>0||n.stopAfterStep!=null&&o+l.length>=n.stopAfterStep?d:gu({acc:d,index:t+1,params:n,signal:r,state:u.next,stepBase:o+l.length})}async function EA(e,t){let{index:n,outcome:r,params:i,stepBase:o,stepRun:s}=e,a=t.length>0;!a&&r.result.findings.length>0&&em(i,s,e.state,o,r.result.findings);let l=i.sequence[n+1],u=a?await Qh({current:s,driver:i.driver,index:n,next:l,state:r.next}):[];return r.result.findings.forEach(c=>{i.onEvent({finding:c,kind:"finding"})}),u.length>0&&l!=null&&em(i,l,r.next,o+t.length,u),u}function em(e,t,n,r,i){let o=Date.now(),s=$e(n.snapshot.scalars,{kind:"path"});e.onEvent({annotations:[],endMs:o,findings:i,index:r,kind:"step",source:t.transition.steps[0]??t.transition.effectStep,startMs:o,state:yu(n.snapshot,n.snapshot),url:typeof s=="string"?s:null})}var fi={value:e=>AA(e)};function Jo(e,t){return{value:n=>e.value({...n,seed:`${t}:${n.seed}`})}}function Xo(e,t){return{value:n=>e.value({...n,anchor:t})}}function AA({anchor:e,constraints:t,generator:n,nullable:r,seed:i,type:o,values:s,valueSpace:a}){let l=Su(`${a}:${i}`);return r&&l%4===0?null:s!=null&&s.length>0?s[l%s.length]??s[0]??null:n==="date.iso"?CA({anchor:e,constraints:t,n:l,timeHash:Su(`${a}:${i}#tod`)}):o==="number"?PA(l,t):o==="boolean"?l%2===0:NA(n,l)}var qo=864e5;function CA({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/qo)*qo;return new Date(a+s*qo+r%qo).toISOString()}function Su(e,t=0,n=7){return t>=e.length?n>>>0:Su(e,t+1,n*31+(e.codePointAt(t)??0)>>>0)}function PA(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 IA=["ada","bruno","carmen","dario","elena","felix","greta","hugo","iris","jonas","kira","lena","mateo","nadia","oscar","petra","quinn","rosa","stefan","tara","ugo","vera","wim","yara"],MA=["abreu","berg","costa","duval","eriksen","fischer","garza","holm","ito","jansen","kovac","laurent","moreau","novak","okafor","petrov","quist","rossi","sato","tanaka","ueda","vargas","weber","zhang"],TA=["amber","brisk","calm","deep","early","fond","glad","hazel","ivory","jade","keen","lush","mauve","noble","opal","plum","quiet","rapid","sage","teal","umber","vivid","warm","zesty"],OA=["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 Yo(e,t){let n=e[t%e.length];if(n==null)throw new Error("empty word list");return n}function Zo(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function NA(e,t){let n=Yo(IA,t),r=Yo(MA,Math.floor(t/31)),i=Yo(TA,t),o=Yo(OA,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"?`${Zo(n)} ${Zo(r)}`:e==="company.name"?`${Zo(i)} ${Zo(o)}`:e==="lorem.slug"?`${i}-${o}`:`${o}-${String(t%1e3)}`}function nm(e){return Le(e).flatMap(t=>$A(t.test))}function $A(e){let t=new Map(e.world.map(r=>[r.as,r])),n=FA(e.steps);return e.steps.flatMap((r,i)=>r.expect.filter(o=>_A(o)).flatMap(o=>LA({createdAliases:n,predicate:o,setByAlias:t,stepIndex:i,test:e})))}function LA(e){let{createdAliases:t,predicate:n,setByAlias:r,stepIndex:i,test:o}=e,s=DA(n);if(s==null||t.has(s))return[];let a=r.get(s);return a==null?[]:Object.keys(n.assertion.props).filter(l=>!(l in a.set)).map(l=>({entity:n.entity,field:l,stepIndex:i,test:`${o.workflow}/${o.slug}`}))}function DA(e){return Object.values(e.key).flatMap(t=>X(t)?[t.ref.split(".")[0]]:[]).find(t=>t!=null)}function FA(e){return new Set(e.flatMap(t=>t.expect.flatMap(n=>n.kind==="state"&&n.assertion.kind==="created"?[n.assertion.as]:[])))}function _A(e){return e.kind==="state"&&e.assertion.kind==="updated"}function rm(e){return Le(e).flatMap(({test:t})=>jA(t.steps,We(t)))}function jA(e,t){return e.reduce((n,r)=>{let i=BA(r.action),o=i!=null&&!VA(i,n.pre)?[{action:r.action,ephemeralOnly:n.ephemeralKeys.has(C(i)),target:i,test:t}]:[];return{ephemeralKeys:new Set([...n.ephemeralKeys,...UA(r)]),pre:cn(n.pre,[r]),violations:[...n.violations,...o]}},{ephemeralKeys:new Set,pre:In,violations:[]}).violations}function BA(e){if(!(e.kind==="goto"||e.kind==="upload"))return"locator"in e&&e.locator!=null?e.locator:void 0}function VA(e,t){let n=C(e),r=[...t.values()].filter(o=>o.subject.kind==="element"&&C(o.subject.locator)===n);if(r.length===0)return!1;let i=o=>r.some(s=>s.subject.kind==="element"&&s.subject.state===o&&s.expect.expect==="is"&&s.expect.value===!1);return!i("visible")&&!i("enabled")}function UA(e){return Ro(e.expect).filter(t=>jt(t)).flatMap(t=>im(t)).map(t=>C(t))}function im(e){return e.kind==="not"?im(e.predicate):"locator"in e?[e.locator]:[]}function om(e){return Le(e).flatMap(({test:t})=>WA(t.steps,We(t)))}function WA(e,t){return e.reduce((n,r,i)=>{let o=HA(r),s=zA({acc:n,assertions:o,stepIndex:i,test:t}),a=cn(n.pattern,[r]);return{assertedKeys:GA({acc:n,assertions:o,pattern:a,step:r}),pattern:a,redundant:[...n.redundant,...s]}},{assertedKeys:new Set,pattern:In,redundant:[]}).redundant}function zA({acc:e,assertions:t,stepIndex:n,test:r}){return t.reduce((i,{entry:o,predicate:s})=>{let a=K(o.subject),l=C(o.expect),u=e.pattern.get(a),c=u!=null&&e.assertedKeys.has(a)&&C(u.expect)===l,d=i.seen.get(a)===l;return{flagged:c||d?[...i.flagged,{predicate:s,stepIndex:n,test:r}]:i.flagged,seen:new Map([...i.seen,[a,l]])}},{flagged:[],seen:new Map}).flagged}function GA({acc:e,assertions:t,pattern:n,step:r}){let i=new Set([...KA(r),...ei(r)].map(a=>K(a.subject))),o=[...e.assertedKeys].filter(a=>n.has(a)&&!i.has(a)),s=t.map(({entry:a})=>K(a.subject)).filter(a=>n.has(a));return new Set([...o,...s])}function KA(e){return e.action.kind==="goto"?Qr(e.action.url):[]}function HA(e){return un(e.expect).flatMap(t=>{let n=ht(t);return n==null?[]:[{entry:n,predicate:t}]})}var Q=Xa(lm(),1),De={actual:e=>Q.default.red(e),bad:e=>Q.default.red(Q.default.bold(e)),bold:e=>Q.default.bold(e),dim:e=>Q.default.dim(e),expected:e=>Q.default.green(e),good:e=>Q.default.green(Q.default.bold(e)),heading:e=>Q.default.bold(Q.default.cyan(e)),path:e=>Q.default.cyan(Q.default.underline(e)),warn:e=>Q.default.yellow(Q.default.bold(e))},JA={assertion:Q.default.yellow,consistency:Q.default.magenta,"data rule":Q.default.yellow,driver:Q.default.red,fact:Q.default.yellow,"impossible action":Q.default.cyan,precondition:Q.default.yellow,reachability:Q.default.yellow,redundancy:Q.default.yellow,skipped:Q.default.red};function Fe(e){return`${Q.default.red(Q.default.bold("\u2717"))} ${JA[e](Q.default.bold(e))}`}var XA=Q.default.red("\u2717"),PU=Q.default.green("\u2713"),QA=Q.default.dim("\u203A"),eC=8;function um(e,t,n){let r=n==null?"":` ${De.dim(n)}`;return` ${De.dim(e.padStart(eC))} ${t}${r}`}function fn(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${fn(e.scope)} \u25B8 ${fn(e.target)}`:e.name==null?e.role:`${e.role} "${e.name}"`}function Wt(e){return e.kind==="variable"?`global variable "${e.name}"`:e.kind==="element"?`${e.state} ${fn(e.locator)}`:e.kind==="query"?`url query "${e.key}"`:e.kind==="title"||e.kind==="viewport"?e.kind:`url ${e.kind}`}function ns(e){return e.url!=null?`${e.kind} ${e.url}`:e.locator!=null?`${e.kind} ${fn(e.locator)}`:e.kind}function zt(e){if(e.kind==="not")return`not ${zt(e.inner)}`;if(e.kind==="browser"){let t=Jn(e.key);return e.value===null?`${t} absent`:`${t}="${e.value}"`}return e.kind==="value"||e.kind==="text"?`${e.kind} ${fn(e.locator)}="${e.value}"`:`${e.kind} ${fn(e.locator)}`}function Ln(e){let{field:t,source:n,target:r,targetField:i}=e.reference;return`${n}.${t} \u2192 ${r}.${i}`}function Gt(e){return`${e.intent} \u203A ${ns(e.action)}`}function xu(e){return e.kind==="data-rule"?`data rule ${Ln(e.dataRule)}`:`${e.kind} ${zt(e.check)}`}function we(e){return e==null?"\u2205":JSON.stringify(e)}function vu(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=${we(e.snapshot)} actual=${we(e.sut)}`:e.kind==="expected-change"?`${e.entity}.${e.field} [${e.key}] expected to change but stayed ${we(e.value)}`:`${Wt(e.subject)} expected=${Ru(e.want)} actual=${we(e.sut)}`}function rs(e){return{label:xu(e.source),step:Gt(e.step)}}function is(e){return e.expect==="absent"?"absent":e.expect==="not"?`not ${we(e.value)}`:we(e.value)}function Ru(e){return e.expect==="absent"?"absent":e.expect==="not"?`anything but ${we(e.value)}`:we(e.value)}function tC(e){return e==null?"{ \u2026 }":`{ ${Object.entries(e).map(([n,r])=>`${n}: ${JSON.stringify(r)}`).join(", ")} }`}function os({evidencePath:e,finding:t}){let n=nC(t);return e==null?n:`${n} Evidence: ${De.path(e)}`}function ku(e){return iC(oC(e))}function nC(e){return e.kind==="consistency"?mC(e):e.kind==="pending-check"?bC(e.source,e.step,e.budget):e.kind==="impossible-action"?`${Fe("impossible action")} The step "${e.step.intent}" ran ${ns(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"?`${Fe("skipped")} The planned step "${e.intent}" could not run \u2014 ${dm(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.`:e.kind==="lift-visibility"?`${Fe("reachability")} ${Ot(e.locator)} is already visible at step ${String(e.visibleIndex+1)} but the test doesn't declare it until step ${String(e.declaredIndex+1)}. Lift the visible(...) assertion up to the earlier step so the model learns it's reachable as soon as it is \u2014 a late declaration makes its reachability fact too narrow for the explorer.`:`${Fe("driver")} The browser failed while running "${e.step.intent}" \u2014 ${Pt(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 rC=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function iC(e){return e.replaceAll(rC,"").replaceAll(/\s+/g," ").trim()}function oC(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${vu(e.mismatch)}${t}`}return e.kind==="pending-check"?`${wC(e.source)} failed at "${e.step.intent}": ${xC(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 ${dm(e.reason)}`:e.kind==="lift-visibility"?`visible(${Ot(e.locator)}) declared at step ${String(e.declaredIndex+1)} but already visible at step ${String(e.visibleIndex+1)}`:`driver failed at "${e.step.intent}": ${Pt(e.error)}`}var sC={"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 dm(e){return sC[e]}function fm({debugDir:e,runId:t}){let n=`${e}/${t}`;return um("behavior",De.path(`${n}/behavior.jsonl`),void 0)}function pi(e){return"locator"in e&&e.locator!=null?`${e.kind} ${Ot(e.locator)}`:"url"in e?`${e.kind} ${aC(e.url)}`:e.kind}function aC(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:hm(e)}function pn(e){return e.kind==="not"?`not ${pn(e.predicate)}`:e.kind==="and"?e.predicates.map(t=>pn(t)).join(" \u2227 "):e.kind==="when"?e.branches.map(t=>t.name).join(" | "):lC(e)}function Ot(e){return e.by==="role"?e.name==null?e.role:`${e.role} ${$n(e.name)}`:e.by==="inside"?`${Ot(e.scope)} \u25B8 ${Ot(e.target)}`:$n(e.value)}function pm(e){let t=[...e.scalars.values()].find(n=>n.subject.kind==="path"&&n.expect.expect==="is")?.expect;return t==null||t.expect==="absent"?"(any view)":uC(t.value)}function ss(e){let t=[...e.entities.map(n=>cm(n)),...e.absences.map(n=>`no ${cm(n)}`),...[...e.scalars.values()].filter(n=>n.subject.kind!=="path").map(n=>Eu(n))];return t.length===0?"always":t.join(" \u2227 ")}function Eu(e){let t=cC(e.subject);return e.expect.expect==="absent"?`${t} absent`:e.subject.kind==="element"&&dC(e.expect.value)?e.expect.value?t:`not ${t}`:`${t} ${e.expect.expect==="not"?"\u2260":"="} ${$n(e.expect.value)}`}function lC(e){if("locator"in e){let t=Ot(e.locator);return e.kind==="value"||e.kind==="text"?`${e.kind} ${t}=${$n(e.value)}`:`${e.kind} ${t}`}return e.kind==="browser"?`${e.name}=${$n(e.value)}`:e.kind==="singleton"?`${e.singleton}=${$n(e.assertion.value)}`:e.kind==="count"?`${e.entity} count ${String(e.value)}`:""}function $n(e){return e===null?"\u2205":typeof e=="string"?`"${e}"`:typeof e!="object"?String(e):"ref"in e?`{${e.ref}}`:hm(e)}function hm(e){return e.template.map(t=>typeof t=="string"?t:":id").join("")}function uC(e){return typeof e!="object"||e==null?String(e):"template"in e?e.template.map(t=>typeof t=="string"?t:`{${t.ref}}`).join(""):`{${e.ref}}`}function cC(e){return e.kind==="variable"?e.name:e.kind==="element"?`${e.state} ${Ot(e.locator)}`:e.kind==="query"?`url query "${e.key}"`:e.kind==="title"||e.kind==="viewport"?e.kind:`url ${e.kind}`}function dC(e){return typeof e=="boolean"}function cm(e){let t=Object.entries(e.literals).map(([n,r])=>`${n}=${$n(r)}`);return t.length===0?e.entity:`${e.entity}(${t.join(", ")})`}function ts(e){return e==null?"At the end of the run":`After ${pC(e.action)} in ${e.intent}`}var fC={click:"clicking",fill:"filling",goto:"opening",hover:"hovering over",press:"pressing",select:"selecting",upload:"uploading to"};function pC(e){return e.url!=null?`opening ${e.url}`:e.locator!=null?`${fC[e.kind]??e.kind} ${ur(e.locator)}`:e.kind}function ur(e){return e.by==="testId"?`the element with testId "${e.value}"`:e.by==="inside"?`${ur(e.target)} inside ${ur(e.scope)}`:e.name==null?`the ${e.role}`:`the "${e.name}" ${e.role}`}function hC(e){return e.kind==="not"&&e.inner.kind==="visible"?`${ur(e.inner.locator)} never disappeared`:e.kind==="visible"?`${ur(e.locator)} never appeared`:e.kind==="value"||e.kind==="text"?`${ur(e.locator)} never showed "${e.value}"`:`the check ${zt(e)} never held`}function mC(e){let t=e.pending?yC(e):gC(e.mismatch,e.step);return`${Fe("consistency")} ${t}`}function yC(e){let t=`${mm(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=ts(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 ${De.actual(we(r.sut))} instead of ${De.expected(we(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 ${De.actual(we(r.value))} through the ${t}, so the write may not have landed at all. ${n}`:`${i}, ${Wt(r.subject)} never changed within the ${t} \u2014 it still showed ${De.actual(we(r.sut))} instead of ${De.expected(Ru(r.want))}, so the change may not have landed. ${n}`}function mm(e){return`${String(Mt[e]/1e3)}s`}function gC(e,t){let n=ts(t);return e.kind==="wrong-value"?`${n}, ${e.entity}.${e.field} on row "${e.key}" showed ${De.actual(we(e.sut))} but the test expected ${De.expected(we(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==="scalar-mismatch"?`${n}, ${Wt(e.subject)} showed ${De.actual(we(e.sut))} but the test expected ${De.expected(Ru(e.want))}. 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 if the app creating this row is expected behavior, declare it on the acting step with ${e.entity}.created(${tC(e.row)}), 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 ${De.actual(we(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 bC(e,t,n){let r=`${mm(n)} wait window`;if(e.kind==="data-rule")return`${Fe("data rule")} ${ts(t)}, the data rule ${Ln(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.`;if(e.kind==="fact")return`${Fe("fact")} A fact learned from ${SC(e.origin)} says ${zt(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.`;let i=`${Fe("assertion")} ${ts(t)}, ${hC(e.check)} within the ${r}.`;return t.action.locator!=null?`${i} If the page never changed after this action \u2014 the recording goes quiet right after it \u2014 the interaction was likely lost: its target re-rendered or unmounted as it fired, so the click landed on nothing. That is an unstable-render bug in the app, not a missing element. Otherwise it is a wrong accessible name, a UI regression, or a starting state this page doesn't have. Confirm in behavior.jsonl before changing the test.`:`${i} 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 SC(e){return e==null?"another workflow":e.kind==="test"?`an assertion in test "${e.test}"`:`tests ${e.tests.map(n=>JSON.stringify(n)).join(", ")}`}function wC(e){return e.kind==="data-rule"?"data rule":e.kind==="fact"?"fact":"assertion"}function xC(e){return e.kind==="data-rule"?Ln(e.dataRule):zt(e.check)}function ym(e){switch(e.kind){case"cascade-gap":{let{gap:t}=e;return`${Fe("data rule")} ${t.transition} deletes ${t.target} but leaves ${t.source} rows pointing at the deleted row. That breaks the data rule ${Ln(t.dataRule)} \u2014 cascade the delete in the app or declare the cleanup on the deleting step.`}case"create-gap":return vC(e.gap);case"unreachable-interaction":{let{violation:t}=e;return t.ephemeralOnly?`${Fe("reachability")} ${t.test}: ${pi(t.action)}, but ${Ot(t.target)} was only declared inside ephemeral(...). Ephemeral checks are transient and grant no reachability \u2014 assert a durable visible(...) on it before interacting.`:`${Fe("reachability")} ${t.test}: ${pi(t.action)}, but no prior step declared ${Ot(t.target)} reachable. Assert visible(...) (or any state) on it first \u2014 an element isn't interactable until its presence is declared.`}case"redundant-assertion":{let{redundancy:t}=e;return`${Fe("redundancy")} ${t.test}: step ${String(t.stepIndex+1)} restates "${pn(t.predicate)}" \u2014 a prior step already asserted it and nothing changed it since. Delete the restatement, an assertion must state new information.`}case"missing-precondition":{let{missing:t}=e;return`${Fe("precondition")} ${t.test}: step ${String(t.stepIndex+1)} updates ${t.entity}.${t.field} but the world never states what it was before. Seed it explicitly \u2014 a value, arbitrary(...), or null \u2014 so the flow only runs where its starting state actually holds.`}case"fact-conflict":{let{conflict:t}=e;return`${Fe("fact")} Two facts contradict each other \u2014 "${pn(t.a)}" vs "${pn(t.b)}" when ${ss(t.when)}. 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 vC(e){let t=e.missing.length===1?"field":"fields",n=e.missing.length===1?"it":"them";return`${Fe("data rule")} ${e.transition} creates ${e.entity} without setting the required ${t} ${e.missing.join(", ")}. Set ${n} on the creating step or drop the requirement from the entity.`}function gm(e){let t;return n=>{if(t!==void 0&&t.input===n)return t.output;let r=e(n);return t={input:n,output:r},r}}var cr=gm(e=>({dataRules:No(e),facts:si(e)}));var bm=Object.defineProperty,Sm=(e,t)=>{let n={};for(var r in e)bm(n,r,{get:e[r],enumerable:!0});return t||bm(n,Symbol.toStringTag,{value:"Module"}),n};var RC=class wm{constructor(t){this.seed=t}clone(){return new wm(this.seed)}next(){let t=Au(this.seed),n=Cu(t),r=Au(t),i=Cu(r);return this.seed=Au(r),Cu(this.seed)+(i+(n<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function Au(e){return Math.imul(e,214013)+2531011&4294967295}function Cu(e){return(e&-2147483649)>>16}function xm(e){return new RC(e)}var kC="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",EC=class Rm{constructor(t,n){this.states=t,this.index=n}clone(){return new Rm(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=as(this.states,this.index),t}getState(){return[this.index,...this.states]}jump(){let t=this.states.slice(),n=this.index;this.index=as(this.states,this.index);for(let r=19932;r>0;--r)kC.charCodeAt(r/6|0)-48&1<<r%6&&vm(this.states,this.index,t,n),this.index=as(this.states,this.index);vm(this.states,this.index,t,n)}};function vm(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 as(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 AC(e){for(let t=0;t!==624;++t)as(e,t)}function km(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 AC(t),new EC(t,0)}var CC=class Em{constructor(t,n,r,i){this.s01=t,this.s00=n,this.s11=r,this.s10=i}clone(){return new Em(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 Pu(e){return new CC(-1,~e,e|0,0)}var PC=class Am{constructor(t,n,r,i){this.s01=t,this.s00=n,this.s11=r,this.s10=i}clone(){return new Am(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 Cm(e){return new PC(-1,~e,e|0,0)}function Pm(e,t){for(let n=0;n!==t;++n)e.next()}var Im=BigInt,IC=4294967296n;function Tm(e,t,n){let r=n-t+1n,i=IC,o=1;for(;i<r;)i<<=32n,++o;let s=Mm(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=Mm(o,e);return s%r+t}function Mm(e,t){let n=Im(t.next()+2147483648);for(let r=1;r<e;++r){let i=t.next();n=(n<<32n)+Im(i+2147483648)}return n}function hi(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 Iu(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 MC(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 h=r+s,y=i+a+(h>4294967295?1:0);return e.data[0]=y>>>0,e.data[1]=h>>>0,e}let u=r,c=i,d=s,p=a;o===-1&&(u=s,c=a,d=r,p=i);let m=0,f=u-d;return f<0&&(m=1,f=f>>>0),e.data[0]=c-p-m,e.data[1]=f,e}function TC(e,t,n){let r=n[0]+1;for(t[0]=hi(e,r),t[1]=hi(e,4294967296);t[0]>=n[0]&&(t[0]!==n[0]||t[1]>=n[1]);)t[0]=hi(e,r),t[1]=hi(e,4294967296);return t}var OC=Number.MAX_SAFE_INTEGER,NC={sign:1,data:[0,0]},$C={sign:1,data:[0,0]},Om={sign:1,data:[0,0]},Mu=[0,0];function LC(e,t,n,r){let i=r<=OC?Iu(Om,r):MC(Om,Iu(NC,n),Iu($C,t));return i.data[1]===4294967295?(i.data[0]+=1,i.data[1]=0):i.data[1]+=1,TC(e,Mu,i.data),Mu[0]*4294967296+Mu[1]+t}function ls(e,t,n){let r=n-t;return r<=4294967295?hi(e,r+1)+t:LC(e,t,n,r)}var Nm=Symbol.for("fast-check/PreconditionFailure"),wn=class extends Error{constructor(e=!1){super(),this.interruptExecution=e,this.footprint=Nm}static isFailure(e){return e!=null&&e.footprint===Nm}};function DC(e){if(!e)throw new wn}var FC=class{[Symbol.iterator](){return this}next(e){return{value:e,done:!0}}},_C=new FC;function jC(){return _C}function*BC(e,t){for(let n of e)yield t(n)}function*VC(e,t){for(let n of e)yield*t(n)}function*UC(e,t){for(let n of e)t(n)&&(yield n)}function*WC(e,t){for(let n=0;n<t;++n){let r=e.next();if(r.done)break;yield r.value}}function*zC(e,t){let n=e.next();for(;!n.done&&t(n.value);)yield n.value,n=e.next()}function*GC(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 KC=Symbol.iterator,_=class Kt{static nil(){return new Kt(jC())}static of(...t){return new Kt(t[KC]())}constructor(t){this.g=t}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(t){return new Kt(BC(this.g,t))}flatMap(t){return new Kt(VC(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 Kt(zC(this.g,t))}take(t){return new Kt(WC(this.g,t))}filter(t){return new Kt(UC(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 Kt(GC(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 bn(e){return new _(e)}var Te=Symbol.for("fast-check/cloneMethod");function Fn(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Te in e&&typeof e[Te]=="function"}function mr(e){return Fn(e)?e[Te]():e}var HC=Object.defineProperty,O=class{constructor(e,t,n){this.value_=e,this.context=t,this.hasToBeCloned=n!==void 0||Fn(e),this.readOnce=!1,this.value=e,this.hasToBeCloned&&HC(this,"value",{get:n!==void 0?n:this.getValue,enumerable:!1,configurable:!1})}getValue(){return this.hasToBeCloned?this.readOnce?this.value_[Te]():(this.readOnce=!0,this.value_):this.value_}},de=class{filter(e){return new ZC(this,e)}map(e,t){return new YC(this,e,t)}chain(e){return new qC(this,e)}},qC=class extends de{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?_.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)})):_.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}},YC=class extends de{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 _.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)&&!Fn(n)&&Object.defineProperty(n,Te,{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}},ZC=class extends de{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 Ng(e){return typeof e=="object"&&e!==null&&"generate"in e&&"shrink"in e&&"canShrinkWithoutContext"in e}function $g(e){if(!Ng(e))throw new Error("Unexpected value received: not an instance of Arbitrary")}var Lg=Function.prototype.apply,Tu=Symbol("apply");function JC(e){try{return e.apply}catch{return}}function XC(e,t,n){let r=e;r[Tu]=Lg;let i=r[Tu](t,n);return delete r[Tu],i}function H(e,t,n){return JC(e)===Lg?e.apply(t,n):XC(e,t,n)}var Dg=Array,P=BigInt,QC=BigInt64Array,eP=BigUint64Array,Fg=Boolean,Rs=Date,I=Error,_g=Float32Array,jg=Float64Array,tP=Int8Array,nP=Int16Array,rP=Int32Array,qt=Number,ze=String,yr=Set,iP=Uint8Array,oP=Uint8ClampedArray,sP=Uint16Array,aP=Uint32Array,lP=encodeURIComponent,Yt=Map,ys=Symbol,$m=Array.prototype.forEach,Lm=Array.prototype.indexOf,Dm=Array.prototype.join,Fm=Array.prototype.map,_m=Array.prototype.flat,jm=Array.prototype.filter,Bm=Array.prototype.push,Vm=Array.prototype.pop,Um=Array.prototype.splice,Wm=Array.prototype.slice,zm=Array.prototype.sort,Gm=Array.prototype.every;function uP(e){try{return e.forEach}catch{return}}function cP(e){try{return e.indexOf}catch{return}}function dP(e){try{return e.join}catch{return}}function fP(e){try{return e.map}catch{return}}function pP(e){try{return e.flat}catch{return}}function hP(e){try{return e.filter}catch{return}}function mP(e){try{return e.push}catch{return}}function yP(e){try{return e.pop}catch{return}}function gP(e){try{return e.splice}catch{return}}function bP(e){try{return e.slice}catch{return}}function SP(e){try{return e.sort}catch{return}}function wP(e){try{return e.every}catch{return}}function Bg(e,t){return uP(e)===$m?e.forEach(t):H($m,e,[t])}function Ht(e,...t){return cP(e)===Lm?e.indexOf(...t):H(Lm,e,t)}function ce(e,...t){return dP(e)===Dm?e.join(...t):H(Dm,e,t)}function U(e,t){return fP(e)===Fm?e.map(t):H(Fm,e,[t])}function xP(e,t){return pP(e)===_m?([].flat(),e.flat(t)):H(_m,e,[t])}function vP(e,t){return hP(e)===jm?e.filter(t):H(jm,e,[t])}function T(e,...t){return mP(e)===Bm?e.push(...t):H(Bm,e,t)}function Vg(e){return yP(e)===Vm?e.pop():H(Vm,e,[])}function Ug(e,...t){return gP(e)===Um?e.splice(...t):H(Um,e,t)}function Ne(e,...t){return bP(e)===Wm?e.slice(...t):H(Wm,e,t)}function Wg(e,...t){return SP(e)===zm?e.sort(...t):H(zm,e,t)}function zg(e,...t){return wP(e)===Gm?e.every(...t):H(Gm,e,t)}var Km=Date.prototype.getTime,Hm=Date.prototype.toISOString;function RP(e){try{return e.getTime}catch{return}}function kP(e){try{return e.toISOString}catch{return}}function ks(e){return RP(e)===Km?e.getTime():H(Km,e,[])}function EP(e){return kP(e)===Hm?e.toISOString():H(Hm,e,[])}var qm=Set.prototype.add,Ym=Set.prototype.has;function AP(e){try{return e.add}catch{return}}function CP(e){try{return e.has}catch{return}}function Si(e,t){return AP(e)===qm?e.add(t):H(qm,e,[t])}function Es(e,t){return CP(e)===Ym?e.has(t):H(Ym,e,[t])}var Zm=WeakMap.prototype.set,Jm=WeakMap.prototype.get;function PP(e){try{return e.set}catch{return}}function IP(e){try{return e.get}catch{return}}function MP(e,t,n){return PP(e)===Zm?e.set(t,n):H(Zm,e,[t,n])}function TP(e,t){return IP(e)===Jm?e.get(t):H(Jm,e,[t])}var Xm=Map.prototype.set,Qm=Map.prototype.get,ey=Map.prototype.has;function OP(e){try{return e.set}catch{return}}function NP(e){try{return e.get}catch{return}}function $P(e){try{return e.has}catch{return}}function yt(e,t,n){return OP(e)===Xm?e.set(t,n):H(Xm,e,[t,n])}function st(e,t){return NP(e)===Qm?e.get(t):H(Qm,e,[t])}function LP(e,t){return $P(e)===ey?e.has(t):H(ey,e,[t])}var ty=String.prototype.split,ny=String.prototype.startsWith,ry=String.prototype.endsWith,iy=String.prototype.substring,oy=String.prototype.toLowerCase,sy=String.prototype.toUpperCase,ay=String.prototype.padStart,ly=String.prototype.charCodeAt,uy=String.prototype.normalize,cy=String.prototype.replace;function DP(e){try{return e.split}catch{return}}function FP(e){try{return e.startsWith}catch{return}}function _P(e){try{return e.endsWith}catch{return}}function jP(e){try{return e.substring}catch{return}}function BP(e){try{return e.toLowerCase}catch{return}}function VP(e){try{return e.toUpperCase}catch{return}}function UP(e){try{return e.padStart}catch{return}}function WP(e){try{return e.charCodeAt}catch{return}}function zP(e){try{return e.normalize}catch{return}}function GP(e){try{return e.replace}catch{return}}function Ge(e,...t){return DP(e)===ty?e.split(...t):H(ty,e,t)}function KP(e,...t){return FP(e)===ny?e.startsWith(...t):H(ny,e,t)}function HP(e,...t){return _P(e)===ry?e.endsWith(...t):H(ry,e,t)}function ge(e,...t){return jP(e)===iy?e.substring(...t):H(iy,e,t)}function nc(e){return BP(e)===oy?e.toLowerCase():H(oy,e,[])}function Pc(e){return VP(e)===sy?e.toUpperCase():H(sy,e,[])}function qP(e,...t){return UP(e)===ay?e.padStart(...t):H(ay,e,t)}function gr(e,t){return WP(e)===ly?e.charCodeAt(t):H(ly,e,[t])}function YP(e,t){return zP(e)===uy?e.normalize(t):H(uy,e,[t])}function ZP(e,t,n){return GP(e)===cy?e.replace(t,n):H(cy,e,[t,n])}var dy=Number.prototype.toString;function JP(e){try{return e.toString}catch{return}}function wi(e,...t){return JP(e)===dy?e.toString(...t):H(dy,e,t)}var XP=Object.prototype.hasOwnProperty,QP=Object.prototype.toString;function Gg(e,t){return H(XP,e,[t])}function rc(e){return H(QP,e,[])}var eI=Error.prototype.toString;function tI(e){return H(eI,e,[])}var nI=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 gn(e){return new nI(e)}var Kg=Array.isArray,rI=Object.defineProperty;function Hg(e,t){return rI(e,Te,{value:()=>{let n=[];for(let r=0;r!==t.length;++r)T(n,t[r].value);return Hg(n,t),n}})}function qg(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&&Hg(n,e),new O(n,r)}function Yg(e,t,n){let r=[],i=Kg(n)?n:[];for(let o=0;o!==e.length;++o)T(r,gn(()=>e[o].shrink(t[o],i[o]).map(s=>{let a=U(t,(l,u)=>new O(mr(l),i[u]));return[...Ne(a,0,o),s,...Ne(a,o+1)]}).map(qg)));return _.nil().join(...r)}var iI=class extends de{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 qg(n)}canShrinkWithoutContext(e){if(!Kg(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 Yg(this.arbs,e,t)}};function j(...e){return new iI(e)}var oI=Math.log;function Zg(e){return 2+~~(oI(e+1)*.4342944819032518)}var Ic={};function sI(e){Ic=e}function gt(){return Ic}function aI(){Ic={}}var xi=Symbol("UndefinedContextPlaceholder");function br(e){return e.context!==void 0?e:e.hasToBeCloned?new O(e.value_,xi,()=>e.value):new O(e.value_,xi)}var fy=()=>{},lI=class{constructor(e,t){this.arb=e,this.predicate=t;let{asyncBeforeEach:n,asyncAfterEach:r,beforeEach:i,afterEach:o}=gt()||{};if(n!==void 0&&i!==void 0)throw I(`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 I(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=n||i||fy,this.afterEachHook=r||o||fy}isAsync(){return!0}generate(e,t){return br(this.arb.generate(e,t!==void 0?Zg(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return _.nil();let t=e.context!==xi?e.context:void 0;return this.arb.shrink(e.value_,t).map(br)}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 I("Property failed by returning false")}}catch(t){return wn.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}},Jg=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return br(this.arb.generate(e,t))}canShrinkWithoutContext(e){return!0}shrink(e,t){if(t===void 0&&!this.arb.canShrinkWithoutContext(e))return _.nil();let n=t!==xi?t:void 0;return this.arb.shrink(e,n).map(br)}};function uI(...e){if(e.length<2)throw new Error("asyncProperty expects at least two parameters");let t=Ne(e,0,e.length-1),n=e[e.length-1];return Bg(t,$g),new lI(j(...U(t,r=>new Jg(r))),r=>n(...r))}var py=()=>{},Xg=class{constructor(e,t){this.arb=e,this.predicate=t;let{beforeEach:n=py,afterEach:r=py,asyncBeforeEach:i,asyncAfterEach:o}=gt()||{};if(i!==void 0)throw I(`"asyncBeforeEach" can't be set when running synchronous properties`);if(o!==void 0)throw I(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=n,this.afterEachHook=r}isAsync(){return!1}generate(e,t){return br(this.arb.generate(e,t!==void 0?Zg(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return _.nil();let t=e.context!==xi?e.context:void 0;return this.arb.shrink(e.value_,t).map(br)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(e){try{let t=this.predicate(e);return t===void 0||t===!0?null:{error:new I("Property failed by returning false")}}catch(t){return wn.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 cI(...e){if(e.length<2)throw new Error("property expects at least two parameters");let t=Ne(e,0,e.length-1),n=e[e.length-1];return Bg(t,$g),new Xg(j(...U(t,r=>new Jg(r))),r=>n(...r))}var dI=(function(e){return e[e.None=0]="None",e[e.Verbose=1]="Verbose",e[e.VeryVerbose=2]="VeryVerbose",e})({});function ic(e){return"unsafeNext"in e?e.unsafeJump===void 0?{clone:()=>ic(e),next:()=>e.unsafeNext(),getState:()=>e.getState()}:{clone:()=>ic(e),next:()=>e.unsafeNext(),jump:()=>e.unsafeJump(),getState:()=>e.getState()}:e}function Qg(e){return"jump"in e&&typeof e.jump=="function"?e:{clone:()=>Qg(e),next:()=>e.next(),jump:()=>Pm(e,42),getState:()=>e.getState()}}function Is(e){return Qg(ic(e))}var fI=Date.now,pI=Math.min,hI=Math.random,mI=class{constructor(e){let t=e||{};this.seed=yI(t),this.randomType=gI(t),this.numRuns=bI(t),this.verbose=SI(t),this.maxSkipsPerRun=t.maxSkipsPerRun!==void 0?t.maxSkipsPerRun:100,this.timeout=Nu(t.timeout),this.skipAllAfterTimeLimit=Nu(t.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=Nu(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 Ou(e){return t=>Is(e(t))}function yI(e){if(e.seed===void 0)return fI()^hI()*4294967296;let t=e.seed|0;return e.seed===t?t:t^(e.seed-t)*4294967296}function gI(e){if(e.randomType===void 0)return Pu;if(typeof e.randomType=="string")switch(e.randomType){case"mersenne":return Ou(km);case"congruential":case"congruential32":return Ou(xm);case"xorshift128plus":return Pu;case"xoroshiro128plus":return Cm;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===Is(t)?e.randomType:Ou(e.randomType)}function bI(e){return e.numRuns!==void 0?e.numRuns:e.num_runs!==void 0?e.num_runs:100}function SI(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 Nu(e){if(e!==void 0)return pI(e,2147483647)}function Mc(e){return new mI(e)}function wI(e,t,n){let r=null;return{clear:()=>n(r),promise:new Promise(i=>{r=t(()=>{i(new wn(!0))},e)})}}var hy=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 wn(this.interruptExecution);return this.isAsync()?Promise.resolve(n):n}if(this.interruptExecution&&this.isAsync()){let n=wI(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()}},xI=(e,t,n)=>{let r=null;return{clear:()=>n(r),promise:new Promise(i=>{r=t(()=>{i({error:new I(`Property timeout: exceeded limit of ${e} milliseconds`)})},e)})}},vI=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=xI(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())}},eb=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()}},my=Array.from,yy=typeof Buffer<"u"?Buffer.isBuffer:void 0,dr=JSON.stringify,gy=Number.isNaN,RI=Object.keys,kI=Object.getOwnPropertySymbols,EI=Object.getOwnPropertyDescriptor,by=Object.getPrototypeOf,Sy=Number.NEGATIVE_INFINITY,AI=Number.POSITIVE_INFINITY,bt=Symbol.for("fast-check/toStringMethod");function Tc(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&bt in e&&typeof e[bt]=="function"}var Zt=Symbol.for("fast-check/asyncToStringMethod");function Oc(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Zt in e&&typeof e[Zt]=="function"}var CI=/^Symbol\((.*)\)$/;function PI(e){if(e.description!==void 0)return e.description;let t=CI.exec(ze(e));return t&&t[1].length?t[1]:null}function wy(e){switch(e){case 0:return 1/e===Sy?"-0":"0";case Sy:return"Number.NEGATIVE_INFINITY";case AI:return"Number.POSITIVE_INFINITY";default:return e===e?ze(e):"Number.NaN"}}function II(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 ot(e,t,n){let r=[...t,e];if(typeof e=="object"&&Ht(t,e)!==-1)return"[cyclic]";if(Oc(e)){let i=n(e);if(i.state==="fulfilled")return i.value}if(Tc(e))try{return e[bt]()}catch{}switch(rc(e)){case"[object Array]":{let i=e;if(i.length>=50&&II(i)){let s=[];for(let a in i)gy(Number(a))||T(s,`${a}:${ot(i[a],r,n)}`);return s.length!==0?`Object.assign(Array(${i.length}),{${ce(s,",")}})`:`Array(${i.length})`}let o=ce(U(i,s=>ot(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 gy(ks(i))?"new Date(NaN)":`new Date(${dr(EP(i))})`}case"[object Map]":return`new Map(${ot(Array.from(e),r,n)})`;case"[object Null]":return"null";case"[object Number]":return typeof e=="number"?wy(e):`new Number(${wy(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"?`[${ot(o,r,n)}]`:dr(o)}:${ot(e[o],r,n)}`;return"{"+ce([...by(e)===null?["__proto__:null"]:[],...U(RI(e),i),...U(vP(kI(e),o=>{let s=EI(e,o);return s&&s.enumerable}),i)],",")+"}"}case"[object Set]":return`new Set(${ot(Array.from(e),r,n)})`;case"[object String]":return typeof e=="string"?dr(e):`new String(${dr(e)})`;case"[object Symbol]":{let i=e;if(ys.keyFor(i)!==void 0)return`Symbol.for(${dr(ys.keyFor(i))})`;let o=PI(i);return o===null?"Symbol()":i===(o.startsWith("Symbol.")&&ys[o.substring(7)])?o:`Symbol(${dr(o)})`}case"[object Promise]":{let i=n(e);switch(i.state){case"fulfilled":return`Promise.resolve(${ot(i.value,r,n)})`;case"rejected":return`Promise.reject(${ot(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(${ot(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 yy=="function"&&yy(e))return`Buffer.from(${e.buffer.detached?"/*detached ArrayBuffer*/":ot(my(e.values()),r,n)})`;let i=by(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(${ot(my(s.values()),r,n)})`}break}}try{return e.toString()}catch{return rc(e)}}function ke(e){return ot(e,[],()=>({state:"unknown",value:void 0}))}function tb(e){let t=ys(),n=[],r=new Yt;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(),p=Zt in u?Promise.resolve().then(()=>u[Zt]()):u;return p.catch(()=>{}),n.push(Promise.race([p,d.delay]).then(m=>{m===t?r.set(c,{state:"pending",value:void 0}):r.set(c,{state:"fulfilled",value:m}),d.cancel()},m=>{r.set(c,{state:"rejected",value:m}),d.cancel()})),r.set(c,o),o};function a(){let l=ot(e,[],s);return n.length===0?l:Promise.all(n.splice(0)).then(a)}return a()}async function Nc(e){return Promise.resolve(tb(e))}function xy(e){return e===null?new wn:e}function MI(...e){return e[1]?e[0].then(xy):xy(e[0])}function TI(e,t){return MI(e,t)}var vy=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=ke(e);if(this.coveredCases.has(t)){let r=this.coveredCases.get(t);return this.skipRuns?TI(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()}},Ry=Date.now,$u=setTimeout,Lu=clearTimeout;function OI(e,t){let n=e;return e.isAsync()&&t.timeout!==void 0&&(n=new vI(n,t.timeout,$u,Lu)),t.unbiased&&(n=new eb(n)),t.skipAllAfterTimeLimit!==void 0&&(n=new hy(n,Ry,t.skipAllAfterTimeLimit,!1,$u,Lu)),t.interruptAfterTimeLimit!==void 0&&(n=new hy(n,Ry,t.interruptAfterTimeLimit,!0,$u,Lu)),t.skipEqualValues&&(n=new vy(n,!0)),t.ignoreEqualValues&&(n=new vy(n,!1)),n}var NI=(function(e){return e[e.Success=0]="Success",e[e.Skipped=-1]="Skipped",e[e.Failure=1]="Failure",e})({}),$I=class nb{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?+Ge(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?Ge(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:nb.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()}}},rb=class{constructor(e,t,n,r){this.sourceValues=e,this.shrink=t,this.runExecution=new $I(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"&&!wn.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_)}},LI=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}},DI=-2147483648,FI=2147483647,_I=Math.pow(2,27),jI=Math.pow(2,-53),$c=class ib{constructor(t){this.internalRng=Is(t.clone())}clone(){return new ib(this.internalRng)}next(t){return ls(this.internalRng,0,(1<<t)-1)}nextBoolean(){return ls(this.internalRng,0,1)===1}nextInt(t,n){return ls(this.internalRng,t===void 0?DI:t,n===void 0?FI:n)}nextBigInt(t,n){return Tm(this.internalRng,t,n)}nextDouble(){let t=this.next(26),n=this.next(27);return(t*_I+n)*jI}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState=="function")return this.internalRng.getState()}};function BI(e,t,n){return t.jump(),e.generate(new $c(t),n)}function*ob(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 BI(e,o,i)}function VI(e,t,n){return()=>e.generate(new $c(t),n)}function*sb(e,t,n,r){yield*U(r,s=>()=>new O(s,void 0));let i=0,o=Is(n(t));for(;;)o.jump(),yield VI(e,o,i++)}function ky(e){return e()}function ab(e,t,n){let r=t,i=e.split(":").map(s=>+s);if(i.length===0)return r.map(ky);if(!i.every(s=>!Number.isNaN(s)))throw new Error(`Unable to replay, got invalid path=${e}`);let o=r.drop(i[0]).map(ky);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 UI=Object.assign;function WI(e){return e.length===1?`Hint: ${e[0]}`:e.map((t,n)=>`Hint (${n+1}): ${t}`).join(`
|
|
21
|
+
`)}function zI(e,t){return`Encountered failures were:
|
|
22
22
|
- ${e.map(t).join(`
|
|
23
23
|
- `)}`}function Lc(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:
|
|
24
24
|
${n.join(`
|
|
25
|
-
`)}`}function
|
|
25
|
+
`)}`}function GI(e,t){let n=`Failed to run property, too many pre-condition failures encountered
|
|
26
26
|
{ seed: ${e.seed} }
|
|
27
27
|
|
|
28
28
|
Ran ${e.numRuns} time(s)
|
|
29
|
-
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=Lc(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
|
|
30
|
-
Got ${
|
|
29
|
+
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=Lc(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 KI(e){if(e instanceof I&&e.stack!==void 0)return e.stack;try{return ze(e)}catch{}if(e instanceof I)try{return tI(e)}catch{}if(e!==null&&typeof e=="object")try{return rc(e)}catch{}return"Failed to serialize errorInstance"}function HI(e,t){let n=e.runConfiguration.includeErrorInReport?`
|
|
30
|
+
Got ${ZP(KI(e.errorInstance),/^Error: /,"error: ")}`:"",r=`Property failed after ${e.numRuns} tests
|
|
31
31
|
{ seed: ${e.seed}, path: "${e.counterexamplePath}", endOnFailure: true }
|
|
32
32
|
Counterexample: ${t(e.counterexample)}
|
|
33
|
-
Shrunk ${e.numShrinks} time(s)${n}`,i=null,o=[];return e.verbose>=2?i=Lc(e.executionSummary,t):e.verbose===1?i=
|
|
34
|
-
{ seed: ${e.seed} }`,r=null,i=[];return e.verbose>=2?r=Lc(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 oc(e,t){if(!e.failed)return;let{message:n,details:r,hints:i}=e.counterexamplePath===null?e.interrupted?
|
|
33
|
+
Shrunk ${e.numShrinks} time(s)${n}`,i=null,o=[];return e.verbose>=2?i=Lc(e.executionSummary,t):e.verbose===1?i=zI(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 qI(e,t){let n=`Property interrupted after ${e.numRuns} tests
|
|
34
|
+
{ seed: ${e.seed} }`,r=null,i=[];return e.verbose>=2?r=Lc(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 oc(e,t){if(!e.failed)return;let{message:n,details:r,hints:i}=e.counterexamplePath===null?e.interrupted?qI(e,t):GI(e,t):HI(e,t),o=n;return r!==null&&(o+=`
|
|
35
35
|
|
|
36
36
|
${r}`),i.length>0&&(o+=`
|
|
37
37
|
|
|
38
|
-
${zI(i)}`),o}function lb(e){return oc(e,ke)}async function ub(e){let t=[];function n(s){let a=tb(s);return typeof a=="string"?a:(t.push(Promise.all([s,a])),"\u2026")}let r=oc(e,n);if(t.length===0)return r;let i=new Yt(await Promise.all(t));function o(s){let a=st(i,s);return a!==void 0?a:ke(s)}return oc(e,o)}function cb(e,t){if(t.runConfiguration.includeErrorInReport)throw new I(e);let n=new I(e,{cause:t.errorInstance});return"cause"in n||WI(n,{cause:t.errorInstance}),n}function ZI(e){if(e.failed)throw cb(lb(e),e)}async function JI(e){if(e.failed)throw cb(await ub(e),e)}function XI(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):ZI(e)}async function QI(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):JI(e)}function eM(e,t,n,r,i){let o=new rb(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 tM(e,t,n,r,i){let o=new rb(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 db(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=Mc({...gt(),...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=NI(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 DI(n.path.length===0?ob(r,n.seed,n.randomType,n.examples):ab(n.path,bn(sb(r,n.seed,n.randomType,n.examples)),s),i,o),l=n.endOnFailure?_.nil:s;return r.isAsync()?tM(r,l,a,n.verbose,n.markInterruptAsFailure).then(u=>u.toRunDetails(n.seed,n.path,o,n)):eM(r,l,a,n.verbose,n.markInterruptAsFailure).toRunDetails(n.seed,n.path,o,n)}function nM(e,t){let n=db(e,t);if(e.isAsync())return n.then(QI);XI(n)}function rM(e,t){let n=Object.prototype.hasOwnProperty.call(e,"isAsync")?e:new Xg(e,()=>!0);return t.unbiased===!0?new eb(n):n}function fb(e,t){let n=Mc(typeof t=="number"?{...gt(),numRuns:t}:{...gt(),...t}),r=rM(e,n),i=r.shrink.bind(r);return(n.path.length===0?bn(ob(r,n.seed,n.randomType,n.examples)):ab(n.path,bn(sb(r,n.seed,n.randomType,n.examples)),i)).take(n.numRuns).map(o=>o.value_)}function iM(e,t){return[...fb(e,t)]}function oM(e){return(Math.round(e*100)/100).toFixed(2)}function sM(e,t,n){let r=Mc(typeof n=="number"?{...gt(),numRuns:n}:{...gt(),...n}),i={};for(let l of fb(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],`${oM(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 aM=Object.assign;function sc(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 p=c.value;return T(s.history,{arb:u,value:p,context:c.context,mrng:c.mrng}),o=c.mrng.clone(),p}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(aM(l,{values(){return U(s.history,u=>u.value)},[Te](){return sc(e,t,n,r).value},[bt](){return ke(U(s.history,u=>u.value))}}),s)}var Du=Array.isArray,Ey=Object.keys,lM=Object.is;function uM(e){let t=new Yt;return function(r,i){let o=st(t,r);if(o===void 0){let l=r(...i);return yt(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 pb(e,t){if(e!==null&&typeof e=="object"&&t!==null&&typeof t=="object"){if(Du(e)){if(!Du(t)||e.length!==t.length)return!1}else if(Du(t))return!1;if(Ey(e).length!==Ey(t).length)return!1;for(let n in e)if(!(n in t)||!pb(e[n],t[n]))return!1;return!0}else return lM(e,t)}var cM=class extends de{constructor(...e){super(...e),this.arbitraryCache=uM(pb)}generate(e,t){return sc(e,t,()=>[],this.arbitraryCache)}canShrinkWithoutContext(e){return!1}shrink(e,t){if(t===void 0)return _.nil();let n=t,r=n.mrng,i=n.biasFactor,o=n.history;return Yg(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 U(o,(c,d)=>({arb:c.arb,value:l[d],context:u[d],mrng:c.mrng}))}return sc(r,i,a,this.arbitraryCache)})}};function dM(){return new cM}var fM=Math.floor,Ay=Math.log;function pM(e){return fM(Ay(e)/Ay(2))}function hM(e){return e===P(0)?P(0):P(ze(e).length)}function hb(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 mM=Math.ceil,yM=Math.floor;function Cy(e){return yM(e/2)}function Py(e){return mM(e/2)}function Iy(e,t,n){let r=e-t;function*i(){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}}function*o(){let s=n?void 0:t,a=n?r:Py(r);for(let l=a;l<0;l=Py(l)){let u=l===r?t:e-l;yield new O(u,s),s=u}}return r>0?bn(i()):bn(o())}var My=Math.sign,gM=Number.isInteger,bM=Object.is,Sr=class mb extends de{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"&&gM(t)&&!bM(t,-0)&&this.min<=t&&t<=this.max}shrink(t,n){return mb.isValidContext(t,n)?this.isLastChanceTry(t,n)?_.of(new O(n,void 0)):Iy(t,n,!1):Iy(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=hb(this.min,this.max,pM);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&&My(t)!==My(n))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},Ty=Number.isInteger;function SM(e){return{min:e.min!==void 0?e.min:-2147483648,max:e.max!==void 0?e.max:2147483647}}function te(e={}){let t=SM(e);if(t.min>t.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!Ty(t.min))throw new Error("fc.integer minimum value should be an integer");if(!Ty(t.max))throw new Error("fc.integer maximum value should be an integer");return new Sr(t.min,t.max)}var Oy=new Map;function Dc(e){if(e===void 0)return{depth:0};if(typeof e!="string")return e;let t=st(Oy,e);if(t!==void 0)return t;let n={depth:0};return yt(Oy,e,n),n}function Fc(){return{depth:0}}var wM=class{constructor(e,t,n){this.arb=e,this.mrng=t,this.biasFactor=n}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},xM=Math.min,vM=Math.max,RM=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=xM(t,n),this.lastIndexInSlice=vM(t,n),new O(e[this.nextIndexInSlice++],void 0)}};function Ny(e,t,n,r){return r===void 0||n.length===0||t.nextInt(1,r)!==1?new wM(e,t,r):new RM(e,t,n,r)}var kM=Math.floor,$y=Math.log,Ly=Math.max,EM=Array.isArray;function Fu(e,t){return e===t?e:e+kM($y(t-e)/$y(2))}var yb=class gb extends de{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=te({min:n,max:r}),this.depthContext=Dc(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[Te]=()=>{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=Ny(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=Ly(0,n-Fu(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=Ny(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=Ly(0,t-Fu(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&&gb.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=Fu(this.minLength,this.maxGeneratedLength);return{size:te({min:this.minLength,max:r}).generate(t,void 0).value,biasFactorItems:n}}canShrinkWithoutContext(t){if(!EM(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(U(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,gn(()=>this.arb.shrink(t[o],n.itemsContexts[o]).map(s=>{let a=U(Ne(t,0,o),(u,c)=>new O(mr(u),n.itemsContexts[c])),l=U(Ne(t,o+1),(u,c)=>new O(mr(u),n.itemsContexts[c+o+1]));return[[...a,s,...l],void 0,o]})));return _.nil().join(...i)}shrinkImpl(t,n){if(t.length===0)return _.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[U(Ne(t,o),(s,a)=>new O(mr(s),r.itemsContexts[a+o])),i.context,0]}).join(gn(()=>t.length>this.minLength?this.shrinkItemByItem(t,r,1):this.shrinkItemByItem(t,r,t.length))).join(t.length>this.minLength?gn(()=>{let i={shrunkOnce:!1,lengthContext:void 0,itemsContexts:Ne(r.itemsContexts,1),startIndex:0};return this.shrinkImpl(Ne(t,1),i).filter(o=>this.minLength<=o[0].length+1).map(o=>[[new O(mr(t[0]),r.itemsContexts[0]),...o[0]],void 0,0])}):_.nil())}shrink(t,n){return this.shrinkImpl(t,n).map(r=>this.wrapper(r[0],!0,r[1],r[2]))}},AM=Math.floor,CM=Math.min,_n=2147483647,fr=["xsmall","small","medium","large","xlarge"],PM=["-4","-3","-2","-1","=","+1","+2","+3","+4"],_c="small";function IM(e,t){switch(t){case"xsmall":return AM(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 ki(e,t){let n=Ht(PM,e);if(n===-1)return e;let r=Ht(fr,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?fr[0]:i>=fr.length?fr[fr.length-1]:fr[i]}function vi(e,t,n,r){let{baseSize:i=_c,defaultSizeToMaxWhenMaxSpecified:o}=gt()||{},s=e!==void 0?e:r&&o?"max":i;return s==="max"?n:CM(IM(t,ki(s,i)),n)}function MM(e,t){if(typeof e=="number")return 1/e;let{baseSize:n=_c,defaultSizeToMaxWhenMaxSpecified:r}=gt()||{},i=e!==void 0?e:t&&r?"max":n;if(i==="max")return 0;switch(ki(i,n)){case"xsmall":return 1;case"small":return .5;case"medium":return .25;case"large":return .125;case"xlarge":return .0625}}function jc(e){let{baseSize:t=_c}=gt()||{};return e===void 0?t:ki(e,t)}function le(e,t={}){let n=t.size,r=t.minLength||0,i=t.maxLength,o=t.depthIdentifier,s=i!==void 0?i:_n;return new yb(e,r,vi(n,r,s,i!==void 0),s,o,void 0,t.experimentalCustomSlices||[])}function us(e){return e/P(2)}function Dy(e,t,n){let r=e-t;function*i(){let s=n?void 0:t,a=n?r:us(r);for(let l=a;l>0;l=us(l)){let u=e-l;yield new O(u,s),s=u}}function*o(){let s=n?void 0:t,a=n?r:us(r);for(let l=a;l<0;l=us(l)){let u=e-l;yield new O(u,s),s=u}}return r>0?bn(i()):bn(o())}var TM=class bb extends de{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=hb(this.min,this.max,hM);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 bb.isValidContext(t,n)?this.isLastChanceTry(t,n)?_.of(new O(n,void 0)):Dy(t,n,!1):Dy(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?P(0):this.min<0?this.max:this.min}isLastChanceTry(t,n){return t>0?t===n+P(1)&&t>this.min:t<0?t===n-P(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!==P(0)&&r)throw new Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function OM(e){let n=P(-1)<<P(255),r=(P(1)<<P(255))-P(1),i=e.min,o=e.max;return{min:i!==void 0?i:n-(o!==void 0&&o<P(0)?o*o:P(0)),max:o!==void 0?o:r+(i!==void 0&&i>P(0)?i*i:P(0))}}function NM(e){return e[0]===void 0?{}:e[1]===void 0?e[0]:{min:e[0],max:e[1]}}function Sn(...e){let t=OM(NM(e));if(t.min>t.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new TM(t.min,t.max)}var $M=Object.getPrototypeOf,mi=class extends de{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 As(e){return $M(e)===mi.prototype&&e.generate===mi.prototype.generate&&e.canShrinkWithoutContext===mi.prototype.canShrinkWithoutContext&&e.shrink===mi.prototype.shrink?e:new mi(e)}function LM(e){return e===1}function DM(e){if(typeof e!="boolean")throw new Error("Unsupported input type");return e===!0?1:0}function Ei(){return As(te({min:0,max:1}).map(LM,DM))}var bi=Object.is,FM=class{constructor(e){this.values=e,this.fastValues=new yr(this.values);let t=!1,n=!1;if(Es(this.fastValues,0))for(let r=0;r!==this.values.length;++r){let i=this.values[r];t=t||bi(i,-0),n=n||bi(i,0)}this.hasMinusZero=t,this.hasPlusZero=n}has(e){return e===0?bi(e,0)?this.hasPlusZero:this.hasMinusZero:Es(this.fastValues,e)}},Sb=class extends de{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 Fn(r)?new O(r,n,()=>r[Te]()):new O(r,n)}canShrinkWithoutContext(e){return this.values.length===1?bi(this.values[0],e):(this.fastValues===void 0&&(this.fastValues=new FM(this.values)),this.fastValues.has(e))}shrink(e,t){return t===0||bi(e,this.values[0])?_.nil():_.of(new O(this.values[0],0))}};function $t(...e){if(e.length===0)throw new Error("fc.constantFrom expects at least one parameter");return new Sb(e)}function _M(e){return!e||!e.withBigInt?$t(!1,null,void 0,0,"",NaN):$t(!1,null,void 0,0,"",NaN,P(0))}function Re(e){return new Sb([e])}var jM=class wb{constructor(){this.receivedLogs=[]}log(t){this.receivedLogs.push(t)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[Te](){return new wb}};function BM(){return Re(new jM)}var VM=NaN,UM=Number.isNaN;function xb(e){return new Rs(e)}function vb(e){if(!(e instanceof Rs)||e.constructor!==Rs)throw new I("Not a valid value for date unmapper");return ks(e)}function WM(e){return t=>t===e?new Rs(VM):xb(t)}function zM(e){return t=>{let n=vb(t);return UM(n)?e:n}}var Fy=Number.isNaN;function Rb(e={}){let t=e.min!==void 0?ks(e.min):-864e13,n=e.max!==void 0?ks(e.max):864e13,r=e.noInvalidDate;if(Fy(t))throw new Error("fc.date min must be valid instance of Date");if(Fy(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 te({min:t,max:n}).map(xb,vb);let i=n+1;return te({min:t,max:n+1}).map(WM(i),zM(i))}var GM=class extends de{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 _(this.shrinkIterator(t)):_.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 m=this.chainer(u.value_);if(m===void 0)break;let f=c.clone(),h=m.generate(c,r);l.push({arbitrary:m,value:h.value_,context:h.context,clonedMrng:f}),u=h}let d=l[l.length-1],p={biasFactor:r,entries:l,currentShrinkLevel:i};yield new O(d.value,p)}}}isSafeContext(e){return e!=null&&typeof e=="object"&&"biasFactor"in e&&"entries"in e&&"currentShrinkLevel"in e}};function KM(e,t){return new GM(e,t)}var HM=Symbol.iterator,qM=Array.isArray,YM=Object.is,ZM=class kb extends de{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(!qM(t)||t.length!==this.numValues)return!1;if(t.length===0)return!0;for(let n=1;n<t.length;++n)if(!YM(t[0],t[n]))return!1;return this.arb.canShrinkWithoutContext(t[0])}shrink(t,n){return t.length===0?_.nil():new _(this.shrinkImpl(t,n!==void 0?n:[])).map(r=>this.wrapper(r))}*shrinkImpl(t,n){let r=U(t,(o,s)=>this.arb.shrink(o,n[s])[HM]()),i=U(r,o=>o.next());for(;!i[0].done;)yield U(i,o=>o.value),i=U(r,o=>o.next())}static makeItCloneable(t,n){return t[Te]=()=>{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&&kb.makeItCloneable(r,t),new O(r,i)}};function JM(e,t){return new ZM(e,t)}var _y=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}},XM=Number.isNaN,QM=class{constructor(e){this.selector=e,this.selectedItemsExceptNaN=new yr,this.data=[]}tryAdd(e){let t=this.selector(e);if(XM(t))return T(this.data,e),!0;let n=this.selectedItemsExceptNaN.size;return Si(this.selectedItemsExceptNaN,t),n!==this.selectedItemsExceptNaN.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},eT=Object.is,tT=class{constructor(e){this.selector=e,this.selectedItemsExceptMinusZero=new yr,this.data=[],this.hasMinusZero=!1}tryAdd(e){let t=this.selector(e);if(eT(t,-0))return this.hasMinusZero?!1:(T(this.data,e),this.hasMinusZero=!0,!0);let n=this.selectedItemsExceptMinusZero.size;return Si(this.selectedItemsExceptMinusZero,t),n!==this.selectedItemsExceptMinusZero.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},nT=class{constructor(e){this.selector=e,this.selectedItems=new yr,this.data=[]}tryAdd(e){let t=this.selector(e),n=this.selectedItems.size;return Si(this.selectedItems,t),n!==this.selectedItems.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}};function rT(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 _y(l)}let r=e.comparator,i=e.selector,o=a=>i(a.value_),s=(a,l)=>r(o(a),o(l));return()=>new _y(s)}let t=e.selector||(r=>r),n=r=>t(r.value_);switch(e.comparator){case"IsStrictlyEqual":return()=>new QM(n);case"SameValueZero":return()=>new nT(n);case"SameValue":case void 0:return()=>new tT(n)}}function jn(e,t={}){let n=t.minLength!==void 0?t.minLength:0,r=t.maxLength!==void 0?t.maxLength:_n,i=vi(t.size,n,r,t.maxLength!==void 0),o=t.depthIdentifier,s=new yb(e,n,i,r,o,rT(t),[]);return n===0?s:s.filter(a=>a.length>=n)}var iT=Object.create,oT=Object.defineProperty,sT=Object.getOwnPropertyDescriptor,jy=Object.getPrototypeOf,aT=Object.prototype,lT=Reflect.ownKeys;function uT(e){let t=e[1]?iT(null):{};for(let n of e[0])oT(t,n[0],{enumerable:!0,configurable:!0,writable:!0,value:n[1]});return t}function cT(e){return e!==void 0&&!!e.configurable&&!!e.enumerable&&!!e.writable&&e.get===void 0&&e.set===void 0}function dT(e){if(typeof e!="object"||e===null)throw new I("Incompatible instance received: should be a non-null object");let t=jy(e)===null,n=jy(e)===aT;if(!t&&!n)throw new I("Incompatible instance received: should be of exact type Object");let r=U(lT(e),i=>[i,sT(e,i)]);if(!zg(r,([,i])=>cT(i)))throw new I("Incompatible instance received: should contain only c/e/w properties without get/set");return[U(r,([i,o])=>[i,o.value]),t]}function fT(e){return e[0]}function Bc(e,t,n={}){let r=!!n.noNullPrototype;return j(jn(j(e,t),{minLength:n.minKeys,maxLength:n.maxKeys,size:n.size,selector:fT,depthIdentifier:n.depthIdentifier}),r?Re(!1):Ei()).map(uT,dT)}var pT=Number.POSITIVE_INFINITY,hT=Number.MAX_SAFE_INTEGER,mT=Number.isInteger,yT=Math.floor,gT=Math.pow,bT=Math.min,ac=class Eb extends de{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,!mT(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 Eb(t,{depthBias:MM(n.depthSize,n.maxDepth!==void 0),maxDepth:n.maxDepth!==void 0?n.maxDepth:pT,withCrossShrink:!!n.withCrossShrink},Dc(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 _.of(l).join(a)}return a}let r=this.canShrinkWithoutContextIndex(t);return r===-1?_.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 _.nil()}finally{--this.context.depth}let n=new O(this.warbs[0].fallbackValue.default,void 0);return _.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=yT(gT(1+t,this.context.depth))-1;return-bT(this.totalWeight*n,hT)||0}};function ST(e){return e!=null&&typeof e=="object"&&!("generate"in e)&&!("arbitrary"in e)&&!("weight"in e)}function By(e){return Ng(e)?{arbitrary:e,weight:1}:e}function Me(...e){let t=e[0];if(ST(t)){let r=U(Ne(e,1),By);return ac.from(r,t,"fc.oneof")}let n=U(e,By);return ac.from(n,{},"fc.oneof")}var wT=Number.isInteger;function yn(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(!wT(t))throw new Error("fc.nat maximum value should be an integer");return new Sr(0,t)}var xT=Object.is;function vT(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 RT(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 kT(e){let t=vT(e);return function(r){let i=RT(t,r);return i.entry.build(r-i.from)}}function ET(e){let t={mapping:new Yt,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===qt.NEGATIVE_INFINITY?t.negativeZeroIndex=n:yt(t.mapping,s,n),++n}}return t}function AT(e){let t=null;return function(r){t===null&&(t=ET(e));let i=xT(r,-0)?t.negativeZeroIndex:st(t.mapping,r);if(i===void 0)throw new I("Unknown value encountered cannot be built using this mapToConstant");return i}}function CT(e){if(e.length===0)throw new I("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 I("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 I("fc.mapToConstant expects at least one choice among options");return t}function wr(...e){return yn({max:CT(e)-1}).map(kT(e),AT(e))}function Ab(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=Vg(i);for(let s=o.nextStartIndex;s<=t.length;++s){let a=ge(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 PT(e){return ce(e,"")}function Cb(e){return e.minLength!==void 0?e.minLength:0}function Pb(e){return e.maxLength!==void 0?e.maxLength:_n}function IT(e,t){return Cb(t)<=e.length&&e.length<=Pb(t)}function MT(e,t){return function(r){if(typeof r!="string")throw new I("Unsupported value");let i=Ab(e,r,Cb(t),Pb(t));if(i===void 0)throw new I("Unable to unmap received string");return i}}var Ib=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function TT(e,t,n){let r;try{r=n(e)}catch{return}for(let i of r)if(!t.canShrinkWithoutContext(i))return;return r}function OT(e,t){let n=[];for(let r of Ib){let i=TT(r,e,t);i!==void 0&&T(n,i)}return n}var Vy=new WeakMap;function NT(e){let t=[];for(let n of Ib){let r=Ab(e,n,0,_n);r!==void 0&&T(t,r)}return t}function $T(e,t){let n=OP(Vy,e);n===void 0&&(n=NT(e),TP(Vy,e,n));let r=[];for(let i of n)IT(i,t)&&T(r,i);return r}var LT=[[0,127]],DT=[[0,55295],[57344,1114111]],FT=[[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]],_T=[[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]],Uy=String.fromCodePoint,jT=Math.min,BT=Math.max;function lc(e){if(e.length===1){let n=Uy(e[0]);return{num:1,build:()=>n}}let t=e[0];return{num:e[1]-e[0]+1,build:n=>Uy(t+n)}}function Wy(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=BT(s,u),p=jT(a,c);if(n.length>=1){let m=n[n.length-1];(m.length===1?m[0]:m[1])+1===d&&(d=m[0],Vg(n))}T(n,d===p?[d]:[d,p]),a<=p&&(r+=1),c<=p&&(i+=1)}}return n}var zy=Object.create(null);function VT(e){switch(e){case"full":return DT;case"ascii":return LT}}function UT(e,t){let n=`${e}:${t}`,r=zy[n];if(r!==void 0)return r;let i=VT(t),o=e==="binary"?i:Wy(i,FT),s=[];for(let l of o)T(s,lc(l));if(e==="grapheme"){let l=Wy(i,_T);for(let u of l){let c=lc(u);T(s,{num:c.num,build:d=>ZP(c.build(d),"NFD")})}}let a=wr(...s);return zy[n]=a,a}function yi(e,t){return UT(e,t)}function WT(e){if(typeof e.unit=="object")return e.unit;switch(e.unit){case"grapheme":return yi("grapheme","full");case"grapheme-composite":return yi("composite","full");case"grapheme-ascii":case void 0:return yi("grapheme","ascii");case"binary":return yi("binary","full");case"binary-ascii":return yi("binary","ascii")}}function Pe(e={}){let t=WT(e),n=MT(t,e),r=$T(t,e);return le(t,{...e,experimentalCustomSlices:r}).map(PT,n)}var Mb=Map,Vc=String.fromCharCode,Uc={num:26,build:e=>Vc(e+97)},zT={num:26,build:e=>Vc(e+65)},Tb={num:10,build:e=>Vc(e+48)};function GT(e){let t=uP(e);return e!==t?t:`%${wi(gr(e,0),16)}`}function KT(e){if(typeof e!="string")throw new Error("Unsupported");return decodeURIComponent(e)}var HT=()=>Pe({unit:"binary",minLength:1,maxLength:1}).map(GT,KT),_u;function qT(){return _u===void 0&&(_u=wr(Uc)),_u}var cs;function uc(e){cs===void 0&&(cs=new Mb);let t=st(cs,e);return t===void 0&&(t=wr(Uc,Tb,{num:e.length,build:n=>e[n]}),yt(cs,e,t)),t}function YT(e){return wr(Uc,zT,Tb,{num:e.length,build:t=>e[t]})}var ds;function Wc(e){ds===void 0&&(ds=new Mb);let t=st(ds,e);return t===void 0&&(t=Me({weight:10,arbitrary:YT(e)},{weight:1,arbitrary:HT()}),yt(ds,e,t)),t}function Jt(e,t={}){let n=t.freq===void 0?6:t.freq,r=Gg(t,"nil")?t.nil:null,i=[{arbitrary:Re(r),weight:1,fallbackValue:{default:r}},{arbitrary:e,weight:n-1}],o={withCrossShrink:!0,depthSize:t.depthSize,maxDepth:t.maxDepth,depthIdentifier:t.depthIdentifier};return ac.from(i,o,"fc.option")}function ZT(e){return e.length>63?!1:e.length<4||e[0]!=="x"||e[1]!=="n"||e[2]!=="-"||e[3]!=="-"}var Ob=Symbol("adapted-value");function JT(e,t){let n=t(e.value_);return n.adapted?new O(n.value,Ob):e}var XT=class extends de{constructor(e,t){super(),this.sourceArb=e,this.adapter=t,this.adaptValue=n=>JT(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===Ob?this.sourceArb.canShrinkWithoutContext(e)?this.sourceArb.shrink(e,void 0).map(this.adaptValue):_.nil():this.sourceArb.shrink(e,t).map(this.adaptValue)}};function Nb(e,t){return new XT(e,t)}function QT([e,t]){return t===null?e:`${e}${t[0]}${t[1]}`}function eO(e){if(typeof e!="string"||e.length===0)throw new Error("Unsupported");return e.length===1?[e[0],null]:[e[0],[ge(e,1,e.length-1),e[e.length-1]]]}function tO(e){let t=uc("");return j(t,Jt(j(Pe({unit:uc("-"),size:e,maxLength:61}),t))).map(QT,eO).filter(ZT)}function nO(e){return`${ce(e[0],".")}.${e[1]}`}function rO(e){if(typeof e!="string")throw new Error("Unsupported type");let t=e.lastIndexOf(".");return[Ge(ge(e,0,t),"."),ge(e,t+1)]}function iO(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:[Ne(t,0,i),n]};return{adapted:!1,value:e}}function zc(e={}){let t=jc(e.size),n=ki("-1",t),r=Pe({unit:qT(),minLength:2,maxLength:63,size:n});return Nb(j(le(tO(t),{size:n,minLength:1,maxLength:127}),r),iO).map(nO,rO)}function oO(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:Ne(e,0,n)};return{adapted:!1,value:e}}function sO(e){return ce(e,".")}function aO(e){if(typeof e!="string")throw new Error("Unsupported");return Ge(e,".")}function lO(e){return`${e[0]}@${e[1]}`}function uO(e){if(typeof e!="string")throw new Error("Unsupported");return Ge(e,"@",2)}function cO(e={}){return j(Nb(le(Pe({unit:uc("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:e.size}),{minLength:1,maxLength:32,size:e.size}),oO).map(sO,aO),zc({size:e.size})).map(lO,uO)}var dO=qt.NEGATIVE_INFINITY,cc=qt.POSITIVE_INFINITY,$b=qt.EPSILON,Gc=P(2146435072)*P(4294967296),fO=-Gc-P(1),Gy=4503599627370496,pO=P(0xfffffffffffff),Ky=P("9007199254740992"),dc=new Float64Array(1),Hy=new Uint32Array(dc.buffer,dc.byteOffset);function hO(e){return dc[0]=e,[Hy[1],Hy[0]]}function mO(e){let{0:t,1:n}=hO(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*$b,a*=r===0?1:-1,{exponent:s,significand:a}}function qy(e,t){return e===-1022?P(t*Gy):P((t-1)*Gy)+(P(e+1023)<<P(52))}function Kc(e){if(e===cc)return Gc;if(e===dO)return fO;let t=mO(e),n=t.exponent,r=t.significand;return e>0||e===0&&1/e===cc?qy(n,r):-qy(n,-r)-P(1)}function fc(e){if(e<0)return-fc(-e-P(1));if(e===Gc)return cc;if(e<Ky)return qt(e)*2**-1074;let t=e-Ky,n=-1021+qt(t>>P(52));return(1+qt(t&pO)*$b)*2**n}var Yy=Number.isInteger,Zy=Object.is,ju=Number.NEGATIVE_INFINITY,Bu=Number.POSITIVE_INFINITY;function Lb(e,t,n,r){let{noDefaultInfinity:i=!1,minExcluded:o=!1,maxExcluded:s=!1,min:a=i?-t:ju,max:l=i?t:Bu}=e,u=o?a<-n?-r:Math.max(a,-n):a===ju?Math.max(a,-r):Math.max(a,-n),c=s?l>n?r:Math.min(l,n):l===Bu?Math.min(l,r):Math.min(l,n);return{noDefaultInfinity:!1,minExcluded:o||(a!==ju||o)&&Yy(u),maxExcluded:s||(l!==Bu||s)&&Yy(c),min:Zy(u,-0)?0:u,max:Zy(c,0)?-0:c,noNaN:e.noNaN||!1}}var Db=Number.NEGATIVE_INFINITY,Fb=Number.POSITIVE_INFINITY,yO=Number.MAX_VALUE,gO=45035996273704955e-1,pc=4503599627370496;function bO(e){return Lb(e,yO,gO,pc)}function SO(e){return e===4503599627370496?Fb:e===-4503599627370496?Db:e}function wO(e){if(typeof e!="number")throw new Error("Unsupported type");return e===Fb?pc:e===Db?-pc:e}var xO=Number.isInteger,_b=Number.isNaN,vO=Number.NEGATIVE_INFINITY,RO=Number.POSITIVE_INFINITY,Jy=Number.MAX_VALUE,kO=NaN;function Xy(e,t){if(_b(e))throw new Error("fc.double constraints."+t+" must be a 64-bit float");return Kc(e)}function EO(e){if(typeof e!="number")throw new Error("Unsupported type");return Kc(e)}function AO(e){return!xO(e)}function Qy(e){let{noDefaultInfinity:t=!1,noNaN:n=!1,minExcluded:r=!1,maxExcluded:i=!1,min:o=t?-Jy:vO,max:s=t?Jy:RO}=e,a=Xy(o,"min"),l=r?a+P(1):a,u=Xy(s,"max"),c=i?u-P(1):u;if(c<l)throw new Error("fc.double constraints.min must be smaller or equal to constraints.max");if(n)return Sn({min:l,max:c}).map(fc,EO);let d=c>P(0),p=d?l:l-P(1),m=d?c+P(1):c;return Sn({min:p,max:m}).map(f=>c<f||f<l?kO:fc(f),f=>{if(typeof f!="number")throw new Error("Unsupported type");return _b(f)?c!==m?m:p:Kc(f)})}function Ms(e={}){return e.noInteger?Qy(bO(e)).map(SO,wO).filter(AO):Qy(e)}var CO=Number.NEGATIVE_INFINITY,hc=Number.POSITIVE_INFINITY,PO=Math.imul,mc=2**127*(1+(2**23-1)/2**23),jb=2139095040,IO=-2139095041,yc=new Float32Array(1),MO=new Uint32Array(yc.buffer,yc.byteOffset);function TO(e){return yc[0]=e,MO[0]}function OO(e){let t=TO(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 eg(e,t){return e===-126?t*8388608:PO(e+127,8388608)+(t-1)*8388608}function Hc(e){if(e===hc)return jb;if(e===CO)return IO;let t=OO(e),n=t.exponent,r=t.significand;return e>0||e===0&&1/e===hc?eg(n,r):-eg(n,-r)-1}function gc(e){if(e<0)return-gc(-e-1);if(e===jb)return hc;if(e<16777216)return e*2**-149;let t=e-16777216,n=-125+(t>>23);return(1+(t&8388607)/8388608)*2**n}var Bb=Number.NEGATIVE_INFINITY,Vb=Number.POSITIVE_INFINITY,NO=mc,$O=83886075e-1,bc=8388608;function LO(e){return Lb(e,NO,$O,bc)}function DO(e){return e===8388608?Vb:e===-8388608?Bb:e}function FO(e){if(typeof e!="number")throw new Error("Unsupported type");return e===Vb?bc:e===Bb?-bc:e}var _O=Number.isInteger,Ub=Number.isNaN,jO=Math.fround,BO=Number.NEGATIVE_INFINITY,VO=Number.POSITIVE_INFINITY,UO=NaN;function tg(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(Ub(e)||jO(e)!==e)throw new Error(n);return Hc(e)}function WO(e){if(typeof e!="number")throw new Error("Unsupported type");return Hc(e)}function zO(e){return!_O(e)}function ng(e){let{noDefaultInfinity:t=!1,noNaN:n=!1,minExcluded:r=!1,maxExcluded:i=!1,min:o=t?-mc:BO,max:s=t?mc:VO}=e,a=tg(o,"min"),l=r?a+1:a,u=tg(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 te({min:l,max:c}).map(gc,WO);let d=c>0?l:l-1,p=c>0?c+1:c;return te({min:d,max:p}).map(m=>m>c||m<l?UO:gc(m),m=>{if(typeof m!="number")throw new Error("Unsupported type");return Ub(m)?c!==p?p:d:Hc(m)})}function Wb(e={}){return e.noInteger?ng(LO(e)).map(DO,FO).filter(zO):ng(e)}function GO(e){return e.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function zb(e){return e.replace(/\*\//g,"*\\/")}var it=[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 Cs(e){let t=4294967295;for(let n=0;n<e.length;++n){let r=gr(e,n);if(r<128)t=it[t&255^r]^t>>8;else if(r<2048)t=it[t&255^(192|r>>6&31)]^t>>8,t=it[t&255^(128|r&63)]^t>>8;else if(r>=55296&&r<57344){let i=gr(e,++n);if(r>=56320||i<56320||i>57343||Number.isNaN(i))n-=1,t=it[t&255^239]^t>>8,t=it[t&255^191]^t>>8,t=it[t&255^189]^t>>8;else{let o=(r&1023)+64,s=i&1023;t=it[t&255^(240|o>>8&7)]^t>>8,t=it[t&255^(128|o>>2&63)]^t>>8,t=it[t&255^(128|s>>6&15|(o&3)<<4)]^t>>8,t=it[t&255^(128|s&63)]^t>>8}}else t=it[t&255^(224|r>>12&15)]^t>>8,t=it[t&255^(128|r>>6&63)]^t>>8,t=it[t&255^(128|r&63)]^t>>8}return(t|0)+2147483648}var KO=Object.getPrototypeOf,gi=class extends de{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 _.nil()}};function Ps(e){return KO(e)===gi.prototype&&e.generate===gi.prototype.generate&&e.canShrinkWithoutContext===gi.prototype.canShrinkWithoutContext&&e.shrink===gi.prototype.shrink?e:new gi(e)}var HO=Object.assign,qO=Object.keys;function Gb(e){return j(Ps(te()),Ps(te({min:1,max:4294967295}))).map(([t,n])=>{let r=()=>{let i={};return HO((s,a)=>{let l=ke(s),u=ke(a),c=e(Cs(`${t}${l}`)%n,Cs(`${t}${u}`)%n);return i[`[${l},${u}]`]=c,c},{toString:()=>{let s=qO(i).sort().map(a=>`${a} => ${ke(i[a])}`).map(a=>`/* ${zb(a)} */`);return`function(a, b) {
|
|
38
|
+
${WI(i)}`),o}function lb(e){return oc(e,ke)}async function ub(e){let t=[];function n(s){let a=tb(s);return typeof a=="string"?a:(t.push(Promise.all([s,a])),"\u2026")}let r=oc(e,n);if(t.length===0)return r;let i=new Yt(await Promise.all(t));function o(s){let a=st(i,s);return a!==void 0?a:ke(s)}return oc(e,o)}function cb(e,t){if(t.runConfiguration.includeErrorInReport)throw new I(e);let n=new I(e,{cause:t.errorInstance});return"cause"in n||UI(n,{cause:t.errorInstance}),n}function YI(e){if(e.failed)throw cb(lb(e),e)}async function ZI(e){if(e.failed)throw cb(await ub(e),e)}function JI(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):YI(e)}async function XI(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):ZI(e)}function QI(e,t,n,r,i){let o=new rb(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 eM(e,t,n,r,i){let o=new rb(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 db(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=Mc({...gt(),...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=OI(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 LI(n.path.length===0?ob(r,n.seed,n.randomType,n.examples):ab(n.path,bn(sb(r,n.seed,n.randomType,n.examples)),s),i,o),l=n.endOnFailure?_.nil:s;return r.isAsync()?eM(r,l,a,n.verbose,n.markInterruptAsFailure).then(u=>u.toRunDetails(n.seed,n.path,o,n)):QI(r,l,a,n.verbose,n.markInterruptAsFailure).toRunDetails(n.seed,n.path,o,n)}function tM(e,t){let n=db(e,t);if(e.isAsync())return n.then(XI);JI(n)}function nM(e,t){let n=Object.prototype.hasOwnProperty.call(e,"isAsync")?e:new Xg(e,()=>!0);return t.unbiased===!0?new eb(n):n}function fb(e,t){let n=Mc(typeof t=="number"?{...gt(),numRuns:t}:{...gt(),...t}),r=nM(e,n),i=r.shrink.bind(r);return(n.path.length===0?bn(ob(r,n.seed,n.randomType,n.examples)):ab(n.path,bn(sb(r,n.seed,n.randomType,n.examples)),i)).take(n.numRuns).map(o=>o.value_)}function rM(e,t){return[...fb(e,t)]}function iM(e){return(Math.round(e*100)/100).toFixed(2)}function oM(e,t,n){let r=Mc(typeof n=="number"?{...gt(),numRuns:n}:{...gt(),...n}),i={};for(let l of fb(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],`${iM(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 sM=Object.assign;function sc(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 p=c.value;return T(s.history,{arb:u,value:p,context:c.context,mrng:c.mrng}),o=c.mrng.clone(),p}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(sM(l,{values(){return U(s.history,u=>u.value)},[Te](){return sc(e,t,n,r).value},[bt](){return ke(U(s.history,u=>u.value))}}),s)}var Du=Array.isArray,Ey=Object.keys,aM=Object.is;function lM(e){let t=new Yt;return function(r,i){let o=st(t,r);if(o===void 0){let l=r(...i);return yt(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 pb(e,t){if(e!==null&&typeof e=="object"&&t!==null&&typeof t=="object"){if(Du(e)){if(!Du(t)||e.length!==t.length)return!1}else if(Du(t))return!1;if(Ey(e).length!==Ey(t).length)return!1;for(let n in e)if(!(n in t)||!pb(e[n],t[n]))return!1;return!0}else return aM(e,t)}var uM=class extends de{constructor(...e){super(...e),this.arbitraryCache=lM(pb)}generate(e,t){return sc(e,t,()=>[],this.arbitraryCache)}canShrinkWithoutContext(e){return!1}shrink(e,t){if(t===void 0)return _.nil();let n=t,r=n.mrng,i=n.biasFactor,o=n.history;return Yg(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 U(o,(c,d)=>({arb:c.arb,value:l[d],context:u[d],mrng:c.mrng}))}return sc(r,i,a,this.arbitraryCache)})}};function cM(){return new uM}var dM=Math.floor,Ay=Math.log;function fM(e){return dM(Ay(e)/Ay(2))}function pM(e){return e===P(0)?P(0):P(ze(e).length)}function hb(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 hM=Math.ceil,mM=Math.floor;function Cy(e){return mM(e/2)}function Py(e){return hM(e/2)}function Iy(e,t,n){let r=e-t;function*i(){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}}function*o(){let s=n?void 0:t,a=n?r:Py(r);for(let l=a;l<0;l=Py(l)){let u=l===r?t:e-l;yield new O(u,s),s=u}}return r>0?bn(i()):bn(o())}var My=Math.sign,yM=Number.isInteger,gM=Object.is,Sr=class mb extends de{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"&&yM(t)&&!gM(t,-0)&&this.min<=t&&t<=this.max}shrink(t,n){return mb.isValidContext(t,n)?this.isLastChanceTry(t,n)?_.of(new O(n,void 0)):Iy(t,n,!1):Iy(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=hb(this.min,this.max,fM);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&&My(t)!==My(n))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},Ty=Number.isInteger;function bM(e){return{min:e.min!==void 0?e.min:-2147483648,max:e.max!==void 0?e.max:2147483647}}function te(e={}){let t=bM(e);if(t.min>t.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!Ty(t.min))throw new Error("fc.integer minimum value should be an integer");if(!Ty(t.max))throw new Error("fc.integer maximum value should be an integer");return new Sr(t.min,t.max)}var Oy=new Map;function Dc(e){if(e===void 0)return{depth:0};if(typeof e!="string")return e;let t=st(Oy,e);if(t!==void 0)return t;let n={depth:0};return yt(Oy,e,n),n}function Fc(){return{depth:0}}var SM=class{constructor(e,t,n){this.arb=e,this.mrng=t,this.biasFactor=n}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},wM=Math.min,xM=Math.max,vM=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=wM(t,n),this.lastIndexInSlice=xM(t,n),new O(e[this.nextIndexInSlice++],void 0)}};function Ny(e,t,n,r){return r===void 0||n.length===0||t.nextInt(1,r)!==1?new SM(e,t,r):new vM(e,t,n,r)}var RM=Math.floor,$y=Math.log,Ly=Math.max,kM=Array.isArray;function Fu(e,t){return e===t?e:e+RM($y(t-e)/$y(2))}var yb=class gb extends de{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=te({min:n,max:r}),this.depthContext=Dc(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[Te]=()=>{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=Ny(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=Ly(0,n-Fu(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=Ny(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=Ly(0,t-Fu(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&&gb.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=Fu(this.minLength,this.maxGeneratedLength);return{size:te({min:this.minLength,max:r}).generate(t,void 0).value,biasFactorItems:n}}canShrinkWithoutContext(t){if(!kM(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(U(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,gn(()=>this.arb.shrink(t[o],n.itemsContexts[o]).map(s=>{let a=U(Ne(t,0,o),(u,c)=>new O(mr(u),n.itemsContexts[c])),l=U(Ne(t,o+1),(u,c)=>new O(mr(u),n.itemsContexts[c+o+1]));return[[...a,s,...l],void 0,o]})));return _.nil().join(...i)}shrinkImpl(t,n){if(t.length===0)return _.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[U(Ne(t,o),(s,a)=>new O(mr(s),r.itemsContexts[a+o])),i.context,0]}).join(gn(()=>t.length>this.minLength?this.shrinkItemByItem(t,r,1):this.shrinkItemByItem(t,r,t.length))).join(t.length>this.minLength?gn(()=>{let i={shrunkOnce:!1,lengthContext:void 0,itemsContexts:Ne(r.itemsContexts,1),startIndex:0};return this.shrinkImpl(Ne(t,1),i).filter(o=>this.minLength<=o[0].length+1).map(o=>[[new O(mr(t[0]),r.itemsContexts[0]),...o[0]],void 0,0])}):_.nil())}shrink(t,n){return this.shrinkImpl(t,n).map(r=>this.wrapper(r[0],!0,r[1],r[2]))}},EM=Math.floor,AM=Math.min,_n=2147483647,fr=["xsmall","small","medium","large","xlarge"],CM=["-4","-3","-2","-1","=","+1","+2","+3","+4"],_c="small";function PM(e,t){switch(t){case"xsmall":return EM(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 ki(e,t){let n=Ht(CM,e);if(n===-1)return e;let r=Ht(fr,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?fr[0]:i>=fr.length?fr[fr.length-1]:fr[i]}function vi(e,t,n,r){let{baseSize:i=_c,defaultSizeToMaxWhenMaxSpecified:o}=gt()||{},s=e!==void 0?e:r&&o?"max":i;return s==="max"?n:AM(PM(t,ki(s,i)),n)}function IM(e,t){if(typeof e=="number")return 1/e;let{baseSize:n=_c,defaultSizeToMaxWhenMaxSpecified:r}=gt()||{},i=e!==void 0?e:t&&r?"max":n;if(i==="max")return 0;switch(ki(i,n)){case"xsmall":return 1;case"small":return .5;case"medium":return .25;case"large":return .125;case"xlarge":return .0625}}function jc(e){let{baseSize:t=_c}=gt()||{};return e===void 0?t:ki(e,t)}function le(e,t={}){let n=t.size,r=t.minLength||0,i=t.maxLength,o=t.depthIdentifier,s=i!==void 0?i:_n;return new yb(e,r,vi(n,r,s,i!==void 0),s,o,void 0,t.experimentalCustomSlices||[])}function us(e){return e/P(2)}function Dy(e,t,n){let r=e-t;function*i(){let s=n?void 0:t,a=n?r:us(r);for(let l=a;l>0;l=us(l)){let u=e-l;yield new O(u,s),s=u}}function*o(){let s=n?void 0:t,a=n?r:us(r);for(let l=a;l<0;l=us(l)){let u=e-l;yield new O(u,s),s=u}}return r>0?bn(i()):bn(o())}var MM=class bb extends de{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=hb(this.min,this.max,pM);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 bb.isValidContext(t,n)?this.isLastChanceTry(t,n)?_.of(new O(n,void 0)):Dy(t,n,!1):Dy(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?P(0):this.min<0?this.max:this.min}isLastChanceTry(t,n){return t>0?t===n+P(1)&&t>this.min:t<0?t===n-P(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!==P(0)&&r)throw new Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function TM(e){let n=P(-1)<<P(255),r=(P(1)<<P(255))-P(1),i=e.min,o=e.max;return{min:i!==void 0?i:n-(o!==void 0&&o<P(0)?o*o:P(0)),max:o!==void 0?o:r+(i!==void 0&&i>P(0)?i*i:P(0))}}function OM(e){return e[0]===void 0?{}:e[1]===void 0?e[0]:{min:e[0],max:e[1]}}function Sn(...e){let t=TM(OM(e));if(t.min>t.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new MM(t.min,t.max)}var NM=Object.getPrototypeOf,mi=class extends de{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 As(e){return NM(e)===mi.prototype&&e.generate===mi.prototype.generate&&e.canShrinkWithoutContext===mi.prototype.canShrinkWithoutContext&&e.shrink===mi.prototype.shrink?e:new mi(e)}function $M(e){return e===1}function LM(e){if(typeof e!="boolean")throw new Error("Unsupported input type");return e===!0?1:0}function Ei(){return As(te({min:0,max:1}).map($M,LM))}var bi=Object.is,DM=class{constructor(e){this.values=e,this.fastValues=new yr(this.values);let t=!1,n=!1;if(Es(this.fastValues,0))for(let r=0;r!==this.values.length;++r){let i=this.values[r];t=t||bi(i,-0),n=n||bi(i,0)}this.hasMinusZero=t,this.hasPlusZero=n}has(e){return e===0?bi(e,0)?this.hasPlusZero:this.hasMinusZero:Es(this.fastValues,e)}},Sb=class extends de{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 Fn(r)?new O(r,n,()=>r[Te]()):new O(r,n)}canShrinkWithoutContext(e){return this.values.length===1?bi(this.values[0],e):(this.fastValues===void 0&&(this.fastValues=new DM(this.values)),this.fastValues.has(e))}shrink(e,t){return t===0||bi(e,this.values[0])?_.nil():_.of(new O(this.values[0],0))}};function $t(...e){if(e.length===0)throw new Error("fc.constantFrom expects at least one parameter");return new Sb(e)}function FM(e){return!e||!e.withBigInt?$t(!1,null,void 0,0,"",NaN):$t(!1,null,void 0,0,"",NaN,P(0))}function Re(e){return new Sb([e])}var _M=class wb{constructor(){this.receivedLogs=[]}log(t){this.receivedLogs.push(t)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[Te](){return new wb}};function jM(){return Re(new _M)}var BM=NaN,VM=Number.isNaN;function xb(e){return new Rs(e)}function vb(e){if(!(e instanceof Rs)||e.constructor!==Rs)throw new I("Not a valid value for date unmapper");return ks(e)}function UM(e){return t=>t===e?new Rs(BM):xb(t)}function WM(e){return t=>{let n=vb(t);return VM(n)?e:n}}var Fy=Number.isNaN;function Rb(e={}){let t=e.min!==void 0?ks(e.min):-864e13,n=e.max!==void 0?ks(e.max):864e13,r=e.noInvalidDate;if(Fy(t))throw new Error("fc.date min must be valid instance of Date");if(Fy(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 te({min:t,max:n}).map(xb,vb);let i=n+1;return te({min:t,max:n+1}).map(UM(i),WM(i))}var zM=class extends de{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 _(this.shrinkIterator(t)):_.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 m=this.chainer(u.value_);if(m===void 0)break;let f=c.clone(),h=m.generate(c,r);l.push({arbitrary:m,value:h.value_,context:h.context,clonedMrng:f}),u=h}let d=l[l.length-1],p={biasFactor:r,entries:l,currentShrinkLevel:i};yield new O(d.value,p)}}}isSafeContext(e){return e!=null&&typeof e=="object"&&"biasFactor"in e&&"entries"in e&&"currentShrinkLevel"in e}};function GM(e,t){return new zM(e,t)}var KM=Symbol.iterator,HM=Array.isArray,qM=Object.is,YM=class kb extends de{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(!HM(t)||t.length!==this.numValues)return!1;if(t.length===0)return!0;for(let n=1;n<t.length;++n)if(!qM(t[0],t[n]))return!1;return this.arb.canShrinkWithoutContext(t[0])}shrink(t,n){return t.length===0?_.nil():new _(this.shrinkImpl(t,n!==void 0?n:[])).map(r=>this.wrapper(r))}*shrinkImpl(t,n){let r=U(t,(o,s)=>this.arb.shrink(o,n[s])[KM]()),i=U(r,o=>o.next());for(;!i[0].done;)yield U(i,o=>o.value),i=U(r,o=>o.next())}static makeItCloneable(t,n){return t[Te]=()=>{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&&kb.makeItCloneable(r,t),new O(r,i)}};function ZM(e,t){return new YM(e,t)}var _y=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}},JM=Number.isNaN,XM=class{constructor(e){this.selector=e,this.selectedItemsExceptNaN=new yr,this.data=[]}tryAdd(e){let t=this.selector(e);if(JM(t))return T(this.data,e),!0;let n=this.selectedItemsExceptNaN.size;return Si(this.selectedItemsExceptNaN,t),n!==this.selectedItemsExceptNaN.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},QM=Object.is,eT=class{constructor(e){this.selector=e,this.selectedItemsExceptMinusZero=new yr,this.data=[],this.hasMinusZero=!1}tryAdd(e){let t=this.selector(e);if(QM(t,-0))return this.hasMinusZero?!1:(T(this.data,e),this.hasMinusZero=!0,!0);let n=this.selectedItemsExceptMinusZero.size;return Si(this.selectedItemsExceptMinusZero,t),n!==this.selectedItemsExceptMinusZero.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},tT=class{constructor(e){this.selector=e,this.selectedItems=new yr,this.data=[]}tryAdd(e){let t=this.selector(e),n=this.selectedItems.size;return Si(this.selectedItems,t),n!==this.selectedItems.size?(T(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}};function nT(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 _y(l)}let r=e.comparator,i=e.selector,o=a=>i(a.value_),s=(a,l)=>r(o(a),o(l));return()=>new _y(s)}let t=e.selector||(r=>r),n=r=>t(r.value_);switch(e.comparator){case"IsStrictlyEqual":return()=>new XM(n);case"SameValueZero":return()=>new tT(n);case"SameValue":case void 0:return()=>new eT(n)}}function jn(e,t={}){let n=t.minLength!==void 0?t.minLength:0,r=t.maxLength!==void 0?t.maxLength:_n,i=vi(t.size,n,r,t.maxLength!==void 0),o=t.depthIdentifier,s=new yb(e,n,i,r,o,nT(t),[]);return n===0?s:s.filter(a=>a.length>=n)}var rT=Object.create,iT=Object.defineProperty,oT=Object.getOwnPropertyDescriptor,jy=Object.getPrototypeOf,sT=Object.prototype,aT=Reflect.ownKeys;function lT(e){let t=e[1]?rT(null):{};for(let n of e[0])iT(t,n[0],{enumerable:!0,configurable:!0,writable:!0,value:n[1]});return t}function uT(e){return e!==void 0&&!!e.configurable&&!!e.enumerable&&!!e.writable&&e.get===void 0&&e.set===void 0}function cT(e){if(typeof e!="object"||e===null)throw new I("Incompatible instance received: should be a non-null object");let t=jy(e)===null,n=jy(e)===sT;if(!t&&!n)throw new I("Incompatible instance received: should be of exact type Object");let r=U(aT(e),i=>[i,oT(e,i)]);if(!zg(r,([,i])=>uT(i)))throw new I("Incompatible instance received: should contain only c/e/w properties without get/set");return[U(r,([i,o])=>[i,o.value]),t]}function dT(e){return e[0]}function Bc(e,t,n={}){let r=!!n.noNullPrototype;return j(jn(j(e,t),{minLength:n.minKeys,maxLength:n.maxKeys,size:n.size,selector:dT,depthIdentifier:n.depthIdentifier}),r?Re(!1):Ei()).map(lT,cT)}var fT=Number.POSITIVE_INFINITY,pT=Number.MAX_SAFE_INTEGER,hT=Number.isInteger,mT=Math.floor,yT=Math.pow,gT=Math.min,ac=class Eb extends de{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,!hT(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 Eb(t,{depthBias:IM(n.depthSize,n.maxDepth!==void 0),maxDepth:n.maxDepth!==void 0?n.maxDepth:fT,withCrossShrink:!!n.withCrossShrink},Dc(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 _.of(l).join(a)}return a}let r=this.canShrinkWithoutContextIndex(t);return r===-1?_.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 _.nil()}finally{--this.context.depth}let n=new O(this.warbs[0].fallbackValue.default,void 0);return _.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=mT(yT(1+t,this.context.depth))-1;return-gT(this.totalWeight*n,pT)||0}};function bT(e){return e!=null&&typeof e=="object"&&!("generate"in e)&&!("arbitrary"in e)&&!("weight"in e)}function By(e){return Ng(e)?{arbitrary:e,weight:1}:e}function Me(...e){let t=e[0];if(bT(t)){let r=U(Ne(e,1),By);return ac.from(r,t,"fc.oneof")}let n=U(e,By);return ac.from(n,{},"fc.oneof")}var ST=Number.isInteger;function yn(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(!ST(t))throw new Error("fc.nat maximum value should be an integer");return new Sr(0,t)}var wT=Object.is;function xT(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 vT(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 RT(e){let t=xT(e);return function(r){let i=vT(t,r);return i.entry.build(r-i.from)}}function kT(e){let t={mapping:new Yt,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===qt.NEGATIVE_INFINITY?t.negativeZeroIndex=n:yt(t.mapping,s,n),++n}}return t}function ET(e){let t=null;return function(r){t===null&&(t=kT(e));let i=wT(r,-0)?t.negativeZeroIndex:st(t.mapping,r);if(i===void 0)throw new I("Unknown value encountered cannot be built using this mapToConstant");return i}}function AT(e){if(e.length===0)throw new I("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 I("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 I("fc.mapToConstant expects at least one choice among options");return t}function wr(...e){return yn({max:AT(e)-1}).map(RT(e),ET(e))}function Ab(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=Vg(i);for(let s=o.nextStartIndex;s<=t.length;++s){let a=ge(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 CT(e){return ce(e,"")}function Cb(e){return e.minLength!==void 0?e.minLength:0}function Pb(e){return e.maxLength!==void 0?e.maxLength:_n}function PT(e,t){return Cb(t)<=e.length&&e.length<=Pb(t)}function IT(e,t){return function(r){if(typeof r!="string")throw new I("Unsupported value");let i=Ab(e,r,Cb(t),Pb(t));if(i===void 0)throw new I("Unable to unmap received string");return i}}var Ib=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function MT(e,t,n){let r;try{r=n(e)}catch{return}for(let i of r)if(!t.canShrinkWithoutContext(i))return;return r}function TT(e,t){let n=[];for(let r of Ib){let i=MT(r,e,t);i!==void 0&&T(n,i)}return n}var Vy=new WeakMap;function OT(e){let t=[];for(let n of Ib){let r=Ab(e,n,0,_n);r!==void 0&&T(t,r)}return t}function NT(e,t){let n=TP(Vy,e);n===void 0&&(n=OT(e),MP(Vy,e,n));let r=[];for(let i of n)PT(i,t)&&T(r,i);return r}var $T=[[0,127]],LT=[[0,55295],[57344,1114111]],DT=[[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]],FT=[[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]],Uy=String.fromCodePoint,_T=Math.min,jT=Math.max;function lc(e){if(e.length===1){let n=Uy(e[0]);return{num:1,build:()=>n}}let t=e[0];return{num:e[1]-e[0]+1,build:n=>Uy(t+n)}}function Wy(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=jT(s,u),p=_T(a,c);if(n.length>=1){let m=n[n.length-1];(m.length===1?m[0]:m[1])+1===d&&(d=m[0],Vg(n))}T(n,d===p?[d]:[d,p]),a<=p&&(r+=1),c<=p&&(i+=1)}}return n}var zy=Object.create(null);function BT(e){switch(e){case"full":return LT;case"ascii":return $T}}function VT(e,t){let n=`${e}:${t}`,r=zy[n];if(r!==void 0)return r;let i=BT(t),o=e==="binary"?i:Wy(i,DT),s=[];for(let l of o)T(s,lc(l));if(e==="grapheme"){let l=Wy(i,FT);for(let u of l){let c=lc(u);T(s,{num:c.num,build:d=>YP(c.build(d),"NFD")})}}let a=wr(...s);return zy[n]=a,a}function yi(e,t){return VT(e,t)}function UT(e){if(typeof e.unit=="object")return e.unit;switch(e.unit){case"grapheme":return yi("grapheme","full");case"grapheme-composite":return yi("composite","full");case"grapheme-ascii":case void 0:return yi("grapheme","ascii");case"binary":return yi("binary","full");case"binary-ascii":return yi("binary","ascii")}}function Pe(e={}){let t=UT(e),n=IT(t,e),r=NT(t,e);return le(t,{...e,experimentalCustomSlices:r}).map(CT,n)}var Mb=Map,Vc=String.fromCharCode,Uc={num:26,build:e=>Vc(e+97)},WT={num:26,build:e=>Vc(e+65)},Tb={num:10,build:e=>Vc(e+48)};function zT(e){let t=lP(e);return e!==t?t:`%${wi(gr(e,0),16)}`}function GT(e){if(typeof e!="string")throw new Error("Unsupported");return decodeURIComponent(e)}var KT=()=>Pe({unit:"binary",minLength:1,maxLength:1}).map(zT,GT),_u;function HT(){return _u===void 0&&(_u=wr(Uc)),_u}var cs;function uc(e){cs===void 0&&(cs=new Mb);let t=st(cs,e);return t===void 0&&(t=wr(Uc,Tb,{num:e.length,build:n=>e[n]}),yt(cs,e,t)),t}function qT(e){return wr(Uc,WT,Tb,{num:e.length,build:t=>e[t]})}var ds;function Wc(e){ds===void 0&&(ds=new Mb);let t=st(ds,e);return t===void 0&&(t=Me({weight:10,arbitrary:qT(e)},{weight:1,arbitrary:KT()}),yt(ds,e,t)),t}function Jt(e,t={}){let n=t.freq===void 0?6:t.freq,r=Gg(t,"nil")?t.nil:null,i=[{arbitrary:Re(r),weight:1,fallbackValue:{default:r}},{arbitrary:e,weight:n-1}],o={withCrossShrink:!0,depthSize:t.depthSize,maxDepth:t.maxDepth,depthIdentifier:t.depthIdentifier};return ac.from(i,o,"fc.option")}function YT(e){return e.length>63?!1:e.length<4||e[0]!=="x"||e[1]!=="n"||e[2]!=="-"||e[3]!=="-"}var Ob=Symbol("adapted-value");function ZT(e,t){let n=t(e.value_);return n.adapted?new O(n.value,Ob):e}var JT=class extends de{constructor(e,t){super(),this.sourceArb=e,this.adapter=t,this.adaptValue=n=>ZT(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===Ob?this.sourceArb.canShrinkWithoutContext(e)?this.sourceArb.shrink(e,void 0).map(this.adaptValue):_.nil():this.sourceArb.shrink(e,t).map(this.adaptValue)}};function Nb(e,t){return new JT(e,t)}function XT([e,t]){return t===null?e:`${e}${t[0]}${t[1]}`}function QT(e){if(typeof e!="string"||e.length===0)throw new Error("Unsupported");return e.length===1?[e[0],null]:[e[0],[ge(e,1,e.length-1),e[e.length-1]]]}function eO(e){let t=uc("");return j(t,Jt(j(Pe({unit:uc("-"),size:e,maxLength:61}),t))).map(XT,QT).filter(YT)}function tO(e){return`${ce(e[0],".")}.${e[1]}`}function nO(e){if(typeof e!="string")throw new Error("Unsupported type");let t=e.lastIndexOf(".");return[Ge(ge(e,0,t),"."),ge(e,t+1)]}function rO(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:[Ne(t,0,i),n]};return{adapted:!1,value:e}}function zc(e={}){let t=jc(e.size),n=ki("-1",t),r=Pe({unit:HT(),minLength:2,maxLength:63,size:n});return Nb(j(le(eO(t),{size:n,minLength:1,maxLength:127}),r),rO).map(tO,nO)}function iO(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:Ne(e,0,n)};return{adapted:!1,value:e}}function oO(e){return ce(e,".")}function sO(e){if(typeof e!="string")throw new Error("Unsupported");return Ge(e,".")}function aO(e){return`${e[0]}@${e[1]}`}function lO(e){if(typeof e!="string")throw new Error("Unsupported");return Ge(e,"@",2)}function uO(e={}){return j(Nb(le(Pe({unit:uc("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:e.size}),{minLength:1,maxLength:32,size:e.size}),iO).map(oO,sO),zc({size:e.size})).map(aO,lO)}var cO=qt.NEGATIVE_INFINITY,cc=qt.POSITIVE_INFINITY,$b=qt.EPSILON,Gc=P(2146435072)*P(4294967296),dO=-Gc-P(1),Gy=4503599627370496,fO=P(0xfffffffffffff),Ky=P("9007199254740992"),dc=new Float64Array(1),Hy=new Uint32Array(dc.buffer,dc.byteOffset);function pO(e){return dc[0]=e,[Hy[1],Hy[0]]}function hO(e){let{0:t,1:n}=pO(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*$b,a*=r===0?1:-1,{exponent:s,significand:a}}function qy(e,t){return e===-1022?P(t*Gy):P((t-1)*Gy)+(P(e+1023)<<P(52))}function Kc(e){if(e===cc)return Gc;if(e===cO)return dO;let t=hO(e),n=t.exponent,r=t.significand;return e>0||e===0&&1/e===cc?qy(n,r):-qy(n,-r)-P(1)}function fc(e){if(e<0)return-fc(-e-P(1));if(e===Gc)return cc;if(e<Ky)return qt(e)*2**-1074;let t=e-Ky,n=-1021+qt(t>>P(52));return(1+qt(t&fO)*$b)*2**n}var Yy=Number.isInteger,Zy=Object.is,ju=Number.NEGATIVE_INFINITY,Bu=Number.POSITIVE_INFINITY;function Lb(e,t,n,r){let{noDefaultInfinity:i=!1,minExcluded:o=!1,maxExcluded:s=!1,min:a=i?-t:ju,max:l=i?t:Bu}=e,u=o?a<-n?-r:Math.max(a,-n):a===ju?Math.max(a,-r):Math.max(a,-n),c=s?l>n?r:Math.min(l,n):l===Bu?Math.min(l,r):Math.min(l,n);return{noDefaultInfinity:!1,minExcluded:o||(a!==ju||o)&&Yy(u),maxExcluded:s||(l!==Bu||s)&&Yy(c),min:Zy(u,-0)?0:u,max:Zy(c,0)?-0:c,noNaN:e.noNaN||!1}}var Db=Number.NEGATIVE_INFINITY,Fb=Number.POSITIVE_INFINITY,mO=Number.MAX_VALUE,yO=45035996273704955e-1,pc=4503599627370496;function gO(e){return Lb(e,mO,yO,pc)}function bO(e){return e===4503599627370496?Fb:e===-4503599627370496?Db:e}function SO(e){if(typeof e!="number")throw new Error("Unsupported type");return e===Fb?pc:e===Db?-pc:e}var wO=Number.isInteger,_b=Number.isNaN,xO=Number.NEGATIVE_INFINITY,vO=Number.POSITIVE_INFINITY,Jy=Number.MAX_VALUE,RO=NaN;function Xy(e,t){if(_b(e))throw new Error("fc.double constraints."+t+" must be a 64-bit float");return Kc(e)}function kO(e){if(typeof e!="number")throw new Error("Unsupported type");return Kc(e)}function EO(e){return!wO(e)}function Qy(e){let{noDefaultInfinity:t=!1,noNaN:n=!1,minExcluded:r=!1,maxExcluded:i=!1,min:o=t?-Jy:xO,max:s=t?Jy:vO}=e,a=Xy(o,"min"),l=r?a+P(1):a,u=Xy(s,"max"),c=i?u-P(1):u;if(c<l)throw new Error("fc.double constraints.min must be smaller or equal to constraints.max");if(n)return Sn({min:l,max:c}).map(fc,kO);let d=c>P(0),p=d?l:l-P(1),m=d?c+P(1):c;return Sn({min:p,max:m}).map(f=>c<f||f<l?RO:fc(f),f=>{if(typeof f!="number")throw new Error("Unsupported type");return _b(f)?c!==m?m:p:Kc(f)})}function Ms(e={}){return e.noInteger?Qy(gO(e)).map(bO,SO).filter(EO):Qy(e)}var AO=Number.NEGATIVE_INFINITY,hc=Number.POSITIVE_INFINITY,CO=Math.imul,mc=2**127*(1+(2**23-1)/2**23),jb=2139095040,PO=-2139095041,yc=new Float32Array(1),IO=new Uint32Array(yc.buffer,yc.byteOffset);function MO(e){return yc[0]=e,IO[0]}function TO(e){let t=MO(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 eg(e,t){return e===-126?t*8388608:CO(e+127,8388608)+(t-1)*8388608}function Hc(e){if(e===hc)return jb;if(e===AO)return PO;let t=TO(e),n=t.exponent,r=t.significand;return e>0||e===0&&1/e===hc?eg(n,r):-eg(n,-r)-1}function gc(e){if(e<0)return-gc(-e-1);if(e===jb)return hc;if(e<16777216)return e*2**-149;let t=e-16777216,n=-125+(t>>23);return(1+(t&8388607)/8388608)*2**n}var Bb=Number.NEGATIVE_INFINITY,Vb=Number.POSITIVE_INFINITY,OO=mc,NO=83886075e-1,bc=8388608;function $O(e){return Lb(e,OO,NO,bc)}function LO(e){return e===8388608?Vb:e===-8388608?Bb:e}function DO(e){if(typeof e!="number")throw new Error("Unsupported type");return e===Vb?bc:e===Bb?-bc:e}var FO=Number.isInteger,Ub=Number.isNaN,_O=Math.fround,jO=Number.NEGATIVE_INFINITY,BO=Number.POSITIVE_INFINITY,VO=NaN;function tg(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(Ub(e)||_O(e)!==e)throw new Error(n);return Hc(e)}function UO(e){if(typeof e!="number")throw new Error("Unsupported type");return Hc(e)}function WO(e){return!FO(e)}function ng(e){let{noDefaultInfinity:t=!1,noNaN:n=!1,minExcluded:r=!1,maxExcluded:i=!1,min:o=t?-mc:jO,max:s=t?mc:BO}=e,a=tg(o,"min"),l=r?a+1:a,u=tg(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 te({min:l,max:c}).map(gc,UO);let d=c>0?l:l-1,p=c>0?c+1:c;return te({min:d,max:p}).map(m=>m>c||m<l?VO:gc(m),m=>{if(typeof m!="number")throw new Error("Unsupported type");return Ub(m)?c!==p?p:d:Hc(m)})}function Wb(e={}){return e.noInteger?ng($O(e)).map(LO,DO).filter(WO):ng(e)}function zO(e){return e.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function zb(e){return e.replace(/\*\//g,"*\\/")}var it=[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 Cs(e){let t=4294967295;for(let n=0;n<e.length;++n){let r=gr(e,n);if(r<128)t=it[t&255^r]^t>>8;else if(r<2048)t=it[t&255^(192|r>>6&31)]^t>>8,t=it[t&255^(128|r&63)]^t>>8;else if(r>=55296&&r<57344){let i=gr(e,++n);if(r>=56320||i<56320||i>57343||Number.isNaN(i))n-=1,t=it[t&255^239]^t>>8,t=it[t&255^191]^t>>8,t=it[t&255^189]^t>>8;else{let o=(r&1023)+64,s=i&1023;t=it[t&255^(240|o>>8&7)]^t>>8,t=it[t&255^(128|o>>2&63)]^t>>8,t=it[t&255^(128|s>>6&15|(o&3)<<4)]^t>>8,t=it[t&255^(128|s&63)]^t>>8}}else t=it[t&255^(224|r>>12&15)]^t>>8,t=it[t&255^(128|r>>6&63)]^t>>8,t=it[t&255^(128|r&63)]^t>>8}return(t|0)+2147483648}var GO=Object.getPrototypeOf,gi=class extends de{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 _.nil()}};function Ps(e){return GO(e)===gi.prototype&&e.generate===gi.prototype.generate&&e.canShrinkWithoutContext===gi.prototype.canShrinkWithoutContext&&e.shrink===gi.prototype.shrink?e:new gi(e)}var KO=Object.assign,HO=Object.keys;function Gb(e){return j(Ps(te()),Ps(te({min:1,max:4294967295}))).map(([t,n])=>{let r=()=>{let i={};return KO((s,a)=>{let l=ke(s),u=ke(a),c=e(Cs(`${t}${l}`)%n,Cs(`${t}${u}`)%n);return i[`[${l},${u}]`]=c,c},{toString:()=>{let s=HO(i).sort().map(a=>`${a} => ${ke(i[a])}`).map(a=>`/* ${zb(a)} */`);return`function(a, b) {
|
|
39
39
|
// With hash and stringify coming from fast-check${s.length!==0?`
|
|
40
40
|
${ce(s,`
|
|
41
41
|
`)}`:""}
|
|
@@ -43,17 +43,17 @@ ${zI(i)}`),o}function lb(e){return oc(e,ke)}async function ub(e){let t=[];functi
|
|
|
43
43
|
const hA = hash('${t}' + stringify(a)) % ${n};
|
|
44
44
|
const hB = hash('${t}' + stringify(b)) % ${n};
|
|
45
45
|
return cmp(hA, hB);
|
|
46
|
-
}`},[Te]:r})};return r()})}var
|
|
46
|
+
}`},[Te]:r})};return r()})}var qO=Object.assign;function YO(){return Gb(qO((e,t)=>e<t,{toString(){return"(hA, hB) => hA < hB"}}))}var ZO=Object.assign;function JO(){return Gb(ZO((e,t)=>e-t,{toString(){return"(hA, hB) => hA - hB"}}))}var XO=Object.defineProperties,QO=Object.keys;function e2(e){return j(le(e,{minLength:1}),Ps(te())).map(([t,n])=>{let r=()=>{let i={},o=(...a)=>{let l=ke(a),u=t[Cs(`${n}${l}`)%t.length];return i[l]=u,Fn(u)?u[Te]():u};function s(a){let l=U(U(Wg(QO(i)),u=>`${u} => ${ke(i[u])}`),u=>`/* ${zb(u)} */`);return`function(...args) {
|
|
47
47
|
// With hash and stringify coming from fast-check${l.length!==0?`
|
|
48
48
|
${l.join(`
|
|
49
49
|
`)}`:""}
|
|
50
50
|
const outs = ${a};
|
|
51
51
|
return outs[hash('${n}' + stringify(args)) % outs.length];
|
|
52
|
-
}`}return QO(o,{toString:{value:()=>s(ke(t))},[bt]:{value:()=>s(ke(t))},[Zt]:{value:async()=>s(await Nc(t))},[Te]:{value:r,configurable:!0}})};return r()})}var n2=Number.MIN_SAFE_INTEGER,r2=Number.MAX_SAFE_INTEGER;function Kb(){return new Sr(n2,r2)}var i2=Number.MAX_SAFE_INTEGER;function o2(){return new Sr(0,i2)}var s2=Number.parseInt;function a2(e){let[t,n]=e;switch(t){case"oct":return`0${wi(n,8)}`;case"hex":return`0x${wi(n,16)}`;default:return`${n}`}}function gs(e,t){let n=s2(e,t);if(wi(n,t)!==e)throw new Error("Invalid value");return n}function l2(e){if(typeof e!="string")throw new Error("Invalid type");return e.length>=2&&e[0]==="0"?e[1]==="x"?["hex",gs(ge(e,2),16)]:["oct",gs(ge(e,1),8)]:["dec",gs(e,10)]}function u2(e){return ce(e,".")}function c2(e){if(typeof e!="string")throw new Error("Invalid type");return U(Ge(e,"."),t=>gs(t,10))}function qc(){return j(yn(255),yn(255),yn(255),yn(255)).map(u2,c2)}function Nt(e){return j($t("dec","oct","hex"),yn(e)).map(a2,l2)}function Vu(e){return ce(e,".")}function Uu(e){if(typeof e!="string")throw new Error("Invalid type");return Ge(e,".")}function Hb(){return Me(j(Nt(255),Nt(255),Nt(255),Nt(255)).map(Vu,Uu),j(Nt(255),Nt(255),Nt(65535)).map(Vu,Uu),j(Nt(255),Nt(16777215)).map(Vu,Uu),Nt(4294967295))}function Yc(e){return e.length===0?[]:Ge(e,":")}function Zc(e){let t=Ge(e,":");return t.length>=2&&t[t.length-1].length<=4?[Ne(t,0,t.length-2),`${t[t.length-2]}:${t[t.length-1]}`]:[Ne(t,0,t.length-1),t[t.length-1]]}function d2(e){return`${ce(e[0],":")}:${e[1]}`}function f2(e){if(typeof e!="string")throw new Error("Invalid type");return Zc(e)}function p2(e){return`::${ce(e[0],":")}:${e[1]}`}function h2(e){if(typeof e!="string")throw new Error("Invalid type");if(!HP(e,"::"))throw new Error("Invalid value");return Zc(ge(e,2))}function bs(e){return`${ce(e[0],":")}::${ce(e[1],":")}:${e[2]}`}function Ss(e){if(typeof e!="string")throw new Error("Invalid type");let[t,n]=Ge(e,"::",2),[r,i]=Zc(n);return[Yc(t),r,i]}function m2(e){return bs([e[0],[e[1]],e[2]])}function y2(e){let t=Ss(e);return[t[0],ce(t[1],":"),t[2]]}function rg(e){return`${ce(e[0],":")}::${e[1]}`}function ig(e){if(typeof e!="string")throw new Error("Invalid type");let[t,n]=Ge(e,"::",2);return[Yc(t),n]}function g2(e){return`${ce(e[0],":")}::`}function b2(e){if(typeof e!="string")throw new Error("Invalid type");if(!qP(e,"::"))throw new Error("Invalid value");return[Yc(ge(e,0,e.length-2))]}function S2([e,t]){return`${e}:${t}`}function w2(e){if(typeof e!="string")throw new I("Invalid type");if(!e.includes(":"))throw new I("Invalid value");return e.split(":",2)}var x2="0123456789abcdef",Wu;function v2(){return Wu===void 0&&(Wu=te({min:0,max:15}).map(e=>x2[e],e=>{if(typeof e!="string")throw new I("Not a string");if(e.length!==1)throw new I("Invalid length");let t=gr(e,0);if(t<=57)return t-48;if(t<97)throw new I("Invalid character");return t-87})),Wu}function qb(){let e=Pe({unit:v2(),minLength:1,maxLength:4,size:"max"}),t=Me(j(e,e).map(S2,w2),qc());return Me(j(le(e,{minLength:6,maxLength:6,size:"max"}),t).map(d2,f2),j(le(e,{minLength:5,maxLength:5,size:"max"}),t).map(p2,h2),j(le(e,{minLength:0,maxLength:1,size:"max"}),le(e,{minLength:4,maxLength:4,size:"max"}),t).map(bs,Ss),j(le(e,{minLength:0,maxLength:2,size:"max"}),le(e,{minLength:3,maxLength:3,size:"max"}),t).map(bs,Ss),j(le(e,{minLength:0,maxLength:3,size:"max"}),le(e,{minLength:2,maxLength:2,size:"max"}),t).map(bs,Ss),j(le(e,{minLength:0,maxLength:4,size:"max"}),e,t).map(m2,y2),j(le(e,{minLength:0,maxLength:5,size:"max"}),t).map(rg,ig),j(le(e,{minLength:0,maxLength:6,size:"max"}),e).map(rg,ig),j(le(e,{minLength:0,maxLength:7,size:"max"})).map(g2,b2))}var R2=class extends de{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)}},k2=Object.getOwnPropertyNames;function E2(){let e=new Yt;return n=>{let r=st(e,n);return r!==void 0||(r=new R2(String(n)),yt(e,n,r)),r}}function Yb(e){let t=E2(),n=e(t),r=k2(n);for(let i of r){let o=t(i);o.underlying=n[i]}return n}function A2(e,t){for(let n of e){let r=t[n]||{};if(r.maxLength===void 0||r.maxLength>0)return!0}return!1}function C2(e,t){if(e.length===0)return Re([]);if(!A2(e,t))throw new I("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return j(...e.map(n=>le(Re(n),t[n]))).map(n=>vP(n)).filter(n=>n.length>0)}var og=Object.assign,ws=Object.create,Zb=Object.defineProperty,sg=Object.getPrototypeOf,P2=Object.prototype;function I2(e){return Zb(ws(null),bt,{configurable:!1,enumerable:!1,writable:!1,value:()=>e})}function ag(e,t){return I2(`<${ze(e)}#${t}>`)}function M2(e,t){let n=ws(P2);for(let r in e){let i=e[r],o=[];for(let s of i){let a=og(ws(sg(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]:U(u.index,c=>n[u.type][c])}Zb(a,bt,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let l=e[r][o],u=og(ws(sg(l)),l);for(let c in s){let d=s[c];u[c]=d.index===void 0?void 0:typeof d.index=="number"?ag(d.type,d.index):U(d.index,p=>ag(d.type,p))}return ke(u)}})}}return n}function T2(e){let t=0,n=new Yt;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=st(n,a.type);if(l===void 0&&(l=new Yt,yt(n,a.type,l)),DP(l,a.forwardRelationship))throw new I(`Cannot declare multiple inverse relationships for the same forward relationship ${ze(a.forwardRelationship)} on type ${ze(a.type)}`);yt(l,a.forwardRelationship,{type:i,property:s}),t+=1}}let r=new Yt;if(t===0)return r;for(let i in e){let o=e[i],s=st(n,i);if(s!==void 0)for(let a in o){let l=o[a];if(l.arity==="inverse")continue;let u=st(s,a);if(u!==void 0){if(u.type!==l.type)throw new I(`Inverse relationship ${ze(u.property)} on type ${ze(u.type)} references forward relationship ${ze(a)} but types do not match`);yt(r,l,u)}}}if(r.size!==t)throw new I("Some inverse relationships could not be matched with their corresponding forward relationships");return r}var lg=Object.create;function O2(e,t,n){switch(e){case"exclusive":return Re(n);case"successor":return As(te({min:t!==void 0?t+1:0,max:n}));case"any":return As(te({min:0,max:n}))}}function N2(e,t,n,r,i,o,s){let a=O2(t,n,r);switch(e){case"0-1":return Jt(a,{nil:void 0,depthIdentifier:i}).generate(o,s).value;case"1":return a.generate(o,s).value;case"many":{let l=0,u=Jt(jn(a,{depthIdentifier:i,selector:d=>d===r?d+ ++l:d,minLength:1}),{nil:[],depthIdentifier:i}).generate(o,s).value,c=0;return U(u,d=>d===r?d+c++:d)}}}var $2=class extends de{constructor(e,t){super(),this.relations=e,this.defaultEntities=t;let n=new yr,r=new yr;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(Es(n,a.type))throw new I(`Cannot mix exclusive with other strategies for type ${ze(a.type)}`);Si(r,a.type)}else{if(Es(r,a.type))throw new I(`Cannot mix exclusive with other strategies for type ${ze(a.type)}`);Si(n,a.type)}if(a.strategy==="successor"&&a.type!==i)throw new I("Cannot mix types for the strategy successor");if(a.strategy==="successor"&&a.arity==="1")throw new I("Cannot use an arity of 1 for the strategy successor")}}}this.inversedRelations=T2(e)}createEmptyLinksInstanceFor(e){let t=lg(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=lg(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=Fc();l.depth=o.depth;for(let u in s){let c=s[u];if(c.arity==="inverse")continue;let d=c.type,p=n[d],m=p.length,f=N2(c.arity,c.strategy||"any",d===o.type?o.indexInType:void 0,p.length,l,e,t);a[u]={type:d,index:f};let h=f===void 0?[]:typeof f=="number"?[f]:f;for(let y of h){y>=m&&(T(r,{type:d,indexInType:y,depth:o.depth+1}),T(p,this.createEmptyLinksInstanceFor(d)));let S=st(this.inversedRelations,c);if(S!==void 0){let x=p[y][S.property].index;T(x,o.indexInType)}}}}return r.length=0,new O(n,void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return _.nil()}};function L2(e,t){return new $2(e,t)}var D2=Object.keys,F2=Object.getOwnPropertySymbols,_2=Object.getOwnPropertyDescriptor;function j2(e){let t=D2(e),n=F2(e);for(let r=0;r!==n.length;++r){let i=n[r],o=_2(e,i);o&&o.enumerable&&t.push(i)}return t}var B2=Object.create,V2=Object.defineProperty,U2=Object.getOwnPropertyDescriptor,W2=Object.getOwnPropertyNames,z2=Object.getOwnPropertySymbols;function G2(e,t){return function(r){let i=r[1]?B2(null):{};for(let o=0;o!==e.length;++o){let s=r[0][o];s!==t&&V2(i,e[o],{value:s,configurable:!0,enumerable:!0,writable:!0})}return i}}function K2(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=U2(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=W2(r).length,u=z2(r).length;if(s!==l+u)throw new Error("Incompatible instance received: should not contain extra properties");return[a,i]}}var zu=Symbol("no-key");function Gu(e,t,n){let r=j2(e),i=[];for(let o=0;o!==r.length;++o){let s=r[o],a=e[s];t===void 0||Ht(t,s)!==-1?T(i,a):T(i,Jt(a,{nil:zu}))}return j(j(...i),n?Re(!1):Ei()).map(G2(r,zu),K2(r,zu))}function Sc(e,t){let n=t!==void 0&&!!t.noNullPrototype;if(t===void 0||!("requiredKeys"in t&&t.requiredKeys!==void 0))return Gu(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 Gu(e,r,n)}var H2=Object.create;function q2(e,t,n,r){let i=H2(null);for(let o in e){let s=e[o],a=Sc(s,r),l=t(o),u=n(o),c={minLength:l,maxLength:l};i[o]=u!==void 0?jn(a,{...c,selector:u}):le(a,c)}return Sc(i)}var ug=Object.create,Y2=Object.keys;function Z2(e,t,n={}){let r=Y2(e),i=n.initialPoolConstraints||ug(null),o=n.unicityConstraints||ug(null),s={noNullPrototype:n.noNullPrototype};return C2(r,i).chain(a=>L2(t,a).chain(l=>q2(e,u=>l[u].length,u=>o[u],s).map(u=>M2(u,l))))}function J2(e){return ce(U(e,t=>t[t.length-1]===","?ge(t,0,t.length-1):t)," ")}function X2(e){return function(n){if(typeof n!="string")throw new Error("Unsupported type");let r=[];for(let i of Ge(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 Q2(e){let t=ce(e," ");return t[t.length-1]===","&&(t=ge(t,0,t.length-1)),Pc(t[0])+ge(t,1)+"."}function eN(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]===","||Pc(nc(n[0]))!==n[0])throw new Error("Unsupported value");let r=nc(n[0])+ge(n,1,n.length-1),i=[],o=Ge(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 tN(e){return ce(e," ")}function nN(e){if(typeof e!="string")throw new Error("Unsupported type");let t=Ge(e,". ");for(let n=0;n<t.length-1;++n)t[n]+=".";return t}var g=(e,t)=>({arbitrary:Re(e),weight:t});function rN(){return Me(g("non",6),g("adipiscing",5),g("ligula",5),g("enim",5),g("pellentesque",5),g("in",5),g("augue",5),g("et",5),g("nulla",5),g("lorem",4),g("sit",4),g("sed",4),g("diam",4),g("fermentum",4),g("ut",4),g("eu",4),g("aliquam",4),g("mauris",4),g("vitae",4),g("felis",4),g("ipsum",3),g("dolor",3),g("amet,",3),g("elit",3),g("euismod",3),g("mi",3),g("orci",3),g("erat",3),g("praesent",3),g("egestas",3),g("leo",3),g("vel",3),g("sapien",3),g("integer",3),g("curabitur",3),g("convallis",3),g("purus",3),g("risus",2),g("suspendisse",2),g("lectus",2),g("nec,",2),g("ultricies",2),g("sed,",2),g("cras",2),g("elementum",2),g("ultrices",2),g("maecenas",2),g("massa,",2),g("varius",2),g("a,",2),g("semper",2),g("proin",2),g("nec",2),g("nisl",2),g("amet",2),g("duis",2),g("congue",2),g("libero",2),g("vestibulum",2),g("pede",2),g("blandit",2),g("sodales",2),g("ante",2),g("nibh",2),g("ac",2),g("aenean",2),g("massa",2),g("suscipit",2),g("sollicitudin",2),g("fusce",2),g("tempus",2),g("aliquam,",2),g("nunc",2),g("ullamcorper",2),g("rhoncus",2),g("metus",2),g("faucibus,",2),g("justo",2),g("magna",2),g("at",2),g("tincidunt",2),g("consectetur",1),g("tortor,",1),g("dignissim",1),g("congue,",1),g("non,",1),g("porttitor,",1),g("nonummy",1),g("molestie,",1),g("est",1),g("eleifend",1),g("mi,",1),g("arcu",1),g("scelerisque",1),g("vitae,",1),g("consequat",1),g("in,",1),g("pretium",1),g("volutpat",1),g("pharetra",1),g("tempor",1),g("bibendum",1),g("odio",1),g("dui",1),g("primis",1),g("faucibus",1),g("luctus",1),g("posuere",1),g("cubilia",1),g("curae,",1),g("hendrerit",1),g("velit",1),g("mauris,",1),g("gravida",1),g("ornare",1),g("ut,",1),g("pulvinar",1),g("varius,",1),g("turpis",1),g("nibh,",1),g("eros",1),g("id",1),g("aliquet",1),g("quis",1),g("lobortis",1),g("consectetuer",1),g("morbi",1),g("vehicula",1),g("tortor",1),g("tellus,",1),g("id,",1),g("eu,",1),g("quam",1),g("feugiat,",1),g("posuere,",1),g("iaculis",1),g("lectus,",1),g("tristique",1),g("mollis,",1),g("nisl,",1),g("vulputate",1),g("sem",1),g("vivamus",1),g("placerat",1),g("imperdiet",1),g("cursus",1),g("rutrum",1),g("iaculis,",1),g("augue,",1),g("lacus",1))}function iN(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=rN();return n==="sentences"?le(le(i,{minLength:1,size:"small"}).map(Q2,eN(i)),{minLength:1,maxLength:t,size:r}).map(tN,nN):le(i,{minLength:1,maxLength:t,size:r}).map(J2,X2(i))}function oN(e){return new Map(e)}function sN(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 aN(e){return e[0]}function wc(e,t,n={}){return jn(j(e,t),{minLength:n.minKeys,maxLength:n.maxKeys,size:n.size,selector:aN,depthIdentifier:n.depthIdentifier,comparator:"SameValueZero"}).map(oN,sN)}var fs=10;function lN(e){let t={};return(n=>{let r=n!==void 0?n:fs;if(!Gg(t,r)){let i=fs;fs=r-1,t[r]=e(r),fs=i}return t[r]})}function uN(e){let t=0;for(;e>P(0);)e&P(1)&&++t,e>>=P(1);return t}function cN(e,t){let n=(P(1)<<P(t))-P(1),r=e&n,i=uN(e-r),o=r;for(let s=P(1);s<=n&&i!==0;s<<=P(1))o&s||(o|=s,--i);return o}function ps(e,t){let n=[];for(let r=e.length-1;r!==-1;--r)t(e[r])!==e[r]&&T(n,r);return n}function dN(e,t,n){let r=P(0);for(let i=0,o=P(1);i!==n.length;++i,o<<=P(1))e[n[i]]!==t[n[i]]&&(r|=o);return r}function Ku(e,t,n,r){for(let i=0,o=P(1);i!==n.length;++i,o<<=P(1))t&o&&(e[n[i]]=r(e[n[i]]))}var fN=class extends de{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=ps(r,this.toggleCase),o=Sn(P(0),(P(1)<<P(i.length))-P(1)).generate(e,void 0);return Ku(r,o.value,i,this.toggleCase),new O(ce(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:dN(a,s,ps(a,this.toggleCase)),flagsContext:void 0}}else n={rawString:e,rawStringContext:void 0,flags:P(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=ps(s,this.toggleCase),l=cN(i,a.length);return Ku(s,l,a,this.toggleCase),new O(ce(s,""),this.buildContextFor(o,new O(l,void 0)))}).join(gn(()=>{let o=[...r],s=ps(o,this.toggleCase);return Sn(P(0),(P(1)<<P(s.length))-P(1)).shrink(i,n.flagsContext).map(a=>{let l=Ne(o);return Ku(l,a.value,s,this.toggleCase),new O(ce(l,""),this.buildContextFor(new O(r,n.rawStringContext),a))})}))}};function pN(e){let t=Pc(e);return t!==e?t:nc(e)}function hN(e,t){return new fN(e,t&&t.toggleCase||pN,t&&t.untoggleAll)}function mN(e){return _g.from(e)}function yN(e){if(!(e instanceof _g))throw new Error("Unexpected type");return[...e]}function Jb(e={}){return le(Wb(e),e).map(mN,yN)}function gN(e){return jg.from(e)}function bN(e){if(!(e instanceof jg))throw new Error("Unexpected type");return[...e]}function Xb(e={}){return le(Ms(e),e).map(gN,bN)}function Xt(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 le(i({min:s,max:a}),l).map(u=>r.from(u),u=>{if(!(u instanceof r))throw new Error("Invalid type");return[...u]})}function Qb(e={}){return Xt(e,-32768,32767,rP,te)}function eS(e={}){return Xt(e,-2147483648,2147483647,iP,te)}function tS(e={}){return Xt(e,-128,127,nP,te)}function nS(e={}){return Xt(e,0,65535,aP,te)}function rS(e={}){return Xt(e,0,4294967295,lP,te)}function iS(e={}){return Xt(e,0,255,oP,te)}function oS(e={}){return Xt(e,0,255,sP,te)}function SN(e){return e!==void 0}function cg(e){return e.hasToBeCloned?new O(e.value_,{generatorContext:e.context},()=>e.value):new O(e.value_,{generatorContext:e.context})}function dg(e){return e.hasToBeCloned?new O(e.value_,{shrinkerContext:e.context},()=>e.value):new O(e.value_,{shrinkerContext:e.context})}var wN=class extends de{constructor(e,t){super(),this.generatorArbitrary=e,this.shrinkerArbitrary=t}generate(e,t){return cg(this.generatorArbitrary.generate(e,t))}canShrinkWithoutContext(e){return this.shrinkerArbitrary.canShrinkWithoutContext(e)}shrink(e,t){return SN(t)?"generatorContext"in t?this.generatorArbitrary.shrink(e,t.generatorContext).map(cg):this.shrinkerArbitrary.shrink(e,t.shrinkerContext).map(dg):this.shrinkerArbitrary.shrink(e,void 0).map(dg)}};function xc(e,t,n){let r=te({min:e,max:t});return t===n?r:new wN(r,te({min:e,max:n}))}var xN=Math.min,vc=Math.max,fg=Dg.isArray,vN=Object.entries;function RN(e){let t=-1;for(let n=0;n!==e.length;++n)t=vc(t,e[n][0]);return t}function kN(e,t){let n=Dg(e);for(let r=0;r!==t.length;++r){let i=t[r];i[0]<e&&(n[i[0]]=i[1])}return n}function sS(e,t={}){let{size:n,minNumElements:r=0,maxLength:i=_n,maxNumElements:o=i,noTrailingHole:s,depthIdentifier:a}=t,l=vi(n,vi(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=xN(o,i),c=t.maxNumElements!==void 0||n!==void 0?n:"=",d=jn(j(xc(0,vc(l-1,0),vc(i-1,0)),e),{size:c,minLength:r,maxLength:u,selector:p=>p[0],depthIdentifier:a}).map(p=>kN(RN(p)+1,p),p=>{if(!fg(p))throw new Error("Not supported entry type");if(s&&p.length!==0&&!(p.length-1 in p))throw new Error("No trailing hole");return U(vN(p),m=>[Number(m[0]),m[1]])});return s||i===r?d:j(d,xc(r,l,i)).map(p=>{let m=p[0],f=p[1];if(m.length>=f)return m;let h=Ne(m);return h.length=f,h},p=>{if(!fg(p))throw new Error("Not supported entry type");return[p,p.length]})}function EN(e){return new Set(e)}function AN(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 aS(e,t={}){return jn(e,{minLength:t.minLength,maxLength:t.maxLength,size:t.size,depthIdentifier:t.depthIdentifier,comparator:"SameValueZero"}).map(EN,AN)}function CN(e,t,n,r,i,o){return Bc(e,t,{maxKeys:n,noNullPrototype:!o,size:r,depthIdentifier:i})}function PN(e){return Me(tS(e),iS(e),oS(e),Qb(e),nS(e),eS(e),rS(e),Jb(e),Xb(e))}function lS(e){let t=e.values,n=e.depthSize,r=Fc(),i=e.maxDepth,o=e.maxKeys,s=e.size,a=Me(...t,...e.withBigInt?[Sn()]:[],...e.withDate?[Rb()]:[]);return Yb(l=>({anything:Me({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=>ke(u))]:[],...e.withTypedArray?[PN({maxLength:o,size:s})]:[],...e.withSparseArray?[sS(l("anything"),{maxNumElements:o,size:s,depthIdentifier:r})]:[]),keys:e.withObjectString?Me({arbitrary:e.key,weight:10},{arbitrary:l("anything").map(u=>ke(u)),weight:1}):e.key,array:le(l("anything"),{maxLength:o,size:s,depthIdentifier:r}),set:aS(l("anything"),{maxLength:o,size:s,depthIdentifier:r}),map:Me(wc(l("keys"),l("anything"),{maxKeys:o,size:s,depthIdentifier:r}),wc(l("anything"),l("anything"),{maxKeys:o,size:s,depthIdentifier:r})),object:CN(l("keys"),l("anything"),o,s,r,e.withNullPrototype)})).anything}function IN(e){switch(typeof e){case"boolean":return new Fg(e);case"number":return new qt(e);case"string":return new ze(e);default:return e}}function MN(e){return typeof e!="object"||e===null||!("constructor"in e)?e:e.constructor===Fg||e.constructor===qt||e.constructor===ze?e.valueOf():e}function TN(e){return e.map(IN,MN)}function ON(e,t){return[Ei(),Kb(),Ms(),t(e),Me(t(e),Re(null),Re(void 0))]}function NN(e){return e.map(t=>TN(t))}function $N(e,t){return t?NN(e).concat(e):e}function uS(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:Pe(t),values:$N(e.values!==void 0?e.values:ON(t,Pe),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 LN(e){return Bc(e.key,lS(e),{maxKeys:e.maxKeys,noNullPrototype:!e.withNullPrototype,size:e.size})}function DN(e){return LN(uS(e))}function FN(e,t){let{depthSize:n,maxDepth:r}=t;return{key:e,values:[Ei(),Ms({noDefaultInfinity:!0,noNaN:!0}),e,Re(null)],depthSize:n,maxDepth:r}}function cS(e){return lS(uS(e))}function dS(e={}){let t=e.noUnicodeString===void 0||e.noUnicodeString===!0;return cS(FN("stringUnit"in e?Pe({unit:e.stringUnit}):t?Pe():Pe({unit:"binary"}),e))}var _N=JSON.stringify,jN=JSON.parse;function BN(e){if(typeof e!="string")throw new I("Cannot unmap the passed value");return jN(e)}function VN(e={}){return dS(e).map(_N,BN)}var UN=Object.defineProperties;function Hu(e,t){return`Stream(${t!==void 0?`${ce(t,",")}\u2026`:`${e} emitted`})`}var WN=class extends de{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 UN(new _(s(this.arb,e.clone())),{toString:{value:()=>Hu(o,i!==null?i.map(ke):void 0)},[bt]:{value:()=>Hu(o,i!==null?i.map(ke):void 0)},[Zt]:{value:async()=>Hu(o,i!==null?await Promise.all(i.map(Nc)):void 0)},[Te]:{value:r,enumerable:!0}})};return new O(r(),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return _.nil()}};function zN(e,t){return new WN(e,t!==void 0&&typeof t=="object"&&"noHistory"in t?!t.noHistory:!0)}function GN(e){return ce(e,"")}function pg(e){if(typeof e!="string")throw new Error("Cannot unmap the passed value");return[...e]}function KN(e){switch(e.length%4){case 0:return e;case 3:return`${e}=`;case 2:return`${e}==`;default:return ge(e,1)}}function HN(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 ge(e,0,t)}var qu=String.fromCharCode;function qN(e){return e<26?qu(e+65):e<52?qu(e+97-26):e<62?qu(e+48-52):e===62?"+":"/"}function YN(e){if(typeof e!="string"||e.length!==1)throw new I("Invalid entry");let t=gr(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 ZN(){return te({min:0,max:63}).map(qN,YN)}function JN(e={}){let{minLength:t=0,maxLength:n=_n,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 I("Minimal length should be inferior or equal to maximal length");if(i%4!==0)throw new I("Minimal length of base64 strings must be a multiple of 4");if(o%4!==0)throw new I("Maximal length of base64 strings must be a multiple of 4");let a=ZN();return le(a,{minLength:i,maxLength:o,size:s,experimentalCustomSlices:OT(a,pg)}).map(GN,pg).map(KN,HN)}var hg=Object.is;function XN(e,t){let n=new Yt,r=0;for(let i of e)hg(i,-0)?++r:yt(n,i,(st(n,i)||0)+1);for(let i=0;i!==t.length;++i){if(!(i in t))return!1;let o=t[i];if(hg(o,-0)){if(r===0)return!1;--r}else{let s=st(n,o)||0;if(s===0)return!1;yt(n,o,s-1)}}return!0}var QN=Math.floor,mg=Math.log,e6=Array.isArray,fS=class extends de{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 Sr(n,r),this.biasedLengthArb=n!==r?new Sr(n,n+QN(mg(r-n)/mg(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=U(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]),Ug(i,a,1)}return this.isOrdered&&Wg(o,(s,a)=>s-a),new O(U(o,s=>this.originalArray[s]),n.context)}canShrinkWithoutContext(e){return!e6(e)||!this.lengthArb.canShrinkWithoutContext(e.length)?!1:XN(this.originalArray,e)}shrink(e,t){return e.length===0?_.nil():this.lengthArb.shrink(e.length,t).map(n=>new O(Ne(e,e.length-n.value),n.context)).join(e.length>this.minLength?gn(()=>this.shrink(Ne(e,1),void 0).filter(n=>this.minLength<=n.value.length+1).map(n=>new O([e[0],...n.value],void 0))):_.nil())}};function t6(e,t={}){let{minLength:n=0,maxLength:r=e.length}=t;return new fS(e,!0,n,r)}function n6(e,t={}){let{minLength:n=0,maxLength:r=e.length}=t;return new fS(e,!1,n,r)}var r6={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"},i6={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 o6(e){return e<10?ze(e):r6[e]}function yg(e,t){let n="";for(;e.length+n.length<t;)n+="0";return n+e}function gg(e){let t="";for(let n=e;n!==0;){let r=n>>5;t=o6(n-(r<<5))+t,n=r}return t}function s6(e,t){let n=~~(e/1073741824),r=e&1073741823;return yg(gg(n),t-6)+yg(gg(r),6)}function pS(e){return function(n){return s6(n,e)}}function Yu(e){if(typeof e!="string")throw new I("Unsupported type");let t=0,n=1;for(let r=e.length-1;r>=0;--r){let i=i6[e[r]];if(i===void 0)throw new I("Unsupported type");t+=i*n,n*=32}return t}var a6=pS(10),bg=pS(8);function l6(e){return a6(e[0])+bg(e[1])+bg(e[2])}function u6(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 c6(){return j(te({min:0,max:0xffffffffffff}),te({min:0,max:0xffffffffff}),te({min:0,max:0xffffffffff})).map(l6,u6)}function hS(e){return YP(wi(e,16),8,"0")}function d6(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!==hS(t))throw new Error("Unsupported value: invalid content");return t}function Zu(e,t){return te({min:e,max:t}).map(hS,d6)}function f6(e){return`${e[0]}-${ge(e[1],4)}-${ge(e[1],0,4)}-${ge(e[2],0,4)}-${ge(e[2],4)}${e[3]}`}var p6=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function h6(e){if(typeof e!="string")throw new Error("Unsupported type");let t=p6.exec(e);if(t===null)throw new Error("Unsupported type");return[t[1],t[3]+t[2],t[4]+ge(t[5],0,4),ge(t[5],4)]}var Sg="0123456789abcdef";function m6(e){let t={},n={};for(let o=0;o!==e.length;++o){let s=Sg[o],a=Sg[e[o]];t[s]=a,n[a]=s}function r(o){return t[o[0]]+ge(o,1)}function i(o){if(typeof o!="string")throw new I("Cannot produce non-string values");let s=n[o[0]];if(s===void 0)throw new I("Cannot produce strings not starting by the version in hexa code");return s+ge(o,1)}return{versionsApplierMapper:r,versionsApplierUnmapper:i}}function y6(e){let t={};for(let n of e){if(t[n])throw new I(`Version ${n} has been requested at least twice for uuid`);if(t[n]=!0,n<1||n>15)throw new I(`Version must be a value in [1-15] for uuid, but received ${n}`);if(~~n!==n)throw new I(`Version must be an integer value for uuid, but received ${n}`)}if(e.length===0)throw new I("Must provide at least one version for uuid")}function g6(e={}){let t=Zu(0,4294967295),n=e.version!==void 0?typeof e.version=="number"?[e.version]:e.version:[1,2,3,4,5,6,7,8];y6(n);let{versionsApplierMapper:r,versionsApplierUnmapper:i}=m6(n);return j(t,Zu(0,268435456*n.length-1).map(r,i),Zu(2147483648,3221225471),t).map(f6,h6)}function b6(e){return Pe({unit:Wc("-._~!$&'()*+,;=:"),size:e})}function S6([e,t,n]){return(e===null?"":`${e}@`)+t+(n===null?"":`:${n}`)}function w6(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 x6(e){return`[${e}]`}function v6(e){if(typeof e!="string"||e[0]!=="["||e[e.length-1]!=="]")throw new Error("Unsupported");return e.substring(1,e.length-1)}function mS(e){let t=e||{},n=t.size,r=[zc({size:n}),...t.withIPv4===!0?[qc()]:[],...t.withIPv6===!0?[qb().map(x6,v6)]:[],...t.withIPv4Extended===!0?[Hb()]:[]];return j(t.withUserInfo===!0?Jt(b6(n)):Re(null),Me(...r),t.withPort===!0?Jt(yn(65535)):Re(null)).map(S6,w6)}function yS(e){return Pe({unit:Wc("-._~!$&'()*+,;=:@/?"),size:e})}function gS(e={}){return yS(e.size)}function bS(e={}){return Pe({unit:Wc("-._~!$&'()*+,;=:@"),size:e.size})}function R6(e){return ce(U(e,t=>`/${t}`),"")}function k6(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 Ug(Ge(e,"/"),1)}function E6(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 Ju(e,t){return le(bS({size:e}),{size:t}).map(R6,k6)}function A6(e){let[t,n]=E6(e);return t===n?Ju(t,n):Me(Ju(t,n),Ju(n,t))}function SS(e){return A6(jc((e||{}).size))}function wS(e={}){return yS(e.size)}function C6(e){let[t,n,r]=e;return`${t}://${n}${r}${e[3]===null?"":`?${e[3]}`}${e[4]===null?"":`#${e[4]}`}`}var P6=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function I6(e){if(typeof e!="string")throw new Error("Incompatible value received: type");let t=P6.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 M6(e){let t=e||{},n=jc(t.size),r=t.authoritySettings!==void 0&&t.authoritySettings.size!==void 0?ki(t.authoritySettings.size,n):n,i={...t.authoritySettings,size:r};return j($t(...t.validSchemes||["http","https"]),mS(i),SS({size:n}),t.withQueryParameters===!0?Jt(wS({size:n})):Re(null),t.withFragments===!0?Jt(gS({size:n})):Re(null)).map(C6,I6)}var T6=class xS{constructor(t,n){this.commands=t,this.metadataForReplay=n,this[Te]=function(){return new xS(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}},O6=class Rc{constructor(t){if(this.cmd=t,this.hasRan=!1,Tc(t)){let n=t[bt];this[bt]=function(){return n.call(t)}}if(Oc(t)){let n=t[Zt];this[Zt]=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 Fn(this.cmd)?new Rc(this.cmd[Te]()):new Rc(this.cmd)}toString(){return this.cmd.toString()}},wg=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)}},N6=class extends de{constructor(e,t,n,r,i){super(),this.sourceReplayPath=r,this.disableReplayLog=i,this.oneCommandArb=Me(...e).map(o=>new O6(o)),this.lengthArb=xc(0,t,n),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(wg.stringify(this.replayPath))}`}buildValueFor(e,t){let n=e.map(i=>i.value_),r={shrunkOnce:t,items:e};return new O(new T6(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?wg.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 _.nil();let n=t,r=n.shrunkOnce,i=n.items,o=this.filterForShrinkImpl(i);if(o.length===0)return _.nil();let s=r?_.nil():new _([[]][Symbol.iterator]()),a=[];for(let l=0;l!==o.length;++l)a.push(gn(()=>{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(gn(()=>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 $6(e,t={}){let{size:n,maxCommands:r=_n,disableReplayLog:i=!1,replayPath:o=null}=t;return new N6(e,vi(n,0,r,t.maxCommands!==void 0),r,o,i)}var L6=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}},D6=function*(e,t){for(let n of t)yield new L6(e,n)},vS=(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}),F6=(e,t)=>vS({then:o=>{o(e())}},t,void 0,(o,s,a)=>{o.check(s)&&o.run(s,a)},(o,s)=>s()),_6=e=>typeof e.then=="function",RS=async(e,t,n=Promise.resolve())=>await vS({then:s=>{let a=e();return _6(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 j6(e,t){F6(e,t)}async function B6(e,t){await RS(e,t)}async function V6(e,t,n){let r=RS(t,D6(e,n),e.schedule(Promise.resolve(),"startModel"));await e.waitFor(r),await e.waitAll()}var hs=e=>e(),kS=class kc{constructor(t,n){this.act=t,this.taskSelector=n,this.lastTaskId=0,this.sourceTaskSelector=n.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[Te]=function(){return new kc(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 ${GO(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?ke(s):void 0})}scheduleInternal(t,n,r,i,o,s){let a=++this.lastTaskId,l,u=new Promise((c,d)=>{l=()=>{let p=Promise.resolve(s!==void 0?r.then(()=>s()):r);return p.then(m=>{this.log(t,a,n,i,"resolved",m),c(m)},m=>{this.log(t,a,n,i,"rejected",m),d(m)}),p}});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||hs)}scheduleFunction(t,n){return(...r)=>this.scheduleInternal("function",`${t.name}(${r.map(ke).join(",")})`,t(...r),void 0,n||hs)}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 p=t[c],[m,f,h]=typeof p=="function"?[p,p.name,void 0]:[p.builder,p.label,p.metadata],y=this.scheduleInternal("sequence",f,i,h,n||hs,()=>m());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||hs;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,p=null,m=async()=>{for(c=50,c=50;!r&&c>0;--c)await Promise.resolve();if(!r&&this.scheduledTasks.length>0)return o!==void 0&&o(),p=this.waitOne(i),p.then(()=>(p=null,m()),S=>{throw p=null,r=!0,u(S),S});!r&&s!==void 0&&s(),d=null},f=()=>{if(d!==null){c=51;return}d=m().catch(()=>{})},h=()=>{let S=this.scheduledWatchers.indexOf(f);S!==-1&&this.scheduledWatchers.splice(S,1),S===0&&this.scheduledWatchers.length!==0&&this.scheduledWatchers[0]()},y=new Promise((S,x)=>{l=b=>{h(),S(b)},u=b=>{h(),x(b)}});return t.then(S=>{r=!0,p===null?l(S):p.then(()=>l(S),x=>u(x))},S=>{r=!0,p===null?u(S):p.then(()=>u(S),()=>u(S))}),(this.scheduledTasks.length>0||a)&&this.scheduledWatchers.length===0&&f(),this.scheduledWatchers.push(f),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(kc.buildLog).map(t=>`-> ${t}`).join(`
|
|
53
|
-
`)+"`"}};function ES(e){let t=0;return{clone:()=>ES(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 xg(e,t){return new kS(e,ES(t))}function AS(e){let t=e.clone();return{clone:()=>AS(t),nextTaskIndex:n=>e.nextInt(0,n.length-1)}}var U6=class extends de{constructor(e){super(),this.act=e}generate(e,t){return new O(new kS(this.act,AS(e.clone())),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return _.nil()}};function W6(e){let{act:t=n=>n()}=e||{};return new U6(t)}function z6(e,t){let{act:n=r=>r()}=Array.isArray(e)?t||{}:e||{};return Array.isArray(e)?xg(n,e):function(r,...i){return xg(n,i)}}function G6(e={}){return Xt(e,P("-9223372036854775808"),P("9223372036854775807"),eP,Sn)}function K6(e={}){return Xt(e,P(0),P("18446744073709551615"),tP,Sn)}function H6(e,t){return t}var Xu=Math.floor,q6=Math.min;function lt(e,t){switch(e.type){case"Char":return{astNode:e,minLength:1};case"Repetition":switch(e.quantifier.kind){case"*":{let n=lt(e.expression,t);return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:t},expression:n.astNode},minLength:0}}case"+":{let n=lt(e.expression,t),r=n.minLength>1?n.minLength:1;return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:1,to:Xu(t/r)},expression:n.astNode},minLength:n.minLength}}case"?":{let n=lt(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?Xu(t/e.quantifier.from):t,r=lt(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:Xu(t/i)},expression:r.astNode},minLength:e.quantifier.from*r.minLength}:{astNode:{...e,expression:r.astNode},minLength:e.quantifier.from*r.minLength}}default:return H6(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=lt(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?lt(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=lt(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=lt(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=lt(e.left,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:o,right:null},minLength:0}}let n=lt(e.left,t),r=lt(e.right,t);return n.minLength>t?r:r.minLength>t?n:{astNode:{...e,left:n.astNode,right:r.astNode},minLength:q6(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 Y6(e,t){return lt(e,t).astNode}function Z6(e){return new Error(`Unsupported AST node! Received: ${ke(e)}`)}function xs(e,t,n){if(!t&&!n)return e;let r={hasStart:!1,hasEnd:!1},i=CS(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 CS(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)=>xs(i,t&&o===0,n&&o===e.expressions.length-1))};case"CharacterClass":return e;case"ClassRange":return e;case"Group":return{...e,expression:CS(e.expression,t,n,r)};case"Disjunction":return r.hasStart=!0,r.hasEnd=!0,{...e,left:e.left!==null?xs(e.left,t,n):null,right:e.right!==null?xs(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 Z6(e)}}function J6(e){return xs(e,!0,!0)}function vg(e,t){return e[t]>="\uD800"&&e[t]<="\uDBFF"&&e[t+1]>="\uDC00"&&e[t+1]<="\uDFFF"?2:1}function Ce(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Ec(e){return e>="0"&&e<="9"}function PS(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 X6(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=PS(e,r):i==="("&&(n+=1)}throw new Error("Missing closing ')'")}function Q6(e,t){let n=!1;for(let r=t;r!==e.length;++r){let i=e[r];if(!Ec(i)){if(t===r)return-1;if(i===","){if(n)return-1;n=!0}else return i==="}"?r:-1}}return-1}function e$(e,t,n,r){switch(e[t]){case"[":return r===1?t+1:PS(e,t+1)+1;case"{":{if(r===1)return t+1;let i=Q6(e,t+1);return i===-1?t+1:i+1}case"(":return r===1?t+1:X6(e,t+1)+1;case"]":case"}":case")":return t+1;case"\\":{let i=e[t+1];switch(i){case"x":if(Ce(e[t+2])&&Ce(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(Ce(e[t+3]))return t+5;throw new Error(`Unexpected token '${e.substring(t,t+5)}' found`)}if(e[t+5]==="}"){if(Ce(e[t+3])&&Ce(e[t+4]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`)}if(e[t+6]==="}"){if(Ce(e[t+3])&&Ce(e[t+4])&&Ce(e[t+5]))return t+7;throw new Error(`Unexpected token '${e.substring(t,t+7)}' found`)}if(e[t+7]==="}"){if(Ce(e[t+3])&&Ce(e[t+4])&&Ce(e[t+5])&&Ce(e[t+6]))return t+8;throw new Error(`Unexpected token '${e.substring(t,t+8)}' found`)}if(e[t+8]==="}"&&Ce(e[t+3])&&Ce(e[t+4])&&Ce(e[t+5])&&Ce(e[t+6])&&Ce(e[t+7]))return t+9;throw new Error(`Unexpected token '${e.substring(t,t+9)}' found`)}if(Ce(e[t+2])&&Ce(e[t+3])&&Ce(e[t+4])&&Ce(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(Ec(i)){let o=n?e.length:Math.min(t+4,e.length),s=t+2;for(;s<o&&Ec(e[s]);++s);return s}return t+(n?vg(e,t+1):1)+1}}default:return t+(n?vg(e,t):1)}}function ms(e,t,n,r){let i=e$(e,t,n,r);return e.substring(t,i)}var Rg={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},Ts={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"},Ri=Xc(Ts),Jc={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"},Ac=Xc(Jc),IS={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"},kg=Xc(IS);function Xc(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 t$(e){return e in Jc||e in Ac}function n$(e){return e in Ts||e in Ri}function Eg(e){if(e in Rg)return Rg[e];if(e in Ri)return Ri[e];if(e in Ts||e==="General_Category"||e==="Script"||e==="Script_Extensions")return e;throw new Error(`Unknown Unicode property name: ${e}`)}function Ag(e){if(e in Ac)return Ac[e];if(e in kg)return kg[e];if(e in Ri)return Ri[e];if(e in Jc||e in IS||e in Ts)return e;throw new Error(`Unknown Unicode property value: ${e}`)}function r$(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:Eg(r),canonicalValue:Ag(i)}}if(t$(e))return{type:"UnicodeProperty",name:"General_Category",value:e,negative:t,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:Ag(e)};if(n$(e)){let r=Eg(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 Qu=String.fromCodePoint;function ec(e){let t=e.pop();if(t===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return t}function MS(e){return e>="0"&&e<="9"}function vs(e,t){return{type:"Char",kind:"simple",symbol:e,value:e,codePoint:e.codePointAt(0)||-1,escaped:t}}function pr(e,t){return{type:"Char",kind:"meta",symbol:t,value:e,codePoint:t.codePointAt(0)||-1}}function hn(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 tc(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:Qu(r),value:e,codePoint:r}}case"u":{if(e==="\\u")return vs("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:Qu(r),value:e,codePoint:r}}case"0":return pr(e,"\0");case"n":return pr(e,`
|
|
54
|
-
`);case"f":return pr(e,"\f");case"r":return pr(e,"\r");case"t":return pr(e," ");case"v":return pr(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(MS(t)){let n=e.substring(1),r=Number(n);return{type:"Char",kind:"decimal",symbol:Qu(r),value:e,codePoint:r}}if(e.length>2&&(t==="p"||t==="P")){let n=t==="P";return
|
|
52
|
+
}`}return XO(o,{toString:{value:()=>s(ke(t))},[bt]:{value:()=>s(ke(t))},[Zt]:{value:async()=>s(await Nc(t))},[Te]:{value:r,configurable:!0}})};return r()})}var t2=Number.MIN_SAFE_INTEGER,n2=Number.MAX_SAFE_INTEGER;function Kb(){return new Sr(t2,n2)}var r2=Number.MAX_SAFE_INTEGER;function i2(){return new Sr(0,r2)}var o2=Number.parseInt;function s2(e){let[t,n]=e;switch(t){case"oct":return`0${wi(n,8)}`;case"hex":return`0x${wi(n,16)}`;default:return`${n}`}}function gs(e,t){let n=o2(e,t);if(wi(n,t)!==e)throw new Error("Invalid value");return n}function a2(e){if(typeof e!="string")throw new Error("Invalid type");return e.length>=2&&e[0]==="0"?e[1]==="x"?["hex",gs(ge(e,2),16)]:["oct",gs(ge(e,1),8)]:["dec",gs(e,10)]}function l2(e){return ce(e,".")}function u2(e){if(typeof e!="string")throw new Error("Invalid type");return U(Ge(e,"."),t=>gs(t,10))}function qc(){return j(yn(255),yn(255),yn(255),yn(255)).map(l2,u2)}function Nt(e){return j($t("dec","oct","hex"),yn(e)).map(s2,a2)}function Vu(e){return ce(e,".")}function Uu(e){if(typeof e!="string")throw new Error("Invalid type");return Ge(e,".")}function Hb(){return Me(j(Nt(255),Nt(255),Nt(255),Nt(255)).map(Vu,Uu),j(Nt(255),Nt(255),Nt(65535)).map(Vu,Uu),j(Nt(255),Nt(16777215)).map(Vu,Uu),Nt(4294967295))}function Yc(e){return e.length===0?[]:Ge(e,":")}function Zc(e){let t=Ge(e,":");return t.length>=2&&t[t.length-1].length<=4?[Ne(t,0,t.length-2),`${t[t.length-2]}:${t[t.length-1]}`]:[Ne(t,0,t.length-1),t[t.length-1]]}function c2(e){return`${ce(e[0],":")}:${e[1]}`}function d2(e){if(typeof e!="string")throw new Error("Invalid type");return Zc(e)}function f2(e){return`::${ce(e[0],":")}:${e[1]}`}function p2(e){if(typeof e!="string")throw new Error("Invalid type");if(!KP(e,"::"))throw new Error("Invalid value");return Zc(ge(e,2))}function bs(e){return`${ce(e[0],":")}::${ce(e[1],":")}:${e[2]}`}function Ss(e){if(typeof e!="string")throw new Error("Invalid type");let[t,n]=Ge(e,"::",2),[r,i]=Zc(n);return[Yc(t),r,i]}function h2(e){return bs([e[0],[e[1]],e[2]])}function m2(e){let t=Ss(e);return[t[0],ce(t[1],":"),t[2]]}function rg(e){return`${ce(e[0],":")}::${e[1]}`}function ig(e){if(typeof e!="string")throw new Error("Invalid type");let[t,n]=Ge(e,"::",2);return[Yc(t),n]}function y2(e){return`${ce(e[0],":")}::`}function g2(e){if(typeof e!="string")throw new Error("Invalid type");if(!HP(e,"::"))throw new Error("Invalid value");return[Yc(ge(e,0,e.length-2))]}function b2([e,t]){return`${e}:${t}`}function S2(e){if(typeof e!="string")throw new I("Invalid type");if(!e.includes(":"))throw new I("Invalid value");return e.split(":",2)}var w2="0123456789abcdef",Wu;function x2(){return Wu===void 0&&(Wu=te({min:0,max:15}).map(e=>w2[e],e=>{if(typeof e!="string")throw new I("Not a string");if(e.length!==1)throw new I("Invalid length");let t=gr(e,0);if(t<=57)return t-48;if(t<97)throw new I("Invalid character");return t-87})),Wu}function qb(){let e=Pe({unit:x2(),minLength:1,maxLength:4,size:"max"}),t=Me(j(e,e).map(b2,S2),qc());return Me(j(le(e,{minLength:6,maxLength:6,size:"max"}),t).map(c2,d2),j(le(e,{minLength:5,maxLength:5,size:"max"}),t).map(f2,p2),j(le(e,{minLength:0,maxLength:1,size:"max"}),le(e,{minLength:4,maxLength:4,size:"max"}),t).map(bs,Ss),j(le(e,{minLength:0,maxLength:2,size:"max"}),le(e,{minLength:3,maxLength:3,size:"max"}),t).map(bs,Ss),j(le(e,{minLength:0,maxLength:3,size:"max"}),le(e,{minLength:2,maxLength:2,size:"max"}),t).map(bs,Ss),j(le(e,{minLength:0,maxLength:4,size:"max"}),e,t).map(h2,m2),j(le(e,{minLength:0,maxLength:5,size:"max"}),t).map(rg,ig),j(le(e,{minLength:0,maxLength:6,size:"max"}),e).map(rg,ig),j(le(e,{minLength:0,maxLength:7,size:"max"})).map(y2,g2))}var v2=class extends de{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)}},R2=Object.getOwnPropertyNames;function k2(){let e=new Yt;return n=>{let r=st(e,n);return r!==void 0||(r=new v2(String(n)),yt(e,n,r)),r}}function Yb(e){let t=k2(),n=e(t),r=R2(n);for(let i of r){let o=t(i);o.underlying=n[i]}return n}function E2(e,t){for(let n of e){let r=t[n]||{};if(r.maxLength===void 0||r.maxLength>0)return!0}return!1}function A2(e,t){if(e.length===0)return Re([]);if(!E2(e,t))throw new I("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return j(...e.map(n=>le(Re(n),t[n]))).map(n=>xP(n)).filter(n=>n.length>0)}var og=Object.assign,ws=Object.create,Zb=Object.defineProperty,sg=Object.getPrototypeOf,C2=Object.prototype;function P2(e){return Zb(ws(null),bt,{configurable:!1,enumerable:!1,writable:!1,value:()=>e})}function ag(e,t){return P2(`<${ze(e)}#${t}>`)}function I2(e,t){let n=ws(C2);for(let r in e){let i=e[r],o=[];for(let s of i){let a=og(ws(sg(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]:U(u.index,c=>n[u.type][c])}Zb(a,bt,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let l=e[r][o],u=og(ws(sg(l)),l);for(let c in s){let d=s[c];u[c]=d.index===void 0?void 0:typeof d.index=="number"?ag(d.type,d.index):U(d.index,p=>ag(d.type,p))}return ke(u)}})}}return n}function M2(e){let t=0,n=new Yt;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=st(n,a.type);if(l===void 0&&(l=new Yt,yt(n,a.type,l)),LP(l,a.forwardRelationship))throw new I(`Cannot declare multiple inverse relationships for the same forward relationship ${ze(a.forwardRelationship)} on type ${ze(a.type)}`);yt(l,a.forwardRelationship,{type:i,property:s}),t+=1}}let r=new Yt;if(t===0)return r;for(let i in e){let o=e[i],s=st(n,i);if(s!==void 0)for(let a in o){let l=o[a];if(l.arity==="inverse")continue;let u=st(s,a);if(u!==void 0){if(u.type!==l.type)throw new I(`Inverse relationship ${ze(u.property)} on type ${ze(u.type)} references forward relationship ${ze(a)} but types do not match`);yt(r,l,u)}}}if(r.size!==t)throw new I("Some inverse relationships could not be matched with their corresponding forward relationships");return r}var lg=Object.create;function T2(e,t,n){switch(e){case"exclusive":return Re(n);case"successor":return As(te({min:t!==void 0?t+1:0,max:n}));case"any":return As(te({min:0,max:n}))}}function O2(e,t,n,r,i,o,s){let a=T2(t,n,r);switch(e){case"0-1":return Jt(a,{nil:void 0,depthIdentifier:i}).generate(o,s).value;case"1":return a.generate(o,s).value;case"many":{let l=0,u=Jt(jn(a,{depthIdentifier:i,selector:d=>d===r?d+ ++l:d,minLength:1}),{nil:[],depthIdentifier:i}).generate(o,s).value,c=0;return U(u,d=>d===r?d+c++:d)}}}var N2=class extends de{constructor(e,t){super(),this.relations=e,this.defaultEntities=t;let n=new yr,r=new yr;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(Es(n,a.type))throw new I(`Cannot mix exclusive with other strategies for type ${ze(a.type)}`);Si(r,a.type)}else{if(Es(r,a.type))throw new I(`Cannot mix exclusive with other strategies for type ${ze(a.type)}`);Si(n,a.type)}if(a.strategy==="successor"&&a.type!==i)throw new I("Cannot mix types for the strategy successor");if(a.strategy==="successor"&&a.arity==="1")throw new I("Cannot use an arity of 1 for the strategy successor")}}}this.inversedRelations=M2(e)}createEmptyLinksInstanceFor(e){let t=lg(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=lg(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=Fc();l.depth=o.depth;for(let u in s){let c=s[u];if(c.arity==="inverse")continue;let d=c.type,p=n[d],m=p.length,f=O2(c.arity,c.strategy||"any",d===o.type?o.indexInType:void 0,p.length,l,e,t);a[u]={type:d,index:f};let h=f===void 0?[]:typeof f=="number"?[f]:f;for(let y of h){y>=m&&(T(r,{type:d,indexInType:y,depth:o.depth+1}),T(p,this.createEmptyLinksInstanceFor(d)));let S=st(this.inversedRelations,c);if(S!==void 0){let x=p[y][S.property].index;T(x,o.indexInType)}}}}return r.length=0,new O(n,void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return _.nil()}};function $2(e,t){return new N2(e,t)}var L2=Object.keys,D2=Object.getOwnPropertySymbols,F2=Object.getOwnPropertyDescriptor;function _2(e){let t=L2(e),n=D2(e);for(let r=0;r!==n.length;++r){let i=n[r],o=F2(e,i);o&&o.enumerable&&t.push(i)}return t}var j2=Object.create,B2=Object.defineProperty,V2=Object.getOwnPropertyDescriptor,U2=Object.getOwnPropertyNames,W2=Object.getOwnPropertySymbols;function z2(e,t){return function(r){let i=r[1]?j2(null):{};for(let o=0;o!==e.length;++o){let s=r[0][o];s!==t&&B2(i,e[o],{value:s,configurable:!0,enumerable:!0,writable:!0})}return i}}function G2(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=V2(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=U2(r).length,u=W2(r).length;if(s!==l+u)throw new Error("Incompatible instance received: should not contain extra properties");return[a,i]}}var zu=Symbol("no-key");function Gu(e,t,n){let r=_2(e),i=[];for(let o=0;o!==r.length;++o){let s=r[o],a=e[s];t===void 0||Ht(t,s)!==-1?T(i,a):T(i,Jt(a,{nil:zu}))}return j(j(...i),n?Re(!1):Ei()).map(z2(r,zu),G2(r,zu))}function Sc(e,t){let n=t!==void 0&&!!t.noNullPrototype;if(t===void 0||!("requiredKeys"in t&&t.requiredKeys!==void 0))return Gu(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 Gu(e,r,n)}var K2=Object.create;function H2(e,t,n,r){let i=K2(null);for(let o in e){let s=e[o],a=Sc(s,r),l=t(o),u=n(o),c={minLength:l,maxLength:l};i[o]=u!==void 0?jn(a,{...c,selector:u}):le(a,c)}return Sc(i)}var ug=Object.create,q2=Object.keys;function Y2(e,t,n={}){let r=q2(e),i=n.initialPoolConstraints||ug(null),o=n.unicityConstraints||ug(null),s={noNullPrototype:n.noNullPrototype};return A2(r,i).chain(a=>$2(t,a).chain(l=>H2(e,u=>l[u].length,u=>o[u],s).map(u=>I2(u,l))))}function Z2(e){return ce(U(e,t=>t[t.length-1]===","?ge(t,0,t.length-1):t)," ")}function J2(e){return function(n){if(typeof n!="string")throw new Error("Unsupported type");let r=[];for(let i of Ge(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 X2(e){let t=ce(e," ");return t[t.length-1]===","&&(t=ge(t,0,t.length-1)),Pc(t[0])+ge(t,1)+"."}function Q2(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]===","||Pc(nc(n[0]))!==n[0])throw new Error("Unsupported value");let r=nc(n[0])+ge(n,1,n.length-1),i=[],o=Ge(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 eN(e){return ce(e," ")}function tN(e){if(typeof e!="string")throw new Error("Unsupported type");let t=Ge(e,". ");for(let n=0;n<t.length-1;++n)t[n]+=".";return t}var g=(e,t)=>({arbitrary:Re(e),weight:t});function nN(){return Me(g("non",6),g("adipiscing",5),g("ligula",5),g("enim",5),g("pellentesque",5),g("in",5),g("augue",5),g("et",5),g("nulla",5),g("lorem",4),g("sit",4),g("sed",4),g("diam",4),g("fermentum",4),g("ut",4),g("eu",4),g("aliquam",4),g("mauris",4),g("vitae",4),g("felis",4),g("ipsum",3),g("dolor",3),g("amet,",3),g("elit",3),g("euismod",3),g("mi",3),g("orci",3),g("erat",3),g("praesent",3),g("egestas",3),g("leo",3),g("vel",3),g("sapien",3),g("integer",3),g("curabitur",3),g("convallis",3),g("purus",3),g("risus",2),g("suspendisse",2),g("lectus",2),g("nec,",2),g("ultricies",2),g("sed,",2),g("cras",2),g("elementum",2),g("ultrices",2),g("maecenas",2),g("massa,",2),g("varius",2),g("a,",2),g("semper",2),g("proin",2),g("nec",2),g("nisl",2),g("amet",2),g("duis",2),g("congue",2),g("libero",2),g("vestibulum",2),g("pede",2),g("blandit",2),g("sodales",2),g("ante",2),g("nibh",2),g("ac",2),g("aenean",2),g("massa",2),g("suscipit",2),g("sollicitudin",2),g("fusce",2),g("tempus",2),g("aliquam,",2),g("nunc",2),g("ullamcorper",2),g("rhoncus",2),g("metus",2),g("faucibus,",2),g("justo",2),g("magna",2),g("at",2),g("tincidunt",2),g("consectetur",1),g("tortor,",1),g("dignissim",1),g("congue,",1),g("non,",1),g("porttitor,",1),g("nonummy",1),g("molestie,",1),g("est",1),g("eleifend",1),g("mi,",1),g("arcu",1),g("scelerisque",1),g("vitae,",1),g("consequat",1),g("in,",1),g("pretium",1),g("volutpat",1),g("pharetra",1),g("tempor",1),g("bibendum",1),g("odio",1),g("dui",1),g("primis",1),g("faucibus",1),g("luctus",1),g("posuere",1),g("cubilia",1),g("curae,",1),g("hendrerit",1),g("velit",1),g("mauris,",1),g("gravida",1),g("ornare",1),g("ut,",1),g("pulvinar",1),g("varius,",1),g("turpis",1),g("nibh,",1),g("eros",1),g("id",1),g("aliquet",1),g("quis",1),g("lobortis",1),g("consectetuer",1),g("morbi",1),g("vehicula",1),g("tortor",1),g("tellus,",1),g("id,",1),g("eu,",1),g("quam",1),g("feugiat,",1),g("posuere,",1),g("iaculis",1),g("lectus,",1),g("tristique",1),g("mollis,",1),g("nisl,",1),g("vulputate",1),g("sem",1),g("vivamus",1),g("placerat",1),g("imperdiet",1),g("cursus",1),g("rutrum",1),g("iaculis,",1),g("augue,",1),g("lacus",1))}function rN(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=nN();return n==="sentences"?le(le(i,{minLength:1,size:"small"}).map(X2,Q2(i)),{minLength:1,maxLength:t,size:r}).map(eN,tN):le(i,{minLength:1,maxLength:t,size:r}).map(Z2,J2(i))}function iN(e){return new Map(e)}function oN(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 sN(e){return e[0]}function wc(e,t,n={}){return jn(j(e,t),{minLength:n.minKeys,maxLength:n.maxKeys,size:n.size,selector:sN,depthIdentifier:n.depthIdentifier,comparator:"SameValueZero"}).map(iN,oN)}var fs=10;function aN(e){let t={};return(n=>{let r=n!==void 0?n:fs;if(!Gg(t,r)){let i=fs;fs=r-1,t[r]=e(r),fs=i}return t[r]})}function lN(e){let t=0;for(;e>P(0);)e&P(1)&&++t,e>>=P(1);return t}function uN(e,t){let n=(P(1)<<P(t))-P(1),r=e&n,i=lN(e-r),o=r;for(let s=P(1);s<=n&&i!==0;s<<=P(1))o&s||(o|=s,--i);return o}function ps(e,t){let n=[];for(let r=e.length-1;r!==-1;--r)t(e[r])!==e[r]&&T(n,r);return n}function cN(e,t,n){let r=P(0);for(let i=0,o=P(1);i!==n.length;++i,o<<=P(1))e[n[i]]!==t[n[i]]&&(r|=o);return r}function Ku(e,t,n,r){for(let i=0,o=P(1);i!==n.length;++i,o<<=P(1))t&o&&(e[n[i]]=r(e[n[i]]))}var dN=class extends de{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=ps(r,this.toggleCase),o=Sn(P(0),(P(1)<<P(i.length))-P(1)).generate(e,void 0);return Ku(r,o.value,i,this.toggleCase),new O(ce(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:cN(a,s,ps(a,this.toggleCase)),flagsContext:void 0}}else n={rawString:e,rawStringContext:void 0,flags:P(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=ps(s,this.toggleCase),l=uN(i,a.length);return Ku(s,l,a,this.toggleCase),new O(ce(s,""),this.buildContextFor(o,new O(l,void 0)))}).join(gn(()=>{let o=[...r],s=ps(o,this.toggleCase);return Sn(P(0),(P(1)<<P(s.length))-P(1)).shrink(i,n.flagsContext).map(a=>{let l=Ne(o);return Ku(l,a.value,s,this.toggleCase),new O(ce(l,""),this.buildContextFor(new O(r,n.rawStringContext),a))})}))}};function fN(e){let t=Pc(e);return t!==e?t:nc(e)}function pN(e,t){return new dN(e,t&&t.toggleCase||fN,t&&t.untoggleAll)}function hN(e){return _g.from(e)}function mN(e){if(!(e instanceof _g))throw new Error("Unexpected type");return[...e]}function Jb(e={}){return le(Wb(e),e).map(hN,mN)}function yN(e){return jg.from(e)}function gN(e){if(!(e instanceof jg))throw new Error("Unexpected type");return[...e]}function Xb(e={}){return le(Ms(e),e).map(yN,gN)}function Xt(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 le(i({min:s,max:a}),l).map(u=>r.from(u),u=>{if(!(u instanceof r))throw new Error("Invalid type");return[...u]})}function Qb(e={}){return Xt(e,-32768,32767,nP,te)}function eS(e={}){return Xt(e,-2147483648,2147483647,rP,te)}function tS(e={}){return Xt(e,-128,127,tP,te)}function nS(e={}){return Xt(e,0,65535,sP,te)}function rS(e={}){return Xt(e,0,4294967295,aP,te)}function iS(e={}){return Xt(e,0,255,iP,te)}function oS(e={}){return Xt(e,0,255,oP,te)}function bN(e){return e!==void 0}function cg(e){return e.hasToBeCloned?new O(e.value_,{generatorContext:e.context},()=>e.value):new O(e.value_,{generatorContext:e.context})}function dg(e){return e.hasToBeCloned?new O(e.value_,{shrinkerContext:e.context},()=>e.value):new O(e.value_,{shrinkerContext:e.context})}var SN=class extends de{constructor(e,t){super(),this.generatorArbitrary=e,this.shrinkerArbitrary=t}generate(e,t){return cg(this.generatorArbitrary.generate(e,t))}canShrinkWithoutContext(e){return this.shrinkerArbitrary.canShrinkWithoutContext(e)}shrink(e,t){return bN(t)?"generatorContext"in t?this.generatorArbitrary.shrink(e,t.generatorContext).map(cg):this.shrinkerArbitrary.shrink(e,t.shrinkerContext).map(dg):this.shrinkerArbitrary.shrink(e,void 0).map(dg)}};function xc(e,t,n){let r=te({min:e,max:t});return t===n?r:new SN(r,te({min:e,max:n}))}var wN=Math.min,vc=Math.max,fg=Dg.isArray,xN=Object.entries;function vN(e){let t=-1;for(let n=0;n!==e.length;++n)t=vc(t,e[n][0]);return t}function RN(e,t){let n=Dg(e);for(let r=0;r!==t.length;++r){let i=t[r];i[0]<e&&(n[i[0]]=i[1])}return n}function sS(e,t={}){let{size:n,minNumElements:r=0,maxLength:i=_n,maxNumElements:o=i,noTrailingHole:s,depthIdentifier:a}=t,l=vi(n,vi(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=wN(o,i),c=t.maxNumElements!==void 0||n!==void 0?n:"=",d=jn(j(xc(0,vc(l-1,0),vc(i-1,0)),e),{size:c,minLength:r,maxLength:u,selector:p=>p[0],depthIdentifier:a}).map(p=>RN(vN(p)+1,p),p=>{if(!fg(p))throw new Error("Not supported entry type");if(s&&p.length!==0&&!(p.length-1 in p))throw new Error("No trailing hole");return U(xN(p),m=>[Number(m[0]),m[1]])});return s||i===r?d:j(d,xc(r,l,i)).map(p=>{let m=p[0],f=p[1];if(m.length>=f)return m;let h=Ne(m);return h.length=f,h},p=>{if(!fg(p))throw new Error("Not supported entry type");return[p,p.length]})}function kN(e){return new Set(e)}function EN(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 aS(e,t={}){return jn(e,{minLength:t.minLength,maxLength:t.maxLength,size:t.size,depthIdentifier:t.depthIdentifier,comparator:"SameValueZero"}).map(kN,EN)}function AN(e,t,n,r,i,o){return Bc(e,t,{maxKeys:n,noNullPrototype:!o,size:r,depthIdentifier:i})}function CN(e){return Me(tS(e),iS(e),oS(e),Qb(e),nS(e),eS(e),rS(e),Jb(e),Xb(e))}function lS(e){let t=e.values,n=e.depthSize,r=Fc(),i=e.maxDepth,o=e.maxKeys,s=e.size,a=Me(...t,...e.withBigInt?[Sn()]:[],...e.withDate?[Rb()]:[]);return Yb(l=>({anything:Me({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=>ke(u))]:[],...e.withTypedArray?[CN({maxLength:o,size:s})]:[],...e.withSparseArray?[sS(l("anything"),{maxNumElements:o,size:s,depthIdentifier:r})]:[]),keys:e.withObjectString?Me({arbitrary:e.key,weight:10},{arbitrary:l("anything").map(u=>ke(u)),weight:1}):e.key,array:le(l("anything"),{maxLength:o,size:s,depthIdentifier:r}),set:aS(l("anything"),{maxLength:o,size:s,depthIdentifier:r}),map:Me(wc(l("keys"),l("anything"),{maxKeys:o,size:s,depthIdentifier:r}),wc(l("anything"),l("anything"),{maxKeys:o,size:s,depthIdentifier:r})),object:AN(l("keys"),l("anything"),o,s,r,e.withNullPrototype)})).anything}function PN(e){switch(typeof e){case"boolean":return new Fg(e);case"number":return new qt(e);case"string":return new ze(e);default:return e}}function IN(e){return typeof e!="object"||e===null||!("constructor"in e)?e:e.constructor===Fg||e.constructor===qt||e.constructor===ze?e.valueOf():e}function MN(e){return e.map(PN,IN)}function TN(e,t){return[Ei(),Kb(),Ms(),t(e),Me(t(e),Re(null),Re(void 0))]}function ON(e){return e.map(t=>MN(t))}function NN(e,t){return t?ON(e).concat(e):e}function uS(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:Pe(t),values:NN(e.values!==void 0?e.values:TN(t,Pe),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 $N(e){return Bc(e.key,lS(e),{maxKeys:e.maxKeys,noNullPrototype:!e.withNullPrototype,size:e.size})}function LN(e){return $N(uS(e))}function DN(e,t){let{depthSize:n,maxDepth:r}=t;return{key:e,values:[Ei(),Ms({noDefaultInfinity:!0,noNaN:!0}),e,Re(null)],depthSize:n,maxDepth:r}}function cS(e){return lS(uS(e))}function dS(e={}){let t=e.noUnicodeString===void 0||e.noUnicodeString===!0;return cS(DN("stringUnit"in e?Pe({unit:e.stringUnit}):t?Pe():Pe({unit:"binary"}),e))}var FN=JSON.stringify,_N=JSON.parse;function jN(e){if(typeof e!="string")throw new I("Cannot unmap the passed value");return _N(e)}function BN(e={}){return dS(e).map(FN,jN)}var VN=Object.defineProperties;function Hu(e,t){return`Stream(${t!==void 0?`${ce(t,",")}\u2026`:`${e} emitted`})`}var UN=class extends de{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 VN(new _(s(this.arb,e.clone())),{toString:{value:()=>Hu(o,i!==null?i.map(ke):void 0)},[bt]:{value:()=>Hu(o,i!==null?i.map(ke):void 0)},[Zt]:{value:async()=>Hu(o,i!==null?await Promise.all(i.map(Nc)):void 0)},[Te]:{value:r,enumerable:!0}})};return new O(r(),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return _.nil()}};function WN(e,t){return new UN(e,t!==void 0&&typeof t=="object"&&"noHistory"in t?!t.noHistory:!0)}function zN(e){return ce(e,"")}function pg(e){if(typeof e!="string")throw new Error("Cannot unmap the passed value");return[...e]}function GN(e){switch(e.length%4){case 0:return e;case 3:return`${e}=`;case 2:return`${e}==`;default:return ge(e,1)}}function KN(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 ge(e,0,t)}var qu=String.fromCharCode;function HN(e){return e<26?qu(e+65):e<52?qu(e+97-26):e<62?qu(e+48-52):e===62?"+":"/"}function qN(e){if(typeof e!="string"||e.length!==1)throw new I("Invalid entry");let t=gr(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 YN(){return te({min:0,max:63}).map(HN,qN)}function ZN(e={}){let{minLength:t=0,maxLength:n=_n,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 I("Minimal length should be inferior or equal to maximal length");if(i%4!==0)throw new I("Minimal length of base64 strings must be a multiple of 4");if(o%4!==0)throw new I("Maximal length of base64 strings must be a multiple of 4");let a=YN();return le(a,{minLength:i,maxLength:o,size:s,experimentalCustomSlices:TT(a,pg)}).map(zN,pg).map(GN,KN)}var hg=Object.is;function JN(e,t){let n=new Yt,r=0;for(let i of e)hg(i,-0)?++r:yt(n,i,(st(n,i)||0)+1);for(let i=0;i!==t.length;++i){if(!(i in t))return!1;let o=t[i];if(hg(o,-0)){if(r===0)return!1;--r}else{let s=st(n,o)||0;if(s===0)return!1;yt(n,o,s-1)}}return!0}var XN=Math.floor,mg=Math.log,QN=Array.isArray,fS=class extends de{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 Sr(n,r),this.biasedLengthArb=n!==r?new Sr(n,n+XN(mg(r-n)/mg(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=U(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]),Ug(i,a,1)}return this.isOrdered&&Wg(o,(s,a)=>s-a),new O(U(o,s=>this.originalArray[s]),n.context)}canShrinkWithoutContext(e){return!QN(e)||!this.lengthArb.canShrinkWithoutContext(e.length)?!1:JN(this.originalArray,e)}shrink(e,t){return e.length===0?_.nil():this.lengthArb.shrink(e.length,t).map(n=>new O(Ne(e,e.length-n.value),n.context)).join(e.length>this.minLength?gn(()=>this.shrink(Ne(e,1),void 0).filter(n=>this.minLength<=n.value.length+1).map(n=>new O([e[0],...n.value],void 0))):_.nil())}};function e6(e,t={}){let{minLength:n=0,maxLength:r=e.length}=t;return new fS(e,!0,n,r)}function t6(e,t={}){let{minLength:n=0,maxLength:r=e.length}=t;return new fS(e,!1,n,r)}var n6={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"},r6={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 i6(e){return e<10?ze(e):n6[e]}function yg(e,t){let n="";for(;e.length+n.length<t;)n+="0";return n+e}function gg(e){let t="";for(let n=e;n!==0;){let r=n>>5;t=i6(n-(r<<5))+t,n=r}return t}function o6(e,t){let n=~~(e/1073741824),r=e&1073741823;return yg(gg(n),t-6)+yg(gg(r),6)}function pS(e){return function(n){return o6(n,e)}}function Yu(e){if(typeof e!="string")throw new I("Unsupported type");let t=0,n=1;for(let r=e.length-1;r>=0;--r){let i=r6[e[r]];if(i===void 0)throw new I("Unsupported type");t+=i*n,n*=32}return t}var s6=pS(10),bg=pS(8);function a6(e){return s6(e[0])+bg(e[1])+bg(e[2])}function l6(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 u6(){return j(te({min:0,max:0xffffffffffff}),te({min:0,max:0xffffffffff}),te({min:0,max:0xffffffffff})).map(a6,l6)}function hS(e){return qP(wi(e,16),8,"0")}function c6(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!==hS(t))throw new Error("Unsupported value: invalid content");return t}function Zu(e,t){return te({min:e,max:t}).map(hS,c6)}function d6(e){return`${e[0]}-${ge(e[1],4)}-${ge(e[1],0,4)}-${ge(e[2],0,4)}-${ge(e[2],4)}${e[3]}`}var f6=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function p6(e){if(typeof e!="string")throw new Error("Unsupported type");let t=f6.exec(e);if(t===null)throw new Error("Unsupported type");return[t[1],t[3]+t[2],t[4]+ge(t[5],0,4),ge(t[5],4)]}var Sg="0123456789abcdef";function h6(e){let t={},n={};for(let o=0;o!==e.length;++o){let s=Sg[o],a=Sg[e[o]];t[s]=a,n[a]=s}function r(o){return t[o[0]]+ge(o,1)}function i(o){if(typeof o!="string")throw new I("Cannot produce non-string values");let s=n[o[0]];if(s===void 0)throw new I("Cannot produce strings not starting by the version in hexa code");return s+ge(o,1)}return{versionsApplierMapper:r,versionsApplierUnmapper:i}}function m6(e){let t={};for(let n of e){if(t[n])throw new I(`Version ${n} has been requested at least twice for uuid`);if(t[n]=!0,n<1||n>15)throw new I(`Version must be a value in [1-15] for uuid, but received ${n}`);if(~~n!==n)throw new I(`Version must be an integer value for uuid, but received ${n}`)}if(e.length===0)throw new I("Must provide at least one version for uuid")}function y6(e={}){let t=Zu(0,4294967295),n=e.version!==void 0?typeof e.version=="number"?[e.version]:e.version:[1,2,3,4,5,6,7,8];m6(n);let{versionsApplierMapper:r,versionsApplierUnmapper:i}=h6(n);return j(t,Zu(0,268435456*n.length-1).map(r,i),Zu(2147483648,3221225471),t).map(d6,p6)}function g6(e){return Pe({unit:Wc("-._~!$&'()*+,;=:"),size:e})}function b6([e,t,n]){return(e===null?"":`${e}@`)+t+(n===null?"":`:${n}`)}function S6(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 w6(e){return`[${e}]`}function x6(e){if(typeof e!="string"||e[0]!=="["||e[e.length-1]!=="]")throw new Error("Unsupported");return e.substring(1,e.length-1)}function mS(e){let t=e||{},n=t.size,r=[zc({size:n}),...t.withIPv4===!0?[qc()]:[],...t.withIPv6===!0?[qb().map(w6,x6)]:[],...t.withIPv4Extended===!0?[Hb()]:[]];return j(t.withUserInfo===!0?Jt(g6(n)):Re(null),Me(...r),t.withPort===!0?Jt(yn(65535)):Re(null)).map(b6,S6)}function yS(e){return Pe({unit:Wc("-._~!$&'()*+,;=:@/?"),size:e})}function gS(e={}){return yS(e.size)}function bS(e={}){return Pe({unit:Wc("-._~!$&'()*+,;=:@"),size:e.size})}function v6(e){return ce(U(e,t=>`/${t}`),"")}function R6(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 Ug(Ge(e,"/"),1)}function k6(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 Ju(e,t){return le(bS({size:e}),{size:t}).map(v6,R6)}function E6(e){let[t,n]=k6(e);return t===n?Ju(t,n):Me(Ju(t,n),Ju(n,t))}function SS(e){return E6(jc((e||{}).size))}function wS(e={}){return yS(e.size)}function A6(e){let[t,n,r]=e;return`${t}://${n}${r}${e[3]===null?"":`?${e[3]}`}${e[4]===null?"":`#${e[4]}`}`}var C6=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function P6(e){if(typeof e!="string")throw new Error("Incompatible value received: type");let t=C6.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 I6(e){let t=e||{},n=jc(t.size),r=t.authoritySettings!==void 0&&t.authoritySettings.size!==void 0?ki(t.authoritySettings.size,n):n,i={...t.authoritySettings,size:r};return j($t(...t.validSchemes||["http","https"]),mS(i),SS({size:n}),t.withQueryParameters===!0?Jt(wS({size:n})):Re(null),t.withFragments===!0?Jt(gS({size:n})):Re(null)).map(A6,P6)}var M6=class xS{constructor(t,n){this.commands=t,this.metadataForReplay=n,this[Te]=function(){return new xS(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}},T6=class Rc{constructor(t){if(this.cmd=t,this.hasRan=!1,Tc(t)){let n=t[bt];this[bt]=function(){return n.call(t)}}if(Oc(t)){let n=t[Zt];this[Zt]=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 Fn(this.cmd)?new Rc(this.cmd[Te]()):new Rc(this.cmd)}toString(){return this.cmd.toString()}},wg=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)}},O6=class extends de{constructor(e,t,n,r,i){super(),this.sourceReplayPath=r,this.disableReplayLog=i,this.oneCommandArb=Me(...e).map(o=>new T6(o)),this.lengthArb=xc(0,t,n),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(wg.stringify(this.replayPath))}`}buildValueFor(e,t){let n=e.map(i=>i.value_),r={shrunkOnce:t,items:e};return new O(new M6(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?wg.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 _.nil();let n=t,r=n.shrunkOnce,i=n.items,o=this.filterForShrinkImpl(i);if(o.length===0)return _.nil();let s=r?_.nil():new _([[]][Symbol.iterator]()),a=[];for(let l=0;l!==o.length;++l)a.push(gn(()=>{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(gn(()=>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 N6(e,t={}){let{size:n,maxCommands:r=_n,disableReplayLog:i=!1,replayPath:o=null}=t;return new O6(e,vi(n,0,r,t.maxCommands!==void 0),r,o,i)}var $6=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}},L6=function*(e,t){for(let n of t)yield new $6(e,n)},vS=(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}),D6=(e,t)=>vS({then:o=>{o(e())}},t,void 0,(o,s,a)=>{o.check(s)&&o.run(s,a)},(o,s)=>s()),F6=e=>typeof e.then=="function",RS=async(e,t,n=Promise.resolve())=>await vS({then:s=>{let a=e();return F6(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 _6(e,t){D6(e,t)}async function j6(e,t){await RS(e,t)}async function B6(e,t,n){let r=RS(t,L6(e,n),e.schedule(Promise.resolve(),"startModel"));await e.waitFor(r),await e.waitAll()}var hs=e=>e(),kS=class kc{constructor(t,n){this.act=t,this.taskSelector=n,this.lastTaskId=0,this.sourceTaskSelector=n.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[Te]=function(){return new kc(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 ${zO(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?ke(s):void 0})}scheduleInternal(t,n,r,i,o,s){let a=++this.lastTaskId,l,u=new Promise((c,d)=>{l=()=>{let p=Promise.resolve(s!==void 0?r.then(()=>s()):r);return p.then(m=>{this.log(t,a,n,i,"resolved",m),c(m)},m=>{this.log(t,a,n,i,"rejected",m),d(m)}),p}});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||hs)}scheduleFunction(t,n){return(...r)=>this.scheduleInternal("function",`${t.name}(${r.map(ke).join(",")})`,t(...r),void 0,n||hs)}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 p=t[c],[m,f,h]=typeof p=="function"?[p,p.name,void 0]:[p.builder,p.label,p.metadata],y=this.scheduleInternal("sequence",f,i,h,n||hs,()=>m());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||hs;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,p=null,m=async()=>{for(c=50,c=50;!r&&c>0;--c)await Promise.resolve();if(!r&&this.scheduledTasks.length>0)return o!==void 0&&o(),p=this.waitOne(i),p.then(()=>(p=null,m()),S=>{throw p=null,r=!0,u(S),S});!r&&s!==void 0&&s(),d=null},f=()=>{if(d!==null){c=51;return}d=m().catch(()=>{})},h=()=>{let S=this.scheduledWatchers.indexOf(f);S!==-1&&this.scheduledWatchers.splice(S,1),S===0&&this.scheduledWatchers.length!==0&&this.scheduledWatchers[0]()},y=new Promise((S,x)=>{l=b=>{h(),S(b)},u=b=>{h(),x(b)}});return t.then(S=>{r=!0,p===null?l(S):p.then(()=>l(S),x=>u(x))},S=>{r=!0,p===null?u(S):p.then(()=>u(S),()=>u(S))}),(this.scheduledTasks.length>0||a)&&this.scheduledWatchers.length===0&&f(),this.scheduledWatchers.push(f),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(kc.buildLog).map(t=>`-> ${t}`).join(`
|
|
53
|
+
`)+"`"}};function ES(e){let t=0;return{clone:()=>ES(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 xg(e,t){return new kS(e,ES(t))}function AS(e){let t=e.clone();return{clone:()=>AS(t),nextTaskIndex:n=>e.nextInt(0,n.length-1)}}var V6=class extends de{constructor(e){super(),this.act=e}generate(e,t){return new O(new kS(this.act,AS(e.clone())),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return _.nil()}};function U6(e){let{act:t=n=>n()}=e||{};return new V6(t)}function W6(e,t){let{act:n=r=>r()}=Array.isArray(e)?t||{}:e||{};return Array.isArray(e)?xg(n,e):function(r,...i){return xg(n,i)}}function z6(e={}){return Xt(e,P("-9223372036854775808"),P("9223372036854775807"),QC,Sn)}function G6(e={}){return Xt(e,P(0),P("18446744073709551615"),eP,Sn)}function K6(e,t){return t}var Xu=Math.floor,H6=Math.min;function lt(e,t){switch(e.type){case"Char":return{astNode:e,minLength:1};case"Repetition":switch(e.quantifier.kind){case"*":{let n=lt(e.expression,t);return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:t},expression:n.astNode},minLength:0}}case"+":{let n=lt(e.expression,t),r=n.minLength>1?n.minLength:1;return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:1,to:Xu(t/r)},expression:n.astNode},minLength:n.minLength}}case"?":{let n=lt(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?Xu(t/e.quantifier.from):t,r=lt(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:Xu(t/i)},expression:r.astNode},minLength:e.quantifier.from*r.minLength}:{astNode:{...e,expression:r.astNode},minLength:e.quantifier.from*r.minLength}}default:return K6(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=lt(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?lt(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=lt(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=lt(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=lt(e.left,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:o,right:null},minLength:0}}let n=lt(e.left,t),r=lt(e.right,t);return n.minLength>t?r:r.minLength>t?n:{astNode:{...e,left:n.astNode,right:r.astNode},minLength:H6(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 q6(e,t){return lt(e,t).astNode}function Y6(e){return new Error(`Unsupported AST node! Received: ${ke(e)}`)}function xs(e,t,n){if(!t&&!n)return e;let r={hasStart:!1,hasEnd:!1},i=CS(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 CS(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)=>xs(i,t&&o===0,n&&o===e.expressions.length-1))};case"CharacterClass":return e;case"ClassRange":return e;case"Group":return{...e,expression:CS(e.expression,t,n,r)};case"Disjunction":return r.hasStart=!0,r.hasEnd=!0,{...e,left:e.left!==null?xs(e.left,t,n):null,right:e.right!==null?xs(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 Y6(e)}}function Z6(e){return xs(e,!0,!0)}function vg(e,t){return e[t]>="\uD800"&&e[t]<="\uDBFF"&&e[t+1]>="\uDC00"&&e[t+1]<="\uDFFF"?2:1}function Ce(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Ec(e){return e>="0"&&e<="9"}function PS(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 J6(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=PS(e,r):i==="("&&(n+=1)}throw new Error("Missing closing ')'")}function X6(e,t){let n=!1;for(let r=t;r!==e.length;++r){let i=e[r];if(!Ec(i)){if(t===r)return-1;if(i===","){if(n)return-1;n=!0}else return i==="}"?r:-1}}return-1}function Q6(e,t,n,r){switch(e[t]){case"[":return r===1?t+1:PS(e,t+1)+1;case"{":{if(r===1)return t+1;let i=X6(e,t+1);return i===-1?t+1:i+1}case"(":return r===1?t+1:J6(e,t+1)+1;case"]":case"}":case")":return t+1;case"\\":{let i=e[t+1];switch(i){case"x":if(Ce(e[t+2])&&Ce(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(Ce(e[t+3]))return t+5;throw new Error(`Unexpected token '${e.substring(t,t+5)}' found`)}if(e[t+5]==="}"){if(Ce(e[t+3])&&Ce(e[t+4]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`)}if(e[t+6]==="}"){if(Ce(e[t+3])&&Ce(e[t+4])&&Ce(e[t+5]))return t+7;throw new Error(`Unexpected token '${e.substring(t,t+7)}' found`)}if(e[t+7]==="}"){if(Ce(e[t+3])&&Ce(e[t+4])&&Ce(e[t+5])&&Ce(e[t+6]))return t+8;throw new Error(`Unexpected token '${e.substring(t,t+8)}' found`)}if(e[t+8]==="}"&&Ce(e[t+3])&&Ce(e[t+4])&&Ce(e[t+5])&&Ce(e[t+6])&&Ce(e[t+7]))return t+9;throw new Error(`Unexpected token '${e.substring(t,t+9)}' found`)}if(Ce(e[t+2])&&Ce(e[t+3])&&Ce(e[t+4])&&Ce(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(Ec(i)){let o=n?e.length:Math.min(t+4,e.length),s=t+2;for(;s<o&&Ec(e[s]);++s);return s}return t+(n?vg(e,t+1):1)+1}}default:return t+(n?vg(e,t):1)}}function ms(e,t,n,r){let i=Q6(e,t,n,r);return e.substring(t,i)}var Rg={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},Ts={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"},Ri=Xc(Ts),Jc={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"},Ac=Xc(Jc),IS={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"},kg=Xc(IS);function Xc(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 e$(e){return e in Jc||e in Ac}function t$(e){return e in Ts||e in Ri}function Eg(e){if(e in Rg)return Rg[e];if(e in Ri)return Ri[e];if(e in Ts||e==="General_Category"||e==="Script"||e==="Script_Extensions")return e;throw new Error(`Unknown Unicode property name: ${e}`)}function Ag(e){if(e in Ac)return Ac[e];if(e in kg)return kg[e];if(e in Ri)return Ri[e];if(e in Jc||e in IS||e in Ts)return e;throw new Error(`Unknown Unicode property value: ${e}`)}function n$(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:Eg(r),canonicalValue:Ag(i)}}if(e$(e))return{type:"UnicodeProperty",name:"General_Category",value:e,negative:t,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:Ag(e)};if(t$(e)){let r=Eg(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 Qu=String.fromCodePoint;function ec(e){let t=e.pop();if(t===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return t}function MS(e){return e>="0"&&e<="9"}function vs(e,t){return{type:"Char",kind:"simple",symbol:e,value:e,codePoint:e.codePointAt(0)||-1,escaped:t}}function pr(e,t){return{type:"Char",kind:"meta",symbol:t,value:e,codePoint:t.codePointAt(0)||-1}}function hn(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 tc(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:Qu(r),value:e,codePoint:r}}case"u":{if(e==="\\u")return vs("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:Qu(r),value:e,codePoint:r}}case"0":return pr(e,"\0");case"n":return pr(e,`
|
|
54
|
+
`);case"f":return pr(e,"\f");case"r":return pr(e,"\r");case"t":return pr(e," ");case"v":return pr(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(MS(t)){let n=e.substring(1),r=Number(n);return{type:"Char",kind:"decimal",symbol:Qu(r),value:e,codePoint:r}}if(e.length>2&&(t==="p"||t==="P")){let n=t==="P";return n$(e.substring(3,e.length-1),n)}return vs(e.substring(1),!0)}}return vs(e)}function hr(e,t,n,r){let i=null;for(let o=0,s=ms(t,o,n,0);o!==t.length;o+=s.length,s=ms(t,o,n,0)){let a=s[0];switch(a){case"|":i===null&&(i=[]),i.push(hn(e.splice(0),!0)||null);break;case".":e.push({type:"Char",kind:"meta",symbol:s,value:s,codePoint:NaN});break;case"*":case"+":{let l=ec(e);e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"?":{let l=ec(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(vs(s));break}let l=ec(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 p=0,m=ms(l,p,n,1);p!==l.length;p+=m.length,m=ms(l,p,n,1)){if(p===0&&m==="^"){c=!0;continue}let f=tc(m);if(m==="-")u.push(f),d=!0;else{let h=u.length>=2?u[u.length-2]:void 0;d&&h!==void 0&&h.type==="Char"&&f.type==="Char"?(u.pop(),u.pop(),u.push({type:"ClassRange",from:h,to:f})):u.push(f),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]===":")hr(u,l.substring(2),n,r),e.push({type:"Group",capturing:!1,expression:hn(u)});else if(l[1]==="="||l[1]==="!")hr(u,l.substring(2),n,r),e.push({type:"Assertion",kind:"Lookahead",negative:l[1]==="!"?!0:void 0,assertion:hn(u)});else if(l[1]==="<"&&(l[2]==="="||l[2]==="!"))hr(u,l.substring(3),n,r),e.push({type:"Assertion",kind:"Lookbehind",negative:l[2]==="!"?!0:void 0,assertion:hn(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,p=c[0].substring(2);r.named.set(p,d),hr(u,c.slice(1).join(">"),n,r),e.push({type:"Group",capturing:!0,nameRaw:p,name:p,number:d,expression:hn(u)})}else{let c=++r.lastIndex;hr(u,l,n,r),e.push({type:"Group",capturing:!0,number:c,expression:hn(u)})}break}default:if(s==="^")e.push({type:"Assertion",kind:s});else if(s==="$")e.push({type:"Assertion",kind:s});else if(s[0]==="\\"&&MS(s[1])){let l=Number(s.substring(1));n||l<=r.lastIndex?e.push({type:"Backreference",kind:"number",number:l,reference:l}):e.push(tc(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(tc(s));break}}if(i!==null){i.push(hn(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 r$(e){let t=Ht([...e.flags],"u")!==-1,n=e.source,r=[];return hr(r,n,t,{lastIndex:0,named:new Map}),hn(r)}var i$=String.fromCodePoint;function o$(e){return e.binary||e.shorthand?e.canonicalValue:`${e.canonicalName}=${e.canonicalValue}`}function Cg(e,t,n,r){let i=-1;for(let o=t;o<=n;++o)if(e.test(i$(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 s$(e,t){let n=new RegExp(`^\\${t?"P":"p"}{${e}}$`,"u"),r=[];return Cg(n,0,55295,r),Cg(n,57344,1114111,r),r}var Pg=new Map;function a$(e,t){let n=`${t?"P":"p"}:${e}`,r=Pg.get(n);if(r!==void 0)return r;let i=s$(e,t);return Pg.set(n,i),i}function l$(e){return wr(...U(a$(o$(e),e.negative),t=>lc(t)))}var u$=String.fromCodePoint,Ig=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],Mg=[..."0123456789"],Tg=[...` \r
|
|
55
55
|
\v\f`],Cc=[...`\r
|
|
56
|
-
`],TS=[...""],d$=[...Cc,...TS],Dn=()=>Pe({unit:"grapheme-ascii",minLength:1,maxLength:1});function Og(e){return new I(`Unsupported AST node! Received: ${ke(e)}`)}function mn(e,t,n){switch(e.type){case"Char":if(e.kind==="meta")switch(e.value){case"\\w":return $t(...Ig);case"\\W":return Dn().filter(r=>Ht(Ig,r)===-1);case"\\d":return $t(...Mg);case"\\D":return Dn().filter(r=>Ht(Mg,r)===-1);case"\\s":return $t(...Tg);case"\\S":return Dn().filter(r=>Ht(Tg,r)===-1);case"\\b":case"\\B":throw new I(`Meta character ${e.value} not implemented yet!`);case".":{let r=n.dotAll?TS:d$;return Dn().filter(i=>Ht(r,i)===-1)}}if(e.symbol===void 0)throw new I(`Unexpected undefined symbol received for non-meta Char! Received: ${ke(e)}`);return Re(e.symbol);case"Repetition":{let r=mn(e.expression,t,n);switch(e.quantifier.kind){case"*":return Pe({...t,unit:r});case"+":return Pe({...t,minLength:1,unit:r});case"?":return Pe({...t,minLength:0,maxLength:1,unit:r});case"Range":return Pe({...t,minLength:e.quantifier.from,maxLength:e.quantifier.to,unit:r});default:throw Og(e.quantifier)}}case"Quantifier":throw new I("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return j(...U(e.expressions,r=>mn(r,t,n))).map(r=>ce(r,""));case"CharacterClass":if(e.negative){let r=U(e.expressions,i=>mn(i,t,n));return Dn().filter(i=>zg(r,o=>!o.canShrinkWithoutContext(i)))}return Me(...U(e.expressions,r=>mn(r,t,n)));case"ClassRange":{let r=e.from.codePoint,i=e.to.codePoint;return te({min:r,max:i}).map(o=>c$(o),o=>{if(typeof o!="string")throw new I("Invalid type");if([...o].length!==1)throw new I("Invalid length");return gr(o,0)})}case"Group":return mn(e.expression,t,n);case"Disjunction":return Me(e.left!==null?mn(e.left,t,n):Re(""),e.right!==null?mn(e.right,t,n):Re(""));case"Assertion":if(e.kind==="^"||e.kind==="$")return n.multiline?e.kind==="^"?Me(Re(""),j(Pe({unit:Dn()}),$t(...Cc)).map(r=>`${r[0]}${r[1]}`,r=>{if(typeof r!="string"||r.length===0)throw new I("Invalid type");return[ge(r,0,r.length-1),r[r.length-1]]})):Me(Re(""),j($t(...Cc),Pe({unit:Dn()})).map(r=>`${r[0]}${r[1]}`,r=>{if(typeof r!="string"||r.length===0)throw new I("Invalid type");return[r[0],ge(r,1)]})):Re("");throw new I(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":throw new I("Backreference nodes not implemented yet!");case"UnicodeProperty":return u$(e);default:throw Og(e)}}function f$(e,t={}){for(let a of e.flags)if(a!=="d"&&a!=="g"&&a!=="m"&&a!=="s"&&a!=="u")throw new I(`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=J6(i$(e));n!==void 0&&(o=Y6(o,n));let s=mn(o,r,i);return n!==void 0?s.filter(a=>[...a].length<=n):s}function p$(e){let t=[];for(let n=0;n!==e.length;++n)t.push(e[n].next());return t}function h$(e,t){for(let n=0;n!==e.length;++n)t[n]=e[n].next()}function m$(e){for(let t=0;t!==e.length;++t)if(e[t].done)return!0;return!1}function*y$(...e){let t=p$(e);for(;!m$(t);)yield t.map(n=>n.value),h$(e,t)}function*g$(e){let t=e;for(;;)yield t,++t}var b$=class extends de{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?_.nil():new _(y$(this.arb.shrink(e,t),g$(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 S$(e,t){return new b$(e,t)}var w$=Sm({Arbitrary:()=>de,ExecutionStatus:()=>$I,PreconditionFailure:()=>wn,Random:()=>$c,Stream:()=>_,Value:()=>O,VerbosityLevel:()=>fI,__commitHash:()=>R$,__type:()=>x$,__version:()=>v$,anything:()=>cS,array:()=>le,assert:()=>nM,asyncDefaultReportMessage:()=>ub,asyncModelRun:()=>B6,asyncProperty:()=>cI,asyncStringify:()=>Nc,asyncToStringMethod:()=>Zt,base64String:()=>JN,bigInt:()=>Sn,bigInt64Array:()=>G6,bigUint64Array:()=>K6,boolean:()=>Ei,chainUntil:()=>KM,check:()=>db,clone:()=>JM,cloneIfNeeded:()=>mr,cloneMethod:()=>Te,commands:()=>$6,compareBooleanFunc:()=>ZO,compareFunc:()=>XO,configureGlobal:()=>aI,constant:()=>Re,constantFrom:()=>$t,context:()=>BM,createDepthIdentifier:()=>Fc,date:()=>Rb,defaultReportMessage:()=>lb,dictionary:()=>Bc,domain:()=>zc,double:()=>Ms,emailAddress:()=>cO,entityGraph:()=>Z2,falsy:()=>_M,float:()=>Wb,float32Array:()=>Jb,float64Array:()=>Xb,func:()=>t2,gen:()=>dM,getDepthContextFor:()=>Dc,hasAsyncToStringMethod:()=>Oc,hasCloneMethod:()=>Fn,hasToStringMethod:()=>Tc,hash:()=>Cs,infiniteStream:()=>zN,int16Array:()=>Qb,int32Array:()=>eS,int8Array:()=>tS,integer:()=>te,ipV4:()=>qc,ipV4Extended:()=>Hb,ipV6:()=>qb,json:()=>VN,jsonValue:()=>dS,letrec:()=>Yb,limitShrink:()=>S$,lorem:()=>iN,map:()=>wc,mapToConstant:()=>wr,maxSafeInteger:()=>Kb,maxSafeNat:()=>o2,memo:()=>lN,mixedCase:()=>hN,modelRun:()=>j6,nat:()=>yn,noBias:()=>As,noShrink:()=>Ps,object:()=>DN,oneof:()=>Me,option:()=>Jt,pre:()=>FC,property:()=>dI,readConfigureGlobal:()=>gt,record:()=>Sc,resetConfigureGlobal:()=>lI,sample:()=>iM,scheduledModelRun:()=>V6,scheduler:()=>W6,schedulerFor:()=>z6,set:()=>aS,shuffledSubarray:()=>n6,sparseArray:()=>sS,statistics:()=>sM,stream:()=>bn,string:()=>Pe,stringMatching:()=>f$,stringify:()=>ke,subarray:()=>t6,toStringMethod:()=>bt,tuple:()=>j,uint16Array:()=>nS,uint32Array:()=>rS,uint8Array:()=>iS,uint8ClampedArray:()=>oS,ulid:()=>c6,uniqueArray:()=>jn,uuid:()=>g6,webAuthority:()=>mS,webFragments:()=>gS,webPath:()=>SS,webQueryParameters:()=>wS,webSegment:()=>bS,webUrl:()=>M6}),x$="module",v$="4.8.0",R$="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c",je=w$;var k$=24301;function Os(e,t){return e.reduce((n,r)=>P$(n,t[r.idx]?.paramSpaces),new Map)}function vr(e,t){return Object.fromEntries(Object.entries(e.paramSpaces).map(([n,r])=>[n,E$(r,r?.name==null?0:t.get(r.name)??0)]))}var OS=new WeakMap;function E$(e,t){if(e==null)return NS(void 0,t);let n=OS.get(e)??new Map;OS.set(e,n);let r=n.get(t);if(r!=null)return r;let i=NS(e,t);return n.set(t,i),i}function A$(e){return e?.values!=null&&e.values.length>0?je.constantFrom(...e.values):C$(e)}function NS(e,t){let[n]=je.sample(A$(e),{numRuns:1,seed:k$+t});if(n==null)throw new Error("arbitrary produced no sample");return n}function C$(e){if(e?.type==="number")return je.integer();if(e?.type==="boolean")return je.boolean();let t=e?.generator==null?void 0:M$[e.generator];if(t!=null)return t;let n=e?.constraints?.kind==="string"?e.constraints:void 0;return je.string({maxLength:n?.maxLength,minLength:n?.minLength??1}).filter(r=>r.trim().length>0&&r===r.trim())}function P$(e,t){return t==null?e:Object.values(t).reduce((n,r)=>r==null?n:new Map([...n,[r.name,(n.get(r.name)??0)+1]]),e)}var I$="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],xr=e=>je.array(je.constantFrom(...I$),{maxLength:e,minLength:1}).map(t=>t.join("")),Qc=(e,t)=>je.array(xr(10),{maxLength:t,minLength:1}).map(n=>n.join(e)),M$={"company.name":Qc(" ",3),"date.iso":T$(),"internet.email":O$(),"internet.url":N$(),"lorem.slug":Qc("-",3),"lorem.word":xr(10),"person.fullName":Qc(" ",2)};function T$(){return je.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 O$(){return je.tuple(xr(12),xr(10),je.constantFrom("com","dev","io","org","ai")).map(([e,t,n])=>`${e}@${t}.${n}`)}function N$(){return je.tuple(je.constantFrom("http","https"),xr(12),je.constantFrom("app","com","dev","io","org"),je.array(xr(8),{maxLength:3})).map(([e,t,n,r])=>{let i=r.length===0?"":`/${r.join("/")}`;return`${e}://${t}.${n}${i}`})}var $$=new Map;function Ns(e){return vr(e,$$)}import{z as ne}from"zod";var Rr=ne.enum(["crash","data-rule","fact","frame"]),$S=ne.object({intent:ne.string().min(1),test:ne.string().min(1)}),L$=ne.union([ne.object({kind:ne.literal("scalar-mismatch"),subject:ne.string().min(1)}),ne.object({entity:ne.string().min(1),kind:ne.string().min(1)})]),D$=ne.discriminatedUnion("kind",[ne.object({kind:ne.literal("consistency"),layer:Rr,mismatch:L$,step:$S.nullable()}),ne.object({kind:ne.literal("pending-check"),layer:Rr,source:ne.string().min(1),step:$S}),ne.object({intent:ne.string().min(1),kind:ne.literal("unrunnable"),layer:Rr,reason:ne.string().min(1),test:ne.string().min(1)}),ne.object({error:ne.string().min(1),kind:ne.literal("driver-error"),layer:Rr,step:ne.string().min(1)}),ne.object({kind:ne.literal("impossible-action"),layer:Rr,step:ne.string().min(1)})]);function ed(e){return e.kind==="driver-error"||e.kind==="unrunnable"?"crash":e.kind==="pending-check"?e.source.kind==="data-rule"?"data-rule":e.source.kind==="fact"?"fact":"frame":"frame"}function Ai(e,t){let r=t.map(i=>({line:ku(i),part:DS(i)})).toSorted((i,o)=>C(i.part).localeCompare(C(o.part))).map(i=>i.part);return{layer:_$(r),signature:C({baseState:e,parts:r.map(i=>C(i))})}}var LS={crash:0,"data-rule":1,fact:2,frame:3};function DS(e){let t=ed(e);switch(e.kind){case"consistency":return{kind:"consistency",layer:t,mismatch:F$(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};case"lift-visibility":return{kind:"impossible-action",layer:t,step:`lift:${String(e.visibleIndex)}`}}}function F$(e){return e.kind==="scalar-mismatch"?{kind:e.kind,subject:Wt(e.subject)}:{entity:e.entity,kind:e.kind}}function _$(e){return e.map(n=>n.layer).toSorted((n,r)=>LS[n]-LS[r]).at(0)??"frame"}import{z as $s}from"zod";var Ci=$s.number().min(0).max(10),FS=$s.object({destructiveActions:Ci,leadsToMutation:Ci,maxAttemptLength:$s.number().int().positive(),mixWorkflows:Ci,mutatingActions:Ci,scopedBoost:$s.number().min(1),sharedEntity:Ci}),td={even:{destructiveActions:2,leadsToMutation:2,maxAttemptLength:12,mixWorkflows:3,mutatingActions:4,scopedBoost:8,sharedEntity:5}};function _S(e){return td[e]}function nd(e,t,n){let r=t.reduce((u,c)=>u+c,0),i=t.reduce((u,c)=>[...u,(u.at(-1)??0)+c],[]),o=n()*r,s=i.findIndex(u=>o<u),a=r<=0?Math.floor(n()*e.length):s,l=e[a<0?e.length-1:a];if(l==null)throw new Error("weighted sample drew an empty set");return l}var jS=4,j$=.1,B$=4,V$=.15,U$=2,W$=2,BS=.2;function Ls(e){let t=e.corpus.map(()=>-Math.log(1-e.random()));return{startingPoint:e.startingPoint.name,steps:WS({jitter:t,params:e},e.startingPoint.snapshot,[],new Map)}}function WS(e,t,n,r){let{params:i}=e;if(n.length>=i.strategy.maxAttemptLength)return n;let o=Oo(i.facts,t),s=Ko(i.corpus,{snapshot:o},z$(i.corpus,n)),a=G$(o,s),l=s.filter(p=>(r.get(`${a}#${String(p.idx)}`)??0)<U$&&n.filter(m=>m.idx===p.idx).length<H$(i.corpus,p)),u=K$({corpus:i.corpus,options:l,random:i.random});if(u.length===0)return n;let c=q$({context:e,here:a,path:n,pool:u,seen:r}),d=`${a}#${String(c.idx)}`;return WS(e,c.stepRun.next.snapshot,[...n,{idx:c.idx,params:c.params}],new Map([...r,[d,(r.get(d)??0)+1]]))}function z$(e,t){let n=Os(t,e);return r=>vr(r,n)}function G$(e,t){return C({enabled:t.map(n=>n.idx),holds:qr(e.scalars).filter(([,n])=>n.subject.kind==="element").map(([n,r])=>[n,r.expect.expect==="is"?r.expect.value===!0:"x"])})}function K$({corpus:e,options:t,random:n}){let r=t.filter(i=>!zS(e,i));return r.length===0||n()<j$?t:r}function zS(e,t){let n=e[t.idx];return n==null||n.nav.length>0||n.effectStep.action.kind==="goto"}function H$(e,t){return zS(e,t)?1:W$}function q$({context:e,here:t,path:n,pool:r,seen:i}){let{jitter:o,params:s}=e,a=r.map(l=>{let u=i.get(`${t}#${String(l.idx)}`)??0,c=n.filter(p=>p.idx===l.idx).length,d=Math.pow(V$,c)/(1+B$*u);return Y$(s,l,n)*d*(o[l.idx]??1)});return nd(r,a,s.random)}function Y$(e,t,n){let r=e.corpus[t.idx];if(r==null)return jS;let i=e.strategy,o=X$(e.corpus,r,n),s=o?i.mixWorkflows:0,a=o&&Q$(e.corpus,r,n)?i.sharedEntity:0,l=jS+s+a,u=e.scopedTests.has(r.test)?l*i.scopedBoost:l,c=n.length/e.strategy.maxAttemptLength;return u*Z$({action:r,corpus:e.corpus,progress:c,s:i})}function Z$({action:e,corpus:t,progress:n,s:r}){let o=ql(e.effectStep)||Yl(e.effectStep)?Math.max(1,r.mutatingActions):1,s=qp(e.effectStep),a=s?1+(Math.max(1,r.destructiveActions)-1)*n:1,l=s?BS+(1-BS)*n:1,u=J$(t).has(e.test)?Math.max(1,r.leadsToMutation):1;return o*a*u*l}var VS=new WeakMap;function J$(e){let t=VS.get(e);if(t!=null)return t;let n=new Set(e.filter(r=>ql(r.effectStep)||Yl(r.effectStep)).map(r=>r.test));return VS.set(e,n),n}function X$(e,t,n){let r=new Set(n.flatMap(i=>{let o=e[i.idx];return o==null?[]:[o.test]}));return r.size>0&&!r.has(t.test)}function Q$(e,t,n){let r=US(t),i=new Set(n.flatMap(o=>{let s=e[o.idx];return s==null?[]:[...US(s)]}));return[...r].some(o=>i.has(o))}function US(e){return new Set([...Zp(e.effectStep),...e.requiredState.entities.map(t=>t.entity)])}import{z as G}from"zod";var GS=G.object({baseStateTest:co,lockfileHash:G.string().min(1),stepRuns:G.array(G.object({idx:G.number().int().nonnegative(),params:G.record(G.string(),G.union([Ft,G.null()]))}))}),KS=G.object({baseStateRef:G.string().min(1),steps:G.array(G.object({index:G.number().int().nonnegative(),params:G.record(G.string(),G.union([Ft,G.null()])),test:G.string().min(1)}))}),HS=G.object({actions:G.array(G.string()),label:G.string().min(1)}),rd=G.object({test:G.string().min(1),text:G.string()}),e4=G.object({baseLabel:G.string(),baseState:G.string().min(1),durationMs:G.number().int().nonnegative(),signature:G.string().optional(),steps:G.array(rd)}),qS=G.object({kind:G.enum(["aborted","clean","error","flaky","finding"]),reason:G.string().optional(),runId:G.string().optional(),trail:e4.optional()});function Ds(e,{sweep:t}){let n=Ut(Le(e),r=>C({s:r.test.singletons,w:r.test.world})).map(r=>({name:r.ref,test:r.test}));return t?[...n,...n.flatMap(r=>t4(r))]:n}function Fs(e,t,n){return sr(e,t.test,n)}function t4(e){return n4(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 n4(e){return e.world.filter(t=>{let n=C({...e,world:e.world.filter(r=>r!==t)});return!n.includes(`"${t.as}.`)&&!n.includes(`"ref":"${t.as}"`)})}async function _s(e){let t=ti(e);if(t.length===0)return null;let n=Ds(e,{sweep:!1}),r=await r4(e,n);return r.length===0?null:{corpus:t,facts:cr(e).facts.filter(i=>!i.localConsequence),startingPoints:r,startingPointTests:new Map(n.map(i=>[i.name,i.test]))}}function YS({lockfileHash:e,prepared:t,random:n,scopedTests:r,strategy:i}){let o=t.startingPoints[Math.floor(n()*t.startingPoints.length)];if(o==null)return null;let s=Ls({corpus:t.corpus,facts:t.facts,random:n,scopedTests:r,startingPoint:o,strategy:i}),a=t.startingPointTests.get(s.startingPoint);return a==null||s.steps.length===0?null:{baseStateTest:a,lockfileHash:e,stepRuns:s.steps.map(l=>({idx:l.idx,params:l.params}))}}async function r4(e,t){let n={generate:fi,materialize:Uo(fi,e.valueSpaces),params:void 0};return(await Promise.all(t.map(async i=>(await Fs(e,i,n)).match(s=>({name:i.name,snapshot:s.snapshot}),()=>null)))).flatMap(i=>i==null?[]:[i])}import{ResultAsync as Vs}from"neverthrow";var Bn=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}},Vn=class extends Error{readyKey;timeoutMs;constructor(t,n){super("app-not-ready"),this.readyKey=t,this.timeoutMs=n}};function id(e){return{read:t=>m4(t,e),seedScript:t=>`globalThis[${JSON.stringify(pl)}] = ${JSON.stringify(t)};`}}async function m4(e,t){let n=Ue(Qn(e.url()),ZS([[{kind:"title"},await e.title()],[{kind:"viewport"},b4(e.viewportSize())]]));if(t.length===0)return{scalars:n};let r=await e.evaluate(g4,{mountKey:lo,names:t,timeoutMs:y4});if(r.kind==="unmounted")throw new Bn(lo);let i=ZS(Object.entries(r.values).map(([o,s])=>[{kind:"variable",name:o},s]));return{scalars:Ue(n,i)}}function ZS(e){return new Map(e.flatMap(([t,n])=>n===void 0?[]:[[K(t),{declared:!0,expect:{expect:"is",value:n},subject:t}]]))}var y4=5e3;async function g4(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 b4(e){return e==null?"":`${String(e.width)}x${String(e.height)}`}async function js({page:e,readiness:t,signal:n,startMs:r,tries:i,url:o}){if(rt(n),!await S4(e,o)){if(Date.now()-r>=t.budgetMs)throw new Vn(Vr,t.budgetMs);let a=t.backoffMs[Math.min(i,t.backoffMs.length-1)]??8e3;await dn(a,n),await js({page:e,readiness:t,signal:n,startMs:r,tries:i+1,url:o});return}let s=Math.max(0,t.budgetMs-(Date.now()-r));if(!await R4(e,n,Math.min(s,x4(t,i)))){if(Date.now()-r>=t.budgetMs)throw new Vn(Vr,t.budgetMs);await js({page:e,readiness:t,signal:n,startMs:r,tries:i+1,url:o})}}function od(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 Bs(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)}async function S4(e,t){let n=await w4(e,t);return n==="net-error"?!1:n==null||n.status()<400}async function w4(e,t){try{return await e.goto(t,{waitUntil:"domcontentloaded"})}catch(n){if(od(n))return"net-error";throw n}}function x4(e,t){return t===0?e.budgetMs/2:e.budgetMs}var v4=50;async function R4(e,t,n){let r=Date.now()+n;for(;Date.now()<r;){if(rt(t),await JS(e))return!0;await dn(v4,t)}return JS(e)}async function JS(e){try{return await e.evaluate(k4,Vr)}catch(t){if(Bs(t))return!1;throw t}}function k4(e){return Reflect.get(globalThis,e)===!0}var E4={backoffMs:[500,1e3,2e3,4e3,8e3],budgetMs:3e4};function ad(e,t,n,r,i=E4){return{awaitCheck:(o,s)=>Vs.fromPromise(P4({check:o,engine:n,page:e,signal:r,timeoutMs:s}),a=>li(a)?{kind:"aborted"}:sd(a)),evaluate:o=>Vs.fromPromise(QS(ld(e,n,o),`check ${o.kind}`),sd),locateIds:o=>V4(e,o),observe:o=>t.read().andThen(s=>Vs.fromPromise(QS(O4(e,n,s,o),"observe"),sd)),perform:o=>Vs.fromPromise(rw(e,o,0,r,i),s=>A4(o,s))}}function sd(e){return e instanceof Bn?So(e.mountKey):Wl(e)}async function ld(e,t,n){try{return await sw(e,t,n)}catch(r){if(Bs(r))return!1;throw r}}function A4(e,t){return t instanceof Vn?_l(t.readyKey,t.timeoutMs):t instanceof Bn?So(t.mountKey):Ul(e.kind,t)}var C4=75;function P4(e){return e.check.kind==="visible"?I4({locator:e.check.locator,page:e.page,signal:e.signal,timeoutMs:e.timeoutMs}):tw(e,Date.now()+e.timeoutMs)}async function tw(e,t){return rt(e.signal),await ld(e.page,e.engine,e.check)?!0:Date.now()>=t?!1:(await dn(C4,e.signal),tw(e,t))}async function I4({locator:e,page:t,signal:n,timeoutMs:r}){try{return await Promise.race([Ws(t,e,{visibleOnly:!0}).waitFor({state:"visible",timeout:r}),M4(n)]),!0}catch(i){if(T4(i))return!1;throw i}}function M4(e){return new Promise((t,n)=>{if(e.aborted){n(new mt);return}e.addEventListener("abort",()=>{n(new mt)},{once:!0})})}function T4(e){return e instanceof Error&&e.name==="TimeoutError"}async function O4(e,t,n,r){let i=await nw(e,t,0),o=await N4(e,t,r);return{snapshot:{...n,scalars:new Map([...n.scalars,...i.scalars,...o])}}}async function N4(e,t,n){let r=await Promise.all([...n.values()].filter(i=>i.subject.kind==="element").map(async i=>{let o=await $4(e,t,i.subject);return[K(i.subject),{declared:!0,expect:{expect:"is",value:o},subject:i.subject}]}));return new Map(r)}async function $4(e,t,n){return n.state==="value"||n.state==="text"?L4(e,n.locator,n.state):ld(e,t,{kind:n.state,locator:n.locator})}async function L4(e,t,n){try{let r=Ws(e,t,{visibleOnly:!0});return n==="value"?await r.inputValue():await r.textContent()??""}catch{return""}}var D4=[100,250,500];async function nw(e,t,n){try{return await t.read(e)}catch(r){let i=D4[n],o=Bs(r)||r instanceof Bn;if(i==null||!o)throw r;return await ow(i),nw(e,t,n+1)}}var XS=35e3;function QS(e,t){let n,r=new Promise((i,o)=>{n=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(XS)}ms`))},XS)});return Promise.race([e,r]).finally(()=>{clearTimeout(n)})}var F4=[250,750,2e3];async function rw(e,t,n,r,i){try{await _4(e,t,r,i)}catch(o){let s=F4[n];if(s==null||!od(o))throw o;await ow(s),await rw(e,t,n+1,r,i)}}async function _4(e,t,n,r){if(t.kind==="goto"){await js({page:e,readiness:r,signal:n,startMs:Date.now(),tries:0,url:kr(t.url,t,"url")});return}if(t.kind==="press"&&t.locator==null){await e.keyboard.press(kr(t.key,t,"key"));return}let i=t.kind!=="upload";await j4(e,Ws(e,t.locator,{visibleOnly:i}),t)}function kr(e,t,n){if(e==null)throw new Error(`action "${t.kind}" requires ${n}`);return e}function j4(e,t,n){switch(n.kind){case"goto":throw new Error("goto must not be located");case"fill":return t.fill(String(kr(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 B4(e,t,String(kr(n.value,n,"value")));case"upload":return t.setInputFiles(kr(n.files,n,"files"));case"press":return t.press(kr(n.key,n,"key"))}}async function B4(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(iw("option",n)).filter({visible:!0}).click()}async function V4(e,t){if(t==null)return[];try{let n=Us(e,t,{visibleOnly:!1});if(await n.count()===0)return[];let r=await n.first().evaluate(U4);return r>0?[r]:[]}catch{return[]}}function U4(e){return globalThis.__ripploRrwebMirror?.getId(e)??-1}function Ws(e,t,n){if(t==null)throw new Error("action requires a locator");return Us(e,t,n)}function Us(e,t,n){if(t.by==="inside"){let i=Us(e,t.scope,n);return Us(i,t.target,n)}let r=t.by==="testId"?e.getByTestId(t.value):e.locator(iw(t.role,t.name));return n.visibleOnly?r.filter({visible:!0}):r}function iw(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}function ow(e){return new Promise(t=>{setTimeout(t,e)})}async function sw(e,t,n){if(n.kind==="browser")return G4(e,t,n.key,n.value);if(n.kind==="not")return!await sw(e,t,n.inner);let r=Ws(e,n.locator,{visibleOnly:!0});return n.kind==="value"?await r.inputValue()===n.value:n.kind==="text"?(await r.textContent()??"").includes(n.value):n.kind==="unobstructed"?W4(r):z4(r,n.kind)}function W4(e){return e.evaluate(t=>{let n=t.getBoundingClientRect(),r=t.ownerDocument.defaultView;if(r==null||n.width<=0||n.height<=0)return!1;let i=2,o=Math.min(9,Math.max(3,Math.round(n.width/12))),s=Math.min(5,Math.max(2,Math.round(n.height/12))),a=(c,d,p)=>Array.from({length:p},(m,f)=>c+i+(d-i*2)*f/(p-1)),u=a(n.left,n.width,o).flatMap(c=>a(n.top,n.height,s).map(d=>({x:c,y:d}))).filter(c=>c.x>=0&&c.y>=0&&c.x<=r.innerWidth&&c.y<=r.innerHeight);return u.length===0?!1:u.every(c=>{let d=t.ownerDocument.elementFromPoint(c.x,c.y);return d!=null&&(d===t||t.contains(d)||d.contains(t))})})}function z4(e,t){return t==="visible"?e.isVisible():t==="disabled"?e.isDisabled():t==="enabled"?e.isEnabled():t==="checked"?e.isChecked():t==="expanded"?ew(e,n=>n.getAttribute("aria-expanded")==="true"):t==="pressed"?ew(e,n=>n.getAttribute("aria-pressed")==="true"):e.evaluate(n=>n===n.ownerDocument.activeElement)}async function ew(e,t){return await e.count()===0?!1:e.evaluate(t)}async function G4(e,t,n,r){let i=await t.read(e),o=$e(i.scalars,n);return r===null?o===void 0:o===r}import K4 from"path";var lw={height:720,width:1280};async function ud({baseUrl:e,browser:t,capture:n,clientState:r,engine:i,fixturesDir:o,networkHeaders:s,reader:a,session:l,signal:u,viewport:c}){let d=await t.newContext({baseURL:e,reducedMotion:"reduce",storageState:l==null?void 0:{cookies:H4(l.cookies,e),origins:l.origins},viewport:c});s!=null&&await q4(d,e,s),l?.headers!=null&&await d.setExtraHTTPHeaders(l.headers),await d.addInitScript("globalThis.__name = globalThis.__name ?? ((target) => target);"),await d.addInitScript(i.seedScript(r));let p=n==null?Y4():await n.hub.attach(d,n.runId),m=await d.newPage();return p.onPage(m),{context:d,driver:X4(Z4(ad(m,a,i,u),o),p),emitAssertion:p.emitAssertion,emitFinding:p.emitFinding,close:()=>Q4({context:d,handle:p})}}async function cd(e,t){let n=await cw(e,void 0);try{return await t(n)}finally{await n.close()}}async function uw(e){let{chromium:t}=await import("playwright");return t.launchPersistentContext(e,{headless:!1,viewport:null})}function H4(e,t){let n=new URL(t).hostname;return e.map(r=>({...r,domain:n}))}async function q4(e,t,n){let r=new URL(t).host;await e.route(i=>i.host===r,i=>i.continue({headers:{...i.request().headers(),...n}}))}function Y4(){return{emitAction:()=>{},emitAssertion:()=>{},emitFinding:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function cw(e,t){let{chromium:n}=await import("playwright"),r=t==null?[]:[`--disk-cache-dir=${t}`,"--disk-cache-size=268435456"];return n.launch({args:r,headless:!e})}function zs({cacheDir:e,headed:t}){let n;return{acquire:async()=>{let o=n;if(o!=null){let s=await o.catch(()=>{});if(s?.isConnected()===!0)return s;n===o&&(n=void 0)}return n??=cw(t,e),n},close:async()=>{let o=n;n=void 0,o!=null&&await o.then(s=>s.close()).catch(()=>{})}}}function Z4(e,t){return{awaitCheck:e.awaitCheck,evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:n=>e.perform(J4(n,t))}}function J4(e,t){return e.kind!=="upload"||e.files==null?e:{...e,files:e.files.map(n=>K4.join(t,n))}}function X4(e,t){return{awaitCheck:e.awaitCheck,evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:n=>(t.emitAction(n),e.perform(n))}}async function Q4({context:e,handle:t}){await aw(t.finish()),await aw(e.close())}var e3=15e3;async function aw(e){let t,n=new Promise(r=>{t=setTimeout(r,e3)});await Promise.race([e.catch(()=>{}),n]).finally(()=>{clearTimeout(t)})}import{err as t3,ok as n3,Result as dd}from"neverthrow";function fd(e,t,n){return{read:()=>n.read(e.map(r=>r.name),t).andThen(r=>r3(e,r))}}function r3(e,t){return dd.combine(e.map(n=>i3(n,t.entities[n.name]??[]).map(r=>[n.name,r]))).map(n=>({entities:new Map(n),scalars:new Map(Object.entries(t.singletons).map(([r,i])=>[K({kind:"variable",name:r}),{declared:!0,expect:{expect:"is",value:i},subject:{kind:"variable",name:r}}]))}))}function i3(e,t){let n=ui(e);return dd.combine(t.map(r=>o3(r,e).map(i=>[i,s3(r,n)]))).map(r=>new Map(r))}function o3(e,t){return dd.combine(t.identity.map(n=>{let r=e[n];return r==null?t3(Bl(t.name,n)):n3(String(r))})).map(n=>n.join(":"))}function s3(e,t){let n=t.map(r=>[r,e[r]]).filter(r=>r[1]!=null);return Object.fromEntries(n)}var dw=Xa(B0(),1);import a3 from"crypto";import{err as l3,errAsync as pd,ok as u3,ResultAsync as Er}from"neverthrow";var c3=3e4,d3=[250,750,2e3],f3=[500,1e3,2e3,3e3];function hd({baseUrl:e,extraHeaders:t,runId:n,secret:r},i){let o=new dw.Webhook(r),s=(a,l,u)=>p3({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:Pl,signal:i}).map(u=>({entities:u.entities,singletons:u.singletons}))},ready:()=>pw(e,t,i,0),setupWorld:a=>s("/setup",{entities:a,runId:n},{retry:"connection",schema:Cl,signal:i}).map(l=>l.rows),teardown:()=>s("/teardown",{runId:n},{retry:"connection",schema:Il,signal:void 0}).map(()=>{})}}function p3(e){return fw(e.retry,()=>g3(e),0)}function fw(e,t,n){return t().orElse(r=>{let i=d3[n];return i==null||!m3(r,e)?pd(r):Er.fromSafePromise(hw(i)).andThen(()=>fw(e,t,n+1))})}function pw(e,t,n,r){return Er.fromPromise(fetch(e,{headers:t,method:"HEAD",signal:mw(n)}),i=>nr("",i)).map(()=>{}).orElse(()=>{let i=f3[r];return i==null||n.aborted?pd(Vl(e)):Er.fromSafePromise(hw(i)).andThen(()=>pw(e,t,n,r+1))})}var h3=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function m3(e,t){return e.kind==="aborted"?!1:y3(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function y3(e){return e.kind==="engine-network"&&e.code!=null&&h3.has(e.code)}function hw(e){return new Promise(t=>{setTimeout(t,e)})}function g3({baseUrl:e,body:t,extraHeaders:n,path:r,schema:i,signal:o,webhook:s}){let a=JSON.stringify(t);return Er.fromPromise(fetch(`${e}${r}`,{body:a,headers:{...n,"Content-Type":"application/json",...b3(s,a)},method:"PUT",signal:mw(o)}),l=>nr(r,l)).andThen(l=>S3(l,r)).andThen(l=>w3(i,l,r)).mapErr(l=>o?.aborted===!0?zl():l)}function b3(e,t){let n=`msg_${a3.randomUUID()}`,r=new Date;return{"webhook-id":n,"webhook-signature":e.sign(n,r,t),"webhook-timestamp":String(Math.floor(r.getTime()/1e3))}}function mw(e){let t=AbortSignal.timeout(c3);return e==null?t:AbortSignal.any([e,t])}function S3(e,t){return e.ok?Er.fromPromise(e.json(),n=>nr(t,n)):Er.fromPromise(e.text().catch(()=>""),n=>nr(t,n)).andThen(n=>pd(Fl(t,e.status,n)))}function w3(e,t,n){let r=e.safeParse(t);return r.success?u3(r.data):l3(jl(n,r.error))}import L9 from"path";import{err as jr,ok as Xi,ResultAsync as Gf}from"neverthrow";import k0 from"path";import{z as vt}from"zod";import x3 from"path";function yw({debugDir:e,runId:t,worker:n}){let r=x3.join(e,t,"behavior.jsonl");return n.open({file:r,runId:t}),{close:i=>n.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(v3(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:R3(i.timeNanos)};n.line({line:JSON.stringify(o),runId:t,timeNanos:i.timeNanos})},emitRrwebBatch:i=>{n.rrwebBatch({data:i,runId:t})}}}function xn(e){return String(BigInt(Math.round(e))*1000000n)}function v3(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function R3(e){return Number(BigInt(e)/1000000n)}import{existsSync as k3}from"fs";import{createRequire as E3}from"module";import{fileURLToPath as A3}from"url";import{Worker as C3}from"worker_threads";var P3=E3(import.meta.url);function gw(e){let t=new C3(I3(),{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 I3(){try{return P3.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(n=>A3(new URL(n,import.meta.url))),t=e.find(n=>k3(n));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}function Sw(e){if(e.kind==="pending-check")return null;let t={kind:"finding",source:"verifier",timeNanos:xn(Date.now())};return e.kind==="consistency"?{...t,...M3(e.mismatch),findingKind:"consistency",pending:e.pending,step:e.step==null?"":Gt(e.step),wait:e.budget,waitMs:Mt[e.budget]}:e.kind==="impossible-action"?{...t,findingKind:e.kind,step:Gt(e.step),subject:"action could not run"}:e.kind==="unrunnable"?{...t,findingKind:e.kind,step:e.intent,subject:`step could not run (${e.reason})`}:e.kind==="lift-visibility"?{...t,findingKind:e.kind,step:String(e.declaredIndex+1),subject:`visibility liftable to step ${String(e.visibleIndex+1)}`}:{...t,findingKind:e.kind,step:Gt(e.step),subject:Pt(e.error)}}function M3(e){return e.kind==="scalar-mismatch"?{actual:we(e.sut),expected:is(e.want),mismatchKind:e.kind,subject:Wt(e.subject)}:e.kind==="wrong-value"?{actual:we(e.sut),expected:we(e.snapshot),mismatchKind:e.kind,subject:bw(e.entity,e.field,e.key)}:e.kind==="expected-change"?{expected:`change from ${we(e.value)}`,mismatchKind:e.kind,subject:bw(e.entity,e.field,e.key)}:{mismatchKind:e.kind,subject:`${e.entity} [${e.key}]`}}function bw(e,t,n){return`${e}.${t} [${n}]`}import{readFile as T3}from"fs/promises";import{createRequire as O3}from"module";import{fileURLToPath as N3}from"url";var $3=O3(import.meta.url);function md(e,t){try{return $3.resolve(e)}catch{return N3(new URL(`assets/${t}`,import.meta.url))}}var L3=md("@ripplo/browser-trace/bundle","browser-trace.js");async function xw(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await D3())}var ww;function D3(){return ww??=T3(L3,{encoding:"utf8"}),ww}import{createServer as F3}from"http";import{mkdir as _3,rm as j3,writeFile as B3}from"fs/promises";import V3 from"path";import{z as re}from"zod";var U3="otlp-port",Rw=re.object({key:re.string(),value:re.object({boolValue:re.boolean().optional(),doubleValue:re.number().optional(),intValue:re.union([re.string(),re.number()]).optional(),stringValue:re.string().optional()})}),W3=re.object({attributes:re.array(Rw).default([]),endTimeUnixNano:re.string(),kind:re.number().default(0),name:re.string(),parentSpanId:re.string().optional(),spanId:re.string(),startTimeUnixNano:re.string(),status:re.object({code:re.number(),message:re.string().optional()}).optional(),traceId:re.string()}),z3=re.object({resourceSpans:re.array(re.object({resource:re.object({attributes:re.array(Rw).default([])}).optional(),scopeSpans:re.array(re.object({spans:re.array(W3).default([])})).default([])})).default([])});async function yd({localDir:e,onRrwebBatch:t,onSpan:n,writePortFile:r}){let{port:i,server:o}=await G3({onRrwebBatch:t,onSpan:n}),s=V3.join(e,U3);return r&&(await _3(e,{recursive:!0}),await B3(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{r&&await j3(s,{force:!0}),await Z3(o)}}}function G3(e){return new Promise((t,n)=>{let r=F3((i,o)=>{K3(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 K3(e,t,n){let r=H3(e.url);if(r!=null){vw(e).then(i=>{n.onRrwebBatch(r,i),Gs(t)}).catch(()=>{Gs(t)});return}vw(e).then(i=>{q3(z3.parse(JSON.parse(i.toString("utf8"))),n.onSpan),Gs(t)}).catch(()=>{Gs(t)})}function H3(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function vw(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 Gs(e){e.writeHead(200,{"content-type":"application/json"}),e.end("{}")}function q3(e,t){e.resourceSpans.flatMap(n=>n.scopeSpans).flatMap(n=>n.spans).forEach(n=>{t({attributes:Y3(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:cl(n.kind),status:{code:dl(n.status?.code??0),message:n.status?.message},timeNanos:n.startTimeUnixNano,traceId:n.traceId})})}function Y3(e){return Object.fromEntries(e.map(({key:t,value:n})=>[t,String(n.stringValue??n.intValue??n.doubleValue??n.boolValue??"")]))}function Z3(e){return new Promise((t,n)=>{e.close(r=>{if(r==null){t();return}n(r)}),e.closeAllConnections()})}import{readFile as S9}from"fs/promises";var J3=Object.defineProperty,X3=(e,t,n)=>t in e?J3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t,n)=>X3(e,typeof t!="symbol"?t+"":t,n),kw,Q3=Object.defineProperty,eL=(e,t,n)=>t in e?Q3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ew=(e,t,n)=>eL(e,typeof t!="symbol"?t+"":t,n),Oe=(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))(Oe||{}),Aw={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Cw={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ks={},tL=()=>!!globalThis.Zone;function xf(e){if(Ks[e])return Ks[e];let t=globalThis[e],n=t.prototype,r=e in Aw?Aw[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 Cw?Cw[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&&!tL())return Ks[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?Ks[e]=u:n}catch{return n}}var gd={};function nn(e,t,n){var r;let i=`${e}.${String(n)}`;if(gd[i])return gd[i].call(t);let o=xf(e),s=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return s?(gd[i]=s,s.call(t)):t[n]}var bd={};function k1(e,t,n){let r=`${e}.${String(n)}`;if(bd[r])return bd[r].bind(t);let o=xf(e)[n];return typeof o!="function"?t[n]:(bd[r]=o,o.bind(t))}function nL(e){return nn("Node",e,"ownerDocument")}function rL(e){return nn("Node",e,"childNodes")}function iL(e){return nn("Node",e,"parentNode")}function oL(e){return nn("Node",e,"parentElement")}function sL(e){return nn("Node",e,"textContent")}function aL(e,t){return k1("Node",e,"contains")(t)}function lL(e){return k1("Node",e,"getRootNode")()}function uL(e){return!e||!("host"in e)?null:nn("ShadowRoot",e,"host")}function cL(e){return e.styleSheets}function dL(e){return!e||!("shadowRoot"in e)?null:nn("Element",e,"shadowRoot")}function fL(e,t){return nn("Element",e,"querySelector")(t)}function pL(e,t){return nn("Element",e,"querySelectorAll")(t)}function hL(){return xf("MutationObserver").constructor}function mL(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 Be={ownerDocument:nL,childNodes:rL,parentNode:iL,parentElement:oL,textContent:sL,contains:aL,getRootNode:lL,host:uL,styleSheets:cL,shadowRoot:dL,querySelector:fL,querySelectorAll:pL,mutationObserver:hL,patch:mL};function E1(e){return e.nodeType===e.ELEMENT_NODE}function Ni(e){let t=e&&"host"in e&&"mode"in e&&Be.host(e)||null;return!!(t&&"shadowRoot"in t&&Be.shadowRoot(t)===e)}function $i(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function yL(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 gL(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 Td(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=>A1(i,n)).join("");return yL(r)}catch{return null}}function A1(e,t){if(SL(e)){let n;try{n=Td(e.styleSheet)||gL(e)}catch{n=e.cssText}return e.styleSheet.href?ka(n,e.styleSheet.href):n}else{let n=e.cssText;return wL(e)&&e.selectorText.includes(":")&&(n=bL(n)),t?ka(n,t):n}}function bL(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function SL(e){return"styleSheet"in e}function wL(e){return"selectorText"in e}var xa=class{constructor(){Ew(this,"idNodeMap",new Map),Ew(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 xL(){return new xa}function va({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:o}){let s=i||"",a=r&&Wn(r);return(t[n.toLowerCase()]||a&&t[a])&&(o?s=o(s,e):s="*".repeat(s.length)),s}function Wn(e){return e.toLowerCase()}var Pw="__rrweb_original__";function vL(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=Pw in o?o[Pw]: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 Ra(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Wn(t):null}function C1(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 RL(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var kL=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,EL=/^(?:[a-z+]+:)?\/\//i,AL=/^www\..*/i,CL=/^(data:)([^,]*),(.*)/i;function ka(e,t){return(e||"").replace(kL,(n,r,i,o,s,a)=>{let l=i||s||a,u=r||o||"";if(!l)return n;if(EL.test(l)||AL.test(l))return`url(${u}${l}${u})`;if(CL.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${RL(t)+l}${u})`;let c=t.split("/"),d=l.split("/");c.pop();for(let p of d)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${u}${c.join("/")}${u})`})}function Hs(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function PL(e,t,n=!1){let r=Array.from(t.childNodes),i=[],o=0;if(r.length>1&&e&&typeof e=="string"){let s=Hs(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=Hs(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 p=u.substring(0,d),m=s.split(p),f=-1;if(m.length===2)f=m[0].length;else if(m.length>2&&m[0]===""&&r[l-1].textContent!=="")f=s.indexOf(p,1);else if(m.length===1){if(p=p.substring(0,p.length-1),m=s.split(p),m.length<=1)return i.push(e),i;d=c+1}else d===u.length-1&&(f=s.indexOf(p));if(m.length>=2&&d>c){let h=r[l-1].textContent;if(h&&typeof h=="string"){let y=Hs(h).length;f=s.indexOf(p,y)}f===-1&&(f=m[0].length)}if(f!==-1){let h=Math.floor(f/a);for(;h>0&&h<e.length;){if(o+=1,o>50*r.length)return i.push(e),i;let y=Hs(e.substring(0,h),n);if(y.length===f){i.push(e.substring(0,h)),e=e.substring(h),s=s.substring(f);break}else y.length<f?h+=Math.max(1,Math.floor((f-y.length)/a)):h-=Math.max(1,Math.floor((y.length-f)*a))}break}}}}return i.push(e),i}function IL(e,t){return PL(e,t).join("/* rr_split */")}var ML=1,TL=new RegExp("[^a-z0-9-_:]"),Di=-2;function P1(){return ML++}function OL(e){if(e instanceof HTMLFormElement)return"form";let t=Wn(e.tagName);return TL.test(t)?"div":t}var Ar,Iw,NL=/^[^ \t\n\r\u000c]+/,$L=/^[, \t\n\r\u000c]+/;function LL(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($L),!(n>=t.length);){let o=r(NL);if(o.slice(-1)===",")o=Ir(e,o.substring(0,o.length-1)),i.push(o);else{let s="";o=Ir(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 Mw=new WeakMap;function Ir(e,t){return!t||t.trim()===""?t:vf(e,t)}function DL(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function vf(e,t){let n=Mw.get(e);if(n||(n=e.createElement("a"),Mw.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function I1(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)?Ir(e,r):n==="srcset"?LL(e,r):n==="style"?ka(r,vf(e)):t==="object"&&n==="data"?Ir(e,r):r)}function M1(e,t,n){return["video","audio"].includes(e)&&t==="autoplay"}function FL(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 Ea(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ea(Be.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?Ea(Be.parentNode(e),t,n):!1}function T1(e,t,n,r){let i;if(E1(e)){if(i=e,!Be.childNodes(i).length)return!1}else{if(Be.parentElement(e)===null)return!1;i=Be.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(Ea(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 _L(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 jL(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 BL(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:h=!1,cssCaptured:y=!1}=t,S=VL(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Oe.Document,childNodes:[],compatMode:e.compatMode}:{type:Oe.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Oe.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return WL(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:p,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:h,rootId:S});case e.TEXT_NODE:return UL(e,{doc:n,needsMask:s,maskTextFn:u,rootId:S,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:Oe.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Oe.Comment,textContent:Be.textContent(e)||"",rootId:S};default:return!1}}function VL(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function UL(e,t){let{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:o}=t,s=Be.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=Be.textContent(e),u&&l&&(l=ka(l,vf(t.doc)))),!u&&!c&&l&&n&&(l=r?r(l,Be.parentElement(e)):l.replace(/[\S]/g,"*")),{type:Oe.Text,textContent:l||"",rootId:i}}function WL(e,t){let{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:m}=t,f=FL(e,r,i),h=OL(e),y={},S=e.attributes.length;for(let b=0;b<S;b++){let v=e.attributes[b];M1(h,v.name,v.value)||(y[v.name]=I1(n,h,Wn(v.name),v.value))}if(h==="link"&&o){let b=Array.from(n.styleSheets).find(N=>N.href===e.href),v=null;b&&(v=Td(b)),v&&(delete y.rel,delete y.href,y._cssText=v)}if(h==="style"&&e.sheet){let b=Td(e.sheet);b&&(e.childNodes.length>1&&(b=IL(b,e)),y._cssText=b)}if(["input","textarea","select"].includes(h)){let b=e.value,v=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&b?y.value=va({element:e,type:Ra(e),tagName:h,value:b,maskInputOptions:s,maskInputFn:a}):v&&(y.checked=v)}if(h==="option"&&(e.selected&&!s.select?y.selected=!0:delete y.selected),h==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),h==="canvas"&&c){if(e.__context==="2d")vL(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let b=e.toDataURL(l.type,l.quality),v=n.createElement("canvas");v.width=e.width,v.height=e.height;let N=v.toDataURL(l.type,l.quality);b!==N&&(y.rr_dataURL=b)}}if(h==="img"&&u){Ar||(Ar=n.createElement("canvas"),Iw=Ar.getContext("2d"));let b=e,v=b.currentSrc||b.getAttribute("src")||"<unknown-src>",N=b.crossOrigin,$=()=>{b.removeEventListener("load",$);try{Ar.width=b.naturalWidth,Ar.height=b.naturalHeight,Iw.drawImage(b,0,0),y.rr_dataURL=Ar.toDataURL(l.type,l.quality)}catch(L){if(b.crossOrigin!=="anonymous"){b.crossOrigin="anonymous",b.complete&&b.naturalWidth!==0?$():b.addEventListener("load",$);return}else console.warn(`Cannot inline img src=${v}! Error: ${L}`)}b.crossOrigin==="anonymous"&&(N?y.crossOrigin=N:b.removeAttribute("crossorigin"))};b.complete&&b.naturalWidth!==0?$():b.addEventListener("load",$)}if(["audio","video"].includes(h)){let b=y;b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime,b.rr_mediaPlaybackRate=e.playbackRate,b.rr_mediaMuted=e.muted,b.rr_mediaLoop=e.loop,b.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),f){let{width:b,height:v}=e.getBoundingClientRect();y={class:y.class,rr_width:`${b}px`,rr_height:`${v}px`}}h==="iframe"&&!d(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let x;try{customElements.get(h)&&(x=!0)}catch{}return{type:Oe.Element,tagName:h,attributes:y,childNodes:[],isSVG:DL(e)||void 0,needBlock:f,rootId:m,isCustom:x}}function fe(e){return e==null?"":e.toLowerCase()}function O1(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 zL(e,t){if(t.comment&&e.type===Oe.Comment)return!0;if(e.type===Oe.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"&&C1(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(fe(e.attributes.name).match(/^msapplication-tile(image|color)$/)||fe(e.attributes.name)==="application-name"||fe(e.attributes.rel)==="icon"||fe(e.attributes.rel)==="apple-touch-icon"||fe(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&fe(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(fe(e.attributes.property).match(/^(og|twitter|fb):/)||fe(e.attributes.name).match(/^(og|twitter):/)||fe(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(fe(e.attributes.name)==="robots"||fe(e.attributes.name)==="googlebot"||fe(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(fe(e.attributes.name)==="author"||fe(e.attributes.name)==="generator"||fe(e.attributes.name)==="framework"||fe(e.attributes.name)==="publisher"||fe(e.attributes.name)==="progid"||fe(e.attributes.property).match(/^article:/)||fe(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(fe(e.attributes.name)==="google-site-verification"||fe(e.attributes.name)==="yandex-verification"||fe(e.attributes.name)==="csrf-token"||fe(e.attributes.name)==="p:domain_verify"||fe(e.attributes.name)==="verify-v1"||fe(e.attributes.name)==="verification"||fe(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Mr(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:p,slimDOMOptions:m,dataURLOptions:f={},inlineImages:h=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:x,iframeLoadTimeout:b=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:N=5e3,keepIframeSrcFn:$=()=>!1,newlyAddedElement:L=!1,cssCaptured:D=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:V=!0}=t;M||(M=T1(e,s,a,M===void 0));let se=BL(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,dataURLOptions:f,inlineImages:h,recordCanvas:y,keepIframeSrcFn:$,newlyAddedElement:L,cssCaptured:D});if(!se)return console.warn(e,"not serialized"),null;let pe;r.hasNode(e)?pe=r.getId(e):zL(se,m)||!V&&se.type===Oe.Text&&!se.textContent.replace(/^\s+|\s+$/gm,"").length?pe=Di:pe=P1();let F=Object.assign(se,{id:pe});if(r.add(e,F),pe===Di)return null;S&&S(e);let _e=!l;if(F.type===Oe.Element){_e=_e&&!F.needBlock,delete F.needBlock;let Ie=Be.shadowRoot(e);Ie&&$i(Ie)&&(F.isShadowHost=!0)}if((F.type===Oe.Document||F.type===Oe.Element)&&_e){m.headWhitespace&&F.type===Oe.Element&&F.tagName==="head"&&(V=!1);let Ie={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:h,recordCanvas:y,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:x,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:N,keepIframeSrcFn:$,cssCaptured:!1};if(!(F.type===Oe.Element&&F.tagName==="textarea"&&F.attributes.value!==void 0)){F.type===Oe.Element&&F.attributes._cssText!==void 0&&typeof F.attributes._cssText=="string"&&(Ie.cssCaptured=!0);for(let Rn of Array.from(Be.childNodes(e))){let kt=Mr(Rn,Ie);kt&&F.childNodes.push(kt)}}let at=null;if(E1(e)&&(at=Be.shadowRoot(e)))for(let Rn of Array.from(Be.childNodes(at))){let kt=Mr(Rn,Ie);kt&&($i(at)&&(kt.isShadow=!0),F.childNodes.push(kt))}}let Rt=Be.parentNode(e);return Rt&&Ni(Rt)&&$i(Rt)&&(F.isShadow=!0),F.type===Oe.Element&&F.tagName==="iframe"&&_L(e,()=>{let Ie=e.contentDocument;if(Ie&&x){let at=Mr(Ie,{doc:Ie,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:h,recordCanvas:y,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:x,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:N,keepIframeSrcFn:$});at&&x(e,at)}},b),F.type===Oe.Element&&F.tagName==="link"&&typeof F.attributes.rel=="string"&&(F.attributes.rel==="stylesheet"||F.attributes.rel==="preload"&&typeof F.attributes.href=="string"&&C1(F.attributes.href)==="css")&&jL(e,()=>{if(v){let Ie=Mr(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:h,recordCanvas:y,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:x,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:N,keepIframeSrcFn:$});Ie&&v(e,Ie)}},N),F}function GL(e,t){let{mirror:n=new xa,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:p,slimDOM:m=!1,dataURLOptions:f,preserveWhiteSpace:h,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:x,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:N=()=>!1}=t||{},$=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,L=O1(m);return Mr(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:$,maskTextFn:d,maskInputFn:p,slimDOMOptions:L,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:h,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:x,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:N,newlyAddedElement:!1})}var KL=/(max|min)-device-(width|height)/,SK=new RegExp(KL.source,"g");function HL(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function qL(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 Rf={exports:{}},me=String,N1=function(){return{isColorSupported:!1,reset:me,bold:me,dim:me,italic:me,underline:me,inverse:me,hidden:me,strikethrough:me,black:me,red:me,green:me,yellow:me,blue:me,magenta:me,cyan:me,white:me,gray:me,bgBlack:me,bgRed:me,bgGreen:me,bgYellow:me,bgBlue:me,bgMagenta:me,bgCyan:me,bgWhite:me}};Rf.exports=N1();Rf.exports.createColors=N1;var YL=Rf.exports,ZL={},JL=Object.freeze(Object.defineProperty({__proto__:null,default:ZL},Symbol.toStringTag,{value:"Module"})),wt=qL(JL),Tw=YL,Ow=wt,Od=class $1 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,$1)}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=Tw.isColorSupported),Ow&&t&&(n=Ow(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}=Tw.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let m=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
|
|
56
|
+
`],TS=[...""],c$=[...Cc,...TS],Dn=()=>Pe({unit:"grapheme-ascii",minLength:1,maxLength:1});function Og(e){return new I(`Unsupported AST node! Received: ${ke(e)}`)}function mn(e,t,n){switch(e.type){case"Char":if(e.kind==="meta")switch(e.value){case"\\w":return $t(...Ig);case"\\W":return Dn().filter(r=>Ht(Ig,r)===-1);case"\\d":return $t(...Mg);case"\\D":return Dn().filter(r=>Ht(Mg,r)===-1);case"\\s":return $t(...Tg);case"\\S":return Dn().filter(r=>Ht(Tg,r)===-1);case"\\b":case"\\B":throw new I(`Meta character ${e.value} not implemented yet!`);case".":{let r=n.dotAll?TS:c$;return Dn().filter(i=>Ht(r,i)===-1)}}if(e.symbol===void 0)throw new I(`Unexpected undefined symbol received for non-meta Char! Received: ${ke(e)}`);return Re(e.symbol);case"Repetition":{let r=mn(e.expression,t,n);switch(e.quantifier.kind){case"*":return Pe({...t,unit:r});case"+":return Pe({...t,minLength:1,unit:r});case"?":return Pe({...t,minLength:0,maxLength:1,unit:r});case"Range":return Pe({...t,minLength:e.quantifier.from,maxLength:e.quantifier.to,unit:r});default:throw Og(e.quantifier)}}case"Quantifier":throw new I("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return j(...U(e.expressions,r=>mn(r,t,n))).map(r=>ce(r,""));case"CharacterClass":if(e.negative){let r=U(e.expressions,i=>mn(i,t,n));return Dn().filter(i=>zg(r,o=>!o.canShrinkWithoutContext(i)))}return Me(...U(e.expressions,r=>mn(r,t,n)));case"ClassRange":{let r=e.from.codePoint,i=e.to.codePoint;return te({min:r,max:i}).map(o=>u$(o),o=>{if(typeof o!="string")throw new I("Invalid type");if([...o].length!==1)throw new I("Invalid length");return gr(o,0)})}case"Group":return mn(e.expression,t,n);case"Disjunction":return Me(e.left!==null?mn(e.left,t,n):Re(""),e.right!==null?mn(e.right,t,n):Re(""));case"Assertion":if(e.kind==="^"||e.kind==="$")return n.multiline?e.kind==="^"?Me(Re(""),j(Pe({unit:Dn()}),$t(...Cc)).map(r=>`${r[0]}${r[1]}`,r=>{if(typeof r!="string"||r.length===0)throw new I("Invalid type");return[ge(r,0,r.length-1),r[r.length-1]]})):Me(Re(""),j($t(...Cc),Pe({unit:Dn()})).map(r=>`${r[0]}${r[1]}`,r=>{if(typeof r!="string"||r.length===0)throw new I("Invalid type");return[r[0],ge(r,1)]})):Re("");throw new I(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":throw new I("Backreference nodes not implemented yet!");case"UnicodeProperty":return l$(e);default:throw Og(e)}}function d$(e,t={}){for(let a of e.flags)if(a!=="d"&&a!=="g"&&a!=="m"&&a!=="s"&&a!=="u")throw new I(`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=Z6(r$(e));n!==void 0&&(o=q6(o,n));let s=mn(o,r,i);return n!==void 0?s.filter(a=>[...a].length<=n):s}function f$(e){let t=[];for(let n=0;n!==e.length;++n)t.push(e[n].next());return t}function p$(e,t){for(let n=0;n!==e.length;++n)t[n]=e[n].next()}function h$(e){for(let t=0;t!==e.length;++t)if(e[t].done)return!0;return!1}function*m$(...e){let t=f$(e);for(;!h$(t);)yield t.map(n=>n.value),p$(e,t)}function*y$(e){let t=e;for(;;)yield t,++t}var g$=class extends de{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?_.nil():new _(m$(this.arb.shrink(e,t),y$(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 b$(e,t){return new g$(e,t)}var S$=Sm({Arbitrary:()=>de,ExecutionStatus:()=>NI,PreconditionFailure:()=>wn,Random:()=>$c,Stream:()=>_,Value:()=>O,VerbosityLevel:()=>dI,__commitHash:()=>v$,__type:()=>w$,__version:()=>x$,anything:()=>cS,array:()=>le,assert:()=>tM,asyncDefaultReportMessage:()=>ub,asyncModelRun:()=>j6,asyncProperty:()=>uI,asyncStringify:()=>Nc,asyncToStringMethod:()=>Zt,base64String:()=>ZN,bigInt:()=>Sn,bigInt64Array:()=>z6,bigUint64Array:()=>G6,boolean:()=>Ei,chainUntil:()=>GM,check:()=>db,clone:()=>ZM,cloneIfNeeded:()=>mr,cloneMethod:()=>Te,commands:()=>N6,compareBooleanFunc:()=>YO,compareFunc:()=>JO,configureGlobal:()=>sI,constant:()=>Re,constantFrom:()=>$t,context:()=>jM,createDepthIdentifier:()=>Fc,date:()=>Rb,defaultReportMessage:()=>lb,dictionary:()=>Bc,domain:()=>zc,double:()=>Ms,emailAddress:()=>uO,entityGraph:()=>Y2,falsy:()=>FM,float:()=>Wb,float32Array:()=>Jb,float64Array:()=>Xb,func:()=>e2,gen:()=>cM,getDepthContextFor:()=>Dc,hasAsyncToStringMethod:()=>Oc,hasCloneMethod:()=>Fn,hasToStringMethod:()=>Tc,hash:()=>Cs,infiniteStream:()=>WN,int16Array:()=>Qb,int32Array:()=>eS,int8Array:()=>tS,integer:()=>te,ipV4:()=>qc,ipV4Extended:()=>Hb,ipV6:()=>qb,json:()=>BN,jsonValue:()=>dS,letrec:()=>Yb,limitShrink:()=>b$,lorem:()=>rN,map:()=>wc,mapToConstant:()=>wr,maxSafeInteger:()=>Kb,maxSafeNat:()=>i2,memo:()=>aN,mixedCase:()=>pN,modelRun:()=>_6,nat:()=>yn,noBias:()=>As,noShrink:()=>Ps,object:()=>LN,oneof:()=>Me,option:()=>Jt,pre:()=>DC,property:()=>cI,readConfigureGlobal:()=>gt,record:()=>Sc,resetConfigureGlobal:()=>aI,sample:()=>rM,scheduledModelRun:()=>B6,scheduler:()=>U6,schedulerFor:()=>W6,set:()=>aS,shuffledSubarray:()=>t6,sparseArray:()=>sS,statistics:()=>oM,stream:()=>bn,string:()=>Pe,stringMatching:()=>d$,stringify:()=>ke,subarray:()=>e6,toStringMethod:()=>bt,tuple:()=>j,uint16Array:()=>nS,uint32Array:()=>rS,uint8Array:()=>iS,uint8ClampedArray:()=>oS,ulid:()=>u6,uniqueArray:()=>jn,uuid:()=>y6,webAuthority:()=>mS,webFragments:()=>gS,webPath:()=>SS,webQueryParameters:()=>wS,webSegment:()=>bS,webUrl:()=>I6}),w$="module",x$="4.8.0",v$="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c",je=S$;var R$=24301;function Os(e,t){return e.reduce((n,r)=>C$(n,t[r.idx]?.paramSpaces),new Map)}function vr(e,t){return Object.fromEntries(Object.entries(e.paramSpaces).map(([n,r])=>[n,k$(r,r?.name==null?0:t.get(r.name)??0)]))}var OS=new WeakMap;function k$(e,t){if(e==null)return NS(void 0,t);let n=OS.get(e)??new Map;OS.set(e,n);let r=n.get(t);if(r!=null)return r;let i=NS(e,t);return n.set(t,i),i}function E$(e){return e?.values!=null&&e.values.length>0?je.constantFrom(...e.values):A$(e)}function NS(e,t){let[n]=je.sample(E$(e),{numRuns:1,seed:R$+t});if(n==null)throw new Error("arbitrary produced no sample");return n}function A$(e){if(e?.type==="number")return je.integer();if(e?.type==="boolean")return je.boolean();let t=e?.generator==null?void 0:I$[e.generator];if(t!=null)return t;let n=e?.constraints?.kind==="string"?e.constraints:void 0;return je.string({maxLength:n?.maxLength,minLength:n?.minLength??1}).filter(r=>r.trim().length>0&&r===r.trim())}function C$(e,t){return t==null?e:Object.values(t).reduce((n,r)=>r==null?n:new Map([...n,[r.name,(n.get(r.name)??0)+1]]),e)}var P$="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],xr=e=>je.array(je.constantFrom(...P$),{maxLength:e,minLength:1}).map(t=>t.join("")),Qc=(e,t)=>je.array(xr(10),{maxLength:t,minLength:1}).map(n=>n.join(e)),I$={"company.name":Qc(" ",3),"date.iso":M$(),"internet.email":T$(),"internet.url":O$(),"lorem.slug":Qc("-",3),"lorem.word":xr(10),"person.fullName":Qc(" ",2)};function M$(){return je.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 T$(){return je.tuple(xr(12),xr(10),je.constantFrom("com","dev","io","org","ai")).map(([e,t,n])=>`${e}@${t}.${n}`)}function O$(){return je.tuple(je.constantFrom("http","https"),xr(12),je.constantFrom("app","com","dev","io","org"),je.array(xr(8),{maxLength:3})).map(([e,t,n,r])=>{let i=r.length===0?"":`/${r.join("/")}`;return`${e}://${t}.${n}${i}`})}var N$=new Map;function Ns(e){return vr(e,N$)}import{z as ne}from"zod";var Rr=ne.enum(["crash","data-rule","fact","frame"]),$S=ne.object({intent:ne.string().min(1),test:ne.string().min(1)}),$$=ne.union([ne.object({kind:ne.literal("scalar-mismatch"),subject:ne.string().min(1)}),ne.object({entity:ne.string().min(1),kind:ne.string().min(1)})]),L$=ne.discriminatedUnion("kind",[ne.object({kind:ne.literal("consistency"),layer:Rr,mismatch:$$,step:$S.nullable()}),ne.object({kind:ne.literal("pending-check"),layer:Rr,source:ne.string().min(1),step:$S}),ne.object({intent:ne.string().min(1),kind:ne.literal("unrunnable"),layer:Rr,reason:ne.string().min(1),test:ne.string().min(1)}),ne.object({error:ne.string().min(1),kind:ne.literal("driver-error"),layer:Rr,step:ne.string().min(1)}),ne.object({kind:ne.literal("impossible-action"),layer:Rr,step:ne.string().min(1)})]);function ed(e){return e.kind==="driver-error"||e.kind==="unrunnable"?"crash":e.kind==="pending-check"?e.source.kind==="data-rule"?"data-rule":e.source.kind==="fact"?"fact":"frame":"frame"}function Ai(e,t){let r=t.map(i=>({line:ku(i),part:DS(i)})).toSorted((i,o)=>C(i.part).localeCompare(C(o.part))).map(i=>i.part);return{layer:F$(r),signature:C({baseState:e,parts:r.map(i=>C(i))})}}var LS={crash:0,"data-rule":1,fact:2,frame:3};function DS(e){let t=ed(e);switch(e.kind){case"consistency":return{kind:"consistency",layer:t,mismatch:D$(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};case"lift-visibility":return{kind:"impossible-action",layer:t,step:`lift:${String(e.visibleIndex)}`}}}function D$(e){return e.kind==="scalar-mismatch"?{kind:e.kind,subject:Wt(e.subject)}:{entity:e.entity,kind:e.kind}}function F$(e){return e.map(n=>n.layer).toSorted((n,r)=>LS[n]-LS[r]).at(0)??"frame"}import{z as $s}from"zod";var Ci=$s.number().min(0).max(10),FS=$s.object({destructiveActions:Ci,leadsToMutation:Ci,maxAttemptLength:$s.number().int().positive(),mixWorkflows:Ci,mutatingActions:Ci,scopedBoost:$s.number().min(1),sharedEntity:Ci}),td={even:{destructiveActions:2,leadsToMutation:2,maxAttemptLength:12,mixWorkflows:3,mutatingActions:4,scopedBoost:8,sharedEntity:5}};function _S(e){return td[e]}function nd(e,t,n){let r=t.reduce((u,c)=>u+c,0),i=t.reduce((u,c)=>[...u,(u.at(-1)??0)+c],[]),o=n()*r,s=i.findIndex(u=>o<u),a=r<=0?Math.floor(n()*e.length):s,l=e[a<0?e.length-1:a];if(l==null)throw new Error("weighted sample drew an empty set");return l}var jS=4,_$=.1,j$=4,B$=.15,V$=2,U$=2,BS=.2;function Ls(e){let t=e.corpus.map(()=>-Math.log(1-e.random()));return{startingPoint:e.startingPoint.name,steps:WS({jitter:t,params:e},e.startingPoint.snapshot,[],new Map)}}function WS(e,t,n,r){let{params:i}=e;if(n.length>=i.strategy.maxAttemptLength)return n;let o=Oo(i.facts,t),s=Ko(i.corpus,{snapshot:o},W$(i.corpus,n)),a=z$(o,s),l=s.filter(p=>(r.get(`${a}#${String(p.idx)}`)??0)<V$&&n.filter(m=>m.idx===p.idx).length<K$(i.corpus,p)),u=G$({corpus:i.corpus,options:l,random:i.random});if(u.length===0)return n;let c=H$({context:e,here:a,path:n,pool:u,seen:r}),d=`${a}#${String(c.idx)}`;return WS(e,c.stepRun.next.snapshot,[...n,{idx:c.idx,params:c.params}],new Map([...r,[d,(r.get(d)??0)+1]]))}function W$(e,t){let n=Os(t,e);return r=>vr(r,n)}function z$(e,t){return C({enabled:t.map(n=>n.idx),holds:qr(e.scalars).filter(([,n])=>n.subject.kind==="element").map(([n,r])=>[n,r.expect.expect==="is"?r.expect.value===!0:"x"])})}function G$({corpus:e,options:t,random:n}){let r=t.filter(i=>!zS(e,i));return r.length===0||n()<_$?t:r}function zS(e,t){let n=e[t.idx];return n==null||n.nav.length>0||n.effectStep.action.kind==="goto"}function K$(e,t){return zS(e,t)?1:U$}function H$({context:e,here:t,path:n,pool:r,seen:i}){let{jitter:o,params:s}=e,a=r.map(l=>{let u=i.get(`${t}#${String(l.idx)}`)??0,c=n.filter(p=>p.idx===l.idx).length,d=Math.pow(B$,c)/(1+j$*u);return q$(s,l,n)*d*(o[l.idx]??1)});return nd(r,a,s.random)}function q$(e,t,n){let r=e.corpus[t.idx];if(r==null)return jS;let i=e.strategy,o=J$(e.corpus,r,n),s=o?i.mixWorkflows:0,a=o&&X$(e.corpus,r,n)?i.sharedEntity:0,l=jS+s+a,u=e.scopedTests.has(r.test)?l*i.scopedBoost:l,c=n.length/e.strategy.maxAttemptLength;return u*Y$({action:r,corpus:e.corpus,progress:c,s:i})}function Y$({action:e,corpus:t,progress:n,s:r}){let o=ql(e.effectStep)||Yl(e.effectStep)?Math.max(1,r.mutatingActions):1,s=qp(e.effectStep),a=s?1+(Math.max(1,r.destructiveActions)-1)*n:1,l=s?BS+(1-BS)*n:1,u=Z$(t).has(e.test)?Math.max(1,r.leadsToMutation):1;return o*a*u*l}var VS=new WeakMap;function Z$(e){let t=VS.get(e);if(t!=null)return t;let n=new Set(e.filter(r=>ql(r.effectStep)||Yl(r.effectStep)).map(r=>r.test));return VS.set(e,n),n}function J$(e,t,n){let r=new Set(n.flatMap(i=>{let o=e[i.idx];return o==null?[]:[o.test]}));return r.size>0&&!r.has(t.test)}function X$(e,t,n){let r=US(t),i=new Set(n.flatMap(o=>{let s=e[o.idx];return s==null?[]:[...US(s)]}));return[...r].some(o=>i.has(o))}function US(e){return new Set([...Zp(e.effectStep),...e.requiredState.entities.map(t=>t.entity)])}import{z as G}from"zod";var GS=G.object({baseStateTest:co,lockfileHash:G.string().min(1),stepRuns:G.array(G.object({idx:G.number().int().nonnegative(),params:G.record(G.string(),G.union([Ft,G.null()]))}))}),KS=G.object({baseStateRef:G.string().min(1),steps:G.array(G.object({index:G.number().int().nonnegative(),params:G.record(G.string(),G.union([Ft,G.null()])),test:G.string().min(1)}))}),HS=G.object({actions:G.array(G.string()),label:G.string().min(1)}),rd=G.object({test:G.string().min(1),text:G.string()}),Q$=G.object({baseLabel:G.string(),baseState:G.string().min(1),durationMs:G.number().int().nonnegative(),signature:G.string().optional(),steps:G.array(rd)}),qS=G.object({kind:G.enum(["aborted","clean","error","flaky","finding"]),reason:G.string().optional(),runId:G.string().optional(),trail:Q$.optional()});function Ds(e,{sweep:t}){let n=Ut(Le(e),r=>C({s:r.test.singletons,w:r.test.world})).map(r=>({name:r.ref,test:r.test}));return t?[...n,...n.flatMap(r=>e4(r))]:n}function Fs(e,t,n){return sr(e,t.test,n)}function e4(e){return t4(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 t4(e){return e.world.filter(t=>{let n=C({...e,world:e.world.filter(r=>r!==t)});return!n.includes(`"${t.as}.`)&&!n.includes(`"ref":"${t.as}"`)})}async function _s(e){let t=ti(e);if(t.length===0)return null;let n=Ds(e,{sweep:!1}),r=await n4(e,n);return r.length===0?null:{corpus:t,facts:cr(e).facts.filter(i=>!i.localConsequence),startingPoints:r,startingPointTests:new Map(n.map(i=>[i.name,i.test]))}}function YS({lockfileHash:e,prepared:t,random:n,scopedTests:r,strategy:i}){let o=t.startingPoints[Math.floor(n()*t.startingPoints.length)];if(o==null)return null;let s=Ls({corpus:t.corpus,facts:t.facts,random:n,scopedTests:r,startingPoint:o,strategy:i}),a=t.startingPointTests.get(s.startingPoint);return a==null||s.steps.length===0?null:{baseStateTest:a,lockfileHash:e,stepRuns:s.steps.map(l=>({idx:l.idx,params:l.params}))}}async function n4(e,t){let n={generate:fi,materialize:Uo(fi,e.valueSpaces),params:void 0};return(await Promise.all(t.map(async i=>(await Fs(e,i,n)).match(s=>({name:i.name,snapshot:s.snapshot}),()=>null)))).flatMap(i=>i==null?[]:[i])}import{ResultAsync as Vs}from"neverthrow";var Bn=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}},Vn=class extends Error{readyKey;timeoutMs;constructor(t,n){super("app-not-ready"),this.readyKey=t,this.timeoutMs=n}};function id(e){return{read:t=>h4(t,e),seedScript:t=>`globalThis[${JSON.stringify(pl)}] = ${JSON.stringify(t)};`}}async function h4(e,t){let n=Ue(Qn(e.url()),ZS([[{kind:"title"},await e.title()],[{kind:"viewport"},g4(e.viewportSize())]]));if(t.length===0)return{scalars:n};let r=await e.evaluate(y4,{mountKey:lo,names:t,timeoutMs:m4});if(r.kind==="unmounted")throw new Bn(lo);let i=ZS(Object.entries(r.values).map(([o,s])=>[{kind:"variable",name:o},s]));return{scalars:Ue(n,i)}}function ZS(e){return new Map(e.flatMap(([t,n])=>n===void 0?[]:[[K(t),{declared:!0,expect:{expect:"is",value:n},subject:t}]]))}var m4=5e3;async function y4(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 g4(e){return e==null?"":`${String(e.width)}x${String(e.height)}`}async function js({page:e,readiness:t,signal:n,startMs:r,tries:i,url:o}){if(rt(n),!await b4(e,o)){if(Date.now()-r>=t.budgetMs)throw new Vn(Vr,t.budgetMs);let a=t.backoffMs[Math.min(i,t.backoffMs.length-1)]??8e3;await dn(a,n),await js({page:e,readiness:t,signal:n,startMs:r,tries:i+1,url:o});return}let s=Math.max(0,t.budgetMs-(Date.now()-r));if(!await v4(e,n,Math.min(s,w4(t,i)))){if(Date.now()-r>=t.budgetMs)throw new Vn(Vr,t.budgetMs);await js({page:e,readiness:t,signal:n,startMs:r,tries:i+1,url:o})}}function od(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 Bs(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)}async function b4(e,t){let n=await S4(e,t);return n==="net-error"?!1:n==null||n.status()<400}async function S4(e,t){try{return await e.goto(t,{waitUntil:"domcontentloaded"})}catch(n){if(od(n))return"net-error";throw n}}function w4(e,t){return t===0?e.budgetMs/2:e.budgetMs}var x4=50;async function v4(e,t,n){let r=Date.now()+n;for(;Date.now()<r;){if(rt(t),await JS(e))return!0;await dn(x4,t)}return JS(e)}async function JS(e){try{return await e.evaluate(R4,Vr)}catch(t){if(Bs(t))return!1;throw t}}function R4(e){return Reflect.get(globalThis,e)===!0}var k4={backoffMs:[500,1e3,2e3,4e3,8e3],budgetMs:3e4};function ad(e,t,n,r,i=k4){return{awaitCheck:(o,s)=>Vs.fromPromise(C4({check:o,engine:n,page:e,signal:r,timeoutMs:s}),a=>li(a)?{kind:"aborted"}:sd(a)),evaluate:o=>Vs.fromPromise(QS(ld(e,n,o),`check ${o.kind}`),sd),locateIds:o=>B4(e,o),observe:o=>t.read().andThen(s=>Vs.fromPromise(QS(T4(e,n,s,o),"observe"),sd)),perform:o=>Vs.fromPromise(rw(e,o,0,r,i),s=>E4(o,s))}}function sd(e){return e instanceof Bn?So(e.mountKey):Wl(e)}async function ld(e,t,n){try{return await sw(e,t,n)}catch(r){if(Bs(r))return!1;throw r}}function E4(e,t){return t instanceof Vn?_l(t.readyKey,t.timeoutMs):t instanceof Bn?So(t.mountKey):Ul(e.kind,t)}var A4=75;function C4(e){return e.check.kind==="visible"?P4({locator:e.check.locator,page:e.page,signal:e.signal,timeoutMs:e.timeoutMs}):tw(e,Date.now()+e.timeoutMs)}async function tw(e,t){return rt(e.signal),await ld(e.page,e.engine,e.check)?!0:Date.now()>=t?!1:(await dn(A4,e.signal),tw(e,t))}async function P4({locator:e,page:t,signal:n,timeoutMs:r}){try{return await Promise.race([Ws(t,e,{visibleOnly:!0}).waitFor({state:"visible",timeout:r}),I4(n)]),!0}catch(i){if(M4(i))return!1;throw i}}function I4(e){return new Promise((t,n)=>{if(e.aborted){n(new mt);return}e.addEventListener("abort",()=>{n(new mt)},{once:!0})})}function M4(e){return e instanceof Error&&e.name==="TimeoutError"}async function T4(e,t,n,r){let i=await nw(e,t,0),o=await O4(e,t,r);return{snapshot:{...n,scalars:new Map([...n.scalars,...i.scalars,...o])}}}async function O4(e,t,n){let r=await Promise.all([...n.values()].filter(i=>i.subject.kind==="element").map(async i=>{let o=await N4(e,t,i.subject);return[K(i.subject),{declared:!0,expect:{expect:"is",value:o},subject:i.subject}]}));return new Map(r)}async function N4(e,t,n){return n.state==="value"||n.state==="text"?$4(e,n.locator,n.state):ld(e,t,{kind:n.state,locator:n.locator})}async function $4(e,t,n){try{let r=Ws(e,t,{visibleOnly:!0});return n==="value"?await r.inputValue():await r.textContent()??""}catch{return""}}var L4=[100,250,500];async function nw(e,t,n){try{return await t.read(e)}catch(r){let i=L4[n],o=Bs(r)||r instanceof Bn;if(i==null||!o)throw r;return await ow(i),nw(e,t,n+1)}}var XS=35e3;function QS(e,t){let n,r=new Promise((i,o)=>{n=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(XS)}ms`))},XS)});return Promise.race([e,r]).finally(()=>{clearTimeout(n)})}var D4=[250,750,2e3];async function rw(e,t,n,r,i){try{await F4(e,t,r,i)}catch(o){let s=D4[n];if(s==null||!od(o))throw o;await ow(s),await rw(e,t,n+1,r,i)}}async function F4(e,t,n,r){if(t.kind==="goto"){await js({page:e,readiness:r,signal:n,startMs:Date.now(),tries:0,url:kr(t.url,t,"url")});return}if(t.kind==="press"&&t.locator==null){await e.keyboard.press(kr(t.key,t,"key"));return}let i=t.kind!=="upload";await _4(e,Ws(e,t.locator,{visibleOnly:i}),t)}function kr(e,t,n){if(e==null)throw new Error(`action "${t.kind}" requires ${n}`);return e}function _4(e,t,n){switch(n.kind){case"goto":throw new Error("goto must not be located");case"fill":return t.fill(String(kr(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 j4(e,t,String(kr(n.value,n,"value")));case"upload":return t.setInputFiles(kr(n.files,n,"files"));case"press":return t.press(kr(n.key,n,"key"))}}async function j4(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(iw("option",n)).filter({visible:!0}).click()}async function B4(e,t){if(t==null)return[];try{let n=Us(e,t,{visibleOnly:!1});if(await n.count()===0)return[];let r=await n.first().evaluate(V4);return r>0?[r]:[]}catch{return[]}}function V4(e){return globalThis.__ripploRrwebMirror?.getId(e)??-1}function Ws(e,t,n){if(t==null)throw new Error("action requires a locator");return Us(e,t,n)}function Us(e,t,n){if(t.by==="inside"){let i=Us(e,t.scope,n);return Us(i,t.target,n)}let r=t.by==="testId"?e.getByTestId(t.value):e.locator(iw(t.role,t.name));return n.visibleOnly?r.filter({visible:!0}):r}function iw(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}function ow(e){return new Promise(t=>{setTimeout(t,e)})}async function sw(e,t,n){if(n.kind==="browser")return z4(e,t,n.key,n.value);if(n.kind==="not")return!await sw(e,t,n.inner);let r=Ws(e,n.locator,{visibleOnly:!0});return n.kind==="value"?await r.inputValue()===n.value:n.kind==="text"?(await r.textContent()??"").includes(n.value):n.kind==="unobstructed"?U4(r):W4(r,n.kind)}function U4(e){return e.evaluate(t=>{let n=t.getBoundingClientRect(),r=t.ownerDocument.defaultView;if(r==null||n.width<=0||n.height<=0)return!1;let i=2,o=Math.min(9,Math.max(3,Math.round(n.width/12))),s=Math.min(5,Math.max(2,Math.round(n.height/12))),a=(c,d,p)=>Array.from({length:p},(m,f)=>c+i+(d-i*2)*f/(p-1)),u=a(n.left,n.width,o).flatMap(c=>a(n.top,n.height,s).map(d=>({x:c,y:d}))).filter(c=>c.x>=0&&c.y>=0&&c.x<=r.innerWidth&&c.y<=r.innerHeight);return u.length===0?!1:u.every(c=>{let d=t.ownerDocument.elementFromPoint(c.x,c.y);return d!=null&&(d===t||t.contains(d)||d.contains(t))})})}function W4(e,t){return t==="visible"?e.isVisible():t==="disabled"?e.isDisabled():t==="enabled"?e.isEnabled():t==="checked"?e.isChecked():t==="expanded"?ew(e,n=>n.getAttribute("aria-expanded")==="true"):t==="pressed"?ew(e,n=>n.getAttribute("aria-pressed")==="true"):e.evaluate(n=>n===n.ownerDocument.activeElement)}async function ew(e,t){return await e.count()===0?!1:e.evaluate(t)}async function z4(e,t,n,r){let i=await t.read(e),o=$e(i.scalars,n);return r===null?o===void 0:o===r}import G4 from"path";var lw={height:720,width:1280};async function ud({baseUrl:e,browser:t,capture:n,clientState:r,engine:i,fixturesDir:o,networkHeaders:s,reader:a,session:l,signal:u,viewport:c}){let d=await t.newContext({baseURL:e,ignoreHTTPSErrors:!0,reducedMotion:"reduce",storageState:l==null?void 0:{cookies:K4(l.cookies,e),origins:l.origins},viewport:c});s!=null&&await H4(d,e,s),l?.headers!=null&&await d.setExtraHTTPHeaders(l.headers),await d.addInitScript("globalThis.__name = globalThis.__name ?? ((target) => target);"),await d.addInitScript(i.seedScript(r));let p=n==null?q4():await n.hub.attach(d,n.runId),m=await d.newPage();return p.onPage(m),{context:d,driver:J4(Y4(ad(m,a,i,u),o),p),emitAssertion:p.emitAssertion,emitFinding:p.emitFinding,close:()=>X4({context:d,handle:p})}}async function cd(e,t){let n=await cw(e,void 0);try{return await t(n)}finally{await n.close()}}async function uw(e){let{chromium:t}=await import("playwright");return t.launchPersistentContext(e,{headless:!1,viewport:null})}function K4(e,t){let n=new URL(t).hostname;return e.map(r=>({...r,domain:n}))}async function H4(e,t,n){let r=new URL(t).host;await e.route(i=>i.host===r,i=>i.continue({headers:{...i.request().headers(),...n}}))}function q4(){return{emitAction:()=>{},emitAssertion:()=>{},emitFinding:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function cw(e,t){let{chromium:n}=await import("playwright"),r=t==null?[]:[`--disk-cache-dir=${t}`,"--disk-cache-size=268435456"];return n.launch({args:r,headless:!e})}function zs({cacheDir:e,headed:t}){let n;return{acquire:async()=>{let o=n;if(o!=null){let s=await o.catch(()=>{});if(s?.isConnected()===!0)return s;n===o&&(n=void 0)}return n??=cw(t,e),n},close:async()=>{let o=n;n=void 0,o!=null&&await o.then(s=>s.close()).catch(()=>{})}}}function Y4(e,t){return{awaitCheck:e.awaitCheck,evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:n=>e.perform(Z4(n,t))}}function Z4(e,t){return e.kind!=="upload"||e.files==null?e:{...e,files:e.files.map(n=>G4.join(t,n))}}function J4(e,t){return{awaitCheck:e.awaitCheck,evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:n=>(t.emitAction(n),e.perform(n))}}async function X4({context:e,handle:t}){await aw(t.finish()),await aw(e.close())}var Q4=15e3;async function aw(e){let t,n=new Promise(r=>{t=setTimeout(r,Q4)});await Promise.race([e.catch(()=>{}),n]).finally(()=>{clearTimeout(t)})}import{err as e3,ok as t3,Result as dd}from"neverthrow";function fd(e,t,n){return{read:()=>n.read(e.map(r=>r.name),t).andThen(r=>n3(e,r))}}function n3(e,t){return dd.combine(e.map(n=>r3(n,t.entities[n.name]??[]).map(r=>[n.name,r]))).map(n=>({entities:new Map(n),scalars:new Map(Object.entries(t.singletons).map(([r,i])=>[K({kind:"variable",name:r}),{declared:!0,expect:{expect:"is",value:i},subject:{kind:"variable",name:r}}]))}))}function r3(e,t){let n=ui(e);return dd.combine(t.map(r=>i3(r,e).map(i=>[i,o3(r,n)]))).map(r=>new Map(r))}function i3(e,t){return dd.combine(t.identity.map(n=>{let r=e[n];return r==null?e3(Bl(t.name,n)):t3(String(r))})).map(n=>n.join(":"))}function o3(e,t){let n=t.map(r=>[r,e[r]]).filter(r=>r[1]!=null);return Object.fromEntries(n)}var dw=Xa(j0(),1);import s3 from"crypto";import{err as a3,errAsync as pd,ok as l3,ResultAsync as Er}from"neverthrow";var u3=3e4,c3=[250,750,2e3],d3=[500,1e3,2e3,3e3];function hd({baseUrl:e,extraHeaders:t,runId:n,secret:r},i){let o=new dw.Webhook(r),s=(a,l,u)=>f3({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:Pl,signal:i}).map(u=>({entities:u.entities,singletons:u.singletons}))},ready:()=>pw(e,t,i,0),setupWorld:a=>s("/setup",{entities:a,runId:n},{retry:"connection",schema:Cl,signal:i}).map(l=>l.rows),teardown:()=>s("/teardown",{runId:n},{retry:"connection",schema:Il,signal:void 0}).map(()=>{})}}function f3(e){return fw(e.retry,()=>y3(e),0)}function fw(e,t,n){return t().orElse(r=>{let i=c3[n];return i==null||!h3(r,e)?pd(r):Er.fromSafePromise(hw(i)).andThen(()=>fw(e,t,n+1))})}function pw(e,t,n,r){return Er.fromPromise(fetch(e,{headers:t,method:"HEAD",signal:mw(n)}),i=>nr("",i)).map(()=>{}).orElse(()=>{let i=d3[r];return i==null||n.aborted?pd(Vl(e)):Er.fromSafePromise(hw(i)).andThen(()=>pw(e,t,n,r+1))})}var p3=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function h3(e,t){return e.kind==="aborted"?!1:m3(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function m3(e){return e.kind==="engine-network"&&e.code!=null&&p3.has(e.code)}function hw(e){return new Promise(t=>{setTimeout(t,e)})}function y3({baseUrl:e,body:t,extraHeaders:n,path:r,schema:i,signal:o,webhook:s}){let a=JSON.stringify(t);return Er.fromPromise(fetch(`${e}${r}`,{body:a,headers:{...n,"Content-Type":"application/json",...g3(s,a)},method:"PUT",signal:mw(o)}),l=>nr(r,l)).andThen(l=>b3(l,r)).andThen(l=>S3(i,l,r)).mapErr(l=>o?.aborted===!0?zl():l)}function g3(e,t){let n=`msg_${s3.randomUUID()}`,r=new Date;return{"webhook-id":n,"webhook-signature":e.sign(n,r,t),"webhook-timestamp":String(Math.floor(r.getTime()/1e3))}}function mw(e){let t=AbortSignal.timeout(u3);return e==null?t:AbortSignal.any([e,t])}function b3(e,t){return e.ok?Er.fromPromise(e.json(),n=>nr(t,n)):Er.fromPromise(e.text().catch(()=>""),n=>nr(t,n)).andThen(n=>pd(Fl(t,e.status,n)))}function S3(e,t,n){let r=e.safeParse(t);return r.success?l3(r.data):a3(jl(n,r.error))}import $9 from"path";import{err as jr,ok as Xi,ResultAsync as Gf}from"neverthrow";import k0 from"path";import{z as vt}from"zod";import w3 from"path";function yw({debugDir:e,runId:t,worker:n}){let r=w3.join(e,t,"behavior.jsonl");return n.open({file:r,runId:t}),{close:i=>n.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(x3(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:v3(i.timeNanos)};n.line({line:JSON.stringify(o),runId:t,timeNanos:i.timeNanos})},emitRrwebBatch:i=>{n.rrwebBatch({data:i,runId:t})}}}function xn(e){return String(BigInt(Math.round(e))*1000000n)}function x3(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function v3(e){return Number(BigInt(e)/1000000n)}import{existsSync as R3}from"fs";import{createRequire as k3}from"module";import{fileURLToPath as E3}from"url";import{Worker as A3}from"worker_threads";var C3=k3(import.meta.url);function gw(e){let t=new A3(P3(),{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 P3(){try{return C3.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(n=>E3(new URL(n,import.meta.url))),t=e.find(n=>R3(n));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}function Sw(e){if(e.kind==="pending-check")return null;let t={kind:"finding",source:"verifier",timeNanos:xn(Date.now())};return e.kind==="consistency"?{...t,...I3(e.mismatch),findingKind:"consistency",pending:e.pending,step:e.step==null?"":Gt(e.step),wait:e.budget,waitMs:Mt[e.budget]}:e.kind==="impossible-action"?{...t,findingKind:e.kind,step:Gt(e.step),subject:"action could not run"}:e.kind==="unrunnable"?{...t,findingKind:e.kind,step:e.intent,subject:`step could not run (${e.reason})`}:e.kind==="lift-visibility"?{...t,findingKind:e.kind,step:String(e.declaredIndex+1),subject:`visibility liftable to step ${String(e.visibleIndex+1)}`}:{...t,findingKind:e.kind,step:Gt(e.step),subject:Pt(e.error)}}function I3(e){return e.kind==="scalar-mismatch"?{actual:we(e.sut),expected:is(e.want),mismatchKind:e.kind,subject:Wt(e.subject)}:e.kind==="wrong-value"?{actual:we(e.sut),expected:we(e.snapshot),mismatchKind:e.kind,subject:bw(e.entity,e.field,e.key)}:e.kind==="expected-change"?{expected:`change from ${we(e.value)}`,mismatchKind:e.kind,subject:bw(e.entity,e.field,e.key)}:{mismatchKind:e.kind,subject:`${e.entity} [${e.key}]`}}function bw(e,t,n){return`${e}.${t} [${n}]`}import{readFile as M3}from"fs/promises";import{createRequire as T3}from"module";import{fileURLToPath as O3}from"url";var N3=T3(import.meta.url);function md(e,t){try{return N3.resolve(e)}catch{return O3(new URL(`assets/${t}`,import.meta.url))}}var $3=md("@ripplo/browser-trace/bundle","browser-trace.js");async function xw(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await L3())}var ww;function L3(){return ww??=M3($3,{encoding:"utf8"}),ww}import{createServer as D3}from"http";import{mkdir as F3,rm as _3,writeFile as j3}from"fs/promises";import B3 from"path";import{z as re}from"zod";var V3="otlp-port",Rw=re.object({key:re.string(),value:re.object({boolValue:re.boolean().optional(),doubleValue:re.number().optional(),intValue:re.union([re.string(),re.number()]).optional(),stringValue:re.string().optional()})}),U3=re.object({attributes:re.array(Rw).default([]),endTimeUnixNano:re.string(),kind:re.number().default(0),name:re.string(),parentSpanId:re.string().optional(),spanId:re.string(),startTimeUnixNano:re.string(),status:re.object({code:re.number(),message:re.string().optional()}).optional(),traceId:re.string()}),W3=re.object({resourceSpans:re.array(re.object({resource:re.object({attributes:re.array(Rw).default([])}).optional(),scopeSpans:re.array(re.object({spans:re.array(U3).default([])})).default([])})).default([])});async function yd({localDir:e,onRrwebBatch:t,onSpan:n,writePortFile:r}){let{port:i,server:o}=await z3({onRrwebBatch:t,onSpan:n}),s=B3.join(e,V3);return r&&(await F3(e,{recursive:!0}),await j3(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{r&&await _3(s,{force:!0}),await Y3(o)}}}function z3(e){return new Promise((t,n)=>{let r=D3((i,o)=>{G3(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 G3(e,t,n){let r=K3(e.url);if(r!=null){vw(e).then(i=>{n.onRrwebBatch(r,i),Gs(t)}).catch(()=>{Gs(t)});return}vw(e).then(i=>{H3(W3.parse(JSON.parse(i.toString("utf8"))),n.onSpan),Gs(t)}).catch(()=>{Gs(t)})}function K3(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function vw(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 Gs(e){e.writeHead(200,{"content-type":"application/json"}),e.end("{}")}function H3(e,t){e.resourceSpans.flatMap(n=>n.scopeSpans).flatMap(n=>n.spans).forEach(n=>{t({attributes:q3(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:cl(n.kind),status:{code:dl(n.status?.code??0),message:n.status?.message},timeNanos:n.startTimeUnixNano,traceId:n.traceId})})}function q3(e){return Object.fromEntries(e.map(({key:t,value:n})=>[t,String(n.stringValue??n.intValue??n.doubleValue??n.boolValue??"")]))}function Y3(e){return new Promise((t,n)=>{e.close(r=>{if(r==null){t();return}n(r)}),e.closeAllConnections()})}import{readFile as b9}from"fs/promises";var Z3=Object.defineProperty,J3=(e,t,n)=>t in e?Z3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t,n)=>J3(e,typeof t!="symbol"?t+"":t,n),kw,X3=Object.defineProperty,Q3=(e,t,n)=>t in e?X3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ew=(e,t,n)=>Q3(e,typeof t!="symbol"?t+"":t,n),Oe=(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))(Oe||{}),Aw={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Cw={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ks={},eL=()=>!!globalThis.Zone;function xf(e){if(Ks[e])return Ks[e];let t=globalThis[e],n=t.prototype,r=e in Aw?Aw[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 Cw?Cw[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&&!eL())return Ks[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?Ks[e]=u:n}catch{return n}}var gd={};function nn(e,t,n){var r;let i=`${e}.${String(n)}`;if(gd[i])return gd[i].call(t);let o=xf(e),s=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return s?(gd[i]=s,s.call(t)):t[n]}var bd={};function k1(e,t,n){let r=`${e}.${String(n)}`;if(bd[r])return bd[r].bind(t);let o=xf(e)[n];return typeof o!="function"?t[n]:(bd[r]=o,o.bind(t))}function tL(e){return nn("Node",e,"ownerDocument")}function nL(e){return nn("Node",e,"childNodes")}function rL(e){return nn("Node",e,"parentNode")}function iL(e){return nn("Node",e,"parentElement")}function oL(e){return nn("Node",e,"textContent")}function sL(e,t){return k1("Node",e,"contains")(t)}function aL(e){return k1("Node",e,"getRootNode")()}function lL(e){return!e||!("host"in e)?null:nn("ShadowRoot",e,"host")}function uL(e){return e.styleSheets}function cL(e){return!e||!("shadowRoot"in e)?null:nn("Element",e,"shadowRoot")}function dL(e,t){return nn("Element",e,"querySelector")(t)}function fL(e,t){return nn("Element",e,"querySelectorAll")(t)}function pL(){return xf("MutationObserver").constructor}function hL(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 Be={ownerDocument:tL,childNodes:nL,parentNode:rL,parentElement:iL,textContent:oL,contains:sL,getRootNode:aL,host:lL,styleSheets:uL,shadowRoot:cL,querySelector:dL,querySelectorAll:fL,mutationObserver:pL,patch:hL};function E1(e){return e.nodeType===e.ELEMENT_NODE}function Ni(e){let t=e&&"host"in e&&"mode"in e&&Be.host(e)||null;return!!(t&&"shadowRoot"in t&&Be.shadowRoot(t)===e)}function $i(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function mL(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 yL(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 Td(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=>A1(i,n)).join("");return mL(r)}catch{return null}}function A1(e,t){if(bL(e)){let n;try{n=Td(e.styleSheet)||yL(e)}catch{n=e.cssText}return e.styleSheet.href?ka(n,e.styleSheet.href):n}else{let n=e.cssText;return SL(e)&&e.selectorText.includes(":")&&(n=gL(n)),t?ka(n,t):n}}function gL(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function bL(e){return"styleSheet"in e}function SL(e){return"selectorText"in e}var xa=class{constructor(){Ew(this,"idNodeMap",new Map),Ew(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 wL(){return new xa}function va({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:o}){let s=i||"",a=r&&Wn(r);return(t[n.toLowerCase()]||a&&t[a])&&(o?s=o(s,e):s="*".repeat(s.length)),s}function Wn(e){return e.toLowerCase()}var Pw="__rrweb_original__";function xL(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=Pw in o?o[Pw]: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 Ra(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Wn(t):null}function C1(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 vL(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var RL=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,kL=/^(?:[a-z+]+:)?\/\//i,EL=/^www\..*/i,AL=/^(data:)([^,]*),(.*)/i;function ka(e,t){return(e||"").replace(RL,(n,r,i,o,s,a)=>{let l=i||s||a,u=r||o||"";if(!l)return n;if(kL.test(l)||EL.test(l))return`url(${u}${l}${u})`;if(AL.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${vL(t)+l}${u})`;let c=t.split("/"),d=l.split("/");c.pop();for(let p of d)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${u}${c.join("/")}${u})`})}function Hs(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function CL(e,t,n=!1){let r=Array.from(t.childNodes),i=[],o=0;if(r.length>1&&e&&typeof e=="string"){let s=Hs(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=Hs(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 p=u.substring(0,d),m=s.split(p),f=-1;if(m.length===2)f=m[0].length;else if(m.length>2&&m[0]===""&&r[l-1].textContent!=="")f=s.indexOf(p,1);else if(m.length===1){if(p=p.substring(0,p.length-1),m=s.split(p),m.length<=1)return i.push(e),i;d=c+1}else d===u.length-1&&(f=s.indexOf(p));if(m.length>=2&&d>c){let h=r[l-1].textContent;if(h&&typeof h=="string"){let y=Hs(h).length;f=s.indexOf(p,y)}f===-1&&(f=m[0].length)}if(f!==-1){let h=Math.floor(f/a);for(;h>0&&h<e.length;){if(o+=1,o>50*r.length)return i.push(e),i;let y=Hs(e.substring(0,h),n);if(y.length===f){i.push(e.substring(0,h)),e=e.substring(h),s=s.substring(f);break}else y.length<f?h+=Math.max(1,Math.floor((f-y.length)/a)):h-=Math.max(1,Math.floor((y.length-f)*a))}break}}}}return i.push(e),i}function PL(e,t){return CL(e,t).join("/* rr_split */")}var IL=1,ML=new RegExp("[^a-z0-9-_:]"),Di=-2;function P1(){return IL++}function TL(e){if(e instanceof HTMLFormElement)return"form";let t=Wn(e.tagName);return ML.test(t)?"div":t}var Ar,Iw,OL=/^[^ \t\n\r\u000c]+/,NL=/^[, \t\n\r\u000c]+/;function $L(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(NL),!(n>=t.length);){let o=r(OL);if(o.slice(-1)===",")o=Ir(e,o.substring(0,o.length-1)),i.push(o);else{let s="";o=Ir(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 Mw=new WeakMap;function Ir(e,t){return!t||t.trim()===""?t:vf(e,t)}function LL(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function vf(e,t){let n=Mw.get(e);if(n||(n=e.createElement("a"),Mw.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function I1(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)?Ir(e,r):n==="srcset"?$L(e,r):n==="style"?ka(r,vf(e)):t==="object"&&n==="data"?Ir(e,r):r)}function M1(e,t,n){return["video","audio"].includes(e)&&t==="autoplay"}function DL(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 Ea(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ea(Be.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?Ea(Be.parentNode(e),t,n):!1}function T1(e,t,n,r){let i;if(E1(e)){if(i=e,!Be.childNodes(i).length)return!1}else{if(Be.parentElement(e)===null)return!1;i=Be.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(Ea(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 FL(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 _L(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 jL(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:h=!1,cssCaptured:y=!1}=t,S=BL(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Oe.Document,childNodes:[],compatMode:e.compatMode}:{type:Oe.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Oe.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return UL(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:p,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:h,rootId:S});case e.TEXT_NODE:return VL(e,{doc:n,needsMask:s,maskTextFn:u,rootId:S,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:Oe.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Oe.Comment,textContent:Be.textContent(e)||"",rootId:S};default:return!1}}function BL(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function VL(e,t){let{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:o}=t,s=Be.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=Be.textContent(e),u&&l&&(l=ka(l,vf(t.doc)))),!u&&!c&&l&&n&&(l=r?r(l,Be.parentElement(e)):l.replace(/[\S]/g,"*")),{type:Oe.Text,textContent:l||"",rootId:i}}function UL(e,t){let{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:m}=t,f=DL(e,r,i),h=TL(e),y={},S=e.attributes.length;for(let b=0;b<S;b++){let v=e.attributes[b];M1(h,v.name,v.value)||(y[v.name]=I1(n,h,Wn(v.name),v.value))}if(h==="link"&&o){let b=Array.from(n.styleSheets).find(N=>N.href===e.href),v=null;b&&(v=Td(b)),v&&(delete y.rel,delete y.href,y._cssText=v)}if(h==="style"&&e.sheet){let b=Td(e.sheet);b&&(e.childNodes.length>1&&(b=PL(b,e)),y._cssText=b)}if(["input","textarea","select"].includes(h)){let b=e.value,v=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&b?y.value=va({element:e,type:Ra(e),tagName:h,value:b,maskInputOptions:s,maskInputFn:a}):v&&(y.checked=v)}if(h==="option"&&(e.selected&&!s.select?y.selected=!0:delete y.selected),h==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),h==="canvas"&&c){if(e.__context==="2d")xL(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let b=e.toDataURL(l.type,l.quality),v=n.createElement("canvas");v.width=e.width,v.height=e.height;let N=v.toDataURL(l.type,l.quality);b!==N&&(y.rr_dataURL=b)}}if(h==="img"&&u){Ar||(Ar=n.createElement("canvas"),Iw=Ar.getContext("2d"));let b=e,v=b.currentSrc||b.getAttribute("src")||"<unknown-src>",N=b.crossOrigin,$=()=>{b.removeEventListener("load",$);try{Ar.width=b.naturalWidth,Ar.height=b.naturalHeight,Iw.drawImage(b,0,0),y.rr_dataURL=Ar.toDataURL(l.type,l.quality)}catch(L){if(b.crossOrigin!=="anonymous"){b.crossOrigin="anonymous",b.complete&&b.naturalWidth!==0?$():b.addEventListener("load",$);return}else console.warn(`Cannot inline img src=${v}! Error: ${L}`)}b.crossOrigin==="anonymous"&&(N?y.crossOrigin=N:b.removeAttribute("crossorigin"))};b.complete&&b.naturalWidth!==0?$():b.addEventListener("load",$)}if(["audio","video"].includes(h)){let b=y;b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime,b.rr_mediaPlaybackRate=e.playbackRate,b.rr_mediaMuted=e.muted,b.rr_mediaLoop=e.loop,b.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),f){let{width:b,height:v}=e.getBoundingClientRect();y={class:y.class,rr_width:`${b}px`,rr_height:`${v}px`}}h==="iframe"&&!d(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let x;try{customElements.get(h)&&(x=!0)}catch{}return{type:Oe.Element,tagName:h,attributes:y,childNodes:[],isSVG:LL(e)||void 0,needBlock:f,rootId:m,isCustom:x}}function fe(e){return e==null?"":e.toLowerCase()}function O1(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 WL(e,t){if(t.comment&&e.type===Oe.Comment)return!0;if(e.type===Oe.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"&&C1(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(fe(e.attributes.name).match(/^msapplication-tile(image|color)$/)||fe(e.attributes.name)==="application-name"||fe(e.attributes.rel)==="icon"||fe(e.attributes.rel)==="apple-touch-icon"||fe(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&fe(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(fe(e.attributes.property).match(/^(og|twitter|fb):/)||fe(e.attributes.name).match(/^(og|twitter):/)||fe(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(fe(e.attributes.name)==="robots"||fe(e.attributes.name)==="googlebot"||fe(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(fe(e.attributes.name)==="author"||fe(e.attributes.name)==="generator"||fe(e.attributes.name)==="framework"||fe(e.attributes.name)==="publisher"||fe(e.attributes.name)==="progid"||fe(e.attributes.property).match(/^article:/)||fe(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(fe(e.attributes.name)==="google-site-verification"||fe(e.attributes.name)==="yandex-verification"||fe(e.attributes.name)==="csrf-token"||fe(e.attributes.name)==="p:domain_verify"||fe(e.attributes.name)==="verify-v1"||fe(e.attributes.name)==="verification"||fe(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Mr(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:p,slimDOMOptions:m,dataURLOptions:f={},inlineImages:h=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:x,iframeLoadTimeout:b=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:N=5e3,keepIframeSrcFn:$=()=>!1,newlyAddedElement:L=!1,cssCaptured:D=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:V=!0}=t;M||(M=T1(e,s,a,M===void 0));let se=jL(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,dataURLOptions:f,inlineImages:h,recordCanvas:y,keepIframeSrcFn:$,newlyAddedElement:L,cssCaptured:D});if(!se)return console.warn(e,"not serialized"),null;let pe;r.hasNode(e)?pe=r.getId(e):WL(se,m)||!V&&se.type===Oe.Text&&!se.textContent.replace(/^\s+|\s+$/gm,"").length?pe=Di:pe=P1();let F=Object.assign(se,{id:pe});if(r.add(e,F),pe===Di)return null;S&&S(e);let _e=!l;if(F.type===Oe.Element){_e=_e&&!F.needBlock,delete F.needBlock;let Ie=Be.shadowRoot(e);Ie&&$i(Ie)&&(F.isShadowHost=!0)}if((F.type===Oe.Document||F.type===Oe.Element)&&_e){m.headWhitespace&&F.type===Oe.Element&&F.tagName==="head"&&(V=!1);let Ie={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:h,recordCanvas:y,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:x,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:N,keepIframeSrcFn:$,cssCaptured:!1};if(!(F.type===Oe.Element&&F.tagName==="textarea"&&F.attributes.value!==void 0)){F.type===Oe.Element&&F.attributes._cssText!==void 0&&typeof F.attributes._cssText=="string"&&(Ie.cssCaptured=!0);for(let Rn of Array.from(Be.childNodes(e))){let kt=Mr(Rn,Ie);kt&&F.childNodes.push(kt)}}let at=null;if(E1(e)&&(at=Be.shadowRoot(e)))for(let Rn of Array.from(Be.childNodes(at))){let kt=Mr(Rn,Ie);kt&&($i(at)&&(kt.isShadow=!0),F.childNodes.push(kt))}}let Rt=Be.parentNode(e);return Rt&&Ni(Rt)&&$i(Rt)&&(F.isShadow=!0),F.type===Oe.Element&&F.tagName==="iframe"&&FL(e,()=>{let Ie=e.contentDocument;if(Ie&&x){let at=Mr(Ie,{doc:Ie,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:h,recordCanvas:y,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:x,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:N,keepIframeSrcFn:$});at&&x(e,at)}},b),F.type===Oe.Element&&F.tagName==="link"&&typeof F.attributes.rel=="string"&&(F.attributes.rel==="stylesheet"||F.attributes.rel==="preload"&&typeof F.attributes.href=="string"&&C1(F.attributes.href)==="css")&&_L(e,()=>{if(v){let Ie=Mr(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:h,recordCanvas:y,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:x,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:N,keepIframeSrcFn:$});Ie&&v(e,Ie)}},N),F}function zL(e,t){let{mirror:n=new xa,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:p,slimDOM:m=!1,dataURLOptions:f,preserveWhiteSpace:h,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:x,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:N=()=>!1}=t||{},$=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,L=O1(m);return Mr(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:$,maskTextFn:d,maskInputFn:p,slimDOMOptions:L,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:h,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:x,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:N,newlyAddedElement:!1})}var GL=/(max|min)-device-(width|height)/,bK=new RegExp(GL.source,"g");function KL(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function HL(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 Rf={exports:{}},me=String,N1=function(){return{isColorSupported:!1,reset:me,bold:me,dim:me,italic:me,underline:me,inverse:me,hidden:me,strikethrough:me,black:me,red:me,green:me,yellow:me,blue:me,magenta:me,cyan:me,white:me,gray:me,bgBlack:me,bgRed:me,bgGreen:me,bgYellow:me,bgBlue:me,bgMagenta:me,bgCyan:me,bgWhite:me}};Rf.exports=N1();Rf.exports.createColors=N1;var qL=Rf.exports,YL={},ZL=Object.freeze(Object.defineProperty({__proto__:null,default:YL},Symbol.toStringTag,{value:"Module"})),wt=HL(ZL),Tw=qL,Ow=wt,Od=class $1 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,$1)}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=Tw.isColorSupported),Ow&&t&&(n=Ow(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}=Tw.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let m=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
|
|
57
57
|
`+m+a("^")}return" "+l(p)+u}).join(`
|
|
58
58
|
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
59
59
|
|
|
@@ -63,25 +63,25 @@ ${zI(i)}`),o}function lb(e){return oc(e,ke)}async function ub(e){let t=[];functi
|
|
|
63
63
|
`,beforeComment:`
|
|
64
64
|
`,beforeDecl:`
|
|
65
65
|
`,beforeOpen:" ",beforeRule:`
|
|
66
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function
|
|
67
|
-
`)){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 Nw[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"+
|
|
66
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function JL(e){return e[0].toUpperCase()+e.slice(1)}var Nd=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(`
|
|
67
|
+
`)){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 Nw[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"+JL(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=Nw[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(`
|
|
68
68
|
`)&&(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(`
|
|
69
69
|
`)&&(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(`
|
|
70
70
|
`)&&(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(`
|
|
71
71
|
`)&&(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(`
|
|
72
|
-
`);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)}},L1=Nd;Nd.default=Nd;var
|
|
73
|
-
`?(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
|
|
74
|
-
`);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[xd]=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:Bd(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;jd(s.source)?l=Ys(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||Ys(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(Dw)u.file=Dw(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}},Va=Aa;Aa.default=Aa;wd&&wd.registerInput&&wd.registerInput(Aa);var{SourceMapConsumer:F1,SourceMapGenerator:ma}=wt,{dirname:ya,relative:_1,resolve:j1,sep:B1}=wt,{pathToFileURL:jw}=wt,
|
|
72
|
+
`);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)}},L1=Nd;Nd.default=Nd;var XL=L1;function $d(e,t){new XL(t).stringify(e)}var _a=$d;$d.default=$d;var{isClean:qs,my:QL}=Ki,e7=kf,t7=L1,n7=_a;function Ld(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=>Ld(s,n)):(o==="object"&&i!==null&&(i=Ld(i)),n[r]=i)}return n}var Dd=class{constructor(t={}){this.raws={},this[qs]=!1,this[QL]=!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=Ld(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 e7(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[qs]){this[qs]=!1;let t=this;for(;t=t.parent;)t[qs]=!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]===`
|
|
73
|
+
`?(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 t7().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=n7){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}},ja=Dd;Dd.default=Dd;var r7=ja,Fd=class extends r7{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]==="$"}},Ba=Fd;Fd.default=Fd;var i7="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",o7=(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r},s7=(e=21)=>{let t="",n=e;for(;n--;)t+=i7[Math.random()*64|0];return t},a7={nanoid:s7,customAlphabet:o7},{SourceMapConsumer:$w,SourceMapGenerator:Lw}=wt,{existsSync:l7,readFileSync:u7}=wt,{dirname:Sd,join:c7}=wt;function d7(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var _d=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=Sd(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new $w(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 d7(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=Sd(t),l7(t))return this.mapFile=t,u7(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 $w)return Lw.fromSourceMap(n).toString();if(n instanceof Lw)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=c7(Sd(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)}},D1=_d;_d.default=_d;var{SourceMapConsumer:f7,SourceMapGenerator:p7}=wt,{fileURLToPath:Dw,pathToFileURL:Ys}=wt,{isAbsolute:jd,resolve:Bd}=wt,{nanoid:h7}=a7,wd=wt,Fw=kf,m7=D1,xd=Symbol("fromOffsetCache"),y7=!!(f7&&p7),_w=!!(Bd&&jd),Aa=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&&(!_w||/^\w+:\/\//.test(n.from)||jd(n.from)?this.file=n.from:this.file=Bd(n.from)),_w&&y7){let r=new m7(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 "+h7(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 Fw(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 Fw(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&&(Ys&&(o.input.url=Ys(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let n,r;if(this[xd])r=this[xd];else{let o=this.css.split(`
|
|
74
|
+
`);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[xd]=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:Bd(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;jd(s.source)?l=Ys(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||Ys(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(Dw)u.file=Dw(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}},Va=Aa;Aa.default=Aa;wd&&wd.registerInput&&wd.registerInput(Aa);var{SourceMapConsumer:F1,SourceMapGenerator:ma}=wt,{dirname:ya,relative:_1,resolve:j1,sep:B1}=wt,{pathToFileURL:jw}=wt,g7=Va,b7=!!(F1&&ma),S7=!!(ya&&j1&&_1&&B1),w7=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=`
|
|
75
75
|
`;this.css.includes(`\r
|
|
76
76
|
`)&&(n=`\r
|
|
77
|
-
`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||ya(t.file),i;this.mapOpts.sourcesContent===!1?(i=new F1(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(),
|
|
78
|
-
`),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?ya(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=ya(j1(r,this.mapOpts.annotation)));let i=_1(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 b7(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(jw){let r=jw(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;B1==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}},V1=x7,v7=ja,Vd=class extends v7{constructor(t){super(t),this.type="comment"}},Ua=Vd;Vd.default=Vd;var{isClean:U1,my:W1}=Ki,z1=Ba,G1=Ua,R7=ja,K1,Ef,Af,H1;function q1(e){return e.map(t=>(t.nodes&&(t.nodes=q1(t.nodes)),delete t.source,t))}function Y1(e){if(e[U1]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Y1(t)}var en=class Z1 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=q1(K1(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 z1(t)]}else if(t.selector)t=[new Ef(t)];else if(t.name)t=[new Af(t)];else if(t.text)t=[new G1(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[W1]||Z1.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[U1]&&Y1(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]}};en.registerParse=e=>{K1=e};en.registerRule=e=>{Ef=e};en.registerAtRule=e=>{Af=e};en.registerRoot=e=>{H1=e};var zn=en;en.default=en;en.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Af.prototype):e.type==="rule"?Object.setPrototypeOf(e,Ef.prototype):e.type==="decl"?Object.setPrototypeOf(e,z1.prototype):e.type==="comment"?Object.setPrototypeOf(e,G1.prototype):e.type==="root"&&Object.setPrototypeOf(e,H1.prototype),e[W1]=!0,e.nodes&&e.nodes.forEach(t=>{en.rebuild(t)})};var k7=zn,J1,X1,Fi=class extends k7{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new J1(new X1,this,t).stringify()}};Fi.registerLazyResult=e=>{J1=e};Fi.registerProcessor=e=>{X1=e};var Cf=Fi;Fi.default=Fi;var Bw={},Q1=function(t){Bw[t]||(Bw[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Ud=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}},ex=Ud;Ud.default=Ud;var E7=ex,Wd=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 E7(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},Pf=Wd;Wd.default=Wd;var vd=39,Vw=34,Zs=92,Uw=47,Js=10,Pi=32,Xs=12,Qs=9,ea=13,A7=91,C7=93,P7=40,I7=41,M7=123,T7=125,O7=59,N7=42,$7=58,L7=64,ta=/[\t\n\f\r "#'()/;[\\\]{}]/g,na=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,D7=/.[\r\n"'(/\\]/,Ww=/[\da-f]/i,F7=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,s,a,l,u,c,d,p,m,f,h=r.length,y=0,S=[],x=[];function b(){return y}function v(D){throw t.error("Unclosed "+D,y)}function N(){return x.length===0&&y>=h}function $(D){if(x.length)return x.pop();if(y>=h)return;let M=D?D.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case Js:case Pi:case Qs:case ea:case Xs:{s=y;do s+=1,o=r.charCodeAt(s);while(o===Pi||o===Js||o===Qs||o===ea||o===Xs);f=["space",r.slice(y,s)],y=s-1;break}case A7:case C7:case M7:case T7:case $7:case O7:case I7:{let V=String.fromCharCode(o);f=[V,V,y];break}case P7:{if(p=S.length?S.pop()[1]:"",m=r.charCodeAt(y+1),p==="url"&&m!==vd&&m!==Vw&&m!==Pi&&m!==Js&&m!==Qs&&m!==Xs&&m!==ea){s=y;do{if(c=!1,s=r.indexOf(")",s+1),s===-1)if(i||M){s=y;break}else v("bracket");for(d=s;r.charCodeAt(d-1)===Zs;)d-=1,c=!c}while(c);f=["brackets",r.slice(y,s+1),y,s],y=s}else s=r.indexOf(")",y+1),l=r.slice(y,s+1),s===-1||D7.test(l)?f=["(","(",y]:(f=["brackets",l,y,s],y=s);break}case vd:case Vw:{a=o===vd?"'":'"',s=y;do{if(c=!1,s=r.indexOf(a,s+1),s===-1)if(i||M){s=y+1;break}else v("string");for(d=s;r.charCodeAt(d-1)===Zs;)d-=1,c=!c}while(c);f=["string",r.slice(y,s+1),y,s],y=s;break}case L7:{ta.lastIndex=y+1,ta.test(r),ta.lastIndex===0?s=r.length-1:s=ta.lastIndex-2,f=["at-word",r.slice(y,s+1),y,s],y=s;break}case Zs:{for(s=y,u=!0;r.charCodeAt(s+1)===Zs;)s+=1,u=!u;if(o=r.charCodeAt(s+1),u&&o!==Uw&&o!==Pi&&o!==Js&&o!==Qs&&o!==ea&&o!==Xs&&(s+=1,Ww.test(r.charAt(s)))){for(;Ww.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===Pi&&(s+=1)}f=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===Uw&&r.charCodeAt(y+1)===N7?(s=r.indexOf("*/",y+2)+1,s===0&&(i||M?s=r.length:v("comment")),f=["comment",r.slice(y,s+1),y,s],y=s):(na.lastIndex=y+1,na.test(r),na.lastIndex===0?s=r.length-1:s=na.lastIndex-2,f=["word",r.slice(y,s+1),y,s],S.push(f),y=s);break}}return y++,f}function L(D){x.push(D)}return{back:L,endOfFile:N,nextToken:$,position:b}},tx=zn,Ca=class extends tx{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)}},If=Ca;Ca.default=Ca;tx.registerAtRule(Ca);var nx=zn,rx,ix,Or=class extends nx{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 rx(new ix,this,t).stringify()}};Or.registerLazyResult=e=>{rx=e};Or.registerProcessor=e=>{ix=e};var Hi=Or;Or.default=Or;nx.registerRoot(Or);var _i={comma(e){return _i.split(e,[","],!0)},space(e){let t=[" ",`
|
|
79
|
-
`," "];return _i.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}},ox=_i;_i.default=_i;var sx=zn,
|
|
77
|
+
`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||ya(t.file),i;this.mapOpts.sourcesContent===!1?(i=new F1(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(),S7&&b7&&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=ma.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new ma({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 ma({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(`
|
|
78
|
+
`),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?ya(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=ya(j1(r,this.mapOpts.annotation)));let i=_1(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 g7(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(jw){let r=jw(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;B1==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}},V1=w7,x7=ja,Vd=class extends x7{constructor(t){super(t),this.type="comment"}},Ua=Vd;Vd.default=Vd;var{isClean:U1,my:W1}=Ki,z1=Ba,G1=Ua,v7=ja,K1,Ef,Af,H1;function q1(e){return e.map(t=>(t.nodes&&(t.nodes=q1(t.nodes)),delete t.source,t))}function Y1(e){if(e[U1]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Y1(t)}var en=class Z1 extends v7{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=q1(K1(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 z1(t)]}else if(t.selector)t=[new Ef(t)];else if(t.name)t=[new Af(t)];else if(t.text)t=[new G1(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[W1]||Z1.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[U1]&&Y1(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]}};en.registerParse=e=>{K1=e};en.registerRule=e=>{Ef=e};en.registerAtRule=e=>{Af=e};en.registerRoot=e=>{H1=e};var zn=en;en.default=en;en.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Af.prototype):e.type==="rule"?Object.setPrototypeOf(e,Ef.prototype):e.type==="decl"?Object.setPrototypeOf(e,z1.prototype):e.type==="comment"?Object.setPrototypeOf(e,G1.prototype):e.type==="root"&&Object.setPrototypeOf(e,H1.prototype),e[W1]=!0,e.nodes&&e.nodes.forEach(t=>{en.rebuild(t)})};var R7=zn,J1,X1,Fi=class extends R7{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new J1(new X1,this,t).stringify()}};Fi.registerLazyResult=e=>{J1=e};Fi.registerProcessor=e=>{X1=e};var Cf=Fi;Fi.default=Fi;var Bw={},Q1=function(t){Bw[t]||(Bw[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Ud=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}},ex=Ud;Ud.default=Ud;var k7=ex,Wd=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 k7(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},Pf=Wd;Wd.default=Wd;var vd=39,Vw=34,Zs=92,Uw=47,Js=10,Pi=32,Xs=12,Qs=9,ea=13,E7=91,A7=93,C7=40,P7=41,I7=123,M7=125,T7=59,O7=42,N7=58,$7=64,ta=/[\t\n\f\r "#'()/;[\\\]{}]/g,na=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,L7=/.[\r\n"'(/\\]/,Ww=/[\da-f]/i,D7=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,s,a,l,u,c,d,p,m,f,h=r.length,y=0,S=[],x=[];function b(){return y}function v(D){throw t.error("Unclosed "+D,y)}function N(){return x.length===0&&y>=h}function $(D){if(x.length)return x.pop();if(y>=h)return;let M=D?D.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case Js:case Pi:case Qs:case ea:case Xs:{s=y;do s+=1,o=r.charCodeAt(s);while(o===Pi||o===Js||o===Qs||o===ea||o===Xs);f=["space",r.slice(y,s)],y=s-1;break}case E7:case A7:case I7:case M7:case N7:case T7:case P7:{let V=String.fromCharCode(o);f=[V,V,y];break}case C7:{if(p=S.length?S.pop()[1]:"",m=r.charCodeAt(y+1),p==="url"&&m!==vd&&m!==Vw&&m!==Pi&&m!==Js&&m!==Qs&&m!==Xs&&m!==ea){s=y;do{if(c=!1,s=r.indexOf(")",s+1),s===-1)if(i||M){s=y;break}else v("bracket");for(d=s;r.charCodeAt(d-1)===Zs;)d-=1,c=!c}while(c);f=["brackets",r.slice(y,s+1),y,s],y=s}else s=r.indexOf(")",y+1),l=r.slice(y,s+1),s===-1||L7.test(l)?f=["(","(",y]:(f=["brackets",l,y,s],y=s);break}case vd:case Vw:{a=o===vd?"'":'"',s=y;do{if(c=!1,s=r.indexOf(a,s+1),s===-1)if(i||M){s=y+1;break}else v("string");for(d=s;r.charCodeAt(d-1)===Zs;)d-=1,c=!c}while(c);f=["string",r.slice(y,s+1),y,s],y=s;break}case $7:{ta.lastIndex=y+1,ta.test(r),ta.lastIndex===0?s=r.length-1:s=ta.lastIndex-2,f=["at-word",r.slice(y,s+1),y,s],y=s;break}case Zs:{for(s=y,u=!0;r.charCodeAt(s+1)===Zs;)s+=1,u=!u;if(o=r.charCodeAt(s+1),u&&o!==Uw&&o!==Pi&&o!==Js&&o!==Qs&&o!==ea&&o!==Xs&&(s+=1,Ww.test(r.charAt(s)))){for(;Ww.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===Pi&&(s+=1)}f=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===Uw&&r.charCodeAt(y+1)===O7?(s=r.indexOf("*/",y+2)+1,s===0&&(i||M?s=r.length:v("comment")),f=["comment",r.slice(y,s+1),y,s],y=s):(na.lastIndex=y+1,na.test(r),na.lastIndex===0?s=r.length-1:s=na.lastIndex-2,f=["word",r.slice(y,s+1),y,s],S.push(f),y=s);break}}return y++,f}function L(D){x.push(D)}return{back:L,endOfFile:N,nextToken:$,position:b}},tx=zn,Ca=class extends tx{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)}},If=Ca;Ca.default=Ca;tx.registerAtRule(Ca);var nx=zn,rx,ix,Or=class extends nx{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 rx(new ix,this,t).stringify()}};Or.registerLazyResult=e=>{rx=e};Or.registerProcessor=e=>{ix=e};var Hi=Or;Or.default=Or;nx.registerRoot(Or);var _i={comma(e){return _i.split(e,[","],!0)},space(e){let t=[" ",`
|
|
79
|
+
`," "];return _i.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}},ox=_i;_i.default=_i;var sx=zn,F7=ox,Pa=class extends sx{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return F7.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)}},Mf=Pa;Pa.default=Pa;sx.registerRule(Pa);var _7=Ba,j7=D7,B7=Ua,V7=If,U7=Hi,zw=Mf,Gw={empty:!0,space:!0};function W7(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var z7=class{constructor(t){this.input=t,this.root=new U7,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 B7;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=j7(this.input)}decl(t,n){let r=new _7;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]||W7(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 p=u;p>0;p--){let m=c[p][0];if(d.trim().indexOf("!")===0&&m!=="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 zw;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 p=0;p<a;p+=1)o=r[p],s=o[0],s==="space"&&p===a-1&&!i?u=!1:s==="comment"?(d=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!Gw[d]&&!Gw[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let p=r.reduce((m,f)=>m+f[1],"");t.raws[n]={raw:p,value:l}}t[n]=l}rule(t){t.pop();let n=new zw;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})}},G7=z7,K7=zn,H7=G7,q7=Va;function Ia(e,t){let n=new q7(e,t),r=new H7(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+=`
|
|
80
80
|
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
|
|
81
81
|
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
|
|
82
|
-
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Tf=Ia;Ia.default=Ia;H7.registerParse(Ia);var{isClean:Lt,my:Z7}=Ki,J7=V1,X7=_a,Q7=zn,eD=Cf,tD=Q1,Kw=Pf,nD=Tf,rD=Hi,iD={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},oD={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},sD={Once:!0,postcssPlugin:!0,prepare:!0},Nr=0;function Ii(e){return typeof e=="object"&&typeof e.then=="function"}function ax(e){let t=!1,n=iD[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Nr,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Nr,n+"Exit"]:[n,n+"Exit"]}function Hw(e){let t;return e.type==="document"?t=["Document",Nr,"DocumentExit"]:e.type==="root"?t=["Root",Nr,"RootExit"]:t=ax(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function zd(e){return e[Lt]=!1,e.nodes&&e.nodes.forEach(t=>zd(t)),e}var Gd={},$r=class lx{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=zd(n);else if(n instanceof lx||n instanceof Kw)i=zd(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=nD;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[Z7]&&Q7.rebuild(i)}this.result=new Kw(t,i,r),this.helpers={...Gd,postcss:Gd,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(!oD[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!sD[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(Ii(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Lt];){t[Lt]=!0;let n=[Hw(t)];for(;n.length>0;){let r=this.visitTick(n);if(Ii(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 Ii(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=X7;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let i=new J7(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(Ii(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Lt];)t[Lt]=!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||tD("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(Ii(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[Lt]){a[Lt]=!0,t.push(Hw(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===Nr){r.nodes&&r.nodes.length&&(r[Lt]=!0,n.iterator=r.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[Lt]=!0;let n=ax(t);for(let r of n)if(r===Nr)t.nodes&&t.each(i=>{i[Lt]||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"}};$r.registerPostcss=e=>{Gd=e};var ux=$r;$r.default=$r;rD.registerLazyResult($r);eD.registerLazyResult($r);var aD=V1,lD=_a,uD=Q1,cD=Tf,dD=Pf,Kd=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=lD;this.result=new dD(this._processor,i,this._opts),this.result.css=n;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new aD(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||uD("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=cD;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"}},fD=Kd;Kd.default=Kd;var pD=fD,hD=ux,mD=Cf,yD=Hi,ji=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 pD(this,t,n):new hD(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},gD=ji;ji.default=ji;yD.registerProcessor(ji);mD.registerProcessor(ji);var bD=Ba,SD=D1,wD=Ua,xD=If,vD=Va,RD=Hi,kD=Mf;function Bi(e,t){if(Array.isArray(e))return e.map(i=>Bi(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:vD.prototype};o.map&&(o.map={...o.map,__proto__:SD.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>Bi(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 RD(r);if(r.type==="decl")return new bD(r);if(r.type==="rule")return new kD(r);if(r.type==="comment")return new wD(r);if(r.type==="atrule")return new xD(r);throw new Error("Unknown node type: "+e.type)}var ED=Bi;Bi.default=Bi;var AD=kf,cx=Ba,CD=ux,PD=zn,Of=gD,ID=_a,MD=ED,dx=Cf,TD=ex,fx=Ua,px=If,OD=Pf,ND=Va,$D=Tf,LD=ox,hx=Mf,mx=Hi,DD=ja;function ie(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Of(e)}ie.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:
|
|
82
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Tf=Ia;Ia.default=Ia;K7.registerParse(Ia);var{isClean:Lt,my:Y7}=Ki,Z7=V1,J7=_a,X7=zn,Q7=Cf,eD=Q1,Kw=Pf,tD=Tf,nD=Hi,rD={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},iD={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},oD={Once:!0,postcssPlugin:!0,prepare:!0},Nr=0;function Ii(e){return typeof e=="object"&&typeof e.then=="function"}function ax(e){let t=!1,n=rD[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Nr,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Nr,n+"Exit"]:[n,n+"Exit"]}function Hw(e){let t;return e.type==="document"?t=["Document",Nr,"DocumentExit"]:e.type==="root"?t=["Root",Nr,"RootExit"]:t=ax(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function zd(e){return e[Lt]=!1,e.nodes&&e.nodes.forEach(t=>zd(t)),e}var Gd={},$r=class lx{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=zd(n);else if(n instanceof lx||n instanceof Kw)i=zd(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=tD;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[Y7]&&X7.rebuild(i)}this.result=new Kw(t,i,r),this.helpers={...Gd,postcss:Gd,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(!iD[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!oD[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(Ii(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Lt];){t[Lt]=!0;let n=[Hw(t)];for(;n.length>0;){let r=this.visitTick(n);if(Ii(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 Ii(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=J7;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let i=new Z7(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(Ii(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Lt];)t[Lt]=!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||eD("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(Ii(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[Lt]){a[Lt]=!0,t.push(Hw(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===Nr){r.nodes&&r.nodes.length&&(r[Lt]=!0,n.iterator=r.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[Lt]=!0;let n=ax(t);for(let r of n)if(r===Nr)t.nodes&&t.each(i=>{i[Lt]||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"}};$r.registerPostcss=e=>{Gd=e};var ux=$r;$r.default=$r;nD.registerLazyResult($r);Q7.registerLazyResult($r);var sD=V1,aD=_a,lD=Q1,uD=Tf,cD=Pf,Kd=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=aD;this.result=new cD(this._processor,i,this._opts),this.result.css=n;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new sD(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||lD("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=uD;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"}},dD=Kd;Kd.default=Kd;var fD=dD,pD=ux,hD=Cf,mD=Hi,ji=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 fD(this,t,n):new pD(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},yD=ji;ji.default=ji;mD.registerProcessor(ji);hD.registerProcessor(ji);var gD=Ba,bD=D1,SD=Ua,wD=If,xD=Va,vD=Hi,RD=Mf;function Bi(e,t){if(Array.isArray(e))return e.map(i=>Bi(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:xD.prototype};o.map&&(o.map={...o.map,__proto__:bD.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>Bi(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 vD(r);if(r.type==="decl")return new gD(r);if(r.type==="rule")return new RD(r);if(r.type==="comment")return new SD(r);if(r.type==="atrule")return new wD(r);throw new Error("Unknown node type: "+e.type)}var kD=Bi;Bi.default=Bi;var ED=kf,cx=Ba,AD=ux,CD=zn,Of=yD,PD=_a,ID=kD,dx=Cf,MD=ex,fx=Ua,px=If,TD=Pf,OD=Va,ND=Tf,$D=ox,hx=Mf,mx=Hi,LD=ja;function ie(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Of(e)}ie.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:
|
|
83
83
|
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:
|
|
84
|
-
https://www.w3ctech.com/topic/2226`));let a=n(...s);return a.postcssPlugin=t,a.postcssVersion=new Of().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return ie([i(l)]).process(s,a)},i};ie.stringify=
|
|
84
|
+
https://www.w3ctech.com/topic/2226`));let a=n(...s);return a.postcssPlugin=t,a.postcssVersion=new Of().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return ie([i(l)]).process(s,a)},i};ie.stringify=PD;ie.parse=ND;ie.fromJSON=ID;ie.list=$D;ie.comment=e=>new fx(e);ie.atRule=e=>new px(e);ie.decl=e=>new cx(e);ie.rule=e=>new hx(e);ie.root=e=>new mx(e);ie.document=e=>new dx(e);ie.CssSyntaxError=ED;ie.Declaration=cx;ie.Container=CD;ie.Processor=Of;ie.Document=dx;ie.Comment=fx;ie.Warning=MD;ie.AtRule=px;ie.Result=TD;ie.Input=OD;ie.Rule=hx;ie.Root=mx;ie.Node=LD;AD.registerPostcss(ie);var DD=ie;ie.default=ie;var be=KL(DD);be.stringify;be.fromJSON;be.plugin;be.parse;be.list;be.document;be.comment;be.atRule;be.rule;be.decl;be.root;be.CssSyntaxError;be.Declaration;be.Container;be.Processor;be.Document;be.Comment;be.Warning;be.AtRule;be.Result;be.Input;be.Rule;be.Root;be.Node;var FD=Object.defineProperty,_D=(e,t,n)=>t in e?FD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ut=(e,t,n)=>_D(e,typeof t!="symbol"?t+"":t,n);function jD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function BD(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 Nf={exports:{}},ye=String,yx=function(){return{isColorSupported:!1,reset:ye,bold:ye,dim:ye,italic:ye,underline:ye,inverse:ye,hidden:ye,strikethrough:ye,black:ye,red:ye,green:ye,yellow:ye,blue:ye,magenta:ye,cyan:ye,white:ye,gray:ye,bgBlack:ye,bgRed:ye,bgGreen:ye,bgYellow:ye,bgBlue:ye,bgMagenta:ye,bgCyan:ye,bgWhite:ye}};Nf.exports=yx();Nf.exports.createColors=yx;var VD=Nf.exports,UD={},WD=Object.freeze(Object.defineProperty({__proto__:null,default:UD},Symbol.toStringTag,{value:"Module"})),xt=BD(WD),qw=VD,Yw=xt,Hd=class gx 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,gx)}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=qw.isColorSupported),Yw&&t&&(n=Yw(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}=qw.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let m=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
|
|
85
85
|
`+m+a("^")}return" "+l(p)+u}).join(`
|
|
86
86
|
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
87
87
|
|
|
@@ -91,30 +91,30 @@ https://www.w3ctech.com/topic/2226`));let a=n(...s);return a.postcssPlugin=t,a.p
|
|
|
91
91
|
`,beforeComment:`
|
|
92
92
|
`,beforeDecl:`
|
|
93
93
|
`,beforeOpen:" ",beforeRule:`
|
|
94
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function
|
|
95
|
-
`)){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 Zw[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"+
|
|
94
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function zD(e){return e[0].toUpperCase()+e.slice(1)}var qd=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(`
|
|
95
|
+
`)){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 Zw[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"+zD(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=Zw[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(`
|
|
96
96
|
`)&&(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(`
|
|
97
97
|
`)&&(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(`
|
|
98
98
|
`)&&(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(`
|
|
99
99
|
`)&&(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(`
|
|
100
|
-
`);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)}},bx=qd;qd.default=qd;var
|
|
101
|
-
`?(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
|
|
102
|
-
`);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[Ed]=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:tf(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;ef(s.source)?l=ia(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||ia(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(Qw)u.file=Qw(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}},Ka=Ma;Ma.default=Ma;kd&&kd.registerInput&&kd.registerInput(Ma);var{SourceMapConsumer:wx,SourceMapGenerator:ga}=xt,{dirname:ba,relative:xx,resolve:vx,sep:Rx}=xt,{pathToFileURL:n1}=xt,
|
|
100
|
+
`);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)}},bx=qd;qd.default=qd;var GD=bx;function Yd(e,t){new GD(t).stringify(e)}var Wa=Yd;Yd.default=Yd;var{isClean:ra,my:KD}=qi,HD=$f,qD=bx,YD=Wa;function Zd(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=>Zd(s,n)):(o==="object"&&i!==null&&(i=Zd(i)),n[r]=i)}return n}var Jd=class{constructor(t={}){this.raws={},this[ra]=!1,this[KD]=!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=Zd(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 HD(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[ra]){this[ra]=!1;let t=this;for(;t=t.parent;)t[ra]=!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]===`
|
|
101
|
+
`?(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 qD().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=YD){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}},za=Jd;Jd.default=Jd;var ZD=za,Xd=class extends ZD{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]==="$"}},Ga=Xd;Xd.default=Xd;var JD="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",XD=(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r},QD=(e=21)=>{let t="",n=e;for(;n--;)t+=JD[Math.random()*64|0];return t},eF={nanoid:QD,customAlphabet:XD},{SourceMapConsumer:Jw,SourceMapGenerator:Xw}=xt,{existsSync:tF,readFileSync:nF}=xt,{dirname:Rd,join:rF}=xt;function iF(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Qd=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=Rd(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Jw(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 iF(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=Rd(t),tF(t))return this.mapFile=t,nF(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 Jw)return Xw.fromSourceMap(n).toString();if(n instanceof Xw)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=rF(Rd(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)}},Sx=Qd;Qd.default=Qd;var{SourceMapConsumer:oF,SourceMapGenerator:sF}=xt,{fileURLToPath:Qw,pathToFileURL:ia}=xt,{isAbsolute:ef,resolve:tf}=xt,{nanoid:aF}=eF,kd=xt,e1=$f,lF=Sx,Ed=Symbol("fromOffsetCache"),uF=!!(oF&&sF),t1=!!(tf&&ef),Ma=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&&(!t1||/^\w+:\/\//.test(n.from)||ef(n.from)?this.file=n.from:this.file=tf(n.from)),t1&&uF){let r=new lF(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 "+aF(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 e1(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 e1(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&&(ia&&(o.input.url=ia(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let n,r;if(this[Ed])r=this[Ed];else{let o=this.css.split(`
|
|
102
|
+
`);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[Ed]=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:tf(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;ef(s.source)?l=ia(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||ia(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(Qw)u.file=Qw(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}},Ka=Ma;Ma.default=Ma;kd&&kd.registerInput&&kd.registerInput(Ma);var{SourceMapConsumer:wx,SourceMapGenerator:ga}=xt,{dirname:ba,relative:xx,resolve:vx,sep:Rx}=xt,{pathToFileURL:n1}=xt,cF=Ka,dF=!!(wx&&ga),fF=!!(ba&&vx&&xx&&Rx),pF=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=`
|
|
103
103
|
`;this.css.includes(`\r
|
|
104
104
|
`)&&(n=`\r
|
|
105
|
-
`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||ba(t.file),i;this.mapOpts.sourcesContent===!1?(i=new wx(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(),
|
|
106
|
-
`),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?ba(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=ba(vx(r,this.mapOpts.annotation)));let i=xx(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 dF(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(n1){let r=n1(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;Rx==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}},kx=hF,mF=za,nf=class extends mF{constructor(t){super(t),this.type="comment"}},Ha=nf;nf.default=nf;var{isClean:Ex,my:Ax}=qi,Cx=Ga,Px=Ha,yF=za,Ix,Lf,Df,Mx;function Tx(e){return e.map(t=>(t.nodes&&(t.nodes=Tx(t.nodes)),delete t.source,t))}function Ox(e){if(e[Ex]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ox(t)}var tn=class Nx extends yF{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=Tx(Ix(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 Cx(t)]}else if(t.selector)t=[new Lf(t)];else if(t.name)t=[new Df(t)];else if(t.text)t=[new Px(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Ax]||Nx.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Ex]&&Ox(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]}};tn.registerParse=e=>{Ix=e};tn.registerRule=e=>{Lf=e};tn.registerAtRule=e=>{Df=e};tn.registerRoot=e=>{Mx=e};var Gn=tn;tn.default=tn;tn.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Df.prototype):e.type==="rule"?Object.setPrototypeOf(e,Lf.prototype):e.type==="decl"?Object.setPrototypeOf(e,Cx.prototype):e.type==="comment"?Object.setPrototypeOf(e,Px.prototype):e.type==="root"&&Object.setPrototypeOf(e,Mx.prototype),e[Ax]=!0,e.nodes&&e.nodes.forEach(t=>{tn.rebuild(t)})};var gF=Gn,$x,Lx,Vi=class extends gF{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new $x(new Lx,this,t).stringify()}};Vi.registerLazyResult=e=>{$x=e};Vi.registerProcessor=e=>{Lx=e};var Ff=Vi;Vi.default=Vi;var r1={},Dx=function(t){r1[t]||(r1[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},rf=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}},Fx=rf;rf.default=rf;var bF=Fx,of=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 bF(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},_f=of;of.default=of;var Ad=39,i1=34,oa=92,o1=47,sa=10,Mi=32,aa=12,la=9,ua=13,SF=91,wF=93,xF=40,vF=41,RF=123,kF=125,EF=59,AF=42,CF=58,PF=64,ca=/[\t\n\f\r "#'()/;[\\\]{}]/g,da=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,IF=/.[\r\n"'(/\\]/,s1=/[\da-f]/i,MF=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,s,a,l,u,c,d,p,m,f,h=r.length,y=0,S=[],x=[];function b(){return y}function v(D){throw t.error("Unclosed "+D,y)}function N(){return x.length===0&&y>=h}function $(D){if(x.length)return x.pop();if(y>=h)return;let M=D?D.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case sa:case Mi:case la:case ua:case aa:{s=y;do s+=1,o=r.charCodeAt(s);while(o===Mi||o===sa||o===la||o===ua||o===aa);f=["space",r.slice(y,s)],y=s-1;break}case SF:case wF:case RF:case kF:case CF:case EF:case vF:{let V=String.fromCharCode(o);f=[V,V,y];break}case xF:{if(p=S.length?S.pop()[1]:"",m=r.charCodeAt(y+1),p==="url"&&m!==Ad&&m!==i1&&m!==Mi&&m!==sa&&m!==la&&m!==aa&&m!==ua){s=y;do{if(c=!1,s=r.indexOf(")",s+1),s===-1)if(i||M){s=y;break}else v("bracket");for(d=s;r.charCodeAt(d-1)===oa;)d-=1,c=!c}while(c);f=["brackets",r.slice(y,s+1),y,s],y=s}else s=r.indexOf(")",y+1),l=r.slice(y,s+1),s===-1||IF.test(l)?f=["(","(",y]:(f=["brackets",l,y,s],y=s);break}case Ad:case i1:{a=o===Ad?"'":'"',s=y;do{if(c=!1,s=r.indexOf(a,s+1),s===-1)if(i||M){s=y+1;break}else v("string");for(d=s;r.charCodeAt(d-1)===oa;)d-=1,c=!c}while(c);f=["string",r.slice(y,s+1),y,s],y=s;break}case PF:{ca.lastIndex=y+1,ca.test(r),ca.lastIndex===0?s=r.length-1:s=ca.lastIndex-2,f=["at-word",r.slice(y,s+1),y,s],y=s;break}case oa:{for(s=y,u=!0;r.charCodeAt(s+1)===oa;)s+=1,u=!u;if(o=r.charCodeAt(s+1),u&&o!==o1&&o!==Mi&&o!==sa&&o!==la&&o!==ua&&o!==aa&&(s+=1,s1.test(r.charAt(s)))){for(;s1.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===Mi&&(s+=1)}f=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===o1&&r.charCodeAt(y+1)===AF?(s=r.indexOf("*/",y+2)+1,s===0&&(i||M?s=r.length:v("comment")),f=["comment",r.slice(y,s+1),y,s],y=s):(da.lastIndex=y+1,da.test(r),da.lastIndex===0?s=r.length-1:s=da.lastIndex-2,f=["word",r.slice(y,s+1),y,s],S.push(f),y=s);break}}return y++,f}function L(D){x.push(D)}return{back:L,endOfFile:N,nextToken:$,position:b}},_x=Gn,Ta=class extends _x{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)}},jf=Ta;Ta.default=Ta;_x.registerAtRule(Ta);var jx=Gn,Bx,Vx,Lr=class extends jx{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 Bx(new Vx,this,t).stringify()}};Lr.registerLazyResult=e=>{Bx=e};Lr.registerProcessor=e=>{Vx=e};var Yi=Lr;Lr.default=Lr;jx.registerRoot(Lr);var Ui={comma(e){return Ui.split(e,[","],!0)},space(e){let t=[" ",`
|
|
107
|
-
`," "];return Ui.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}},Ux=Ui;Ui.default=Ui;var Wx=Gn,
|
|
105
|
+
`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||ba(t.file),i;this.mapOpts.sourcesContent===!1?(i=new wx(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(),fF&&dF&&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=ga.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new ga({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 ga({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(`
|
|
106
|
+
`),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?ba(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=ba(vx(r,this.mapOpts.annotation)));let i=xx(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 cF(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(n1){let r=n1(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;Rx==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}},kx=pF,hF=za,nf=class extends hF{constructor(t){super(t),this.type="comment"}},Ha=nf;nf.default=nf;var{isClean:Ex,my:Ax}=qi,Cx=Ga,Px=Ha,mF=za,Ix,Lf,Df,Mx;function Tx(e){return e.map(t=>(t.nodes&&(t.nodes=Tx(t.nodes)),delete t.source,t))}function Ox(e){if(e[Ex]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ox(t)}var tn=class Nx extends mF{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=Tx(Ix(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 Cx(t)]}else if(t.selector)t=[new Lf(t)];else if(t.name)t=[new Df(t)];else if(t.text)t=[new Px(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Ax]||Nx.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Ex]&&Ox(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]}};tn.registerParse=e=>{Ix=e};tn.registerRule=e=>{Lf=e};tn.registerAtRule=e=>{Df=e};tn.registerRoot=e=>{Mx=e};var Gn=tn;tn.default=tn;tn.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Df.prototype):e.type==="rule"?Object.setPrototypeOf(e,Lf.prototype):e.type==="decl"?Object.setPrototypeOf(e,Cx.prototype):e.type==="comment"?Object.setPrototypeOf(e,Px.prototype):e.type==="root"&&Object.setPrototypeOf(e,Mx.prototype),e[Ax]=!0,e.nodes&&e.nodes.forEach(t=>{tn.rebuild(t)})};var yF=Gn,$x,Lx,Vi=class extends yF{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new $x(new Lx,this,t).stringify()}};Vi.registerLazyResult=e=>{$x=e};Vi.registerProcessor=e=>{Lx=e};var Ff=Vi;Vi.default=Vi;var r1={},Dx=function(t){r1[t]||(r1[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},rf=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}},Fx=rf;rf.default=rf;var gF=Fx,of=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 gF(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},_f=of;of.default=of;var Ad=39,i1=34,oa=92,o1=47,sa=10,Mi=32,aa=12,la=9,ua=13,bF=91,SF=93,wF=40,xF=41,vF=123,RF=125,kF=59,EF=42,AF=58,CF=64,ca=/[\t\n\f\r "#'()/;[\\\]{}]/g,da=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,PF=/.[\r\n"'(/\\]/,s1=/[\da-f]/i,IF=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,s,a,l,u,c,d,p,m,f,h=r.length,y=0,S=[],x=[];function b(){return y}function v(D){throw t.error("Unclosed "+D,y)}function N(){return x.length===0&&y>=h}function $(D){if(x.length)return x.pop();if(y>=h)return;let M=D?D.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case sa:case Mi:case la:case ua:case aa:{s=y;do s+=1,o=r.charCodeAt(s);while(o===Mi||o===sa||o===la||o===ua||o===aa);f=["space",r.slice(y,s)],y=s-1;break}case bF:case SF:case vF:case RF:case AF:case kF:case xF:{let V=String.fromCharCode(o);f=[V,V,y];break}case wF:{if(p=S.length?S.pop()[1]:"",m=r.charCodeAt(y+1),p==="url"&&m!==Ad&&m!==i1&&m!==Mi&&m!==sa&&m!==la&&m!==aa&&m!==ua){s=y;do{if(c=!1,s=r.indexOf(")",s+1),s===-1)if(i||M){s=y;break}else v("bracket");for(d=s;r.charCodeAt(d-1)===oa;)d-=1,c=!c}while(c);f=["brackets",r.slice(y,s+1),y,s],y=s}else s=r.indexOf(")",y+1),l=r.slice(y,s+1),s===-1||PF.test(l)?f=["(","(",y]:(f=["brackets",l,y,s],y=s);break}case Ad:case i1:{a=o===Ad?"'":'"',s=y;do{if(c=!1,s=r.indexOf(a,s+1),s===-1)if(i||M){s=y+1;break}else v("string");for(d=s;r.charCodeAt(d-1)===oa;)d-=1,c=!c}while(c);f=["string",r.slice(y,s+1),y,s],y=s;break}case CF:{ca.lastIndex=y+1,ca.test(r),ca.lastIndex===0?s=r.length-1:s=ca.lastIndex-2,f=["at-word",r.slice(y,s+1),y,s],y=s;break}case oa:{for(s=y,u=!0;r.charCodeAt(s+1)===oa;)s+=1,u=!u;if(o=r.charCodeAt(s+1),u&&o!==o1&&o!==Mi&&o!==sa&&o!==la&&o!==ua&&o!==aa&&(s+=1,s1.test(r.charAt(s)))){for(;s1.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===Mi&&(s+=1)}f=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===o1&&r.charCodeAt(y+1)===EF?(s=r.indexOf("*/",y+2)+1,s===0&&(i||M?s=r.length:v("comment")),f=["comment",r.slice(y,s+1),y,s],y=s):(da.lastIndex=y+1,da.test(r),da.lastIndex===0?s=r.length-1:s=da.lastIndex-2,f=["word",r.slice(y,s+1),y,s],S.push(f),y=s);break}}return y++,f}function L(D){x.push(D)}return{back:L,endOfFile:N,nextToken:$,position:b}},_x=Gn,Ta=class extends _x{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)}},jf=Ta;Ta.default=Ta;_x.registerAtRule(Ta);var jx=Gn,Bx,Vx,Lr=class extends jx{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 Bx(new Vx,this,t).stringify()}};Lr.registerLazyResult=e=>{Bx=e};Lr.registerProcessor=e=>{Vx=e};var Yi=Lr;Lr.default=Lr;jx.registerRoot(Lr);var Ui={comma(e){return Ui.split(e,[","],!0)},space(e){let t=[" ",`
|
|
107
|
+
`," "];return Ui.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}},Ux=Ui;Ui.default=Ui;var Wx=Gn,MF=Ux,Oa=class extends Wx{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return MF.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)}},Bf=Oa;Oa.default=Oa;Wx.registerRule(Oa);var TF=Ga,OF=IF,NF=Ha,$F=jf,LF=Yi,a1=Bf,l1={empty:!0,space:!0};function DF(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var FF=class{constructor(t){this.input=t,this.root=new LF,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 $F;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 NF;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=OF(this.input)}decl(t,n){let r=new TF;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]||DF(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 p=u;p>0;p--){let m=c[p][0];if(d.trim().indexOf("!")===0&&m!=="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 a1;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 p=0;p<a;p+=1)o=r[p],s=o[0],s==="space"&&p===a-1&&!i?u=!1:s==="comment"?(d=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!l1[d]&&!l1[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let p=r.reduce((m,f)=>m+f[1],"");t.raws[n]={raw:p,value:l}}t[n]=l}rule(t){t.pop();let n=new a1;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})}},_F=FF,jF=Gn,BF=_F,VF=Ka;function Na(e,t){let n=new VF(e,t),r=new BF(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+=`
|
|
108
108
|
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
|
|
109
109
|
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
|
|
110
|
-
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Vf=Na;Na.default=Na;BF.registerParse(Na);var{isClean:Dt,my:WF}=qi,zF=kx,GF=Wa,KF=Gn,HF=Ff,qF=Dx,u1=_f,YF=Vf,ZF=Yi,JF={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},XF={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},QF={Once:!0,postcssPlugin:!0,prepare:!0},Dr=0;function Ti(e){return typeof e=="object"&&typeof e.then=="function"}function zx(e){let t=!1,n=JF[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Dr,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Dr,n+"Exit"]:[n,n+"Exit"]}function c1(e){let t;return e.type==="document"?t=["Document",Dr,"DocumentExit"]:e.type==="root"?t=["Root",Dr,"RootExit"]:t=zx(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function sf(e){return e[Dt]=!1,e.nodes&&e.nodes.forEach(t=>sf(t)),e}var af={},Fr=class Gx{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=sf(n);else if(n instanceof Gx||n instanceof u1)i=sf(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=YF;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[WF]&&KF.rebuild(i)}this.result=new u1(t,i,r),this.helpers={...af,postcss:af,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(!XF[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!QF[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(Ti(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Dt];){t[Dt]=!0;let n=[c1(t)];for(;n.length>0;){let r=this.visitTick(n);if(Ti(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 Ti(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=GF;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let i=new zF(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(Ti(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Dt];)t[Dt]=!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||qF("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(Ti(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[Dt]){a[Dt]=!0,t.push(c1(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===Dr){r.nodes&&r.nodes.length&&(r[Dt]=!0,n.iterator=r.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[Dt]=!0;let n=zx(t);for(let r of n)if(r===Dr)t.nodes&&t.each(i=>{i[Dt]||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"}};Fr.registerPostcss=e=>{af=e};var Kx=Fr;Fr.default=Fr;ZF.registerLazyResult(Fr);HF.registerLazyResult(Fr);var e_=kx,t_=Wa,n_=Dx,r_=Vf,i_=_f,lf=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=t_;this.result=new i_(this._processor,i,this._opts),this.result.css=n;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new e_(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||n_("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=r_;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"}},o_=lf;lf.default=lf;var s_=o_,a_=Kx,l_=Ff,u_=Yi,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 s_(this,t,n):new a_(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},c_=Wi;Wi.default=Wi;u_.registerProcessor(Wi);l_.registerProcessor(Wi);var d_=Ga,f_=Sx,p_=Ha,h_=jf,m_=Ka,y_=Yi,g_=Bf;function zi(e,t){if(Array.isArray(e))return e.map(i=>zi(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:m_.prototype};o.map&&(o.map={...o.map,__proto__:f_.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>zi(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 y_(r);if(r.type==="decl")return new d_(r);if(r.type==="rule")return new g_(r);if(r.type==="comment")return new p_(r);if(r.type==="atrule")return new h_(r);throw new Error("Unknown node type: "+e.type)}var b_=zi;zi.default=zi;var S_=$f,Hx=Ga,w_=Kx,x_=Gn,Uf=c_,v_=Wa,R_=b_,qx=Ff,k_=Fx,Yx=Ha,Zx=jf,E_=_f,A_=Ka,C_=Vf,P_=Ux,Jx=Bf,Xx=Yi,I_=za;function oe(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Uf(e)}oe.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:
|
|
110
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Vf=Na;Na.default=Na;jF.registerParse(Na);var{isClean:Dt,my:UF}=qi,WF=kx,zF=Wa,GF=Gn,KF=Ff,HF=Dx,u1=_f,qF=Vf,YF=Yi,ZF={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},JF={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},XF={Once:!0,postcssPlugin:!0,prepare:!0},Dr=0;function Ti(e){return typeof e=="object"&&typeof e.then=="function"}function zx(e){let t=!1,n=ZF[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Dr,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Dr,n+"Exit"]:[n,n+"Exit"]}function c1(e){let t;return e.type==="document"?t=["Document",Dr,"DocumentExit"]:e.type==="root"?t=["Root",Dr,"RootExit"]:t=zx(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function sf(e){return e[Dt]=!1,e.nodes&&e.nodes.forEach(t=>sf(t)),e}var af={},Fr=class Gx{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=sf(n);else if(n instanceof Gx||n instanceof u1)i=sf(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=qF;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[UF]&&GF.rebuild(i)}this.result=new u1(t,i,r),this.helpers={...af,postcss:af,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(!JF[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!XF[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(Ti(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Dt];){t[Dt]=!0;let n=[c1(t)];for(;n.length>0;){let r=this.visitTick(n);if(Ti(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 Ti(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=zF;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let i=new WF(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(Ti(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Dt];)t[Dt]=!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||HF("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(Ti(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[Dt]){a[Dt]=!0,t.push(c1(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===Dr){r.nodes&&r.nodes.length&&(r[Dt]=!0,n.iterator=r.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[Dt]=!0;let n=zx(t);for(let r of n)if(r===Dr)t.nodes&&t.each(i=>{i[Dt]||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"}};Fr.registerPostcss=e=>{af=e};var Kx=Fr;Fr.default=Fr;YF.registerLazyResult(Fr);KF.registerLazyResult(Fr);var QF=kx,e_=Wa,t_=Dx,n_=Vf,r_=_f,lf=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=e_;this.result=new r_(this._processor,i,this._opts),this.result.css=n;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new QF(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||t_("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=n_;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"}},i_=lf;lf.default=lf;var o_=i_,s_=Kx,a_=Ff,l_=Yi,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 o_(this,t,n):new s_(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},u_=Wi;Wi.default=Wi;l_.registerProcessor(Wi);a_.registerProcessor(Wi);var c_=Ga,d_=Sx,f_=Ha,p_=jf,h_=Ka,m_=Yi,y_=Bf;function zi(e,t){if(Array.isArray(e))return e.map(i=>zi(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:h_.prototype};o.map&&(o.map={...o.map,__proto__:d_.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>zi(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 m_(r);if(r.type==="decl")return new c_(r);if(r.type==="rule")return new y_(r);if(r.type==="comment")return new f_(r);if(r.type==="atrule")return new p_(r);throw new Error("Unknown node type: "+e.type)}var g_=zi;zi.default=zi;var b_=$f,Hx=Ga,S_=Kx,w_=Gn,Uf=u_,x_=Wa,v_=g_,qx=Ff,R_=Fx,Yx=Ha,Zx=jf,k_=_f,E_=Ka,A_=Vf,C_=Ux,Jx=Bf,Xx=Yi,P_=za;function oe(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Uf(e)}oe.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:
|
|
111
111
|
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:
|
|
112
|
-
https://www.w3ctech.com/topic/2226`));let a=n(...s);return a.postcssPlugin=t,a.postcssVersion=new Uf().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return oe([i(l)]).process(s,a)},i};oe.stringify=
|
|
112
|
+
https://www.w3ctech.com/topic/2226`));let a=n(...s);return a.postcssPlugin=t,a.postcssVersion=new Uf().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return oe([i(l)]).process(s,a)},i};oe.stringify=x_;oe.parse=A_;oe.fromJSON=v_;oe.list=C_;oe.comment=e=>new Yx(e);oe.atRule=e=>new Zx(e);oe.decl=e=>new Hx(e);oe.rule=e=>new Jx(e);oe.root=e=>new Xx(e);oe.document=e=>new qx(e);oe.CssSyntaxError=b_;oe.Declaration=Hx;oe.Container=w_;oe.Processor=Uf;oe.Document=qx;oe.Comment=Yx;oe.Warning=R_;oe.AtRule=Zx;oe.Result=k_;oe.Input=E_;oe.Rule=Jx;oe.Root=Xx;oe.Node=P_;S_.registerPostcss(oe);var I_=oe;oe.default=oe;var Se=jD(I_);Se.stringify;Se.fromJSON;Se.plugin;Se.parse;Se.list;Se.document;Se.comment;Se.atRule;Se.rule;Se.decl;Se.root;Se.CssSyntaxError;Se.Declaration;Se.Container;Se.Processor;Se.Document;Se.Comment;Se.Warning;Se.AtRule;Se.Result;Se.Input;Se.Rule;Se.Root;Se.Node;var uf=class e{constructor(...t){ut(this,"parentElement",null),ut(this,"parentNode",null),ut(this,"ownerDocument"),ut(this,"firstChild",null),ut(this,"lastChild",null),ut(this,"previousSibling",null),ut(this,"nextSibling",null),ut(this,"ELEMENT_NODE",1),ut(this,"TEXT_NODE",3),ut(this,"nodeType"),ut(this,"nodeName"),ut(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 d1={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},f1={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},fa={},M_=()=>!!globalThis.Zone;function Wf(e){if(fa[e])return fa[e];let t=globalThis[e],n=t.prototype,r=e in d1?d1[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 f1?f1[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&&!M_())return fa[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?fa[e]=u:n}catch{return n}}var Cd={};function rn(e,t,n){var r;let i=`${e}.${String(n)}`;if(Cd[i])return Cd[i].call(t);let o=Wf(e),s=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return s?(Cd[i]=s,s.call(t)):t[n]}var Pd={};function Qx(e,t,n){let r=`${e}.${String(n)}`;if(Pd[r])return Pd[r].bind(t);let o=Wf(e)[n];return typeof o!="function"?t[n]:(Pd[r]=o,o.bind(t))}function T_(e){return rn("Node",e,"ownerDocument")}function O_(e){return rn("Node",e,"childNodes")}function N_(e){return rn("Node",e,"parentNode")}function $_(e){return rn("Node",e,"parentElement")}function L_(e){return rn("Node",e,"textContent")}function D_(e,t){return Qx("Node",e,"contains")(t)}function F_(e){return Qx("Node",e,"getRootNode")()}function __(e){return!e||!("host"in e)?null:rn("ShadowRoot",e,"host")}function j_(e){return e.styleSheets}function B_(e){return!e||!("shadowRoot"in e)?null:rn("Element",e,"shadowRoot")}function V_(e,t){return rn("Element",e,"querySelector")(t)}function U_(e,t){return rn("Element",e,"querySelectorAll")(t)}function e0(){return Wf("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:T_,childNodes:O_,parentNode:N_,parentElement:$_,textContent:L_,contains:D_,getRootNode:F_,host:__,styleSheets:j_,shadowRoot:B_,querySelector:V_,querySelectorAll:U_,mutationObserver:e0,patch:Kn};function Ke(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var Cr=`Please stop import mirror directly. Instead of that,\r
|
|
113
113
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
114
|
-
or you can use record.mirror to access the mirror instance during recording.`,p1={map:{},getId(){return console.error(Cr),-1},getNode(){return console.error(Cr),null},removeNodeFromMap(){console.error(Cr)},has(){return console.error(Cr),!1},reset(){console.error(Cr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(p1=new Proxy(p1,{get(e,t,n){return t==="map"&&console.error(Cr),Reflect.get(e,t,n)}}));function Gi(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 qa(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)}}),()=>qa(e,t,o||{},!0)}var $a=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||($a=()=>new Date().getTime());function t0(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 n0(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function r0(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function i0(e){return e?e.nodeType===e.ELEMENT_NODE?e:B.parentElement(e):null}function He(e,t,n,r){if(!e)return!1;let i=i0(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||r&&i.closest("."+t)!==null)return!0}else if(Ea(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function z_(e,t){return t.getId(e)!==-1}function Id(e,t,n){return e.tagName==="TITLE"&&n.headTitleMutations?!0:t.getId(e)===Di}function o0(e,t){if(Ni(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?o0(r,t):!0}function cf(e){return!!e.changedTouches}function G_(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 s0(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function a0(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function df(e){return e?e instanceof uf&&"shadowRoot"in e?!!e.shadowRoot:!!B.shadowRoot(e):!1}var ff=class{constructor(){E(this,"id",1),E(this,"styleIDMap",new WeakMap),E(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 l0(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 K_(e){let t=e,n;for(;n=l0(t);)t=n;return t}function H_(e){let t=B.ownerDocument(e);if(!t)return!1;let n=K_(e);return B.contains(t,n)}function u0(e){let t=B.ownerDocument(e);return t?B.contains(t,e)||H_(e):!1}var q=(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))(q||{}),W=(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))(W||{}),Ze=(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))(Ze||{}),Qt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Qt||{}),_r=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(_r||{}),Pr=(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))(Pr||{});var c0=(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))(c0||{});function h1(e){return"__ln"in e}var pf=class{constructor(){E(this,"length",0),E(this,"head",null),E(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&&h1(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&&h1(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--)}},m1=(e,t)=>`${e}@${t}`,hf=class{constructor(){E(this,"frozen",!1),E(this,"locked",!1),E(this,"texts",[]),E(this,"attributes",[]),E(this,"attributeMap",new WeakMap),E(this,"removes",[]),E(this,"mapRemoves",[]),E(this,"movedMap",{}),E(this,"addedSet",new Set),E(this,"movedSet",new Set),E(this,"droppedSet",new Set),E(this,"removesSubTreeCache",new Set),E(this,"mutationCb"),E(this,"blockClass"),E(this,"blockSelector"),E(this,"maskTextClass"),E(this,"maskTextSelector"),E(this,"inlineStylesheet"),E(this,"maskInputOptions"),E(this,"maskTextFn"),E(this,"maskInputFn"),E(this,"keepIframeSrcFn"),E(this,"recordCanvas"),E(this,"inlineImages"),E(this,"slimDOMOptions"),E(this,"dataURLOptions"),E(this,"doc"),E(this,"mirror"),E(this,"iframeManager"),E(this,"stylesheetManager"),E(this,"shadowDomManager"),E(this,"canvasManager"),E(this,"processedNodeManager"),E(this,"unattachedDoc"),E(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),E(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],n=new Set,r=new pf,i=l=>{let u=l,c=Di;for(;c===Di;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{let u=B.parentNode(l);if(!u||!u0(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){let f=u.tagName;if(f==="TEXTAREA")return;f==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let d=Ni(u)?this.mirror.getId(l0(l)):this.mirror.getId(u),p=i(l);if(d===-1||p===-1)return r.addNode(l);let m=Mr(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:f=>{s0(f,this.mirror)&&this.iframeManager.addIframe(f),a0(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),df(l)&&this.shadowDomManager.addShadowRoot(B.shadowRoot(l),this.doc)},onIframeLoad:(f,h)=>{this.iframeManager.attachIframe(f,h),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,h)=>{this.stylesheetManager.attachLinkElement(f,h)},cssCaptured:c});m&&(t.push({parentId:d,nextId:p,node:m}),n.add(m.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)y1(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(B.parentNode(l))||o(l);for(let l of this.addedSet)!g1(this.droppedSet,l)&&!y1(this.removesSubTreeCache,l,this.mirror)||g1(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 m=c.value,f=B.parentNode(m);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let h=B.host(f);if(this.mirror.getId(h)!==-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))}),E(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=va({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Ra(t),value:r,maskInputFn:this.maskInputFn})}),E(this,"processMutation",t=>{if(!Id(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let n=B.textContent(t.target);!He(t.target,this.blockClass,this.blockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:T1(t.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,i0(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=Ra(n);i=va({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:s,value:i,maskInputFn:this.maskInputFn})}if(He(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"),!M1(n.tagName,r))if(o.attributes[r]=I1(this.doc,Wn(n.tagName),Wn(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(He(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=Ni(t.target)?this.mirror.getId(B.host(t.target)):this.mirror.getId(t.target);He(t.target,this.blockClass,this.blockSelector,!1)||Id(n,this.mirror,this.slimDOMOptions)||!z_(n,this.mirror)||(this.addedSet.has(n)?(mf(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||o0(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[m1(r,i)]?mf(this.movedSet,n):(this.removes.push({parentId:i,id:r,isShadow:Ni(t.target)&&$i(t.target)?!0:void 0}),q_(n,this.removesSubTreeCache))),this.mapRemoves.push(n))});break}}}),E(this,"genAdds",(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Id(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[m1(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);He(t,this.blockClass,this.blockSelector,!1)||(B.childNodes(t).forEach(r=>this.genAdds(r)),df(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 mf(e,t){e.delete(t),B.childNodes(t).forEach(n=>mf(e,n))}function q_(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 y1(e,t,n){return e.size===0?!1:Y_(e,t)}function Y_(e,t,n){let r=B.parentNode(t);return r?e.has(r):!1}function g1(e,t){return e.size===0?!1:d0(e,t)}function d0(e,t){let n=B.parentNode(t);return n?e.has(n)?!0:d0(e,n):!1}var Li;function Z_(e){Li=e}function J_(){Li=void 0}var J=e=>Li?(...n)=>{try{return e(...n)}catch(r){if(Li&&Li(r)===!0)return;throw r}}:e,Un=[];function Zi(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 f0(e,t){let n=new hf;Un.push(n),n.init(e);let r=new(e0())(J(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function X_({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=Gi(J(d=>{let p=Date.now()-a;e(s.map(m=>(m.timeOffset-=p,m)),d),s=[],a=null}),o),u=J(Gi(J(d=>{let p=Zi(d),{clientX:m,clientY:f}=cf(d)?d.changedTouches[0]:d;a||(a=$a()),s.push({x:m,y:f,id:r.getId(p),timeOffset:$a()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?W.Drag:d instanceof MouseEvent?W.MouseMove:W.TouchMove)}),i,{trailing:!1})),c=[Ke("mousemove",u,n),Ke("touchmove",u,n),Ke("drag",u,n)];return J(()=>{c.forEach(d=>d())})}function Q_({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 p=Zi(d);if(He(p,r,i,!0))return;let m=null,f=c;if("pointerType"in d){switch(d.pointerType){case"mouse":m=Qt.Mouse;break;case"touch":m=Qt.Touch;break;case"pen":m=Qt.Pen;break}m===Qt.Touch?Ze[c]===Ze.MouseDown?f="TouchStart":Ze[c]===Ze.MouseUp&&(f="TouchEnd"):Qt.Pen}else cf(d)&&(m=Qt.Touch);m!==null?(l=m,(f.startsWith("Touch")&&m===Qt.Touch||f.startsWith("Mouse")&&m===Qt.Mouse)&&(m=null)):Ze[c]===Ze.Click&&(m=l,l=null);let h=cf(d)?d.changedTouches[0]:d;if(!h)return;let y=n.getId(p),{clientX:S,clientY:x}=h;J(e)({type:Ze[f],id:y,x:S,y:x,...m!==null&&{pointerType:m}})};return Object.keys(Ze).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let d=Wn(c),p=u(c);if(window.PointerEvent)switch(Ze[c]){case Ze.MouseDown:case Ze.MouseUp:d=d.replace("mouse","pointer");break;case Ze.TouchStart:case Ze.TouchEnd:return}a.push(Ke(d,p,t))}),J(()=>{a.forEach(c=>c())})}function p0({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){let s=J(Gi(J(a=>{let l=Zi(a);if(!l||He(l,r,i,!0))return;let u=n.getId(l);if(l===t&&t.defaultView){let c=t0(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 Ke("scroll",s,t)}function e9({viewportResizeCb:e},{win:t}){let n=-1,r=-1,i=J(Gi(J(()=>{let o=n0(),s=r0();(n!==o||r!==s)&&(e({width:Number(s),height:Number(o)}),n=o,r=s)}),200));return Ke("resize",i,t)}var t9=["INPUT","TEXTAREA","SELECT"],b1=new WeakMap;function n9({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(x){let b=Zi(x),v=x.isTrusted,N=b&&b.tagName;if(b&&N==="OPTION"&&(b=B.parentElement(b)),!b||!N||t9.indexOf(N)<0||He(b,r,i,!0)||b.classList.contains(o)||s&&b.matches(s))return;let $=b.value,L=!1,D=Ra(b)||"";D==="radio"||D==="checkbox"?L=b.checked:(a[N.toLowerCase()]||a[D])&&($=va({element:b,maskInputOptions:a,tagName:N,type:D,value:$,maskInputFn:l})),p(b,c?{text:$,isChecked:L,userTriggered:v}:{text:$,isChecked:L});let M=b.name;D==="radio"&&M&&L&&t.querySelectorAll(`input[type="radio"][name="${M}"]`).forEach(V=>{if(V!==b){let se=V.value;p(V,c?{text:se,isChecked:!L,userTriggered:!1}:{text:se,isChecked:!L})}})}function p(x,b){let v=b1.get(x);if(!v||v.text!==b.text||v.isChecked!==b.isChecked){b1.set(x,b);let N=n.getId(x);J(e)({...b,id:N})}}let f=(u.input==="last"?["change"]:["input","change"]).map(x=>Ke(x,J(d),t)),h=t.defaultView;if(!h)return()=>{f.forEach(x=>x())};let y=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),S=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&f.push(...S.map(x=>qa(x[0],x[1],{set(){J(d)({target:this,isTrusted:!1})}},!1,h))),J(()=>{f.forEach(x=>x())})}function La(e){let t=[];function n(r,i){if(pa("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||pa("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||pa("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||pa("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 vn(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function r9({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:J((c,d,p)=>{let[m,f]=p,{id:h,styleId:y}=vn(d,t,n.styleMirror);return(h&&h!==-1||y&&y!==-1)&&e({id:h,styleId:y,adds:[{rule:m,index:f}]}),c.apply(d,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,d,p=this.cssRules.length){let m=`${c} { ${d} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[m,p])};let o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:J((c,d,p)=>{let[m]=p,{id:f,styleId:h}=vn(d,t,n.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,removes:[{index:m}]}),c.apply(d,p)})}),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:J((c,d,p)=>{let[m]=p,{id:f,styleId:h}=vn(d,t,n.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,replace:m}),c.apply(d,p)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:J((c,d,p)=>{let[m]=p,{id:f,styleId:h}=vn(d,t,n.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,replaceSync:m}),c.apply(d,p)})}));let l={};ha("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(ha("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),ha("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),ha("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:J((p,m,f)=>{let[h,y]=f,{id:S,styleId:x}=vn(m.parentStyleSheet,t,n.styleMirror);return(S&&S!==-1||x&&x!==-1)&&e({id:S,styleId:x,adds:[{rule:h,index:[...La(m),y||0]}]}),p.apply(m,f)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:J((p,m,f)=>{let[h]=f,{id:y,styleId:S}=vn(m.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,removes:[{index:[...La(m),h]}]}),p.apply(m,f)})})}),J(()=>{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 h0({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}}),J(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function i9({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:J((a,l,u)=>{var c;let[d,p,m]=u;if(n.has(d))return o.apply(l,[d,p,m]);let{id:f,styleId:h}=vn((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,r.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,set:{property:d,value:p,priority:m},index:La(l.parentRule)}),a.apply(l,u)})});let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:J((a,l,u)=>{var c;let[d]=u;if(n.has(d))return s.apply(l,[d]);let{id:p,styleId:m}=vn((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||m&&m!==-1)&&e({id:p,styleId:m,remove:{property:d},index:La(l.parentRule)}),a.apply(l,u)})}),J(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}function o9({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){let s=J(l=>Gi(J(u=>{let c=Zi(u);if(!c||He(c,t,n,!0))return;let{currentTime:d,volume:p,muted:m,playbackRate:f,loop:h}=c;e({type:l,id:r.getId(c),currentTime:d,volume:p,muted:m,playbackRate:f,loop:h})}),i.media||500)),a=[Ke("play",s(Pr.Play),o),Ke("pause",s(Pr.Pause),o),Ke("seeked",s(Pr.Seeked),o),Ke("volumechange",s(Pr.VolumeChange),o),Ke("ratechange",s(Pr.RateChange),o)];return J(()=>{a.forEach(l=>l())})}function s9({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(J(()=>{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),J(()=>{r.forEach(a=>a())})}function a9(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e,s=!0,a=J(()=>{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 p=l.getRangeAt(d),{startContainer:m,startOffset:f,endContainer:h,endOffset:y}=p;He(m,r,i,!0)||He(h,r,i,!0)||u.push({start:n.getId(m),startOffset:f,end:n.getId(h),endOffset:y})}o({ranges:u})});return a(),Ke("selectionchange",a)}function l9({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 u9(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:p,selectionCb:m,customElementCb:f}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),n(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),r(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),i(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),o(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),s(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),a(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),l(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),u(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),c(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),d(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),p(...h)},e.selectionCb=(...h)=>{t.selection&&t.selection(...h),m(...h)},e.customElementCb=(...h)=>{t.customElement&&t.customElement(...h),f(...h)}}function c9(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};u9(e,t);let r;e.recordDOM&&(r=f0(e,e.doc));let i=X_(e),o=Q_(e),s=p0(e),a=e9(e,{win:n}),l=n9(e),u=o9(e),c=()=>{},d=()=>{},p=()=>{},m=()=>{};e.recordDOM&&(c=r9(e,{win:n}),d=h0(e,e.doc),p=i9(e,{win:n}),e.collectFonts&&(m=s9(e)));let f=a9(e),h=l9(e),y=[];for(let S of e.plugins)y.push(S.observer(S.callback,n,S.options));return J(()=>{Un.forEach(S=>S.reset()),r?.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),p(),m(),f(),h(),y.forEach(S=>S())})}function pa(e){return typeof window[e]<"u"}function ha(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var Da=class{constructor(t){E(this,"iframeIdToRemoteIdMap",new WeakMap),E(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}},yf=class{constructor(t){E(this,"iframes",new WeakMap),E(this,"crossOriginIframeMap",new WeakMap),E(this,"crossOriginIframeMirror",new Da(P1)),E(this,"crossOriginIframeStyleMirror"),E(this,"crossOriginIframeRootIdMap",new WeakMap),E(this,"mirror"),E(this,"mutationCb"),E(this,"wrappedEmit"),E(this,"loadListener"),E(this,"stylesheetManager"),E(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Da(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 q.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:q.IncrementalSnapshot,data:{source:W.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case q.Meta:case q.Load:case q.DomContentLoaded:return!1;case q.Plugin:return n;case q.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case q.IncrementalSnapshot:switch(n.data.source){case W.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 W.Drag:case W.TouchMove:case W.MouseMove:return n.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case W.ViewportResize:return!1;case W.MediaInteraction:case W.MouseInteraction:case W.Scroll:case W.CanvasMutation:case W.Input:return this.replaceIds(n.data,t,["id"]),n;case W.StyleSheetRule:case W.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case W.Font:return n;case W.Selection:return n.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),n;case W.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!==c0.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},gf=class{constructor(t){E(this,"shadowDoms",new WeakSet),E(this,"mutationCb"),E(this,"scrollCb"),E(this,"bypassOptions"),E(this,"mirror"),E(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(!$i(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let r=f0({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(p0({...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(h0({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&&u0(this)&&r.addShadowRoot(a,n),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d9=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Oi=0;Oi<Tr.length;Oi++)d9[Tr.charCodeAt(Oi)]=Oi;var Oi,f9=function(e){var t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=Tr[t[n]>>2],i+=Tr[(t[n]&3)<<4|t[n+1]>>4],i+=Tr[(t[n+1]&15)<<2|t[n+2]>>6],i+=Tr[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 S1=new Map;function p9(e,t){let n=S1.get(e);return n||(n=new Map,S1.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var m0=(e,t,n)=>{if(!e||!(g0(e,t)||typeof e=="object"))return;let r=e.constructor.name,i=p9(n,r),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Sa(e,t,n){if(e instanceof Array)return e.map(r=>Sa(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=f9(e);return{rr_type:r,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Sa(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:[Sa(e.data,t,n),e.width,e.height]};if(g0(e,t)||typeof e=="object"){let r=e.constructor.name,i=m0(e,t,n);return{rr_type:r,index:i}}}}return e}var y0=(e,t,n)=>e.map(r=>Sa(r,t,n)),g0=(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 h9(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 He(this.canvas,n,r,!0)||setTimeout(()=>{let c=y0(u,t,this);e(this.canvas,{type:_r["2D"],property:s,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=qa(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:_r["2D"],property:s,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(s=>s())}}function m9(e){return e==="experimental-webgl"?"webgl":e}function w1(e,t,n,r){let i=[];try{let o=Kn(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!He(this,t,n,!0)){let u=m9(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 x1(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 p=c.apply(this,d);if(m0(p,o,this),"tagName"in this.canvas&&!He(this.canvas,r,i,!0)){let m=y0(d,o,this),f={type:t,property:l,args:m};n(this.canvas,f)}return p}});s.push(u)}catch{let u=qa(e,l,{set(c){n(this.canvas,{type:t,property:l,args:[c],setter:!0})}});s.push(u)}return s}function y9(e,t,n,r){let i=[];return i.push(...x1(t.WebGLRenderingContext.prototype,_r.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...x1(t.WebGL2RenderingContext.prototype,_r.WebGL2,e,n,r,t)),()=>{i.forEach(o=>o())}}var b0="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",g9=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),v1=typeof window<"u"&&window.Blob&&new Blob([g9(b0)],{type:"text/javascript;charset=utf-8"});function b9(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,"+b0,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var bf=class{constructor(t){E(this,"pendingCanvasMutations",new Map),E(this,"rafStamps",{latestId:0,invokeId:null}),E(this,"mirror"),E(this,"mutationCb"),E(this,"resetObservers"),E(this,"frozen",!1),E(this,"locked",!1),E(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=w1(n,r,i,!0),a=new Map,l=new b9;l.onmessage=f=>{let{id:h}=f.data;if(a.set(h,!1),!("base64"in f.data))return;let{base64:y,type:S,width:x,height:b}=f.data;this.mutationCb({id:h,type:_r["2D"],commands:[{property:"clearRect",args:[0,0,x,b]},{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,p=()=>{let f=[];return n.document.querySelectorAll("canvas").forEach(h=>{He(h,r,i,!0)||f.push(h)}),f},m=f=>{if(c&&f-c<u){d=requestAnimationFrame(m);return}c=f,p().forEach(async h=>{var y;let S=this.mirror.getId(h);if(a.get(S)||h.width===0||h.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(h.__context)){let b=h.getContext(h.__context);((y=b?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&b.clear(b.COLOR_BUFFER_BIT)}let x=await createImageBitmap(h);l.postMessage({id:S,bitmap:x,width:h.width,height:h.height,dataURLOptions:o.dataURLOptions},[x])}),d=requestAnimationFrame(m)};d=requestAnimationFrame(m),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=w1(t,n,r,!1),o=h9(this.processMutation.bind(this),t,n,r),s=y9(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)}},Sf=class{constructor(t){E(this,"trackedLinkElements",new WeakSet),E(this,"mutationCb"),E(this,"adoptedStyleSheetCb"),E(this,"styleMirror",new ff),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:A1(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){}},wf=class{constructor(){E(this,"nodeMap",new WeakMap),E(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(){}},Ee,wa,Md,Fa=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((kw=e.contentWindow)==null?void 0:kw.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var St=xL();function Hn(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:p,slimDOMOptions:m,maskInputFn:f,maskTextFn:h,hooks:y,packFn:S,sampling:x={},dataURLOptions:b={},mousemoveWait:v,recordDOM:N=!0,recordCanvas:$=!1,recordCrossOriginIframes:L=!1,recordAfter:D=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:M=!1,collectFonts:V=!1,inlineImages:se=!1,plugins:pe,keepIframeSrcFn:F=()=>!1,ignoreCSSAttributes:_e=new Set([]),errorHandler:Rt}=e;Z_(Rt);let Ie=L?window.parent===window:!0,at=!1;if(!Ie)try{window.parent.document&&(at=!1)}catch{at=!0}if(Ie&&!t)throw new Error("emit function is required");if(!Ie&&!at)return()=>{};v!==void 0&&x.mousemove===void 0&&(x.mousemove=v),St.reset();let Rn=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}:p!==void 0?p:{password:!0},kt=O1(m);G_();let Yf,Ya=0,Zf=ee=>{for(let ct of pe||[])ct.eventProcessor&&(ee=ct.eventProcessor(ee));return S&&!at&&(ee=S(ee)),ee};Ee=(ee,ct)=>{var xe;let ve=ee;if(ve.timestamp=$a(),(xe=Un[0])!=null&&xe.isFrozen()&&ve.type!==q.FullSnapshot&&!(ve.type===q.IncrementalSnapshot&&ve.data.source===W.Mutation)&&Un.forEach(Je=>Je.unfreeze()),Ie)t?.(Zf(ve),ct);else if(at){let Je={type:"rrweb",event:Zf(ve),origin:window.location.origin,isCheckout:ct};window.parent.postMessage(Je,"*")}if(ve.type===q.FullSnapshot)Yf=ve,Ya=0;else if(ve.type===q.IncrementalSnapshot){if(ve.data.source===W.Mutation&&ve.data.isAttachIframe)return;Ya++;let Je=r&&Ya>=r,ae=n&&ve.timestamp-Yf.timestamp>n;(Je||ae)&&wa(!0)}};let eo=ee=>{Ee({type:q.IncrementalSnapshot,data:{source:W.Mutation,...ee}})},Jf=ee=>Ee({type:q.IncrementalSnapshot,data:{source:W.Scroll,...ee}}),Xf=ee=>Ee({type:q.IncrementalSnapshot,data:{source:W.CanvasMutation,...ee}}),j0=ee=>Ee({type:q.IncrementalSnapshot,data:{source:W.AdoptedStyleSheet,...ee}}),kn=new Sf({mutationCb:eo,adoptedStyleSheetCb:j0}),En=new yf({mirror:St,mutationCb:eo,stylesheetManager:kn,recordCrossOriginIframes:L,wrappedEmit:Ee});for(let ee of pe||[])ee.getMirror&&ee.getMirror({nodeMirror:St,crossOriginIframeMirror:En.crossOriginIframeMirror,crossOriginIframeStyleMirror:En.crossOriginIframeStyleMirror});let Za=new wf;Md=new bf({recordCanvas:$,mutationCb:Xf,win:window,blockClass:i,blockSelector:o,mirror:St,sampling:x.canvas,dataURLOptions:b});let to=new gf({mutationCb:eo,scrollCb:Jf,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:Rn,dataURLOptions:b,maskTextFn:h,maskInputFn:f,recordCanvas:$,inlineImages:se,sampling:x,slimDOMOptions:kt,iframeManager:En,stylesheetManager:kn,canvasManager:Md,keepIframeSrcFn:F,processedNodeManager:Za},mirror:St});wa=(ee=!1)=>{if(!N)return;Ee({type:q.Meta,data:{href:window.location.href,width:r0(),height:n0()}},ee),kn.reset(),to.init(),Un.forEach(xe=>xe.lock());let ct=GL(document,{mirror:St,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:Rn,maskTextFn:h,maskInputFn:f,slimDOM:kt,dataURLOptions:b,recordCanvas:$,inlineImages:se,onSerialize:xe=>{s0(xe,St)&&En.addIframe(xe),a0(xe,St)&&kn.trackLinkElement(xe),df(xe)&&to.addShadowRoot(B.shadowRoot(xe),document)},onIframeLoad:(xe,ve)=>{En.attachIframe(xe,ve),to.observeAttachShadow(xe)},onStylesheetLoad:(xe,ve)=>{kn.attachLinkElement(xe,ve)},keepIframeSrcFn:F});if(!ct)return console.warn("Failed to snapshot the document");Ee({type:q.FullSnapshot,data:{node:ct,initialOffset:t0(window)}},ee),Un.forEach(xe=>xe.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&kn.adoptStyleSheets(document.adoptedStyleSheets,St.getId(document))};try{let ee=[],ct=ve=>{var Je;return J(c9)({mutationCb:eo,mousemoveCb:(ae,Ja)=>Ee({type:q.IncrementalSnapshot,data:{source:Ja,positions:ae}}),mouseInteractionCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.MouseInteraction,...ae}}),scrollCb:Jf,viewportResizeCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.ViewportResize,...ae}}),inputCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.Input,...ae}}),mediaInteractionCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.MediaInteraction,...ae}}),styleSheetRuleCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.StyleSheetRule,...ae}}),styleDeclarationCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.StyleDeclaration,...ae}}),canvasMutationCb:Xf,fontCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.Font,...ae}}),selectionCb:ae=>{Ee({type:q.IncrementalSnapshot,data:{source:W.Selection,...ae}})},customElementCb:ae=>{Ee({type:q.IncrementalSnapshot,data:{source:W.CustomElement,...ae}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:Rn,inlineStylesheet:c,sampling:x,recordDOM:N,recordCanvas:$,inlineImages:se,userTriggeredOnInput:M,collectFonts:V,doc:ve,maskInputFn:f,maskTextFn:h,keepIframeSrcFn:F,blockSelector:o,slimDOMOptions:kt,dataURLOptions:b,mirror:St,iframeManager:En,stylesheetManager:kn,shadowDomManager:to,processedNodeManager:Za,canvasManager:Md,ignoreCSSAttributes:_e,plugins:((Je=pe?.filter(ae=>ae.observer))==null?void 0:Je.map(ae=>({observer:ae.observer,options:ae.options,callback:Ja=>Ee({type:q.Plugin,data:{plugin:ae.name,payload:Ja}})})))||[]},y)};En.addLoadListener(ve=>{try{ee.push(ct(ve.contentDocument))}catch(Je){console.warn(Je)}});let xe=()=>{wa(),ee.push(ct(document)),Fa=!0};return["interactive","complete"].includes(document.readyState)?xe():(ee.push(Ke("DOMContentLoaded",()=>{Ee({type:q.DomContentLoaded,data:{}}),D==="DOMContentLoaded"&&xe()})),ee.push(Ke("load",()=>{Ee({type:q.Load,data:{}}),D==="load"&&xe()},window))),()=>{ee.forEach(ve=>{try{ve()}catch(Je){String(Je).toLowerCase().includes("cross-origin")||console.warn(Je)}}),Za.destroy(),Fa=!1,J_()}}catch(ee){console.warn(ee)}}Hn.addCustomEvent=(e,t)=>{if(!Fa)throw new Error("please add custom event after start recording");Ee({type:q.Custom,data:{tag:e,payload:t}})};Hn.freezePage=()=>{Un.forEach(e=>e.freeze())};Hn.takeFullSnapshot=e=>{if(!Fa)throw new Error("please take full snapshot after start recording");wa(e)};Hn.mirror=St;var R1;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(R1||(R1={}));var XK=5*1e3;var{addCustomEvent:QK}=Hn,{freezePage:eH}=Hn,{takeFullSnapshot:tH}=Hn;var x0="__ripploEmitRrwebEvent";function v0(){return{eventTypes:S0(q),incrementalSources:S0(W)}}function S0(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,n])=>[n,t]))}var w9=md("@ripplo/rrweb-bundle/bundle","rrweb.js"),w0;function R0(){return w0??=S9(w9,{encoding:"utf8"}),w0}async function Ji({clientVersion:e,debugDir:t,writeOtlpPortFile:n}){let r=new Map,i=gw(v0()),o=await yd({localDir:k0.join(k0.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 R0();return{attach:async(l,u)=>{let c=yw({debugDir:t,runId:u,worker:i});c.emit({clientVersion:e,kind:"meta",source:"capture",timeNanos:"0"}),r.set(u,c),await xw(l,u),await l.addInitScript(`globalThis.__ripploCapturePort = ${String(o.port)};`),await v9(l,c),await E9(l,c);let d=[];return{emitAction:p=>{P9(c,p)},emitAssertion:p=>{I9(c,p)},emitFinding:p=>{let m=Sw(p);m!=null&&c.emit(m)},finish:()=>A9(c,{pages:d,registry:r,runId:u}),onPage:p=>{d.push(p),C9(c,s,p)}}},debugDir:t,close:async()=>{await o.stop(),await i.terminate()},injectSpan:(l,u)=>{r.get(l)?.emit(u)}}}async function x9(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function v9(e,t){await e.exposeBinding(x0,(n,r)=>{let i=typeof r=="string"?r:JSON.stringify(r);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}var R9="__ripploEventPush",k9=vt.discriminatedUnion("kind",[vt.object({kind:vt.literal("console"),level:vt.string(),text:vt.string(),timestamp:vt.number()}),vt.object({kind:vt.literal("error"),message:vt.string(),stack:vt.string().optional(),timestamp:vt.number()})]);async function E9(e,t){await e.exposeBinding(R9,(n,r)=>{let i=k9.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:xn(o.timestamp)});return}t.emit({kind:"error",message:o.message,source:"browser",stack:o.stack,timeNanos:xn(o.timestamp)})})}async function A9(e,t){await x9(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 C9(e,t,n){n.on("load",()=>{n.addScriptTag({content:t}).catch(()=>{})}),n.on("response",r=>{N9(e,r)}),n.url()!=="about:blank"&&n.addScriptTag({content:t}).catch(()=>{})}function P9(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:M9(t),timeNanos:xn(Date.now()),value:T9(t)})}function I9(e,t){let n=rs(t);e.emit({kind:"assertion",label:n.label,outcome:t.outcome,source:"test",step:n.step,timeNanos:xn(Date.now()),wait:t.waitBudget,waitMs:t.waitMs})}function M9(e){if(e.url!=null)return e.url;if(e.locator!=null)return zf(e.locator)}function zf(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${zf(e.scope)} \u25B8 ${zf(e.target)}`:`${e.role} ${e.name??""}`.trim()}function T9(e){return e.value!=null?typeof e.value=="object"?JSON.stringify(e.value):String(e.value):e.key}var O9=/^http:\/\/127\.0\.0\.1:\d+\/rrweb\//;async function N9(e,t){let n=t.request(),r=n.resourceType();if(r!=="fetch"&&r!=="xhr"||O9.test(n.url()))return;let i=n.headers().traceparent?.split("-"),o=n.timing().startTime;e.emit({kind:"network",method:n.method(),requestBody:n.postData()??void 0,resourceType:r,responseBody:await $9(t),source:"browser",spanId:i?.[2],status:t.status(),timeNanos:xn(o>0?o:Date.now()),traceId:i?.[1],url:t.url()})}async function $9(e){try{return await e.text()}catch{return}}function Qi(e){return{aborted:!0,findings:[],ran:[],teardown:e}}function Kf(e,t){return new Gf(G9(e,t))}function D9(e,t){return new Gf(F9(e,t))}async function F9(e,t){let n=await uw(e.profileDir).catch(()=>{});if(n==null)return jr(Vt(new Error("launch")));try{return Xi(await _9({context:n,params:e,signal:t}))}catch(r){return jr(Vt(r))}finally{await n.close().catch(pt)}}async function _9({context:e,params:t,signal:n}){let r=e.pages()[0]??await e.newPage(),i=await Ji({clientVersion:t.clientVersion,debugDir:t.debugDir,writeOtlpPortFile:!0}),o=await i.attach(e,t.runId);return o.onPage(r),e.on("page",s=>{o.onPage(s)}),await r.goto(t.startUrl).catch(pt),t.onReady(),await j9(e,n),await o.finish(),await i.close(),{behaviorPath:L9.join(t.debugDir,t.runId,"behavior.jsonl")}}function j9(e,t){return new Promise(n=>{let r=()=>{n()};t.addEventListener("abort",r,{once:!0}),e.on("close",r),e.browser()?.on("disconnected",r),e.on("page",i=>i.on("close",r)),e.pages().forEach(i=>i.on("close",r))})}function B9(e,t){return new Gf(V9(e,t))}async function V9(e,t){let n=U9(e),r=P0({lockfile:e.lockfile,options:e.options,runId:e.runId,signal:t}),i=async o=>{try{return Xi(await W9({established:o,params:e,signal:t}))}catch(s){return await o.teardown().match(pt,pt),jr(Vt(s))}};return C0(r,n).match(i,async o=>(await Hf(r.teardown),jr(o)))}function U9(e){return{capture:!1,lockfile:e.lockfile,onEvent:void 0,onPhase:void 0,options:e.options,params:void 0,runId:e.runId,sequence:e.sequence,test:e.test}}async function W9({established:e,params:t,signal:n}){let r=zs({cacheDir:void 0,headed:!0}),i=await r.acquire(),{result:o,session:s}=await A0({browser:i,capture:null,established:e,lockfile:t.lockfile,onEvent:void 0,onPhase:void 0,options:t.options,sequence:t.sequence,signal:n,stopAfterStep:t.stopAfterStep,test:t.test,viewport:null});return t.onReady(),await z9(i,s.context),await e.teardown().match(pt,pt),await r.close(),{kind:"handed-over",ran:o.ran.length}}function z9(e,t){return new Promise(n=>{let r=()=>{n()};e.on("disconnected",r),t.on("close",r),t.on("page",i=>i.on("close",r)),t.pages().forEach(i=>i.on("close",r))})}async function G9({browser:e,hub:t,request:n},r){if(r.aborted)return Xi(Qi("skipped"));let i=P0({lockfile:n.lockfile,options:n.options,runId:n.runId,signal:r}),o=async s=>{try{return Xi(await H9({browser:e,established:s,hub:t,request:n,signal:r}))}catch(a){return jr(Vt(a))}};return C0(i,n).match(o,s=>K9(s,i.teardown))}async function K9(e,t){return e.kind!=="aborted"?jr(e):Xi(Qi(await Hf(t)))}function Hf(e){return e().match(()=>"done",()=>"failed")}async function H9(e){let t=await q9(e);if(t.kind==="completed"){let r=Date.now();return await e.established.teardown().match(pt,Gl),e.request.onPhase?.("teardown",Date.now()-r),{aborted:!1,...t.result}}let n=await Hf(e.established.teardown);if(t.kind==="aborted")return Qi(n);throw t.error}function E0(e,t,n){return ni(e,t).map(r=>({params:{...Ns(r),...n},transition:r}))}async function A0(e){let{established:t,lockfile:n,signal:r}=e,i=Date.now(),o=await ud({baseUrl:e.options.baseUrl,browser:e.browser,capture:e.capture,clientState:t.clientState,engine:id(Z9(n)),fixturesDir:e.options.fixturesDir,networkHeaders:I0(e.options.tunnelAuth),reader:t.reader,session:t.auth,signal:r,viewport:e.viewport});e.onPhase?.("browser",Date.now()-i);try{let s=cr(n),a=Date.now(),l=await Ho({canon:bo(n),classify:go(n),dataRules:s.dataRules,driver:o.driver,facts:ou(s.facts,We(e.test)),initialState:{snapshot:t.snapshot},onAssertion:o.emitAssertion,sequence:e.sequence,stopAfterStep:e.stopAfterStep,onEvent:u=>{u.kind==="finding"&&o.emitFinding(u.finding),e.onEvent?.(u)}},r);return e.onPhase?.("drive",Date.now()-a),{result:l,session:o}}catch(s){throw await o.close().catch(pt),s}}async function q9({browser:e,established:t,hub:n,request:r,signal:i}){try{rt(i),r.onEvent?.({aliases:t.aliases,generated:t.generated,generatedSingletons:t.generatedSingletons,kind:"world"});let{result:o,session:s}=await A0({browser:e,capture:r.capture?{hub:n,runId:r.runId}:null,established:t,lockfile:r.lockfile,onEvent:r.onEvent,onPhase:r.onPhase,options:r.options,sequence:r.sequence??E0(r.lockfile,r.test,r.params),signal:i,stopAfterStep:void 0,test:r.test,viewport:lw});return await s.close(),{kind:"completed",result:o}}catch(o){return li(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function C0(e,t){let n=Date.now();return e.ready().andThen(()=>{t.onPhase?.("engine",Date.now()-n);let r=Date.now();return sr(t.lockfile,t.test,{generate:Xo(Jo(t.options.generate,t.runId),new Date().toISOString()),materialize:e.materialize,params:t.params}).map(i=>(t.onPhase?.("world",Date.now()-r),{aliases:i.aliases,auth:i.auth,clientState:i.clientState,generated:i.generated,generatedSingletons:i.generatedSingletons,reader:e.reader,snapshot:i.snapshot,teardown:e.teardown}))})}function P0({lockfile:e,options:t,runId:n,signal:r}){let i=hd({baseUrl:t.engineUrl,extraHeaders:I0(t.tunnelAuth),runId:n,secret:t.secret},r);return{materialize:Wo(i.setupWorld),reader:fd(e.entities,Y9(e),i.query),ready:i.ready,teardown:i.teardown}}function I0(e){if(e!=null)return{"CF-Access-Client-Id":e.clientId,"CF-Access-Client-Secret":e.clientSecret}}function Y9(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function Z9(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}import{err as J9,ok as X9,ResultAsync as Q9}from"neverthrow";function e8({cacheDir:e,clientVersion:t,debugDir:n,headed:r,writeOtlpPortFile:i}){let o=zs({cacheDir:e,headed:r}),s,a,l=async()=>(s??=Ji({clientVersion:t,debugDir:n,writeOtlpPortFile:i}),a=await s,a),u=async(p,m)=>{if(m.aborted)return X9(Qi("skipped"));try{let f=await l();if(p.options.headed&&!r)return await cd(!0,async y=>Kf({browser:y,hub:f,request:p},m));let h=await o.acquire();return await Kf({browser:h,hub:f,request:p},m)}catch(f){return J9(Vt(f))}};return{close:async()=>{await o.close();let p=s;s=void 0,a=void 0,p!=null&&await p.then(m=>m.close()).catch(()=>{})},prewarm:async()=>{await l(),await o.acquire()},injectSpan:(p,m)=>{a?.injectSpan(p,m)},runOnce:(p,m)=>new Q9(u(p,m))}}import{z}from"zod";function t8(e){let t=e.split(`
|
|
115
|
-
`).map(i=>
|
|
116
|
-
`)}function
|
|
117
|
-
daemon: cannot subscribe to run dispatch${s} \u2014 server-side, restarting the daemon will not help`}return o}function
|
|
114
|
+
or you can use record.mirror to access the mirror instance during recording.`,p1={map:{},getId(){return console.error(Cr),-1},getNode(){return console.error(Cr),null},removeNodeFromMap(){console.error(Cr)},has(){return console.error(Cr),!1},reset(){console.error(Cr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(p1=new Proxy(p1,{get(e,t,n){return t==="map"&&console.error(Cr),Reflect.get(e,t,n)}}));function Gi(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 qa(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)}}),()=>qa(e,t,o||{},!0)}var $a=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||($a=()=>new Date().getTime());function t0(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 n0(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function r0(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function i0(e){return e?e.nodeType===e.ELEMENT_NODE?e:B.parentElement(e):null}function He(e,t,n,r){if(!e)return!1;let i=i0(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||r&&i.closest("."+t)!==null)return!0}else if(Ea(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function W_(e,t){return t.getId(e)!==-1}function Id(e,t,n){return e.tagName==="TITLE"&&n.headTitleMutations?!0:t.getId(e)===Di}function o0(e,t){if(Ni(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?o0(r,t):!0}function cf(e){return!!e.changedTouches}function z_(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 s0(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function a0(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function df(e){return e?e instanceof uf&&"shadowRoot"in e?!!e.shadowRoot:!!B.shadowRoot(e):!1}var ff=class{constructor(){E(this,"id",1),E(this,"styleIDMap",new WeakMap),E(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 l0(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 G_(e){let t=e,n;for(;n=l0(t);)t=n;return t}function K_(e){let t=B.ownerDocument(e);if(!t)return!1;let n=G_(e);return B.contains(t,n)}function u0(e){let t=B.ownerDocument(e);return t?B.contains(t,e)||K_(e):!1}var q=(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))(q||{}),W=(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))(W||{}),Ze=(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))(Ze||{}),Qt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Qt||{}),_r=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(_r||{}),Pr=(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))(Pr||{});var c0=(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))(c0||{});function h1(e){return"__ln"in e}var pf=class{constructor(){E(this,"length",0),E(this,"head",null),E(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&&h1(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&&h1(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--)}},m1=(e,t)=>`${e}@${t}`,hf=class{constructor(){E(this,"frozen",!1),E(this,"locked",!1),E(this,"texts",[]),E(this,"attributes",[]),E(this,"attributeMap",new WeakMap),E(this,"removes",[]),E(this,"mapRemoves",[]),E(this,"movedMap",{}),E(this,"addedSet",new Set),E(this,"movedSet",new Set),E(this,"droppedSet",new Set),E(this,"removesSubTreeCache",new Set),E(this,"mutationCb"),E(this,"blockClass"),E(this,"blockSelector"),E(this,"maskTextClass"),E(this,"maskTextSelector"),E(this,"inlineStylesheet"),E(this,"maskInputOptions"),E(this,"maskTextFn"),E(this,"maskInputFn"),E(this,"keepIframeSrcFn"),E(this,"recordCanvas"),E(this,"inlineImages"),E(this,"slimDOMOptions"),E(this,"dataURLOptions"),E(this,"doc"),E(this,"mirror"),E(this,"iframeManager"),E(this,"stylesheetManager"),E(this,"shadowDomManager"),E(this,"canvasManager"),E(this,"processedNodeManager"),E(this,"unattachedDoc"),E(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),E(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],n=new Set,r=new pf,i=l=>{let u=l,c=Di;for(;c===Di;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{let u=B.parentNode(l);if(!u||!u0(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){let f=u.tagName;if(f==="TEXTAREA")return;f==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let d=Ni(u)?this.mirror.getId(l0(l)):this.mirror.getId(u),p=i(l);if(d===-1||p===-1)return r.addNode(l);let m=Mr(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:f=>{s0(f,this.mirror)&&this.iframeManager.addIframe(f),a0(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),df(l)&&this.shadowDomManager.addShadowRoot(B.shadowRoot(l),this.doc)},onIframeLoad:(f,h)=>{this.iframeManager.attachIframe(f,h),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,h)=>{this.stylesheetManager.attachLinkElement(f,h)},cssCaptured:c});m&&(t.push({parentId:d,nextId:p,node:m}),n.add(m.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)y1(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(B.parentNode(l))||o(l);for(let l of this.addedSet)!g1(this.droppedSet,l)&&!y1(this.removesSubTreeCache,l,this.mirror)||g1(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 m=c.value,f=B.parentNode(m);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let h=B.host(f);if(this.mirror.getId(h)!==-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))}),E(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=va({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Ra(t),value:r,maskInputFn:this.maskInputFn})}),E(this,"processMutation",t=>{if(!Id(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let n=B.textContent(t.target);!He(t.target,this.blockClass,this.blockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:T1(t.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,i0(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=Ra(n);i=va({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:s,value:i,maskInputFn:this.maskInputFn})}if(He(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"),!M1(n.tagName,r))if(o.attributes[r]=I1(this.doc,Wn(n.tagName),Wn(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(He(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=Ni(t.target)?this.mirror.getId(B.host(t.target)):this.mirror.getId(t.target);He(t.target,this.blockClass,this.blockSelector,!1)||Id(n,this.mirror,this.slimDOMOptions)||!W_(n,this.mirror)||(this.addedSet.has(n)?(mf(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||o0(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[m1(r,i)]?mf(this.movedSet,n):(this.removes.push({parentId:i,id:r,isShadow:Ni(t.target)&&$i(t.target)?!0:void 0}),H_(n,this.removesSubTreeCache))),this.mapRemoves.push(n))});break}}}),E(this,"genAdds",(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Id(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[m1(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);He(t,this.blockClass,this.blockSelector,!1)||(B.childNodes(t).forEach(r=>this.genAdds(r)),df(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 mf(e,t){e.delete(t),B.childNodes(t).forEach(n=>mf(e,n))}function H_(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 y1(e,t,n){return e.size===0?!1:q_(e,t)}function q_(e,t,n){let r=B.parentNode(t);return r?e.has(r):!1}function g1(e,t){return e.size===0?!1:d0(e,t)}function d0(e,t){let n=B.parentNode(t);return n?e.has(n)?!0:d0(e,n):!1}var Li;function Y_(e){Li=e}function Z_(){Li=void 0}var J=e=>Li?(...n)=>{try{return e(...n)}catch(r){if(Li&&Li(r)===!0)return;throw r}}:e,Un=[];function Zi(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 f0(e,t){let n=new hf;Un.push(n),n.init(e);let r=new(e0())(J(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function J_({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=Gi(J(d=>{let p=Date.now()-a;e(s.map(m=>(m.timeOffset-=p,m)),d),s=[],a=null}),o),u=J(Gi(J(d=>{let p=Zi(d),{clientX:m,clientY:f}=cf(d)?d.changedTouches[0]:d;a||(a=$a()),s.push({x:m,y:f,id:r.getId(p),timeOffset:$a()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?W.Drag:d instanceof MouseEvent?W.MouseMove:W.TouchMove)}),i,{trailing:!1})),c=[Ke("mousemove",u,n),Ke("touchmove",u,n),Ke("drag",u,n)];return J(()=>{c.forEach(d=>d())})}function X_({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 p=Zi(d);if(He(p,r,i,!0))return;let m=null,f=c;if("pointerType"in d){switch(d.pointerType){case"mouse":m=Qt.Mouse;break;case"touch":m=Qt.Touch;break;case"pen":m=Qt.Pen;break}m===Qt.Touch?Ze[c]===Ze.MouseDown?f="TouchStart":Ze[c]===Ze.MouseUp&&(f="TouchEnd"):Qt.Pen}else cf(d)&&(m=Qt.Touch);m!==null?(l=m,(f.startsWith("Touch")&&m===Qt.Touch||f.startsWith("Mouse")&&m===Qt.Mouse)&&(m=null)):Ze[c]===Ze.Click&&(m=l,l=null);let h=cf(d)?d.changedTouches[0]:d;if(!h)return;let y=n.getId(p),{clientX:S,clientY:x}=h;J(e)({type:Ze[f],id:y,x:S,y:x,...m!==null&&{pointerType:m}})};return Object.keys(Ze).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let d=Wn(c),p=u(c);if(window.PointerEvent)switch(Ze[c]){case Ze.MouseDown:case Ze.MouseUp:d=d.replace("mouse","pointer");break;case Ze.TouchStart:case Ze.TouchEnd:return}a.push(Ke(d,p,t))}),J(()=>{a.forEach(c=>c())})}function p0({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){let s=J(Gi(J(a=>{let l=Zi(a);if(!l||He(l,r,i,!0))return;let u=n.getId(l);if(l===t&&t.defaultView){let c=t0(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 Ke("scroll",s,t)}function Q_({viewportResizeCb:e},{win:t}){let n=-1,r=-1,i=J(Gi(J(()=>{let o=n0(),s=r0();(n!==o||r!==s)&&(e({width:Number(s),height:Number(o)}),n=o,r=s)}),200));return Ke("resize",i,t)}var e9=["INPUT","TEXTAREA","SELECT"],b1=new WeakMap;function t9({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(x){let b=Zi(x),v=x.isTrusted,N=b&&b.tagName;if(b&&N==="OPTION"&&(b=B.parentElement(b)),!b||!N||e9.indexOf(N)<0||He(b,r,i,!0)||b.classList.contains(o)||s&&b.matches(s))return;let $=b.value,L=!1,D=Ra(b)||"";D==="radio"||D==="checkbox"?L=b.checked:(a[N.toLowerCase()]||a[D])&&($=va({element:b,maskInputOptions:a,tagName:N,type:D,value:$,maskInputFn:l})),p(b,c?{text:$,isChecked:L,userTriggered:v}:{text:$,isChecked:L});let M=b.name;D==="radio"&&M&&L&&t.querySelectorAll(`input[type="radio"][name="${M}"]`).forEach(V=>{if(V!==b){let se=V.value;p(V,c?{text:se,isChecked:!L,userTriggered:!1}:{text:se,isChecked:!L})}})}function p(x,b){let v=b1.get(x);if(!v||v.text!==b.text||v.isChecked!==b.isChecked){b1.set(x,b);let N=n.getId(x);J(e)({...b,id:N})}}let f=(u.input==="last"?["change"]:["input","change"]).map(x=>Ke(x,J(d),t)),h=t.defaultView;if(!h)return()=>{f.forEach(x=>x())};let y=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),S=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&f.push(...S.map(x=>qa(x[0],x[1],{set(){J(d)({target:this,isTrusted:!1})}},!1,h))),J(()=>{f.forEach(x=>x())})}function La(e){let t=[];function n(r,i){if(pa("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||pa("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||pa("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||pa("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 vn(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function n9({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:J((c,d,p)=>{let[m,f]=p,{id:h,styleId:y}=vn(d,t,n.styleMirror);return(h&&h!==-1||y&&y!==-1)&&e({id:h,styleId:y,adds:[{rule:m,index:f}]}),c.apply(d,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,d,p=this.cssRules.length){let m=`${c} { ${d} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[m,p])};let o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:J((c,d,p)=>{let[m]=p,{id:f,styleId:h}=vn(d,t,n.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,removes:[{index:m}]}),c.apply(d,p)})}),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:J((c,d,p)=>{let[m]=p,{id:f,styleId:h}=vn(d,t,n.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,replace:m}),c.apply(d,p)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:J((c,d,p)=>{let[m]=p,{id:f,styleId:h}=vn(d,t,n.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,replaceSync:m}),c.apply(d,p)})}));let l={};ha("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(ha("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),ha("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),ha("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:J((p,m,f)=>{let[h,y]=f,{id:S,styleId:x}=vn(m.parentStyleSheet,t,n.styleMirror);return(S&&S!==-1||x&&x!==-1)&&e({id:S,styleId:x,adds:[{rule:h,index:[...La(m),y||0]}]}),p.apply(m,f)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:J((p,m,f)=>{let[h]=f,{id:y,styleId:S}=vn(m.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,removes:[{index:[...La(m),h]}]}),p.apply(m,f)})})}),J(()=>{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 h0({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}}),J(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function r9({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:J((a,l,u)=>{var c;let[d,p,m]=u;if(n.has(d))return o.apply(l,[d,p,m]);let{id:f,styleId:h}=vn((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,r.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,set:{property:d,value:p,priority:m},index:La(l.parentRule)}),a.apply(l,u)})});let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:J((a,l,u)=>{var c;let[d]=u;if(n.has(d))return s.apply(l,[d]);let{id:p,styleId:m}=vn((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||m&&m!==-1)&&e({id:p,styleId:m,remove:{property:d},index:La(l.parentRule)}),a.apply(l,u)})}),J(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}function i9({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){let s=J(l=>Gi(J(u=>{let c=Zi(u);if(!c||He(c,t,n,!0))return;let{currentTime:d,volume:p,muted:m,playbackRate:f,loop:h}=c;e({type:l,id:r.getId(c),currentTime:d,volume:p,muted:m,playbackRate:f,loop:h})}),i.media||500)),a=[Ke("play",s(Pr.Play),o),Ke("pause",s(Pr.Pause),o),Ke("seeked",s(Pr.Seeked),o),Ke("volumechange",s(Pr.VolumeChange),o),Ke("ratechange",s(Pr.RateChange),o)];return J(()=>{a.forEach(l=>l())})}function o9({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(J(()=>{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),J(()=>{r.forEach(a=>a())})}function s9(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e,s=!0,a=J(()=>{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 p=l.getRangeAt(d),{startContainer:m,startOffset:f,endContainer:h,endOffset:y}=p;He(m,r,i,!0)||He(h,r,i,!0)||u.push({start:n.getId(m),startOffset:f,end:n.getId(h),endOffset:y})}o({ranges:u})});return a(),Ke("selectionchange",a)}function a9({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 l9(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:p,selectionCb:m,customElementCb:f}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),n(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),r(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),i(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),o(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),s(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),a(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),l(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),u(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),c(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),d(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),p(...h)},e.selectionCb=(...h)=>{t.selection&&t.selection(...h),m(...h)},e.customElementCb=(...h)=>{t.customElement&&t.customElement(...h),f(...h)}}function u9(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};l9(e,t);let r;e.recordDOM&&(r=f0(e,e.doc));let i=J_(e),o=X_(e),s=p0(e),a=Q_(e,{win:n}),l=t9(e),u=i9(e),c=()=>{},d=()=>{},p=()=>{},m=()=>{};e.recordDOM&&(c=n9(e,{win:n}),d=h0(e,e.doc),p=r9(e,{win:n}),e.collectFonts&&(m=o9(e)));let f=s9(e),h=a9(e),y=[];for(let S of e.plugins)y.push(S.observer(S.callback,n,S.options));return J(()=>{Un.forEach(S=>S.reset()),r?.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),p(),m(),f(),h(),y.forEach(S=>S())})}function pa(e){return typeof window[e]<"u"}function ha(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var Da=class{constructor(t){E(this,"iframeIdToRemoteIdMap",new WeakMap),E(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}},yf=class{constructor(t){E(this,"iframes",new WeakMap),E(this,"crossOriginIframeMap",new WeakMap),E(this,"crossOriginIframeMirror",new Da(P1)),E(this,"crossOriginIframeStyleMirror"),E(this,"crossOriginIframeRootIdMap",new WeakMap),E(this,"mirror"),E(this,"mutationCb"),E(this,"wrappedEmit"),E(this,"loadListener"),E(this,"stylesheetManager"),E(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Da(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 q.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:q.IncrementalSnapshot,data:{source:W.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case q.Meta:case q.Load:case q.DomContentLoaded:return!1;case q.Plugin:return n;case q.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case q.IncrementalSnapshot:switch(n.data.source){case W.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 W.Drag:case W.TouchMove:case W.MouseMove:return n.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case W.ViewportResize:return!1;case W.MediaInteraction:case W.MouseInteraction:case W.Scroll:case W.CanvasMutation:case W.Input:return this.replaceIds(n.data,t,["id"]),n;case W.StyleSheetRule:case W.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case W.Font:return n;case W.Selection:return n.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),n;case W.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!==c0.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},gf=class{constructor(t){E(this,"shadowDoms",new WeakSet),E(this,"mutationCb"),E(this,"scrollCb"),E(this,"bypassOptions"),E(this,"mirror"),E(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(!$i(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let r=f0({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(p0({...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(h0({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&&u0(this)&&r.addShadowRoot(a,n),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c9=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Oi=0;Oi<Tr.length;Oi++)c9[Tr.charCodeAt(Oi)]=Oi;var Oi,d9=function(e){var t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=Tr[t[n]>>2],i+=Tr[(t[n]&3)<<4|t[n+1]>>4],i+=Tr[(t[n+1]&15)<<2|t[n+2]>>6],i+=Tr[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 S1=new Map;function f9(e,t){let n=S1.get(e);return n||(n=new Map,S1.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var m0=(e,t,n)=>{if(!e||!(g0(e,t)||typeof e=="object"))return;let r=e.constructor.name,i=f9(n,r),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Sa(e,t,n){if(e instanceof Array)return e.map(r=>Sa(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=d9(e);return{rr_type:r,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Sa(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:[Sa(e.data,t,n),e.width,e.height]};if(g0(e,t)||typeof e=="object"){let r=e.constructor.name,i=m0(e,t,n);return{rr_type:r,index:i}}}}return e}var y0=(e,t,n)=>e.map(r=>Sa(r,t,n)),g0=(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 p9(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 He(this.canvas,n,r,!0)||setTimeout(()=>{let c=y0(u,t,this);e(this.canvas,{type:_r["2D"],property:s,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=qa(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:_r["2D"],property:s,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(s=>s())}}function h9(e){return e==="experimental-webgl"?"webgl":e}function w1(e,t,n,r){let i=[];try{let o=Kn(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!He(this,t,n,!0)){let u=h9(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 x1(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 p=c.apply(this,d);if(m0(p,o,this),"tagName"in this.canvas&&!He(this.canvas,r,i,!0)){let m=y0(d,o,this),f={type:t,property:l,args:m};n(this.canvas,f)}return p}});s.push(u)}catch{let u=qa(e,l,{set(c){n(this.canvas,{type:t,property:l,args:[c],setter:!0})}});s.push(u)}return s}function m9(e,t,n,r){let i=[];return i.push(...x1(t.WebGLRenderingContext.prototype,_r.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...x1(t.WebGL2RenderingContext.prototype,_r.WebGL2,e,n,r,t)),()=>{i.forEach(o=>o())}}var b0="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",y9=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),v1=typeof window<"u"&&window.Blob&&new Blob([y9(b0)],{type:"text/javascript;charset=utf-8"});function g9(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,"+b0,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var bf=class{constructor(t){E(this,"pendingCanvasMutations",new Map),E(this,"rafStamps",{latestId:0,invokeId:null}),E(this,"mirror"),E(this,"mutationCb"),E(this,"resetObservers"),E(this,"frozen",!1),E(this,"locked",!1),E(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=w1(n,r,i,!0),a=new Map,l=new g9;l.onmessage=f=>{let{id:h}=f.data;if(a.set(h,!1),!("base64"in f.data))return;let{base64:y,type:S,width:x,height:b}=f.data;this.mutationCb({id:h,type:_r["2D"],commands:[{property:"clearRect",args:[0,0,x,b]},{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,p=()=>{let f=[];return n.document.querySelectorAll("canvas").forEach(h=>{He(h,r,i,!0)||f.push(h)}),f},m=f=>{if(c&&f-c<u){d=requestAnimationFrame(m);return}c=f,p().forEach(async h=>{var y;let S=this.mirror.getId(h);if(a.get(S)||h.width===0||h.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(h.__context)){let b=h.getContext(h.__context);((y=b?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&b.clear(b.COLOR_BUFFER_BIT)}let x=await createImageBitmap(h);l.postMessage({id:S,bitmap:x,width:h.width,height:h.height,dataURLOptions:o.dataURLOptions},[x])}),d=requestAnimationFrame(m)};d=requestAnimationFrame(m),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=w1(t,n,r,!1),o=p9(this.processMutation.bind(this),t,n,r),s=m9(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)}},Sf=class{constructor(t){E(this,"trackedLinkElements",new WeakSet),E(this,"mutationCb"),E(this,"adoptedStyleSheetCb"),E(this,"styleMirror",new ff),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:A1(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){}},wf=class{constructor(){E(this,"nodeMap",new WeakMap),E(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(){}},Ee,wa,Md,Fa=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((kw=e.contentWindow)==null?void 0:kw.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var St=wL();function Hn(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:p,slimDOMOptions:m,maskInputFn:f,maskTextFn:h,hooks:y,packFn:S,sampling:x={},dataURLOptions:b={},mousemoveWait:v,recordDOM:N=!0,recordCanvas:$=!1,recordCrossOriginIframes:L=!1,recordAfter:D=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:M=!1,collectFonts:V=!1,inlineImages:se=!1,plugins:pe,keepIframeSrcFn:F=()=>!1,ignoreCSSAttributes:_e=new Set([]),errorHandler:Rt}=e;Y_(Rt);let Ie=L?window.parent===window:!0,at=!1;if(!Ie)try{window.parent.document&&(at=!1)}catch{at=!0}if(Ie&&!t)throw new Error("emit function is required");if(!Ie&&!at)return()=>{};v!==void 0&&x.mousemove===void 0&&(x.mousemove=v),St.reset();let Rn=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}:p!==void 0?p:{password:!0},kt=O1(m);z_();let Yf,Ya=0,Zf=ee=>{for(let ct of pe||[])ct.eventProcessor&&(ee=ct.eventProcessor(ee));return S&&!at&&(ee=S(ee)),ee};Ee=(ee,ct)=>{var xe;let ve=ee;if(ve.timestamp=$a(),(xe=Un[0])!=null&&xe.isFrozen()&&ve.type!==q.FullSnapshot&&!(ve.type===q.IncrementalSnapshot&&ve.data.source===W.Mutation)&&Un.forEach(Je=>Je.unfreeze()),Ie)t?.(Zf(ve),ct);else if(at){let Je={type:"rrweb",event:Zf(ve),origin:window.location.origin,isCheckout:ct};window.parent.postMessage(Je,"*")}if(ve.type===q.FullSnapshot)Yf=ve,Ya=0;else if(ve.type===q.IncrementalSnapshot){if(ve.data.source===W.Mutation&&ve.data.isAttachIframe)return;Ya++;let Je=r&&Ya>=r,ae=n&&ve.timestamp-Yf.timestamp>n;(Je||ae)&&wa(!0)}};let eo=ee=>{Ee({type:q.IncrementalSnapshot,data:{source:W.Mutation,...ee}})},Jf=ee=>Ee({type:q.IncrementalSnapshot,data:{source:W.Scroll,...ee}}),Xf=ee=>Ee({type:q.IncrementalSnapshot,data:{source:W.CanvasMutation,...ee}}),_0=ee=>Ee({type:q.IncrementalSnapshot,data:{source:W.AdoptedStyleSheet,...ee}}),kn=new Sf({mutationCb:eo,adoptedStyleSheetCb:_0}),En=new yf({mirror:St,mutationCb:eo,stylesheetManager:kn,recordCrossOriginIframes:L,wrappedEmit:Ee});for(let ee of pe||[])ee.getMirror&&ee.getMirror({nodeMirror:St,crossOriginIframeMirror:En.crossOriginIframeMirror,crossOriginIframeStyleMirror:En.crossOriginIframeStyleMirror});let Za=new wf;Md=new bf({recordCanvas:$,mutationCb:Xf,win:window,blockClass:i,blockSelector:o,mirror:St,sampling:x.canvas,dataURLOptions:b});let to=new gf({mutationCb:eo,scrollCb:Jf,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:Rn,dataURLOptions:b,maskTextFn:h,maskInputFn:f,recordCanvas:$,inlineImages:se,sampling:x,slimDOMOptions:kt,iframeManager:En,stylesheetManager:kn,canvasManager:Md,keepIframeSrcFn:F,processedNodeManager:Za},mirror:St});wa=(ee=!1)=>{if(!N)return;Ee({type:q.Meta,data:{href:window.location.href,width:r0(),height:n0()}},ee),kn.reset(),to.init(),Un.forEach(xe=>xe.lock());let ct=zL(document,{mirror:St,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:Rn,maskTextFn:h,maskInputFn:f,slimDOM:kt,dataURLOptions:b,recordCanvas:$,inlineImages:se,onSerialize:xe=>{s0(xe,St)&&En.addIframe(xe),a0(xe,St)&&kn.trackLinkElement(xe),df(xe)&&to.addShadowRoot(B.shadowRoot(xe),document)},onIframeLoad:(xe,ve)=>{En.attachIframe(xe,ve),to.observeAttachShadow(xe)},onStylesheetLoad:(xe,ve)=>{kn.attachLinkElement(xe,ve)},keepIframeSrcFn:F});if(!ct)return console.warn("Failed to snapshot the document");Ee({type:q.FullSnapshot,data:{node:ct,initialOffset:t0(window)}},ee),Un.forEach(xe=>xe.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&kn.adoptStyleSheets(document.adoptedStyleSheets,St.getId(document))};try{let ee=[],ct=ve=>{var Je;return J(u9)({mutationCb:eo,mousemoveCb:(ae,Ja)=>Ee({type:q.IncrementalSnapshot,data:{source:Ja,positions:ae}}),mouseInteractionCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.MouseInteraction,...ae}}),scrollCb:Jf,viewportResizeCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.ViewportResize,...ae}}),inputCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.Input,...ae}}),mediaInteractionCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.MediaInteraction,...ae}}),styleSheetRuleCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.StyleSheetRule,...ae}}),styleDeclarationCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.StyleDeclaration,...ae}}),canvasMutationCb:Xf,fontCb:ae=>Ee({type:q.IncrementalSnapshot,data:{source:W.Font,...ae}}),selectionCb:ae=>{Ee({type:q.IncrementalSnapshot,data:{source:W.Selection,...ae}})},customElementCb:ae=>{Ee({type:q.IncrementalSnapshot,data:{source:W.CustomElement,...ae}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:Rn,inlineStylesheet:c,sampling:x,recordDOM:N,recordCanvas:$,inlineImages:se,userTriggeredOnInput:M,collectFonts:V,doc:ve,maskInputFn:f,maskTextFn:h,keepIframeSrcFn:F,blockSelector:o,slimDOMOptions:kt,dataURLOptions:b,mirror:St,iframeManager:En,stylesheetManager:kn,shadowDomManager:to,processedNodeManager:Za,canvasManager:Md,ignoreCSSAttributes:_e,plugins:((Je=pe?.filter(ae=>ae.observer))==null?void 0:Je.map(ae=>({observer:ae.observer,options:ae.options,callback:Ja=>Ee({type:q.Plugin,data:{plugin:ae.name,payload:Ja}})})))||[]},y)};En.addLoadListener(ve=>{try{ee.push(ct(ve.contentDocument))}catch(Je){console.warn(Je)}});let xe=()=>{wa(),ee.push(ct(document)),Fa=!0};return["interactive","complete"].includes(document.readyState)?xe():(ee.push(Ke("DOMContentLoaded",()=>{Ee({type:q.DomContentLoaded,data:{}}),D==="DOMContentLoaded"&&xe()})),ee.push(Ke("load",()=>{Ee({type:q.Load,data:{}}),D==="load"&&xe()},window))),()=>{ee.forEach(ve=>{try{ve()}catch(Je){String(Je).toLowerCase().includes("cross-origin")||console.warn(Je)}}),Za.destroy(),Fa=!1,Z_()}}catch(ee){console.warn(ee)}}Hn.addCustomEvent=(e,t)=>{if(!Fa)throw new Error("please add custom event after start recording");Ee({type:q.Custom,data:{tag:e,payload:t}})};Hn.freezePage=()=>{Un.forEach(e=>e.freeze())};Hn.takeFullSnapshot=e=>{if(!Fa)throw new Error("please take full snapshot after start recording");wa(e)};Hn.mirror=St;var R1;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(R1||(R1={}));var JK=5*1e3;var{addCustomEvent:XK}=Hn,{freezePage:QK}=Hn,{takeFullSnapshot:eH}=Hn;var x0="__ripploEmitRrwebEvent";function v0(){return{eventTypes:S0(q),incrementalSources:S0(W)}}function S0(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,n])=>[n,t]))}var S9=md("@ripplo/rrweb-bundle/bundle","rrweb.js"),w0;function R0(){return w0??=b9(S9,{encoding:"utf8"}),w0}async function Ji({clientVersion:e,debugDir:t,writeOtlpPortFile:n}){let r=new Map,i=gw(v0()),o=await yd({localDir:k0.join(k0.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 R0();return{attach:async(l,u)=>{let c=yw({debugDir:t,runId:u,worker:i});c.emit({clientVersion:e,kind:"meta",source:"capture",timeNanos:"0"}),r.set(u,c),await xw(l,u),await l.addInitScript(`globalThis.__ripploCapturePort = ${String(o.port)};`),await x9(l,c),await k9(l,c);let d=[];return{emitAction:p=>{C9(c,p)},emitAssertion:p=>{P9(c,p)},emitFinding:p=>{let m=Sw(p);m!=null&&c.emit(m)},finish:()=>E9(c,{pages:d,registry:r,runId:u}),onPage:p=>{d.push(p),A9(c,s,p)}}},debugDir:t,close:async()=>{await o.stop(),await i.terminate()},injectSpan:(l,u)=>{r.get(l)?.emit(u)}}}async function w9(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function x9(e,t){await e.exposeBinding(x0,(n,r)=>{let i=typeof r=="string"?r:JSON.stringify(r);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}var v9="__ripploEventPush",R9=vt.discriminatedUnion("kind",[vt.object({kind:vt.literal("console"),level:vt.string(),text:vt.string(),timestamp:vt.number()}),vt.object({kind:vt.literal("error"),message:vt.string(),stack:vt.string().optional(),timestamp:vt.number()})]);async function k9(e,t){await e.exposeBinding(v9,(n,r)=>{let i=R9.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:xn(o.timestamp)});return}t.emit({kind:"error",message:o.message,source:"browser",stack:o.stack,timeNanos:xn(o.timestamp)})})}async function E9(e,t){await w9(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 A9(e,t,n){n.on("load",()=>{n.addScriptTag({content:t}).catch(()=>{})}),n.on("response",r=>{O9(e,r)}),n.url()!=="about:blank"&&n.addScriptTag({content:t}).catch(()=>{})}function C9(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:I9(t),timeNanos:xn(Date.now()),value:M9(t)})}function P9(e,t){let n=rs(t);e.emit({kind:"assertion",label:n.label,outcome:t.outcome,source:"test",step:n.step,timeNanos:xn(Date.now()),wait:t.waitBudget,waitMs:t.waitMs})}function I9(e){if(e.url!=null)return e.url;if(e.locator!=null)return zf(e.locator)}function zf(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${zf(e.scope)} \u25B8 ${zf(e.target)}`:`${e.role} ${e.name??""}`.trim()}function M9(e){return e.value!=null?typeof e.value=="object"?JSON.stringify(e.value):String(e.value):e.key}var T9=/^http:\/\/127\.0\.0\.1:\d+\/rrweb\//;async function O9(e,t){let n=t.request(),r=n.resourceType();if(r!=="fetch"&&r!=="xhr"||T9.test(n.url()))return;let i=n.headers().traceparent?.split("-"),o=n.timing().startTime;e.emit({kind:"network",method:n.method(),requestBody:n.postData()??void 0,resourceType:r,responseBody:await N9(t),source:"browser",spanId:i?.[2],status:t.status(),timeNanos:xn(o>0?o:Date.now()),traceId:i?.[1],url:t.url()})}async function N9(e){try{return await e.text()}catch{return}}function Qi(e){return{aborted:!0,findings:[],ran:[],teardown:e}}function Kf(e,t){return new Gf(z9(e,t))}function L9(e,t){return new Gf(D9(e,t))}async function D9(e,t){let n=await uw(e.profileDir).catch(()=>{});if(n==null)return jr(Vt(new Error("launch")));try{return Xi(await F9({context:n,params:e,signal:t}))}catch(r){return jr(Vt(r))}finally{await n.close().catch(pt)}}async function F9({context:e,params:t,signal:n}){let r=e.pages()[0]??await e.newPage(),i=await Ji({clientVersion:t.clientVersion,debugDir:t.debugDir,writeOtlpPortFile:!0}),o=await i.attach(e,t.runId);return o.onPage(r),e.on("page",s=>{o.onPage(s)}),await r.goto(t.startUrl).catch(pt),t.onReady(),await _9(e,n),await o.finish(),await i.close(),{behaviorPath:$9.join(t.debugDir,t.runId,"behavior.jsonl")}}function _9(e,t){return new Promise(n=>{let r=()=>{n()};t.addEventListener("abort",r,{once:!0}),e.on("close",r),e.browser()?.on("disconnected",r),e.on("page",i=>i.on("close",r)),e.pages().forEach(i=>i.on("close",r))})}function j9(e,t){return new Gf(B9(e,t))}async function B9(e,t){let n=V9(e),r=P0({lockfile:e.lockfile,options:e.options,runId:e.runId,signal:t}),i=async o=>{try{return Xi(await U9({established:o,params:e,signal:t}))}catch(s){return await o.teardown().match(pt,pt),jr(Vt(s))}};return C0(r,n).match(i,async o=>(await Hf(r.teardown),jr(o)))}function V9(e){return{capture:!1,lockfile:e.lockfile,onEvent:void 0,onPhase:void 0,options:e.options,params:void 0,runId:e.runId,sequence:e.sequence,test:e.test}}async function U9({established:e,params:t,signal:n}){let r=zs({cacheDir:void 0,headed:!0}),i=await r.acquire(),{result:o,session:s}=await A0({browser:i,capture:null,established:e,lockfile:t.lockfile,onEvent:void 0,onPhase:void 0,options:t.options,sequence:t.sequence,signal:n,stopAfterStep:t.stopAfterStep,test:t.test,viewport:null});return t.onReady(),await W9(i,s.context),await e.teardown().match(pt,pt),await r.close(),{kind:"handed-over",ran:o.ran.length}}function W9(e,t){return new Promise(n=>{let r=()=>{n()};e.on("disconnected",r),t.on("close",r),t.on("page",i=>i.on("close",r)),t.pages().forEach(i=>i.on("close",r))})}async function z9({browser:e,hub:t,request:n},r){if(r.aborted)return Xi(Qi("skipped"));let i=P0({lockfile:n.lockfile,options:n.options,runId:n.runId,signal:r}),o=async s=>{try{return Xi(await K9({browser:e,established:s,hub:t,request:n,signal:r}))}catch(a){return jr(Vt(a))}};return C0(i,n).match(o,s=>G9(s,i.teardown))}async function G9(e,t){return e.kind!=="aborted"?jr(e):Xi(Qi(await Hf(t)))}function Hf(e){return e().match(()=>"done",()=>"failed")}async function K9(e){let t=await H9(e);if(t.kind==="completed"){let r=Date.now();return await e.established.teardown().match(pt,Gl),e.request.onPhase?.("teardown",Date.now()-r),{aborted:!1,...t.result}}let n=await Hf(e.established.teardown);if(t.kind==="aborted")return Qi(n);throw t.error}function E0(e,t,n){return ni(e,t).map(r=>({params:{...Ns(r),...n},transition:r}))}async function A0(e){let{established:t,lockfile:n,signal:r}=e,i=Date.now(),o=await ud({baseUrl:e.options.baseUrl,browser:e.browser,capture:e.capture,clientState:t.clientState,engine:id(Y9(n)),fixturesDir:e.options.fixturesDir,networkHeaders:void 0,reader:t.reader,session:t.auth,signal:r,viewport:e.viewport});e.onPhase?.("browser",Date.now()-i);try{let s=cr(n),a=Date.now(),l=await Ho({canon:bo(n),classify:go(n),dataRules:s.dataRules,driver:o.driver,facts:ou(s.facts,We(e.test)),initialState:{snapshot:t.snapshot},onAssertion:o.emitAssertion,sequence:e.sequence,stopAfterStep:e.stopAfterStep,onEvent:u=>{u.kind==="finding"&&o.emitFinding(u.finding),e.onEvent?.(u)}},r);return e.onPhase?.("drive",Date.now()-a),{result:l,session:o}}catch(s){throw await o.close().catch(pt),s}}async function H9({browser:e,established:t,hub:n,request:r,signal:i}){try{rt(i),r.onEvent?.({aliases:t.aliases,generated:t.generated,generatedSingletons:t.generatedSingletons,kind:"world"});let{result:o,session:s}=await A0({browser:e,capture:r.capture?{hub:n,runId:r.runId}:null,established:t,lockfile:r.lockfile,onEvent:r.onEvent,onPhase:r.onPhase,options:r.options,sequence:r.sequence??E0(r.lockfile,r.test,r.params),signal:i,stopAfterStep:void 0,test:r.test,viewport:lw});return await s.close(),{kind:"completed",result:o}}catch(o){return li(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function C0(e,t){let n=Date.now();return e.ready().andThen(()=>{t.onPhase?.("engine",Date.now()-n);let r=Date.now();return sr(t.lockfile,t.test,{generate:Xo(Jo(t.options.generate,t.runId),new Date().toISOString()),materialize:e.materialize,params:t.params}).map(i=>(t.onPhase?.("world",Date.now()-r),{aliases:i.aliases,auth:i.auth,clientState:i.clientState,generated:i.generated,generatedSingletons:i.generatedSingletons,reader:e.reader,snapshot:i.snapshot,teardown:e.teardown}))})}function P0({lockfile:e,options:t,runId:n,signal:r}){let i=hd({baseUrl:t.engineUrl,extraHeaders:void 0,runId:n,secret:t.secret},r);return{materialize:Wo(i.setupWorld),reader:fd(e.entities,q9(e),i.query),ready:i.ready,teardown:i.teardown}}function q9(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function Y9(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}import{err as Z9,ok as J9,ResultAsync as X9}from"neverthrow";function Q9({cacheDir:e,clientVersion:t,debugDir:n,headed:r,writeOtlpPortFile:i}){let o=zs({cacheDir:e,headed:r}),s,a,l=async()=>(s??=Ji({clientVersion:t,debugDir:n,writeOtlpPortFile:i}),a=await s,a),u=async(p,m)=>{if(m.aborted)return J9(Qi("skipped"));try{let f=await l();if(p.options.headed&&!r)return await cd(!0,async y=>Kf({browser:y,hub:f,request:p},m));let h=await o.acquire();return await Kf({browser:h,hub:f,request:p},m)}catch(f){return Z9(Vt(f))}};return{close:async()=>{await o.close();let p=s;s=void 0,a=void 0,p!=null&&await p.then(m=>m.close()).catch(()=>{})},prewarm:async()=>{await l(),await o.acquire()},injectSpan:(p,m)=>{a?.injectSpan(p,m)},runOnce:(p,m)=>new X9(u(p,m))}}import{z}from"zod";function e8(e){let t=e.split(`
|
|
115
|
+
`).map(i=>y8(i)).filter(i=>i!=null),n=c8(t),r=t.map(i=>i8(i,n)).filter(i=>i!=null).filter(i=>i.kind==="input"||i.element!=null);return t8(r)}function t8(e){return e.filter((t,n)=>{let r=e[n+1];return!(t.kind==="input"&&r?.kind==="input"&&n8(t.element,r.element))})}function n8(e,t){return e?.testId===t?.testId&&e?.ariaLabel===t?.ariaLabel&&e?.placeholder===t?.placeholder}var r8={2:"click",3:"contextmenu",4:"dblclick"};function i8(e,t){return e.rrwebType==="IncrementalSnapshot:MouseInteraction"?o8(e,t):e.rrwebType==="IncrementalSnapshot:Input"?s8(e,t):null}function o8(e,t){let n=v8.safeParse(e.event.data);if(!n.success)return null;let r=r8[n.data.type];if(r==null)return null;let i=I0(n.data.id,t.nodes);return{element:M0(i,t),kind:r,timeNanos:e.timeNanos,value:void 0}}function s8(e,t){let n=R8.safeParse(e.event.data);return n.success?{element:M0(n.data.id,t),kind:"input",timeNanos:e.timeNanos,value:n.data.text??a8(n.data.isChecked)}:null}function a8(e){return e==null?void 0:String(e)}var l8=new Set(["button","a","input","select","textarea","summary"]);function I0(e,t){let n=t.get(e);if(n!=null)return u8(n)?e:n.parentId==null?void 0:I0(n.parentId,t)}function u8(e){return e.attrs["data-testid"]!=null||e.attrs["aria-label"]!=null||e.attrs.role!=null||l8.has(e.tag??"")}function M0(e,t){let n=e==null?void 0:t.nodes.get(e);if(!(n==null||e==null))return{ariaLabel:Br(n,"aria-label"),href:Br(n,"href"),name:Br(n,"name"),placeholder:Br(n,"placeholder"),role:Br(n,"role"),tag:n.tag,testId:Br(n,"data-testid"),text:T0(e,t)}}function Br(e,t){let n=e.attrs[t];return typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):void 0}function T0(e,t){let n=t.nodes.get(e);if(n==null)return;let r=n.text?.trim()??"",o=(t.children.get(e)??[]).map(a=>T0(a,t)??""),s=[r,...o].filter(a=>a.length>0).join(" ");return s.length===0?void 0:s.slice(0,100)}function c8(e){let t=e.flatMap(i=>d8(i).flatMap(o=>qf(o,void 0))),n=e.flatMap(i=>f8(i).flatMap(o=>qf(o.node,o.parentId??void 0))),r=h8(new Map([...t,...n]),e);return{children:p8(r),nodes:r}}function d8(e){if(e.rrwebType!=="FullSnapshot")return[];let t=S8.safeParse(e.event.data);return t.success?[t.data.node]:[]}function f8(e){if(e.rrwebType!=="IncrementalSnapshot:Mutation")return[];let t=O0.safeParse(e.event.data);return t.success?t.data.adds.flatMap(n=>{let r=w8.safeParse(n);return r.success?[r.data]:[]}):[]}function p8(e){let t=new Map;return e.forEach((n,r)=>{n.parentId!=null&&t.set(n.parentId,[...t.get(n.parentId)??[],r])}),t}function qf(e,t){let n=b8.safeParse(e);if(!n.success)return[];let r=n.data,i=r.childNodes??[];return[[r.id,{attrs:{...r.attributes},parentId:t,tag:r.tagName,text:r.textContent}],...i.flatMap(s=>qf(s,r.id))]}function h8(e,t){return t.flatMap(r=>m8(r)).reduce((r,i)=>{let o=r.get(i.id);return o==null?r:new Map(r).set(i.id,{...o,attrs:{...o.attrs,...i.attributes}})},e)}function m8(e){if(e.rrwebType!=="IncrementalSnapshot:Mutation")return[];let t=O0.safeParse(e.event.data);return t.success?t.data.attributes.flatMap(n=>{let r=x8.safeParse(n);return r.success?[r.data]:[]}):[]}function y8(e){if(e.trim().length===0)return null;let t=k8.safeParse(g8(e));return t.success?t.data:null}function g8(e){try{return JSON.parse(e)}catch{return null}}var b8=z.object({attributes:z.record(z.string(),z.unknown()).optional(),childNodes:z.array(z.unknown()).optional(),id:z.number(),tagName:z.string().optional(),textContent:z.string().optional()}),S8=z.object({node:z.unknown()}),w8=z.object({node:z.unknown(),parentId:z.number().nullable().default(null)}),x8=z.object({attributes:z.record(z.string(),z.unknown()),id:z.number()}),O0=z.object({adds:z.array(z.unknown()).default([]),attributes:z.array(z.unknown()).default([])}),v8=z.object({id:z.number(),type:z.number()}),R8=z.object({id:z.number(),isChecked:z.boolean().optional(),text:z.string().optional()}),k8=z.object({event:z.object({data:z.unknown()}),kind:z.literal("rrweb"),rrwebType:z.string(),timeNanos:z.string()});function E8(e){let t=n=>e.find(r=>r.phase===n)?.ms??0;return{browserMs:t("browser"),driveMs:t("drive"),engineMs:t("engine"),teardownMs:t("teardown"),worldMs:t("world")}}async function A8(e,t){let n=await L0({attemptIndex:0,capture:!1,params:e,stepRuns:e.stepRuns},t);if(n.kind!=="completed")return N0(n);let r=$0(n.findings);if(r!=null)return{error:r,kind:"error"};if(n.findings.length===0)return{kind:"clean",timing:{confirm:void 0,detect:n.timing}};let i=Ai(e.baseState.name,n.findings);return e.seenSignature!=null&&await e.seenSignature(i.signature)?{baseState:e.baseState.name,captureEvents:[],kind:"finding",runId:n.runId,signature:i.signature,timing:{confirm:void 0,detect:n.timing},verifierLayer:i.layer}:C8(e,i,n.timing,t)}function N0(e){return e.kind==="error"?{error:e.error,kind:"error"}:{kind:e.kind}}function $0(e){let t=e.find(n=>n.kind==="driver-error"&&wo(n.error));return t!=null&&t.kind==="driver-error"?t.error:void 0}async function C8(e,t,n,r){let i=await L0({attemptIndex:1,capture:!0,params:e,stepRuns:e.stepRuns},r);if(i.kind!=="completed")return N0(i);let o=$0(i.findings);if(o!=null)return{error:o,kind:"error"};let s={confirm:i.timing,detect:n};return Ai(e.baseState.name,i.findings).signature!==t.signature?{kind:"flaky",timing:s}:{baseState:e.baseState.name,captureEvents:i.events,kind:"finding",runId:i.runId,signature:t.signature,timing:s,verifierLayer:t.layer}}async function L0({attemptIndex:e,capture:t,params:n,stepRuns:r},i){let o=n.runIdFor(e),s=[],a=[];return(await n.session.runOnce({capture:t,lockfile:n.lockfile,onEvent:t?u=>{s.push(u)}:void 0,options:n.options,params:void 0,runId:o,sequence:P8(n,r),test:n.baseState.test,onPhase:(u,c)=>{a.push({ms:c,phase:u})}},i)).match(u=>u.aborted?{kind:"aborted"}:{events:s,findings:u.findings,kind:"completed",runId:o,timing:E8(a)},u=>({error:u,kind:"error"}))}function P8(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}})}async function D0(e,t){let n=await _s(e);if(n==null)return{kind:"unplannable"};let r=[...n.startingPointTests.values()].find(o=>We(o)===t.baseStateRef);if(r==null)return{kind:"unplannable"};let i=t.steps.map(o=>{let s=n.corpus.find(a=>a.test===o.test&&a.index===o.index);return s==null?null:{params:o.params,transition:s}});return i.some(o=>o==null)?{kind:"unplannable"}:{baseTest:r,kind:"ok",sequence:i.filter(o=>o!=null)}}async function I8({capture:e,lockfile:t,options:n,repro:r,runId:i,session:o,signal:s}){let a=await D0(t,r);return a.kind==="unplannable"?{kind:"unplannable"}:(await o.runOnce({capture:e,lockfile:t,onEvent:void 0,onPhase:void 0,options:n,params:void 0,runId:i,sequence:a.sequence,test:a.baseTest},s)).match(u=>u.aborted?{kind:"aborted"}:u.findings.length>0?{findings:u.findings,kind:"still-fails"}:{kind:"resolved"},u=>({kind:"state-unavailable",reason:u.kind}))}function XH(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 QH(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 eq({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(`
|
|
116
|
+
`)}function tq(){return"Not signed in. Run `npx ripplo auth login`, then start the daemon again."}function nq({devSessionId:e,version:t}){return`ripplo daemon: v${t} ready as local executor for session ${e} (switch with \`npx ripplo executor cloud\` \u2014 Ctrl-C to stop)`}function rq({cwd:e,pid:t}){return`ripplo daemon: another daemon is already running for this project${t==null?"":` (pid ${String(t)})`} (cwd ${e}) \u2014 this one is exiting. Run \`npx ripplo daemon status\` to inspect it, or \`npx ripplo daemon stop\` to stop it.`}function iq(e){switch(e.kind){case"not-running":return"ripplo daemon: not running.";case"stopped":return`ripplo daemon: stopped (pid ${String(e.pid)}).`;case"timeout":return`ripplo daemon: pid ${String(e.pid)} did not exit within 10s \u2014 it may be finishing a run. Check again with \`npx ripplo daemon status\`.`}}function oq(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project. Shutting down."}function sq(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} | ${M8(t.progress)})`;if(t.sseHealth!=null&&!t.sseHealth.ok){let s=t.sseHealth.detail==null?"":`: ${t.sseHealth.detail}`;return`${o}
|
|
117
|
+
daemon: cannot subscribe to run dispatch${s} \u2014 server-side, restarting the daemon will not help`}return o}function M8(e){return e.attempts===0?"explore: idle":`explore: ${String(e.attempts)} attempts, ${String(e.findings)} findings`}function aq(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 lq(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:T8(e.findings).map(t=>os({evidencePath:`.ripplo/debug/${e.runId}/behavior.jsonl`,finding:t})),kind:"findings"};case"error":return{detail:Pt(e.error),kind:"error"};case"dispatch-failed":return{kind:"dispatch-error",reason:{detail:e.reason,type:"generic"}}}}function T8(e){let t=new Set(e.flatMap(n=>O8(n)?[F0(n)]:[]));return e.filter(n=>!(N8(n)&&t.has(F0(n))))}function O8(e){return e.kind==="pending-check"&&e.source.kind==="step"}function F0(e){return e.kind!=="pending-check"||e.source.kind==="data-rule"?"":`${zt(e.source.check)}|${Gt(e.step)}`}function N8(e){return e.kind==="pending-check"&&e.source.kind==="fact"}export{ro as a,op as b,tv as c,nv as d,dv as e,fv as f,fp as g,hv as h,Ev as i,wp as j,xp as k,Jn as l,We as m,Le as n,ti as o,hh as p,Sh as q,si as r,wo as s,Vp as t,Pt as u,fi as v,nm as w,rm as x,om as y,De as z,Wt as A,is as B,os as C,fm as D,pi as E,pn as F,pm as G,ss as H,ym as I,cr as J,_S as K,GS as L,KS as M,qS as N,_s as O,YS as P,yd as Q,L9 as R,j9 as S,E0 as T,Q9 as U,e8 as V,A8 as W,D0 as X,I8 as Y,XH as Z,QH as _,eq as $,tq as aa,nq as ba,rq as ca,iq as da,oq as ea,sq as fa,M8 as ga,aq as ha,lq as ia};
|
|
118
118
|
/*! Bundled license information:
|
|
119
119
|
|
|
120
120
|
rrweb/dist/rrweb.js:
|