ripplo 0.7.5 → 0.7.6
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-KABDPGL5.js → chunk-752OI543.js} +69 -69
- package/dist/daemon-WX4C4JLT.js +60 -0
- package/dist/index.js +134 -134
- package/package.json +3 -3
- package/dist/daemon-PM5KE7TX.js +0 -60
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var ax=Object.create;var kf=Object.defineProperty;var lx=Object.getOwnPropertyDescriptor;var ux=Object.getOwnPropertyNames;var cx=Object.getPrototypeOf,dx=Object.prototype.hasOwnProperty;var Er=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var fx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ux(t))!dx.call(e,i)&&i!==r&&kf(e,i,{get:()=>t[i],enumerable:!(n=lx(t,i))||n.enumerable});return e};var Ti=(e,t,r)=>(r=e!=null?ax(cx(e)):{},fx(t||!e||!e.__esModule?kf(r,"default",{value:e,enumerable:!0}):r,e));var Of=Er(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.timingSafeEqual=void 0;function Mf(e,t=""){if(!e)throw new Error(t)}function Hx(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),Mf(e instanceof DataView),Mf(t instanceof DataView);let r=e.byteLength,n=0,i=-1;for(;++i<r;)n|=e.getUint8(i)^t.getUint8(i);return n===0}Oi.timingSafeEqual=Hx});var $f=Er(He=>{"use strict";var qx=He&&He.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(He,"__esModule",{value:!0});var Ae=256,ca=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var r="",n=0;n<t.length-2;n+=3){var i=t[n]<<16|t[n+1]<<8|t[n+2];r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),r+=this._encodeByte(i>>>6&63),r+=this._encodeByte(i>>>0&63)}var o=t.length-n;if(o>0){var i=t[n]<<16|(o===2?t[n+1]<<8:0);r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),o===2?r+=this._encodeByte(i>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(t),n=t.length-r,i=new Uint8Array(this.maxDecodedLength(n)),o=0,s=0,a=0,l=0,u=0,c=0,d=0;s<n-4;s+=4)l=this._decodeChar(t.charCodeAt(s+0)),u=this._decodeChar(t.charCodeAt(s+1)),c=this._decodeChar(t.charCodeAt(s+2)),d=this._decodeChar(t.charCodeAt(s+3)),i[o++]=l<<2|u>>>4,i[o++]=u<<4|c>>>2,i[o++]=c<<6|d,a|=l&Ae,a|=u&Ae,a|=c&Ae,a|=d&Ae;if(s<n-1&&(l=this._decodeChar(t.charCodeAt(s)),u=this._decodeChar(t.charCodeAt(s+1)),i[o++]=l<<2|u>>>4,a|=l&Ae,a|=u&Ae),s<n-2&&(c=this._decodeChar(t.charCodeAt(s+2)),i[o++]=u<<4|c>>>2,a|=c&Ae),s<n-3&&(d=this._decodeChar(t.charCodeAt(s+3)),i[o++]=c<<6|d,a|=d&Ae),a!==0)throw new Error("Base64Coder: incorrect characters for decoding");return i},e.prototype._encodeByte=function(t){var r=t;return r+=65,r+=25-t>>>8&6,r+=51-t>>>8&-75,r+=61-t>>>8&-15,r+=62-t>>>8&3,String.fromCharCode(r)},e.prototype._decodeChar=function(t){var r=Ae;return r+=(42-t&t-44)>>>8&-Ae+t-43+62,r+=(46-t&t-48)>>>8&-Ae+t-47+63,r+=(47-t&t-58)>>>8&-Ae+t-48+52,r+=(64-t&t-91)>>>8&-Ae+t-65+0,r+=(96-t&t-123)>>>8&-Ae+t-97+26,r},e.prototype._getPaddingLength=function(t){var r=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)r++;if(t.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},e})();He.Coder=ca;var mn=new ca;function Kx(e){return mn.encode(e)}He.encode=Kx;function Yx(e){return mn.decode(e)}He.decode=Yx;var Nf=(function(e){qx(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},t.prototype._decodeChar=function(r){var n=Ae;return n+=(44-r&r-46)>>>8&-Ae+r-45+62,n+=(94-r&r-96)>>>8&-Ae+r-95+63,n+=(47-r&r-58)>>>8&-Ae+r-48+52,n+=(64-r&r-91)>>>8&-Ae+r-65+0,n+=(96-r&r-123)>>>8&-Ae+r-97+26,n},t})(ca);He.URLSafeCoder=Nf;var Lf=new Nf;function Jx(e){return Lf.encode(e)}He.encodeURLSafe=Jx;function Zx(e){return Lf.decode(e)}He.decodeURLSafe=Zx;He.encodedLength=function(e){return mn.encodedLength(e)};He.maxDecodedLength=function(e){return mn.maxDecodedLength(e)};He.decodedLength=function(e){return mn.decodedLength(e)}});var _f=Er((Df,Ni)=>{"use strict";(function(e,t){var r={};t(r);var n=r.default;for(var i in r)n[i]=r[i];typeof Ni=="object"&&typeof Ni.exports=="object"?Ni.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):e.sha256=n})(Df,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(d,p,h,f,m){for(var g,S,w,y,x,E,N,I,M,C,V,Z,X;m>=64;){for(g=p[0],S=p[1],w=p[2],y=p[3],x=p[4],E=p[5],N=p[6],I=p[7],C=0;C<16;C++)V=f+C*4,d[C]=(h[V]&255)<<24|(h[V+1]&255)<<16|(h[V+2]&255)<<8|h[V+3]&255;for(C=16;C<64;C++)M=d[C-2],Z=(M>>>17|M<<15)^(M>>>19|M<<13)^M>>>10,M=d[C-15],X=(M>>>7|M<<25)^(M>>>18|M<<14)^M>>>3,d[C]=(Z+d[C-7]|0)+(X+d[C-16]|0);for(C=0;C<64;C++)Z=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&E^~x&N)|0)+(I+(t[C]+d[C]|0)|0)|0,X=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&S^g&w^S&w)|0,I=N,N=E,E=x,x=y+Z|0,y=w,w=S,S=g,g=Z+X|0;p[0]+=g,p[1]+=S,p[2]+=w,p[3]+=y,p[4]+=x,p[5]+=E,p[6]+=N,p[7]+=I,f+=64,m-=64}return f}var n=(function(){function d(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var p=0;p<this.buffer.length;p++)this.buffer[p]=0;for(var p=0;p<this.temp.length;p++)this.temp[p]=0;this.reset()},d.prototype.update=function(p,h){if(h===void 0&&(h=p.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this.bytesHashed+=h,this.bufferLength>0){for(;this.bufferLength<64&&h>0;)this.buffer[this.bufferLength++]=p[f++],h--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(h>=64&&(f=r(this.temp,this.state,p,f,h),h%=64);h>0;)this.buffer[this.bufferLength++]=p[f++],h--;return this},d.prototype.finish=function(p){if(!this.finished){var h=this.bytesHashed,f=this.bufferLength,m=h/536870912|0,g=h<<3,S=h%64<56?64:128;this.buffer[f]=128;for(var w=f+1;w<S-8;w++)this.buffer[w]=0;this.buffer[S-8]=m>>>24&255,this.buffer[S-7]=m>>>16&255,this.buffer[S-6]=m>>>8&255,this.buffer[S-5]=m>>>0&255,this.buffer[S-4]=g>>>24&255,this.buffer[S-3]=g>>>16&255,this.buffer[S-2]=g>>>8&255,this.buffer[S-1]=g>>>0&255,r(this.temp,this.state,this.buffer,0,S),this.finished=!0}for(var w=0;w<8;w++)p[w*4+0]=this.state[w]>>>24&255,p[w*4+1]=this.state[w]>>>16&255,p[w*4+2]=this.state[w]>>>8&255,p[w*4+3]=this.state[w]>>>0&255;return this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d.prototype._saveState=function(p){for(var h=0;h<this.state.length;h++)p[h]=this.state[h]},d.prototype._restoreState=function(p,h){for(var f=0;f<this.state.length;f++)this.state[f]=p[f];this.bytesHashed=h,this.finished=!1,this.bufferLength=0},d})();e.Hash=n;var i=(function(){function d(p){this.inner=new n,this.outer=new n,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var h=new Uint8Array(this.blockSize);if(p.length>this.blockSize)new n().update(p).finish(h).clean();else for(var f=0;f<p.length;f++)h[f]=p[f];for(var f=0;f<h.length;f++)h[f]^=54;this.inner.update(h);for(var f=0;f<h.length;f++)h[f]^=106;this.outer.update(h),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var f=0;f<h.length;f++)h[f]=0}return d.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},d.prototype.clean=function(){for(var p=0;p<this.istate.length;p++)this.ostate[p]=this.istate[p]=0;this.inner.clean(),this.outer.clean()},d.prototype.update=function(p){return this.inner.update(p),this},d.prototype.finish=function(p){return this.outer.finished?this.outer.finish(p):(this.inner.finish(p),this.outer.update(p,this.digestLength).finish(p)),this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d})();e.HMAC=i;function o(d){var p=new n().update(d),h=p.digest();return p.clean(),h}e.hash=o,e.default=o;function s(d,p){var h=new i(d).update(p),f=h.digest();return h.clean(),f}e.hmac=s;function a(d,p,h,f){var m=f[0];if(m===0)throw new Error("hkdf: cannot expand more");p.reset(),m>1&&p.update(d),h&&p.update(h),p.update(f),p.finish(d),f[0]++}var l=new Uint8Array(e.digestLength);function u(d,p,h,f){p===void 0&&(p=l),f===void 0&&(f=32);for(var m=new Uint8Array([1]),g=s(p,d),S=new i(g),w=new Uint8Array(S.digestLength),y=w.length,x=new Uint8Array(f),E=0;E<f;E++)y===w.length&&(a(w,S,h,m),y=0),x[E]=w[y++];return S.clean(),w.fill(0),m.fill(0),x}e.hkdf=u;function c(d,p,h,f){for(var m=new i(d),g=m.digestLength,S=new Uint8Array(4),w=new Uint8Array(g),y=new Uint8Array(g),x=new Uint8Array(f),E=0;E*g<f;E++){var N=E+1;S[0]=N>>>24&255,S[1]=N>>>16&255,S[2]=N>>>8&255,S[3]=N>>>0&255,m.reset(),m.update(p),m.update(S),m.finish(y);for(var I=0;I<g;I++)w[I]=y[I];for(var I=2;I<=h;I++){m.reset(),m.update(y).finish(y);for(var M=0;M<g;M++)w[M]^=y[M]}for(var I=0;I<g&&E*g+I<f;I++)x[E*g+I]=w[I]}for(var E=0;E<g;E++)w[E]=y[E]=0;for(var E=0;E<4;E++)S[E]=0;return m.clean(),x}e.pbkdf2=c})});var fa=Er(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.Webhook=Ar.WebhookVerificationError=void 0;var Xx=Of(),Ff=$f(),Qx=_f(),jf=300,da=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},Wt=class e extends da{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};Ar.WebhookVerificationError=Wt;var Li=class e{constructor(t,r){if(!t)throw new Error("Secret can't be empty.");if(r?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,n=>n.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=Ff.decode(t)}}verify(t,r){let n={};for(let p of Object.keys(r))n[p.toLowerCase()]=r[p];let i=n["webhook-id"],o=n["webhook-signature"],s=n["webhook-timestamp"];if(!o||!i||!s)throw new Wt("Missing required headers");let a=this.verifyTimestamp(s),u=this.sign(i,a,t).split(",")[1],c=o.split(" "),d=new globalThis.TextEncoder;for(let p of c){let[h,f]=p.split(",");if(h==="v1"&&(0,Xx.timingSafeEqual)(d.encode(f),d.encode(u)))return JSON.parse(t.toString())}throw new Wt("No matching signature found")}sign(t,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,o=Math.floor(r.getTime()/1e3),s=i.encode(`${t}.${o}.${n}`);return`v1,${Ff.encode(Qx.hmac(this.key,s))}`}verifyTimestamp(t){let r=Math.floor(Date.now()/1e3),n=parseInt(t,10);if(isNaN(n))throw new Wt("Invalid Signature Headers");if(r-n>jf)throw new Wt("Message timestamp too old");if(n>r+jf)throw new Wt("Message timestamp too new");return new Date(n*1e3)}};Ar.Webhook=Li;Li.prefix="whsec_"});var Kp=Er((Ka,qp)=>{"use strict";var{hasOwnProperty:Rn}=Object.prototype,dr=qa();dr.configure=qa;dr.stringify=dr;dr.default=dr;Ka.stringify=dr;Ka.configure=qa;qp.exports=dr;var Tk=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Ht(e){return e.length<5e3&&!Tk.test(e)?`"${e}"`:JSON.stringify(e)}function Ga(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let n=e[r],i=r;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var Mk=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Ha(e){return Mk.call(e)!==void 0&&e.length!==0}function Gp(e,t,r){e.length<r&&(r=e.length);let n=t===","?"":" ",i=`"0":${n}${e[0]}`;for(let o=1;o<r;o++)i+=`${t}"${o}":${n}${e[o]}`;return i}function Ok(e){if(Rn.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 Nk(e){let t;if(Rn.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 Lk(e,t){let r;if(Rn.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function Hp(e,t){let r;if(Rn.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function cr(e){return e===1?"1 item":`${e} items`}function $k(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function Dk(e){if(Rn.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 r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function qa(e){e={...e};let t=Dk(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=Ok(e),n=Lk(e,"bigint"),i=Nk(e),o=typeof i=="function"?i:void 0,s=Hp(e,"maximumDepth"),a=Hp(e,"maximumBreadth");function l(h,f,m,g,S,w){let y=f[h];switch(typeof y=="object"&&y!==null&&typeof y.toJSON=="function"&&(y=y.toJSON(h)),y=g.call(f,h,y),typeof y){case"string":return Ht(y);case"object":{if(y===null)return"null";if(m.indexOf(y)!==-1)return r;let x="",E=",",N=w;if(Array.isArray(y)){if(y.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(y),S!==""&&(w+=S,x+=`
|
|
2
|
+
var ox=Object.create;var Rf=Object.defineProperty;var sx=Object.getOwnPropertyDescriptor;var ax=Object.getOwnPropertyNames;var lx=Object.getPrototypeOf,ux=Object.prototype.hasOwnProperty;var Er=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var cx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ax(t))!ux.call(e,i)&&i!==r&&Rf(e,i,{get:()=>t[i],enumerable:!(n=sx(t,i))||n.enumerable});return e};var Ti=(e,t,r)=>(r=e!=null?ox(lx(e)):{},cx(t||!e||!e.__esModule?Rf(r,"default",{value:e,enumerable:!0}):r,e));var Mf=Er(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.timingSafeEqual=void 0;function Tf(e,t=""){if(!e)throw new Error(t)}function zx(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),Tf(e instanceof DataView),Tf(t instanceof DataView);let r=e.byteLength,n=0,i=-1;for(;++i<r;)n|=e.getUint8(i)^t.getUint8(i);return n===0}Oi.timingSafeEqual=zx});var Lf=Er(He=>{"use strict";var Gx=He&&He.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(He,"__esModule",{value:!0});var Ae=256,ca=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var r="",n=0;n<t.length-2;n+=3){var i=t[n]<<16|t[n+1]<<8|t[n+2];r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),r+=this._encodeByte(i>>>6&63),r+=this._encodeByte(i>>>0&63)}var o=t.length-n;if(o>0){var i=t[n]<<16|(o===2?t[n+1]<<8:0);r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),o===2?r+=this._encodeByte(i>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(t),n=t.length-r,i=new Uint8Array(this.maxDecodedLength(n)),o=0,s=0,a=0,l=0,u=0,c=0,d=0;s<n-4;s+=4)l=this._decodeChar(t.charCodeAt(s+0)),u=this._decodeChar(t.charCodeAt(s+1)),c=this._decodeChar(t.charCodeAt(s+2)),d=this._decodeChar(t.charCodeAt(s+3)),i[o++]=l<<2|u>>>4,i[o++]=u<<4|c>>>2,i[o++]=c<<6|d,a|=l&Ae,a|=u&Ae,a|=c&Ae,a|=d&Ae;if(s<n-1&&(l=this._decodeChar(t.charCodeAt(s)),u=this._decodeChar(t.charCodeAt(s+1)),i[o++]=l<<2|u>>>4,a|=l&Ae,a|=u&Ae),s<n-2&&(c=this._decodeChar(t.charCodeAt(s+2)),i[o++]=u<<4|c>>>2,a|=c&Ae),s<n-3&&(d=this._decodeChar(t.charCodeAt(s+3)),i[o++]=c<<6|d,a|=d&Ae),a!==0)throw new Error("Base64Coder: incorrect characters for decoding");return i},e.prototype._encodeByte=function(t){var r=t;return r+=65,r+=25-t>>>8&6,r+=51-t>>>8&-75,r+=61-t>>>8&-15,r+=62-t>>>8&3,String.fromCharCode(r)},e.prototype._decodeChar=function(t){var r=Ae;return r+=(42-t&t-44)>>>8&-Ae+t-43+62,r+=(46-t&t-48)>>>8&-Ae+t-47+63,r+=(47-t&t-58)>>>8&-Ae+t-48+52,r+=(64-t&t-91)>>>8&-Ae+t-65+0,r+=(96-t&t-123)>>>8&-Ae+t-97+26,r},e.prototype._getPaddingLength=function(t){var r=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)r++;if(t.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},e})();He.Coder=ca;var mn=new ca;function Hx(e){return mn.encode(e)}He.encode=Hx;function qx(e){return mn.decode(e)}He.decode=qx;var Of=(function(e){Gx(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},t.prototype._decodeChar=function(r){var n=Ae;return n+=(44-r&r-46)>>>8&-Ae+r-45+62,n+=(94-r&r-96)>>>8&-Ae+r-95+63,n+=(47-r&r-58)>>>8&-Ae+r-48+52,n+=(64-r&r-91)>>>8&-Ae+r-65+0,n+=(96-r&r-123)>>>8&-Ae+r-97+26,n},t})(ca);He.URLSafeCoder=Of;var Nf=new Of;function Kx(e){return Nf.encode(e)}He.encodeURLSafe=Kx;function Yx(e){return Nf.decode(e)}He.decodeURLSafe=Yx;He.encodedLength=function(e){return mn.encodedLength(e)};He.maxDecodedLength=function(e){return mn.maxDecodedLength(e)};He.decodedLength=function(e){return mn.decodedLength(e)}});var Df=Er(($f,Ni)=>{"use strict";(function(e,t){var r={};t(r);var n=r.default;for(var i in r)n[i]=r[i];typeof Ni=="object"&&typeof Ni.exports=="object"?Ni.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):e.sha256=n})($f,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(d,p,h,f,m){for(var g,S,w,y,x,E,N,I,M,C,V,Z,X;m>=64;){for(g=p[0],S=p[1],w=p[2],y=p[3],x=p[4],E=p[5],N=p[6],I=p[7],C=0;C<16;C++)V=f+C*4,d[C]=(h[V]&255)<<24|(h[V+1]&255)<<16|(h[V+2]&255)<<8|h[V+3]&255;for(C=16;C<64;C++)M=d[C-2],Z=(M>>>17|M<<15)^(M>>>19|M<<13)^M>>>10,M=d[C-15],X=(M>>>7|M<<25)^(M>>>18|M<<14)^M>>>3,d[C]=(Z+d[C-7]|0)+(X+d[C-16]|0);for(C=0;C<64;C++)Z=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&E^~x&N)|0)+(I+(t[C]+d[C]|0)|0)|0,X=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&S^g&w^S&w)|0,I=N,N=E,E=x,x=y+Z|0,y=w,w=S,S=g,g=Z+X|0;p[0]+=g,p[1]+=S,p[2]+=w,p[3]+=y,p[4]+=x,p[5]+=E,p[6]+=N,p[7]+=I,f+=64,m-=64}return f}var n=(function(){function d(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var p=0;p<this.buffer.length;p++)this.buffer[p]=0;for(var p=0;p<this.temp.length;p++)this.temp[p]=0;this.reset()},d.prototype.update=function(p,h){if(h===void 0&&(h=p.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this.bytesHashed+=h,this.bufferLength>0){for(;this.bufferLength<64&&h>0;)this.buffer[this.bufferLength++]=p[f++],h--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(h>=64&&(f=r(this.temp,this.state,p,f,h),h%=64);h>0;)this.buffer[this.bufferLength++]=p[f++],h--;return this},d.prototype.finish=function(p){if(!this.finished){var h=this.bytesHashed,f=this.bufferLength,m=h/536870912|0,g=h<<3,S=h%64<56?64:128;this.buffer[f]=128;for(var w=f+1;w<S-8;w++)this.buffer[w]=0;this.buffer[S-8]=m>>>24&255,this.buffer[S-7]=m>>>16&255,this.buffer[S-6]=m>>>8&255,this.buffer[S-5]=m>>>0&255,this.buffer[S-4]=g>>>24&255,this.buffer[S-3]=g>>>16&255,this.buffer[S-2]=g>>>8&255,this.buffer[S-1]=g>>>0&255,r(this.temp,this.state,this.buffer,0,S),this.finished=!0}for(var w=0;w<8;w++)p[w*4+0]=this.state[w]>>>24&255,p[w*4+1]=this.state[w]>>>16&255,p[w*4+2]=this.state[w]>>>8&255,p[w*4+3]=this.state[w]>>>0&255;return this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d.prototype._saveState=function(p){for(var h=0;h<this.state.length;h++)p[h]=this.state[h]},d.prototype._restoreState=function(p,h){for(var f=0;f<this.state.length;f++)this.state[f]=p[f];this.bytesHashed=h,this.finished=!1,this.bufferLength=0},d})();e.Hash=n;var i=(function(){function d(p){this.inner=new n,this.outer=new n,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var h=new Uint8Array(this.blockSize);if(p.length>this.blockSize)new n().update(p).finish(h).clean();else for(var f=0;f<p.length;f++)h[f]=p[f];for(var f=0;f<h.length;f++)h[f]^=54;this.inner.update(h);for(var f=0;f<h.length;f++)h[f]^=106;this.outer.update(h),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var f=0;f<h.length;f++)h[f]=0}return d.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},d.prototype.clean=function(){for(var p=0;p<this.istate.length;p++)this.ostate[p]=this.istate[p]=0;this.inner.clean(),this.outer.clean()},d.prototype.update=function(p){return this.inner.update(p),this},d.prototype.finish=function(p){return this.outer.finished?this.outer.finish(p):(this.inner.finish(p),this.outer.update(p,this.digestLength).finish(p)),this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d})();e.HMAC=i;function o(d){var p=new n().update(d),h=p.digest();return p.clean(),h}e.hash=o,e.default=o;function s(d,p){var h=new i(d).update(p),f=h.digest();return h.clean(),f}e.hmac=s;function a(d,p,h,f){var m=f[0];if(m===0)throw new Error("hkdf: cannot expand more");p.reset(),m>1&&p.update(d),h&&p.update(h),p.update(f),p.finish(d),f[0]++}var l=new Uint8Array(e.digestLength);function u(d,p,h,f){p===void 0&&(p=l),f===void 0&&(f=32);for(var m=new Uint8Array([1]),g=s(p,d),S=new i(g),w=new Uint8Array(S.digestLength),y=w.length,x=new Uint8Array(f),E=0;E<f;E++)y===w.length&&(a(w,S,h,m),y=0),x[E]=w[y++];return S.clean(),w.fill(0),m.fill(0),x}e.hkdf=u;function c(d,p,h,f){for(var m=new i(d),g=m.digestLength,S=new Uint8Array(4),w=new Uint8Array(g),y=new Uint8Array(g),x=new Uint8Array(f),E=0;E*g<f;E++){var N=E+1;S[0]=N>>>24&255,S[1]=N>>>16&255,S[2]=N>>>8&255,S[3]=N>>>0&255,m.reset(),m.update(p),m.update(S),m.finish(y);for(var I=0;I<g;I++)w[I]=y[I];for(var I=2;I<=h;I++){m.reset(),m.update(y).finish(y);for(var M=0;M<g;M++)w[M]^=y[M]}for(var I=0;I<g&&E*g+I<f;I++)x[E*g+I]=w[I]}for(var E=0;E<g;E++)w[E]=y[E]=0;for(var E=0;E<4;E++)S[E]=0;return m.clean(),x}e.pbkdf2=c})});var fa=Er(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.Webhook=Ar.WebhookVerificationError=void 0;var Jx=Mf(),_f=Lf(),Zx=Df(),Ff=300,da=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},Wt=class e extends da{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};Ar.WebhookVerificationError=Wt;var Li=class e{constructor(t,r){if(!t)throw new Error("Secret can't be empty.");if(r?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,n=>n.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=_f.decode(t)}}verify(t,r){let n={};for(let p of Object.keys(r))n[p.toLowerCase()]=r[p];let i=n["webhook-id"],o=n["webhook-signature"],s=n["webhook-timestamp"];if(!o||!i||!s)throw new Wt("Missing required headers");let a=this.verifyTimestamp(s),u=this.sign(i,a,t).split(",")[1],c=o.split(" "),d=new globalThis.TextEncoder;for(let p of c){let[h,f]=p.split(",");if(h==="v1"&&(0,Jx.timingSafeEqual)(d.encode(f),d.encode(u)))return JSON.parse(t.toString())}throw new Wt("No matching signature found")}sign(t,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,o=Math.floor(r.getTime()/1e3),s=i.encode(`${t}.${o}.${n}`);return`v1,${_f.encode(Zx.hmac(this.key,s))}`}verifyTimestamp(t){let r=Math.floor(Date.now()/1e3),n=parseInt(t,10);if(isNaN(n))throw new Wt("Invalid Signature Headers");if(r-n>Ff)throw new Wt("Message timestamp too old");if(n>r+Ff)throw new Wt("Message timestamp too new");return new Date(n*1e3)}};Ar.Webhook=Li;Li.prefix="whsec_"});var qp=Er((Ka,Hp)=>{"use strict";var{hasOwnProperty:Rn}=Object.prototype,dr=qa();dr.configure=qa;dr.stringify=dr;dr.default=dr;Ka.stringify=dr;Ka.configure=qa;Hp.exports=dr;var Ik=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Ht(e){return e.length<5e3&&!Ik.test(e)?`"${e}"`:JSON.stringify(e)}function Ga(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let n=e[r],i=r;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var Pk=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Ha(e){return Pk.call(e)!==void 0&&e.length!==0}function zp(e,t,r){e.length<r&&(r=e.length);let n=t===","?"":" ",i=`"0":${n}${e[0]}`;for(let o=1;o<r;o++)i+=`${t}"${o}":${n}${e[o]}`;return i}function Tk(e){if(Rn.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 Mk(e){let t;if(Rn.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 Ok(e,t){let r;if(Rn.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function Gp(e,t){let r;if(Rn.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function cr(e){return e===1?"1 item":`${e} items`}function Nk(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function Lk(e){if(Rn.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 r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function qa(e){e={...e};let t=Lk(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=Tk(e),n=Ok(e,"bigint"),i=Mk(e),o=typeof i=="function"?i:void 0,s=Gp(e,"maximumDepth"),a=Gp(e,"maximumBreadth");function l(h,f,m,g,S,w){let y=f[h];switch(typeof y=="object"&&y!==null&&typeof y.toJSON=="function"&&(y=y.toJSON(h)),y=g.call(f,h,y),typeof y){case"string":return Ht(y);case"object":{if(y===null)return"null";if(m.indexOf(y)!==-1)return r;let x="",E=",",N=w;if(Array.isArray(y)){if(y.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(y),S!==""&&(w+=S,x+=`
|
|
3
3
|
${w}`,E=`,
|
|
4
4
|
${w}`);let X=Math.min(y.length,a),F=0;for(;F<X-1;F++){let ft=l(String(F),y,m,g,S,w);x+=ft!==void 0?ft:"null",x+=E}let $e=l(String(F),y,m,g,S,w);if(x+=$e!==void 0?$e:"null",y.length-1>a){let ft=y.length-a-1;x+=`${E}"... ${cr(ft)} not stringified"`}return S!==""&&(x+=`
|
|
5
5
|
${N}`),m.pop(),`[${x}]`}let I=Object.keys(y),M=I.length;if(M===0)return"{}";if(s<m.length+1)return'"[Object]"';let C="",V="";S!==""&&(w+=S,E=`,
|
|
@@ -15,106 +15,106 @@ ${y}`),m.pop(),`{${x}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";
|
|
|
15
15
|
${S}`,V=`,
|
|
16
16
|
${S}`,Z=Math.min(f.length,a),X=0;for(;X<Z-1;X++){let $e=c(String(X),f[X],m,g,S);C+=$e!==void 0?$e:"null",C+=V}let F=c(String(X),f[X],m,g,S);if(C+=F!==void 0?F:"null",f.length-1>a){let $e=f.length-a-1;C+=`${V}"... ${cr($e)} not stringified"`}return C+=`
|
|
17
17
|
${w}`,m.pop(),`[${C}]`}let y=Object.keys(f),x=y.length;if(x===0)return"{}";if(s<m.length+1)return'"[Object]"';S+=g;let E=`,
|
|
18
|
-
${S}`,N="",I="",M=Math.min(x,a);Ha(f)&&(N+=
|
|
18
|
+
${S}`,N="",I="",M=Math.min(x,a);Ha(f)&&(N+=zp(f,E,a),y=y.slice(f.length),M-=f.length,I=E),i&&(y=Ga(y,o)),m.push(f);for(let C=0;C<M;C++){let V=y[C],Z=c(V,f[V],m,g,S);Z!==void 0&&(N+=`${I}${Ht(V)}: ${Z}`,I=E)}if(x>a){let C=x-a;N+=`${I}"...": "${cr(C)} not stringified"`,I=E}return I!==""&&(N=`
|
|
19
19
|
${S}${N}
|
|
20
|
-
${w}`),m.pop(),`{${N}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return t?t(f):void 0}}function d(h,f,m){switch(typeof f){case"string":return Ht(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(h),typeof f!="object")return d(h,f,m);if(f===null)return"null"}if(m.indexOf(f)!==-1)return r;let g="",S=f.length!==void 0;if(S&&Array.isArray(f)){if(f.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(f);let N=Math.min(f.length,a),I=0;for(;I<N-1;I++){let C=d(String(I),f[I],m);g+=C!==void 0?C:"null",g+=","}let M=d(String(I),f[I],m);if(g+=M!==void 0?M:"null",f.length-1>a){let C=f.length-a-1;g+=`,"... ${cr(C)} not stringified"`}return m.pop(),`[${g}]`}let w=Object.keys(f),y=w.length;if(y===0)return"{}";if(s<m.length+1)return'"[Object]"';let x="",E=Math.min(y,a);S&&Ha(f)&&(g+=
|
|
21
|
-
`),t}function Ut(e,t){return fn.join(sa(e),t)}function la(){return fn.join(
|
|
22
|
-
`,{mode:384})}function
|
|
23
|
-
`)}function
|
|
20
|
+
${w}`),m.pop(),`{${N}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return t?t(f):void 0}}function d(h,f,m){switch(typeof f){case"string":return Ht(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(h),typeof f!="object")return d(h,f,m);if(f===null)return"null"}if(m.indexOf(f)!==-1)return r;let g="",S=f.length!==void 0;if(S&&Array.isArray(f)){if(f.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(f);let N=Math.min(f.length,a),I=0;for(;I<N-1;I++){let C=d(String(I),f[I],m);g+=C!==void 0?C:"null",g+=","}let M=d(String(I),f[I],m);if(g+=M!==void 0?M:"null",f.length-1>a){let C=f.length-a-1;g+=`,"... ${cr(C)} not stringified"`}return m.pop(),`[${g}]`}let w=Object.keys(f),y=w.length;if(y===0)return"{}";if(s<m.length+1)return'"[Object]"';let x="",E=Math.min(y,a);S&&Ha(f)&&(g+=zp(f,",",a),w=w.slice(f.length),E-=f.length,x=","),i&&(w=Ga(w,o)),m.push(f);for(let N=0;N<E;N++){let I=w[N],M=d(I,f[I],m);M!==void 0&&(g+=`${x}${Ht(I)}:${M}`,x=",")}if(y>a){let N=y-a;g+=`${x}"...":"${cr(N)} not stringified"`}return m.pop(),`{${g}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return t?t(f):void 0}}function p(h,f,m){if(arguments.length>1){let g="";if(typeof m=="number"?g=" ".repeat(Math.min(m,10)):typeof m=="string"&&(g=m.slice(0,10)),f!=null){if(typeof f=="function")return l("",{"":h},[],f,g,"");if(Array.isArray(f))return u("",h,[],Nk(f),g,"")}if(g.length!==0)return c("",h,[],g,"")}return d("",h,[])}return p}});var cm=Er((NW,Dl)=>{"use strict";var wo=process||{},lm=wo.argv||[],So=wo.env||{},YA=!(So.NO_COLOR||lm.includes("--no-color"))&&(!!So.FORCE_COLOR||lm.includes("--color")||wo.platform==="win32"||(wo.stdout||{}).isTTY&&So.TERM!=="dumb"||!!So.CI),JA=(e,t,r=e)=>n=>{let i=""+n,o=i.indexOf(t,e.length);return~o?e+ZA(i,t,r,o)+t:e+i+t},ZA=(e,t,r,n)=>{let i="",o=0;do i+=e.substring(o,n)+r,o=n+t.length,n=e.indexOf(t,o);while(~n);return i+e.substring(o)},um=(e=YA)=>{let t=e?JA:()=>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")}};Dl.exports=um();Dl.exports.createColors=um});import{execFileSync as dx}from"child_process";import fx from"fs";import Mi from"path";function px(e){let t=mx(e);return t??kf(e)}function kf(e){let t=Mi.dirname(e);return hx(Mi.join(e,".ripplo"))?e:t===e?null:kf(t)}function hx(e){try{return fx.statSync(e).isDirectory()}catch{return!1}}function mx(e){let t=gx(["rev-parse","--show-toplevel"],e);if(t==null)return null;let r=t.trim();return r.length===0?null:Mi.isAbsolute(r)?r:Mi.resolve(e,r)}function gx(e,t){try{return dx("git",e,{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]})}catch{return null}}import yx from"pino";import bx from"pino-pretty";var Se=yx({level:process.env.LOG_LEVEL??"info"},bx({ignore:"pid,hostname"}));import{readdir as Sx,rm as wx,stat as vx}from"fs/promises";import Af from"path";var Ef=Af.join(process.cwd(),".ripplo","debug"),Cf=360*60*1e3;async function xx({maxRuns:e}){try{let r=(await Sx(Ef,{withFileTypes:!0})).filter(u=>u.isDirectory()),n=Date.now(),i=await Promise.all(r.map(async u=>{let c=Af.join(Ef,u.name),d=await vx(c);return{dirPath:c,mtime:d.mtimeMs}})),o=i.filter(u=>n-u.mtime>Cf),a=i.filter(u=>n-u.mtime<=Cf).toSorted((u,c)=>c.mtime-u.mtime).slice(e),l=[...o,...a];if(l.length===0)return;await Promise.allSettled(l.map(u=>wx(u.dirPath,{force:!0,recursive:!0}))),Se.debug("Pruned %d old debug run(s)",l.length)}catch{Se.warn("Debug run pruning failed, ignoring")}}var Cr=class extends Error{detail;serverUrl;constructor({detail:t,serverUrl:r}){super(`Failed to connect to Ripplo server at ${r}. Check the server is running and reachable. Details: ${t}`),this.name="GqlConnectionError",this.detail=t,this.serverUrl=r}},dn=class extends Error{errors;constructor(t){super(t.map(r=>r.message).join(", ")),this.name="GqlRequestError",this.errors=t}};function Rx(e){if(e instanceof dn)return e.errors[0]?.extensions?.code}async function _e(e){let{print:t}=await import("graphql"),r=t(e.document),n=JSON.stringify({query:r,variables:e.variables}),i=`${e.config.ripploServerUrl}/graphql`,o=await kx({init:{body:n,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json"},method:"POST"},serverUrl:e.config.ripploServerUrl,url:i}),s=await Ax({res:o,url:i});if(!Ix(s))throw new Error("Invalid GraphQL response");if(Px(s))throw new dn(s.errors);if(s.data==null)throw new Error("No data returned from server");return s.data}async function kx({init:e,serverUrl:t,url:r}){let n=1,i=await If({init:e,url:r});for(;i.retryable&&n<3;)await Cx(Ex(n)),n+=1,i=await If({init:e,url:r});if(i.response!=null)return i.response;throw new Cr({detail:i.detail,serverUrl:t})}async function If({init:e,url:t}){try{let r=await fetch(t,{...e,signal:AbortSignal.timeout(15e3)});return{detail:"",response:r,retryable:r.status>=500}}catch(r){return{detail:r instanceof Error?r.message:String(r),response:void 0,retryable:!0}}}function Ex(e){return 300*3**(e-1)*(.5+Math.random())}function Cx(e){return new Promise(t=>{setTimeout(t,e)})}async function Ax({res:e,url:t}){let r=await e.text();if(r.length===0)throw new Error(`Empty response from Ripplo server at ${t} (status ${String(e.status)}). The server may have restarted or the request was rejected before a body was sent.`);try{return JSON.parse(r)}catch{throw new Error(`Non-JSON response from Ripplo server at ${t} (status ${String(e.status)}): ${r.slice(0,200)}`)}}function Ix(e){return typeof e=="object"&&e!=null&&("data"in e||"errors"in e)}function Px(e){return Array.isArray(e.errors)&&e.errors.length>0}import{Agent as Tx,RetryAgent as Mx,setGlobalDispatcher as Ox}from"undici";var Nx=1500,Lx=4e3,$x=3,Dx=50,_x=100,Pf=!1;function Fx(){if(Pf)return;Pf=!0;let e=new Tx({connections:_x,keepAliveMaxTimeout:Lx,keepAliveTimeout:Nx}),t=new Mx(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH","UND_ERR_SOCKET"],maxRetries:$x,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:Dx});Ox(t)}import hn from"fs";import lr from"fs";import jx from"os";import fn from"path";var Vx=".local",Bx=".ripplo";function sa(e){return fn.join(e,".ripplo",Vx)}function aa(e){let t=sa(e);lr.existsSync(t)||lr.mkdirSync(t,{recursive:!0});let r=fn.join(t,".gitignore");return lr.existsSync(r)||lr.writeFileSync(r,`*
|
|
21
|
+
`),t}function Ut(e,t){return fn.join(sa(e),t)}function la(){return fn.join(jx.homedir(),Bx)}function pn(){let e=la();return lr.existsSync(e)?lr.chmodSync(e,448):lr.mkdirSync(e,{mode:448,recursive:!0}),e}function ur(e){return fn.join(la(),e)}function ua(){let e=process.env.RIPPLO_TOKEN;if(e!=null&&e.trim().length>0)return e.trim();let t=ur("token");if(!hn.existsSync(t))return null;let r=hn.readFileSync(t,"utf8").trim();return r.length===0?null:r}function Ux(e){pn(),hn.writeFileSync(ur("token"),e+`
|
|
22
|
+
`,{mode:384})}function Wx(){let e=ur("token");return hn.existsSync(e)?(hn.unlinkSync(e),!0):!1}var Vf=Ti(fa(),1);import jf from"crypto";function Xx({body:e,secret:t}){let r=new Vf.Webhook(t),n=`msg_${jf.randomUUID()}`,i=new Date,o=r.sign(n,i,e),s=Math.floor(i.getTime()/1e3);return{"webhook-id":n,"webhook-signature":o,"webhook-timestamp":String(s)}}function Qx(){return`whsec_${jf.randomBytes(24).toString("base64")}`}import Wf from"fs";import ji from"path";import{config as iR}from"dotenv";import{z as _i}from"zod";import{err as oR,ok as zf}from"neverthrow";import Di from"fs";import ma from"path";import{err as pa,ok as Bf}from"neverthrow";import{z as $i}from"zod";var eR=ma.join(".ripplo","project.json"),ha=[".env",".env.local"],tR=$i.object({envFiles:$i.array($i.string().min(1)).optional(),projectId:$i.string().min(1)});function Uf(e){return ma.join(e,eR)}function ga(e){let t=Uf(e);return Di.existsSync(t)?rR(t).andThen(r=>{let n=tR.safeParse(r);return n.success?Bf({envFiles:n.data.envFiles??ha,projectId:n.data.projectId}):pa({issues:n.error.issues.map(i=>`${i.path.join(".")}: ${i.message}`),kind:"project-file-invalid",path:t})}):pa({kind:"project-file-missing",path:t})}function ya(e){return ga(e).match(t=>t,()=>{})}function rR(e){try{return Bf(JSON.parse(Di.readFileSync(e,"utf8")))}catch(t){return pa({issues:[t instanceof Error?t.message:String(t)],kind:"project-file-invalid",path:e})}}function zj({cwd:e,envFiles:t,projectId:r}){let n=Uf(e);Di.mkdirSync(ma.dirname(n),{recursive:!0});let i={projectId:r};t!=null&&!nR(t)&&(i.envFiles=[...t]),Di.writeFileSync(n,JSON.stringify(i,null,2)+`
|
|
23
|
+
`)}function nR(e){return e.length!==ha.length?!1:e.every((t,r)=>t===ha[r])}function Xj(e){let r=ya(e)?.envFiles??[".env",".env.local"],n=ji.join(e,".ripplo");r.forEach(i=>{let o=ji.resolve(n,i);Wf.existsSync(o)&&iR({override:!0,path:o,quiet:!0})}),Fi=void 0}var sR=_i.object({RIPPLO_APP_URL:_i.url(),RIPPLO_ENGINE_URL:_i.url(),RIPPLO_WEBHOOK_SECRET:_i.string().min(1)}),Fi;function Vi(){return Fi!=null?zf(Fi):lR().map(e=>(Fi=e,e))}function aR(e){let r=ya(e)?.envFiles??[],n=ji.join(e,".ripplo");return r.map(i=>ji.resolve(n,i)).filter(i=>!Wf.existsSync(i))}function lR(){let e=sR.safeParse(process.env);if(!e.success)return oR({issues:e.error.issues.map(r=>`${r.path.join(".")}: ${r.message}`),kind:"env-invalid",missingEnvFiles:aR(process.cwd())});let t=e.data;return zf({appUrl:t.RIPPLO_APP_URL,engineUrl:t.RIPPLO_ENGINE_URL,webhookSecret:t.RIPPLO_WEBHOOK_SECRET})}import{z as Bi}from"zod";var uR=Bi.object({__codec:Bi.string().min(1),data:Bi.unknown(),version:Bi.number().int().positive()}),Ui=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}},Wi=class extends Error{constructor(t){super(`Codec mismatch: expected "${t.expected}", got "${t.got}"`),this.name="CodecMismatchError"}};function ba({name:e,schema:t}){return{currentVersion:1,name:e,decode:r=>fR({name:e,raw:r,schema:t}),encode:r=>({__codec:e,data:r,version:1})}}function cR(e,t){return JSON.stringify(e.encode(t))}function dR(e,t){let r=JSON.parse(t);return e.decode(r)}function fR({name:e,raw:t,schema:r}){let n=uR.parse(t);if(n.__codec!==e)throw new Wi({expected:e,got:n.__codec});if(n.version!==1)throw new Ui({codec:e,currentVersion:1,gotVersion:n.version});return r.parse(n.data)}import{z as P}from"zod";import{z as A}from"zod";var Sa=A.enum(["fast","slow","async"]),Ir=A.object({ref:A.string().min(1)}),Ze=A.union([A.string(),A.number(),A.boolean()]),wa=A.object({template:A.array(A.union([A.string(),Ir])).min(1)}),Ue=A.union([Ir,Ze,wa,A.null()]),Gf=A.object({kind:A.literal("changed")}),va=A.union([Ue,Gf]),vt=A.union([A.string(),Ir,wa]),pR=A.object({by:A.literal("role"),name:A.union([vt,A.undefined()]).optional().transform(e=>e),role:A.string().min(1)}),hR=A.object({by:A.literal("testId"),value:vt}),mR=A.object({by:A.literal("inside"),scope:A.lazy(()=>Re),target:A.lazy(()=>Re)}),Re=A.discriminatedUnion("by",[pR,hR,mR]),zi=A.enum(["string","number","boolean"]),xa=A.enum(["strict","eventual"]),gR=A.object({kind:A.literal("string"),maxLength:A.number().int().positive().optional(),minLength:A.number().int().nonnegative().optional(),pattern:A.string().optional()}),yR=A.object({kind:A.literal("number"),max:A.number().int().optional(),min:A.number().int().optional()}),bR=A.object({kind:A.literal("datetime"),maxOffsetDays:A.number().int(),minOffsetDays:A.number().int()}),Hf=A.discriminatedUnion("kind",[gR,yR,bR]),qf=A.enum(["company.name","date.iso","internet.email","internet.url","person.fullName","lorem.slug","lorem.word"]),Ra=A.object({constraints:Hf.optional(),generator:qf,name:A.string().min(1),type:zi,values:A.array(Ze).min(1).optional()}),Kf=A.object({consistency:xa.default("strict"),optional:A.boolean(),stable:A.boolean(),type:zi,valueSpace:A.string().min(1).optional()}),ka=A.enum(["backend","client"]),Ea=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),Kf),source:ka.default("backend")}),Ca=A.object({consistency:xa.default("strict"),default:Ze,description:A.string().optional(),name:A.string().min(1),source:ka.default("backend"),type:zi,valueSpace:A.string().min(1).optional()}),xt=A.enum(["url","title","viewport"]);import{z as T}from"zod";var SR=T.discriminatedUnion("kind",[T.object({as:T.string().min(1),kind:T.literal("created"),props:T.record(T.string().min(1),Ue)}),T.object({as:T.string().min(1),kind:T.literal("updated"),props:T.record(T.string().min(1),va)}),T.object({kind:T.literal("deleted")})]),wR=T.object({kind:T.literal("is"),value:Ue}),Yf=T.lazy(()=>T.union([Ue,xR])),vR=T.object({entity:T.string().min(1),where:T.record(T.string().min(1),Yf)}),xR=T.object({field:T.string().min(1),kind:T.literal("within"),selection:vR}),Rt=T.union([Sa,T.undefined()]).optional().transform(e=>e),zt=T.lazy(()=>T.discriminatedUnion("kind",[T.object({kind:T.literal("visible"),locator:Re,wait:Rt}),T.object({kind:T.literal("disabled"),locator:Re,wait:Rt}),T.object({kind:T.literal("enabled"),locator:Re,wait:Rt}),T.object({kind:T.literal("focused"),locator:Re,wait:Rt}),T.object({kind:T.literal("value"),locator:Re,value:vt,wait:Rt}),T.object({kind:T.literal("text"),locator:Re,value:vt,wait:Rt}),T.object({assertion:wR,kind:T.literal("singleton"),singleton:T.string().min(1),wait:Rt}),T.object({kind:T.literal("browser"),name:xt,value:vt,wait:Rt}),T.object({assertion:SR,entity:T.string().min(1),key:T.record(T.string().min(1),Yf),kind:T.literal("state"),wait:Rt}),T.object({kind:T.literal("not"),predicate:zt}),T.object({kind:T.literal("and"),predicates:T.array(zt)}),T.object({entity:T.string().min(1),kind:T.literal("count"),value:T.number().int().nonnegative()}),T.object({condition:zt,consequence:zt,kind:T.literal("when"),otherwise:T.union([zt,T.undefined()]).optional().transform(e=>e)})]));var Jf=P.discriminatedUnion("kind",[P.object({kind:P.literal("goto"),url:vt}),P.object({kind:P.literal("fill"),locator:Re,value:Ue}),P.object({kind:P.literal("clear"),locator:Re}),P.object({kind:P.literal("click"),locator:Re}),P.object({kind:P.literal("dblclick"),locator:Re}),P.object({kind:P.literal("select"),locator:Re,value:Ue}),P.object({kind:P.literal("check"),locator:Re}),P.object({kind:P.literal("uncheck"),locator:Re}),P.object({kind:P.literal("hover"),locator:Re}),P.object({files:P.array(P.string().min(1)).min(1),kind:P.literal("upload"),locator:Re}),P.object({key:P.string().min(1),kind:P.literal("press"),locator:Re.optional()})]),Zf=P.object({action:Jf,expect:P.array(zt).default([])}),Xf=P.object({example:Ze.optional(),valueSpace:P.string().min(1)}),Aa=P.object({as:P.string().min(1),entity:P.string().min(1),set:P.record(P.string().min(1),Ue)}),Qf=P.object({entity:P.string().min(1),where:P.record(P.string().min(1),Ue)}),Gi=P.object({absent:P.array(Qf).default([]),exclusive:P.array(P.string().min(1)).default([]),intent:P.string().min(1),maybe:P.array(Aa).default([]),name:P.string().min(1),params:P.record(P.string().min(1),Xf),singletons:P.record(P.string().min(1),Ue).default({}),sourcePath:P.string().min(1).optional(),steps:P.array(Zf).default([]),stub:P.boolean().default(!1),world:P.array(Aa).default([])}),ep=P.object({sha256:P.string().regex(/^[0-9a-f]{64}$/u),size:P.number().int().nonnegative()}),Hi=P.object({entities:P.array(Ea),fixtures:P.record(P.string().min(1),ep).default({}),singletons:P.array(Ca).default([]),tests:P.array(Gi),valueSpaces:P.array(Ra)}),RR=ba({name:"ripplo-lockfile",schema:Hi});var qi="__ripplo__",Ia="__ripplo_seed__";import{z as Gt}from"zod";var tp=Gt.object({index:Gt.number().int().nonnegative(),kind:Gt.string(),target:Gt.string(),value:Gt.string()}),kR=Gt.object({steps:Gt.array(tp),stub:Gt.boolean().default(!1)});function gn(e,t){return{index:t,kind:e.action.kind,target:ER(e.action),value:CR(e.action)}}function tt(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,"-").split("-").filter(t=>t.length>0).join("-")}function ER(e){return e.kind==="goto"?Ki(e.url):e.kind==="press"&&e.locator==null?"":Yi(e.locator)}function Ki(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:e.template.map(t=>typeof t=="string"?t:`{${t.ref}}`).join("")}function Yi(e){return e.by==="testId"?`testId=${Ki(e.value)}`:e.by==="inside"?`${Yi(e.scope)} \u25B8 ${Yi(e.target)}`:`${e.role} ${e.name==null?"":Ki(e.name)}`.trim()}function CR(e){return e.kind==="fill"||e.kind==="select"?AR(e.value):e.kind==="press"?e.key:""}function AR(e){return e==null?"":typeof e!="object"?String(e):Ki(e)}import{z as ke}from"zod";var rp=ke.enum(["Strict","Lax","None"]),np=ke.object({domain:ke.string().min(1),expires:ke.number(),httpOnly:ke.boolean(),name:ke.string().min(1),path:ke.string().min(1),sameSite:rp,secure:ke.boolean(),value:ke.string()}),ip=ke.object({localStorage:ke.array(ke.object({name:ke.string().min(1),value:ke.string()})),origin:ke.string().min(1)}),Pa=ke.object({cookies:ke.array(np),headers:ke.record(ke.string().min(1),ke.string()).optional(),origins:ke.array(ip)});import{z as K}from"zod";var Ta=K.union([Ze,K.null()]),Ma=K.record(K.string().min(1),Ta),op=K.object({as:K.string().min(1),entity:K.string().min(1),fields:K.record(K.string().min(1),Ue)}),IR=K.object({entities:K.array(op),runId:K.string().min(1),singletons:K.record(K.string().min(1),Ta).default({})}),sp=K.object({as:K.string().min(1),row:Ma,session:Pa.optional()}),Oa=K.object({rows:K.array(sp)}),PR=K.object({entities:K.array(K.string().min(1)),runId:K.string().min(1),singletons:K.array(K.string().min(1)).default([])}),Na=K.object({entities:K.record(K.string().min(1),K.array(Ma)),singletons:K.record(K.string().min(1),Ta).default({})}),TR=K.object({runId:K.string().min(1)}),La=K.object({ok:K.literal(!0)});import $a from"fs";import Ji from"path";import{createJiti as $R}from"jiti";import{err as Zi,ok as lp}from"neverthrow";import MR from"fs";import yn from"path";import Pr from"typescript";function ap(e){let t=yn.join(e,"index.ts"),r=LR(e);MR.mkdirSync(yn.dirname(r.tsBuildInfoFile??""),{recursive:!0});let n=Pr.createIncrementalCompilerHost(r),i=Pr.createIncrementalProgram({host:n,options:r,rootNames:[t]}),o=[...i.getSyntacticDiagnostics(),...i.getSemanticDiagnostics()];i.emit();let s=o.filter(u=>OR(u,e));if(s.length===0)return{diagnostics:[],ok:!0};let a={getCanonicalFileName:u=>u,getCurrentDirectory:()=>yn.dirname(e),getNewLine:()=>`
|
|
24
24
|
`};return{diagnostics:Pr.formatDiagnosticsWithColorAndContext(s,a).split(`
|
|
25
|
-
`).filter(u=>u.length>0),ok:!1}}function
|
|
26
|
-
`)}function
|
|
27
|
-
`)}function
|
|
28
|
-
`);case"not-ripplo":return`${e.entryPath} must default-export a Ripplo (createRipplo({ entities, invariants, singletons, tests })). Check that the default export is the value returned by createRipplo, not a function or a re-export.`;case"invalid-lockfile":return["Lockfile failed schema validation (stale or hand-edited .ripplo/ripplo.lock?):",...
|
|
25
|
+
`).filter(u=>u.length>0),ok:!1}}function OR(e,t){let r=e.file?.fileName;return r==null?!0:r.startsWith(t)}var NR=yn.join(".local","tsbuildinfo");function LR(e){return{allowImportingTsExtensions:!0,allowJs:!1,esModuleInterop:!0,incremental:!0,module:Pr.ModuleKind.Preserve,moduleResolution:Pr.ModuleResolutionKind.Bundler,noEmit:!0,resolveJsonModule:!0,skipLibCheck:!0,strict:!1,target:Pr.ScriptTarget.ES2022,tsBuildInfoFile:yn.join(e,NR)}}var Xi=".ripplo/ripplo.lock",bn;async function up(e){let{result:t}=await DR(e);return t}async function DR(e){let t=FR(Ji.join(e,".ripplo"));if(bn!=null&&bn.fingerprint===t&&bn.result.isOk())return{fingerprint:t,result:bn.result};let r=await Sn(e);return bn={fingerprint:t,result:r},{fingerprint:t,result:r}}async function Sn(e){let t=Ji.join(e,".ripplo"),r=Ji.join(t,"index.ts"),n=ap(t);return n.ok?(await jR(r)).andThen(o=>BR({entryPath:r,exported:o})):Zi({diagnostics:n.diagnostics,kind:"typecheck-failed"})}var _R=new Set([".local","debug","node_modules"]);function FR(e){return cp(e).toSorted((t,r)=>t.localeCompare(r)).join("|")}function cp(e){return($a.existsSync(e)?$a.readdirSync(e,{withFileTypes:!0}):[]).flatMap(r=>{if(_R.has(r.name))return[];let n=Ji.join(e,r.name);if(r.isDirectory())return cp(n);let i=$a.statSync(n);return[`${n}:${String(i.mtimeMs)}:${String(i.size)}`]})}async function jR(e){try{let r=await $R(import.meta.url,{fsCache:!1,moduleCache:!1,sourceMaps:!0}).import(e),n=r!=null&&typeof r=="object"&&"default"in r?Reflect.get(r,"default"):r;return lp(n)}catch(t){return Zi({kind:"load-threw",message:VR(t)})}}function VR(e){return e instanceof Error?e.message:String(e)}function BR({entryPath:e,exported:t}){if(t==null||typeof t!="object"||!("lockfile"in t))return Zi({entryPath:e,kind:"not-ripplo"});let r=Hi.safeParse(Reflect.get(t,"lockfile"));return r.success?lp(r.data):Zi({issues:r.error.issues.map(n=>`${n.path.join(".")}: ${n.message}`),kind:"invalid-lockfile"})}function Tr(e,t){return t==null?`Load \`/ripplo:${e}\` skill for instructions.`:`Load \`/ripplo:${e}\` skill for instructions on ${t}.`}function UV(e){return e.length===1?Tr(e[0]):`REQUIRED before proceeding: load ${e.map(r=>`\`/ripplo:${r}\``).join(" AND ")} skills (load every one \u2014 each carries rules the others don't).`}function Qi(e){return[`Compilation failed: ${UR(e)}`,Tr("create","DSL authoring + lint rules")].join(`
|
|
26
|
+
`)}function HV(){return`${Xi} is up to date`}function qV(e){return[`${Xi} is ${e==="missing"?"missing":"out of date"} \u2014 run \`ripplo compile\` and commit the result`,Tr("setup")].join(`
|
|
27
|
+
`)}function KV(){return`wrote ${Xi}`}function UR(e){switch(e.kind){case"typecheck-failed":return["TypeScript errors in .ripplo/:",...dp(e.diagnostics)].join(`
|
|
28
|
+
`);case"not-ripplo":return`${e.entryPath} must default-export a Ripplo (createRipplo({ entities, invariants, singletons, tests })). Check that the default export is the value returned by createRipplo, not a function or a re-export.`;case"invalid-lockfile":return["Lockfile failed schema validation (stale or hand-edited .ripplo/ripplo.lock?):",...dp(e.issues),"Regenerate with `npx ripplo compile` \u2014 never hand-edit the lockfile."].join(`
|
|
29
29
|
`);case"load-threw":return[`.ripplo/index.ts threw while loading: ${e.message}`,"Usually a bad import or a top-level throw in .ripplo/ \u2014 run `npx ripplo compile` for the stack."].join(`
|
|
30
|
-
`)}}function
|
|
30
|
+
`)}}function dp(e,t=8){return e.length<=t?e:[...e.slice(0,t),`\u2026 and ${String(e.length-t)} more`]}var eo=class extends Error{failure;constructor(t){super(t.kind),this.name="CliError",this.failure=t}};function eB(e){return e instanceof eo?Da(e.failure):e instanceof Error?e.message:String(e)}function Da(e){switch(e.kind){case"project-file-missing":return[`Missing ${e.path} \u2014 this directory is not a Ripplo project.`,"Run `npx ripplo init` to create it (or cd into the project root).",Tr("setup")].join(`
|
|
31
31
|
`);case"project-file-invalid":return[`${e.path} is invalid:`,...e.issues.map(t=>` ${t}`),"Fix the file by hand or re-run `npx ripplo init`."].join(`
|
|
32
32
|
`);case"not-authenticated":return["Not authenticated. Run `ripplo auth login`.","(Claude Code: run it yourself as a background process \u2014 device-code flow, the user only approves in the browser.)"].join(`
|
|
33
|
-
`);case"env-invalid":return
|
|
33
|
+
`);case"env-invalid":return WR(e);case"playwright-install-failed":return["Playwright browser installation failed (Chromium still missing after install).","Try manually: `npx playwright install chromium` \u2014 look for network/proxy or disk-space errors in its output."].join(`
|
|
34
34
|
`);case"gitdir-unrecognized":return`Unrecognized .git file at ${e.marker} \u2014 expected a directory or a "gitdir:" pointer (worktree). Is the repo corrupted?`;case"gitdir-empty":return`Empty gitdir pointer at ${e.marker} \u2014 the worktree's .git file points nowhere. Re-create the worktree.`;case"oauth-device-code-failed":return[`Could not start sign-in (device-code request failed): ${e.description}`,"Is the Ripplo server reachable? Check RIPPLO_SERVER_URL and retry."].join(`
|
|
35
35
|
`);case"oauth-authorization-failed":return[`Sign-in failed (${e.code}): ${e.description}`,e.code==="expired_token"?"The approval window expired \u2014 run `ripplo auth login` again.":"Run `ripplo auth login` to retry."].join(`
|
|
36
|
-
`);case"compilation-failed":return Qi(e.error)}}function
|
|
37
|
-
`)}import{err as KR,ok as YR}from"neverthrow";import{z as _a}from"zod";var HR="https://ripplo.ai";function hp(){return gp().RIPPLO_SERVER_URL}function mp(){return gp().RIPPLO_PROJECT_ID}var qR=_a.object({RIPPLO_PROJECT_ID:_a.string().min(1).optional(),RIPPLO_SERVER_URL:_a.string().min(1).default(HR)}),pp;function gp(){return pp??=qR.parse(process.env),pp}import yp from"fs";import Fa from"path";function bp(e){let t=yp.realpathSync(e),r=t,n=Fa.dirname(r);for(;n!==r;){if(yp.existsSync(Fa.join(r,".git")))return r;r=n,n=Fa.dirname(r)}return t}function hB(e){return ga(e).andThen(t=>Vi().andThen(r=>{let n=ua();return n==null?KR({kind:"not-authenticated"}):YR({appUrl:r.appUrl,cwd:bp(e),engineUrl:r.engineUrl,projectId:mp()??t.projectId,ripploServerUrl:hp(),token:n,webhookSecret:r.webhookSecret})}))}import Sp from"fs";import{checkSync as JR,lockSync as ZR}from"proper-lockfile";var XR="dev.pid",wp=15e3;function vp(e){return Ut(e,XR)}function xp(e){try{return JR(vp(e),{realpath:!1,stale:wp})}catch{return!1}}var ja=class extends Error{pid;cwd;constructor({cwd:t,pid:r}){super("dev-lock-held"),this.name="DevLockHeldError",this.pid=r,this.cwd=t}};function SB({cwd:e,onCompromised:t}){aa(e);let r=vp(e),n=QR({cwd:e,onCompromised:t,path:r});return Sp.writeFileSync(r,String(process.pid)),()=>{try{n()}catch{}}}function QR({cwd:e,onCompromised:t,path:r}){try{return ZR(r,{realpath:!1,stale:wp,onCompromised:()=>{t()}})}catch(n){throw ek(n)?new ja({cwd:e,pid:tk(r)}):n}}function ek(e){if(!(e instanceof Error)||!("code"in e))return!1;let{code:t}=e;return t==="ELOCKED"}function tk(e){try{let t=Sp.readFileSync(e,"utf8").trim(),r=Number.parseInt(t,10);return Number.isFinite(r)&&r>0?r:null}catch{return null}}import{createServer as ak}from"http";import{mkdir as lk,rm as uk,writeFile as ck}from"fs/promises";import dk from"path";import{z as ee}from"zod";import rk from"path";import{z as wn}from"zod";var nk=["unspecified","internal","server","client","producer","consumer"],ik=["unset","ok","error"];function Rp(e){return nk[e]??"unspecified"}function kp(e){return ik[e]??"unset"}var RB=wn.looseObject({data:wn.looseObject({source:wn.number().optional()}).optional(),timestamp:wn.number(),type:wn.number()});function Ep({debugDir:e,runId:t,worker:r}){let n=rk.join(e,t,"behavior.jsonl");return r.open({file:n,runId:t}),{close:i=>r.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(ok(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:sk(i.timeNanos)};r.line({line:JSON.stringify(o),runId:t,timeNanos:i.timeNanos})},emitRrwebBatch:i=>{r.rrwebBatch({data:i,runId:t})}}}function Mr(e){return String(BigInt(Math.round(e))*1000000n)}function ok(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function sk(e){return Number(BigInt(e)/1000000n)}var fk="otlp-port",Ap=ee.object({key:ee.string(),value:ee.object({boolValue:ee.boolean().optional(),doubleValue:ee.number().optional(),intValue:ee.union([ee.string(),ee.number()]).optional(),stringValue:ee.string().optional()})}),pk=ee.object({attributes:ee.array(Ap).default([]),endTimeUnixNano:ee.string(),kind:ee.number().default(0),name:ee.string(),parentSpanId:ee.string().optional(),spanId:ee.string(),startTimeUnixNano:ee.string(),status:ee.object({code:ee.number(),message:ee.string().optional()}).optional(),traceId:ee.string()}),hk=ee.object({resourceSpans:ee.array(ee.object({resource:ee.object({attributes:ee.array(Ap).default([])}).optional(),scopeSpans:ee.array(ee.object({spans:ee.array(pk).default([])})).default([])})).default([])});async function Va({localDir:e,onRrwebBatch:t,onSpan:r,writePortFile:n}){let{port:i,server:o}=await mk({onRrwebBatch:t,onSpan:r}),s=dk.join(e,fk);return n&&(await lk(e,{recursive:!0}),await ck(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{n&&await uk(s,{force:!0}),await wk(o)}}}function mk(e){return new Promise((t,r)=>{let n=ak((i,o)=>{gk(i,o,e)});n.on("error",r),n.listen(0,()=>{let i=n.address();if(i==null||typeof i=="string"){r(new Error("otlp_receiver_no_port"));return}t({port:i.port,server:n})})})}function gk(e,t,r){let n=yk(e.url);if(n!=null){Cp(e).then(i=>{r.onRrwebBatch(n,i),to(t)}).catch(()=>{to(t)});return}Cp(e).then(i=>{bk(hk.parse(JSON.parse(i.toString("utf8"))),r.onSpan),to(t)}).catch(()=>{to(t)})}function yk(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function Cp(e){return new Promise((t,r)=>{let n=[];e.on("data",i=>{n.push(i)}),e.on("end",()=>{t(Buffer.concat(n))}),e.on("error",r)})}function to(e){e.writeHead(200,{"content-type":"application/json"}),e.end("{}")}function bk(e,t){e.resourceSpans.flatMap(r=>r.scopeSpans).flatMap(r=>r.spans).forEach(r=>{t({attributes:Sk(r.attributes),durationMs:Number((BigInt(r.endTimeUnixNano)-BigInt(r.startTimeUnixNano))/1000000n),kind:"span",name:r.name,parentSpanId:r.parentSpanId,source:"server",spanId:r.spanId,spanKind:Rp(r.kind),status:{code:kp(r.status?.code??0),message:r.status?.message},timeNanos:r.startTimeUnixNano,traceId:r.traceId})})}function Sk(e){return Object.fromEntries(e.map(({key:t,value:r})=>[t,String(r.stringValue??r.intValue??r.doubleValue??r.boolValue??"")]))}function wk(e){return new Promise((t,r)=>{e.close(n=>{if(n==null){t();return}r(n)}),e.closeAllConnections()})}function kt(e){let t=new URL(e,"https://ripplo.invalid"),r=[...t.searchParams.entries()].toSorted(([n],[i])=>n.localeCompare(i)).map(([n,i])=>`${n}=${i}`).join("&");return r.length===0?t.pathname:`${t.pathname}?${r}`}function Or(e,t){return e==="url"?kt(t):t}function Ba(e,t,r){return Or(e,String(t))===Or(e,String(r))}function Pp(e,t,r){return e!=="url"?Ba(e,t,r):Ip(String(t))===Ip(String(r))}function Ip(e){return new URL(e,"https://ripplo.invalid").pathname}function Ua({actual:e,canon:t,pre:r,predicted:n}){return[...[...new Set([...n.entities.keys(),...e.entities.keys()])].flatMap(s=>vk({actual:e.entities.get(s),canon:t,entity:s,pre:r.entities.get(s),predicted:n.entities.get(s)})),...Rk(r.singletons,n.singletons,e.singletons)]}function vk({actual:e,canon:t,entity:r,pre:n,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>xk({actual:e?.get(s),canon:t,entity:r,key:s,predicted:i?.get(s),preHadKey:n?.has(s)??!1,preRow:n?.get(s)}))}function xk({actual:e,canon:t,entity:r,key:n,predicted:i,preHadKey:o,preRow:s}){if(i==null)return[{divergence:{entity:r,key:n,kind:"ghost-write"},pending:o}];if(e==null)return[{divergence:{entity:r,key:n,kind:"absent"},pending:!o}];let a=(u,c,d)=>Op(t(r,u,c),t(r,u,d));return[...new Set([...Object.keys(i),...Object.keys(e)])].filter(u=>!a(u,i[u],e[u])).map(u=>({divergence:{entity:r,field:u,key:n,kind:"field-mismatch",snapshot:i[u],sut:e[u]},pending:s==null?e[u]===void 0:a(u,s[u],e[u])}))}function Op(e,t){return Tp(e)===Tp(t)}function Tp(e){return e==null?"\u2205":JSON.stringify(e)}function Rk(e,t,r){return[...new Set([...Object.keys(t),...Object.keys(r)])].flatMap(i=>{let o=t[i],s=r[i];return o===void 0||s===void 0||Mp(i,o,s)?[]:[{divergence:{kind:"singleton-mismatch",singleton:i,snapshot:o,sut:s},pending:e[i]!==void 0&&Mp(i,e[i],s)}]})}function Mp(e,t,r){let n=xt.safeParse(e);return n.success?Pp(n.data,t,r):Op(t,r)}function Wa(e){let t=kk(e.entities),r=Ek(e.singletons);return n=>Ck(n,t,r)}function kk(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([r,n])=>[Np(t.name,r),n.consistency])))}function Np(e,t){return`${e}.${t}`}function Ek(e){return new Map(e.map(t=>[t.name,t.consistency]))}function Ck(e,t,r){return e.kind==="singleton-mismatch"?Ak(e.singleton,r):e.kind==="ghost-write"||e.kind==="absent"?"strict":t.get(Np(e.entity,e.field))??"strict"}function Ak(e,t){return xt.safeParse(e).success?t.get(e)??"eventual":t.get(e)??"strict"}function za(e){let t=new Set(e.valueSpaces.filter(r=>r.generator==="date.iso").map(r=>r.name));return(r,n,i)=>{if(!t.has(`${r}.${n}`)||typeof i!="string")return i;let o=Date.parse(i);return Number.isNaN(o)?i:new Date(o).toISOString()}}function $p(e,t,r){return{detail:r.slice(0,500),kind:"engine-http",path:e,status:t}}function ro(e,t){return{code:zp(t),kind:"engine-network",message:xn(t),path:e}}function Dp(e){return{kind:"client-mount-missing",mountKey:e}}function _p(e,t){return{kind:"engine-decode",message:xn(t),path:e}}function Fp(e,t){return{entity:e,field:t,kind:"state-identity"}}function jp(e){return{as:e,kind:"setup-missing-row"}}function vn(e){return{kind:"driver-launch",message:xn(e)}}function Vp(e,t){return{action:e,kind:"action-failed",message:xn(t)}}function Bp(e){return{kind:"check-failed",message:xn(e)}}function Up(){return{kind:"aborted"}}var Lp=300;function Et(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${Ik(e.detail)}${Pk(e.status)}`;case"engine-network":return`engine ${e.path} request failed: ${e.message}`;case"client-mount-missing":return`client bridge "${e.mountKey}" never mounted; client singletons unreadable`;case"engine-decode":return`engine ${e.path} response did not match schema: ${e.message}`;case"state-identity":return`row of "${e.entity}" is missing identity field "${e.field}"`;case"setup-missing-row":return`setup returned no row for "${e.as}"`;case"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 Wp(e){throw new Error(Et(e))}function no(){}function Ik(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=Lp?t:`${t.slice(0,Lp)}\u2026 [truncated]`}function Pk(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 zp(e){if(!(typeof e!="object"||e==null))return"code"in e&&typeof e.code=="string"?e.code:"cause"in e?zp(e.cause):void 0}function xn(e){return e instanceof Error?e.message:String(e)}var Ya=Ti(Kp(),1),jB=Ya.default.configure,io=Ya.default;function J(e){return io(e)??""}function Ct(e,t){return[...new Map(e.map(r=>[t(r),r])).values()]}function Ja(e){return Ct(e,J)}function Yp(e){return J(e)}var kn=class extends Error{name="AbortError";constructor(){super("aborted")}};function Jp(e){return e instanceof Error&&e.name==="AbortError"}function qt(e){if(e.aborted)throw new kn}function Za(e,t){return t.aborted?Promise.reject(new kn):new Promise((r,n)=>{let i=()=>{clearTimeout(o),n(new kn)},o=setTimeout(()=>{t.removeEventListener("abort",i),r()},e);t.addEventListener("abort",i,{once:!0})})}function rh(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var _k=()=>[];async function Qa({canon:e,classify:t,initialSnapshot:r,lawObligations:n,observe:i,onAssertion:o,onStep:s,steps:a},l){return nh({acc:[],canon:e,classify:t,index:0,lawObligations:n??_k,observe:i,onAssertion:o,onStep:s,signal:l,snapshot:r,steps:a})}async function nh({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,steps:c}){qt(l);let d=c[n];if(d==null)return{finalModel:u,findings:e};let p=Date.now();if(!d.guard(u)){let h={kind:"illegal-transition",step:d.step};return Xa(a,{endMs:Date.now(),findings:[h],index:n,startMs:p}),{finalModel:u,findings:[...e,h]}}return d.perform().match(()=>Fk({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,startMs:p,step:d,steps:c}),h=>{let f=oo(h,d);return Xa(a,{endMs:Date.now(),findings:[f],index:n,startMs:p}),Promise.resolve({finalModel:u,findings:[...e,f]})})}async function Fk({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,startMs:c,step:d,steps:p}){let h=d.effect(u),f=await Gk({canon:t,classify:r,observe:o,pre:u,predicted:h,signal:l,step:d}),m=[...d.obligations,...i(u,f.snapshot)],g=[...await jk({obligations:m,onAssertion:s,signal:l,step:d}),...f.findings];return Xa(a,{endMs:Date.now(),findings:g,index:n,startMs:c}),nh({acc:[...e,...g],canon:t,classify:r,index:n+1,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:f.snapshot,steps:p})}async function jk({obligations:e,onAssertion:t,signal:r,step:n}){let i=[...new Map(e.map(s=>[Yp(s.source),s])).values()],o=await Promise.all(i.map(async s=>({obligation:s,outcome:await Vk(s,r)})));return o.forEach(s=>{Bk(t,s.obligation,s.outcome,n)}),o.flatMap(s=>Wk(s.obligation,s.outcome,n))}function Vk(e,t){if(e.check.kind==="decided"){let r=e.check.passed?"passed":"failed";return Promise.resolve({kind:r})}return Hk(e.budget,e.check.run,t)}function Bk(e,t,r,n){e?.({outcome:Uk(r),source:t.source,step:n.step})}function Uk(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function Wk(e,t,r){return t.kind==="error"?[oo(t.error,r)]:t.kind==="failed"?[{budget:e.budget,kind:"obligation",source:e.source,step:r.step}]:[]}function oo(e,t){return{error:e,kind:"driver-error",step:t.step}}function Xa(e,t){e?.(t)}var En={async:12e4,fast:5e3,slow:3e4},ih={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:En.async},fast:{backoffMs:[100,250,500,1e3],timeoutMs:En.fast},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:En.slow}};function oh(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function Zp(e){return e().match(t=>({observed:t,ok:!0}),t=>({error:t,ok:!1}))}function zk(e,t,r){return r.reconcile==null?e:r.reconcile(e,t)}function Xp({canon:e,pre:t,predicted:r,step:n},i){let o=n.verifyChanges==null?[]:n.verifyChanges(r,i),s=zk(r,i,n),a=o.map(l=>({divergence:l,pending:!0}));return{adopted:s,probed:[...a,...Ua({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function sh(e,t){return{budget:t.settle,divergence:e.divergence,kind:"consistency",pending:e.pending,step:t.step}}function Qp(e,t,r){let n=e.probed.filter(i=>!i.pending&&r(i.divergence)==="strict");return n.length>0?{findings:n.map(i=>sh(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function eh(e,t,r){return{findings:[...e.probed.map(n=>sh(n,t)),...r],snapshot:e.adopted}}async function Gk({canon:e,classify:t,observe:r,pre:n,predicted:i,signal:o,step:s}){let a=ih[s.settle],l=Date.now()+a.timeoutMs,u=await Zp(r);if(!u.ok)return{findings:[oo(u.error,s)],snapshot:i};let c=Xp({canon:e,pre:n,predicted:i,step:s},u.observed),d=0;for(;Date.now()<l;){qt(o);let p=Qp(c,s,t);if(p!=null)return p;await Za(oh(a,d),o),d+=1;let h=await Zp(r);if(!h.ok)return eh(c,s,[oo(h.error,s)]);c=Xp({canon:e,pre:n,predicted:i,step:s},h.observed)}return Qp(c,s,t)??eh(c,s,[])}async function Hk(e,t,r){let n=ih[e],i=Date.now()+n.timeoutMs,o=await th(t),s=0;for(;o.kind==="pending"&&Date.now()<i;)qt(r),await Za(oh(n,s),r),s+=1,o=await th(t);return o.kind==="pending"?{kind:"failed"}:o}function th(e){return e().match(t=>t?{kind:"passed"}:{kind:"pending"},t=>({error:t,kind:"error"}))}import{z as qk}from"zod";var tl=qk.string().brand(),se=tl.parse("");function At(e){return tl.parse(e)}function ht(e,t){return tl.parse(e.length===0?t:`${e}.${t}`)}function Ne(e){return Ir.safeParse(e).success}function It(e){return typeof e=="object"&&e!==null&&"template"in e}function el(e,t,r){let n=ht(t,e.ref);if(!r.has(n))throw new Error(`unresolved binding ref "${n}"`);return r.get(n)??null}function so(e,t,r){return Kk(e).every(n=>r.has(ht(t,n)))}function rt(e,t,r){return typeof e=="string"?e:Ne(e)?String(el(e,t,r)):e.template.map(n=>typeof n=="string"?n:String(el(n,t,r))).join("")}function nt(e,t,r){return e===null||typeof e=="number"||typeof e=="boolean"?e:Ne(e)?el(e,t,r):rt(e,t,r)}function ah(e,t){return nt(e,se,t)}function Cn(e){return io(e)}function Nr(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,nt(i,t,r)]))}function Kk(e){return e==null||typeof e!="object"?[]:It(e)?e.template.flatMap(t=>typeof t=="string"?[]:[t.ref]):[e.ref]}function Kt(e){return typeof e=="object"&&e!==null&&"kind"in e}function fr(e){return Object.fromEntries(Object.entries(e).filter(t=>!Kt(t[1])))}function lh(e,t,r){return t.reduce((n,i)=>Yk(n,i,r,e),e)}function uh(e,t){return Object.keys(t).length===0?e:{...e,singletons:{...e.singletons,...t}}}function Yk(e,t,r,n){if(!Jk(t,r))return e;if(t.assertion.kind==="created"){let o=Nr(t.assertion.props,se,r);return Zk(e,t.entity,Cn(o),o)}if(t.assertion.kind==="deleted")return rl(e,t.entity,tE(t.key,r,n));let i=Nr(fr(t.assertion.props),se,r);return rl(e,t.entity,rE(t.key,i,r,n))}function Jk(e,t){return("props"in e.assertion?[e.key,fr(e.assertion.props)]:[e.key]).every(n=>Object.values(n).every(i=>fh(i)||!Ne(i)||t.has(At(i.ref))))}function Zk(e,t,r,n){let i=new Map([...e.entities.get(t)??[],[r,n]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function rl(e,t,r){let n=r(e.entities.get(t)??new Map);return{...e,entities:new Map([...e.entities,[t,n]])}}function An(e,t,r,n){let i={env:n,key:r,snapshot:e};return[...(e.entities.get(t)??new Map).values()].filter(o=>lo(o,i))}function ch(e,t,r,n,i){let o={env:n,key:r,snapshot:e};return rl(e,t,s=>new Map([...s].map(([a,l])=>[a,lo(l,o)?i(l):l])))}function lo(e,t){return Object.entries(t.key).every(([r,n])=>dh(e[r],n,t))}function dh(e,t,r){return fh(t)?Xk(t,r).has(ao(e)):ao(e)===ao(eE(t,r.env))}function fh(e){return typeof e=="object"&&e!==null&&"kind"in e}function Xk(e,t){let r=t.snapshot.entities.get(e.selection.entity);return r==null?new Set:new Set([...r.values()].filter(n=>Qk(n,e.selection.where,t)).map(n=>ao(n[e.field])))}function Qk(e,t,r){return Object.entries(t).every(([n,i])=>dh(e[n],i,r))}function ao(e){return e==null?"\u2205":e instanceof Date?e.toISOString():JSON.stringify(e)}function eE(e,t){return nt(e,se,t)}function tE(e,t,r){let n={env:t,key:e,snapshot:r};return i=>new Map([...i].filter(([,o])=>!lo(o,n)))}function rE(e,t,r,n){let i={env:r,key:e,snapshot:n};return o=>new Map([...o].map(([s,a])=>lo(a,i)?[s,{...a,...t}]:[s,a]))}function mh(e){let t=e.predicates.filter(o=>Sh(o)),r=t.filter(o=>o.assertion.kind==="created"),n=bh(t);if(r.length===0&&n.length===0&&e.deferred.length===0&&e.adopt.length===0)return;let i=t.filter(o=>o.assertion.kind==="updated");return(o,s)=>{let a=r.reduce((c,d)=>uE(c,s,d,e.env),{env:e.env,snapshot:o}),l=n.reduce((c,d)=>lE(c,s,d,e.env),a.snapshot),u=i.reduce((c,d)=>iE(c,s,d),a.env);return nE(dE(l,e.deferred,u),s,e.adopt)}}function nE(e,t,r){if(r.length===0)return e;let n=r.reduce((i,o)=>{let s=t.snapshot.singletons[o];return s===void 0?i:{...i,[o]:s}},e.singletons);return{...e,singletons:n}}function gh(e,t,r){return new Map([...e,...Object.entries(r).map(([n,i])=>[ht(se,`${t}.${n}`),i])])}function iE(e,t,r){let n=An(t.snapshot,r.entity,r.key,e).at(0);return n==null?e:gh(e,r.assertion.as,n)}function yh(e){let t=bh(e.predicates.filter(r=>Sh(r)));if(t.length!==0)return(r,n)=>t.flatMap(i=>oE(i,r,n,e.env))}function bh(e){return e.filter(t=>t.assertion.kind==="updated"&&nl(t.assertion.props).length>0)}function nl(e){return Object.entries(e).filter(([,t])=>Kt(t)).map(([t])=>t)}function Sh(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function oE(e,t,r,n){let i=An(t,e.entity,e.key,n).at(0),o=An(r.snapshot,e.entity,e.key,n).at(0);if(i==null||o==null)return[];let s=Cn(sE(e.key,n));return nl(e.assertion.props).flatMap(a=>ph(i[a])===ph(o[a])?[{entity:e.entity,field:a,key:s,kind:"expected-change",value:o[a]}]:[])}function sE(e,t){let r=Object.fromEntries(Object.entries(e).filter(n=>!aE(n[1])));return Nr(r,se,t)}function aE(e){return typeof e=="object"&&e!==null&&"kind"in e}function ph(e){return e==null?"\u2205":JSON.stringify(e)}function lE(e,t,r,n){let i=nl(r.assertion.props),o=An(t.snapshot,r.entity,r.key,n).at(0);return o==null?e:ch(e,r.entity,r.key,n,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function uE(e,t,r,n){if(r.assertion.kind!=="created")return e;let i=Nr(r.assertion.props,se,n),o=Cn(i),s=e.snapshot.entities.get(r.entity);if(s==null||!s.has(o))return e;let a=cE(t.snapshot.entities.get(r.entity),s,i);if(a==null)return e;let[l,u]=a,c=new Map(s);return c.delete(o),c.set(l,u),{env:gh(e.env,r.assertion.as,u),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(r.entity,c)}}}function cE(e,t,r){if(e!=null)return[...e].find(([n,i])=>!t.has(n)&&Object.entries(r).every(([o,s])=>hh(i[o])===hh(s)))}function hh(e){return e==null?"\u2205":JSON.stringify(e)}function dE(e,t,r){let n=t.reduce((i,o)=>{let s=fE(o.value,r);return s==null?i:{...i,[o.name]:Or(o.name,s)}},e.singletons);return{...e,singletons:n}}function fE(e,t){try{return rt(e,se,t)}catch{return}}function uo(e,t){if(e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused")return{kind:e.kind,locator:In(e.locator,t)};if(e.kind==="not"){let r=uo(e.predicate,t);return r==null?null:{inner:r,kind:"not"}}return e.kind==="value"||e.kind==="text"?{kind:e.kind,locator:In(e.locator,t),value:rt(e.value,se,t)}:e.kind!=="browser"?null:{kind:"browser",name:e.name,value:rt(e.value,se,t)}}function Pn(e,t){let r=e.expect.filter(l=>l.kind==="state"),n=SE(r),{adopt:i,conditional:o,deferred:s,immediate:a}=mE(e,t,n);return{action:wE(e.action,t),label:e.action.kind,obligations:e.expect.flatMap(l=>xE(l,t)),reconcile:mh({adopt:i,deferred:s,env:t,predicates:r}),verifyChanges:yh({adopt:i,deferred:s,env:t,predicates:r}),effect:l=>{let u=lh(l,r,t),c=o.reduce((d,p)=>({...d,...il(p,u,t)}),{});return uh(u,{...a,...c})}}}function In(e,t){return e.by==="role"?{by:"role",name:e.name==null?void 0:rt(e.name,se,t),role:e.role}:e.by==="inside"?{by:"inside",scope:In(e.scope,t),target:In(e.target,t)}:{by:"testId",value:rt(e.value,se,t)}}function il(e,t,r){return e==null?{}:e.kind==="when"?ol(e.condition,t,r)?il(e.consequence,t,r):il(e.otherwise,t,r):hE(e,r)}function ol(e,t,r){if(!pE(e))throw new Error(`when() condition cannot be a "${e.kind}" predicate`);switch(e.kind){case"singleton":return t.singletons[e.singleton]===nt(e.assertion.value,se,r);case"count":return(t.entities.get(e.entity)?.size??0)===e.value;case"not":return!ol(e.predicate,t,r);case"and":return e.predicates.every(n=>ol(n,t,r))}}function pE(e){return e.kind==="singleton"||e.kind==="count"||e.kind==="not"||e.kind==="and"}function hE(e,t){if(e.kind!=="browser"&&e.kind!=="singleton")return{};let r=e.kind==="browser"?e.value:e.assertion.value;return so(r,se,t)?wh(e,t):{}}function mE(e,t,r){let n=e.action.kind==="goto"&&!e.expect.some(s=>s.kind==="browser"&&s.name==="url"),i=e.action.kind==="goto"&&!n?{url:kt(rt(e.action.url,se,t))}:{},o=n?["url"]:[];return e.expect.reduce((s,a)=>a.kind==="browser"&&gE(a.value,r)?{...s,deferred:[...s.deferred,{name:a.name,value:a.value}]}:a.kind==="browser"||a.kind==="singleton"?{...s,immediate:{...s.immediate,...wh(a,t)}}:a.kind==="when"?{...s,conditional:[...s.conditional,a]}:s,{adopt:o,conditional:[],deferred:[],immediate:i})}function gE(e,t){return yE(e).some(r=>t.has(r.split(".")[0]??r))}function yE(e){return typeof e=="string"?[]:Ne(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function wh(e,t){if(e.kind==="browser")return{[e.name]:bE(e,t)};if(e.kind==="singleton")return{[e.singleton]:nt(e.assertion.value,se,t)};throw new Error("when() consequence must be a url (browser) or singleton assertion")}function bE(e,t){return Or(e.name,rt(e.value,se,t))}function SE(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function wE(e,t){return{files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:vE(e,t),url:e.kind==="goto"?rt(e.url,se,t):void 0,value:"value"in e?ah(e.value,t):void 0}}function vE(e,t){if(!(!("locator"in e)||e.locator==null))return In(e.locator,t)}function xE(e,t){if(e.kind==="browser"||e.kind==="singleton")return[];let r=uo(e,t),n="wait"in e?e.wait??"fast":"fast";return r==null?[]:[{budget:n,check:r}]}import{err as RE,ok as kE,okAsync as EE,Result as CE}from"neverthrow";function Tn(e,t,r){let n=e.tests.find(a=>a.name===t);if(n==null)throw new Error(`test "${t}" not found in lockfile`);let i=OE(e),o={env:new Map,generate:r.generate,indexed:i,overrides:new Map(Object.entries(r.params??{}).map(([a,l])=>[At(a),l]))};NE(n.params,se,o);let s=n.world.map(a=>LE(a,se,o));return r.materialize(s).map(a=>AE(FE(a,o.env,i),n,e))}function sl(e,t){let r=new Map(t.map(n=>[n.name,n]));return n=>EE(PE(n,e,r).rows)}function al(e){return t=>{let r=t.map(n=>({as:n.as,entity:n.entity,fields:n.fields}));return e(r).andThen(n=>IE(t,n))}}function vh(e,t){let r=co(t);return Object.fromEntries(Object.entries(e).filter(([n,i])=>r.includes(n)&&i!=null))}function co(e){return Object.entries(e.props).filter(([,t])=>t.stable).map(([t])=>t)}function AE(e,t,r){let n=Object.fromEntries(r.singletons.map(l=>[l.name,l.default])),i=Object.fromEntries(Object.entries(t.singletons).map(([l,u])=>[l,nt(u,se,e.env)])),o={...n,...i},s=new Set(r.singletons.filter(l=>l.source==="client").map(l=>l.name)),a=Object.fromEntries(Object.entries(o).filter(([l])=>s.has(l)));return{...e,clientState:a,snapshot:{...e.snapshot,singletons:o}}}function IE(e,t){let r=new Map(t.map(n=>[n.as,n]));return CE.combine(e.map(n=>{let i=r.get(n.as);return i==null?RE(jp(n.as)):kE({as:n.as,entity:n.entity,row:i.row,session:i.session})}))}function PE(e,t,r){return e.reduce((n,i)=>{let o=TE(i.fields,n.env),s=VE({generate:t,model:i.model,seedPrefix:i.seedPrefix,set:o,valueSpaces:r}),a=Object.entries(s).map(([l,u])=>[`${i.as}.${l}`,u]);return{env:new Map([...n.env,...a]),rows:[...n.rows,{as:i.as,entity:i.entity,row:s,session:void 0}]}},{env:new Map,rows:[]})}function TE(e,t){return Object.fromEntries(Object.entries(e).map(([r,n])=>{if(Ne(n))return[r,ME(t,n.ref)];if(It(n))throw new Error(`template value not allowed in entity field "${r}"`);return[r,n]}))}function ME(e,t){let r=e.get(t);if(r==null)throw new Error(`setup ref "${t}" was not produced by an earlier entity`);return r}function OE(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function NE(e,t,r){Object.entries(e).forEach(([n,i])=>{let o=ht(t,n),s=r.indexed.valueSpaces.get(i.valueSpace);if(s==null)throw new Error(`unknown valueSpace "${i.valueSpace}" for param "${o}"`);let a=r.overrides.get(o)??i.example??r.generate.value({anchor:void 0,constraints:s.constraints,generator:s.generator,nullable:!1,seed:o,type:s.type,values:s.values,valueSpace:i.valueSpace});r.env.set(o,a)})}function LE(e,t,r){let n=r.indexed.models.get(e.entity);if(n==null)throw new Error(`model "${e.entity}" not found for setup "${e.as}"`);let i=ht(t,e.as),o=$E(e.set,t,r.env);return{as:i,entity:e.entity,fields:{..._E(n,o,i,r),...o},model:n,seedPrefix:i}}function $E(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,DE(i,t,r)]))}function DE(e,t,r){if(!Ne(e))return e;let n=ht(t,e.ref);return r.get(n)??{ref:n}}function _E(e,t,r,n){return Object.fromEntries(Object.entries(e.props).filter(([i,o])=>!o.optional&&!e.identity.includes(i)&&!(i in t)).map(([i,o])=>[i,xh({field:i,generate:n.generate,model:e,seedPrefix:r,spec:o,valueSpaces:n.indexed.valueSpaces})]))}function FE(e,t,r){let n=new Map,i=e.flatMap(o=>{let s=r.models.get(o.entity);if(s==null)throw new Error(`model "${o.entity}" not found for setup "${o.as}"`);Object.entries(o.row).forEach(([l,u])=>t.set(ht(At(o.as),l),u));let a=n.get(o.entity)??new Map;return a.set(BE(o.row,s),vh(o.row,s)),n.set(o.entity,a),o.session==null?[]:[o.session]});return{auth:jE(i),env:t,snapshot:{entities:UE(n),singletons:{}}}}function jE(e){if(e.length===0)return;let t=e.flatMap(r=>Object.entries(r.headers??{}));return{cookies:e.flatMap(r=>r.cookies),headers:t.length===0?void 0:Object.fromEntries(t),origins:e.flatMap(r=>r.origins)}}function VE({generate:e,model:t,seedPrefix:r,set:n,valueSpaces:i}){return{...Object.fromEntries(Object.entries(t.props).filter(([s])=>!(s in n)).map(([s,a])=>[s,xh({field:s,generate:e,model:t,seedPrefix:r,spec:a,valueSpaces:i})])),...n}}function xh({field:e,generate:t,model:r,seedPrefix:n,spec:i,valueSpaces:o}){let s=`${r.name}.${e}`;return t.value({anchor:void 0,constraints:o.get(s)?.constraints,generator:o.get(s)?.generator??"lorem.word",nullable:i.optional,seed:ht(n,e),type:i.type,values:o.get(s)?.values,valueSpace:s})}function BE(e,t){return t.identity.map(r=>String(e[r])).join(":")}function UE(e){return new Map([...e].map(([t,r])=>[t,new Map(r)]))}function mt(e){return`${e.test}#${String(e.index)}`}function Lr(e){let t=e.tests.flatMap(r=>fo(e,r.name));return Ct(t,r=>`${r.test}:${J(r.steps)}`)}function fo(e,t){let r=Ph(e,t),n=Eh(r,e),i=Rh(n,r.singletons),o=dC(r,cC(e));return WE(i,fC(r.steps),n).map(({chunk:a,guard:l},u)=>lC({chunk:a,guard:l,index:u,intent:r.intent,namespace:n.namespace,paramSpaceOf:o,testName:t}))}function Rh(e,t){return{absences:sC(e),entities:aC(e),exclusives:e.exclusives,optionals:Ih(e.optionals,e),singletons:Object.fromEntries(Object.entries(t).filter(([,r])=>!Ne(r)&&!It(r)))}}function po(e,t,r){return Object.values(e).flatMap(n=>Ne(n)?ul(n.ref,r):[]).find(n=>n.entity===t)?.aliasPath}function WE(e,t,r){return t.reduce((n,i)=>({guard:zE(n.guard,i,r),guarded:[...n.guarded,{chunk:i,guard:rC(n.guard,i)}]}),{guard:e,guarded:[]}).guarded}function zE(e,t,r){let n=t.flatMap(i=>i.expect.filter(o=>o.kind==="state")).reduce((i,o)=>GE(i,o,r),e);return{...n,singletons:{...n.singletons,...QE(t)}}}function GE(e,t,r){return t.assertion.kind==="deleted"?HE(e,t,r):t.assertion.kind==="created"?YE(e,t.entity,t.assertion.as,t.assertion.props,r):ZE(e,t,r)}function HE(e,t,r){let n=po(t.key,t.entity,r.namespace),i=e.entities.find(a=>a.alias===n),o=Mn(qE(t.key),t.entity,r),s=i==null?{entity:t.entity,...o}:{entity:i.entity,...KE(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==n)}}function qE(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let r=t[1];return Ah(r)?[]:[[t[0],r]]}))}function KE(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(r=>!t.relations.some(n=>n.field===r.field)),...t.relations]}}function YE(e,t,r,n,i){let o=Mn(n,t,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!JE(o,s)),entities:[...e.entities,{alias:r,entity:t,...o}]}}function JE(e,t){return Object.entries(t.literals).every(([n,i])=>e.literals[n]===i)&&t.relations.every(n=>e.relations.some(i=>i.field===n.field&&i.targetAlias===n.targetAlias&&i.targetField===n.targetField))}function ZE(e,t,r){if(t.assertion.kind!=="updated")return e;let n=po(t.key,t.entity,r.namespace);if(n==null)return e;let i=Mn(fr(t.assertion.props),t.entity,r),o=Object.entries(t.assertion.props).filter(([,a])=>Kt(a)).map(([a])=>a),s=a=>a.alias===n?XE(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a)),optionals:e.optionals.map(a=>s(a))}}function XE(e,t,r){let n=Object.entries(e.literals).filter(([i])=>!r.includes(i)&&!(i in t.literals));return{...e,literals:{...Object.fromEntries(n),...t.literals},relations:[...e.relations.filter(i=>!t.relations.some(o=>o.field===i.field)),...t.relations]}}function QE(e){return e.reduce((t,r)=>({...t,...eC(r),...tC(r)}),{})}function eC(e){return e.action.kind==="goto"?{url:e.action.url}:{}}function tC(e){return Object.fromEntries(e.expect.flatMap(t=>t.kind==="browser"?[[t.name,t.value]]:t.kind==="singleton"?[[t.singleton,t.assertion.value]]:[]))}function rC(e,t){return t[0]?.action.kind!=="goto"?e:{...e,singletons:Object.fromEntries(Object.entries(e.singletons).filter(([r])=>r!=="url"))}}function ho(e,t){let r=Ph(e,t),n=Eh(r,e);return{guard:Rh(n,r.singletons),namespace:n.namespace,stable:n.stable}}function kh(e,t){return[...new Set(e)].flatMap(r=>ul(r,t))}function it(e){return Ne(e)?[e.ref]:It(e)?e.template.flatMap(t=>Ne(t)?[t.ref]:[]):[]}function Yt(e){switch(e.kind){case"visible":case"disabled":case"enabled":case"focused":return Jt(e.locator);case"value":case"text":return[...Jt(e.locator),...it(e.value)];case"singleton":return it(e.assertion.value);case"browser":return it(e.value);case"state":return[...e.assertion.kind==="deleted"?[]:Object.values(fr(e.assertion.props)).flatMap(t=>it(t)),...Object.values(e.key).flatMap(t=>Ch(t))];case"not":return Yt(e.predicate);case"when":return[...Yt(e.condition),...Yt(e.consequence),...e.otherwise==null?[]:Yt(e.otherwise)];case"and":return e.predicates.flatMap(t=>Yt(t));case"count":return[]}}function Eh(e,t){return{absences:e.absent,exclusives:e.exclusive,namespace:new Map([...e.world,...e.maybe].map(r=>[r.as,r.entity])),optionals:e.maybe,setups:e.world,stable:nC(t)}}function nC(e){let t=new Map(e.entities.map(r=>[r.name,r]));return(r,n)=>t.get(r)?.props[n]?.stable===!0}function Jt(e){return e.by==="inside"?[...Jt(e.scope),...Jt(e.target)]:e.by==="role"?e.name==null?[]:it(e.name):it(e.value)}function Ch(e){return Ah(e)?Object.values(e.selection.where).flatMap(t=>Ch(t)):it(e)}function Ah(e){return typeof e=="object"&&e!==null&&"kind"in e}function iC(e){return e.kind==="goto"?it(e.url):e.kind==="fill"||e.kind==="select"?[...Jt(e.locator),...it(e.value)]:e.kind==="press"?e.locator==null?[]:Jt(e.locator):(e.kind==="upload",Jt(e.locator))}function oC(e){return[...iC(e.action),...e.expect.flatMap(t=>Yt(t))]}function sC(e){return e.absences.map(t=>({entity:t.entity,...Mn(t.where,t.entity,e)}))}function Mn(e,t,r){let n=Object.entries(e).filter(([s])=>r.stable(t,s)),i=Object.fromEntries(n.flatMap(([s,a])=>Ne(a)||It(a)?[]:[[s,a]])),o=n.flatMap(s=>{let a=s[1];if(!Ne(a))return[];let l=ul(a.ref,r.namespace).at(0);return l==null?[]:[{entity:l.entity,field:s[0],targetAlias:l.aliasPath,targetField:l.field}]});return{literals:i,relations:o}}function Ih(e,t){return e.map(r=>({alias:r.as,entity:r.entity,...Mn(r.set,r.entity,t)}))}function aC(e){return Ih(e.setups,e)}function lC(e){let t=e.chunk.findIndex(s=>s.action.kind!=="goto"),r=t===-1?e.chunk:e.chunk.slice(0,t),n=e.chunk.slice(r.length),i=n.at(-1)??e.chunk.at(-1);if(i==null)throw new Error("empty transition chunk");let o=[...new Set(e.chunk.flatMap(s=>oC(s)))];return{effectStep:i,guard:e.guard,index:e.index,intent:e.intent,namespace:e.namespace,nav:r,paramSpaces:Object.fromEntries(o.filter(s=>e.paramSpaceOf.has(s)).map(s=>[s,e.paramSpaceOf.get(s)])),steps:n,test:e.testName,wait:rh(n.flatMap(s=>uC(s)))}}function uC(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function ul(e,t){let r=e.lastIndexOf(".");if(r===-1)return[];let n=e.slice(0,r),i=t.get(n);return i==null?[]:[{aliasPath:n,entity:i,field:e.slice(r+1),ref:e}]}function Ph(e,t){let r=e.tests.find(n=>n.name===t);if(r==null)throw new Error(`test "${t}" not found in lockfile`);return r}function cC(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function dC(e,t){return new Map(Object.entries(e.params).map(([r,n])=>[r,t.get(n.valueSpace)]))}function fC(e){return ll(e,0,[],[])}function ll(e,t,r,n){let i=e[t];if(i==null)return r.length===0?n:[...n,r];let o=[...r,i];return pC(i)?ll(e,t+1,[],[...n,o]):ll(e,t+1,o,n)}function pC(e){return e.expect.some(t=>t.kind==="state")}function Th(e){return Mh(e,new Map)}function hC(e,t){return e.reduce((r,n)=>r??t(n),null)}function Mh(e,t){let r=e.variables.find(n=>!t.has(n));return r==null?t:hC(e.domain(r),n=>{let i=new Map([...t,[r,n]]);return e.consistent(i)?Mh(e,i):null})}function gt(e,t){let r=mC(e,t);if(r==null)return null;let n=vC(r);return xC(e.singletons,t,n)?n:null}function mC(e,t){let{absences:r,entities:n,exclusives:i,optionals:o}=e,s=new Map(n.map(u=>[u.alias,u])),a=Th({variables:n.map(u=>u.alias),consistent:u=>gC(u)&&yC(n,u)&&SC(r,u,t),domain:u=>Lh(s.get(u),t)});if(a==null)return null;let l=$h(o,a,t);return wC(i,[...n,...o],l,t)?l:null}function gC(e){let t=[...e.values()];return new Set(t).size===t.length}function yC(e,t){return e.every(r=>t.has(r.alias)?r.relations.every(n=>bC(r,n,t)):!0)}function bC(e,t,r){if(!r.has(t.targetAlias))return!0;let n=r.get(t.targetAlias)?.[t.targetField];return n==null?!0:r.get(e.alias)?.[t.field]===n}function SC(e,t,r){return e.every(n=>![...r.entities.get(n.entity)?.values()??[]].some(i=>Oh(i,n,t)))}function Oh(e,t,r){return Nh(e,t)?t.relations.every(n=>{if(!r.has(n.targetAlias))return!1;let i=r.get(n.targetAlias)?.[n.targetField];return i!=null&&e[n.field]===i}):!1}function Nh(e,t){return Object.entries(t.literals).every(([r,n])=>n===null?e[r]==null:e[r]===n)}function Lh(e,t){return e==null?[]:[...t.entities.get(e.entity)?.values()??[]].filter(r=>Nh(r,e))}function $h(e,t,r){let n=e.reduce((i,o)=>{if(i.has(o.alias))return i;let s=new Set(i.values()),a=Lh(o,r).find(l=>!s.has(l)&&Oh(l,o,i));return a==null?i:new Map([...i,[o.alias,a]])},t);return n.size===t.size?n:$h(e,n,r)}function wC(e,t,r,n){return e.every(i=>{let o=t.filter(a=>a.entity===i&&r.has(a.alias)).length;return(n.entities.get(i)?.size??0)===o})}function vC(e){return new Map([...e].flatMap(([t,r])=>Object.entries(r).flatMap(n=>{let i=n[1];return typeof i=="string"||typeof i=="number"||typeof i=="boolean"?[[At(`${t}.${n[0]}`),i]]:[]})))}function xC(e,t,r){return Object.entries(e).every(([n,i])=>{if(!so(i,se,r))return!1;let o=nt(i,se,r),s=t.singletons[n],a=xt.safeParse(n);return a.success?Ba(a.data,o,s):s===o})}function mo(e,t,r){let n=gt(e.guard,t);return n==null?null:new Map([...n,...Object.entries(r).map(([i,o])=>[At(i),o])])}function go(e,t){let r=Pn(e.effectStep,t),n=EC(e,t),i=[...e.nav,...e.steps].map(o=>Pn(o,t));return{effect:CC(r.effect,n),steps:i.map(o=>({action:o.action,effect:o.effect,obligations:o.obligations,reconcile:o.reconcile,verifyChanges:o.verifyChanges}))}}function cl(e,t,r){return gt(e.guard,r)==null?!1:pr(t(r))!==pr(r)||AC(e)||RC(e)}function RC(e){return[...e.nav,...e.steps].every(t=>t.expect.every(r=>r.kind!=="state"))}var Dh=new WeakMap;function pr(e){let t=Dh.get(e);if(t!=null)return t;let r=J({entities:[...e.entities].map(([n,i])=>[n,[...i]]),singletons:kC(e.singletons)});return Dh.set(e,r),r}function kC(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>t==="url"&&typeof r=="string"?[t,kt(r)]:[t,r]))}function EC(e,t){let r=e.nav.at(-1);return r==null?void 0:Pn(r,t).action.url}function CC(e,t){if(t==null)return e;let r=kt(t);return n=>{let i=e(n);return{...i,singletons:{...i.singletons,url:r}}}}function AC(e){return e.effectStep.expect.some(t=>t.kind==="state"&&t.assertion.kind==="updated"&&Object.values(t.assertion.props).some(r=>Kt(r)))}function On(e,t,r){let n=mo(e,t.snapshot,r);if(n==null)return null;let i=IC(e,n);return i==null||!cl(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function _h(e,t,r){let n=mo(e,t.snapshot,r);if(n==null)return"guard-unsatisfied";try{return go(e,n),"no-effect"}catch{return"unresolvable"}}function IC(e,t){try{return go(e,t)}catch{return null}}function $r(e,t,r){return e.flatMap((n,i)=>{let o=r(n),s=On(n,t,o);return s==null?[]:[{firing:s,idx:i,label:mt(n),params:o}]})}var PC={absences:[],entities:[],exclusives:[],optionals:[],singletons:{}};function Nn(e){return{...PC,...e}}function dl(e){return TC(e).flatMap(t=>MC(t))}function TC(e){return[...e.reduce((r,n)=>{let i=J([n.when.singletons,n.consequence]);return new Map([...r,[i,[...r.get(i)??[],n]]])},new Map).values()]}function MC(e){if(e.length<2)return[];let t=e.map(o=>new Set(o.when.entities.map(s=>Fh(s)))),[r]=t;if(r==null)return[];let n=[...r].filter(o=>t.every(s=>s.has(o))),i=e.toSorted((o,s)=>o.when.entities.length-s.when.entities.length)[0];return i==null||n.length===i.when.entities.length?[]:OC(i,n,LC(e))}function Fh(e){return J([e.entity,e.literals])}function OC(e,t,r){let n=e.when.entities.filter(s=>t.includes(Fh(s))),i=new Set(n.map(s=>s.alias));if(![...e.refs].every(s=>i.has(s)))return[];let o=Nn({entities:n.map(s=>NC(s,i)),optionals:e.when.optionals.filter(s=>i.has(s.alias)),singletons:e.when.singletons});return[{consequence:e.consequence,origin:{kind:"generalized",tests:r},refs:e.refs,when:o}]}function NC(e,t){return{...e,relations:e.relations.filter(r=>t.has(r.targetAlias))}}function LC(e){return[...new Set(e.flatMap(t=>t.origin==null?[]:t.origin.kind==="generalized"?t.origin.tests:[t.origin.test]))]}function $C(e){return e.flatMap((t,r)=>e.slice(r+1).flatMap(n=>Uh(t,n)))}function Bh(e,t){return Uh(e,t).length>0}function Uh(e,t){let r=jh(e.when,t.when);return!r&&!jh(t.when,e.when)||!_C(e.consequence,t.consequence)?[]:[{a:e.consequence,b:t.consequence,when:r?t.when:e.when}]}function jh(e,t){return fl(e.entities,t.entities)&&fl(e.absences,t.absences)&&fl(e.optionals,t.optionals)&&e.exclusives.every(r=>t.exclusives.includes(r))&&DC(e.singletons,t.singletons)}function fl(e,t){let r=new Set(t.map(n=>J(n)));return e.every(n=>r.has(J(n)))}function DC(e,t){return Object.entries(e).every(([r,n])=>J(t[r])===J(n))}function _C(e,t){return e.kind==="not"?pl(e.predicate,t):t.kind==="not"?pl(e,t.predicate):FC(e,t)||jC(e,t)}function pl(e,t){return e.kind===t.kind&&"locator"in e&&"locator"in t&&Wh(e,t)}function Wh(e,t){return"locator"in t&&J(e.locator)===J(t.locator)}function FC(e,t){let r=new Set([e.kind,t.kind]);return r.has("enabled")&&r.has("disabled")&&"locator"in e&&"locator"in t?Wh(e,t):!1}function jC(e,t){let r=Vh(e),n=Vh(t);return r==null||n==null||e.kind!==t.kind?!1:pl(e,t)&&J(r)!==J(n)}function Vh(e){return e.kind==="value"||e.kind==="text"?e.value:null}function VC(e,t){return e.flatMap(r=>{let n=BC(r),i=new Set(r.guard.absences.map(o=>o.entity));return t.flatMap(o=>UC(r,o,n,i))})}function BC(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(r=>r.kind==="state"&&r.assertion.kind==="deleted"?[r.entity]:[])))}function UC(e,t,r,n){let{source:i,target:o}=t.reference;return!r.has(o)||r.has(i)||n.has(i)?[]:[{invariant:t,source:i,target:o,transition:mt(e)}]}function ml(e){return J({consequence:e.consequence,when:e.when})}function gl(e){let t=[...WC(e),...QC(e)],r=dl(t).reduce((n,i)=>[...t,...n].some(s=>Bh(i,s))?n:[...n,i],[]);return Ct([...t,...r],ml)}function yl(e){return e.kind==="not"?yl(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="value"||e.kind==="text"}function bl(e,t,r){if(gt(e.when,t)!=null)return null;let n=gt(e.when,r);return n==null?null:tA(e,n)}function WC(e){return Ct(e.tests.flatMap(t=>zC(e,t)),ml)}function zC(e,t){let r=ho(e,t.name);return t.steps.reduce((n,i)=>({guard:GC(n.guard,i,r),laws:[...n.laws,...XC(i,n.guard,r.namespace,{kind:"test",test:t.name})]}),{guard:r.guard,laws:[]}).laws}function GC(e,t,r){return t.expect.reduce((n,i)=>i.kind==="state"?HC(n,i,r):n,e)}function HC(e,t,r){if(t.assertion.kind==="created"){let o=qC(t.assertion.as,t.entity,t.assertion.props,r);return{...e,entities:[...e.entities,o]}}let n=po(t.key,t.entity,r.namespace);if(n==null)return e;if(t.assertion.kind==="deleted")return JC(e,n);let i=fr(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===n?hl(o,i,r):o),optionals:e.optionals.map(o=>o.alias===n?hl(o,i,r):o)}}function qC(e,t,r,n){return hl({alias:e,entity:t,literals:{},relations:[]},r,n)}function hl(e,t,r){return Object.entries(t).reduce((n,[i,o])=>{if(It(o)||!r.stable(e.entity,i))return n;if(Ne(o)){let s=KC(o.ref,i,r.namespace);return{...n,literals:YC(n.literals,i),relations:s==null?n.relations:[...zh(n.relations,i),s]}}return{...n,literals:{...n.literals,[i]:o},relations:zh(n.relations,i)}},e)}function KC(e,t,r){let n=e.lastIndexOf(".");if(n===-1)return;let i=e.slice(0,n),o=r.get(i);return o==null?void 0:{entity:o,field:t,targetAlias:i,targetField:e.slice(n+1)}}function YC(e,t){return Object.fromEntries(Object.entries(e).filter(([r])=>r!==t))}function zh(e,t){return e.filter(r=>r.field!==t)}function JC(e,t){let r=[...e.entities,...e.optionals].find(i=>i.alias===t),n=ZC(e,t);return r==null?n:{...n,absences:[...n.absences,{entity:r.entity,literals:r.literals,relations:r.relations}]}}function ZC(e,t){return{...e,entities:e.entities.filter(r=>r.alias!==t),optionals:e.optionals.filter(r=>r.alias!==t)}}function XC(e,t,r,n){if(e.action.kind!=="goto")return[];let i=e.action.url;return e.expect.filter(o=>yl(o)).map(o=>Gh({consequence:o,guard:t,namespace:r,origin:n,url:i}))}function Gh({consequence:e,guard:t,namespace:r,origin:n,url:i}){return{consequence:e,origin:n,refs:new Set(kh([...it(i),...Yt(e)],r).map(o=>o.aliasPath)),when:{...t,singletons:{...t.singletons,url:i}}}}function QC(e){return Ct(Lr(e).flatMap(t=>eA(t)),ml)}function eA(e){let t=e.nav.at(-1),r=e.steps[0]?.action,n=r!=null&&"locator"in r?r.locator:void 0;return t==null||t.action.kind!=="goto"||n==null?[]:[Gh({consequence:{kind:"enabled",locator:n,wait:void 0},guard:e.guard,namespace:e.namespace,origin:{intent:e.intent,kind:"trigger",test:e.test},url:t.action.url})]}function tA(e,t){try{let r=uo(e.consequence,t);return r==null?null:{check:r}}catch{return null}}function Sl(e){return Ja(e.tests.flatMap(t=>rA(e,t.name)))}function wl(e,t){return gt(e.when,t)==null?!1:gt(e.holds,t)==null}function rA(e,t){let r=ho(e,t);return r.guard.entities.flatMap(n=>n.relations.flatMap(i=>nA(e,n,i,r.namespace)?sA(n,i,r.namespace):[]))}function nA(e,t,r,n){let i=n.get(r.targetAlias);return i!=null&&!iA(e,t.entity,r.field)&&oA(e,i,r.targetField)}function iA(e,t,r){return e.entities.find(n=>n.name===t)?.props[r]?.optional===!0}function oA(e,t,r){return e.entities.find(n=>n.name===t)?.identity.includes(r)===!0}function sA(e,t,r){let n=r.get(t.targetAlias);if(n==null)return[];let i=Hh(e.alias,e.entity),o=Hh(t.targetAlias,n);return[{holds:Nn({entities:[{...i,relations:[t]},o]}),reference:{field:t.field,source:e.entity,target:n,targetField:t.targetField},when:Nn({entities:[i]})}]}function Hh(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function vl(e,t,r){return t.steps.map(n=>({effect:n.effect,obligations:n.obligations.map(i=>({budget:i.budget,check:{kind:"poll",run:()=>r.evaluate(i.check)},source:{check:i.check,kind:"step"}})),reconcile:n.reconcile,settle:e.wait,step:{action:n.action,intent:e.intent,test:e.test},verifyChanges:n.verifyChanges,guard:()=>!0,perform:()=>r.perform(n.action)}))}async function qh(e,t){let{params:r,transition:n}=e.firing,i=On(n,e.state,r);if(i==null){let s={intent:n.intent,kind:"unfireable",reason:_h(n,e.state,r),test:n.test};return{label:mt(n),next:e.state,result:{finalModel:e.state.snapshot,findings:[s]}}}let o=await Qa({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,lawObligations:lA(e.laws,e.invariants,e.driver),observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,steps:vl(e.firing.transition,i.resolved,e.driver)},t);return{label:mt(e.firing.transition),next:{snapshot:o.finalModel},result:o}}function aA(e,t){return wl(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},source:{invariant:e,kind:"invariant"}}]:[]}function lA(e,t,r){return(n,i)=>[...e.flatMap(o=>uA(o,n,i,r)),...t.flatMap(o=>aA(o,i))]}function uA(e,t,r,n){let i=bl(e,t,r);return i==null?[]:[{budget:"fast",check:{kind:"poll",run:()=>n.evaluate(i.check)},source:{check:i.check,kind:"law",origin:e.origin}}]}function Rl(e,t){return xl({acc:{findings:[],fired:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function xl({acc:e,index:t,params:r,signal:n,state:i,stepBase:o}){qt(n);let s=r.sequence[t];if(s==null)return e;let a=Date.now(),l=[],u=await qh({canon:r.canon,classify:r.classify,driver:r.driver,firing:s,invariants:r.invariants,laws:r.laws,onAssertion:r.onAssertion,state:i,onStep:d=>{l.push(d.index),r.onEvent({endMs:d.endMs,findings:d.findings,index:o+d.index,kind:"step",startMs:d.startMs})}},n);if(u==null)return xl({acc:e,index:t+1,params:r,signal:n,state:i,stepBase:o});r.onEvent({endMs:Date.now(),intent:s.transition.intent,kind:"fired",startMs:a}),u.result.findings.forEach(d=>{r.onEvent({finding:d,kind:"finding"})});let c={findings:[...e.findings,...u.result.findings],fired:[...e.fired,u.label]};return xl({acc:c,index:t+1,params:r,signal:n,state:u.next,stepBase:o+l.length})}var Dr={value:e=>cA(e)};function El(e,t){return{value:r=>e.value({...r,seed:`${t}:${r.seed}`})}}function Cl(e,t){return{value:r=>e.value({...r,anchor:t})}}function cA({anchor:e,constraints:t,generator:r,nullable:n,seed:i,type:o,values:s,valueSpace:a}){let l=kl(`${a}:${i}`);return n&&l%4===0?null:s!=null&&s.length>0?s[l%s.length]??s[0]??null:r==="date.iso"?dA({anchor:e,constraints:t,n:l,timeHash:kl(`${a}:${i}#tod`)}):o==="number"?fA(l,t):o==="boolean"?l%2===0:pA(r,l.toString(36))}var yo=864e5;function dA({anchor:e,constraints:t,n:r,timeHash:n}){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+r%o,a=Math.floor(i/yo)*yo;return new Date(a+s*yo+n%yo).toISOString()}function kl(e,t=0,r=7){return t>=e.length?r>>>0:kl(e,t+1,r*31+(e.codePointAt(t)??0)>>>0)}function fA(e,t){if(t?.kind!=="number"||t.min==null||t.max==null)throw new Error("number value space requires min and max constraints");let r=t.max-t.min+1;return r<=0?t.min:t.min+e%r}function pA(e,t){if(e==="internet.email")return`${t}@test.ripplo.ai`;if(e==="internet.url")return`https://${t}.example.com`;let r=e.split(".").at(-1);if(r==null)throw new Error(`generator "${e}" has no "."-suffix`);return`${r}-${t}`}import{ResultAsync as Il}from"neverthrow";var Ln=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}};function Al(e){return{read:t=>hA(t,e),seedScript:t=>`globalThis[${JSON.stringify(Ia)}] = ${JSON.stringify(t)};`}}async function hA(e,t){let r={title:await e.title(),url:kt(e.url()),viewport:yA(e.viewportSize())};if(t.length===0)return r;let n=await e.evaluate(gA,{mountKey:qi,names:t,timeoutMs:mA});if(n.kind==="unmounted")throw new Ln(qi);return{...r,...n.values}}var mA=5e3;async function gA(e){let t=Date.now()+e.timeoutMs;for(;Reflect.get(globalThis,e.mountKey)==null&&Date.now()<t;)await new Promise(n=>setTimeout(n,25));let r=Reflect.get(globalThis,e.mountKey);return r==null?{kind:"unmounted"}:{kind:"values",values:Object.fromEntries(e.names.map(n=>[n,r.readSingleton(n)??null]))}}function yA(e){return e==null?"":`${String(e.width)}x${String(e.height)}`}function Tl(e,t,r){return{evaluate:n=>Il.fromPromise(Jh(bA(e,r,n),`check ${n.kind}`),Kh),observe:()=>t.read().andThen(n=>Il.fromPromise(Jh(Zh(e,r,0),"observe"),Kh).map(i=>({snapshot:{...n,singletons:{...n.singletons,...i}}}))),perform:n=>Il.fromPromise(Qh(e,n,0),i=>Vp(n.kind,i))}}async function bA(e,t,r){try{return await rm(e,t,r)}catch(n){if(Xh(n))return!1;throw n}}function Kh(e){return e instanceof Ln?Dp(e.mountKey):Bp(e)}var SA=[100,250,500];async function Zh(e,t,r){try{return await t.read(e)}catch(n){let i=SA[r];if(i==null||!Xh(n))throw n;return await tm(i),Zh(e,t,r+1)}}function Xh(e){let t=e instanceof Error?e.message:String(e);return/Execution context was destroyed|Cannot find context with specified id|[Ff]rame was detached|frame got detached/.test(t)}var Yh=35e3;function Jh(e,t){let r,n=new Promise((i,o)=>{r=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(Yh)}ms`))},Yh)});return Promise.race([e,n]).finally(()=>{clearTimeout(r)})}var wA=[250,750,2e3];async function Qh(e,t,r){try{await vA(e,t)}catch(n){let i=wA[r];if(i==null||!kA(n))throw n;await tm(i),await Qh(e,t,r+1)}}async function vA(e,t){if(t.kind==="goto"){await e.goto(_r(t.url,t,"url"));return}if(t.kind==="press"&&t.locator==null){await e.keyboard.press(_r(t.key,t,"key"));return}await xA(em(e,t.locator),t)}function _r(e,t,r){if(e==null)throw new Error(`action "${t.kind}" requires ${r}`);return e}function xA(e,t){switch(t.kind){case"goto":throw new Error("goto must not be located");case"fill":return e.fill(String(_r(t.value,t,"value")));case"clear":return e.clear();case"click":return e.click();case"dblclick":return e.dblclick();case"check":return e.check();case"uncheck":return e.uncheck();case"hover":return e.hover();case"select":return e.selectOption(String(_r(t.value,t,"value")));case"upload":return e.setInputFiles(_r(t.files,t,"files"));case"press":return e.press(_r(t.key,t,"key"))}}function em(e,t){if(t==null)throw new Error("action requires a locator");return Pl(e,t)}function Pl(e,t){return t.by==="testId"?e.getByTestId(t.value):t.by==="inside"?Pl(Pl(e,t.scope),t.target):e.locator(RA(t.role,t.name))}function RA(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}function kA(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 tm(e){return new Promise(t=>{setTimeout(t,e)})}async function rm(e,t,r){if(r.kind==="browser")return EA(e,t,r.name,r.value);if(r.kind==="not")return!await rm(e,t,r.inner);let n=em(e,r.locator);return r.kind==="visible"?n.isVisible():r.kind==="disabled"?n.isDisabled():r.kind==="enabled"?n.isEnabled():r.kind==="focused"?n.evaluate(i=>i===i.ownerDocument.activeElement):r.kind==="value"?await n.inputValue()===r.value:(await n.textContent()??"").includes(r.value)}async function EA(e,t,r,n){let o=(await t.read(e))[r];return typeof o=="string"&&o.includes(n)}async function Ml({baseUrl:e,browser:t,capture:r,clientState:n,engine:i,reader:o,session:s}){let a=await t.newContext({baseURL:e,reducedMotion:"reduce",storageState:s==null?void 0:{cookies:s.cookies,origins:s.origins}});s?.headers!=null&&await a.setExtraHTTPHeaders(s.headers),await a.addInitScript(i.seedScript(n));let l=r==null?CA():await r.hub.attach(a,r.runId),u=await a.newPage();return l.onPage(u),{driver:AA(Tl(u,o,i),l),emitAssertion:l.emitAssertion,close:()=>IA({context:a,handle:l})}}async function Ol(e,t){let r=await im(e);try{return await t(r)}finally{await r.close()}}function CA(){return{emitAction:()=>{},emitAssertion:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function im(e){let{chromium:t}=await import("playwright");return t.launch({headless:!e})}function om({headed:e}){let t;return{acquire:async()=>{let i=t;if(i!=null){let o=await i.catch(()=>{});if(o?.isConnected()===!0)return o;t===i&&(t=void 0)}return t??=im(e),t},close:async()=>{let i=t;t=void 0,i!=null&&await i.then(o=>o.close()).catch(()=>{})}}}function AA(e,t){return{evaluate:e.evaluate,observe:e.observe,perform:r=>(t.emitAction(r),e.perform(r))}}async function IA({context:e,handle:t}){await nm(t.finish()),await nm(e.close())}var PA=15e3;async function nm(e){let t,r=new Promise(n=>{t=setTimeout(n,PA)});await Promise.race([e.catch(()=>{}),r]).finally(()=>{clearTimeout(t)})}import{err as TA,ok as MA,Result as Nl}from"neverthrow";function Ll(e,t,r){return{read:()=>r.read(e.map(n=>n.name),t).andThen(n=>OA(e,n))}}function OA(e,t){return Nl.combine(e.map(r=>NA(r,t.entities[r.name]??[]).map(n=>[r.name,n]))).map(r=>({entities:new Map(r),singletons:t.singletons}))}function NA(e,t){let r=co(e);return Nl.combine(t.map(n=>LA(n,e).map(i=>[i,$A(n,r)]))).map(n=>new Map(n))}function LA(e,t){return Nl.combine(t.identity.map(r=>{let n=e[r];return n==null?TA(Fp(t.name,r)):MA(String(n))})).map(r=>r.join(":"))}function $A(e,t){let r=t.map(n=>[n,e[n]]).filter(n=>n[1]!=null);return Object.fromEntries(r)}var am=Ti(fa(),1);import DA from"crypto";import{err as _A,errAsync as sm,ok as FA,ResultAsync as bo}from"neverthrow";var jA=3e4,VA=[250,750,2e3];function $l({baseUrl:e,runId:t,secret:r},n){let i=new am.Webhook(r),o=(s,a,l)=>BA({baseUrl:e,body:a,path:s,retry:l.retry,schema:l.schema,signal:l.signal,webhook:i});return{query:{read:(s,a)=>o("/state",{entities:s,runId:t,singletons:a},{retry:"transient",schema:Na,signal:n}).map(l=>({entities:l.entities,singletons:l.singletons}))},setupWorld:s=>o("/setup",{entities:s,runId:t},{retry:"connection",schema:Oa,signal:n}).map(a=>a.rows),teardown:()=>o("/teardown",{runId:t},{retry:"connection",schema:La,signal:void 0}).map(()=>{})}}function BA(e){return lm(e.retry,()=>HA(e),0)}function lm(e,t,r){return t().orElse(n=>{let i=VA[r];return i==null||!WA(n,e)?sm(n):bo.fromSafePromise(GA(i)).andThen(()=>lm(e,t,r+1))})}var UA=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function WA(e,t){return e.kind==="aborted"?!1:zA(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function zA(e){return e.kind==="engine-network"&&e.code!=null&&UA.has(e.code)}function GA(e){return new Promise(t=>{setTimeout(t,e)})}function HA({baseUrl:e,body:t,path:r,schema:n,signal:i,webhook:o}){let s=JSON.stringify(t);return bo.fromPromise(fetch(`${e}${r}`,{body:s,headers:{"Content-Type":"application/json",...qA(o,s)},method:"PUT",signal:KA(i)}),a=>ro(r,a)).andThen(a=>YA(a,r)).andThen(a=>JA(n,a,r)).mapErr(a=>i?.aborted===!0?Up():a)}function qA(e,t){let r=`msg_${DA.randomUUID()}`,n=new Date;return{"webhook-id":r,"webhook-signature":e.sign(r,n,t),"webhook-timestamp":String(Math.floor(n.getTime()/1e3))}}function KA(e){let t=AbortSignal.timeout(jA);return e==null?t:AbortSignal.any([e,t])}function YA(e,t){return e.ok?bo.fromPromise(e.json(),r=>ro(t,r)):bo.fromPromise(e.text().catch(()=>""),r=>ro(t,r)).andThen(r=>sm($p(t,e.status,r)))}function JA(e,t,r){let n=e.safeParse(t);return n.success?FA(n.data):_A(_p(r,n.error))}var le=Ti(dm(),1),W={actual:e=>le.default.red(e),bad:e=>le.default.red(le.default.bold(e)),bold:e=>le.default.bold(e),dim:e=>le.default.dim(e),expected:e=>le.default.green(e),good:e=>le.default.green(le.default.bold(e)),heading:e=>le.default.bold(le.default.cyan(e)),path:e=>le.default.cyan(le.default.underline(e)),warn:e=>le.default.yellow(le.default.bold(e))},eI={assertion:le.default.yellow,consistency:le.default.magenta,driver:le.default.red,illegal:le.default.cyan,invariant:le.default.yellow,unfireable:le.default.red};function $n(e){return`${le.default.red(le.default.bold("\u2717"))} ${eI[e](le.default.bold(e.toUpperCase()))}`}var tI=le.default.red("\u2717"),$W=le.default.green("\u2713"),fm=le.default.dim("\u203A"),rI=8;function te(e,t,r){let n=r==null?"":` ${W.dim(r)}`;return` ${W.dim(e.padStart(rI))} ${t}${n}`}function Fr(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${Fr(e.scope)} \u25B8 ${Fr(e.target)}`:e.name==null?e.role:`${e.role} "${e.name}"`}function Fl(e){return e.url!=null?`${e.kind} ${e.url}`:e.locator!=null?`${e.kind} ${Fr(e.locator)}`:e.kind}function Dn(e){return e.kind==="not"?`not ${Dn(e.inner)}`:e.kind==="browser"?`${e.name}="${e.value}"`:e.kind==="value"||e.kind==="text"?`${e.kind} ${Fr(e.locator)}="${e.value}"`:`${e.kind} ${Fr(e.locator)}`}function _n(e){let{field:t,source:r,target:n,targetField:i}=e.reference;return`${r}.${t} \u2192 ${n}.${i}`}function mm(e){return`${e.intent} \u203A ${Fl(e.action)}`}function gm(e){return e.kind==="invariant"?`invariant ${_n(e.invariant)}`:`${e.kind} ${Dn(e.check)}`}function ot(e){return e==null?"\u2205":JSON.stringify(e)}function ym(e){return e.kind==="ghost-write"?`${e.entity} "${e.key}" exists in SUT but model expected none`:e.kind==="absent"?`${e.entity} "${e.key}" expected by model but absent in SUT`:e.kind==="field-mismatch"?`${e.entity}.${e.field} [${e.key}] model=${ot(e.snapshot)} sut=${ot(e.sut)}`:e.kind==="expected-change"?`${e.entity}.${e.field} [${e.key}] expected to change but stayed ${ot(e.value)}`:`${e.singleton} model=${ot(e.snapshot)} sut=${ot(e.sut)}`}function jl(e){return{label:gm(e.source),step:mm(e.step)}}function Fn(e){return e.kind==="consistency"?cI(e):e.kind==="obligation"?gI(e.source,e.step,e.budget):e.kind==="illegal-transition"?hr("illegal","guard was false before this step",e.step,[te("meaning",W.dim("the action fired from a state the model says is unreachable"),void 0)]):e.kind==="unfireable"?hr("unfireable",`could not fire "${e.intent}"`,void 0,[te("reason",W.actual(Sm(e.reason)),void 0),te("meaning",W.dim("a planned move was skipped \u2014 never silently drop it"),void 0)]):hr("driver","the browser failed to run this step",e.step,[te("cause",W.actual(Et(e.error)),void 0),te("decide",W.dim("environment/infra failure \u2014 fix the run environment (daemon, dev server, ports); never weaken the model or app for a driver failure"),void 0)])}function bm(e){return iI(oI(e))}var nI=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function iI(e){return e.replaceAll(nI,"").replaceAll(/\s+/g," ").trim()}function oI(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${ym(e.divergence)}${t}`}return e.kind==="obligation"?`${bI(e.source)} failed at "${e.step.intent}": ${SI(e.source)}`:e.kind==="illegal-transition"?`guard was false before "${e.step.intent}" \u2014 the action fired from a state the model says is unreachable`:e.kind==="unfireable"?`could not fire "${e.intent}" \u2014 ${Sm(e.reason)}`:`driver failed at "${e.step.intent}": ${Et(e.error)}`}var sI={"guard-unsatisfied":"the guard isn't satisfied by the live state","no-effect":"the move has no observable effect from this state",unresolvable:"a step references a value the model can't resolve yet (e.g. a not-yet-created id)"};function Sm(e){return sI[e]}function aI({debugDir:e,runId:t}){let r=`${e}/${t}`;return te("behavior",W.path(`${r}/behavior.jsonl`),void 0)}function lI(e){if(e.kind==="cascade-gap"){let{gap:n}=e,i=`${n.transition} deletes ${n.target} but leaves ${n.source} dangling`;return`${$n("invariant")} ${W.bold(i)}
|
|
36
|
+
`);case"compilation-failed":return Qi(e.error)}}function WR(e){let t=e.missingEnvFiles.length===0?[]:["Declared env file(s) not found at this path:",...e.missingEnvFiles.map(r=>` ${r}`),"If you're in a git worktree, the env file may not have been copied from the main checkout \u2014 recreate it (or symlink to a shared file outside the working tree)."];return["Env config invalid:",...e.issues.map(r=>` ${r}`),"Add missing values to the env file(s) declared in .ripplo/project.json.",...t].join(`
|
|
37
|
+
`)}import{err as HR,ok as qR}from"neverthrow";import{z as _a}from"zod";var zR="https://ripplo.ai";function pp(){return mp().RIPPLO_SERVER_URL}function hp(){return mp().RIPPLO_PROJECT_ID}var GR=_a.object({RIPPLO_PROJECT_ID:_a.string().min(1).optional(),RIPPLO_SERVER_URL:_a.string().min(1).default(zR)}),fp;function mp(){return fp??=GR.parse(process.env),fp}import gp from"fs";import Fa from"path";function yp(e){let t=gp.realpathSync(e),r=t,n=Fa.dirname(r);for(;n!==r;){if(gp.existsSync(Fa.join(r,".git")))return r;r=n,n=Fa.dirname(r)}return t}function pB(e){return ga(e).andThen(t=>Vi().andThen(r=>{let n=ua();return n==null?HR({kind:"not-authenticated"}):qR({appUrl:r.appUrl,cwd:yp(e),engineUrl:r.engineUrl,projectId:hp()??t.projectId,ripploServerUrl:pp(),token:n,webhookSecret:r.webhookSecret})}))}import bp from"fs";import{checkSync as KR,lockSync as YR}from"proper-lockfile";var JR="dev.pid",Sp=15e3;function wp(e){return Ut(e,JR)}function vp(e){try{return KR(wp(e),{realpath:!1,stale:Sp})}catch{return!1}}var ja=class extends Error{pid;cwd;constructor({cwd:t,pid:r}){super("dev-lock-held"),this.name="DevLockHeldError",this.pid=r,this.cwd=t}};function bB({cwd:e,onCompromised:t}){aa(e);let r=wp(e),n=ZR({cwd:e,onCompromised:t,path:r});return bp.writeFileSync(r,String(process.pid)),()=>{try{n()}catch{}}}function ZR({cwd:e,onCompromised:t,path:r}){try{return YR(r,{realpath:!1,stale:Sp,onCompromised:()=>{t()}})}catch(n){throw XR(n)?new ja({cwd:e,pid:QR(r)}):n}}function XR(e){if(!(e instanceof Error)||!("code"in e))return!1;let{code:t}=e;return t==="ELOCKED"}function QR(e){try{let t=bp.readFileSync(e,"utf8").trim(),r=Number.parseInt(t,10);return Number.isFinite(r)&&r>0?r:null}catch{return null}}import{createServer as ok}from"http";import{mkdir as sk,rm as ak,writeFile as lk}from"fs/promises";import uk from"path";import{z as ee}from"zod";import ek from"path";import{z as wn}from"zod";var tk=["unspecified","internal","server","client","producer","consumer"],rk=["unset","ok","error"];function xp(e){return tk[e]??"unspecified"}function Rp(e){return rk[e]??"unset"}var xB=wn.looseObject({data:wn.looseObject({source:wn.number().optional()}).optional(),timestamp:wn.number(),type:wn.number()});function kp({debugDir:e,runId:t,worker:r}){let n=ek.join(e,t,"behavior.jsonl");return r.open({file:n,runId:t}),{close:i=>r.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(nk(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:ik(i.timeNanos)};r.line({line:JSON.stringify(o),runId:t,timeNanos:i.timeNanos})},emitRrwebBatch:i=>{r.rrwebBatch({data:i,runId:t})}}}function Mr(e){return String(BigInt(Math.round(e))*1000000n)}function nk(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function ik(e){return Number(BigInt(e)/1000000n)}var ck="otlp-port",Cp=ee.object({key:ee.string(),value:ee.object({boolValue:ee.boolean().optional(),doubleValue:ee.number().optional(),intValue:ee.union([ee.string(),ee.number()]).optional(),stringValue:ee.string().optional()})}),dk=ee.object({attributes:ee.array(Cp).default([]),endTimeUnixNano:ee.string(),kind:ee.number().default(0),name:ee.string(),parentSpanId:ee.string().optional(),spanId:ee.string(),startTimeUnixNano:ee.string(),status:ee.object({code:ee.number(),message:ee.string().optional()}).optional(),traceId:ee.string()}),fk=ee.object({resourceSpans:ee.array(ee.object({resource:ee.object({attributes:ee.array(Cp).default([])}).optional(),scopeSpans:ee.array(ee.object({spans:ee.array(dk).default([])})).default([])})).default([])});async function Va({localDir:e,onRrwebBatch:t,onSpan:r,writePortFile:n}){let{port:i,server:o}=await pk({onRrwebBatch:t,onSpan:r}),s=uk.join(e,ck);return n&&(await sk(e,{recursive:!0}),await lk(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{n&&await ak(s,{force:!0}),await bk(o)}}}function pk(e){return new Promise((t,r)=>{let n=ok((i,o)=>{hk(i,o,e)});n.on("error",r),n.listen(0,()=>{let i=n.address();if(i==null||typeof i=="string"){r(new Error("otlp_receiver_no_port"));return}t({port:i.port,server:n})})})}function hk(e,t,r){let n=mk(e.url);if(n!=null){Ep(e).then(i=>{r.onRrwebBatch(n,i),to(t)}).catch(()=>{to(t)});return}Ep(e).then(i=>{gk(fk.parse(JSON.parse(i.toString("utf8"))),r.onSpan),to(t)}).catch(()=>{to(t)})}function mk(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function Ep(e){return new Promise((t,r)=>{let n=[];e.on("data",i=>{n.push(i)}),e.on("end",()=>{t(Buffer.concat(n))}),e.on("error",r)})}function to(e){e.writeHead(200,{"content-type":"application/json"}),e.end("{}")}function gk(e,t){e.resourceSpans.flatMap(r=>r.scopeSpans).flatMap(r=>r.spans).forEach(r=>{t({attributes:yk(r.attributes),durationMs:Number((BigInt(r.endTimeUnixNano)-BigInt(r.startTimeUnixNano))/1000000n),kind:"span",name:r.name,parentSpanId:r.parentSpanId,source:"server",spanId:r.spanId,spanKind:xp(r.kind),status:{code:Rp(r.status?.code??0),message:r.status?.message},timeNanos:r.startTimeUnixNano,traceId:r.traceId})})}function yk(e){return Object.fromEntries(e.map(({key:t,value:r})=>[t,String(r.stringValue??r.intValue??r.doubleValue??r.boolValue??"")]))}function bk(e){return new Promise((t,r)=>{e.close(n=>{if(n==null){t();return}r(n)}),e.closeAllConnections()})}function kt(e){let t=new URL(e,"https://ripplo.invalid"),r=[...t.searchParams.entries()].toSorted(([n],[i])=>n.localeCompare(i)).map(([n,i])=>`${n}=${i}`).join("&");return r.length===0?t.pathname:`${t.pathname}?${r}`}function Or(e,t){return e==="url"?kt(t):t}function Ba(e,t,r){return Or(e,String(t))===Or(e,String(r))}function Ip(e,t,r){return e!=="url"?Ba(e,t,r):Ap(String(t))===Ap(String(r))}function Ap(e){return new URL(e,"https://ripplo.invalid").pathname}function Ua({actual:e,canon:t,pre:r,predicted:n}){return[...[...new Set([...n.entities.keys(),...e.entities.keys()])].flatMap(s=>Sk({actual:e.entities.get(s),canon:t,entity:s,pre:r.entities.get(s),predicted:n.entities.get(s)})),...vk(r.singletons,n.singletons,e.singletons)]}function Sk({actual:e,canon:t,entity:r,pre:n,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>wk({actual:e?.get(s),canon:t,entity:r,key:s,predicted:i?.get(s),preHadKey:n?.has(s)??!1,preRow:n?.get(s)}))}function wk({actual:e,canon:t,entity:r,key:n,predicted:i,preHadKey:o,preRow:s}){if(i==null)return[{divergence:{entity:r,key:n,kind:"ghost-write"},pending:o}];if(e==null)return[{divergence:{entity:r,key:n,kind:"absent"},pending:!o}];let a=(u,c,d)=>Mp(t(r,u,c),t(r,u,d));return[...new Set([...Object.keys(i),...Object.keys(e)])].filter(u=>!a(u,i[u],e[u])).map(u=>({divergence:{entity:r,field:u,key:n,kind:"field-mismatch",snapshot:i[u],sut:e[u]},pending:s==null?e[u]===void 0:a(u,s[u],e[u])}))}function Mp(e,t){return Pp(e)===Pp(t)}function Pp(e){return e==null?"\u2205":JSON.stringify(e)}function vk(e,t,r){return[...new Set([...Object.keys(t),...Object.keys(r)])].flatMap(i=>{let o=t[i],s=r[i];return o===void 0||s===void 0||Tp(i,o,s)?[]:[{divergence:{kind:"singleton-mismatch",singleton:i,snapshot:o,sut:s},pending:e[i]!==void 0&&Tp(i,e[i],s)}]})}function Tp(e,t,r){let n=xt.safeParse(e);return n.success?Ip(n.data,t,r):Mp(t,r)}function Wa(e){let t=xk(e.entities),r=Rk(e.singletons);return n=>kk(n,t,r)}function xk(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([r,n])=>[Op(t.name,r),n.consistency])))}function Op(e,t){return`${e}.${t}`}function Rk(e){return new Map(e.map(t=>[t.name,t.consistency]))}function kk(e,t,r){return e.kind==="singleton-mismatch"?Ek(e.singleton,r):e.kind==="ghost-write"||e.kind==="absent"?"strict":t.get(Op(e.entity,e.field))??"strict"}function Ek(e,t){return xt.safeParse(e).success?t.get(e)??"eventual":t.get(e)??"strict"}function za(e){let t=new Set(e.valueSpaces.filter(r=>r.generator==="date.iso").map(r=>r.name));return(r,n,i)=>{if(!t.has(`${r}.${n}`)||typeof i!="string")return i;let o=Date.parse(i);return Number.isNaN(o)?i:new Date(o).toISOString()}}function Lp(e,t,r){return{detail:r.slice(0,500),kind:"engine-http",path:e,status:t}}function ro(e,t){return{code:Wp(t),kind:"engine-network",message:xn(t),path:e}}function $p(e){return{kind:"client-mount-missing",mountKey:e}}function Dp(e,t){return{kind:"engine-decode",message:xn(t),path:e}}function _p(e,t){return{entity:e,field:t,kind:"state-identity"}}function Fp(e){return{as:e,kind:"setup-missing-row"}}function vn(e){return{kind:"driver-launch",message:xn(e)}}function jp(e,t){return{action:e,kind:"action-failed",message:xn(t)}}function Vp(e){return{kind:"check-failed",message:xn(e)}}function Bp(){return{kind:"aborted"}}var Np=300;function Et(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${Ck(e.detail)}${Ak(e.status)}`;case"engine-network":return`engine ${e.path} request failed: ${e.message}`;case"client-mount-missing":return`client bridge "${e.mountKey}" never mounted; client singletons unreadable`;case"engine-decode":return`engine ${e.path} response did not match schema: ${e.message}`;case"state-identity":return`row of "${e.entity}" is missing identity field "${e.field}"`;case"setup-missing-row":return`setup returned no row for "${e.as}"`;case"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 Up(e){throw new Error(Et(e))}function no(){}function Ck(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=Np?t:`${t.slice(0,Np)}\u2026 [truncated]`}function Ak(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 xn(e){return e instanceof Error?e.message:String(e)}var Ya=Ti(qp(),1),FB=Ya.default.configure,io=Ya.default;function J(e){return io(e)??""}function Ct(e,t){return[...new Map(e.map(r=>[t(r),r])).values()]}function Ja(e){return Ct(e,J)}function Kp(e){return J(e)}var kn=class extends Error{name="AbortError";constructor(){super("aborted")}};function Yp(e){return e instanceof Error&&e.name==="AbortError"}function qt(e){if(e.aborted)throw new kn}function Za(e,t){return t.aborted?Promise.reject(new kn):new Promise((r,n)=>{let i=()=>{clearTimeout(o),n(new kn)},o=setTimeout(()=>{t.removeEventListener("abort",i),r()},e);t.addEventListener("abort",i,{once:!0})})}function th(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var $k=()=>[];async function Qa({canon:e,classify:t,initialSnapshot:r,lawObligations:n,observe:i,onAssertion:o,onStep:s,steps:a},l){return rh({acc:[],canon:e,classify:t,index:0,lawObligations:n??$k,observe:i,onAssertion:o,onStep:s,signal:l,snapshot:r,steps:a})}async function rh({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,steps:c}){qt(l);let d=c[n];if(d==null)return{finalModel:u,findings:e};let p=Date.now();if(!d.guard(u)){let h={kind:"illegal-transition",step:d.step};return Xa(a,{endMs:Date.now(),findings:[h],index:n,startMs:p}),{finalModel:u,findings:[...e,h]}}return d.perform().match(()=>Dk({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,startMs:p,step:d,steps:c}),h=>{let f=oo(h,d);return Xa(a,{endMs:Date.now(),findings:[f],index:n,startMs:p}),Promise.resolve({finalModel:u,findings:[...e,f]})})}async function Dk({acc:e,canon:t,classify:r,index:n,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:u,startMs:c,step:d,steps:p}){let h=d.effect(u),f=await Wk({canon:t,classify:r,observe:o,pre:u,predicted:h,signal:l,step:d}),m=[...d.obligations,...i(u,f.snapshot)],g=[...await _k({obligations:m,onAssertion:s,signal:l,step:d}),...f.findings];return Xa(a,{endMs:Date.now(),findings:g,index:n,startMs:c}),rh({acc:[...e,...g],canon:t,classify:r,index:n+1,lawObligations:i,observe:o,onAssertion:s,onStep:a,signal:l,snapshot:f.snapshot,steps:p})}async function _k({obligations:e,onAssertion:t,signal:r,step:n}){let i=[...new Map(e.map(s=>[Kp(s.source),s])).values()],o=await Promise.all(i.map(async s=>({obligation:s,outcome:await Fk(s,r)})));return o.forEach(s=>{jk(t,s.obligation,s.outcome,n)}),o.flatMap(s=>Bk(s.obligation,s.outcome,n))}function Fk(e,t){if(e.check.kind==="decided"){let r=e.check.passed?"passed":"failed";return Promise.resolve({kind:r})}return zk(e.budget,e.check.run,t)}function jk(e,t,r,n){e?.({outcome:Vk(r),source:t.source,step:n.step})}function Vk(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function Bk(e,t,r){return t.kind==="error"?[oo(t.error,r)]:t.kind==="failed"?[{budget:e.budget,kind:"obligation",source:e.source,step:r.step}]:[]}function oo(e,t){return{error:e,kind:"driver-error",step:t.step}}function Xa(e,t){e?.(t)}var En={async:12e4,fast:5e3,slow:3e4},nh={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:En.async},fast:{backoffMs:[100,250,500,1e3],timeoutMs:En.fast},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:En.slow}};function ih(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function Jp(e){return e().match(t=>({observed:t,ok:!0}),t=>({error:t,ok:!1}))}function Uk(e,t,r){return r.reconcile==null?e:r.reconcile(e,t)}function Zp({canon:e,pre:t,predicted:r,step:n},i){let o=n.verifyChanges==null?[]:n.verifyChanges(r,i),s=Uk(r,i,n),a=o.map(l=>({divergence:l,pending:!0}));return{adopted:s,probed:[...a,...Ua({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function oh(e,t){return{budget:t.settle,divergence:e.divergence,kind:"consistency",pending:e.pending,step:t.step}}function Xp(e,t,r){let n=e.probed.filter(i=>!i.pending&&r(i.divergence)==="strict");return n.length>0?{findings:n.map(i=>oh(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function Qp(e,t,r){return{findings:[...e.probed.map(n=>oh(n,t)),...r],snapshot:e.adopted}}async function Wk({canon:e,classify:t,observe:r,pre:n,predicted:i,signal:o,step:s}){let a=nh[s.settle],l=Date.now()+a.timeoutMs,u=await Jp(r);if(!u.ok)return{findings:[oo(u.error,s)],snapshot:i};let c=Zp({canon:e,pre:n,predicted:i,step:s},u.observed),d=0;for(;Date.now()<l;){qt(o);let p=Xp(c,s,t);if(p!=null)return p;await Za(ih(a,d),o),d+=1;let h=await Jp(r);if(!h.ok)return Qp(c,s,[oo(h.error,s)]);c=Zp({canon:e,pre:n,predicted:i,step:s},h.observed)}return Xp(c,s,t)??Qp(c,s,[])}async function zk(e,t,r){let n=nh[e],i=Date.now()+n.timeoutMs,o=await eh(t),s=0;for(;o.kind==="pending"&&Date.now()<i;)qt(r),await Za(ih(n,s),r),s+=1,o=await eh(t);return o.kind==="pending"?{kind:"failed"}:o}function eh(e){return e().match(t=>t?{kind:"passed"}:{kind:"pending"},t=>({error:t,kind:"error"}))}import{z as Gk}from"zod";var tl=Gk.string().brand(),se=tl.parse("");function At(e){return tl.parse(e)}function ht(e,t){return tl.parse(e.length===0?t:`${e}.${t}`)}function Ne(e){return Ir.safeParse(e).success}function It(e){return typeof e=="object"&&e!==null&&"template"in e}function el(e,t,r){let n=ht(t,e.ref);if(!r.has(n))throw new Error(`unresolved binding ref "${n}"`);return r.get(n)??null}function so(e,t,r){return Hk(e).every(n=>r.has(ht(t,n)))}function rt(e,t,r){return typeof e=="string"?e:Ne(e)?String(el(e,t,r)):e.template.map(n=>typeof n=="string"?n:String(el(n,t,r))).join("")}function nt(e,t,r){return e===null||typeof e=="number"||typeof e=="boolean"?e:Ne(e)?el(e,t,r):rt(e,t,r)}function sh(e,t){return nt(e,se,t)}function Cn(e){return io(e)}function Nr(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,nt(i,t,r)]))}function Hk(e){return e==null||typeof e!="object"?[]:It(e)?e.template.flatMap(t=>typeof t=="string"?[]:[t.ref]):[e.ref]}function Kt(e){return typeof e=="object"&&e!==null&&"kind"in e}function fr(e){return Object.fromEntries(Object.entries(e).filter(t=>!Kt(t[1])))}function ah(e,t,r){return t.reduce((n,i)=>qk(n,i,r,e),e)}function lh(e,t){return Object.keys(t).length===0?e:{...e,singletons:{...e.singletons,...t}}}function qk(e,t,r,n){if(!Kk(t,r))return e;if(t.assertion.kind==="created"){let o=Nr(t.assertion.props,se,r);return Yk(e,t.entity,Cn(o),o)}if(t.assertion.kind==="deleted")return rl(e,t.entity,Qk(t.key,r,n));let i=Nr(fr(t.assertion.props),se,r);return rl(e,t.entity,eE(t.key,i,r,n))}function Kk(e,t){return("props"in e.assertion?[e.key,fr(e.assertion.props)]:[e.key]).every(n=>Object.values(n).every(i=>dh(i)||!Ne(i)||t.has(At(i.ref))))}function Yk(e,t,r,n){let i=new Map([...e.entities.get(t)??[],[r,n]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function rl(e,t,r){let n=r(e.entities.get(t)??new Map);return{...e,entities:new Map([...e.entities,[t,n]])}}function An(e,t,r,n){let i={env:n,key:r,snapshot:e};return[...(e.entities.get(t)??new Map).values()].filter(o=>lo(o,i))}function uh(e,t,r,n,i){let o={env:n,key:r,snapshot:e};return rl(e,t,s=>new Map([...s].map(([a,l])=>[a,lo(l,o)?i(l):l])))}function lo(e,t){return Object.entries(t.key).every(([r,n])=>ch(e[r],n,t))}function ch(e,t,r){return dh(t)?Jk(t,r).has(ao(e)):ao(e)===ao(Xk(t,r.env))}function dh(e){return typeof e=="object"&&e!==null&&"kind"in e}function Jk(e,t){let r=t.snapshot.entities.get(e.selection.entity);return r==null?new Set:new Set([...r.values()].filter(n=>Zk(n,e.selection.where,t)).map(n=>ao(n[e.field])))}function Zk(e,t,r){return Object.entries(t).every(([n,i])=>ch(e[n],i,r))}function ao(e){return e==null?"\u2205":e instanceof Date?e.toISOString():JSON.stringify(e)}function Xk(e,t){return nt(e,se,t)}function Qk(e,t,r){let n={env:t,key:e,snapshot:r};return i=>new Map([...i].filter(([,o])=>!lo(o,n)))}function eE(e,t,r,n){let i={env:r,key:e,snapshot:n};return o=>new Map([...o].map(([s,a])=>lo(a,i)?[s,{...a,...t}]:[s,a]))}function hh(e){let t=e.predicates.filter(o=>bh(o)),r=t.filter(o=>o.assertion.kind==="created"),n=yh(t);if(r.length===0&&n.length===0&&e.deferred.length===0&&e.adopt.length===0)return;let i=t.filter(o=>o.assertion.kind==="updated");return(o,s)=>{let a=r.reduce((c,d)=>aE(c,s,d,e.env),{env:e.env,snapshot:o}),l=n.reduce((c,d)=>sE(c,s,d,e.env),a.snapshot),u=i.reduce((c,d)=>rE(c,s,d),a.env);return tE(uE(l,e.deferred,u),s,e.adopt)}}function tE(e,t,r){if(r.length===0)return e;let n=r.reduce((i,o)=>{let s=t.snapshot.singletons[o];return s===void 0?i:{...i,[o]:s}},e.singletons);return{...e,singletons:n}}function mh(e,t,r){return new Map([...e,...Object.entries(r).map(([n,i])=>[ht(se,`${t}.${n}`),i])])}function rE(e,t,r){let n=An(t.snapshot,r.entity,r.key,e).at(0);return n==null?e:mh(e,r.assertion.as,n)}function gh(e){let t=yh(e.predicates.filter(r=>bh(r)));if(t.length!==0)return(r,n)=>t.flatMap(i=>nE(i,r,n,e.env))}function yh(e){return e.filter(t=>t.assertion.kind==="updated"&&nl(t.assertion.props).length>0)}function nl(e){return Object.entries(e).filter(([,t])=>Kt(t)).map(([t])=>t)}function bh(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function nE(e,t,r,n){let i=An(t,e.entity,e.key,n).at(0),o=An(r.snapshot,e.entity,e.key,n).at(0);if(i==null||o==null)return[];let s=Cn(iE(e.key,n));return nl(e.assertion.props).flatMap(a=>fh(i[a])===fh(o[a])?[{entity:e.entity,field:a,key:s,kind:"expected-change",value:o[a]}]:[])}function iE(e,t){let r=Object.fromEntries(Object.entries(e).filter(n=>!oE(n[1])));return Nr(r,se,t)}function oE(e){return typeof e=="object"&&e!==null&&"kind"in e}function fh(e){return e==null?"\u2205":JSON.stringify(e)}function sE(e,t,r,n){let i=nl(r.assertion.props),o=An(t.snapshot,r.entity,r.key,n).at(0);return o==null?e:uh(e,r.entity,r.key,n,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function aE(e,t,r,n){if(r.assertion.kind!=="created")return e;let i=Nr(r.assertion.props,se,n),o=Cn(i),s=e.snapshot.entities.get(r.entity);if(s==null||!s.has(o))return e;let a=lE(t.snapshot.entities.get(r.entity),s,i);if(a==null)return e;let[l,u]=a,c=new Map(s);return c.delete(o),c.set(l,u),{env:mh(e.env,r.assertion.as,u),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(r.entity,c)}}}function lE(e,t,r){if(e!=null)return[...e].find(([n,i])=>!t.has(n)&&Object.entries(r).every(([o,s])=>ph(i[o])===ph(s)))}function ph(e){return e==null?"\u2205":JSON.stringify(e)}function uE(e,t,r){let n=t.reduce((i,o)=>{let s=cE(o.value,r);return s==null?i:{...i,[o.name]:Or(o.name,s)}},e.singletons);return{...e,singletons:n}}function cE(e,t){try{return rt(e,se,t)}catch{return}}function uo(e,t){if(e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused")return{kind:e.kind,locator:In(e.locator,t)};if(e.kind==="not"){let r=uo(e.predicate,t);return r==null?null:{inner:r,kind:"not"}}return e.kind==="value"||e.kind==="text"?{kind:e.kind,locator:In(e.locator,t),value:rt(e.value,se,t)}:e.kind!=="browser"?null:{kind:"browser",name:e.name,value:rt(e.value,se,t)}}function Pn(e,t){let r=e.expect.filter(l=>l.kind==="state"),n=yE(r),{adopt:i,conditional:o,deferred:s,immediate:a}=pE(e,t,n);return{action:bE(e.action,t),label:e.action.kind,obligations:e.expect.flatMap(l=>wE(l,t)),reconcile:hh({adopt:i,deferred:s,env:t,predicates:r}),verifyChanges:gh({adopt:i,deferred:s,env:t,predicates:r}),effect:l=>{let u=ah(l,r,t),c=o.reduce((d,p)=>({...d,...il(p,u,t)}),{});return lh(u,{...a,...c})}}}function In(e,t){return e.by==="role"?{by:"role",name:e.name==null?void 0:rt(e.name,se,t),role:e.role}:e.by==="inside"?{by:"inside",scope:In(e.scope,t),target:In(e.target,t)}:{by:"testId",value:rt(e.value,se,t)}}function il(e,t,r){return e==null?{}:e.kind==="when"?ol(e.condition,t,r)?il(e.consequence,t,r):il(e.otherwise,t,r):fE(e,r)}function ol(e,t,r){if(!dE(e))throw new Error(`when() condition cannot be a "${e.kind}" predicate`);switch(e.kind){case"singleton":return t.singletons[e.singleton]===nt(e.assertion.value,se,r);case"count":return(t.entities.get(e.entity)?.size??0)===e.value;case"not":return!ol(e.predicate,t,r);case"and":return e.predicates.every(n=>ol(n,t,r))}}function dE(e){return e.kind==="singleton"||e.kind==="count"||e.kind==="not"||e.kind==="and"}function fE(e,t){if(e.kind!=="browser"&&e.kind!=="singleton")return{};let r=e.kind==="browser"?e.value:e.assertion.value;return so(r,se,t)?Sh(e,t):{}}function pE(e,t,r){let n=e.action.kind==="goto"&&!e.expect.some(s=>s.kind==="browser"&&s.name==="url"),i=e.action.kind==="goto"&&!n?{url:kt(rt(e.action.url,se,t))}:{},o=n?["url"]:[];return e.expect.reduce((s,a)=>a.kind==="browser"&&hE(a.value,r)?{...s,deferred:[...s.deferred,{name:a.name,value:a.value}]}:a.kind==="browser"||a.kind==="singleton"?{...s,immediate:{...s.immediate,...Sh(a,t)}}:a.kind==="when"?{...s,conditional:[...s.conditional,a]}:s,{adopt:o,conditional:[],deferred:[],immediate:i})}function hE(e,t){return mE(e).some(r=>t.has(r.split(".")[0]??r))}function mE(e){return typeof e=="string"?[]:Ne(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function Sh(e,t){if(e.kind==="browser")return{[e.name]:gE(e,t)};if(e.kind==="singleton")return{[e.singleton]:nt(e.assertion.value,se,t)};throw new Error("when() consequence must be a url (browser) or singleton assertion")}function gE(e,t){return Or(e.name,rt(e.value,se,t))}function yE(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function bE(e,t){return{files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:SE(e,t),url:e.kind==="goto"?rt(e.url,se,t):void 0,value:"value"in e?sh(e.value,t):void 0}}function SE(e,t){if(!(!("locator"in e)||e.locator==null))return In(e.locator,t)}function wE(e,t){if(e.kind==="browser"||e.kind==="singleton")return[];let r=uo(e,t),n="wait"in e?e.wait??"fast":"fast";return r==null?[]:[{budget:n,check:r}]}import{err as vE,ok as xE,okAsync as RE,Result as kE}from"neverthrow";function Tn(e,t,r){let n=e.tests.find(a=>a.name===t);if(n==null)throw new Error(`test "${t}" not found in lockfile`);let i=TE(e),o={env:new Map,generate:r.generate,indexed:i,overrides:new Map(Object.entries(r.params??{}).map(([a,l])=>[At(a),l]))};ME(n.params,se,o);let s=n.world.map(a=>OE(a,se,o));return r.materialize(s).map(a=>EE(DE(a,o.env,i),n,e))}function sl(e,t){let r=new Map(t.map(n=>[n.name,n]));return n=>RE(AE(n,e,r).rows)}function al(e){return t=>{let r=t.map(n=>({as:n.as,entity:n.entity,fields:n.fields}));return e(r).andThen(n=>CE(t,n))}}function wh(e,t){let r=co(t);return Object.fromEntries(Object.entries(e).filter(([n,i])=>r.includes(n)&&i!=null))}function co(e){return Object.entries(e.props).filter(([,t])=>t.stable).map(([t])=>t)}function EE(e,t,r){let n=Object.fromEntries(r.singletons.map(l=>[l.name,l.default])),i=Object.fromEntries(Object.entries(t.singletons).map(([l,u])=>[l,nt(u,se,e.env)])),o={...n,...i},s=new Set(r.singletons.filter(l=>l.source==="client").map(l=>l.name)),a=Object.fromEntries(Object.entries(o).filter(([l])=>s.has(l)));return{...e,clientState:a,snapshot:{...e.snapshot,singletons:o}}}function CE(e,t){let r=new Map(t.map(n=>[n.as,n]));return kE.combine(e.map(n=>{let i=r.get(n.as);return i==null?vE(Fp(n.as)):xE({as:n.as,entity:n.entity,row:i.row,session:i.session})}))}function AE(e,t,r){return e.reduce((n,i)=>{let o=IE(i.fields,n.env),s=FE({generate:t,model:i.model,seedPrefix:i.seedPrefix,set:o,valueSpaces:r}),a=Object.entries(s).map(([l,u])=>[`${i.as}.${l}`,u]);return{env:new Map([...n.env,...a]),rows:[...n.rows,{as:i.as,entity:i.entity,row:s,session:void 0}]}},{env:new Map,rows:[]})}function IE(e,t){return Object.fromEntries(Object.entries(e).map(([r,n])=>{if(Ne(n))return[r,PE(t,n.ref)];if(It(n))throw new Error(`template value not allowed in entity field "${r}"`);return[r,n]}))}function PE(e,t){let r=e.get(t);if(r==null)throw new Error(`setup ref "${t}" was not produced by an earlier entity`);return r}function TE(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function ME(e,t,r){Object.entries(e).forEach(([n,i])=>{let o=ht(t,n),s=r.indexed.valueSpaces.get(i.valueSpace);if(s==null)throw new Error(`unknown valueSpace "${i.valueSpace}" for param "${o}"`);let a=r.overrides.get(o)??i.example??r.generate.value({anchor:void 0,constraints:s.constraints,generator:s.generator,nullable:!1,seed:o,type:s.type,values:s.values,valueSpace:i.valueSpace});r.env.set(o,a)})}function OE(e,t,r){let n=r.indexed.models.get(e.entity);if(n==null)throw new Error(`model "${e.entity}" not found for setup "${e.as}"`);let i=ht(t,e.as),o=NE(e.set,t,r.env);return{as:i,entity:e.entity,fields:{...$E(n,o,i,r),...o},model:n,seedPrefix:i}}function NE(e,t,r){return Object.fromEntries(Object.entries(e).map(([n,i])=>[n,LE(i,t,r)]))}function LE(e,t,r){if(!Ne(e))return e;let n=ht(t,e.ref);return r.get(n)??{ref:n}}function $E(e,t,r,n){return Object.fromEntries(Object.entries(e.props).filter(([i,o])=>!o.optional&&!e.identity.includes(i)&&!(i in t)).map(([i,o])=>[i,vh({field:i,generate:n.generate,model:e,seedPrefix:r,spec:o,valueSpaces:n.indexed.valueSpaces})]))}function DE(e,t,r){let n=new Map,i=e.flatMap(o=>{let s=r.models.get(o.entity);if(s==null)throw new Error(`model "${o.entity}" not found for setup "${o.as}"`);Object.entries(o.row).forEach(([l,u])=>t.set(ht(At(o.as),l),u));let a=n.get(o.entity)??new Map;return a.set(jE(o.row,s),wh(o.row,s)),n.set(o.entity,a),o.session==null?[]:[o.session]});return{auth:_E(i),env:t,snapshot:{entities:VE(n),singletons:{}}}}function _E(e){if(e.length===0)return;let t=e.flatMap(r=>Object.entries(r.headers??{}));return{cookies:e.flatMap(r=>r.cookies),headers:t.length===0?void 0:Object.fromEntries(t),origins:e.flatMap(r=>r.origins)}}function FE({generate:e,model:t,seedPrefix:r,set:n,valueSpaces:i}){return{...Object.fromEntries(Object.entries(t.props).filter(([s])=>!(s in n)).map(([s,a])=>[s,vh({field:s,generate:e,model:t,seedPrefix:r,spec:a,valueSpaces:i})])),...n}}function vh({field:e,generate:t,model:r,seedPrefix:n,spec:i,valueSpaces:o}){let s=`${r.name}.${e}`;return t.value({anchor:void 0,constraints:o.get(s)?.constraints,generator:o.get(s)?.generator??"lorem.word",nullable:i.optional,seed:ht(n,e),type:i.type,values:o.get(s)?.values,valueSpace:s})}function jE(e,t){return t.identity.map(r=>String(e[r])).join(":")}function VE(e){return new Map([...e].map(([t,r])=>[t,new Map(r)]))}function mt(e){return`${e.test}#${String(e.index)}`}function Lr(e){let t=e.tests.flatMap(r=>fo(e,r.name));return Ct(t,r=>`${r.test}:${J(r.steps)}`)}function fo(e,t){let r=Ih(e,t),n=kh(r,e),i=xh(n,r.singletons),o=uC(r,lC(e));return BE(i,cC(r.steps),n).map(({chunk:a,guard:l},u)=>sC({chunk:a,guard:l,index:u,intent:r.intent,namespace:n.namespace,paramSpaceOf:o,testName:t}))}function xh(e,t){return{absences:iC(e),entities:oC(e),exclusives:e.exclusives,optionals:Ah(e.optionals,e),singletons:Object.fromEntries(Object.entries(t).filter(([,r])=>!Ne(r)&&!It(r)))}}function po(e,t,r){return Object.values(e).flatMap(n=>Ne(n)?ul(n.ref,r):[]).find(n=>n.entity===t)?.aliasPath}function BE(e,t,r){return t.reduce((n,i)=>({guard:UE(n.guard,i,r),guarded:[...n.guarded,{chunk:i,guard:eC(n.guard,i)}]}),{guard:e,guarded:[]}).guarded}function UE(e,t,r){let n=t.flatMap(i=>i.expect.filter(o=>o.kind==="state")).reduce((i,o)=>WE(i,o,r),e);return{...n,singletons:{...n.singletons,...ZE(t)}}}function WE(e,t,r){return t.assertion.kind==="deleted"?zE(e,t,r):t.assertion.kind==="created"?qE(e,t.entity,t.assertion.as,t.assertion.props,r):YE(e,t,r)}function zE(e,t,r){let n=po(t.key,t.entity,r.namespace),i=e.entities.find(a=>a.alias===n),o=Mn(GE(t.key),t.entity,r),s=i==null?{entity:t.entity,...o}:{entity:i.entity,...HE(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==n)}}function GE(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let r=t[1];return Ch(r)?[]:[[t[0],r]]}))}function HE(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(r=>!t.relations.some(n=>n.field===r.field)),...t.relations]}}function qE(e,t,r,n,i){let o=Mn(n,t,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!KE(o,s)),entities:[...e.entities,{alias:r,entity:t,...o}]}}function KE(e,t){return Object.entries(t.literals).every(([n,i])=>e.literals[n]===i)&&t.relations.every(n=>e.relations.some(i=>i.field===n.field&&i.targetAlias===n.targetAlias&&i.targetField===n.targetField))}function YE(e,t,r){if(t.assertion.kind!=="updated")return e;let n=po(t.key,t.entity,r.namespace);if(n==null)return e;let i=Mn(fr(t.assertion.props),t.entity,r),o=Object.entries(t.assertion.props).filter(([,a])=>Kt(a)).map(([a])=>a),s=a=>a.alias===n?JE(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a)),optionals:e.optionals.map(a=>s(a))}}function JE(e,t,r){let n=Object.entries(e.literals).filter(([i])=>!r.includes(i)&&!(i in t.literals));return{...e,literals:{...Object.fromEntries(n),...t.literals},relations:[...e.relations.filter(i=>!t.relations.some(o=>o.field===i.field)),...t.relations]}}function ZE(e){return e.reduce((t,r)=>({...t,...XE(r),...QE(r)}),{})}function XE(e){return e.action.kind==="goto"?{url:e.action.url}:{}}function QE(e){return Object.fromEntries(e.expect.flatMap(t=>t.kind==="browser"?[[t.name,t.value]]:t.kind==="singleton"?[[t.singleton,t.assertion.value]]:[]))}function eC(e,t){return t[0]?.action.kind!=="goto"?e:{...e,singletons:Object.fromEntries(Object.entries(e.singletons).filter(([r])=>r!=="url"))}}function ho(e,t){let r=Ih(e,t),n=kh(r,e);return{guard:xh(n,r.singletons),namespace:n.namespace,stable:n.stable}}function Rh(e,t){return[...new Set(e)].flatMap(r=>ul(r,t))}function it(e){return Ne(e)?[e.ref]:It(e)?e.template.flatMap(t=>Ne(t)?[t.ref]:[]):[]}function Yt(e){switch(e.kind){case"visible":case"disabled":case"enabled":case"focused":return Jt(e.locator);case"value":case"text":return[...Jt(e.locator),...it(e.value)];case"singleton":return it(e.assertion.value);case"browser":return it(e.value);case"state":return[...e.assertion.kind==="deleted"?[]:Object.values(fr(e.assertion.props)).flatMap(t=>it(t)),...Object.values(e.key).flatMap(t=>Eh(t))];case"not":return Yt(e.predicate);case"when":return[...Yt(e.condition),...Yt(e.consequence),...e.otherwise==null?[]:Yt(e.otherwise)];case"and":return e.predicates.flatMap(t=>Yt(t));case"count":return[]}}function kh(e,t){return{absences:e.absent,exclusives:e.exclusive,namespace:new Map([...e.world,...e.maybe].map(r=>[r.as,r.entity])),optionals:e.maybe,setups:e.world,stable:tC(t)}}function tC(e){let t=new Map(e.entities.map(r=>[r.name,r]));return(r,n)=>t.get(r)?.props[n]?.stable===!0}function Jt(e){return e.by==="inside"?[...Jt(e.scope),...Jt(e.target)]:e.by==="role"?e.name==null?[]:it(e.name):it(e.value)}function Eh(e){return Ch(e)?Object.values(e.selection.where).flatMap(t=>Eh(t)):it(e)}function Ch(e){return typeof e=="object"&&e!==null&&"kind"in e}function rC(e){return e.kind==="goto"?it(e.url):e.kind==="fill"||e.kind==="select"?[...Jt(e.locator),...it(e.value)]:e.kind==="press"?e.locator==null?[]:Jt(e.locator):(e.kind==="upload",Jt(e.locator))}function nC(e){return[...rC(e.action),...e.expect.flatMap(t=>Yt(t))]}function iC(e){return e.absences.map(t=>({entity:t.entity,...Mn(t.where,t.entity,e)}))}function Mn(e,t,r){let n=Object.entries(e).filter(([s])=>r.stable(t,s)),i=Object.fromEntries(n.flatMap(([s,a])=>Ne(a)||It(a)?[]:[[s,a]])),o=n.flatMap(s=>{let a=s[1];if(!Ne(a))return[];let l=ul(a.ref,r.namespace).at(0);return l==null?[]:[{entity:l.entity,field:s[0],targetAlias:l.aliasPath,targetField:l.field}]});return{literals:i,relations:o}}function Ah(e,t){return e.map(r=>({alias:r.as,entity:r.entity,...Mn(r.set,r.entity,t)}))}function oC(e){return Ah(e.setups,e)}function sC(e){let t=e.chunk.findIndex(s=>s.action.kind!=="goto"),r=t===-1?e.chunk:e.chunk.slice(0,t),n=e.chunk.slice(r.length),i=n.at(-1)??e.chunk.at(-1);if(i==null)throw new Error("empty transition chunk");let o=[...new Set(e.chunk.flatMap(s=>nC(s)))];return{effectStep:i,guard:e.guard,index:e.index,intent:e.intent,namespace:e.namespace,nav:r,paramSpaces:Object.fromEntries(o.filter(s=>e.paramSpaceOf.has(s)).map(s=>[s,e.paramSpaceOf.get(s)])),steps:n,test:e.testName,wait:th(n.flatMap(s=>aC(s)))}}function aC(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function ul(e,t){let r=e.lastIndexOf(".");if(r===-1)return[];let n=e.slice(0,r),i=t.get(n);return i==null?[]:[{aliasPath:n,entity:i,field:e.slice(r+1),ref:e}]}function Ih(e,t){let r=e.tests.find(n=>n.name===t);if(r==null)throw new Error(`test "${t}" not found in lockfile`);return r}function lC(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function uC(e,t){return new Map(Object.entries(e.params).map(([r,n])=>[r,t.get(n.valueSpace)]))}function cC(e){return ll(e,0,[],[])}function ll(e,t,r,n){let i=e[t];if(i==null)return r.length===0?n:[...n,r];let o=[...r,i];return dC(i)?ll(e,t+1,[],[...n,o]):ll(e,t+1,o,n)}function dC(e){return e.expect.some(t=>t.kind==="state")}function Ph(e){return Th(e,new Map)}function fC(e,t){return e.reduce((r,n)=>r??t(n),null)}function Th(e,t){let r=e.variables.find(n=>!t.has(n));return r==null?t:fC(e.domain(r),n=>{let i=new Map([...t,[r,n]]);return e.consistent(i)?Th(e,i):null})}function gt(e,t){let r=pC(e,t);if(r==null)return null;let n=SC(r);return wC(e.singletons,t,n)?n:null}function pC(e,t){let{absences:r,entities:n,exclusives:i,optionals:o}=e,s=new Map(n.map(u=>[u.alias,u])),a=Ph({variables:n.map(u=>u.alias),consistent:u=>hC(u)&&mC(n,u)&&yC(r,u,t),domain:u=>Nh(s.get(u),t)});if(a==null)return null;let l=Lh(o,a,t);return bC(i,[...n,...o],l,t)?l:null}function hC(e){let t=[...e.values()];return new Set(t).size===t.length}function mC(e,t){return e.every(r=>t.has(r.alias)?r.relations.every(n=>gC(r,n,t)):!0)}function gC(e,t,r){if(!r.has(t.targetAlias))return!0;let n=r.get(t.targetAlias)?.[t.targetField];return n==null?!0:r.get(e.alias)?.[t.field]===n}function yC(e,t,r){return e.every(n=>![...r.entities.get(n.entity)?.values()??[]].some(i=>Mh(i,n,t)))}function Mh(e,t,r){return Oh(e,t)?t.relations.every(n=>{if(!r.has(n.targetAlias))return!1;let i=r.get(n.targetAlias)?.[n.targetField];return i!=null&&e[n.field]===i}):!1}function Oh(e,t){return Object.entries(t.literals).every(([r,n])=>n===null?e[r]==null:e[r]===n)}function Nh(e,t){return e==null?[]:[...t.entities.get(e.entity)?.values()??[]].filter(r=>Oh(r,e))}function Lh(e,t,r){let n=e.reduce((i,o)=>{if(i.has(o.alias))return i;let s=new Set(i.values()),a=Nh(o,r).find(l=>!s.has(l)&&Mh(l,o,i));return a==null?i:new Map([...i,[o.alias,a]])},t);return n.size===t.size?n:Lh(e,n,r)}function bC(e,t,r,n){return e.every(i=>{let o=t.filter(a=>a.entity===i&&r.has(a.alias)).length;return(n.entities.get(i)?.size??0)===o})}function SC(e){return new Map([...e].flatMap(([t,r])=>Object.entries(r).flatMap(n=>{let i=n[1];return typeof i=="string"||typeof i=="number"||typeof i=="boolean"?[[At(`${t}.${n[0]}`),i]]:[]})))}function wC(e,t,r){return Object.entries(e).every(([n,i])=>{if(!so(i,se,r))return!1;let o=nt(i,se,r),s=t.singletons[n],a=xt.safeParse(n);return a.success?Ba(a.data,o,s):s===o})}function mo(e,t,r){let n=gt(e.guard,t);return n==null?null:new Map([...n,...Object.entries(r).map(([i,o])=>[At(i),o])])}function go(e,t){let r=Pn(e.effectStep,t),n=RC(e,t),i=[...e.nav,...e.steps].map(o=>Pn(o,t));return{effect:kC(r.effect,n),steps:i.map(o=>({action:o.action,effect:o.effect,obligations:o.obligations,reconcile:o.reconcile,verifyChanges:o.verifyChanges}))}}function cl(e,t,r){return gt(e.guard,r)==null?!1:pr(t(r))!==pr(r)||EC(e)||vC(e)}function vC(e){return[...e.nav,...e.steps].every(t=>t.expect.every(r=>r.kind!=="state"))}var $h=new WeakMap;function pr(e){let t=$h.get(e);if(t!=null)return t;let r=J({entities:[...e.entities].map(([n,i])=>[n,[...i]]),singletons:xC(e.singletons)});return $h.set(e,r),r}function xC(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>t==="url"&&typeof r=="string"?[t,kt(r)]:[t,r]))}function RC(e,t){let r=e.nav.at(-1);return r==null?void 0:Pn(r,t).action.url}function kC(e,t){if(t==null)return e;let r=kt(t);return n=>{let i=e(n);return{...i,singletons:{...i.singletons,url:r}}}}function EC(e){return e.effectStep.expect.some(t=>t.kind==="state"&&t.assertion.kind==="updated"&&Object.values(t.assertion.props).some(r=>Kt(r)))}function On(e,t,r){let n=mo(e,t.snapshot,r);if(n==null)return null;let i=CC(e,n);return i==null||!cl(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function Dh(e,t,r){let n=mo(e,t.snapshot,r);if(n==null)return"guard-unsatisfied";try{return go(e,n),"no-effect"}catch{return"unresolvable"}}function CC(e,t){try{return go(e,t)}catch{return null}}function $r(e,t,r){return e.flatMap((n,i)=>{let o=r(n),s=On(n,t,o);return s==null?[]:[{firing:s,idx:i,label:mt(n),params:o}]})}var AC={absences:[],entities:[],exclusives:[],optionals:[],singletons:{}};function Nn(e){return{...AC,...e}}function dl(e){return IC(e).flatMap(t=>PC(t))}function IC(e){return[...e.reduce((r,n)=>{let i=J([n.when.singletons,n.consequence]);return new Map([...r,[i,[...r.get(i)??[],n]]])},new Map).values()]}function PC(e){if(e.length<2)return[];let t=e.map(o=>new Set(o.when.entities.map(s=>_h(s)))),[r]=t;if(r==null)return[];let n=[...r].filter(o=>t.every(s=>s.has(o))),i=e.toSorted((o,s)=>o.when.entities.length-s.when.entities.length)[0];return i==null||n.length===i.when.entities.length?[]:TC(i,n,OC(e))}function _h(e){return J([e.entity,e.literals])}function TC(e,t,r){let n=e.when.entities.filter(s=>t.includes(_h(s))),i=new Set(n.map(s=>s.alias));if(![...e.refs].every(s=>i.has(s)))return[];let o=Nn({entities:n.map(s=>MC(s,i)),optionals:e.when.optionals.filter(s=>i.has(s.alias)),singletons:e.when.singletons});return[{consequence:e.consequence,origin:{kind:"generalized",tests:r},refs:e.refs,when:o}]}function MC(e,t){return{...e,relations:e.relations.filter(r=>t.has(r.targetAlias))}}function OC(e){return[...new Set(e.flatMap(t=>t.origin==null?[]:t.origin.kind==="generalized"?t.origin.tests:[t.origin.test]))]}function NC(e){return e.flatMap((t,r)=>e.slice(r+1).flatMap(n=>Bh(t,n)))}function Vh(e,t){return Bh(e,t).length>0}function Bh(e,t){let r=Fh(e.when,t.when);return!r&&!Fh(t.when,e.when)||!$C(e.consequence,t.consequence)?[]:[{a:e.consequence,b:t.consequence,when:r?t.when:e.when}]}function Fh(e,t){return fl(e.entities,t.entities)&&fl(e.absences,t.absences)&&fl(e.optionals,t.optionals)&&e.exclusives.every(r=>t.exclusives.includes(r))&&LC(e.singletons,t.singletons)}function fl(e,t){let r=new Set(t.map(n=>J(n)));return e.every(n=>r.has(J(n)))}function LC(e,t){return Object.entries(e).every(([r,n])=>J(t[r])===J(n))}function $C(e,t){return e.kind==="not"?pl(e.predicate,t):t.kind==="not"?pl(e,t.predicate):DC(e,t)||_C(e,t)}function pl(e,t){return e.kind===t.kind&&"locator"in e&&"locator"in t&&Uh(e,t)}function Uh(e,t){return"locator"in t&&J(e.locator)===J(t.locator)}function DC(e,t){let r=new Set([e.kind,t.kind]);return r.has("enabled")&&r.has("disabled")&&"locator"in e&&"locator"in t?Uh(e,t):!1}function _C(e,t){let r=jh(e),n=jh(t);return r==null||n==null||e.kind!==t.kind?!1:pl(e,t)&&J(r)!==J(n)}function jh(e){return e.kind==="value"||e.kind==="text"?e.value:null}function FC(e,t){return e.flatMap(r=>{let n=jC(r),i=new Set(r.guard.absences.map(o=>o.entity));return t.flatMap(o=>VC(r,o,n,i))})}function jC(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(r=>r.kind==="state"&&r.assertion.kind==="deleted"?[r.entity]:[])))}function VC(e,t,r,n){let{source:i,target:o}=t.reference;return!r.has(o)||r.has(i)||n.has(i)?[]:[{invariant:t,source:i,target:o,transition:mt(e)}]}function ml(e){return J({consequence:e.consequence,when:e.when})}function gl(e){let t=[...BC(e),...ZC(e)],r=dl(t).reduce((n,i)=>[...t,...n].some(s=>Vh(i,s))?n:[...n,i],[]);return Ct([...t,...r],ml)}function yl(e){return e.kind==="not"?yl(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="value"||e.kind==="text"}function bl(e,t,r){if(gt(e.when,t)!=null)return null;let n=gt(e.when,r);return n==null?null:QC(e,n)}function BC(e){return Ct(e.tests.flatMap(t=>UC(e,t)),ml)}function UC(e,t){let r=ho(e,t.name);return t.steps.reduce((n,i)=>({guard:WC(n.guard,i,r),laws:[...n.laws,...JC(i,n.guard,r.namespace,{kind:"test",test:t.name})]}),{guard:r.guard,laws:[]}).laws}function WC(e,t,r){return t.expect.reduce((n,i)=>i.kind==="state"?zC(n,i,r):n,e)}function zC(e,t,r){if(t.assertion.kind==="created"){let o=GC(t.assertion.as,t.entity,t.assertion.props,r);return{...e,entities:[...e.entities,o]}}let n=po(t.key,t.entity,r.namespace);if(n==null)return e;if(t.assertion.kind==="deleted")return KC(e,n);let i=fr(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===n?hl(o,i,r):o),optionals:e.optionals.map(o=>o.alias===n?hl(o,i,r):o)}}function GC(e,t,r,n){return hl({alias:e,entity:t,literals:{},relations:[]},r,n)}function hl(e,t,r){return Object.entries(t).reduce((n,[i,o])=>{if(It(o)||!r.stable(e.entity,i))return n;if(Ne(o)){let s=HC(o.ref,i,r.namespace);return{...n,literals:qC(n.literals,i),relations:s==null?n.relations:[...Wh(n.relations,i),s]}}return{...n,literals:{...n.literals,[i]:o},relations:Wh(n.relations,i)}},e)}function HC(e,t,r){let n=e.lastIndexOf(".");if(n===-1)return;let i=e.slice(0,n),o=r.get(i);return o==null?void 0:{entity:o,field:t,targetAlias:i,targetField:e.slice(n+1)}}function qC(e,t){return Object.fromEntries(Object.entries(e).filter(([r])=>r!==t))}function Wh(e,t){return e.filter(r=>r.field!==t)}function KC(e,t){let r=[...e.entities,...e.optionals].find(i=>i.alias===t),n=YC(e,t);return r==null?n:{...n,absences:[...n.absences,{entity:r.entity,literals:r.literals,relations:r.relations}]}}function YC(e,t){return{...e,entities:e.entities.filter(r=>r.alias!==t),optionals:e.optionals.filter(r=>r.alias!==t)}}function JC(e,t,r,n){if(e.action.kind!=="goto")return[];let i=e.action.url;return e.expect.filter(o=>yl(o)).map(o=>zh({consequence:o,guard:t,namespace:r,origin:n,url:i}))}function zh({consequence:e,guard:t,namespace:r,origin:n,url:i}){return{consequence:e,origin:n,refs:new Set(Rh([...it(i),...Yt(e)],r).map(o=>o.aliasPath)),when:{...t,singletons:{...t.singletons,url:i}}}}function ZC(e){return Ct(Lr(e).flatMap(t=>XC(t)),ml)}function XC(e){let t=e.nav.at(-1),r=e.steps[0]?.action,n=r!=null&&"locator"in r?r.locator:void 0;return t==null||t.action.kind!=="goto"||n==null?[]:[zh({consequence:{kind:"enabled",locator:n,wait:void 0},guard:e.guard,namespace:e.namespace,origin:{intent:e.intent,kind:"trigger",test:e.test},url:t.action.url})]}function QC(e,t){try{let r=uo(e.consequence,t);return r==null?null:{check:r}}catch{return null}}function Sl(e){return Ja(e.tests.flatMap(t=>eA(e,t.name)))}function wl(e,t){return gt(e.when,t)==null?!1:gt(e.holds,t)==null}function eA(e,t){let r=ho(e,t);return r.guard.entities.flatMap(n=>n.relations.flatMap(i=>tA(e,n,i,r.namespace)?iA(n,i,r.namespace):[]))}function tA(e,t,r,n){let i=n.get(r.targetAlias);return i!=null&&!rA(e,t.entity,r.field)&&nA(e,i,r.targetField)}function rA(e,t,r){return e.entities.find(n=>n.name===t)?.props[r]?.optional===!0}function nA(e,t,r){return e.entities.find(n=>n.name===t)?.identity.includes(r)===!0}function iA(e,t,r){let n=r.get(t.targetAlias);if(n==null)return[];let i=Gh(e.alias,e.entity),o=Gh(t.targetAlias,n);return[{holds:Nn({entities:[{...i,relations:[t]},o]}),reference:{field:t.field,source:e.entity,target:n,targetField:t.targetField},when:Nn({entities:[i]})}]}function Gh(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function vl(e,t,r){return t.steps.map(n=>({effect:n.effect,obligations:n.obligations.map(i=>({budget:i.budget,check:{kind:"poll",run:()=>r.evaluate(i.check)},source:{check:i.check,kind:"step"}})),reconcile:n.reconcile,settle:e.wait,step:{action:n.action,intent:e.intent,test:e.test},verifyChanges:n.verifyChanges,guard:()=>!0,perform:()=>r.perform(n.action)}))}async function Hh(e,t){let{params:r,transition:n}=e.firing,i=On(n,e.state,r);if(i==null){let s={intent:n.intent,kind:"unfireable",reason:Dh(n,e.state,r),test:n.test};return{label:mt(n),next:e.state,result:{finalModel:e.state.snapshot,findings:[s]}}}let o=await Qa({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,lawObligations:sA(e.laws,e.invariants,e.driver),observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,steps:vl(e.firing.transition,i.resolved,e.driver)},t);return{label:mt(e.firing.transition),next:{snapshot:o.finalModel},result:o}}function oA(e,t){return wl(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},source:{invariant:e,kind:"invariant"}}]:[]}function sA(e,t,r){return(n,i)=>[...e.flatMap(o=>aA(o,n,i,r)),...t.flatMap(o=>oA(o,i))]}function aA(e,t,r,n){let i=bl(e,t,r);return i==null?[]:[{budget:"fast",check:{kind:"poll",run:()=>n.evaluate(i.check)},source:{check:i.check,kind:"law",origin:e.origin}}]}function Rl(e,t){return xl({acc:{findings:[],fired:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function xl({acc:e,index:t,params:r,signal:n,state:i,stepBase:o}){qt(n);let s=r.sequence[t];if(s==null)return e;let a=Date.now(),l=[],u=await Hh({canon:r.canon,classify:r.classify,driver:r.driver,firing:s,invariants:r.invariants,laws:r.laws,onAssertion:r.onAssertion,state:i,onStep:d=>{l.push(d.index),r.onEvent({endMs:d.endMs,findings:d.findings,index:o+d.index,kind:"step",startMs:d.startMs})}},n);if(u==null)return xl({acc:e,index:t+1,params:r,signal:n,state:i,stepBase:o});r.onEvent({endMs:Date.now(),intent:s.transition.intent,kind:"fired",startMs:a}),u.result.findings.forEach(d=>{r.onEvent({finding:d,kind:"finding"})});let c={findings:[...e.findings,...u.result.findings],fired:[...e.fired,u.label]};return xl({acc:c,index:t+1,params:r,signal:n,state:u.next,stepBase:o+l.length})}var Dr={value:e=>lA(e)};function El(e,t){return{value:r=>e.value({...r,seed:`${t}:${r.seed}`})}}function Cl(e,t){return{value:r=>e.value({...r,anchor:t})}}function lA({anchor:e,constraints:t,generator:r,nullable:n,seed:i,type:o,values:s,valueSpace:a}){let l=kl(`${a}:${i}`);return n&&l%4===0?null:s!=null&&s.length>0?s[l%s.length]??s[0]??null:r==="date.iso"?uA({anchor:e,constraints:t,n:l,timeHash:kl(`${a}:${i}#tod`)}):o==="number"?cA(l,t):o==="boolean"?l%2===0:dA(r,l.toString(36))}var yo=864e5;function uA({anchor:e,constraints:t,n:r,timeHash:n}){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+r%o,a=Math.floor(i/yo)*yo;return new Date(a+s*yo+n%yo).toISOString()}function kl(e,t=0,r=7){return t>=e.length?r>>>0:kl(e,t+1,r*31+(e.codePointAt(t)??0)>>>0)}function cA(e,t){if(t?.kind!=="number"||t.min==null||t.max==null)throw new Error("number value space requires min and max constraints");let r=t.max-t.min+1;return r<=0?t.min:t.min+e%r}function dA(e,t){if(e==="internet.email")return`${t}@test.ripplo.ai`;if(e==="internet.url")return`https://${t}.example.com`;let r=e.split(".").at(-1);if(r==null)throw new Error(`generator "${e}" has no "."-suffix`);return`${r}-${t}`}import{ResultAsync as Il}from"neverthrow";var Ln=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}};function Al(e){return{read:t=>fA(t,e),seedScript:t=>`globalThis[${JSON.stringify(Ia)}] = ${JSON.stringify(t)};`}}async function fA(e,t){let r={title:await e.title(),url:kt(e.url()),viewport:mA(e.viewportSize())};if(t.length===0)return r;let n=await e.evaluate(hA,{mountKey:qi,names:t,timeoutMs:pA});if(n.kind==="unmounted")throw new Ln(qi);return{...r,...n.values}}var pA=5e3;async function hA(e){let t=Date.now()+e.timeoutMs;for(;Reflect.get(globalThis,e.mountKey)==null&&Date.now()<t;)await new Promise(n=>setTimeout(n,25));let r=Reflect.get(globalThis,e.mountKey);return r==null?{kind:"unmounted"}:{kind:"values",values:Object.fromEntries(e.names.map(n=>[n,r.readSingleton(n)??null]))}}function mA(e){return e==null?"":`${String(e.width)}x${String(e.height)}`}function Tl(e,t,r){return{evaluate:n=>Il.fromPromise(Yh(gA(e,r,n),`check ${n.kind}`),qh),observe:()=>t.read().andThen(n=>Il.fromPromise(Yh(Jh(e,r,0),"observe"),qh).map(i=>({snapshot:{...n,singletons:{...n.singletons,...i}}}))),perform:n=>Il.fromPromise(Xh(e,n,0),i=>jp(n.kind,i))}}async function gA(e,t,r){try{return await tm(e,t,r)}catch(n){if(Zh(n))return!1;throw n}}function qh(e){return e instanceof Ln?$p(e.mountKey):Vp(e)}var yA=[100,250,500];async function Jh(e,t,r){try{return await t.read(e)}catch(n){let i=yA[r];if(i==null||!Zh(n))throw n;return await em(i),Jh(e,t,r+1)}}function Zh(e){let t=e instanceof Error?e.message:String(e);return/Execution context was destroyed|Cannot find context with specified id|[Ff]rame was detached|frame got detached/.test(t)}var Kh=35e3;function Yh(e,t){let r,n=new Promise((i,o)=>{r=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(Kh)}ms`))},Kh)});return Promise.race([e,n]).finally(()=>{clearTimeout(r)})}var bA=[250,750,2e3];async function Xh(e,t,r){try{await SA(e,t)}catch(n){let i=bA[r];if(i==null||!xA(n))throw n;await em(i),await Xh(e,t,r+1)}}async function SA(e,t){if(t.kind==="goto"){await e.goto(_r(t.url,t,"url"));return}if(t.kind==="press"&&t.locator==null){await e.keyboard.press(_r(t.key,t,"key"));return}await wA(Qh(e,t.locator),t)}function _r(e,t,r){if(e==null)throw new Error(`action "${t.kind}" requires ${r}`);return e}function wA(e,t){switch(t.kind){case"goto":throw new Error("goto must not be located");case"fill":return e.fill(String(_r(t.value,t,"value")));case"clear":return e.clear();case"click":return e.click();case"dblclick":return e.dblclick();case"check":return e.check();case"uncheck":return e.uncheck();case"hover":return e.hover();case"select":return e.selectOption(String(_r(t.value,t,"value")));case"upload":return e.setInputFiles(_r(t.files,t,"files"));case"press":return e.press(_r(t.key,t,"key"))}}function Qh(e,t){if(t==null)throw new Error("action requires a locator");return Pl(e,t)}function Pl(e,t){return t.by==="testId"?e.getByTestId(t.value):t.by==="inside"?Pl(Pl(e,t.scope),t.target):e.locator(vA(t.role,t.name))}function vA(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}function xA(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 em(e){return new Promise(t=>{setTimeout(t,e)})}async function tm(e,t,r){if(r.kind==="browser")return RA(e,t,r.name,r.value);if(r.kind==="not")return!await tm(e,t,r.inner);let n=Qh(e,r.locator);return r.kind==="visible"?n.isVisible():r.kind==="disabled"?n.isDisabled():r.kind==="enabled"?n.isEnabled():r.kind==="focused"?n.evaluate(i=>i===i.ownerDocument.activeElement):r.kind==="value"?await n.inputValue()===r.value:(await n.textContent()??"").includes(r.value)}async function RA(e,t,r,n){let o=(await t.read(e))[r];return typeof o=="string"&&o.includes(n)}async function Ml({baseUrl:e,browser:t,capture:r,clientState:n,engine:i,reader:o,session:s}){let a=await t.newContext({baseURL:e,reducedMotion:"reduce",storageState:s==null?void 0:{cookies:s.cookies,origins:s.origins}});s?.headers!=null&&await a.setExtraHTTPHeaders(s.headers),await a.addInitScript(i.seedScript(n));let l=r==null?kA():await r.hub.attach(a,r.runId),u=await a.newPage();return l.onPage(u),{driver:EA(Tl(u,o,i),l),emitAssertion:l.emitAssertion,close:()=>CA({context:a,handle:l})}}async function Ol(e,t){let r=await nm(e);try{return await t(r)}finally{await r.close()}}function kA(){return{emitAction:()=>{},emitAssertion:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function nm(e){let{chromium:t}=await import("playwright");return t.launch({headless:!e})}function im({headed:e}){let t;return{acquire:async()=>{let i=t;if(i!=null){let o=await i.catch(()=>{});if(o?.isConnected()===!0)return o;t===i&&(t=void 0)}return t??=nm(e),t},close:async()=>{let i=t;t=void 0,i!=null&&await i.then(o=>o.close()).catch(()=>{})}}}function EA(e,t){return{evaluate:e.evaluate,observe:e.observe,perform:r=>(t.emitAction(r),e.perform(r))}}async function CA({context:e,handle:t}){await rm(t.finish()),await rm(e.close())}var AA=15e3;async function rm(e){let t,r=new Promise(n=>{t=setTimeout(n,AA)});await Promise.race([e.catch(()=>{}),r]).finally(()=>{clearTimeout(t)})}import{err as IA,ok as PA,Result as Nl}from"neverthrow";function Ll(e,t,r){return{read:()=>r.read(e.map(n=>n.name),t).andThen(n=>TA(e,n))}}function TA(e,t){return Nl.combine(e.map(r=>MA(r,t.entities[r.name]??[]).map(n=>[r.name,n]))).map(r=>({entities:new Map(r),singletons:t.singletons}))}function MA(e,t){let r=co(e);return Nl.combine(t.map(n=>OA(n,e).map(i=>[i,NA(n,r)]))).map(n=>new Map(n))}function OA(e,t){return Nl.combine(t.identity.map(r=>{let n=e[r];return n==null?IA(_p(t.name,r)):PA(String(n))})).map(r=>r.join(":"))}function NA(e,t){let r=t.map(n=>[n,e[n]]).filter(n=>n[1]!=null);return Object.fromEntries(r)}var sm=Ti(fa(),1);import LA from"crypto";import{err as $A,errAsync as om,ok as DA,ResultAsync as bo}from"neverthrow";var _A=3e4,FA=[250,750,2e3];function $l({baseUrl:e,runId:t,secret:r},n){let i=new sm.Webhook(r),o=(s,a,l)=>jA({baseUrl:e,body:a,path:s,retry:l.retry,schema:l.schema,signal:l.signal,webhook:i});return{query:{read:(s,a)=>o("/state",{entities:s,runId:t,singletons:a},{retry:"transient",schema:Na,signal:n}).map(l=>({entities:l.entities,singletons:l.singletons}))},setupWorld:s=>o("/setup",{entities:s,runId:t},{retry:"connection",schema:Oa,signal:n}).map(a=>a.rows),teardown:()=>o("/teardown",{runId:t},{retry:"connection",schema:La,signal:void 0}).map(()=>{})}}function jA(e){return am(e.retry,()=>zA(e),0)}function am(e,t,r){return t().orElse(n=>{let i=FA[r];return i==null||!BA(n,e)?om(n):bo.fromSafePromise(WA(i)).andThen(()=>am(e,t,r+1))})}var VA=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function BA(e,t){return e.kind==="aborted"?!1:UA(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function UA(e){return e.kind==="engine-network"&&e.code!=null&&VA.has(e.code)}function WA(e){return new Promise(t=>{setTimeout(t,e)})}function zA({baseUrl:e,body:t,path:r,schema:n,signal:i,webhook:o}){let s=JSON.stringify(t);return bo.fromPromise(fetch(`${e}${r}`,{body:s,headers:{"Content-Type":"application/json",...GA(o,s)},method:"PUT",signal:HA(i)}),a=>ro(r,a)).andThen(a=>qA(a,r)).andThen(a=>KA(n,a,r)).mapErr(a=>i?.aborted===!0?Bp():a)}function GA(e,t){let r=`msg_${LA.randomUUID()}`,n=new Date;return{"webhook-id":r,"webhook-signature":e.sign(r,n,t),"webhook-timestamp":String(Math.floor(n.getTime()/1e3))}}function HA(e){let t=AbortSignal.timeout(_A);return e==null?t:AbortSignal.any([e,t])}function qA(e,t){return e.ok?bo.fromPromise(e.json(),r=>ro(t,r)):bo.fromPromise(e.text().catch(()=>""),r=>ro(t,r)).andThen(r=>om(Lp(t,e.status,r)))}function KA(e,t,r){let n=e.safeParse(t);return n.success?DA(n.data):$A(Dp(r,n.error))}var le=Ti(cm(),1),W={actual:e=>le.default.red(e),bad:e=>le.default.red(le.default.bold(e)),bold:e=>le.default.bold(e),dim:e=>le.default.dim(e),expected:e=>le.default.green(e),good:e=>le.default.green(le.default.bold(e)),heading:e=>le.default.bold(le.default.cyan(e)),path:e=>le.default.cyan(le.default.underline(e)),warn:e=>le.default.yellow(le.default.bold(e))},XA={assertion:le.default.yellow,consistency:le.default.magenta,driver:le.default.red,illegal:le.default.cyan,invariant:le.default.yellow,unfireable:le.default.red};function $n(e){return`${le.default.red(le.default.bold("\u2717"))} ${XA[e](le.default.bold(e.toUpperCase()))}`}var QA=le.default.red("\u2717"),LW=le.default.green("\u2713"),dm=le.default.dim("\u203A"),eI=8;function te(e,t,r){let n=r==null?"":` ${W.dim(r)}`;return` ${W.dim(e.padStart(eI))} ${t}${n}`}function Fr(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${Fr(e.scope)} \u25B8 ${Fr(e.target)}`:e.name==null?e.role:`${e.role} "${e.name}"`}function Fl(e){return e.url!=null?`${e.kind} ${e.url}`:e.locator!=null?`${e.kind} ${Fr(e.locator)}`:e.kind}function Dn(e){return e.kind==="not"?`not ${Dn(e.inner)}`:e.kind==="browser"?`${e.name}="${e.value}"`:e.kind==="value"||e.kind==="text"?`${e.kind} ${Fr(e.locator)}="${e.value}"`:`${e.kind} ${Fr(e.locator)}`}function _n(e){let{field:t,source:r,target:n,targetField:i}=e.reference;return`${r}.${t} \u2192 ${n}.${i}`}function hm(e){return`${e.intent} \u203A ${Fl(e.action)}`}function mm(e){return e.kind==="invariant"?`invariant ${_n(e.invariant)}`:`${e.kind} ${Dn(e.check)}`}function ot(e){return e==null?"\u2205":JSON.stringify(e)}function gm(e){return e.kind==="ghost-write"?`${e.entity} "${e.key}" exists in SUT but model expected none`:e.kind==="absent"?`${e.entity} "${e.key}" expected by model but absent in SUT`:e.kind==="field-mismatch"?`${e.entity}.${e.field} [${e.key}] model=${ot(e.snapshot)} sut=${ot(e.sut)}`:e.kind==="expected-change"?`${e.entity}.${e.field} [${e.key}] expected to change but stayed ${ot(e.value)}`:`${e.singleton} model=${ot(e.snapshot)} sut=${ot(e.sut)}`}function jl(e){return{label:mm(e.source),step:hm(e.step)}}function Fn(e){return e.kind==="consistency"?uI(e):e.kind==="obligation"?mI(e.source,e.step,e.budget):e.kind==="illegal-transition"?hr("illegal","guard was false before this step",e.step,[te("meaning",W.dim("the action fired from a state the model says is unreachable"),void 0)]):e.kind==="unfireable"?hr("unfireable",`could not fire "${e.intent}"`,void 0,[te("reason",W.actual(bm(e.reason)),void 0),te("meaning",W.dim("a planned move was skipped \u2014 never silently drop it"),void 0)]):hr("driver","the browser failed to run this step",e.step,[te("cause",W.actual(Et(e.error)),void 0),te("decide",W.dim("environment/infra failure \u2014 fix the run environment (daemon, dev server, ports); never weaken the model or app for a driver failure"),void 0)])}function ym(e){return rI(nI(e))}var tI=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function rI(e){return e.replaceAll(tI,"").replaceAll(/\s+/g," ").trim()}function nI(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${gm(e.divergence)}${t}`}return e.kind==="obligation"?`${yI(e.source)} failed at "${e.step.intent}": ${bI(e.source)}`:e.kind==="illegal-transition"?`guard was false before "${e.step.intent}" \u2014 the action fired from a state the model says is unreachable`:e.kind==="unfireable"?`could not fire "${e.intent}" \u2014 ${bm(e.reason)}`:`driver failed at "${e.step.intent}": ${Et(e.error)}`}var iI={"guard-unsatisfied":"the guard isn't satisfied by the live state","no-effect":"the move has no observable effect from this state",unresolvable:"a step references a value the model can't resolve yet (e.g. a not-yet-created id)"};function bm(e){return iI[e]}function oI({debugDir:e,runId:t}){let r=`${e}/${t}`;return te("behavior",W.path(`${r}/behavior.jsonl`),void 0)}function sI(e){if(e.kind==="cascade-gap"){let{gap:n}=e,i=`${n.transition} deletes ${n.target} but leaves ${n.source} dangling`;return`${$n("invariant")} ${W.bold(i)}
|
|
38
38
|
${te("breaks",W.dim(_n(n.invariant)),void 0)}`}if(e.kind==="create-gap"){let{gap:n}=e,i=`${n.transition} creates ${n.entity} without setting required field(s)`;return`${$n("invariant")} ${W.bold(i)}
|
|
39
39
|
${te("missing",W.dim(n.missing.join(", ")),void 0)}`}let{conflict:t}=e,r=`view laws contradict: ${t.a.kind} vs ${t.b.kind}`;return`${$n("invariant")} ${W.bold(r)}
|
|
40
|
-
${te("when",W.dim(JSON.stringify(t.when.singletons)),void 0)}`}function
|
|
41
|
-
`)}function cI(e){return e.pending?hr("consistency",pI(e.divergence),e.step,[...hm(e.divergence),te("meaning",W.dim(`the write never landed within the ${hI(e.budget)} settle budget \u2014 the app still showed the pre-step value, not a wrong one`),void 0),te("fix",W.dim("declare wait: on the expectation (or a slower tier) if this write is legitimately slow"),void 0)]):hr("consistency",mI(e.divergence),e.step,[...hm(e.divergence),te("decide",W.dim(fI(e.divergence)),void 0)])}var dI={absent:"app bug if the write was promised; if it only happens from a different starting state, restrict this test's given and cover that state in its own test","expected-change":"app bug if this action should change it; if the change needs other preconditions, split that case into its own test with the right given","field-mismatch":"app bug if the model value is the promised behavior; if the app legitimately owns this value, mark the field stable: false or assert changed() instead","ghost-write":"declare the missing effect on the acting step (Entity.created/updated/deleted), or if this write belongs to a different flow, cover it in that flow's test","singleton-mismatch":"app bug if the model value is the promised behavior; otherwise correct the singleton's expected value at the step that sets it"};function fI(e){return dI[e.kind]}function pI(e){return e.kind==="field-mismatch"?`${e.entity}.${e.field} write never landed`:e.kind==="ghost-write"?`${e.entity} "${e.key}" delete never landed`:e.kind==="absent"?`${e.entity} "${e.key}" create never landed`:e.kind==="expected-change"?`${e.entity}.${e.field} never changed`:`${e.singleton} write never landed`}function hm(e){if(e.kind==="field-mismatch")return[te("row",W.dim(`${e.entity} ${e.key}`),void 0),te("expected",W.expected(ot(e.snapshot)),"model predicted this"),te("actual",W.actual(ot(e.sut)),"app showed this")];if(e.kind==="singleton-mismatch")return[te("expected",W.expected(ot(e.snapshot)),"model predicted this"),te("actual",W.actual(ot(e.sut)),"app showed this")];if(e.kind==="expected-change")return[te("row",W.dim(`${e.entity} ${e.key}`),void 0),te("expected",W.expected("a different value"),"changed() asserted a change"),te("actual",W.actual(ot(e.value)),"app left it unchanged")];let t=e.kind==="ghost-write"?"an app write the model never declared \u2014 unmodeled side effect":"the model expected this row but the app has none";return[te("meaning",W.dim(t),void 0)]}function hI(e){return`${String(En[e]/1e3)}s "${e}"`}function mI(e){return e.kind==="field-mismatch"?`${e.entity}.${e.field} diverged`:e.kind==="ghost-write"?`${e.entity} "${e.key}" written but never modeled`:e.kind==="absent"?`${e.entity} "${e.key}" missing in the app`:e.kind==="expected-change"?`${e.entity}.${e.field} never changed`:`${e.singleton} diverged`}function gI(e,t,r){if(e.kind==="invariant")return hr("invariant",`${_n(e.invariant)} violated`,t,[te("meaning",W.dim("a referenced row went missing after this step"),void 0)]);let n=e.kind==="law"?"view law never held":"expectation never held",i=e.kind==="law"&&e.origin!=null?[yI(e.origin)]:[];return hr("assertion",n,t,[te("check",W.warn(Dn(e.check)),void 0),...i,te("budget",W.dim(`${r} (polled until timeout)`),void 0),te("decide",W.dim("wrong locator/accessible name, UI regression, or the expectation only holds under a narrower given \u2014 confirm in behavior.jsonl before changing the test"),void 0)])}function yI(e){if(e.kind==="test")return te("law from",W.dim(`an assertion in test "${e.test}"`),void 0);if(e.kind==="trigger")return te("law from",W.dim(`the trigger of "${e.intent}" (test "${e.test}")`),void 0);let t=e.tests.map(r=>JSON.stringify(r)).join(", ");return te("law from",W.dim(`generalized across tests ${t}`),void 0)}function bI(e){return e.kind==="invariant"?"invariant":e.kind==="law"?"law":"assertion"}function SI(e){return e.kind==="invariant"?_n(e.invariant):Dn(e.check)}import{err as T8,ok as M8,ResultAsync as O8}from"neverthrow";import kb from"path";import{existsSync as wI}from"fs";import{createRequire as vI}from"module";import{fileURLToPath as xI}from"url";import{Worker as RI}from"worker_threads";var kI=vI(import.meta.url);function vm(e){let t=new RI(EI(),{workerData:e});t.unref();let r=new Map,n={next:0};t.on("message",o=>{let s=r.get(o.seq);s!=null&&(r.delete(o.seq),s())});let i=o=>{t.postMessage(o)};return{close:({noticeLineIfNoRrweb:o,runId:s})=>{let a=n.next;return n.next+=1,new Promise(l=>{r.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 EI(){try{return kI.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(r=>xI(new URL(r,import.meta.url))),t=e.find(r=>wI(r));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}import{readFile as CI}from"fs/promises";import{createRequire as AI}from"module";import{fileURLToPath as II}from"url";var PI=AI(import.meta.url);function Bl(e,t){try{return PI.resolve(e)}catch{return II(new URL(`assets/${t}`,import.meta.url))}}var TI=Bl("@ripplo/browser-trace/bundle","browser-trace.js");async function Rm(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await MI())}var xm;function MI(){return xm??=CI(TI,{encoding:"utf8"}),xm}import{readFile as e6}from"fs/promises";var OI=Object.defineProperty,NI=(e,t,r)=>t in e?OI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k=(e,t,r)=>NI(e,typeof t!="symbol"?t+"":t,r),km,LI=Object.defineProperty,$I=(e,t,r)=>t in e?LI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Em=(e,t,r)=>$I(e,typeof t!="symbol"?t+"":t,r),Pe=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Pe||{}),Cm={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Am={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},vo={},DI=()=>!!globalThis.Zone;function Gu(e){if(vo[e])return vo[e];let t=globalThis[e],r=t.prototype,n=e in Cm?Cm[e]:void 0,i=!!(n&&n.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in Am?Am[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!DI())return vo[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?vo[e]=u:r}catch{return r}}var Ul={};function Ot(e,t,r){var n;let i=`${e}.${String(r)}`;if(Ul[i])return Ul[i].call(t);let o=Gu(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(Ul[i]=s,s.call(t)):t[r]}var Wl={};function kg(e,t,r){let n=`${e}.${String(r)}`;if(Wl[n])return Wl[n].bind(t);let o=Gu(e)[r];return typeof o!="function"?t[r]:(Wl[n]=o,o.bind(t))}function _I(e){return Ot("Node",e,"ownerDocument")}function FI(e){return Ot("Node",e,"childNodes")}function jI(e){return Ot("Node",e,"parentNode")}function VI(e){return Ot("Node",e,"parentElement")}function BI(e){return Ot("Node",e,"textContent")}function UI(e,t){return kg("Node",e,"contains")(t)}function WI(e){return kg("Node",e,"getRootNode")()}function zI(e){return!e||!("host"in e)?null:Ot("ShadowRoot",e,"host")}function GI(e){return e.styleSheets}function HI(e){return!e||!("shadowRoot"in e)?null:Ot("Element",e,"shadowRoot")}function qI(e,t){return Ot("Element",e,"querySelector")(t)}function KI(e,t){return Ot("Element",e,"querySelectorAll")(t)}function YI(){return Gu("MutationObserver").constructor}function JI(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}var De={ownerDocument:_I,childNodes:FI,parentNode:jI,parentElement:VI,textContent:BI,contains:UI,getRootNode:WI,host:zI,styleSheets:GI,shadowRoot:HI,querySelector:qI,querySelectorAll:KI,mutationObserver:YI,patch:JI};function Eg(e){return e.nodeType===e.ELEMENT_NODE}function zn(e){let t=e&&"host"in e&&"mode"in e&&De.host(e)||null;return!!(t&&"shadowRoot"in t&&De.shadowRoot(t)===e)}function Gn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function ZI(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 XI(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function ru(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,i=>Cg(i,r)).join("");return ZI(n)}catch{return null}}function Cg(e,t){if(eP(e)){let r;try{r=ru(e.styleSheet)||XI(e)}catch{r=e.cssText}return e.styleSheet.href?Qo(r,e.styleSheet.href):r}else{let r=e.cssText;return tP(e)&&e.selectorText.includes(":")&&(r=QI(r)),t?Qo(r,t):r}}function QI(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function eP(e){return"styleSheet"in e}function tP(e){return"selectorText"in e}var Jo=class{constructor(){Em(this,"idNodeMap",new Map),Em(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.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 r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function rP(){return new Jo}function Zo({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"",a=n&&gr(n);return(t[r.toLowerCase()]||a&&t[a])&&(o?s=o(s,e):s="*".repeat(s.length)),s}function gr(e){return e.toLowerCase()}var Im="__rrweb_original__";function nP(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let n=0;n<e.width;n+=r)for(let i=0;i<e.height;i+=r){let o=t.getImageData,s=Im in o?o[Im]:o;if(new Uint32Array(s.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function Xo(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?gr(t):null}function Ag(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(n);return i?.[1]??null}function iP(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var oP=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,sP=/^(?:[a-z+]+:)?\/\//i,aP=/^www\..*/i,lP=/^(data:)([^,]*),(.*)/i;function Qo(e,t){return(e||"").replace(oP,(r,n,i,o,s,a)=>{let l=i||s||a,u=n||o||"";if(!l)return r;if(sP.test(l)||aP.test(l))return`url(${u}${l}${u})`;if(lP.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${iP(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 xo(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function uP(e,t,r=!1){let n=Array.from(t.childNodes),i=[],o=0;if(n.length>1&&e&&typeof e=="string"){let s=xo(e,r),a=s.length/e.length;for(let l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){let u=xo(n[l].textContent,r),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),h=s.split(p),f=-1;if(h.length===2)f=h[0].length;else if(h.length>2&&h[0]===""&&n[l-1].textContent!=="")f=s.indexOf(p,1);else if(h.length===1){if(p=p.substring(0,p.length-1),h=s.split(p),h.length<=1)return i.push(e),i;d=c+1}else d===u.length-1&&(f=s.indexOf(p));if(h.length>=2&&d>c){let m=n[l-1].textContent;if(m&&typeof m=="string"){let g=xo(m).length;f=s.indexOf(p,g)}f===-1&&(f=h[0].length)}if(f!==-1){let m=Math.floor(f/a);for(;m>0&&m<e.length;){if(o+=1,o>50*n.length)return i.push(e),i;let g=xo(e.substring(0,m),r);if(g.length===f){i.push(e.substring(0,m)),e=e.substring(m),s=s.substring(f);break}else g.length<f?m+=Math.max(1,Math.floor((f-g.length)/a)):m-=Math.max(1,Math.floor((g.length-f)*a))}break}}}}return i.push(e),i}function cP(e,t){return uP(e,t).join("/* rr_split */")}var dP=1,fP=new RegExp("[^a-z0-9-_:]"),qn=-2;function Ig(){return dP++}function pP(e){if(e instanceof HTMLFormElement)return"form";let t=gr(e.tagName);return fP.test(t)?"div":t}var jr,Pm,hP=/^[^ \t\n\r\u000c]+/,mP=/^[, \t\n\r\u000c]+/;function gP(e,t){if(t.trim()==="")return t;let r=0;function n(o){let s,a=o.exec(t.substring(r));return a?(s=a[0],r+=s.length,s):""}let i=[];for(;n(mP),!(r>=t.length);){let o=n(hP);if(o.slice(-1)===",")o=Ur(e,o.substring(0,o.length-1)),i.push(o);else{let s="";o=Ur(e,o);let a=!1;for(;;){let l=t.charAt(r);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return i.join(", ")}var Tm=new WeakMap;function Ur(e,t){return!t||t.trim()===""?t:Hu(e,t)}function yP(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Hu(e,t){let r=Tm.get(e);if(r||(r=e.createElement("a"),Tm.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Pg(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?Ur(e,n):r==="srcset"?gP(e,n):r==="style"?Qo(n,Hu(e)):t==="object"&&r==="data"?Ur(e,n):n)}function Tg(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function bP(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch{}return!1}function es(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?es(De.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){let i=e.classList[n];if(t.test(i))return!0}return r?es(De.parentNode(e),t,r):!1}function Mg(e,t,r,n){let i;if(Eg(e)){if(i=e,!De.childNodes(i).length)return!1}else{if(De.parentElement(e)===null)return!1;i=De.parentElement(e)}try{if(typeof t=="string"){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(es(i,t,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function SP(e,t,r){let n=e.contentWindow;if(!n)return;let i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){let a=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),i=!0,t()});return}let s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function wP(e,t,r){let n=!1,i;try{i=e.sheet}catch{return}if(i)return;let o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}function vP(e,t){let{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,S=xP(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Pe.Document,childNodes:[],compatMode:e.compatMode}:{type:Pe.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Pe.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return kP(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m,rootId:S});case e.TEXT_NODE:return RP(e,{doc:r,needsMask:s,maskTextFn:u,rootId:S,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:Pe.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Pe.Comment,textContent:De.textContent(e)||"",rootId:S};default:return!1}}function xP(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function RP(e,t){let{needsMask:r,maskTextFn:n,rootId:i,cssCaptured:o}=t,s=De.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=De.textContent(e),u&&l&&(l=Qo(l,Hu(t.doc)))),!u&&!c&&l&&r&&(l=n?n(l,De.parentElement(e)):l.replace(/[\S]/g,"*")),{type:Pe.Text,textContent:l||"",rootId:i}}function kP(e,t){let{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:h}=t,f=bP(e,n,i),m=pP(e),g={},S=e.attributes.length;for(let y=0;y<S;y++){let x=e.attributes[y];Tg(m,x.name,x.value)||(g[x.name]=Pg(r,m,gr(x.name),x.value))}if(m==="link"&&o){let y=Array.from(r.styleSheets).find(E=>E.href===e.href),x=null;y&&(x=ru(y)),x&&(delete g.rel,delete g.href,g._cssText=x)}if(m==="style"&&e.sheet){let y=ru(e.sheet);y&&(e.childNodes.length>1&&(y=cP(y,e)),g._cssText=y)}if(["input","textarea","select"].includes(m)){let y=e.value,x=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&y?g.value=Zo({element:e,type:Xo(e),tagName:m,value:y,maskInputOptions:s,maskInputFn:a}):x&&(g.checked=x)}if(m==="option"&&(e.selected&&!s.select?g.selected=!0:delete g.selected),m==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&c){if(e.__context==="2d")nP(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let y=e.toDataURL(l.type,l.quality),x=r.createElement("canvas");x.width=e.width,x.height=e.height;let E=x.toDataURL(l.type,l.quality);y!==E&&(g.rr_dataURL=y)}}if(m==="img"&&u){jr||(jr=r.createElement("canvas"),Pm=jr.getContext("2d"));let y=e,x=y.currentSrc||y.getAttribute("src")||"<unknown-src>",E=y.crossOrigin,N=()=>{y.removeEventListener("load",N);try{jr.width=y.naturalWidth,jr.height=y.naturalHeight,Pm.drawImage(y,0,0),g.rr_dataURL=jr.toDataURL(l.type,l.quality)}catch(I){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?N():y.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${x}! Error: ${I}`)}y.crossOrigin==="anonymous"&&(E?g.crossOrigin=E:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?N():y.addEventListener("load",N)}if(["audio","video"].includes(m)){let y=g;y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime,y.rr_mediaPlaybackRate=e.playbackRate,y.rr_mediaMuted=e.muted,y.rr_mediaLoop=e.loop,y.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),f){let{width:y,height:x}=e.getBoundingClientRect();g={class:g.class,rr_width:`${y}px`,rr_height:`${x}px`}}m==="iframe"&&!d(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(m)&&(w=!0)}catch{}return{type:Pe.Element,tagName:m,attributes:g,childNodes:[],isSVG:yP(e)||void 0,needBlock:f,rootId:h,isCustom:w}}function ue(e){return e==null?"":e.toLowerCase()}function Og(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 EP(e,t){if(t.comment&&e.type===Pe.Comment)return!0;if(e.type===Pe.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Ag(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ue(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ue(e.attributes.name)==="application-name"||ue(e.attributes.rel)==="icon"||ue(e.attributes.rel)==="apple-touch-icon"||ue(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ue(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ue(e.attributes.property).match(/^(og|twitter|fb):/)||ue(e.attributes.name).match(/^(og|twitter):/)||ue(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ue(e.attributes.name)==="robots"||ue(e.attributes.name)==="googlebot"||ue(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ue(e.attributes.name)==="author"||ue(e.attributes.name)==="generator"||ue(e.attributes.name)==="framework"||ue(e.attributes.name)==="publisher"||ue(e.attributes.name)==="progid"||ue(e.attributes.property).match(/^article:/)||ue(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ue(e.attributes.name)==="google-site-verification"||ue(e.attributes.name)==="yandex-verification"||ue(e.attributes.name)==="csrf-token"||ue(e.attributes.name)==="p:domain_verify"||ue(e.attributes.name)==="verify-v1"||ue(e.attributes.name)==="verification"||ue(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Wr(e,t){let{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:I=!1,cssCaptured:M=!1}=t,{needsMask:C}=t,{preserveWhiteSpace:V=!0}=t;C||(C=Mg(e,s,a,C===void 0));let Z=vP(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:N,newlyAddedElement:I,cssCaptured:M});if(!Z)return console.warn(e,"not serialized"),null;let X;n.hasNode(e)?X=n.getId(e):EP(Z,h)||!V&&Z.type===Pe.Text&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?X=qn:X=Ig();let F=Object.assign(Z,{id:X});if(n.add(e,F),X===qn)return null;S&&S(e);let $e=!l;if(F.type===Pe.Element){$e=$e&&!F.needBlock,delete F.needBlock;let Ie=De.shadowRoot(e);Ie&&Gn(Ie)&&(F.isShadowHost=!0)}if((F.type===Pe.Document||F.type===Pe.Element)&&$e){h.headWhitespace&&F.type===Pe.Element&&F.tagName==="head"&&(V=!1);let Ie={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N,cssCaptured:!1};if(!(F.type===Pe.Element&&F.tagName==="textarea"&&F.attributes.value!==void 0)){F.type===Pe.Element&&F.attributes._cssText!==void 0&&typeof F.attributes._cssText=="string"&&(Ie.cssCaptured=!0);for(let or of Array.from(De.childNodes(e))){let pt=Wr(or,Ie);pt&&F.childNodes.push(pt)}}let Je=null;if(Eg(e)&&(Je=De.shadowRoot(e)))for(let or of Array.from(De.childNodes(Je))){let pt=Wr(or,Ie);pt&&(Gn(Je)&&(pt.isShadow=!0),F.childNodes.push(pt))}}let ft=De.parentNode(e);return ft&&zn(ft)&&Gn(ft)&&(F.isShadow=!0),F.type===Pe.Element&&F.tagName==="iframe"&&SP(e,()=>{let Ie=e.contentDocument;if(Ie&&w){let Je=Wr(Ie,{doc:Ie,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N});Je&&w(e,Je)}},y),F.type===Pe.Element&&F.tagName==="link"&&typeof F.attributes.rel=="string"&&(F.attributes.rel==="stylesheet"||F.attributes.rel==="preload"&&typeof F.attributes.href=="string"&&Ag(F.attributes.href)==="css")&&wP(e,()=>{if(x){let Ie=Wr(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N});Ie&&x(e,Ie)}},E),F}function CP(e,t){let{mirror:r=new Jo,blockClass:n="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:h=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:y,stylesheetLoadTimeout:x,keepIframeSrcFn:E=()=>!1}=t||{},N=c===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:c===!1?{password:!0}:c,I=Og(h);return Wr(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:N,maskTextFn:d,maskInputFn:p,slimDOMOptions:I,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:y,stylesheetLoadTimeout:x,keepIframeSrcFn:E,newlyAddedElement:!1})}var AP=/(max|min)-device-(width|height)/,ZW=new RegExp(AP.source,"g");function IP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function PP(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var qu={exports:{}},fe=String,Ng=function(){return{isColorSupported:!1,reset:fe,bold:fe,dim:fe,italic:fe,underline:fe,inverse:fe,hidden:fe,strikethrough:fe,black:fe,red:fe,green:fe,yellow:fe,blue:fe,magenta:fe,cyan:fe,white:fe,gray:fe,bgBlack:fe,bgRed:fe,bgGreen:fe,bgYellow:fe,bgBlue:fe,bgMagenta:fe,bgCyan:fe,bgWhite:fe}};qu.exports=Ng();qu.exports.createColors=Ng;var TP=qu.exports,MP={},OP=Object.freeze(Object.defineProperty({__proto__:null,default:MP},Symbol.toStringTag,{value:"Module"})),at=PP(OP),Mm=TP,Om=at,nu=class Lg extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof r<"u"&&typeof n<"u"&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Lg)}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 r=this.source;t==null&&(t=Mm.isColorSupported),Om&&t&&(r=Om(r));let n=r.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=Mm.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return n.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let h=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
|
|
40
|
+
${te("when",W.dim(JSON.stringify(t.when.singletons)),void 0)}`}function aI(e){return"locator"in e&&e.locator!=null?`${e.kind} ${_l(e.locator)}`:"url"in e?`${e.kind} ${lI(e.url)}`:e.kind}function lI(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:Sm(e)}function _l(e){return e.by==="role"?e.name==null?e.role:`${e.role} ${fm(e.name)}`:e.by==="inside"?`${_l(e.scope)} \u25B8 ${_l(e.target)}`:fm(e.value)}function fm(e){return e===null?"\u2205":typeof e=="string"?`"${e}"`:typeof e!="object"?String(e):"ref"in e?`{${e.ref}}`:Sm(e)}function Sm(e){return e.template.map(t=>typeof t=="string"?t:":id").join("")}function hr(e,t,r,n){let i=r==null?[]:[` ${r.intent} ${dm} ${W.dim(Fl(r.action))}`];return[`${$n(e)} ${W.bold(t)}`,...i,...n].join(`
|
|
41
|
+
`)}function uI(e){return e.pending?hr("consistency",fI(e.divergence),e.step,[...pm(e.divergence),te("meaning",W.dim(`the write never landed within the ${pI(e.budget)} settle budget \u2014 the app still showed the pre-step value, not a wrong one`),void 0),te("fix",W.dim("declare wait: on the expectation (or a slower tier) if this write is legitimately slow"),void 0)]):hr("consistency",hI(e.divergence),e.step,[...pm(e.divergence),te("decide",W.dim(dI(e.divergence)),void 0)])}var cI={absent:"app bug if the write was promised; if it only happens from a different starting state, restrict this test's given and cover that state in its own test","expected-change":"app bug if this action should change it; if the change needs other preconditions, split that case into its own test with the right given","field-mismatch":"app bug if the model value is the promised behavior; if the app legitimately owns this value, mark the field stable: false or assert changed() instead","ghost-write":"declare the missing effect on the acting step (Entity.created/updated/deleted), or if this write belongs to a different flow, cover it in that flow's test","singleton-mismatch":"app bug if the model value is the promised behavior; otherwise correct the singleton's expected value at the step that sets it"};function dI(e){return cI[e.kind]}function fI(e){return e.kind==="field-mismatch"?`${e.entity}.${e.field} write never landed`:e.kind==="ghost-write"?`${e.entity} "${e.key}" delete never landed`:e.kind==="absent"?`${e.entity} "${e.key}" create never landed`:e.kind==="expected-change"?`${e.entity}.${e.field} never changed`:`${e.singleton} write never landed`}function pm(e){if(e.kind==="field-mismatch")return[te("row",W.dim(`${e.entity} ${e.key}`),void 0),te("expected",W.expected(ot(e.snapshot)),"model predicted this"),te("actual",W.actual(ot(e.sut)),"app showed this")];if(e.kind==="singleton-mismatch")return[te("expected",W.expected(ot(e.snapshot)),"model predicted this"),te("actual",W.actual(ot(e.sut)),"app showed this")];if(e.kind==="expected-change")return[te("row",W.dim(`${e.entity} ${e.key}`),void 0),te("expected",W.expected("a different value"),"changed() asserted a change"),te("actual",W.actual(ot(e.value)),"app left it unchanged")];let t=e.kind==="ghost-write"?"an app write the model never declared \u2014 unmodeled side effect":"the model expected this row but the app has none";return[te("meaning",W.dim(t),void 0)]}function pI(e){return`${String(En[e]/1e3)}s "${e}"`}function hI(e){return e.kind==="field-mismatch"?`${e.entity}.${e.field} diverged`:e.kind==="ghost-write"?`${e.entity} "${e.key}" written but never modeled`:e.kind==="absent"?`${e.entity} "${e.key}" missing in the app`:e.kind==="expected-change"?`${e.entity}.${e.field} never changed`:`${e.singleton} diverged`}function mI(e,t,r){if(e.kind==="invariant")return hr("invariant",`${_n(e.invariant)} violated`,t,[te("meaning",W.dim("a referenced row went missing after this step"),void 0)]);let n=e.kind==="law"?"view law never held":"expectation never held",i=e.kind==="law"&&e.origin!=null?[gI(e.origin)]:[];return hr("assertion",n,t,[te("check",W.warn(Dn(e.check)),void 0),...i,te("budget",W.dim(`${r} (polled until timeout)`),void 0),te("decide",W.dim("wrong locator/accessible name, UI regression, or the expectation only holds under a narrower given \u2014 confirm in behavior.jsonl before changing the test"),void 0)])}function gI(e){if(e.kind==="test")return te("law from",W.dim(`an assertion in test "${e.test}"`),void 0);if(e.kind==="trigger")return te("law from",W.dim(`the trigger of "${e.intent}" (test "${e.test}")`),void 0);let t=e.tests.map(r=>JSON.stringify(r)).join(", ");return te("law from",W.dim(`generalized across tests ${t}`),void 0)}function yI(e){return e.kind==="invariant"?"invariant":e.kind==="law"?"law":"assertion"}function bI(e){return e.kind==="invariant"?_n(e.invariant):Dn(e.check)}import{err as P8,ok as T8,ResultAsync as M8}from"neverthrow";import Rb from"path";import{existsSync as SI}from"fs";import{createRequire as wI}from"module";import{fileURLToPath as vI}from"url";import{Worker as xI}from"worker_threads";var RI=wI(import.meta.url);function wm(e){let t=new xI(kI(),{workerData:e});t.unref();let r=new Map,n={next:0};t.on("message",o=>{let s=r.get(o.seq);s!=null&&(r.delete(o.seq),s())});let i=o=>{t.postMessage(o)};return{close:({noticeLineIfNoRrweb:o,runId:s})=>{let a=n.next;return n.next+=1,new Promise(l=>{r.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 kI(){try{return RI.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(r=>vI(new URL(r,import.meta.url))),t=e.find(r=>SI(r));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}import{readFile as EI}from"fs/promises";import{createRequire as CI}from"module";import{fileURLToPath as AI}from"url";var II=CI(import.meta.url);function Vl(e,t){try{return II.resolve(e)}catch{return AI(new URL(`assets/${t}`,import.meta.url))}}var PI=Vl("@ripplo/browser-trace/bundle","browser-trace.js");async function xm(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await TI())}var vm;function TI(){return vm??=EI(PI,{encoding:"utf8"}),vm}import{readFile as Q2}from"fs/promises";var MI=Object.defineProperty,OI=(e,t,r)=>t in e?MI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k=(e,t,r)=>OI(e,typeof t!="symbol"?t+"":t,r),Rm,NI=Object.defineProperty,LI=(e,t,r)=>t in e?NI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,km=(e,t,r)=>LI(e,typeof t!="symbol"?t+"":t,r),Pe=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Pe||{}),Em={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Cm={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},vo={},$I=()=>!!globalThis.Zone;function zu(e){if(vo[e])return vo[e];let t=globalThis[e],r=t.prototype,n=e in Em?Em[e]:void 0,i=!!(n&&n.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in Cm?Cm[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!$I())return vo[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?vo[e]=u:r}catch{return r}}var Bl={};function Ot(e,t,r){var n;let i=`${e}.${String(r)}`;if(Bl[i])return Bl[i].call(t);let o=zu(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(Bl[i]=s,s.call(t)):t[r]}var Ul={};function Rg(e,t,r){let n=`${e}.${String(r)}`;if(Ul[n])return Ul[n].bind(t);let o=zu(e)[r];return typeof o!="function"?t[r]:(Ul[n]=o,o.bind(t))}function DI(e){return Ot("Node",e,"ownerDocument")}function _I(e){return Ot("Node",e,"childNodes")}function FI(e){return Ot("Node",e,"parentNode")}function jI(e){return Ot("Node",e,"parentElement")}function VI(e){return Ot("Node",e,"textContent")}function BI(e,t){return Rg("Node",e,"contains")(t)}function UI(e){return Rg("Node",e,"getRootNode")()}function WI(e){return!e||!("host"in e)?null:Ot("ShadowRoot",e,"host")}function zI(e){return e.styleSheets}function GI(e){return!e||!("shadowRoot"in e)?null:Ot("Element",e,"shadowRoot")}function HI(e,t){return Ot("Element",e,"querySelector")(t)}function qI(e,t){return Ot("Element",e,"querySelectorAll")(t)}function KI(){return zu("MutationObserver").constructor}function YI(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}var De={ownerDocument:DI,childNodes:_I,parentNode:FI,parentElement:jI,textContent:VI,contains:BI,getRootNode:UI,host:WI,styleSheets:zI,shadowRoot:GI,querySelector:HI,querySelectorAll:qI,mutationObserver:KI,patch:YI};function kg(e){return e.nodeType===e.ELEMENT_NODE}function zn(e){let t=e&&"host"in e&&"mode"in e&&De.host(e)||null;return!!(t&&"shadowRoot"in t&&De.shadowRoot(t)===e)}function Gn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function JI(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 ZI(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function tu(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,i=>Eg(i,r)).join("");return JI(n)}catch{return null}}function Eg(e,t){if(QI(e)){let r;try{r=tu(e.styleSheet)||ZI(e)}catch{r=e.cssText}return e.styleSheet.href?Qo(r,e.styleSheet.href):r}else{let r=e.cssText;return eP(e)&&e.selectorText.includes(":")&&(r=XI(r)),t?Qo(r,t):r}}function XI(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function QI(e){return"styleSheet"in e}function eP(e){return"selectorText"in e}var Jo=class{constructor(){km(this,"idNodeMap",new Map),km(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.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 r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function tP(){return new Jo}function Zo({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"",a=n&&gr(n);return(t[r.toLowerCase()]||a&&t[a])&&(o?s=o(s,e):s="*".repeat(s.length)),s}function gr(e){return e.toLowerCase()}var Am="__rrweb_original__";function rP(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let n=0;n<e.width;n+=r)for(let i=0;i<e.height;i+=r){let o=t.getImageData,s=Am in o?o[Am]:o;if(new Uint32Array(s.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function Xo(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?gr(t):null}function Cg(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(n);return i?.[1]??null}function nP(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var iP=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,oP=/^(?:[a-z+]+:)?\/\//i,sP=/^www\..*/i,aP=/^(data:)([^,]*),(.*)/i;function Qo(e,t){return(e||"").replace(iP,(r,n,i,o,s,a)=>{let l=i||s||a,u=n||o||"";if(!l)return r;if(oP.test(l)||sP.test(l))return`url(${u}${l}${u})`;if(aP.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${nP(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 xo(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function lP(e,t,r=!1){let n=Array.from(t.childNodes),i=[],o=0;if(n.length>1&&e&&typeof e=="string"){let s=xo(e,r),a=s.length/e.length;for(let l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){let u=xo(n[l].textContent,r),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),h=s.split(p),f=-1;if(h.length===2)f=h[0].length;else if(h.length>2&&h[0]===""&&n[l-1].textContent!=="")f=s.indexOf(p,1);else if(h.length===1){if(p=p.substring(0,p.length-1),h=s.split(p),h.length<=1)return i.push(e),i;d=c+1}else d===u.length-1&&(f=s.indexOf(p));if(h.length>=2&&d>c){let m=n[l-1].textContent;if(m&&typeof m=="string"){let g=xo(m).length;f=s.indexOf(p,g)}f===-1&&(f=h[0].length)}if(f!==-1){let m=Math.floor(f/a);for(;m>0&&m<e.length;){if(o+=1,o>50*n.length)return i.push(e),i;let g=xo(e.substring(0,m),r);if(g.length===f){i.push(e.substring(0,m)),e=e.substring(m),s=s.substring(f);break}else g.length<f?m+=Math.max(1,Math.floor((f-g.length)/a)):m-=Math.max(1,Math.floor((g.length-f)*a))}break}}}}return i.push(e),i}function uP(e,t){return lP(e,t).join("/* rr_split */")}var cP=1,dP=new RegExp("[^a-z0-9-_:]"),qn=-2;function Ag(){return cP++}function fP(e){if(e instanceof HTMLFormElement)return"form";let t=gr(e.tagName);return dP.test(t)?"div":t}var jr,Im,pP=/^[^ \t\n\r\u000c]+/,hP=/^[, \t\n\r\u000c]+/;function mP(e,t){if(t.trim()==="")return t;let r=0;function n(o){let s,a=o.exec(t.substring(r));return a?(s=a[0],r+=s.length,s):""}let i=[];for(;n(hP),!(r>=t.length);){let o=n(pP);if(o.slice(-1)===",")o=Ur(e,o.substring(0,o.length-1)),i.push(o);else{let s="";o=Ur(e,o);let a=!1;for(;;){let l=t.charAt(r);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return i.join(", ")}var Pm=new WeakMap;function Ur(e,t){return!t||t.trim()===""?t:Gu(e,t)}function gP(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Gu(e,t){let r=Pm.get(e);if(r||(r=e.createElement("a"),Pm.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Ig(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?Ur(e,n):r==="srcset"?mP(e,n):r==="style"?Qo(n,Gu(e)):t==="object"&&r==="data"?Ur(e,n):n)}function Pg(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function yP(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch{}return!1}function es(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?es(De.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){let i=e.classList[n];if(t.test(i))return!0}return r?es(De.parentNode(e),t,r):!1}function Tg(e,t,r,n){let i;if(kg(e)){if(i=e,!De.childNodes(i).length)return!1}else{if(De.parentElement(e)===null)return!1;i=De.parentElement(e)}try{if(typeof t=="string"){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(es(i,t,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function bP(e,t,r){let n=e.contentWindow;if(!n)return;let i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){let a=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),i=!0,t()});return}let s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function SP(e,t,r){let n=!1,i;try{i=e.sheet}catch{return}if(i)return;let o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}function wP(e,t){let{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,S=vP(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Pe.Document,childNodes:[],compatMode:e.compatMode}:{type:Pe.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Pe.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return RP(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m,rootId:S});case e.TEXT_NODE:return xP(e,{doc:r,needsMask:s,maskTextFn:u,rootId:S,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:Pe.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Pe.Comment,textContent:De.textContent(e)||"",rootId:S};default:return!1}}function vP(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function xP(e,t){let{needsMask:r,maskTextFn:n,rootId:i,cssCaptured:o}=t,s=De.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=De.textContent(e),u&&l&&(l=Qo(l,Gu(t.doc)))),!u&&!c&&l&&r&&(l=n?n(l,De.parentElement(e)):l.replace(/[\S]/g,"*")),{type:Pe.Text,textContent:l||"",rootId:i}}function RP(e,t){let{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:h}=t,f=yP(e,n,i),m=fP(e),g={},S=e.attributes.length;for(let y=0;y<S;y++){let x=e.attributes[y];Pg(m,x.name,x.value)||(g[x.name]=Ig(r,m,gr(x.name),x.value))}if(m==="link"&&o){let y=Array.from(r.styleSheets).find(E=>E.href===e.href),x=null;y&&(x=tu(y)),x&&(delete g.rel,delete g.href,g._cssText=x)}if(m==="style"&&e.sheet){let y=tu(e.sheet);y&&(e.childNodes.length>1&&(y=uP(y,e)),g._cssText=y)}if(["input","textarea","select"].includes(m)){let y=e.value,x=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&y?g.value=Zo({element:e,type:Xo(e),tagName:m,value:y,maskInputOptions:s,maskInputFn:a}):x&&(g.checked=x)}if(m==="option"&&(e.selected&&!s.select?g.selected=!0:delete g.selected),m==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&c){if(e.__context==="2d")rP(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let y=e.toDataURL(l.type,l.quality),x=r.createElement("canvas");x.width=e.width,x.height=e.height;let E=x.toDataURL(l.type,l.quality);y!==E&&(g.rr_dataURL=y)}}if(m==="img"&&u){jr||(jr=r.createElement("canvas"),Im=jr.getContext("2d"));let y=e,x=y.currentSrc||y.getAttribute("src")||"<unknown-src>",E=y.crossOrigin,N=()=>{y.removeEventListener("load",N);try{jr.width=y.naturalWidth,jr.height=y.naturalHeight,Im.drawImage(y,0,0),g.rr_dataURL=jr.toDataURL(l.type,l.quality)}catch(I){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?N():y.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${x}! Error: ${I}`)}y.crossOrigin==="anonymous"&&(E?g.crossOrigin=E:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?N():y.addEventListener("load",N)}if(["audio","video"].includes(m)){let y=g;y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime,y.rr_mediaPlaybackRate=e.playbackRate,y.rr_mediaMuted=e.muted,y.rr_mediaLoop=e.loop,y.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),f){let{width:y,height:x}=e.getBoundingClientRect();g={class:g.class,rr_width:`${y}px`,rr_height:`${x}px`}}m==="iframe"&&!d(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(m)&&(w=!0)}catch{}return{type:Pe.Element,tagName:m,attributes:g,childNodes:[],isSVG:gP(e)||void 0,needBlock:f,rootId:h,isCustom:w}}function ue(e){return e==null?"":e.toLowerCase()}function Mg(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 kP(e,t){if(t.comment&&e.type===Pe.Comment)return!0;if(e.type===Pe.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Cg(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ue(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ue(e.attributes.name)==="application-name"||ue(e.attributes.rel)==="icon"||ue(e.attributes.rel)==="apple-touch-icon"||ue(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ue(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ue(e.attributes.property).match(/^(og|twitter|fb):/)||ue(e.attributes.name).match(/^(og|twitter):/)||ue(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ue(e.attributes.name)==="robots"||ue(e.attributes.name)==="googlebot"||ue(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ue(e.attributes.name)==="author"||ue(e.attributes.name)==="generator"||ue(e.attributes.name)==="framework"||ue(e.attributes.name)==="publisher"||ue(e.attributes.name)==="progid"||ue(e.attributes.property).match(/^article:/)||ue(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ue(e.attributes.name)==="google-site-verification"||ue(e.attributes.name)==="yandex-verification"||ue(e.attributes.name)==="csrf-token"||ue(e.attributes.name)==="p:domain_verify"||ue(e.attributes.name)==="verify-v1"||ue(e.attributes.name)==="verification"||ue(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Wr(e,t){let{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:I=!1,cssCaptured:M=!1}=t,{needsMask:C}=t,{preserveWhiteSpace:V=!0}=t;C||(C=Tg(e,s,a,C===void 0));let Z=wP(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:N,newlyAddedElement:I,cssCaptured:M});if(!Z)return console.warn(e,"not serialized"),null;let X;n.hasNode(e)?X=n.getId(e):kP(Z,h)||!V&&Z.type===Pe.Text&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?X=qn:X=Ag();let F=Object.assign(Z,{id:X});if(n.add(e,F),X===qn)return null;S&&S(e);let $e=!l;if(F.type===Pe.Element){$e=$e&&!F.needBlock,delete F.needBlock;let Ie=De.shadowRoot(e);Ie&&Gn(Ie)&&(F.isShadowHost=!0)}if((F.type===Pe.Document||F.type===Pe.Element)&&$e){h.headWhitespace&&F.type===Pe.Element&&F.tagName==="head"&&(V=!1);let Ie={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N,cssCaptured:!1};if(!(F.type===Pe.Element&&F.tagName==="textarea"&&F.attributes.value!==void 0)){F.type===Pe.Element&&F.attributes._cssText!==void 0&&typeof F.attributes._cssText=="string"&&(Ie.cssCaptured=!0);for(let or of Array.from(De.childNodes(e))){let pt=Wr(or,Ie);pt&&F.childNodes.push(pt)}}let Je=null;if(kg(e)&&(Je=De.shadowRoot(e)))for(let or of Array.from(De.childNodes(Je))){let pt=Wr(or,Ie);pt&&(Gn(Je)&&(pt.isShadow=!0),F.childNodes.push(pt))}}let ft=De.parentNode(e);return ft&&zn(ft)&&Gn(ft)&&(F.isShadow=!0),F.type===Pe.Element&&F.tagName==="iframe"&&bP(e,()=>{let Ie=e.contentDocument;if(Ie&&w){let Je=Wr(Ie,{doc:Ie,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N});Je&&w(e,Je)}},y),F.type===Pe.Element&&F.tagName==="link"&&typeof F.attributes.rel=="string"&&(F.attributes.rel==="stylesheet"||F.attributes.rel==="preload"&&typeof F.attributes.href=="string"&&Cg(F.attributes.href)==="css")&&SP(e,()=>{if(x){let Ie=Wr(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:N});Ie&&x(e,Ie)}},E),F}function EP(e,t){let{mirror:r=new Jo,blockClass:n="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:h=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:y,stylesheetLoadTimeout:x,keepIframeSrcFn:E=()=>!1}=t||{},N=c===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:c===!1?{password:!0}:c,I=Mg(h);return Wr(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:N,maskTextFn:d,maskInputFn:p,slimDOMOptions:I,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:y,stylesheetLoadTimeout:x,keepIframeSrcFn:E,newlyAddedElement:!1})}var CP=/(max|min)-device-(width|height)/,JW=new RegExp(CP.source,"g");function AP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function IP(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Hu={exports:{}},fe=String,Og=function(){return{isColorSupported:!1,reset:fe,bold:fe,dim:fe,italic:fe,underline:fe,inverse:fe,hidden:fe,strikethrough:fe,black:fe,red:fe,green:fe,yellow:fe,blue:fe,magenta:fe,cyan:fe,white:fe,gray:fe,bgBlack:fe,bgRed:fe,bgGreen:fe,bgYellow:fe,bgBlue:fe,bgMagenta:fe,bgCyan:fe,bgWhite:fe}};Hu.exports=Og();Hu.exports.createColors=Og;var PP=Hu.exports,TP={},MP=Object.freeze(Object.defineProperty({__proto__:null,default:TP},Symbol.toStringTag,{value:"Module"})),at=IP(MP),Tm=PP,Mm=at,ru=class Ng extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof r<"u"&&typeof n<"u"&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ng)}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 r=this.source;t==null&&(t=Tm.isColorSupported),Mm&&t&&(r=Mm(r));let n=r.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=Tm.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return n.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let h=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
|
|
42
42
|
`+h+a("^")}return" "+l(p)+u}).join(`
|
|
43
43
|
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
44
44
|
|
|
45
45
|
`+t+`
|
|
46
|
-
`),this.name+": "+this.message+t}},
|
|
46
|
+
`),this.name+": "+this.message+t}},qu=ru;ru.default=ru;var ni={};ni.isClean=Symbol("isClean");ni.my=Symbol("my");var Om={after:`
|
|
47
47
|
`,beforeClose:`
|
|
48
48
|
`,beforeComment:`
|
|
49
49
|
`,beforeDecl:`
|
|
50
50
|
`,beforeOpen:" ",beforeRule:`
|
|
51
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function
|
|
52
|
-
`)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)n+=s}return n}block(t,r){let n=this.raw(t,"between","beforeOpen");this.builder(r+n+"{",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 r=t.nodes.length-1;for(;r>0&&t.nodes[r].type==="comment";)r-=1;let n=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,r!==i||n)}}comment(t){let r=this.raw(t,"left","commentLeft"),n=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+n+"*/",t)}decl(t,r){let n=this.raw(t,"between","colon"),i=t.prop+n+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),r&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],typeof i<"u"))return i;let o=t.parent;if(n==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return
|
|
51
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function OP(e){return e[0].toUpperCase()+e.slice(1)}var nu=class{constructor(t){this.builder=t}atrule(t,r){let n="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?n+=t.raws.afterName:i&&(n+=" "),t.nodes)this.block(t,n+i);else{let o=(t.raws.between||"")+(r?";":"");this.builder(n+i+o,t)}}beforeAfter(t,r){let n;t.type==="decl"?n=this.raw(t,null,"beforeDecl"):t.type==="comment"?n=this.raw(t,null,"beforeComment"):r==="before"?n=this.raw(t,null,"beforeRule"):n=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(n.includes(`
|
|
52
|
+
`)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)n+=s}return n}block(t,r){let n=this.raw(t,"between","beforeOpen");this.builder(r+n+"{",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 r=t.nodes.length-1;for(;r>0&&t.nodes[r].type==="comment";)r-=1;let n=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,r!==i||n)}}comment(t){let r=this.raw(t,"left","commentLeft"),n=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+n+"*/",t)}decl(t,r){let n=this.raw(t,"between","colon"),i=t.prop+n+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),r&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],typeof i<"u"))return i;let o=t.parent;if(n==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return Om[n];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[n]<"u")return s.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(t,n);{let a="raw"+OP(n);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[r],typeof i<"u")return!1})}return typeof i>"u"&&(i=Om[n]),s.rawCache[n]=i,i}rawBeforeClose(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return r=n.raws.after,r.includes(`
|
|
53
53
|
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r}rawBeforeComment(t,r){let n;return t.walkComments(i=>{if(typeof i.raws.before<"u")return n=i.raws.before,n.includes(`
|
|
54
54
|
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(r,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(t,r){let n;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return n=i.raws.before,n.includes(`
|
|
55
55
|
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(r,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(t){let r;return t.walk(n=>{if(n.type!=="decl"&&(r=n.raws.between,typeof r<"u"))return!1}),r}rawBeforeRule(t){let r;return t.walk(n=>{if(n.nodes&&(n.parent!==t||t.first!==n)&&typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
|
|
56
56
|
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r}rawColon(t){let r;return t.walkDecls(n=>{if(typeof n.raws.between<"u")return r=n.raws.between.replace(/[^\s:]/g,""),!1}),r}rawEmptyBody(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length===0&&(r=n.raws.after,typeof r<"u"))return!1}),r}rawIndent(t){if(t.raws.indent)return t.raws.indent;let r;return t.walk(n=>{let i=n.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof n.raws.before<"u"){let o=n.raws.before.split(`
|
|
57
|
-
`);return r=o[o.length-1],r=r.replace(/\S/g,""),!1}}),r}rawSemicolon(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(r=n.raws.semicolon,typeof r<"u"))return!1}),r}rawValue(t,r){let n=t[r],i=t.raws[r];return i&&i.value===n?i.raw:n}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,r){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,r)}}
|
|
58
|
-
`?(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 r={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(r=this.positionInside(o,i),n=this.positionInside(o+t.word.length,i))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?n={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?n=this.positionInside(t.endIndex):t.index&&(n=this.positionInside(t.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line}),{end:n,start:r}}raw(t,r){return new
|
|
59
|
-
`);n=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)n[a]=s,s+=o[a].length+1;this[
|
|
57
|
+
`);return r=o[o.length-1],r=r.replace(/\S/g,""),!1}}),r}rawSemicolon(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(r=n.raws.semicolon,typeof r<"u"))return!1}),r}rawValue(t,r){let n=t[r],i=t.raws[r];return i&&i.value===n?i.raw:n}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,r){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,r)}},Lg=nu;nu.default=nu;var NP=Lg;function iu(e,t){new NP(t).stringify(e)}var ps=iu;iu.default=iu;var{isClean:Ro,my:LP}=ni,$P=qu,DP=Lg,_P=ps;function ou(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let i=e[n],o=typeof i;n==="parent"&&o==="object"?t&&(r[n]=t):n==="source"?r[n]=i:Array.isArray(i)?r[n]=i.map(s=>ou(s,r)):(o==="object"&&i!==null&&(i=ou(i)),r[n]=i)}return r}var su=class{constructor(t={}){this.raws={},this[Ro]=!1,this[LP]=!0;for(let r in t)if(r==="nodes"){this.nodes=[];for(let n of t[r])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[r]=t[r]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let r=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${r.input.from}:${r.start.line}:${r.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let r in t)this[r]=t[r];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 r=ou(this);for(let n in t)r[n]=t[n];return r}cloneAfter(t={}){let r=this.clone(t);return this.parent.insertAfter(this,r),r}cloneBefore(t={}){let r=this.clone(t);return this.parent.insertBefore(this,r),r}error(t,r={}){if(this.source){let{end:n,start:i}=this.rangeBy(r);return this.source.input.error(t,{column:i.column,line:i.line},{column:n.column,line:n.line},r)}return new $P(t)}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:r==="root"?()=>t.root().toProxy():t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="prop"||r==="value"||r==="name"||r==="params"||r==="important"||r==="text")&&t.markDirty()),!0}}}markDirty(){if(this[Ro]){this[Ro]=!1;let t=this;for(;t=t.parent;)t[Ro]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,r){let n=this.source.start;if(t.index)n=this.positionInside(t.index,r);else if(t.word){r=this.toString();let i=r.indexOf(t.word);i!==-1&&(n=this.positionInside(i,r))}return n}positionInside(t,r){let n=r||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)n[s]===`
|
|
58
|
+
`?(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 r={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(r=this.positionInside(o,i),n=this.positionInside(o+t.word.length,i))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?n={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?n=this.positionInside(t.endIndex):t.index&&(n=this.positionInside(t.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line}),{end:n,start:r}}raw(t,r){return new DP().raw(this,t,r)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let r=this,n=!1;for(let i of t)i===this?n=!0:n?(this.parent.insertAfter(r,i),r=i):this.parent.insertBefore(r,i);n||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,r){let n={},i=r==null;r=r||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))n[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,r):l);else if(typeof a=="object"&&a.toJSON)n[s]=a.toJSON(null,r);else if(s==="source"){let l=r.get(a.input);l==null&&(l=o,r.set(a.input,o),o++),n[s]={end:a.end,inputId:l,start:a.start}}else n[s]=a}return i&&(n.inputs=[...r.keys()].map(s=>s.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=_P){t.stringify&&(t=t.stringify);let r="";return t(this,n=>{r+=n}),r}warn(t,r,n){let i={node:this};for(let o in n)i[o]=n[o];return t.warn(r,i)}get proxyOf(){return this}},hs=su;su.default=su;var FP=hs,au=class extends FP{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]==="$"}},ms=au;au.default=au;var jP="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",VP=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},BP=(e=21)=>{let t="",r=e;for(;r--;)t+=jP[Math.random()*64|0];return t},UP={nanoid:BP,customAlphabet:VP},{SourceMapConsumer:Nm,SourceMapGenerator:Lm}=at,{existsSync:WP,readFileSync:zP}=at,{dirname:Wl,join:GP}=at;function HP(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var lu=class{constructor(t,r){if(r.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let n=r.map?r.map.prev:void 0,i=this.loadMap(r.from,n);!this.mapFile&&r.from&&(this.mapFile=r.from),this.mapFile&&(this.root=Wl(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Nm(this.text)),this.consumerCache}decodeInline(t){let r=/^data:application\/json;charset=utf-?8;base64,/,n=/^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(r.test(t)||n.test(t))return HP(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 r=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!r)return;let n=t.lastIndexOf(r.pop()),i=t.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(n,i)))}loadFile(t){if(this.root=Wl(t),WP(t))return this.mapFile=t,zP(t,"utf-8").toString().trim()}loadMap(t,r){if(r===!1)return!1;if(r){if(typeof r=="string")return r;if(typeof r=="function"){let n=r(t);if(n){let i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(r instanceof Nm)return Lm.fromSourceMap(r).toString();if(r instanceof Lm)return r.toString();if(this.isMap(r))return JSON.stringify(r);throw new Error("Unsupported previous source map format: "+r.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let n=this.annotation;return t&&(n=GP(Wl(t),n)),this.loadFile(n)}}}startWith(t,r){return t?t.substr(0,r.length)===r:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},$g=lu;lu.default=lu;var{SourceMapConsumer:qP,SourceMapGenerator:KP}=at,{fileURLToPath:$m,pathToFileURL:ko}=at,{isAbsolute:uu,resolve:cu}=at,{nanoid:YP}=UP,zl=at,Dm=qu,JP=$g,Gl=Symbol("fromOffsetCache"),ZP=!!(qP&&KP),_m=!!(cu&&uu),ts=class{constructor(t,r={}){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,r.from&&(!_m||/^\w+:\/\//.test(r.from)||uu(r.from)?this.file=r.from:this.file=cu(r.from)),_m&&ZP){let n=new JP(this.css,r);if(n.text){this.map=n;let i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+YP(6)+">"),this.map&&(this.map.file=this.from)}error(t,r,n,i={}){let o,s,a;if(r&&typeof r=="object"){let u=r,c=n;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);r=d.line,n=d.col}else r=u.line,n=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(!n){let u=this.fromOffset(r);r=u.line,n=u.col}let l=this.origin(r,n,s,a);return l?o=new Dm(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 Dm(t,s===void 0?r:{column:n,line:r},s===void 0?n:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:n,endColumn:a,endLine:s,line:r,source:this.css},this.file&&(ko&&(o.input.url=ko(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let r,n;if(this[Gl])n=this[Gl];else{let o=this.css.split(`
|
|
59
|
+
`);n=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)n[a]=s,s+=o[a].length+1;this[Gl]=n}r=n[n.length-1];let i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<n[s])o=s-1;else if(t>=n[s+1])i=s+1;else{i=s;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:cu(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,r,n,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:r,line:t});if(!s.source)return!1;let a;typeof n=="number"&&(a=o.originalPositionFor({column:i,line:n}));let l;uu(s.source)?l=ko(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||ko(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($m)u.file=$m(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 r of["hasBOM","css","file","id"])this[r]!=null&&(t[r]=this[r]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},gs=ts;ts.default=ts;zl&&zl.registerInput&&zl.registerInput(ts);var{SourceMapConsumer:Dg,SourceMapGenerator:zo}=at,{dirname:Go,relative:_g,resolve:Fg,sep:jg}=at,{pathToFileURL:Fm}=at,XP=gs,QP=!!(Dg&&zo),eT=!!(Go&&Fg&&_g&&jg),tT=class{constructor(t,r,n,i){this.stringify=t,this.mapOpts=n.map||{},this.root=r,this.opts=n,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 r=`
|
|
60
60
|
`;this.css.includes(`\r
|
|
61
61
|
`)&&(r=`\r
|
|
62
|
-
`),this.css+=r+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),n=t.root||Go(t.file),i;this.mapOpts.sourcesContent===!1?(i=new
|
|
63
|
-
`),r=a.length-s):r+=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=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=r-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(r=>r.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 r=this.memoizedPaths.get(t);if(r)return r;let n=this.opts.to?Go(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=Go(jg(n,this.mapOpts.annotation)));let i=Fg(n,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 r=t.source.input.map;this.previousMaps.includes(r)||this.previousMaps.push(r)}});else{let t=new QP(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(r=>{if(r.source){let n=r.source.input.from;if(n&&!t[n]){t[n]=!0;let i=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(i,r.source.input.css)}}});else if(this.css){let r=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(r,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 r=this.memoizedFileURLs.get(t);if(r)return r;if(jm){let n=jm(t).toString();return this.memoizedFileURLs.set(t,n),n}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let r=this.memoizedURLs.get(t);if(r)return r;Vg==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},Bg=rT,nT=hs,fu=class extends nT{constructor(t){super(t),this.type="comment"}},ys=fu;fu.default=fu;var{isClean:Ug,my:Wg}=ni,zg=ms,Gg=ys,iT=hs,Hg,Yu,Ju,qg;function Kg(e){return e.map(t=>(t.nodes&&(t.nodes=Kg(t.nodes)),delete t.source,t))}function Yg(e){if(e[Ug]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Yg(t)}var Tt=class Jg extends iT{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let i of n)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r=this.getIterator(),n,i;for(;this.indexes[r]<this.proxyOf.nodes.length&&(n=this.indexes[r],i=t(this.proxyOf.nodes[n],n),i!==!1);)this.indexes[r]+=1;return delete this.indexes[r],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,r){return r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):r==="every"||r==="some"?n=>t[r]((i,...o)=>n(i.toProxy(),...o)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="name"||r==="params"||r==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n=this.index(t),i=this.normalize(r,this.proxyOf.nodes[n]).reverse();n=this.index(t);for(let s of i)this.proxyOf.nodes.splice(n+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],n<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,r){let n=this.index(t),i=n===0?"prepend":!1,o=this.normalize(r,this.proxyOf.nodes[n],i).reverse();n=this.index(t);for(let a of o)this.proxyOf.nodes.splice(n,0,a);let s;for(let a in this.indexes)s=this.indexes[a],n<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=Kg(Hg(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 zg(t)]}else if(t.selector)t=[new Yu(t)];else if(t.name)t=[new Ju(t)];else if(t.text)t=[new Gg(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Wg]||Jg.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Ug]&&Yg(i),typeof i.raws.before>"u"&&r&&typeof r.raws.before<"u"&&(i.raws.before=r.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let i of n)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+n.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 r;for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(i=>{r.props&&!r.props.includes(i.prop)||r.fast&&!i.value.includes(r.fast)||(i.value=i.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let i;try{i=t(r,n)}catch(o){throw r.addToError(o)}return i!==!1&&r.walk&&(i=r.walk(t)),i})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,i)}):this.walk((n,i)=>{if(n.type==="atrule"&&n.name===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="atrule")return r(n,i)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,i)}):this.walk((n,i)=>{if(n.type==="decl"&&n.prop===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="decl")return r(n,i)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,i)}):this.walk((n,i)=>{if(n.type==="rule"&&n.selector===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="rule")return r(n,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]}};Tt.registerParse=e=>{Hg=e};Tt.registerRule=e=>{Yu=e};Tt.registerAtRule=e=>{Ju=e};Tt.registerRoot=e=>{qg=e};var yr=Tt;Tt.default=Tt;Tt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Ju.prototype):e.type==="rule"?Object.setPrototypeOf(e,Yu.prototype):e.type==="decl"?Object.setPrototypeOf(e,zg.prototype):e.type==="comment"?Object.setPrototypeOf(e,Gg.prototype):e.type==="root"&&Object.setPrototypeOf(e,qg.prototype),e[Wg]=!0,e.nodes&&e.nodes.forEach(t=>{Tt.rebuild(t)})};var oT=yr,Zg,Xg,Kn=class extends oT{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Zg(new Xg,this,t).stringify()}};Kn.registerLazyResult=e=>{Zg=e};Kn.registerProcessor=e=>{Xg=e};var Zu=Kn;Kn.default=Kn;var Vm={},Qg=function(t){Vm[t]||(Vm[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},pu=class{constructor(t,r={}){if(this.type="warning",this.text=t,r.node&&r.node.source){let n=r.node.rangeBy(r);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in r)this[n]=r[n]}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}},ey=pu;pu.default=pu;var sT=ey,hu=class{constructor(t,r,n){this.processor=t,this.messages=[],this.root=r,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new sT(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},Xu=hu;hu.default=hu;var ql=39,Bm=34,Eo=92,Um=47,Co=10,jn=32,Ao=12,Io=9,Po=13,aT=91,lT=93,uT=40,cT=41,dT=123,fT=125,pT=59,hT=42,mT=58,gT=64,To=/[\t\n\f\r "#'()/;[\\\]{}]/g,Mo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,yT=/.[\r\n"'(/\\]/,Wm=/[\da-f]/i,bT=function(t,r={}){let n=t.css.valueOf(),i=r.ignoreErrors,o,s,a,l,u,c,d,p,h,f,m=n.length,g=0,S=[],w=[];function y(){return g}function x(M){throw t.error("Unclosed "+M,g)}function E(){return w.length===0&&g>=m}function N(M){if(w.length)return w.pop();if(g>=m)return;let C=M?M.ignoreUnclosed:!1;switch(o=n.charCodeAt(g),o){case Co:case jn:case Io:case Po:case Ao:{s=g;do s+=1,o=n.charCodeAt(s);while(o===jn||o===Co||o===Io||o===Po||o===Ao);f=["space",n.slice(g,s)],g=s-1;break}case aT:case lT:case dT:case fT:case mT:case pT:case cT:{let V=String.fromCharCode(o);f=[V,V,g];break}case uT:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==ql&&h!==Bm&&h!==jn&&h!==Co&&h!==Io&&h!==Ao&&h!==Po){s=g;do{if(c=!1,s=n.indexOf(")",s+1),s===-1)if(i||C){s=g;break}else x("bracket");for(d=s;n.charCodeAt(d-1)===Eo;)d-=1,c=!c}while(c);f=["brackets",n.slice(g,s+1),g,s],g=s}else s=n.indexOf(")",g+1),l=n.slice(g,s+1),s===-1||yT.test(l)?f=["(","(",g]:(f=["brackets",l,g,s],g=s);break}case ql:case Bm:{a=o===ql?"'":'"',s=g;do{if(c=!1,s=n.indexOf(a,s+1),s===-1)if(i||C){s=g+1;break}else x("string");for(d=s;n.charCodeAt(d-1)===Eo;)d-=1,c=!c}while(c);f=["string",n.slice(g,s+1),g,s],g=s;break}case gT:{To.lastIndex=g+1,To.test(n),To.lastIndex===0?s=n.length-1:s=To.lastIndex-2,f=["at-word",n.slice(g,s+1),g,s],g=s;break}case Eo:{for(s=g,u=!0;n.charCodeAt(s+1)===Eo;)s+=1,u=!u;if(o=n.charCodeAt(s+1),u&&o!==Um&&o!==jn&&o!==Co&&o!==Io&&o!==Po&&o!==Ao&&(s+=1,Wm.test(n.charAt(s)))){for(;Wm.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===jn&&(s+=1)}f=["word",n.slice(g,s+1),g,s],g=s;break}default:{o===Um&&n.charCodeAt(g+1)===hT?(s=n.indexOf("*/",g+2)+1,s===0&&(i||C?s=n.length:x("comment")),f=["comment",n.slice(g,s+1),g,s],g=s):(Mo.lastIndex=g+1,Mo.test(n),Mo.lastIndex===0?s=n.length-1:s=Mo.lastIndex-2,f=["word",n.slice(g,s+1),g,s],S.push(f),g=s);break}}return g++,f}function I(M){w.push(M)}return{back:I,endOfFile:E,nextToken:N,position:y}},ty=yr,rs=class extends ty{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)}},Qu=rs;rs.default=rs;ty.registerAtRule(rs);var ry=yr,ny,iy,Gr=class extends ry{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,r,n){let i=super.normalize(t);if(r){if(n==="prepend")this.nodes.length>1?r.raws.before=this.nodes[1].raws.before:delete r.raws.before;else if(this.first!==r)for(let o of i)o.raws.before=r.raws.before}return i}removeChild(t,r){let n=this.index(t);return!r&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(t)}toResult(t={}){return new ny(new iy,this,t).stringify()}};Gr.registerLazyResult=e=>{ny=e};Gr.registerProcessor=e=>{iy=e};var ii=Gr;Gr.default=Gr;ry.registerRoot(Gr);var Yn={comma(e){return Yn.split(e,[","],!0)},space(e){let t=[" ",`
|
|
64
|
-
`," "];return Yn.split(e,t)},split(e,t,r){let n=[],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!==""&&n.push(i.trim()),i="",o=!1):i+=c;return(r||i!=="")&&n.push(i.trim()),n}},
|
|
62
|
+
`),this.css+=r+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),n=t.root||Go(t.file),i;this.mapOpts.sourcesContent===!1?(i=new Dg(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let r=this.root.nodes.length-1;r>=0;r--)t=this.root.nodes[r],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(r)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),eT&&QP&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,r=>{t+=r}),[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=zo.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new zo({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 zo({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,r=1,n="<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=r-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=n,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
|
|
63
|
+
`),r=a.length-s):r+=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=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=r-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(r=>r.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 r=this.memoizedPaths.get(t);if(r)return r;let n=this.opts.to?Go(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=Go(Fg(n,this.mapOpts.annotation)));let i=_g(n,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 r=t.source.input.map;this.previousMaps.includes(r)||this.previousMaps.push(r)}});else{let t=new XP(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(r=>{if(r.source){let n=r.source.input.from;if(n&&!t[n]){t[n]=!0;let i=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(i,r.source.input.css)}}});else if(this.css){let r=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(r,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 r=this.memoizedFileURLs.get(t);if(r)return r;if(Fm){let n=Fm(t).toString();return this.memoizedFileURLs.set(t,n),n}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let r=this.memoizedURLs.get(t);if(r)return r;jg==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},Vg=tT,rT=hs,du=class extends rT{constructor(t){super(t),this.type="comment"}},ys=du;du.default=du;var{isClean:Bg,my:Ug}=ni,Wg=ms,zg=ys,nT=hs,Gg,Ku,Yu,Hg;function qg(e){return e.map(t=>(t.nodes&&(t.nodes=qg(t.nodes)),delete t.source,t))}function Kg(e){if(e[Bg]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Kg(t)}var Tt=class Yg extends nT{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let i of n)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r=this.getIterator(),n,i;for(;this.indexes[r]<this.proxyOf.nodes.length&&(n=this.indexes[r],i=t(this.proxyOf.nodes[n],n),i!==!1);)this.indexes[r]+=1;return delete this.indexes[r],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,r){return r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):r==="every"||r==="some"?n=>t[r]((i,...o)=>n(i.toProxy(),...o)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="name"||r==="params"||r==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n=this.index(t),i=this.normalize(r,this.proxyOf.nodes[n]).reverse();n=this.index(t);for(let s of i)this.proxyOf.nodes.splice(n+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],n<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,r){let n=this.index(t),i=n===0?"prepend":!1,o=this.normalize(r,this.proxyOf.nodes[n],i).reverse();n=this.index(t);for(let a of o)this.proxyOf.nodes.splice(n,0,a);let s;for(let a in this.indexes)s=this.indexes[a],n<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=qg(Gg(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 Wg(t)]}else if(t.selector)t=[new Ku(t)];else if(t.name)t=[new Yu(t)];else if(t.text)t=[new zg(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Ug]||Yg.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Bg]&&Kg(i),typeof i.raws.before>"u"&&r&&typeof r.raws.before<"u"&&(i.raws.before=r.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let i of n)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+n.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 r;for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(i=>{r.props&&!r.props.includes(i.prop)||r.fast&&!i.value.includes(r.fast)||(i.value=i.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let i;try{i=t(r,n)}catch(o){throw r.addToError(o)}return i!==!1&&r.walk&&(i=r.walk(t)),i})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,i)}):this.walk((n,i)=>{if(n.type==="atrule"&&n.name===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="atrule")return r(n,i)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,i)}):this.walk((n,i)=>{if(n.type==="decl"&&n.prop===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="decl")return r(n,i)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,i)}):this.walk((n,i)=>{if(n.type==="rule"&&n.selector===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="rule")return r(n,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]}};Tt.registerParse=e=>{Gg=e};Tt.registerRule=e=>{Ku=e};Tt.registerAtRule=e=>{Yu=e};Tt.registerRoot=e=>{Hg=e};var yr=Tt;Tt.default=Tt;Tt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Yu.prototype):e.type==="rule"?Object.setPrototypeOf(e,Ku.prototype):e.type==="decl"?Object.setPrototypeOf(e,Wg.prototype):e.type==="comment"?Object.setPrototypeOf(e,zg.prototype):e.type==="root"&&Object.setPrototypeOf(e,Hg.prototype),e[Ug]=!0,e.nodes&&e.nodes.forEach(t=>{Tt.rebuild(t)})};var iT=yr,Jg,Zg,Kn=class extends iT{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Jg(new Zg,this,t).stringify()}};Kn.registerLazyResult=e=>{Jg=e};Kn.registerProcessor=e=>{Zg=e};var Ju=Kn;Kn.default=Kn;var jm={},Xg=function(t){jm[t]||(jm[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},fu=class{constructor(t,r={}){if(this.type="warning",this.text=t,r.node&&r.node.source){let n=r.node.rangeBy(r);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in r)this[n]=r[n]}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}},Qg=fu;fu.default=fu;var oT=Qg,pu=class{constructor(t,r,n){this.processor=t,this.messages=[],this.root=r,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new oT(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},Zu=pu;pu.default=pu;var Hl=39,Vm=34,Eo=92,Bm=47,Co=10,jn=32,Ao=12,Io=9,Po=13,sT=91,aT=93,lT=40,uT=41,cT=123,dT=125,fT=59,pT=42,hT=58,mT=64,To=/[\t\n\f\r "#'()/;[\\\]{}]/g,Mo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,gT=/.[\r\n"'(/\\]/,Um=/[\da-f]/i,yT=function(t,r={}){let n=t.css.valueOf(),i=r.ignoreErrors,o,s,a,l,u,c,d,p,h,f,m=n.length,g=0,S=[],w=[];function y(){return g}function x(M){throw t.error("Unclosed "+M,g)}function E(){return w.length===0&&g>=m}function N(M){if(w.length)return w.pop();if(g>=m)return;let C=M?M.ignoreUnclosed:!1;switch(o=n.charCodeAt(g),o){case Co:case jn:case Io:case Po:case Ao:{s=g;do s+=1,o=n.charCodeAt(s);while(o===jn||o===Co||o===Io||o===Po||o===Ao);f=["space",n.slice(g,s)],g=s-1;break}case sT:case aT:case cT:case dT:case hT:case fT:case uT:{let V=String.fromCharCode(o);f=[V,V,g];break}case lT:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==Hl&&h!==Vm&&h!==jn&&h!==Co&&h!==Io&&h!==Ao&&h!==Po){s=g;do{if(c=!1,s=n.indexOf(")",s+1),s===-1)if(i||C){s=g;break}else x("bracket");for(d=s;n.charCodeAt(d-1)===Eo;)d-=1,c=!c}while(c);f=["brackets",n.slice(g,s+1),g,s],g=s}else s=n.indexOf(")",g+1),l=n.slice(g,s+1),s===-1||gT.test(l)?f=["(","(",g]:(f=["brackets",l,g,s],g=s);break}case Hl:case Vm:{a=o===Hl?"'":'"',s=g;do{if(c=!1,s=n.indexOf(a,s+1),s===-1)if(i||C){s=g+1;break}else x("string");for(d=s;n.charCodeAt(d-1)===Eo;)d-=1,c=!c}while(c);f=["string",n.slice(g,s+1),g,s],g=s;break}case mT:{To.lastIndex=g+1,To.test(n),To.lastIndex===0?s=n.length-1:s=To.lastIndex-2,f=["at-word",n.slice(g,s+1),g,s],g=s;break}case Eo:{for(s=g,u=!0;n.charCodeAt(s+1)===Eo;)s+=1,u=!u;if(o=n.charCodeAt(s+1),u&&o!==Bm&&o!==jn&&o!==Co&&o!==Io&&o!==Po&&o!==Ao&&(s+=1,Um.test(n.charAt(s)))){for(;Um.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===jn&&(s+=1)}f=["word",n.slice(g,s+1),g,s],g=s;break}default:{o===Bm&&n.charCodeAt(g+1)===pT?(s=n.indexOf("*/",g+2)+1,s===0&&(i||C?s=n.length:x("comment")),f=["comment",n.slice(g,s+1),g,s],g=s):(Mo.lastIndex=g+1,Mo.test(n),Mo.lastIndex===0?s=n.length-1:s=Mo.lastIndex-2,f=["word",n.slice(g,s+1),g,s],S.push(f),g=s);break}}return g++,f}function I(M){w.push(M)}return{back:I,endOfFile:E,nextToken:N,position:y}},ey=yr,rs=class extends ey{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)}},Xu=rs;rs.default=rs;ey.registerAtRule(rs);var ty=yr,ry,ny,Gr=class extends ty{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,r,n){let i=super.normalize(t);if(r){if(n==="prepend")this.nodes.length>1?r.raws.before=this.nodes[1].raws.before:delete r.raws.before;else if(this.first!==r)for(let o of i)o.raws.before=r.raws.before}return i}removeChild(t,r){let n=this.index(t);return!r&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(t)}toResult(t={}){return new ry(new ny,this,t).stringify()}};Gr.registerLazyResult=e=>{ry=e};Gr.registerProcessor=e=>{ny=e};var ii=Gr;Gr.default=Gr;ty.registerRoot(Gr);var Yn={comma(e){return Yn.split(e,[","],!0)},space(e){let t=[" ",`
|
|
64
|
+
`," "];return Yn.split(e,t)},split(e,t,r){let n=[],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!==""&&n.push(i.trim()),i="",o=!1):i+=c;return(r||i!=="")&&n.push(i.trim()),n}},iy=Yn;Yn.default=Yn;var oy=yr,bT=iy,ns=class extends oy{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return bT.comma(this.selector)}set selectors(t){let r=this.selector?this.selector.match(/,\s*/):null,n=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(n)}},Qu=ns;ns.default=ns;oy.registerRule(ns);var ST=ms,wT=yT,vT=ys,xT=Xu,RT=ii,Wm=Qu,zm={empty:!0,space:!0};function kT(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var ET=class{constructor(t){this.input=t,this.root=new RT,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 r=new xT;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);let n,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),n=t[0],n==="("||n==="["?u.push(n==="("?")":"]"):n==="{"&&u.length>0?u.push("}"):n===u[u.length-1]&&u.pop(),u.length===0)if(n===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){a=!0;break}else if(n==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(r.source.end=this.getPosition(i[3]||i[2]),r.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(r.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(r,"params",l),s&&(t=l[l.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)}checkMissedSemicolon(t){let r=this.colon(t);if(r===!1)return;let n=0,i;for(let o=r-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(n+=1,n===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let r=0,n,i,o;for(let[s,a]of t.entries()){if(n=a,i=n[0],i==="("&&(r+=1),i===")"&&(r-=1),r===0&&i===":")if(!o)this.doubleColon(n);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=n}return!1}comment(t){let r=new vT;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;let n=t[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=i[2],r.raws.left=i[1],r.raws.right=i[3]}}createTokenizer(){this.tokenizer=wT(this.input)}decl(t,r){let n=new ST;this.init(n,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(i[3]||i[2]||kT(t)),n.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;n.prop+=t.shift()[1]}n.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){n.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1];(n.prop[0]==="_"||n.prop[0]==="*")&&(n.raws.before+=n.prop[0],n.prop=n.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"){n.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(n.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let p=u;p>0;p--){let h=c[p][0];if(d.trim().indexOf("!")===0&&h!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(n.important=!0,n.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(n.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(n,"value",s.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let r=new Wm;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r}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 r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}}init(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let r=!1,n=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(n=u[0],l.push(u),n==="("||n==="[")o||(o=u),s.push(n==="("?")":"]");else if(a&&i&&n==="{")o||(o=u),s.push("}");else if(s.length===0)if(n===";")if(i){this.decl(l,a);return}else break;else if(n==="{"){this.rule(l);return}else if(n==="}"){this.tokenizer.back(l.pop()),r=!0;break}else n===":"&&(i=!0);else n===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),s.length>0&&this.unclosedBracket(o),r&&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,r,n,i){let o,s,a=n.length,l="",u=!0,c,d;for(let p=0;p<a;p+=1)o=n[p],s=o[0],s==="space"&&p===a-1&&!i?u=!1:s==="comment"?(d=n[p-1]?n[p-1][0]:"empty",c=n[p+1]?n[p+1][0]:"empty",!zm[d]&&!zm[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let p=n.reduce((h,f)=>h+f[1],"");t.raws[r]={raw:p,value:l}}t[r]=l}rule(t){t.pop();let r=new Wm;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r}spacesAndCommentsFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)n=t.pop()[1]+n;return n}spacesAndCommentsFromStart(t){let r,n="";for(;t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)n+=t.shift()[1];return n}spacesFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],r==="space");)n=t.pop()[1]+n;return n}stringFrom(t,r){let n="";for(let i=r;i<t.length;i++)n+=t[i][1];return t.splice(r,t.length-r),n}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,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})}},CT=ET,AT=yr,IT=CT,PT=gs;function is(e,t){let r=new PT(e,t),n=new IT(r);try{n.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
|
|
65
65
|
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
|
|
66
66
|
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
|
|
67
|
-
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return n.root}var tc=is;is.default=is;IT.registerParse(is);var{isClean:yt,my:MT}=ni,OT=Bg,NT=ps,LT=yr,$T=Zu,DT=Qg,Hm=Xu,_T=tc,FT=ii,jT={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},VT={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},BT={Once:!0,postcssPlugin:!0,prepare:!0},Hr=0;function Vn(e){return typeof e=="object"&&typeof e.then=="function"}function ay(e){let t=!1,r=jT[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Hr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Hr,r+"Exit"]:[r,r+"Exit"]}function qm(e){let t;return e.type==="document"?t=["Document",Hr,"DocumentExit"]:e.type==="root"?t=["Root",Hr,"RootExit"]:t=ay(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function mu(e){return e[yt]=!1,e.nodes&&e.nodes.forEach(t=>mu(t)),e}var gu={},qr=class ly{constructor(t,r,n){this.stringified=!1,this.processed=!1;let i;if(typeof r=="object"&&r!==null&&(r.type==="root"||r.type==="document"))i=mu(r);else if(r instanceof ly||r instanceof Hm)i=mu(r.root),r.map&&(typeof n.map>"u"&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let o=_T;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(r,n)}catch(s){this.processed=!0,this.error=s}i&&!i[MT]&<.rebuild(i)}this.result=new Hm(t,i,n),this.helpers={...gu,postcss:gu,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,r){let n=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=n.postcssPlugin,t.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!=="production"){let i=n.postcssPlugin,o=n.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=(r,n,i)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,i])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!VT[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!BT[n])if(typeof r[n]=="object")for(let i in r[n])i==="*"?t(r,n,r[n][i]):t(r,n+"-"+i.toLowerCase(),r[n][i]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(Vn(n))try{await n}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[yt];){t[yt]=!0;let r=[qm(t)];for(;r.length>0;){let n=this.visitTick(r);if(Vn(n))try{await n}catch(i){let o=r[r.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let i=t.nodes.map(o=>n(o,this.helpers));await Promise.all(i)}else await n(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 r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return Vn(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=NT;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new OT(r,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 r=this.runOnRoot(t);if(Vn(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[yt];)t[yt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||DT("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,r)}toString(){return this.css}visitSync(t,r){for(let[n,i]of t){this.result.lastPlugin=n;let o;try{o=i(r,this.helpers)}catch(s){throw this.handleError(s,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(Vn(o))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent){t.pop();return}if(i.length>0&&r.visitorIndex<i.length){let[s,a]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=s;try{return a(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let s=r.iterator,a;for(;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[yt]){a[yt]=!0,t.push(qm(a));return}r.iterator=0,delete n.indexes[s]}let o=r.events;for(;r.eventIndex<o.length;){let s=o[r.eventIndex];if(r.eventIndex+=1,s===Hr){n.nodes&&n.nodes.length&&(n[yt]=!0,r.iterator=n.getIterator());return}else if(this.listeners[s]){r.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[yt]=!0;let r=ay(t);for(let n of r)if(n===Hr)t.nodes&&t.each(i=>{i[yt]||this.walkSync(i)});else{let i=this.listeners[n];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"}};qr.registerPostcss=e=>{gu=e};var uy=qr;qr.default=qr;FT.registerLazyResult(qr);$T.registerLazyResult(qr);var UT=Bg,WT=ps,zT=Qg,GT=tc,HT=Xu,yu=class{constructor(t,r,n){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=n,this._map=void 0;let i,o=WT;this.result=new HT(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new UT(o,i,this._opts,r);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,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||zT("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,r)}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,r=GT;try{t=r(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},qT=yu;yu.default=yu;var KT=qT,YT=uy,JT=Zu,ZT=ii,Jn=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let r=[];for(let n of t)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n=="object"&&Array.isArray(n.plugins))r=r.concat(n.plugins);else if(typeof n=="object"&&n.postcssPlugin)r.push(n);else if(typeof n=="function")r.push(n);else if(typeof n=="object"&&(n.parse||n.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(n+" is not a PostCSS plugin");return r}process(t,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new KT(this,t,r):new YT(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},XT=Jn;Jn.default=Jn;ZT.registerProcessor(Jn);JT.registerProcessor(Jn);var QT=ms,eM=Dg,tM=ys,rM=Qu,nM=gs,iM=ii,oM=ec;function Zn(e,t){if(Array.isArray(e))return e.map(i=>Zn(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:nM.prototype};o.map&&(o.map={...o.map,__proto__:eM.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>Zn(i,t))),n.source){let{inputId:i,...o}=n.source;n.source=o,i!=null&&(n.source.input=t[i])}if(n.type==="root")return new iM(n);if(n.type==="decl")return new QT(n);if(n.type==="rule")return new oM(n);if(n.type==="comment")return new tM(n);if(n.type==="atrule")return new rM(n);throw new Error("Unknown node type: "+e.type)}var sM=Zn;Zn.default=Zn;var aM=Ku,cy=ms,lM=uy,uM=yr,rc=XT,cM=ps,dM=sM,dy=Zu,fM=ey,fy=ys,py=Qu,pM=Xu,hM=gs,mM=tc,gM=oy,hy=ec,my=ii,yM=hs;function re(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new rc(e)}re.plugin=function(t,r){let n=!1;function i(...s){console&&console.warn&&!n&&(n=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
67
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return n.root}var ec=is;is.default=is;AT.registerParse(is);var{isClean:yt,my:TT}=ni,MT=Vg,OT=ps,NT=yr,LT=Ju,$T=Xg,Gm=Zu,DT=ec,_T=ii,FT={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},jT={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},VT={Once:!0,postcssPlugin:!0,prepare:!0},Hr=0;function Vn(e){return typeof e=="object"&&typeof e.then=="function"}function sy(e){let t=!1,r=FT[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Hr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Hr,r+"Exit"]:[r,r+"Exit"]}function Hm(e){let t;return e.type==="document"?t=["Document",Hr,"DocumentExit"]:e.type==="root"?t=["Root",Hr,"RootExit"]:t=sy(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function hu(e){return e[yt]=!1,e.nodes&&e.nodes.forEach(t=>hu(t)),e}var mu={},qr=class ay{constructor(t,r,n){this.stringified=!1,this.processed=!1;let i;if(typeof r=="object"&&r!==null&&(r.type==="root"||r.type==="document"))i=hu(r);else if(r instanceof ay||r instanceof Gm)i=hu(r.root),r.map&&(typeof n.map>"u"&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let o=DT;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(r,n)}catch(s){this.processed=!0,this.error=s}i&&!i[TT]&&NT.rebuild(i)}this.result=new Gm(t,i,n),this.helpers={...mu,postcss:mu,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,r){let n=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=n.postcssPlugin,t.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!=="production"){let i=n.postcssPlugin,o=n.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=(r,n,i)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,i])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!jT[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!VT[n])if(typeof r[n]=="object")for(let i in r[n])i==="*"?t(r,n,r[n][i]):t(r,n+"-"+i.toLowerCase(),r[n][i]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(Vn(n))try{await n}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[yt];){t[yt]=!0;let r=[Hm(t)];for(;r.length>0;){let n=this.visitTick(r);if(Vn(n))try{await n}catch(i){let o=r[r.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let i=t.nodes.map(o=>n(o,this.helpers));await Promise.all(i)}else await n(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 r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return Vn(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=OT;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new MT(r,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 r=this.runOnRoot(t);if(Vn(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[yt];)t[yt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){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,r)}toString(){return this.css}visitSync(t,r){for(let[n,i]of t){this.result.lastPlugin=n;let o;try{o=i(r,this.helpers)}catch(s){throw this.handleError(s,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(Vn(o))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent){t.pop();return}if(i.length>0&&r.visitorIndex<i.length){let[s,a]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=s;try{return a(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let s=r.iterator,a;for(;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[yt]){a[yt]=!0,t.push(Hm(a));return}r.iterator=0,delete n.indexes[s]}let o=r.events;for(;r.eventIndex<o.length;){let s=o[r.eventIndex];if(r.eventIndex+=1,s===Hr){n.nodes&&n.nodes.length&&(n[yt]=!0,r.iterator=n.getIterator());return}else if(this.listeners[s]){r.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[yt]=!0;let r=sy(t);for(let n of r)if(n===Hr)t.nodes&&t.each(i=>{i[yt]||this.walkSync(i)});else{let i=this.listeners[n];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"}};qr.registerPostcss=e=>{mu=e};var ly=qr;qr.default=qr;_T.registerLazyResult(qr);LT.registerLazyResult(qr);var BT=Vg,UT=ps,WT=Xg,zT=ec,GT=Zu,gu=class{constructor(t,r,n){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=n,this._map=void 0;let i,o=UT;this.result=new GT(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new BT(o,i,this._opts,r);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,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||WT("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,r)}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,r=zT;try{t=r(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},HT=gu;gu.default=gu;var qT=HT,KT=ly,YT=Ju,JT=ii,Jn=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let r=[];for(let n of t)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n=="object"&&Array.isArray(n.plugins))r=r.concat(n.plugins);else if(typeof n=="object"&&n.postcssPlugin)r.push(n);else if(typeof n=="function")r.push(n);else if(typeof n=="object"&&(n.parse||n.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(n+" is not a PostCSS plugin");return r}process(t,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new qT(this,t,r):new KT(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},ZT=Jn;Jn.default=Jn;JT.registerProcessor(Jn);YT.registerProcessor(Jn);var XT=ms,QT=$g,eM=ys,tM=Xu,rM=gs,nM=ii,iM=Qu;function Zn(e,t){if(Array.isArray(e))return e.map(i=>Zn(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:rM.prototype};o.map&&(o.map={...o.map,__proto__:QT.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>Zn(i,t))),n.source){let{inputId:i,...o}=n.source;n.source=o,i!=null&&(n.source.input=t[i])}if(n.type==="root")return new nM(n);if(n.type==="decl")return new XT(n);if(n.type==="rule")return new iM(n);if(n.type==="comment")return new eM(n);if(n.type==="atrule")return new tM(n);throw new Error("Unknown node type: "+e.type)}var oM=Zn;Zn.default=Zn;var sM=qu,uy=ms,aM=ly,lM=yr,tc=ZT,uM=ps,cM=oM,cy=Ju,dM=Qg,dy=ys,fy=Xu,fM=Zu,pM=gs,hM=ec,mM=iy,py=Qu,hy=ii,gM=hs;function re(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new tc(e)}re.plugin=function(t,r){let n=!1;function i(...s){console&&console.warn&&!n&&(n=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
68
68
|
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:
|
|
69
|
-
https://www.w3ctech.com/topic/2226`));let a=r(...s);return a.postcssPlugin=t,a.postcssVersion=new
|
|
69
|
+
https://www.w3ctech.com/topic/2226`));let a=r(...s);return a.postcssPlugin=t,a.postcssVersion=new tc().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return re([i(l)]).process(s,a)},i};re.stringify=uM;re.parse=hM;re.fromJSON=cM;re.list=mM;re.comment=e=>new dy(e);re.atRule=e=>new fy(e);re.decl=e=>new uy(e);re.rule=e=>new py(e);re.root=e=>new hy(e);re.document=e=>new cy(e);re.CssSyntaxError=sM;re.Declaration=uy;re.Container=lM;re.Processor=tc;re.Document=cy;re.Comment=dy;re.Warning=dM;re.AtRule=fy;re.Result=fM;re.Input=pM;re.Rule=py;re.Root=hy;re.Node=gM;aM.registerPostcss(re);var yM=re;re.default=re;var he=AP(yM);he.stringify;he.fromJSON;he.plugin;he.parse;he.list;he.document;he.comment;he.atRule;he.rule;he.decl;he.root;he.CssSyntaxError;he.Declaration;he.Container;he.Processor;he.Document;he.Comment;he.Warning;he.AtRule;he.Result;he.Input;he.Rule;he.Root;he.Node;var bM=Object.defineProperty,SM=(e,t,r)=>t in e?bM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xe=(e,t,r)=>SM(e,typeof t!="symbol"?t+"":t,r);function wM(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function vM(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var rc={exports:{}},pe=String,my=function(){return{isColorSupported:!1,reset:pe,bold:pe,dim:pe,italic:pe,underline:pe,inverse:pe,hidden:pe,strikethrough:pe,black:pe,red:pe,green:pe,yellow:pe,blue:pe,magenta:pe,cyan:pe,white:pe,gray:pe,bgBlack:pe,bgRed:pe,bgGreen:pe,bgYellow:pe,bgBlue:pe,bgMagenta:pe,bgCyan:pe,bgWhite:pe}};rc.exports=my();rc.exports.createColors=my;var xM=rc.exports,RM={},kM=Object.freeze(Object.defineProperty({__proto__:null,default:RM},Symbol.toStringTag,{value:"Module"})),lt=vM(kM),qm=xM,Km=lt,yu=class gy extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof r<"u"&&typeof n<"u"&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,gy)}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 r=this.source;t==null&&(t=qm.isColorSupported),Km&&t&&(r=Km(r));let n=r.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=qm.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return n.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let h=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
|
|
70
70
|
`+h+a("^")}return" "+l(p)+u}).join(`
|
|
71
71
|
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
72
72
|
|
|
73
73
|
`+t+`
|
|
74
|
-
`),this.name+": "+this.message+t}},
|
|
74
|
+
`),this.name+": "+this.message+t}},nc=yu;yu.default=yu;var oi={};oi.isClean=Symbol("isClean");oi.my=Symbol("my");var Ym={after:`
|
|
75
75
|
`,beforeClose:`
|
|
76
76
|
`,beforeComment:`
|
|
77
77
|
`,beforeDecl:`
|
|
78
78
|
`,beforeOpen:" ",beforeRule:`
|
|
79
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function
|
|
80
|
-
`)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)n+=s}return n}block(t,r){let n=this.raw(t,"between","beforeOpen");this.builder(r+n+"{",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 r=t.nodes.length-1;for(;r>0&&t.nodes[r].type==="comment";)r-=1;let n=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,r!==i||n)}}comment(t){let r=this.raw(t,"left","commentLeft"),n=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+n+"*/",t)}decl(t,r){let n=this.raw(t,"between","colon"),i=t.prop+n+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),r&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],typeof i<"u"))return i;let o=t.parent;if(n==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return
|
|
79
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function EM(e){return e[0].toUpperCase()+e.slice(1)}var bu=class{constructor(t){this.builder=t}atrule(t,r){let n="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?n+=t.raws.afterName:i&&(n+=" "),t.nodes)this.block(t,n+i);else{let o=(t.raws.between||"")+(r?";":"");this.builder(n+i+o,t)}}beforeAfter(t,r){let n;t.type==="decl"?n=this.raw(t,null,"beforeDecl"):t.type==="comment"?n=this.raw(t,null,"beforeComment"):r==="before"?n=this.raw(t,null,"beforeRule"):n=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(n.includes(`
|
|
80
|
+
`)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)n+=s}return n}block(t,r){let n=this.raw(t,"between","beforeOpen");this.builder(r+n+"{",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 r=t.nodes.length-1;for(;r>0&&t.nodes[r].type==="comment";)r-=1;let n=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,r!==i||n)}}comment(t){let r=this.raw(t,"left","commentLeft"),n=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+n+"*/",t)}decl(t,r){let n=this.raw(t,"between","colon"),i=t.prop+n+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),r&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],typeof i<"u"))return i;let o=t.parent;if(n==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return Ym[n];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[n]<"u")return s.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(t,n);{let a="raw"+EM(n);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[r],typeof i<"u")return!1})}return typeof i>"u"&&(i=Ym[n]),s.rawCache[n]=i,i}rawBeforeClose(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return r=n.raws.after,r.includes(`
|
|
81
81
|
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r}rawBeforeComment(t,r){let n;return t.walkComments(i=>{if(typeof i.raws.before<"u")return n=i.raws.before,n.includes(`
|
|
82
82
|
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(r,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(t,r){let n;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return n=i.raws.before,n.includes(`
|
|
83
83
|
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(r,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(t){let r;return t.walk(n=>{if(n.type!=="decl"&&(r=n.raws.between,typeof r<"u"))return!1}),r}rawBeforeRule(t){let r;return t.walk(n=>{if(n.nodes&&(n.parent!==t||t.first!==n)&&typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
|
|
84
84
|
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r}rawColon(t){let r;return t.walkDecls(n=>{if(typeof n.raws.between<"u")return r=n.raws.between.replace(/[^\s:]/g,""),!1}),r}rawEmptyBody(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length===0&&(r=n.raws.after,typeof r<"u"))return!1}),r}rawIndent(t){if(t.raws.indent)return t.raws.indent;let r;return t.walk(n=>{let i=n.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof n.raws.before<"u"){let o=n.raws.before.split(`
|
|
85
|
-
`);return r=o[o.length-1],r=r.replace(/\S/g,""),!1}}),r}rawSemicolon(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(r=n.raws.semicolon,typeof r<"u"))return!1}),r}rawValue(t,r){let n=t[r],i=t.raws[r];return i&&i.value===n?i.raw:n}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,r){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,r)}},
|
|
86
|
-
`?(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 r={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(r=this.positionInside(o,i),n=this.positionInside(o+t.word.length,i))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?n={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?n=this.positionInside(t.endIndex):t.index&&(n=this.positionInside(t.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line}),{end:n,start:r}}raw(t,r){return new
|
|
87
|
-
`);n=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)n[a]=s,s+=o[a].length+1;this[
|
|
85
|
+
`);return r=o[o.length-1],r=r.replace(/\S/g,""),!1}}),r}rawSemicolon(t){let r;return t.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(r=n.raws.semicolon,typeof r<"u"))return!1}),r}rawValue(t,r){let n=t[r],i=t.raws[r];return i&&i.value===n?i.raw:n}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,r){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,r)}},yy=bu;bu.default=bu;var CM=yy;function Su(e,t){new CM(t).stringify(e)}var bs=Su;Su.default=Su;var{isClean:Oo,my:AM}=oi,IM=nc,PM=yy,TM=bs;function wu(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let i=e[n],o=typeof i;n==="parent"&&o==="object"?t&&(r[n]=t):n==="source"?r[n]=i:Array.isArray(i)?r[n]=i.map(s=>wu(s,r)):(o==="object"&&i!==null&&(i=wu(i)),r[n]=i)}return r}var vu=class{constructor(t={}){this.raws={},this[Oo]=!1,this[AM]=!0;for(let r in t)if(r==="nodes"){this.nodes=[];for(let n of t[r])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[r]=t[r]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let r=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${r.input.from}:${r.start.line}:${r.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let r in t)this[r]=t[r];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 r=wu(this);for(let n in t)r[n]=t[n];return r}cloneAfter(t={}){let r=this.clone(t);return this.parent.insertAfter(this,r),r}cloneBefore(t={}){let r=this.clone(t);return this.parent.insertBefore(this,r),r}error(t,r={}){if(this.source){let{end:n,start:i}=this.rangeBy(r);return this.source.input.error(t,{column:i.column,line:i.line},{column:n.column,line:n.line},r)}return new IM(t)}getProxyProcessor(){return{get(t,r){return r==="proxyOf"?t:r==="root"?()=>t.root().toProxy():t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="prop"||r==="value"||r==="name"||r==="params"||r==="important"||r==="text")&&t.markDirty()),!0}}}markDirty(){if(this[Oo]){this[Oo]=!1;let t=this;for(;t=t.parent;)t[Oo]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,r){let n=this.source.start;if(t.index)n=this.positionInside(t.index,r);else if(t.word){r=this.toString();let i=r.indexOf(t.word);i!==-1&&(n=this.positionInside(i,r))}return n}positionInside(t,r){let n=r||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)n[s]===`
|
|
86
|
+
`?(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 r={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(r=this.positionInside(o,i),n=this.positionInside(o+t.word.length,i))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?n={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?n=this.positionInside(t.endIndex):t.index&&(n=this.positionInside(t.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line}),{end:n,start:r}}raw(t,r){return new PM().raw(this,t,r)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let r=this,n=!1;for(let i of t)i===this?n=!0:n?(this.parent.insertAfter(r,i),r=i):this.parent.insertBefore(r,i);n||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,r){let n={},i=r==null;r=r||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))n[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,r):l);else if(typeof a=="object"&&a.toJSON)n[s]=a.toJSON(null,r);else if(s==="source"){let l=r.get(a.input);l==null&&(l=o,r.set(a.input,o),o++),n[s]={end:a.end,inputId:l,start:a.start}}else n[s]=a}return i&&(n.inputs=[...r.keys()].map(s=>s.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=TM){t.stringify&&(t=t.stringify);let r="";return t(this,n=>{r+=n}),r}warn(t,r,n){let i={node:this};for(let o in n)i[o]=n[o];return t.warn(r,i)}get proxyOf(){return this}},Ss=vu;vu.default=vu;var MM=Ss,xu=class extends MM{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]==="$"}},ws=xu;xu.default=xu;var OM="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",NM=(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n},LM=(e=21)=>{let t="",r=e;for(;r--;)t+=OM[Math.random()*64|0];return t},$M={nanoid:LM,customAlphabet:NM},{SourceMapConsumer:Jm,SourceMapGenerator:Zm}=lt,{existsSync:DM,readFileSync:_M}=lt,{dirname:ql,join:FM}=lt;function jM(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Ru=class{constructor(t,r){if(r.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let n=r.map?r.map.prev:void 0,i=this.loadMap(r.from,n);!this.mapFile&&r.from&&(this.mapFile=r.from),this.mapFile&&(this.root=ql(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Jm(this.text)),this.consumerCache}decodeInline(t){let r=/^data:application\/json;charset=utf-?8;base64,/,n=/^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(r.test(t)||n.test(t))return jM(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 r=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!r)return;let n=t.lastIndexOf(r.pop()),i=t.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(n,i)))}loadFile(t){if(this.root=ql(t),DM(t))return this.mapFile=t,_M(t,"utf-8").toString().trim()}loadMap(t,r){if(r===!1)return!1;if(r){if(typeof r=="string")return r;if(typeof r=="function"){let n=r(t);if(n){let i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(r instanceof Jm)return Zm.fromSourceMap(r).toString();if(r instanceof Zm)return r.toString();if(this.isMap(r))return JSON.stringify(r);throw new Error("Unsupported previous source map format: "+r.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let n=this.annotation;return t&&(n=FM(ql(t),n)),this.loadFile(n)}}}startWith(t,r){return t?t.substr(0,r.length)===r:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},by=Ru;Ru.default=Ru;var{SourceMapConsumer:VM,SourceMapGenerator:BM}=lt,{fileURLToPath:Xm,pathToFileURL:No}=lt,{isAbsolute:ku,resolve:Eu}=lt,{nanoid:UM}=$M,Kl=lt,Qm=nc,WM=by,Yl=Symbol("fromOffsetCache"),zM=!!(VM&&BM),eg=!!(Eu&&ku),os=class{constructor(t,r={}){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,r.from&&(!eg||/^\w+:\/\//.test(r.from)||ku(r.from)?this.file=r.from:this.file=Eu(r.from)),eg&&zM){let n=new WM(this.css,r);if(n.text){this.map=n;let i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+UM(6)+">"),this.map&&(this.map.file=this.from)}error(t,r,n,i={}){let o,s,a;if(r&&typeof r=="object"){let u=r,c=n;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);r=d.line,n=d.col}else r=u.line,n=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(!n){let u=this.fromOffset(r);r=u.line,n=u.col}let l=this.origin(r,n,s,a);return l?o=new Qm(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 Qm(t,s===void 0?r:{column:n,line:r},s===void 0?n:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:n,endColumn:a,endLine:s,line:r,source:this.css},this.file&&(No&&(o.input.url=No(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let r,n;if(this[Yl])n=this[Yl];else{let o=this.css.split(`
|
|
87
|
+
`);n=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)n[a]=s,s+=o[a].length+1;this[Yl]=n}r=n[n.length-1];let i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<n[s])o=s-1;else if(t>=n[s+1])i=s+1;else{i=s;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:Eu(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,r,n,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:r,line:t});if(!s.source)return!1;let a;typeof n=="number"&&(a=o.originalPositionFor({column:i,line:n}));let l;ku(s.source)?l=No(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||No(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(Xm)u.file=Xm(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 r of["hasBOM","css","file","id"])this[r]!=null&&(t[r]=this[r]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},vs=os;os.default=os;Kl&&Kl.registerInput&&Kl.registerInput(os);var{SourceMapConsumer:Sy,SourceMapGenerator:Ho}=lt,{dirname:qo,relative:wy,resolve:vy,sep:xy}=lt,{pathToFileURL:tg}=lt,GM=vs,HM=!!(Sy&&Ho),qM=!!(qo&&vy&&wy&&xy),KM=class{constructor(t,r,n,i){this.stringify=t,this.mapOpts=n.map||{},this.root=r,this.opts=n,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 r=`
|
|
88
88
|
`;this.css.includes(`\r
|
|
89
89
|
`)&&(r=`\r
|
|
90
|
-
`),this.css+=r+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),n=t.root||qo(t.file),i;this.mapOpts.sourcesContent===!1?(i=new
|
|
91
|
-
`),r=a.length-s):r+=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=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=r-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(r=>r.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 r=this.memoizedPaths.get(t);if(r)return r;let n=this.opts.to?qo(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=qo(xy(n,this.mapOpts.annotation)));let i=vy(n,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 r=t.source.input.map;this.previousMaps.includes(r)||this.previousMaps.push(r)}});else{let t=new HM(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(r=>{if(r.source){let n=r.source.input.from;if(n&&!t[n]){t[n]=!0;let i=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(i,r.source.input.css)}}});else if(this.css){let r=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(r,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 r=this.memoizedFileURLs.get(t);if(r)return r;if(rg){let n=rg(t).toString();return this.memoizedFileURLs.set(t,n),n}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let r=this.memoizedURLs.get(t);if(r)return r;Ry==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},ky=YM,JM=Ss,Au=class extends JM{constructor(t){super(t),this.type="comment"}},xs=Au;Au.default=Au;var{isClean:Ey,my:Cy}=oi,Ay=ws,Iy=xs,ZM=Ss,Py,oc,sc,Ty;function My(e){return e.map(t=>(t.nodes&&(t.nodes=My(t.nodes)),delete t.source,t))}function Oy(e){if(e[Ey]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Oy(t)}var Mt=class Ny extends ZM{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let i of n)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r=this.getIterator(),n,i;for(;this.indexes[r]<this.proxyOf.nodes.length&&(n=this.indexes[r],i=t(this.proxyOf.nodes[n],n),i!==!1);)this.indexes[r]+=1;return delete this.indexes[r],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,r){return r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):r==="every"||r==="some"?n=>t[r]((i,...o)=>n(i.toProxy(),...o)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="name"||r==="params"||r==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n=this.index(t),i=this.normalize(r,this.proxyOf.nodes[n]).reverse();n=this.index(t);for(let s of i)this.proxyOf.nodes.splice(n+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],n<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,r){let n=this.index(t),i=n===0?"prepend":!1,o=this.normalize(r,this.proxyOf.nodes[n],i).reverse();n=this.index(t);for(let a of o)this.proxyOf.nodes.splice(n,0,a);let s;for(let a in this.indexes)s=this.indexes[a],n<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=My(Py(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 Ay(t)]}else if(t.selector)t=[new oc(t)];else if(t.name)t=[new sc(t)];else if(t.text)t=[new Iy(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Cy]||Ny.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Ey]&&Oy(i),typeof i.raws.before>"u"&&r&&typeof r.raws.before<"u"&&(i.raws.before=r.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let i of n)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+n.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 r;for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(i=>{r.props&&!r.props.includes(i.prop)||r.fast&&!i.value.includes(r.fast)||(i.value=i.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let i;try{i=t(r,n)}catch(o){throw r.addToError(o)}return i!==!1&&r.walk&&(i=r.walk(t)),i})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,i)}):this.walk((n,i)=>{if(n.type==="atrule"&&n.name===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="atrule")return r(n,i)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,i)}):this.walk((n,i)=>{if(n.type==="decl"&&n.prop===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="decl")return r(n,i)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,i)}):this.walk((n,i)=>{if(n.type==="rule"&&n.selector===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="rule")return r(n,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]}};Mt.registerParse=e=>{Py=e};Mt.registerRule=e=>{oc=e};Mt.registerAtRule=e=>{sc=e};Mt.registerRoot=e=>{Ty=e};var br=Mt;Mt.default=Mt;Mt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,sc.prototype):e.type==="rule"?Object.setPrototypeOf(e,oc.prototype):e.type==="decl"?Object.setPrototypeOf(e,Ay.prototype):e.type==="comment"?Object.setPrototypeOf(e,Iy.prototype):e.type==="root"&&Object.setPrototypeOf(e,Ty.prototype),e[Cy]=!0,e.nodes&&e.nodes.forEach(t=>{Mt.rebuild(t)})};var XM=br,Ly,$y,Xn=class extends XM{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Ly(new $y,this,t).stringify()}};Xn.registerLazyResult=e=>{Ly=e};Xn.registerProcessor=e=>{$y=e};var ac=Xn;Xn.default=Xn;var ng={},Dy=function(t){ng[t]||(ng[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Iu=class{constructor(t,r={}){if(this.type="warning",this.text=t,r.node&&r.node.source){let n=r.node.rangeBy(r);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in r)this[n]=r[n]}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}},_y=Iu;Iu.default=Iu;var QM=_y,Pu=class{constructor(t,r,n){this.processor=t,this.messages=[],this.root=r,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new QM(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},lc=Pu;Pu.default=Pu;var Zl=39,ig=34,Lo=92,og=47,$o=10,Bn=32,Do=12,_o=9,Fo=13,eO=91,tO=93,rO=40,nO=41,iO=123,oO=125,sO=59,aO=42,lO=58,uO=64,jo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Vo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,cO=/.[\r\n"'(/\\]/,sg=/[\da-f]/i,dO=function(t,r={}){let n=t.css.valueOf(),i=r.ignoreErrors,o,s,a,l,u,c,d,p,h,f,m=n.length,g=0,S=[],w=[];function y(){return g}function x(M){throw t.error("Unclosed "+M,g)}function E(){return w.length===0&&g>=m}function N(M){if(w.length)return w.pop();if(g>=m)return;let C=M?M.ignoreUnclosed:!1;switch(o=n.charCodeAt(g),o){case $o:case Bn:case _o:case Fo:case Do:{s=g;do s+=1,o=n.charCodeAt(s);while(o===Bn||o===$o||o===_o||o===Fo||o===Do);f=["space",n.slice(g,s)],g=s-1;break}case eO:case tO:case iO:case oO:case lO:case sO:case nO:{let V=String.fromCharCode(o);f=[V,V,g];break}case rO:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==Zl&&h!==ig&&h!==Bn&&h!==$o&&h!==_o&&h!==Do&&h!==Fo){s=g;do{if(c=!1,s=n.indexOf(")",s+1),s===-1)if(i||C){s=g;break}else x("bracket");for(d=s;n.charCodeAt(d-1)===Lo;)d-=1,c=!c}while(c);f=["brackets",n.slice(g,s+1),g,s],g=s}else s=n.indexOf(")",g+1),l=n.slice(g,s+1),s===-1||cO.test(l)?f=["(","(",g]:(f=["brackets",l,g,s],g=s);break}case Zl:case ig:{a=o===Zl?"'":'"',s=g;do{if(c=!1,s=n.indexOf(a,s+1),s===-1)if(i||C){s=g+1;break}else x("string");for(d=s;n.charCodeAt(d-1)===Lo;)d-=1,c=!c}while(c);f=["string",n.slice(g,s+1),g,s],g=s;break}case uO:{jo.lastIndex=g+1,jo.test(n),jo.lastIndex===0?s=n.length-1:s=jo.lastIndex-2,f=["at-word",n.slice(g,s+1),g,s],g=s;break}case Lo:{for(s=g,u=!0;n.charCodeAt(s+1)===Lo;)s+=1,u=!u;if(o=n.charCodeAt(s+1),u&&o!==og&&o!==Bn&&o!==$o&&o!==_o&&o!==Fo&&o!==Do&&(s+=1,sg.test(n.charAt(s)))){for(;sg.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===Bn&&(s+=1)}f=["word",n.slice(g,s+1),g,s],g=s;break}default:{o===og&&n.charCodeAt(g+1)===aO?(s=n.indexOf("*/",g+2)+1,s===0&&(i||C?s=n.length:x("comment")),f=["comment",n.slice(g,s+1),g,s],g=s):(Vo.lastIndex=g+1,Vo.test(n),Vo.lastIndex===0?s=n.length-1:s=Vo.lastIndex-2,f=["word",n.slice(g,s+1),g,s],S.push(f),g=s);break}}return g++,f}function I(M){w.push(M)}return{back:I,endOfFile:E,nextToken:N,position:y}},Fy=br,ss=class extends Fy{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)}},uc=ss;ss.default=ss;Fy.registerAtRule(ss);var jy=br,Vy,By,Kr=class extends jy{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,r,n){let i=super.normalize(t);if(r){if(n==="prepend")this.nodes.length>1?r.raws.before=this.nodes[1].raws.before:delete r.raws.before;else if(this.first!==r)for(let o of i)o.raws.before=r.raws.before}return i}removeChild(t,r){let n=this.index(t);return!r&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(t)}toResult(t={}){return new Vy(new By,this,t).stringify()}};Kr.registerLazyResult=e=>{Vy=e};Kr.registerProcessor=e=>{By=e};var si=Kr;Kr.default=Kr;jy.registerRoot(Kr);var Qn={comma(e){return Qn.split(e,[","],!0)},space(e){let t=[" ",`
|
|
92
|
-
`," "];return Qn.split(e,t)},split(e,t,r){let n=[],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!==""&&n.push(i.trim()),i="",o=!1):i+=c;return(r||i!=="")&&n.push(i.trim()),n}},
|
|
90
|
+
`),this.css+=r+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),n=t.root||qo(t.file),i;this.mapOpts.sourcesContent===!1?(i=new Sy(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let r=this.root.nodes.length-1;r>=0;r--)t=this.root.nodes[r],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(r)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),qM&&HM&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,r=>{t+=r}),[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=Ho.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Ho({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 Ho({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,r=1,n="<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=r-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=n,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
|
|
91
|
+
`),r=a.length-s):r+=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=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=r-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(r=>r.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 r=this.memoizedPaths.get(t);if(r)return r;let n=this.opts.to?qo(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=qo(vy(n,this.mapOpts.annotation)));let i=wy(n,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 r=t.source.input.map;this.previousMaps.includes(r)||this.previousMaps.push(r)}});else{let t=new GM(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(r=>{if(r.source){let n=r.source.input.from;if(n&&!t[n]){t[n]=!0;let i=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(i,r.source.input.css)}}});else if(this.css){let r=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(r,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 r=this.memoizedFileURLs.get(t);if(r)return r;if(tg){let n=tg(t).toString();return this.memoizedFileURLs.set(t,n),n}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let r=this.memoizedURLs.get(t);if(r)return r;xy==="\\"&&(t=t.replace(/\\/g,"/"));let n=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,n),n}},Ry=KM,YM=Ss,Cu=class extends YM{constructor(t){super(t),this.type="comment"}},xs=Cu;Cu.default=Cu;var{isClean:ky,my:Ey}=oi,Cy=ws,Ay=xs,JM=Ss,Iy,ic,oc,Py;function Ty(e){return e.map(t=>(t.nodes&&(t.nodes=Ty(t.nodes)),delete t.source,t))}function My(e){if(e[ky]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)My(t)}var Mt=class Oy extends JM{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let i of n)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r=this.getIterator(),n,i;for(;this.indexes[r]<this.proxyOf.nodes.length&&(n=this.indexes[r],i=t(this.proxyOf.nodes[n],n),i!==!1);)this.indexes[r]+=1;return delete this.indexes[r],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,r){return r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):r==="every"||r==="some"?n=>t[r]((i,...o)=>n(i.toProxy(),...o)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r]},set(t,r,n){return t[r]===n||(t[r]=n,(r==="name"||r==="params"||r==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n=this.index(t),i=this.normalize(r,this.proxyOf.nodes[n]).reverse();n=this.index(t);for(let s of i)this.proxyOf.nodes.splice(n+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],n<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,r){let n=this.index(t),i=n===0?"prepend":!1,o=this.normalize(r,this.proxyOf.nodes[n],i).reverse();n=this.index(t);for(let a of o)this.proxyOf.nodes.splice(n,0,a);let s;for(let a in this.indexes)s=this.indexes[a],n<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=Ty(Iy(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 Cy(t)]}else if(t.selector)t=[new ic(t)];else if(t.name)t=[new oc(t)];else if(t.text)t=[new Ay(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Ey]||Oy.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[ky]&&My(i),typeof i.raws.before>"u"&&r&&typeof r.raws.before<"u"&&(i.raws.before=r.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let i of n)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+n.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 r;for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(i=>{r.props&&!r.props.includes(i.prop)||r.fast&&!i.value.includes(r.fast)||(i.value=i.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let i;try{i=t(r,n)}catch(o){throw r.addToError(o)}return i!==!1&&r.walk&&(i=r.walk(t)),i})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,i)}):this.walk((n,i)=>{if(n.type==="atrule"&&n.name===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="atrule")return r(n,i)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,i)}):this.walk((n,i)=>{if(n.type==="decl"&&n.prop===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="decl")return r(n,i)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,i)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,i)}):this.walk((n,i)=>{if(n.type==="rule"&&n.selector===t)return r(n,i)}):(r=t,this.walk((n,i)=>{if(n.type==="rule")return r(n,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]}};Mt.registerParse=e=>{Iy=e};Mt.registerRule=e=>{ic=e};Mt.registerAtRule=e=>{oc=e};Mt.registerRoot=e=>{Py=e};var br=Mt;Mt.default=Mt;Mt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,oc.prototype):e.type==="rule"?Object.setPrototypeOf(e,ic.prototype):e.type==="decl"?Object.setPrototypeOf(e,Cy.prototype):e.type==="comment"?Object.setPrototypeOf(e,Ay.prototype):e.type==="root"&&Object.setPrototypeOf(e,Py.prototype),e[Ey]=!0,e.nodes&&e.nodes.forEach(t=>{Mt.rebuild(t)})};var ZM=br,Ny,Ly,Xn=class extends ZM{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Ny(new Ly,this,t).stringify()}};Xn.registerLazyResult=e=>{Ny=e};Xn.registerProcessor=e=>{Ly=e};var sc=Xn;Xn.default=Xn;var rg={},$y=function(t){rg[t]||(rg[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Au=class{constructor(t,r={}){if(this.type="warning",this.text=t,r.node&&r.node.source){let n=r.node.rangeBy(r);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in r)this[n]=r[n]}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}},Dy=Au;Au.default=Au;var XM=Dy,Iu=class{constructor(t,r,n){this.processor=t,this.messages=[],this.root=r,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new XM(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},ac=Iu;Iu.default=Iu;var Jl=39,ng=34,Lo=92,ig=47,$o=10,Bn=32,Do=12,_o=9,Fo=13,QM=91,eO=93,tO=40,rO=41,nO=123,iO=125,oO=59,sO=42,aO=58,lO=64,jo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Vo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,uO=/.[\r\n"'(/\\]/,og=/[\da-f]/i,cO=function(t,r={}){let n=t.css.valueOf(),i=r.ignoreErrors,o,s,a,l,u,c,d,p,h,f,m=n.length,g=0,S=[],w=[];function y(){return g}function x(M){throw t.error("Unclosed "+M,g)}function E(){return w.length===0&&g>=m}function N(M){if(w.length)return w.pop();if(g>=m)return;let C=M?M.ignoreUnclosed:!1;switch(o=n.charCodeAt(g),o){case $o:case Bn:case _o:case Fo:case Do:{s=g;do s+=1,o=n.charCodeAt(s);while(o===Bn||o===$o||o===_o||o===Fo||o===Do);f=["space",n.slice(g,s)],g=s-1;break}case QM:case eO:case nO:case iO:case aO:case oO:case rO:{let V=String.fromCharCode(o);f=[V,V,g];break}case tO:{if(p=S.length?S.pop()[1]:"",h=n.charCodeAt(g+1),p==="url"&&h!==Jl&&h!==ng&&h!==Bn&&h!==$o&&h!==_o&&h!==Do&&h!==Fo){s=g;do{if(c=!1,s=n.indexOf(")",s+1),s===-1)if(i||C){s=g;break}else x("bracket");for(d=s;n.charCodeAt(d-1)===Lo;)d-=1,c=!c}while(c);f=["brackets",n.slice(g,s+1),g,s],g=s}else s=n.indexOf(")",g+1),l=n.slice(g,s+1),s===-1||uO.test(l)?f=["(","(",g]:(f=["brackets",l,g,s],g=s);break}case Jl:case ng:{a=o===Jl?"'":'"',s=g;do{if(c=!1,s=n.indexOf(a,s+1),s===-1)if(i||C){s=g+1;break}else x("string");for(d=s;n.charCodeAt(d-1)===Lo;)d-=1,c=!c}while(c);f=["string",n.slice(g,s+1),g,s],g=s;break}case lO:{jo.lastIndex=g+1,jo.test(n),jo.lastIndex===0?s=n.length-1:s=jo.lastIndex-2,f=["at-word",n.slice(g,s+1),g,s],g=s;break}case Lo:{for(s=g,u=!0;n.charCodeAt(s+1)===Lo;)s+=1,u=!u;if(o=n.charCodeAt(s+1),u&&o!==ig&&o!==Bn&&o!==$o&&o!==_o&&o!==Fo&&o!==Do&&(s+=1,og.test(n.charAt(s)))){for(;og.test(n.charAt(s+1));)s+=1;n.charCodeAt(s+1)===Bn&&(s+=1)}f=["word",n.slice(g,s+1),g,s],g=s;break}default:{o===ig&&n.charCodeAt(g+1)===sO?(s=n.indexOf("*/",g+2)+1,s===0&&(i||C?s=n.length:x("comment")),f=["comment",n.slice(g,s+1),g,s],g=s):(Vo.lastIndex=g+1,Vo.test(n),Vo.lastIndex===0?s=n.length-1:s=Vo.lastIndex-2,f=["word",n.slice(g,s+1),g,s],S.push(f),g=s);break}}return g++,f}function I(M){w.push(M)}return{back:I,endOfFile:E,nextToken:N,position:y}},_y=br,ss=class extends _y{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)}},lc=ss;ss.default=ss;_y.registerAtRule(ss);var Fy=br,jy,Vy,Kr=class extends Fy{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,r,n){let i=super.normalize(t);if(r){if(n==="prepend")this.nodes.length>1?r.raws.before=this.nodes[1].raws.before:delete r.raws.before;else if(this.first!==r)for(let o of i)o.raws.before=r.raws.before}return i}removeChild(t,r){let n=this.index(t);return!r&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(t)}toResult(t={}){return new jy(new Vy,this,t).stringify()}};Kr.registerLazyResult=e=>{jy=e};Kr.registerProcessor=e=>{Vy=e};var si=Kr;Kr.default=Kr;Fy.registerRoot(Kr);var Qn={comma(e){return Qn.split(e,[","],!0)},space(e){let t=[" ",`
|
|
92
|
+
`," "];return Qn.split(e,t)},split(e,t,r){let n=[],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!==""&&n.push(i.trim()),i="",o=!1):i+=c;return(r||i!=="")&&n.push(i.trim()),n}},By=Qn;Qn.default=Qn;var Uy=br,dO=By,as=class extends Uy{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return dO.comma(this.selector)}set selectors(t){let r=this.selector?this.selector.match(/,\s*/):null,n=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(n)}},uc=as;as.default=as;Uy.registerRule(as);var fO=ws,pO=cO,hO=xs,mO=lc,gO=si,sg=uc,ag={empty:!0,space:!0};function yO(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}var bO=class{constructor(t){this.input=t,this.root=new gO,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 r=new mO;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);let n,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),n=t[0],n==="("||n==="["?u.push(n==="("?")":"]"):n==="{"&&u.length>0?u.push("}"):n===u[u.length-1]&&u.pop(),u.length===0)if(n===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){a=!0;break}else if(n==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(r.source.end=this.getPosition(i[3]||i[2]),r.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(r.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(r,"params",l),s&&(t=l[l.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)}checkMissedSemicolon(t){let r=this.colon(t);if(r===!1)return;let n=0,i;for(let o=r-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(n+=1,n===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let r=0,n,i,o;for(let[s,a]of t.entries()){if(n=a,i=n[0],i==="("&&(r+=1),i===")"&&(r-=1),r===0&&i===":")if(!o)this.doubleColon(n);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=n}return!1}comment(t){let r=new hO;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;let n=t[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=i[2],r.raws.left=i[1],r.raws.right=i[3]}}createTokenizer(){this.tokenizer=pO(this.input)}decl(t,r){let n=new fO;this.init(n,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(i[3]||i[2]||yO(t)),n.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;n.prop+=t.shift()[1]}n.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){n.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1];(n.prop[0]==="_"||n.prop[0]==="*")&&(n.raws.before+=n.prop[0],n.prop=n.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"){n.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(n.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let p=u;p>0;p--){let h=c[p][0];if(d.trim().indexOf("!")===0&&h!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(n.important=!0,n.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(n.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(n,"value",s.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let r=new sg;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r}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 r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}}init(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let r=!1,n=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(n=u[0],l.push(u),n==="("||n==="[")o||(o=u),s.push(n==="("?")":"]");else if(a&&i&&n==="{")o||(o=u),s.push("}");else if(s.length===0)if(n===";")if(i){this.decl(l,a);return}else break;else if(n==="{"){this.rule(l);return}else if(n==="}"){this.tokenizer.back(l.pop()),r=!0;break}else n===":"&&(i=!0);else n===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),s.length>0&&this.unclosedBracket(o),r&&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,r,n,i){let o,s,a=n.length,l="",u=!0,c,d;for(let p=0;p<a;p+=1)o=n[p],s=o[0],s==="space"&&p===a-1&&!i?u=!1:s==="comment"?(d=n[p-1]?n[p-1][0]:"empty",c=n[p+1]?n[p+1][0]:"empty",!ag[d]&&!ag[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let p=n.reduce((h,f)=>h+f[1],"");t.raws[r]={raw:p,value:l}}t[r]=l}rule(t){t.pop();let r=new sg;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r}spacesAndCommentsFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)n=t.pop()[1]+n;return n}spacesAndCommentsFromStart(t){let r,n="";for(;t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)n+=t.shift()[1];return n}spacesFromEnd(t){let r,n="";for(;t.length&&(r=t[t.length-1][0],r==="space");)n=t.pop()[1]+n;return n}stringFrom(t,r){let n="";for(let i=r;i<t.length;i++)n+=t[i][1];return t.splice(r,t.length-r),n}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,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})}},SO=bO,wO=br,vO=SO,xO=vs;function ls(e,t){let r=new xO(e,t),n=new vO(r);try{n.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
|
|
93
93
|
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
|
|
94
94
|
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
|
|
95
|
-
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return n.root}var dc=ls;ls.default=ls;vO.registerParse(ls);var{isClean:bt,my:kO}=oi,EO=ky,CO=bs,AO=br,IO=ac,PO=Dy,ug=lc,TO=dc,MO=si,OO={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},NO={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},LO={Once:!0,postcssPlugin:!0,prepare:!0},Yr=0;function Un(e){return typeof e=="object"&&typeof e.then=="function"}function zy(e){let t=!1,r=OO[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Yr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Yr,r+"Exit"]:[r,r+"Exit"]}function cg(e){let t;return e.type==="document"?t=["Document",Yr,"DocumentExit"]:e.type==="root"?t=["Root",Yr,"RootExit"]:t=zy(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Tu(e){return e[bt]=!1,e.nodes&&e.nodes.forEach(t=>Tu(t)),e}var Mu={},Jr=class Gy{constructor(t,r,n){this.stringified=!1,this.processed=!1;let i;if(typeof r=="object"&&r!==null&&(r.type==="root"||r.type==="document"))i=Tu(r);else if(r instanceof Gy||r instanceof ug)i=Tu(r.root),r.map&&(typeof n.map>"u"&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let o=TO;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(r,n)}catch(s){this.processed=!0,this.error=s}i&&!i[kO]&&AO.rebuild(i)}this.result=new ug(t,i,n),this.helpers={...Mu,postcss:Mu,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,r){let n=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=n.postcssPlugin,t.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!=="production"){let i=n.postcssPlugin,o=n.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=(r,n,i)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,i])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!NO[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!LO[n])if(typeof r[n]=="object")for(let i in r[n])i==="*"?t(r,n,r[n][i]):t(r,n+"-"+i.toLowerCase(),r[n][i]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(Un(n))try{await n}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[bt];){t[bt]=!0;let r=[cg(t)];for(;r.length>0;){let n=this.visitTick(r);if(Un(n))try{await n}catch(i){let o=r[r.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let i=t.nodes.map(o=>n(o,this.helpers));await Promise.all(i)}else await n(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 r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return Un(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=CO;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new EO(r,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 r=this.runOnRoot(t);if(Un(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[bt];)t[bt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||PO("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,r)}toString(){return this.css}visitSync(t,r){for(let[n,i]of t){this.result.lastPlugin=n;let o;try{o=i(r,this.helpers)}catch(s){throw this.handleError(s,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(Un(o))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent){t.pop();return}if(i.length>0&&r.visitorIndex<i.length){let[s,a]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=s;try{return a(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let s=r.iterator,a;for(;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[bt]){a[bt]=!0,t.push(cg(a));return}r.iterator=0,delete n.indexes[s]}let o=r.events;for(;r.eventIndex<o.length;){let s=o[r.eventIndex];if(r.eventIndex+=1,s===Yr){n.nodes&&n.nodes.length&&(n[bt]=!0,r.iterator=n.getIterator());return}else if(this.listeners[s]){r.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[bt]=!0;let r=zy(t);for(let n of r)if(n===Yr)t.nodes&&t.each(i=>{i[bt]||this.walkSync(i)});else{let i=this.listeners[n];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"}};Jr.registerPostcss=e=>{Mu=e};var Hy=Jr;Jr.default=Jr;MO.registerLazyResult(Jr);IO.registerLazyResult(Jr);var $O=ky,DO=bs,_O=Dy,FO=dc,jO=lc,Ou=class{constructor(t,r,n){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=n,this._map=void 0;let i,o=DO;this.result=new jO(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new $O(o,i,this._opts,r);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,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||_O("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,r)}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,r=FO;try{t=r(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},VO=Ou;Ou.default=Ou;var BO=VO,UO=Hy,WO=ac,zO=si,ei=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let r=[];for(let n of t)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n=="object"&&Array.isArray(n.plugins))r=r.concat(n.plugins);else if(typeof n=="object"&&n.postcssPlugin)r.push(n);else if(typeof n=="function")r.push(n);else if(typeof n=="object"&&(n.parse||n.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(n+" is not a PostCSS plugin");return r}process(t,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new BO(this,t,r):new UO(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},GO=ei;ei.default=ei;zO.registerProcessor(ei);WO.registerProcessor(ei);var HO=ws,qO=Sy,KO=xs,YO=uc,JO=vs,ZO=si,XO=cc;function ti(e,t){if(Array.isArray(e))return e.map(i=>ti(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:JO.prototype};o.map&&(o.map={...o.map,__proto__:qO.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>ti(i,t))),n.source){let{inputId:i,...o}=n.source;n.source=o,i!=null&&(n.source.input=t[i])}if(n.type==="root")return new ZO(n);if(n.type==="decl")return new HO(n);if(n.type==="rule")return new XO(n);if(n.type==="comment")return new KO(n);if(n.type==="atrule")return new YO(n);throw new Error("Unknown node type: "+e.type)}var QO=ti;ti.default=ti;var e2=ic,qy=ws,t2=Hy,r2=br,fc=GO,n2=bs,i2=QO,Ky=ac,o2=_y,Yy=xs,Jy=uc,s2=lc,a2=vs,l2=dc,u2=Uy,Zy=cc,Xy=si,c2=Ss;function ne(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new fc(e)}ne.plugin=function(t,r){let n=!1;function i(...s){console&&console.warn&&!n&&(n=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
95
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return n.root}var cc=ls;ls.default=ls;wO.registerParse(ls);var{isClean:bt,my:RO}=oi,kO=Ry,EO=bs,CO=br,AO=sc,IO=$y,lg=ac,PO=cc,TO=si,MO={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},OO={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},NO={Once:!0,postcssPlugin:!0,prepare:!0},Yr=0;function Un(e){return typeof e=="object"&&typeof e.then=="function"}function Wy(e){let t=!1,r=MO[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,Yr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,Yr,r+"Exit"]:[r,r+"Exit"]}function ug(e){let t;return e.type==="document"?t=["Document",Yr,"DocumentExit"]:e.type==="root"?t=["Root",Yr,"RootExit"]:t=Wy(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Pu(e){return e[bt]=!1,e.nodes&&e.nodes.forEach(t=>Pu(t)),e}var Tu={},Jr=class zy{constructor(t,r,n){this.stringified=!1,this.processed=!1;let i;if(typeof r=="object"&&r!==null&&(r.type==="root"||r.type==="document"))i=Pu(r);else if(r instanceof zy||r instanceof lg)i=Pu(r.root),r.map&&(typeof n.map>"u"&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let o=PO;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(r,n)}catch(s){this.processed=!0,this.error=s}i&&!i[RO]&&CO.rebuild(i)}this.result=new lg(t,i,n),this.helpers={...Tu,postcss:Tu,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,r){let n=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=n.postcssPlugin,t.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!=="production"){let i=n.postcssPlugin,o=n.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=(r,n,i)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,i])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!OO[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!NO[n])if(typeof r[n]=="object")for(let i in r[n])i==="*"?t(r,n,r[n][i]):t(r,n+"-"+i.toLowerCase(),r[n][i]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(Un(n))try{await n}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[bt];){t[bt]=!0;let r=[ug(t)];for(;r.length>0;){let n=this.visitTick(r);if(Un(n))try{await n}catch(i){let o=r[r.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let i=t.nodes.map(o=>n(o,this.helpers));await Promise.all(i)}else await n(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 r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return Un(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=EO;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let i=new kO(r,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 r=this.runOnRoot(t);if(Un(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[bt];)t[bt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||IO("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,r)}toString(){return this.css}visitSync(t,r){for(let[n,i]of t){this.result.lastPlugin=n;let o;try{o=i(r,this.helpers)}catch(s){throw this.handleError(s,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(Un(o))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent){t.pop();return}if(i.length>0&&r.visitorIndex<i.length){let[s,a]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=s;try{return a(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let s=r.iterator,a;for(;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[bt]){a[bt]=!0,t.push(ug(a));return}r.iterator=0,delete n.indexes[s]}let o=r.events;for(;r.eventIndex<o.length;){let s=o[r.eventIndex];if(r.eventIndex+=1,s===Yr){n.nodes&&n.nodes.length&&(n[bt]=!0,r.iterator=n.getIterator());return}else if(this.listeners[s]){r.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[bt]=!0;let r=Wy(t);for(let n of r)if(n===Yr)t.nodes&&t.each(i=>{i[bt]||this.walkSync(i)});else{let i=this.listeners[n];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"}};Jr.registerPostcss=e=>{Tu=e};var Gy=Jr;Jr.default=Jr;TO.registerLazyResult(Jr);AO.registerLazyResult(Jr);var LO=Ry,$O=bs,DO=$y,_O=cc,FO=ac,Mu=class{constructor(t,r,n){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=n,this._map=void 0;let i,o=$O;this.result=new FO(this._processor,i,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new LO(o,i,this._opts,r);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,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||DO("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,r)}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,r=_O;try{t=r(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},jO=Mu;Mu.default=Mu;var VO=jO,BO=Gy,UO=sc,WO=si,ei=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let r=[];for(let n of t)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n=="object"&&Array.isArray(n.plugins))r=r.concat(n.plugins);else if(typeof n=="object"&&n.postcssPlugin)r.push(n);else if(typeof n=="function")r.push(n);else if(typeof n=="object"&&(n.parse||n.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(n+" is not a PostCSS plugin");return r}process(t,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new VO(this,t,r):new BO(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},zO=ei;ei.default=ei;WO.registerProcessor(ei);UO.registerProcessor(ei);var GO=ws,HO=by,qO=xs,KO=lc,YO=vs,JO=si,ZO=uc;function ti(e,t){if(Array.isArray(e))return e.map(i=>ti(i));let{inputs:r,...n}=e;if(r){t=[];for(let i of r){let o={...i,__proto__:YO.prototype};o.map&&(o.map={...o.map,__proto__:HO.prototype}),t.push(o)}}if(n.nodes&&(n.nodes=e.nodes.map(i=>ti(i,t))),n.source){let{inputId:i,...o}=n.source;n.source=o,i!=null&&(n.source.input=t[i])}if(n.type==="root")return new JO(n);if(n.type==="decl")return new GO(n);if(n.type==="rule")return new ZO(n);if(n.type==="comment")return new qO(n);if(n.type==="atrule")return new KO(n);throw new Error("Unknown node type: "+e.type)}var XO=ti;ti.default=ti;var QO=nc,Hy=ws,e2=Gy,t2=br,dc=zO,r2=bs,n2=XO,qy=sc,i2=Dy,Ky=xs,Yy=lc,o2=ac,s2=vs,a2=cc,l2=By,Jy=uc,Zy=si,u2=Ss;function ne(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new dc(e)}ne.plugin=function(t,r){let n=!1;function i(...s){console&&console.warn&&!n&&(n=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
96
96
|
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:
|
|
97
|
-
https://www.w3ctech.com/topic/2226`));let a=r(...s);return a.postcssPlugin=t,a.postcssVersion=new
|
|
97
|
+
https://www.w3ctech.com/topic/2226`));let a=r(...s);return a.postcssPlugin=t,a.postcssVersion=new dc().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return ne([i(l)]).process(s,a)},i};ne.stringify=r2;ne.parse=a2;ne.fromJSON=n2;ne.list=l2;ne.comment=e=>new Ky(e);ne.atRule=e=>new Yy(e);ne.decl=e=>new Hy(e);ne.rule=e=>new Jy(e);ne.root=e=>new Zy(e);ne.document=e=>new qy(e);ne.CssSyntaxError=QO;ne.Declaration=Hy;ne.Container=t2;ne.Processor=dc;ne.Document=qy;ne.Comment=Ky;ne.Warning=i2;ne.AtRule=Yy;ne.Result=o2;ne.Input=s2;ne.Rule=Jy;ne.Root=Zy;ne.Node=u2;e2.registerPostcss(ne);var c2=ne;ne.default=ne;var me=wM(c2);me.stringify;me.fromJSON;me.plugin;me.parse;me.list;me.document;me.comment;me.atRule;me.rule;me.decl;me.root;me.CssSyntaxError;me.Declaration;me.Container;me.Processor;me.Document;me.Comment;me.Warning;me.AtRule;me.Result;me.Input;me.Rule;me.Root;me.Node;var Ou=class e{constructor(...t){Xe(this,"parentElement",null),Xe(this,"parentNode",null),Xe(this,"ownerDocument"),Xe(this,"firstChild",null),Xe(this,"lastChild",null),Xe(this,"previousSibling",null),Xe(this,"nextSibling",null),Xe(this,"ELEMENT_NODE",1),Xe(this,"TEXT_NODE",3),Xe(this,"nodeType"),Xe(this,"nodeName"),Xe(this,"RRNodeType")}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.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,r){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 cg={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},dg={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Bo={},d2=()=>!!globalThis.Zone;function fc(e){if(Bo[e])return Bo[e];let t=globalThis[e],r=t.prototype,n=e in cg?cg[e]:void 0,i=!!(n&&n.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in dg?dg[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!d2())return Bo[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?Bo[e]=u:r}catch{return r}}var Zl={};function Nt(e,t,r){var n;let i=`${e}.${String(r)}`;if(Zl[i])return Zl[i].call(t);let o=fc(e),s=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return s?(Zl[i]=s,s.call(t)):t[r]}var Xl={};function Xy(e,t,r){let n=`${e}.${String(r)}`;if(Xl[n])return Xl[n].bind(t);let o=fc(e)[r];return typeof o!="function"?t[r]:(Xl[n]=o,o.bind(t))}function f2(e){return Nt("Node",e,"ownerDocument")}function p2(e){return Nt("Node",e,"childNodes")}function h2(e){return Nt("Node",e,"parentNode")}function m2(e){return Nt("Node",e,"parentElement")}function g2(e){return Nt("Node",e,"textContent")}function y2(e,t){return Xy("Node",e,"contains")(t)}function b2(e){return Xy("Node",e,"getRootNode")()}function S2(e){return!e||!("host"in e)?null:Nt("ShadowRoot",e,"host")}function w2(e){return e.styleSheets}function v2(e){return!e||!("shadowRoot"in e)?null:Nt("Element",e,"shadowRoot")}function x2(e,t){return Nt("Element",e,"querySelector")(t)}function R2(e,t){return Nt("Element",e,"querySelectorAll")(t)}function Qy(){return fc("MutationObserver").constructor}function Sr(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}var U={ownerDocument:f2,childNodes:p2,parentNode:h2,parentElement:m2,textContent:g2,contains:y2,getRootNode:b2,host:S2,styleSheets:w2,shadowRoot:v2,querySelector:x2,querySelectorAll:R2,mutationObserver:Qy,patch:Sr};function Fe(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var Vr=`Please stop import mirror directly. Instead of that,\r
|
|
98
98
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
99
|
-
or you can use record.mirror to access the mirror instance during recording.`,pg={map:{},getId(){return console.error(Vr),-1},getNode(){return console.error(Vr),null},removeNodeFromMap(){console.error(Vr)},has(){return console.error(Vr),!1},reset(){console.error(Vr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(pg=new Proxy(pg,{get(e,t,r){return t==="map"&&console.error(Vr),Reflect.get(e,t,r)}}));function ri(e,t,r={}){let n=null,i=0;return function(...o){let s=Date.now();!i&&r.leading===!1&&(i=s);let a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(l,o)},a))}}function Rs(e,t,r,n,i=window){let o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>Rs(e,t,o||{},!0)}var us=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(us=()=>new Date().getTime());function tb(e){var t,r,n,i;let o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||o?.body&&((t=U.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o?.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:o?.documentElement.scrollTop||o?.body&&((n=U.parentElement(o.body))==null?void 0:n.scrollTop)||((i=o?.body)==null?void 0:i.scrollTop)||0}}function rb(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function nb(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ib(e){return e?e.nodeType===e.ELEMENT_NODE?e:U.parentElement(e):null}function je(e,t,r,n){if(!e)return!1;let i=ib(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(es(i,t,n))return!0}catch{}return!!(r&&(i.matches(r)||n&&i.closest(r)!==null))}function E2(e,t){return t.getId(e)!==-1}function eu(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===qn}function ob(e,t){if(zn(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let n=U.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?ob(n,t):!0}function Lu(e){return!!e.changedTouches}function C2(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 sb(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function ab(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function $u(e){return e?e instanceof Nu&&"shadowRoot"in e?!!e.shadowRoot:!!U.shadowRoot(e):!1}var Du=class{constructor(){k(this,"id",1),k(this,"styleIDMap",new WeakMap),k(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}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 lb(e){var t;let r=null;return"getRootNode"in e&&((t=U.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&U.host(U.getRootNode(e))&&(r=U.host(U.getRootNode(e))),r}function A2(e){let t=e,r;for(;r=lb(t);)t=r;return t}function I2(e){let t=U.ownerDocument(e);if(!t)return!1;let r=A2(e);return U.contains(t,r)}function ub(e){let t=U.ownerDocument(e);return t?U.contains(t,e)||I2(e):!1}var H=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(H||{}),z=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(z||{}),We=(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))(We||{}),Pt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Pt||{}),Zr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Zr||{}),Br=(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))(Br||{});var cb=(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))(cb||{});function hg(e){return"__ln"in e}var _u=class{constructor(){k(this,"length",0),k(this,"head",null),k(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){let r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&hg(t.previousSibling)){let n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&hg(t.nextSibling)&&t.nextSibling.__ln.previous){let n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){let r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},mg=(e,t)=>`${e}@${t}`,Fu=class{constructor(){k(this,"frozen",!1),k(this,"locked",!1),k(this,"texts",[]),k(this,"attributes",[]),k(this,"attributeMap",new WeakMap),k(this,"removes",[]),k(this,"mapRemoves",[]),k(this,"movedMap",{}),k(this,"addedSet",new Set),k(this,"movedSet",new Set),k(this,"droppedSet",new Set),k(this,"removesSubTreeCache",new Set),k(this,"mutationCb"),k(this,"blockClass"),k(this,"blockSelector"),k(this,"maskTextClass"),k(this,"maskTextSelector"),k(this,"inlineStylesheet"),k(this,"maskInputOptions"),k(this,"maskTextFn"),k(this,"maskInputFn"),k(this,"keepIframeSrcFn"),k(this,"recordCanvas"),k(this,"inlineImages"),k(this,"slimDOMOptions"),k(this,"dataURLOptions"),k(this,"doc"),k(this,"mirror"),k(this,"iframeManager"),k(this,"stylesheetManager"),k(this,"shadowDomManager"),k(this,"canvasManager"),k(this,"processedNodeManager"),k(this,"unattachedDoc"),k(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),k(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set,n=new _u,i=l=>{let u=l,c=qn;for(;c===qn;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{let u=U.parentNode(l);if(!u||!ub(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=zn(u)?this.mirror.getId(lb(l)):this.mirror.getId(u),p=i(l);if(d===-1||p===-1)return n.addNode(l);let h=Wr(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=>{sb(f,this.mirror)&&this.iframeManager.addIframe(f),ab(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),$u(l)&&this.shadowDomManager.addShadowRoot(U.shadowRoot(l),this.doc)},onIframeLoad:(f,m)=>{this.iframeManager.attachIframe(f,m),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,m)=>{this.stylesheetManager.attachLinkElement(f,m)},cssCaptured:c});h&&(t.push({parentId:d,nextId:p,node:h}),r.add(h.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)gg(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(U.parentNode(l))||o(l);for(let l of this.addedSet)!yg(this.droppedSet,l)&&!gg(this.removesSubTreeCache,l,this.mirror)||yg(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;n.length;){let l=null;if(s){let u=this.mirror.getId(U.parentNode(s.value)),c=i(s.value);u!==-1&&c!==-1&&(l=s)}if(!l){let u=n.tail;for(;u;){let c=u;if(u=u.previous,c){let d=this.mirror.getId(U.parentNode(c.value));if(i(c.value)===-1)continue;if(d!==-1){l=c;break}else{let h=c.value,f=U.parentNode(h);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=U.host(f);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}s=l.previous,n.removeNode(l.value),o(l.value)}let a={texts:this.texts.map(l=>{let u=l.node,c=U.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!r.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=>!r.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))}),k(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(U.childNodes(t),i=>U.textContent(i)||"").join("");r.attributes.value=Zo({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Xo(t),value:n,maskInputFn:this.maskInputFn})}),k(this,"processMutation",t=>{if(!eu(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let r=U.textContent(t.target);!je(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Mg(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,ib(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=t.attributeName,i=t.target.getAttribute(n);if(n==="value"){let s=Xo(r);i=Zo({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:i,maskInputFn:this.maskInputFn})}if(je(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)n="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Tg(r.tagName,n))if(o.attributes[n]=Pg(this.doc,gr(r.tagName),gr(n),i),n==="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(r.style)){let l=r.style.getPropertyValue(a),u=r.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))r.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else n==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(je(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),i=zn(t.target)?this.mirror.getId(U.host(t.target)):this.mirror.getId(t.target);je(t.target,this.blockClass,this.blockSelector,!1)||eu(r,this.mirror,this.slimDOMOptions)||!E2(r,this.mirror)||(this.addedSet.has(r)?(ju(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||ob(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[mg(n,i)]?ju(this.movedSet,r):(this.removes.push({parentId:i,id:n,isShadow:zn(t.target)&&Gn(t.target)?!0:void 0}),P2(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),k(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(eu(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[mg(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);je(t,this.blockClass,this.blockSelector,!1)||(U.childNodes(t).forEach(n=>this.genAdds(n)),$u(t)&&U.childNodes(U.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,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(r=>{this[r]=t[r]})}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 ju(e,t){e.delete(t),U.childNodes(t).forEach(r=>ju(e,r))}function P2(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),U.childNodes(n).forEach(i=>r.push(i)))}}function gg(e,t,r){return e.size===0?!1:T2(e,t)}function T2(e,t,r){let n=U.parentNode(t);return n?e.has(n):!1}function yg(e,t){return e.size===0?!1:db(e,t)}function db(e,t){let r=U.parentNode(t);return r?e.has(r)?!0:db(e,r):!1}var Hn;function M2(e){Hn=e}function O2(){Hn=void 0}var Y=e=>Hn?(...r)=>{try{return e(...r)}catch(n){if(Hn&&Hn(n)===!0)return;throw n}}:e,mr=[];function ai(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 fb(e,t){let r=new Fu;mr.push(r),r.init(e);let n=new(eb())(Y(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function N2({mousemoveCb:e,sampling:t,doc:r,mirror:n}){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=ri(Y(d=>{let p=Date.now()-a;e(s.map(h=>(h.timeOffset-=p,h)),d),s=[],a=null}),o),u=Y(ri(Y(d=>{let p=ai(d),{clientX:h,clientY:f}=Lu(d)?d.changedTouches[0]:d;a||(a=us()),s.push({x:h,y:f,id:n.getId(p),timeOffset:us()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?z.Drag:d instanceof MouseEvent?z.MouseMove:z.TouchMove)}),i,{trailing:!1})),c=[Fe("mousemove",u,r),Fe("touchmove",u,r),Fe("drag",u,r)];return Y(()=>{c.forEach(d=>d())})}function L2({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,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=ai(d);if(je(p,n,i,!0))return;let h=null,f=c;if("pointerType"in d){switch(d.pointerType){case"mouse":h=Pt.Mouse;break;case"touch":h=Pt.Touch;break;case"pen":h=Pt.Pen;break}h===Pt.Touch?We[c]===We.MouseDown?f="TouchStart":We[c]===We.MouseUp&&(f="TouchEnd"):Pt.Pen}else Lu(d)&&(h=Pt.Touch);h!==null?(l=h,(f.startsWith("Touch")&&h===Pt.Touch||f.startsWith("Mouse")&&h===Pt.Mouse)&&(h=null)):We[c]===We.Click&&(h=l,l=null);let m=Lu(d)?d.changedTouches[0]:d;if(!m)return;let g=r.getId(p),{clientX:S,clientY:w}=m;Y(e)({type:We[f],id:g,x:S,y:w,...h!==null&&{pointerType:h}})};return Object.keys(We).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let d=gr(c),p=u(c);if(window.PointerEvent)switch(We[c]){case We.MouseDown:case We.MouseUp:d=d.replace("mouse","pointer");break;case We.TouchStart:case We.TouchEnd:return}a.push(Fe(d,p,t))}),Y(()=>{a.forEach(c=>c())})}function pb({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){let s=Y(ri(Y(a=>{let l=ai(a);if(!l||je(l,n,i,!0))return;let u=r.getId(l);if(l===t&&t.defaultView){let c=tb(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 Fe("scroll",s,t)}function $2({viewportResizeCb:e},{win:t}){let r=-1,n=-1,i=Y(ri(Y(()=>{let o=rb(),s=nb();(r!==o||n!==s)&&(e({width:Number(s),height:Number(o)}),r=o,n=s)}),200));return Fe("resize",i,t)}var D2=["INPUT","TEXTAREA","SELECT"],bg=new WeakMap;function _2({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(w){let y=ai(w),x=w.isTrusted,E=y&&y.tagName;if(y&&E==="OPTION"&&(y=U.parentElement(y)),!y||!E||D2.indexOf(E)<0||je(y,n,i,!0)||y.classList.contains(o)||s&&y.matches(s))return;let N=y.value,I=!1,M=Xo(y)||"";M==="radio"||M==="checkbox"?I=y.checked:(a[E.toLowerCase()]||a[M])&&(N=Zo({element:y,maskInputOptions:a,tagName:E,type:M,value:N,maskInputFn:l})),p(y,c?{text:N,isChecked:I,userTriggered:x}:{text:N,isChecked:I});let C=y.name;M==="radio"&&C&&I&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(V=>{if(V!==y){let Z=V.value;p(V,c?{text:Z,isChecked:!I,userTriggered:!1}:{text:Z,isChecked:!I})}})}function p(w,y){let x=bg.get(w);if(!x||x.text!==y.text||x.isChecked!==y.isChecked){bg.set(w,y);let E=r.getId(w);Y(e)({...y,id:E})}}let f=(u.input==="last"?["change"]:["input","change"]).map(w=>Fe(w,Y(d),t)),m=t.defaultView;if(!m)return()=>{f.forEach(w=>w())};let g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),S=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&f.push(...S.map(w=>Rs(w[0],w[1],{set(){Y(d)({target:this,isTrusted:!1})}},!1,m))),Y(()=>{f.forEach(w=>w())})}function cs(e){let t=[];function r(n,i){if(Uo("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Uo("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Uo("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Uo("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let s=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(s)}else if(n.parentStyleSheet){let s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(s)}return i}return r(e,t)}function Zt(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function F2({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Y((c,d,p)=>{let[h,f]=p,{id:m,styleId:g}=Zt(d,t,r.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,adds:[{rule:h,index:f}]}),c.apply(d,p)})}),n.CSSStyleSheet.prototype.addRule=function(c,d,p=this.cssRules.length){let h=`${c} { ${d} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[h,p])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Zt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,removes:[{index:h}]}),c.apply(d,p)})}),n.CSSStyleSheet.prototype.removeRule=function(c){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Zt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,replace:h}),c.apply(d,p)})}));let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Zt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,replaceSync:h}),c.apply(d,p)})}));let l={};Wo("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Wo("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Wo("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Wo("CSSSupportsRule")&&(l.CSSSupportsRule=n.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:Y((p,h,f)=>{let[m,g]=f,{id:S,styleId:w}=Zt(h.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||w&&w!==-1)&&e({id:S,styleId:w,adds:[{rule:m,index:[...cs(h),g||0]}]}),p.apply(h,f)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:Y((p,h,f)=>{let[m]=f,{id:g,styleId:S}=Zt(h.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,removes:[{index:[...cs(h),m]}]}),p.apply(h,f)})})}),Y(()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,d])=>{d.prototype.insertRule=u[c].insertRule,d.prototype.deleteRule=u[c].deleteRule})})}function hb({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(U.host(r));let a=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(o=(i=r.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(r,"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}}),Y(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function j2({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Y((a,l,u)=>{var c;let[d,p,h]=u;if(r.has(d))return o.apply(l,[d,p,h]);let{id:f,styleId:m}=Zt((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,set:{property:d,value:p,priority:h},index:cs(l.parentRule)}),a.apply(l,u)})});let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Y((a,l,u)=>{var c;let[d]=u;if(r.has(d))return s.apply(l,[d]);let{id:p,styleId:h}=Zt((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,remove:{property:d},index:cs(l.parentRule)}),a.apply(l,u)})}),Y(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}function V2({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){let s=Y(l=>ri(Y(u=>{let c=ai(u);if(!c||je(c,t,r,!0))return;let{currentTime:d,volume:p,muted:h,playbackRate:f,loop:m}=c;e({type:l,id:n.getId(c),currentTime:d,volume:p,muted:h,playbackRate:f,loop:m})}),i.media||500)),a=[Fe("play",s(Br.Play),o),Fe("pause",s(Br.Pause),o),Fe("seeked",s(Br.Seeked),o),Fe("volumechange",s(Br.VolumeChange),o),Fe("ratechange",s(Br.RateChange),o)];return Y(()=>{a.forEach(l=>l())})}function B2({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],i=new WeakMap,o=r.FontFace;r.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=Sr(t.fonts,"add",function(a){return function(l){return setTimeout(Y(()=>{let u=i.get(l);u&&(e(u),i.delete(l))}),0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=o}),n.push(s),Y(()=>{n.forEach(a=>a())})}function U2(e){let{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,s=!0,a=Y(()=>{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:h,startOffset:f,endContainer:m,endOffset:g}=p;je(h,n,i,!0)||je(m,n,i,!0)||u.push({start:r.getId(h),startOffset:f,end:r.getId(m),endOffset:g})}o({ranges:u})});return a(),Fe("selectionchange",a)}function W2({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:Sr(r.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 z2(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),i(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),o(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),s(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),a(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),l(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),u(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),c(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),p(...m)},e.selectionCb=(...m)=>{t.selection&&t.selection(...m),h(...m)},e.customElementCb=(...m)=>{t.customElement&&t.customElement(...m),f(...m)}}function G2(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};z2(e,t);let n;e.recordDOM&&(n=fb(e,e.doc));let i=N2(e),o=L2(e),s=pb(e),a=$2(e,{win:r}),l=_2(e),u=V2(e),c=()=>{},d=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(c=F2(e,{win:r}),d=hb(e,e.doc),p=j2(e,{win:r}),e.collectFonts&&(h=B2(e)));let f=U2(e),m=W2(e),g=[];for(let S of e.plugins)g.push(S.observer(S.callback,r,S.options));return Y(()=>{mr.forEach(S=>S.reset()),n?.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),p(),h(),f(),m(),g.forEach(S=>S())})}function Uo(e){return typeof window[e]<"u"}function Wo(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ds=class{constructor(t){k(this,"iframeIdToRemoteIdMap",new WeakMap),k(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,i){let o=n||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=o.get(r);return a||(a=this.generateIdFn(),o.set(r,a),s.set(a,r)),a}getIds(t,r){let n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,i))}getRemoteId(t,r,n){let i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=i.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},Vu=class{constructor(t){k(this,"iframes",new WeakMap),k(this,"crossOriginIframeMap",new WeakMap),k(this,"crossOriginIframeMirror",new ds(Ig)),k(this,"crossOriginIframeStyleMirror"),k(this,"crossOriginIframeRootIdMap",new WeakMap),k(this,"mirror"),k(this,"mutationCb"),k(this,"wrappedEmit"),k(this,"loadListener"),k(this,"stylesheetManager"),k(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ds(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,r){var n,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.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 r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let i=this.crossOriginIframeMap.get(t.source);if(!i)return;let o=this.transformCrossOriginEvent(i,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case H.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),{timestamp:r.timestamp,type:H.IncrementalSnapshot,data:{source:z.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case H.Meta:case H.Load:case H.DomContentLoaded:return!1;case H.Plugin:return r;case H.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case H.IncrementalSnapshot:switch(r.data.source){case z.Mutation:return r.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)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case z.Drag:case z.TouchMove:case z.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case z.ViewportResize:return!1;case z.MediaInteraction:case z.MouseInteraction:case z.Scroll:case z.CanvasMutation:case z.Input:return this.replaceIds(r.data,t,["id"]),r;case z.StyleSheetRule:case z.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case z.Font:return r;case z.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case z.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}return!1}replace(t,r,n,i){for(let o of i)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==cb.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}},Bu=class{constructor(t){k(this,"shadowDoms",new WeakSet),k(this,"mutationCb"),k(this,"scrollCb"),k(this,"bypassOptions"),k(this,"mirror"),k(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,r){if(!Gn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let n=fb({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(pb({...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(U.host(t))),this.restoreHandlers.push(hb({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(Sr(t.prototype,"attachShadow",function(i){return function(o){let s=i.call(this,o),a=U.shadowRoot(this);return a&&ub(this)&&n.addShadowRoot(a,r),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},zr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",H2=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Wn=0;Wn<zr.length;Wn++)H2[zr.charCodeAt(Wn)]=Wn;var Wn,q2=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=zr[t[r]>>2],i+=zr[(t[r]&3)<<4|t[r+1]>>4],i+=zr[(t[r+1]&15)<<2|t[r+2]>>6],i+=zr[t[r+2]&63];return n%3===2?i=i.substring(0,i.length-1)+"=":n%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var Sg=new Map;function K2(e,t){let r=Sg.get(e);return r||(r=new Map,Sg.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var mb=(e,t,r)=>{if(!e||!(yb(e,t)||typeof e=="object"))return;let n=e.constructor.name,i=K2(r,n),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Ko(e,t,r){if(e instanceof Array)return e.map(n=>Ko(n,t,r));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 n=e.constructor.name,i=q2(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ko(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",i=e.toDataURL();return{rr_type:n,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Ko(e.data,t,r),e.width,e.height]};if(yb(e,t)||typeof e=="object"){let n=e.constructor.name,i=mb(e,t,r);return{rr_type:n,index:i}}}}return e}var gb=(e,t,r)=>e.map(n=>Ko(n,t,r)),yb=(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 Y2(e,t,r,n){let i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=Sr(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...u){return je(this.canvas,r,n,!0)||setTimeout(()=>{let c=gb(u,t,this);e(this.canvas,{type:Zr["2D"],property:s,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=Rs(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:Zr["2D"],property:s,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(s=>s())}}function J2(e){return e==="experimental-webgl"?"webgl":e}function wg(e,t,r,n){let i=[];try{let o=Sr(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!je(this,t,r,!0)){let u=J2(a);if("__context"in this||(this.__context=u),n&&["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 vg(e,t,r,n,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=Sr(e,l,function(c){return function(...d){let p=c.apply(this,d);if(mb(p,o,this),"tagName"in this.canvas&&!je(this.canvas,n,i,!0)){let h=gb(d,o,this),f={type:t,property:l,args:h};r(this.canvas,f)}return p}});s.push(u)}catch{let u=Rs(e,l,{set(c){r(this.canvas,{type:t,property:l,args:[c],setter:!0})}});s.push(u)}return s}function Z2(e,t,r,n){let i=[];return i.push(...vg(t.WebGLRenderingContext.prototype,Zr.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...vg(t.WebGL2RenderingContext.prototype,Zr.WebGL2,e,r,n,t)),()=>{i.forEach(o=>o())}}var bb="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",X2=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),xg=typeof window<"u"&&window.Blob&&new Blob([X2(bb)],{type:"text/javascript;charset=utf-8"});function Q2(e){let t;try{if(t=xg&&(window.URL||window.webkitURL).createObjectURL(xg),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;base64,"+bb,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var Uu=class{constructor(t){k(this,"pendingCanvasMutations",new Map),k(this,"rafStamps",{latestId:0,invokeId:null}),k(this,"mirror"),k(this,"mutationCb"),k(this,"resetObservers"),k(this,"frozen",!1),k(this,"locked",!1),k(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:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,i,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,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,r,n,i,o){let s=wg(r,n,i,!0),a=new Map,l=new Q2;l.onmessage=f=>{let{id:m}=f.data;if(a.set(m,!1),!("base64"in f.data))return;let{base64:g,type:S,width:w,height:y}=f.data;this.mutationCb({id:m,type:Zr["2D"],commands:[{property:"clearRect",args:[0,0,w,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:S}]},0,0]}]})};let u=1e3/t,c=0,d,p=()=>{let f=[];return r.document.querySelectorAll("canvas").forEach(m=>{je(m,n,i,!0)||f.push(m)}),f},h=f=>{if(c&&f-c<u){d=requestAnimationFrame(h);return}c=f,p().forEach(async m=>{var g;let S=this.mirror.getId(m);if(a.get(S)||m.width===0||m.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(m.__context)){let y=m.getContext(m.__context);((g=y?.getContextAttributes())==null?void 0:g.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let w=await createImageBitmap(m);l.postMessage({id:S,bitmap:w,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[w])}),d=requestAnimationFrame(h)};d=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=wg(t,r,n,!1),o=Y2(this.processMutation.bind(this),t,r,n),s=Z2(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let i=n.map(s=>{let{type:a,...l}=s;return l}),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}},Wu=class{constructor(t){k(this,"trackedLinkElements",new WeakSet),k(this,"mutationCb"),k(this,"adoptedStyleSheetCb"),k(this,"styleMirror",new Du),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,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:Cg(a,o.href),index:l}))})),n.styleIds.push(s)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},zu=class{constructor(){k(this,"nodeMap",new WeakMap),k(this,"active",!1)}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},we,Yo,tu,fs=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((km=e.contentWindow)==null?void 0:km.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var st=rP();function wr(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,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:h,maskInputFn:f,maskTextFn:m,hooks:g,packFn:S,sampling:w={},dataURLOptions:y={},mousemoveWait:x,recordDOM:E=!0,recordCanvas:N=!1,recordCrossOriginIframes:I=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:C=!1,collectFonts:V=!1,inlineImages:Z=!1,plugins:X,keepIframeSrcFn:F=()=>!1,ignoreCSSAttributes:$e=new Set([]),errorHandler:ft}=e;M2(ft);let Ie=I?window.parent===window:!0,Je=!1;if(!Ie)try{window.parent.document&&(Je=!1)}catch{Je=!0}if(Ie&&!t)throw new Error("emit function is required");if(!Ie&&!Je)return()=>{};x!==void 0&&w.mousemove===void 0&&(w.mousemove=x),st.reset();let or=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},pt=Og(h);C2();let wf,na=0,vf=Q=>{for(let et of X||[])et.eventProcessor&&(Q=et.eventProcessor(Q));return S&&!Je&&(Q=S(Q)),Q};we=(Q,et)=>{var ye;let be=Q;if(be.timestamp=us(),(ye=mr[0])!=null&&ye.isFrozen()&&be.type!==H.FullSnapshot&&!(be.type===H.IncrementalSnapshot&&be.data.source===z.Mutation)&&mr.forEach(Ge=>Ge.unfreeze()),Ie)t?.(vf(be),et);else if(Je){let Ge={type:"rrweb",event:vf(be),origin:window.location.origin,isCheckout:et};window.parent.postMessage(Ge,"*")}if(be.type===H.FullSnapshot)wf=be,na=0;else if(be.type===H.IncrementalSnapshot){if(be.data.source===z.Mutation&&be.data.isAttachIframe)return;na++;let Ge=n&&na>=n,oe=r&&be.timestamp-wf.timestamp>r;(Ge||oe)&&Yo(!0)}};let Ii=Q=>{we({type:H.IncrementalSnapshot,data:{source:z.Mutation,...Q}})},xf=Q=>we({type:H.IncrementalSnapshot,data:{source:z.Scroll,...Q}}),Rf=Q=>we({type:H.IncrementalSnapshot,data:{source:z.CanvasMutation,...Q}}),sx=Q=>we({type:H.IncrementalSnapshot,data:{source:z.AdoptedStyleSheet,...Q}}),sr=new Wu({mutationCb:Ii,adoptedStyleSheetCb:sx}),ar=new Vu({mirror:st,mutationCb:Ii,stylesheetManager:sr,recordCrossOriginIframes:I,wrappedEmit:we});for(let Q of X||[])Q.getMirror&&Q.getMirror({nodeMirror:st,crossOriginIframeMirror:ar.crossOriginIframeMirror,crossOriginIframeStyleMirror:ar.crossOriginIframeStyleMirror});let ia=new zu;tu=new Uu({recordCanvas:N,mutationCb:Rf,win:window,blockClass:i,blockSelector:o,mirror:st,sampling:w.canvas,dataURLOptions:y});let Pi=new Bu({mutationCb:Ii,scrollCb:xf,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:or,dataURLOptions:y,maskTextFn:m,maskInputFn:f,recordCanvas:N,inlineImages:Z,sampling:w,slimDOMOptions:pt,iframeManager:ar,stylesheetManager:sr,canvasManager:tu,keepIframeSrcFn:F,processedNodeManager:ia},mirror:st});Yo=(Q=!1)=>{if(!E)return;we({type:H.Meta,data:{href:window.location.href,width:nb(),height:rb()}},Q),sr.reset(),Pi.init(),mr.forEach(ye=>ye.lock());let et=CP(document,{mirror:st,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:or,maskTextFn:m,maskInputFn:f,slimDOM:pt,dataURLOptions:y,recordCanvas:N,inlineImages:Z,onSerialize:ye=>{sb(ye,st)&&ar.addIframe(ye),ab(ye,st)&&sr.trackLinkElement(ye),$u(ye)&&Pi.addShadowRoot(U.shadowRoot(ye),document)},onIframeLoad:(ye,be)=>{ar.attachIframe(ye,be),Pi.observeAttachShadow(ye)},onStylesheetLoad:(ye,be)=>{sr.attachLinkElement(ye,be)},keepIframeSrcFn:F});if(!et)return console.warn("Failed to snapshot the document");we({type:H.FullSnapshot,data:{node:et,initialOffset:tb(window)}},Q),mr.forEach(ye=>ye.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&sr.adoptStyleSheets(document.adoptedStyleSheets,st.getId(document))};try{let Q=[],et=be=>{var Ge;return Y(G2)({mutationCb:Ii,mousemoveCb:(oe,oa)=>we({type:H.IncrementalSnapshot,data:{source:oa,positions:oe}}),mouseInteractionCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.MouseInteraction,...oe}}),scrollCb:xf,viewportResizeCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.ViewportResize,...oe}}),inputCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.Input,...oe}}),mediaInteractionCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.MediaInteraction,...oe}}),styleSheetRuleCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.StyleSheetRule,...oe}}),styleDeclarationCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.StyleDeclaration,...oe}}),canvasMutationCb:Rf,fontCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.Font,...oe}}),selectionCb:oe=>{we({type:H.IncrementalSnapshot,data:{source:z.Selection,...oe}})},customElementCb:oe=>{we({type:H.IncrementalSnapshot,data:{source:z.CustomElement,...oe}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:or,inlineStylesheet:c,sampling:w,recordDOM:E,recordCanvas:N,inlineImages:Z,userTriggeredOnInput:C,collectFonts:V,doc:be,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:F,blockSelector:o,slimDOMOptions:pt,dataURLOptions:y,mirror:st,iframeManager:ar,stylesheetManager:sr,shadowDomManager:Pi,processedNodeManager:ia,canvasManager:tu,ignoreCSSAttributes:$e,plugins:((Ge=X?.filter(oe=>oe.observer))==null?void 0:Ge.map(oe=>({observer:oe.observer,options:oe.options,callback:oa=>we({type:H.Plugin,data:{plugin:oe.name,payload:oa}})})))||[]},g)};ar.addLoadListener(be=>{try{Q.push(et(be.contentDocument))}catch(Ge){console.warn(Ge)}});let ye=()=>{Yo(),Q.push(et(document)),fs=!0};return["interactive","complete"].includes(document.readyState)?ye():(Q.push(Fe("DOMContentLoaded",()=>{we({type:H.DomContentLoaded,data:{}}),M==="DOMContentLoaded"&&ye()})),Q.push(Fe("load",()=>{we({type:H.Load,data:{}}),M==="load"&&ye()},window))),()=>{Q.forEach(be=>{try{be()}catch(Ge){String(Ge).toLowerCase().includes("cross-origin")||console.warn(Ge)}}),ia.destroy(),fs=!1,O2()}}catch(Q){console.warn(Q)}}wr.addCustomEvent=(e,t)=>{if(!fs)throw new Error("please add custom event after start recording");we({type:H.Custom,data:{tag:e,payload:t}})};wr.freezePage=()=>{mr.forEach(e=>e.freeze())};wr.takeFullSnapshot=e=>{if(!fs)throw new Error("please take full snapshot after start recording");Yo(e)};wr.mirror=st;var Rg;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Rg||(Rg={}));var Tz=5*1e3;var{addCustomEvent:Mz}=wr,{freezePage:Oz}=wr,{takeFullSnapshot:Nz}=wr;var vb="__ripploEmitRrwebEvent";function xb(){return{eventTypes:Sb(H),incrementalSources:Sb(z)}}function Sb(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,r])=>[r,t]))}var t6=Bl("@ripplo/rrweb-bundle/bundle","rrweb.js"),wb;function Rb(){return wb??=e6(t6,{encoding:"utf8"}),wb}async function mc({debugDir:e,writeOtlpPortFile:t}){let r=new Map,n=vm(xb()),i=await Va({localDir:kb.join(kb.dirname(e),".local"),writePortFile:t,onRrwebBatch:(a,l)=>{r.get(a)?.emitRrwebBatch(l)},onSpan:a=>{let l=a.attributes["ripplo.run"];l!=null&&r.get(l)?.emit(a)}}),o=await Rb();return{attach:async(a,l)=>{let u=Ep({debugDir:e,runId:l,worker:n});r.set(l,u),await Rm(a,l),await a.addInitScript(`globalThis.__ripploCapturePort = ${String(i.port)};`),await n6(a,u);let c=[];return{emitAction:d=>{s6(u,d)},emitAssertion:d=>{a6(u,d)},finish:()=>i6(u,{pages:c,registry:r,runId:l}),onPage:d=>{c.push(d),o6(u,o,d)}}},close:async()=>{await i.stop(),await n.terminate()},injectSpan:(a,l)=>{r.get(a)?.emit(l)}}}async function r6(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function n6(e,t){await e.exposeBinding(vb,(r,n)=>{let i=typeof n=="string"?n:JSON.stringify(n);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}async function i6(e,t){await r6(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 o6(e,t,r){r.on("load",()=>{r.addScriptTag({content:t}).catch(()=>{})}),r.on("response",n=>{d6(e,n)}),r.on("console",n=>{e.emit({kind:"console",level:n.type(),source:"browser",text:n.text(),timeNanos:Mr(Date.now())})}),r.on("pageerror",n=>{e.emit({kind:"error",message:n.message,source:"browser",stack:n.stack,timeNanos:Mr(Date.now())})})}function s6(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:l6(t),timeNanos:Mr(Date.now()),value:u6(t)})}function a6(e,t){let r=jl(t);e.emit({kind:"assertion",label:r.label,outcome:t.outcome,source:"test",step:r.step,timeNanos:Mr(Date.now())})}function l6(e){if(e.url!=null)return e.url;if(e.locator!=null)return hc(e.locator)}function hc(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${hc(e.scope)} \u25B8 ${hc(e.target)}`:`${e.role} ${e.name??""}`.trim()}function u6(e){return e.value!=null?typeof e.value=="object"?JSON.stringify(e.value):String(e.value):e.key}var c6=/^http:\/\/127\.0\.0\.1:\d+\/rrweb\//;function d6(e,t){let r=t.request(),n=r.resourceType();if(n!=="fetch"&&n!=="xhr"||c6.test(r.url()))return;let i=r.headers().traceparent?.split("-");e.emit({kind:"network",method:r.method(),resourceType:n,source:"browser",spanId:i?.[2],status:t.status(),timeNanos:Mr(Date.now()),traceId:i?.[1],url:t.url()})}import{err as V0,ok as Hd,ResultAsync as w8}from"neverthrow";function gc(e){return{invariants:Sl(e),laws:gl(e)}}var Eb=Object.defineProperty,Cb=(e,t)=>{let r={};for(var n in e)Eb(r,n,{get:e[n],enumerable:!0});return t||Eb(r,Symbol.toStringTag,{value:"Module"}),r};var f6=class Ab{constructor(t){this.seed=t}clone(){return new Ab(this.seed)}next(){let t=yc(this.seed),r=bc(t),n=yc(t),i=bc(n);return this.seed=yc(n),bc(this.seed)+(i+(r<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function yc(e){return Math.imul(e,214013)+2531011&4294967295}function bc(e){return(e&-2147483649)>>16}function Ib(e){return new f6(e)}var p6="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",h6=class Tb{constructor(t,r){this.states=t,this.index=r}clone(){return new Tb(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=ks(this.states,this.index),t}getState(){return[this.index,...this.states]}jump(){let t=this.states.slice(),r=this.index;this.index=ks(this.states,this.index);for(let n=19932;n>0;--n)p6.charCodeAt(n/6|0)-48&1<<n%6&&Pb(this.states,this.index,t,r),this.index=ks(this.states,this.index);Pb(this.states,this.index,t,r)}};function Pb(e,t,r,n){let i=0;if(n>=t){for(;i<624-n;i++)e[i+t]^=r[i+n];for(;i<624-t;i++)e[i+t]^=r[i+n-624];for(;i<624;i++)e[i+t-624]^=r[i+n-624]}else{for(;i<624-t;i++)e[i+t]^=r[i+n];for(;i<624-n;i++)e[i+t-624]^=r[i+n];for(;i<624;i++)e[i+t-624]^=r[i+n-624]}}function ks(e,t){if(t<227){let r=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397]^r>>>1^-(r&1)&2567483615,t+1}else if(t<623){let r=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397-624]^r>>>1^-(r&1)&2567483615,t+1}else{let r=e[t]&2147483648|e[0]&2147483647;return e[t]=e[396]^r>>>1^-(r&1)&2567483615,0}}function m6(e){for(let t=0;t!==624;++t)ks(e,t)}function Mb(e){let t=[e|0];for(let r=1;r!==624;++r){let n=t[r-1]^t[r-1]>>>30;t.push(Math.imul(1812433253,n)+r|0)}return m6(t),new h6(t,0)}var g6=class Ob{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new Ob(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00^this.s00<<23,r=this.s01^(this.s01<<23|this.s00>>>9),n=t^this.s10^(t>>>18|r<<14)^(this.s10>>>5|this.s11<<27),i=r^this.s11^r>>>18^this.s11>>>5,o=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=i,this.s10=n,o}jump(){let t=0,r=0,n=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,r^=this.s00,n^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=r,this.s11=n,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Sc(e){return new g6(-1,~e,e|0,0)}var y6=class Nb{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new Nb(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00+this.s10|0,r=this.s10^this.s00,n=this.s11^this.s01,i=this.s00,o=this.s01;return this.s00=i<<24^o>>>8^r^r<<16,this.s01=o<<24^i>>>8^n^(n<<16|r>>>16),this.s10=n<<5^r>>>27,this.s11=r<<5^n>>>27,t}jump(){let t=0,r=0,n=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,r^=this.s00,n^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=r,this.s11=n,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Lb(e){return new y6(-1,~e,e|0,0)}function $b(e,t){for(let r=0;r!==t;++r)e.next()}var Db=BigInt,b6=4294967296n;function Fb(e,t,r){let n=r-t+1n,i=b6,o=1;for(;i<n;)i<<=32n,++o;let s=_b(o,e);if(s<n)return s+t;if(s+n<i)return s%n+t;let a=i-i%n;for(;s>=a;)s=_b(o,e);return s%n+t}function _b(e,t){let r=Db(t.next()+2147483648);for(let n=1;n<e;++n){let i=t.next();r=(r<<32n)+Db(i+2147483648)}return r}function li(e,t){let r=t>2?~~(4294967296/t)*t:4294967296,n=e.next()+2147483648;for(;n>=r;)n=e.next()+2147483648;return n%t}function wc(e,t){if(t<0){let r=-t;e.sign=-1,e.data[0]=~~(r/4294967296),e.data[1]=r>>>0}else e.sign=1,e.data[0]=~~(t/4294967296),e.data[1]=t>>>0;return e}function S6(e,t,r){let n=t.data[1],i=t.data[0],o=t.sign,s=r.data[1],a=r.data[0],l=r.sign;if(e.sign=1,o===1&&l===-1){let m=n+s,g=i+a+(m>4294967295?1:0);return e.data[0]=g>>>0,e.data[1]=m>>>0,e}let u=n,c=i,d=s,p=a;o===-1&&(u=s,c=a,d=n,p=i);let h=0,f=u-d;return f<0&&(h=1,f=f>>>0),e.data[0]=c-p-h,e.data[1]=f,e}function w6(e,t,r){let n=r[0]+1;for(t[0]=li(e,n),t[1]=li(e,4294967296);t[0]>=r[0]&&(t[0]!==r[0]||t[1]>=r[1]);)t[0]=li(e,n),t[1]=li(e,4294967296);return t}var v6=Number.MAX_SAFE_INTEGER,x6={sign:1,data:[0,0]},R6={sign:1,data:[0,0]},jb={sign:1,data:[0,0]},vc=[0,0];function k6(e,t,r,n){let i=n<=v6?wc(jb,n):S6(jb,wc(x6,r),wc(R6,t));return i.data[1]===4294967295?(i.data[0]+=1,i.data[1]=0):i.data[1]+=1,w6(e,vc,i.data),vc[0]*4294967296+vc[1]+t}function Es(e,t,r){let n=r-t;return n<=4294967295?li(e,n+1)+t:k6(e,t,r,n)}var Vb=Symbol.for("fast-check/PreconditionFailure"),ir=class extends Error{constructor(e=!1){super(),this.interruptExecution=e,this.footprint=Vb}static isFailure(e){return e!=null&&e.footprint===Vb}};function E6(e){if(!e)throw new ir}var C6=class{[Symbol.iterator](){return this}next(e){return{value:e,done:!0}}},A6=new C6;function I6(){return A6}function*P6(e,t){for(let r of e)yield t(r)}function*T6(e,t){for(let r of e)yield*t(r)}function*M6(e,t){for(let r of e)t(r)&&(yield r)}function*O6(e,t){for(let r=0;r<t;++r){let n=e.next();if(n.done)break;yield n.value}}function*N6(e,t){let r=e.next();for(;!r.done&&t(r.value);)yield r.value,r=e.next()}function*L6(e,t){for(let r=e.next();!r.done;r=e.next())yield r.value;for(let r of t)for(let n=r.next();!n.done;n=r.next())yield n.value}var $6=Symbol.iterator,j=class Lt{static nil(){return new Lt(I6())}static of(...t){return new Lt(t[$6]())}constructor(t){this.g=t}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(t){return new Lt(P6(this.g,t))}flatMap(t){return new Lt(T6(this.g,t))}dropWhile(t){let r=!1;function*n(i){(r||!t(i))&&(r=!0,yield i)}return this.flatMap(n)}drop(t){if(t<=0)return this;let r=0;function n(){return r++<t}return this.dropWhile(n)}takeWhile(t){return new Lt(N6(this.g,t))}take(t){return new Lt(O6(this.g,t))}filter(t){return new Lt(M6(this.g,t))}every(t){for(let r of this.g)if(!t(r))return!1;return!0}has(t){for(let r of this.g)if(t(r))return[!0,r];return[!1,null]}join(...t){return new Lt(L6(this.g,t))}getNthOrLast(t){let r=t,n=null;for(let i of this.g){if(r--===0)return i;n=i}return n}};function rr(e){return new j(e)}var Me=Symbol.for("fast-check/cloneMethod");function xr(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Me in e&&typeof e[Me]=="function"}function rn(e){return xr(e)?e[Me]():e}var D6=Object.defineProperty,D=class{constructor(e,t,r){this.value_=e,this.context=t,this.hasToBeCloned=r!==void 0||xr(e),this.readOnce=!1,this.value=e,this.hasToBeCloned&&D6(this,"value",{get:r!==void 0?r:this.getValue,enumerable:!1,configurable:!1})}getValue(){return this.hasToBeCloned?this.readOnce?this.value_[Me]():(this.readOnce=!0,this.value_):this.value_}},de=class{filter(e){return new j6(this,e)}map(e,t){return new F6(this,e,t)}chain(e){return new _6(this,e)}},_6=class extends de{constructor(e,t){super(),this.arb=e,this.chainer=t}generate(e,t){let r=e.clone(),n=this.arb.generate(e,t);return this.valueChainer(n,e,r,t)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?(t.stoppedForOriginal?j.nil():this.arb.shrink(t.originalValue,t.originalContext).map(r=>this.valueChainer(r,t.clonedMrng.clone(),t.clonedMrng,t.originalBias))).join(t.chainedArbitrary.shrink(e,t.chainedContext).map(r=>{let n={...t,chainedContext:r.context,stoppedForOriginal:!0};return new D(r.value_,n)})):j.nil()}valueChainer(e,t,r,n){let i=this.chainer(e.value_),o=i.generate(t,n),s={originalBias:n,originalValue:e.value_,originalContext:e.context,stoppedForOriginal:!1,chainedArbitrary:i,chainedContext:o.context,clonedMrng:r};return new D(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}},F6=class extends de{constructor(e,t,r){super(),this.arb=e,this.mapper=t,this.unmapper=r,this.bindValueMapper=n=>this.valueMapper(n)}generate(e,t){let r=this.arb.generate(e,t);return this.valueMapper(r)}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 r=this.unmapper(e);return this.arb.shrink(r,void 0).map(this.bindValueMapper)}return j.nil()}mapperWithCloneIfNeeded(e){let t=e.value,r=this.mapper(t);return e.hasToBeCloned&&(typeof r=="object"&&r!==null||typeof r=="function")&&Object.isExtensible(r)&&!xr(r)&&Object.defineProperty(r,Me,{get:()=>()=>this.mapperWithCloneIfNeeded(e)[0]}),[r,t]}valueMapper(e){let[t,r]=this.mapperWithCloneIfNeeded(e);return new D(t,{originalValue:r,originalContext:e.context})}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalValue"in e&&"originalContext"in e}},j6=class extends de{constructor(e,t){super(),this.arb=e,this.refinement=t,this.bindRefinementOnValue=r=>this.refinementOnValue(r)}generate(e,t){for(;;){let r=this.arb.generate(e,t);if(this.refinementOnValue(r))return r}}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 Vw(e){return typeof e=="object"&&e!==null&&"generate"in e&&"shrink"in e&&"canShrinkWithoutContext"in e}function Bw(e){if(!Vw(e))throw new Error("Unexpected value received: not an instance of Arbitrary")}var Uw=Function.prototype.apply,xc=Symbol("apply");function V6(e){try{return e.apply}catch{return}}function B6(e,t,r){let n=e;n[xc]=Uw;let i=n[xc](t,r);return delete n[xc],i}function q(e,t,r){return V6(e)===Uw?e.apply(t,r):B6(e,t,r)}var Ww=Array,O=BigInt,U6=BigInt64Array,W6=BigUint64Array,zw=Boolean,Vs=Date,L=Error,Gw=Float32Array,Hw=Float64Array,z6=Int8Array,G6=Int16Array,H6=Int32Array,Dt=Number,Ve=String,nn=Set,q6=Uint8Array,K6=Uint8ClampedArray,Y6=Uint16Array,J6=Uint32Array,Z6=encodeURIComponent,_t=Map,Ns=Symbol,Bb=Array.prototype.forEach,Ub=Array.prototype.indexOf,Wb=Array.prototype.join,zb=Array.prototype.map,Gb=Array.prototype.flat,Hb=Array.prototype.filter,qb=Array.prototype.push,Kb=Array.prototype.pop,Yb=Array.prototype.splice,Jb=Array.prototype.slice,Zb=Array.prototype.sort,Xb=Array.prototype.every;function X6(e){try{return e.forEach}catch{return}}function Q6(e){try{return e.indexOf}catch{return}}function e4(e){try{return e.join}catch{return}}function t4(e){try{return e.map}catch{return}}function r4(e){try{return e.flat}catch{return}}function n4(e){try{return e.filter}catch{return}}function i4(e){try{return e.push}catch{return}}function o4(e){try{return e.pop}catch{return}}function s4(e){try{return e.splice}catch{return}}function a4(e){try{return e.slice}catch{return}}function l4(e){try{return e.sort}catch{return}}function u4(e){try{return e.every}catch{return}}function qw(e,t){return X6(e)===Bb?e.forEach(t):q(Bb,e,[t])}function $t(e,...t){return Q6(e)===Ub?e.indexOf(...t):q(Ub,e,t)}function ce(e,...t){return e4(e)===Wb?e.join(...t):q(Wb,e,t)}function G(e,t){return t4(e)===zb?e.map(t):q(zb,e,[t])}function c4(e,t){return r4(e)===Gb?([].flat(),e.flat(t)):q(Gb,e,[t])}function d4(e,t){return n4(e)===Hb?e.filter(t):q(Hb,e,[t])}function $(e,...t){return i4(e)===qb?e.push(...t):q(qb,e,t)}function Kw(e){return o4(e)===Kb?e.pop():q(Kb,e,[])}function Yw(e,...t){return s4(e)===Yb?e.splice(...t):q(Yb,e,t)}function Le(e,...t){return a4(e)===Jb?e.slice(...t):q(Jb,e,t)}function Jw(e,...t){return l4(e)===Zb?e.sort(...t):q(Zb,e,t)}function Zw(e,...t){return u4(e)===Xb?e.every(...t):q(Xb,e,t)}var Qb=Date.prototype.getTime,eS=Date.prototype.toISOString;function f4(e){try{return e.getTime}catch{return}}function p4(e){try{return e.toISOString}catch{return}}function Bs(e){return f4(e)===Qb?e.getTime():q(Qb,e,[])}function h4(e){return p4(e)===eS?e.toISOString():q(eS,e,[])}var tS=Set.prototype.add,rS=Set.prototype.has;function m4(e){try{return e.add}catch{return}}function g4(e){try{return e.has}catch{return}}function pi(e,t){return m4(e)===tS?e.add(t):q(tS,e,[t])}function Us(e,t){return g4(e)===rS?e.has(t):q(rS,e,[t])}var nS=WeakMap.prototype.set,iS=WeakMap.prototype.get;function y4(e){try{return e.set}catch{return}}function b4(e){try{return e.get}catch{return}}function S4(e,t,r){return y4(e)===nS?e.set(t,r):q(nS,e,[t,r])}function w4(e,t){return b4(e)===iS?e.get(t):q(iS,e,[t])}var oS=Map.prototype.set,sS=Map.prototype.get,aS=Map.prototype.has;function v4(e){try{return e.set}catch{return}}function x4(e){try{return e.get}catch{return}}function R4(e){try{return e.has}catch{return}}function ut(e,t,r){return v4(e)===oS?e.set(t,r):q(oS,e,[t,r])}function Ye(e,t){return x4(e)===sS?e.get(t):q(sS,e,[t])}function k4(e,t){return R4(e)===aS?e.has(t):q(aS,e,[t])}var lS=String.prototype.split,uS=String.prototype.startsWith,cS=String.prototype.endsWith,dS=String.prototype.substring,fS=String.prototype.toLowerCase,pS=String.prototype.toUpperCase,hS=String.prototype.padStart,mS=String.prototype.charCodeAt,gS=String.prototype.normalize,yS=String.prototype.replace;function E4(e){try{return e.split}catch{return}}function C4(e){try{return e.startsWith}catch{return}}function A4(e){try{return e.endsWith}catch{return}}function I4(e){try{return e.substring}catch{return}}function P4(e){try{return e.toLowerCase}catch{return}}function T4(e){try{return e.toUpperCase}catch{return}}function M4(e){try{return e.padStart}catch{return}}function O4(e){try{return e.charCodeAt}catch{return}}function N4(e){try{return e.normalize}catch{return}}function L4(e){try{return e.replace}catch{return}}function Be(e,...t){return E4(e)===lS?e.split(...t):q(lS,e,t)}function $4(e,...t){return C4(e)===uS?e.startsWith(...t):q(uS,e,t)}function D4(e,...t){return A4(e)===cS?e.endsWith(...t):q(cS,e,t)}function ge(e,...t){return I4(e)===dS?e.substring(...t):q(dS,e,t)}function qc(e){return P4(e)===fS?e.toLowerCase():q(fS,e,[])}function Sd(e){return T4(e)===pS?e.toUpperCase():q(pS,e,[])}function _4(e,...t){return M4(e)===hS?e.padStart(...t):q(hS,e,t)}function on(e,t){return O4(e)===mS?e.charCodeAt(t):q(mS,e,[t])}function F4(e,t){return N4(e)===gS?e.normalize(t):q(gS,e,[t])}function j4(e,t,r){return L4(e)===yS?e.replace(t,r):q(yS,e,[t,r])}var bS=Number.prototype.toString;function V4(e){try{return e.toString}catch{return}}function hi(e,...t){return V4(e)===bS?e.toString(...t):q(bS,e,t)}var B4=Object.prototype.hasOwnProperty,U4=Object.prototype.toString;function Xw(e,t){return q(B4,e,[t])}function Kc(e){return q(U4,e,[])}var W4=Error.prototype.toString;function z4(e){return q(W4,e,[])}var G4=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 tr(e){return new G4(e)}var Qw=Array.isArray,H4=Object.defineProperty;function e1(e,t){return H4(e,Me,{value:()=>{let r=[];for(let n=0;n!==t.length;++n)$(r,t[n].value);return e1(r,t),r}})}function t1(e){let t=!1,r=[],n=[];for(let i=0;i!==e.length;++i){let o=e[i];t=t||o.hasToBeCloned,$(r,o.value),$(n,o.context)}return t&&e1(r,e),new D(r,n)}function r1(e,t,r){let n=[],i=Qw(r)?r:[];for(let o=0;o!==e.length;++o)$(n,tr(()=>e[o].shrink(t[o],i[o]).map(s=>{let a=G(t,(l,u)=>new D(rn(l),i[u]));return[...Le(a,0,o),s,...Le(a,o+1)]}).map(t1)));return j.nil().join(...n)}var q4=class extends de{constructor(e){super(),this.arbs=e;for(let t=0;t!==e.length;++t){let r=e[t];if(r==null||r.generate===null||r.generate===void 0)throw new Error(`Invalid parameter encountered at index ${t}: expecting an Arbitrary`)}}generate(e,t){let r=[];for(let n=0;n!==this.arbs.length;++n)$(r,this.arbs[n].generate(e,t));return t1(r)}canShrinkWithoutContext(e){if(!Qw(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 r1(this.arbs,e,t)}};function B(...e){return new q4(e)}var K4=Math.log;function n1(e){return 2+~~(K4(e+1)*.4342944819032518)}var wd={};function Y4(e){wd=e}function ct(){return wd}function J4(){wd={}}var mi=Symbol("UndefinedContextPlaceholder");function sn(e){return e.context!==void 0?e:e.hasToBeCloned?new D(e.value_,mi,()=>e.value):new D(e.value_,mi)}var SS=()=>{},Z4=class{constructor(e,t){this.arb=e,this.predicate=t;let{asyncBeforeEach:r,asyncAfterEach:n,beforeEach:i,afterEach:o}=ct()||{};if(r!==void 0&&i!==void 0)throw L(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if(n!==void 0&&o!==void 0)throw L(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=r||i||SS,this.afterEachHook=n||o||SS}isAsync(){return!0}generate(e,t){return sn(this.arb.generate(e,t!==void 0?n1(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return j.nil();let t=e.context!==mi?e.context:void 0;return this.arb.shrink(e.value_,t).map(sn)}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 L("Property failed by returning false")}}catch(t){return ir.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}},i1=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return sn(this.arb.generate(e,t))}canShrinkWithoutContext(e){return!0}shrink(e,t){if(t===void 0&&!this.arb.canShrinkWithoutContext(e))return j.nil();let r=t!==mi?t:void 0;return this.arb.shrink(e,r).map(sn)}};function X4(...e){if(e.length<2)throw new Error("asyncProperty expects at least two parameters");let t=Le(e,0,e.length-1),r=e[e.length-1];return qw(t,Bw),new Z4(B(...G(t,n=>new i1(n))),n=>r(...n))}var wS=()=>{},o1=class{constructor(e,t){this.arb=e,this.predicate=t;let{beforeEach:r=wS,afterEach:n=wS,asyncBeforeEach:i,asyncAfterEach:o}=ct()||{};if(i!==void 0)throw L(`"asyncBeforeEach" can't be set when running synchronous properties`);if(o!==void 0)throw L(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=r,this.afterEachHook=n}isAsync(){return!1}generate(e,t){return sn(this.arb.generate(e,t!==void 0?n1(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return j.nil();let t=e.context!==mi?e.context:void 0;return this.arb.shrink(e.value_,t).map(sn)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(e){try{let t=this.predicate(e);return t===void 0||t===!0?null:{error:new L("Property failed by returning false")}}catch(t){return ir.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 Q4(...e){if(e.length<2)throw new Error("property expects at least two parameters");let t=Le(e,0,e.length-1),r=e[e.length-1];return qw(t,Bw),new o1(B(...G(t,n=>new i1(n))),n=>r(...n))}var eN=(function(e){return e[e.None=0]="None",e[e.Verbose=1]="Verbose",e[e.VeryVerbose=2]="VeryVerbose",e})({});function Yc(e){return"unsafeNext"in e?e.unsafeJump===void 0?{clone:()=>Yc(e),next:()=>e.unsafeNext(),getState:()=>e.getState()}:{clone:()=>Yc(e),next:()=>e.unsafeNext(),jump:()=>e.unsafeJump(),getState:()=>e.getState()}:e}function s1(e){return"jump"in e&&typeof e.jump=="function"?e:{clone:()=>s1(e),next:()=>e.next(),jump:()=>$b(e,42),getState:()=>e.getState()}}function Hs(e){return s1(Yc(e))}var tN=Date.now,rN=Math.min,nN=Math.random,iN=class{constructor(e){let t=e||{};this.seed=oN(t),this.randomType=sN(t),this.numRuns=aN(t),this.verbose=lN(t),this.maxSkipsPerRun=t.maxSkipsPerRun!==void 0?t.maxSkipsPerRun:100,this.timeout=kc(t.timeout),this.skipAllAfterTimeLimit=kc(t.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=kc(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:r=>{console.log(r)},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 Rc(e){return t=>Hs(e(t))}function oN(e){if(e.seed===void 0)return tN()^nN()*4294967296;let t=e.seed|0;return e.seed===t?t:t^(e.seed-t)*4294967296}function sN(e){if(e.randomType===void 0)return Sc;if(typeof e.randomType=="string")switch(e.randomType){case"mersenne":return Rc(Mb);case"congruential":case"congruential32":return Rc(Ib);case"xorshift128plus":return Sc;case"xoroshiro128plus":return Lb;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===Hs(t)?e.randomType:Rc(e.randomType)}function aN(e){return e.numRuns!==void 0?e.numRuns:e.num_runs!==void 0?e.num_runs:100}function lN(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 kc(e){if(e!==void 0)return rN(e,2147483647)}function vd(e){return new iN(e)}function uN(e,t,r){let n=null;return{clear:()=>r(n),promise:new Promise(i=>{n=t(()=>{i(new ir(!0))},e)})}}var vS=class{constructor(e,t,r,n,i,o){this.property=e,this.getTime=t,this.interruptExecution=n,this.setTimeoutSafe=i,this.clearTimeoutSafe=o,this.skipAfterTime=this.getTime()+r}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 r=new ir(this.interruptExecution);return this.isAsync()?Promise.resolve(r):r}if(this.interruptExecution&&this.isAsync()){let r=uN(t,this.setTimeoutSafe,this.clearTimeoutSafe),n=Promise.race([this.property.run(e),r.promise]);return n.then(r.clear,r.clear),n}return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},cN=(e,t,r)=>{let n=null;return{clear:()=>r(n),promise:new Promise(i=>{n=t(()=>{i({error:new L(`Property timeout: exceeded limit of ${e} milliseconds`)})},e)})}},dN=class{constructor(e,t,r,n){this.property=e,this.timeMs=t,this.setTimeoutSafe=r,this.clearTimeoutSafe=n}isAsync(){return!0}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}async run(e){let t=cN(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),r=Promise.race([this.property.run(e),t.promise]);return r.then(t.clear,t.clear),r}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},a1=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()}},xS=Array.from,RS=typeof Buffer<"u"?Buffer.isBuffer:void 0,Xr=JSON.stringify,kS=Number.isNaN,fN=Object.keys,pN=Object.getOwnPropertySymbols,hN=Object.getOwnPropertyDescriptor,ES=Object.getPrototypeOf,CS=Number.NEGATIVE_INFINITY,mN=Number.POSITIVE_INFINITY,dt=Symbol.for("fast-check/toStringMethod");function xd(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&dt in e&&typeof e[dt]=="function"}var Ft=Symbol.for("fast-check/asyncToStringMethod");function Rd(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Ft in e&&typeof e[Ft]=="function"}var gN=/^Symbol\((.*)\)$/;function yN(e){if(e.description!==void 0)return e.description;let t=gN.exec(Ve(e));return t&&t[1].length?t[1]:null}function AS(e){switch(e){case 0:return 1/e===CS?"-0":"0";case CS:return"Number.NEGATIVE_INFINITY";case mN:return"Number.POSITIVE_INFINITY";default:return e===e?Ve(e):"Number.NaN"}}function bN(e){let t=-1;for(let r in e){let n=Number(r);if(n!==t+1)return!0;t=n}return t+1!==e.length}function Ke(e,t,r){let n=[...t,e];if(typeof e=="object"&&$t(t,e)!==-1)return"[cyclic]";if(Rd(e)){let i=r(e);if(i.state==="fulfilled")return i.value}if(xd(e))try{return e[dt]()}catch{}switch(Kc(e)){case"[object Array]":{let i=e;if(i.length>=50&&bN(i)){let s=[];for(let a in i)kS(Number(a))||$(s,`${a}:${Ke(i[a],n,r)}`);return s.length!==0?`Object.assign(Array(${i.length}),{${ce(s,",")}})`:`Array(${i.length})`}let o=ce(G(i,s=>Ke(s,n,r)),",");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 kS(Bs(i))?"new Date(NaN)":`new Date(${Xr(h4(i))})`}case"[object Map]":return`new Map(${Ke(Array.from(e),n,r)})`;case"[object Null]":return"null";case"[object Number]":return typeof e=="number"?AS(e):`new Number(${AS(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"?`[${Ke(o,n,r)}]`:Xr(o)}:${Ke(e[o],n,r)}`;return"{"+ce([...ES(e)===null?["__proto__:null"]:[],...G(fN(e),i),...G(d4(pN(e),o=>{let s=hN(e,o);return s&&s.enumerable}),i)],",")+"}"}case"[object Set]":return`new Set(${Ke(Array.from(e),n,r)})`;case"[object String]":return typeof e=="string"?Xr(e):`new String(${Xr(e)})`;case"[object Symbol]":{let i=e;if(Ns.keyFor(i)!==void 0)return`Symbol.for(${Xr(Ns.keyFor(i))})`;let o=yN(i);return o===null?"Symbol()":i===(o.startsWith("Symbol.")&&Ns[o.substring(7)])?o:`Symbol(${Xr(o)})`}case"[object Promise]":{let i=r(e);switch(i.state){case"fulfilled":return`Promise.resolve(${Ke(i.value,n,r)})`;case"rejected":return`Promise.reject(${Ke(i.value,n,r)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(e instanceof Error)return`new Error(${Ke(e.message,n,r)})`;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 RS=="function"&&RS(e))return`Buffer.from(${e.buffer.detached?"/*detached ArrayBuffer*/":Ke(xS(e.values()),n,r)})`;let i=ES(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(${Ke(xS(s.values()),n,r)})`}break}}try{return e.toString()}catch{return Kc(e)}}function xe(e){return Ke(e,[],()=>({state:"unknown",value:void 0}))}function l1(e){let t=Ns(),r=[],n=new _t;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(n.has(c))return n.get(c);let d=i(),p=Ft in u?Promise.resolve().then(()=>u[Ft]()):u;return p.catch(()=>{}),r.push(Promise.race([p,d.delay]).then(h=>{h===t?n.set(c,{state:"pending",value:void 0}):n.set(c,{state:"fulfilled",value:h}),d.cancel()},h=>{n.set(c,{state:"rejected",value:h}),d.cancel()})),n.set(c,o),o};function a(){let l=Ke(e,[],s);return r.length===0?l:Promise.all(r.splice(0)).then(a)}return a()}async function kd(e){return Promise.resolve(l1(e))}function IS(e){return e===null?new ir:e}function SN(...e){return e[1]?e[0].then(IS):IS(e[0])}function wN(e,t){return SN(e,t)}var PS=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=xe(e);if(this.coveredCases.has(t)){let n=this.coveredCases.get(t);return this.skipRuns?wN(n,this.property.isAsync()):n}let r=this.property.run(e);return this.coveredCases.set(t,r),r}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},TS=Date.now,Ec=setTimeout,Cc=clearTimeout;function vN(e,t){let r=e;return e.isAsync()&&t.timeout!==void 0&&(r=new dN(r,t.timeout,Ec,Cc)),t.unbiased&&(r=new a1(r)),t.skipAllAfterTimeLimit!==void 0&&(r=new vS(r,TS,t.skipAllAfterTimeLimit,!1,Ec,Cc)),t.interruptAfterTimeLimit!==void 0&&(r=new vS(r,TS,t.interruptAfterTimeLimit,!0,Ec,Cc)),t.skipEqualValues&&(r=new PS(r,!0)),t.ignoreEqualValues&&(r=new PS(r,!1)),r}var xN=(function(e){return e[e.Success=0]="Success",e[e.Skipped=-1]="Skipped",e[e.Failure=1]="Failure",e})({}),RN=class u1{constructor(t,r){this.verbosity=t,this.interruptedAsFailure=r,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(t,r){let n={status:t,value:r,children:[]};return this.currentLevelExecutionTrees.push(n),n}fail(t,r,n){if(this.verbosity>=1){let i=this.appendExecutionTree(1,t);this.currentLevelExecutionTrees=i.children}this.pathToFailure===void 0?this.pathToFailure=`${r}`:this.pathToFailure+=`:${r}`,this.value=t,this.failure=n}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?+Be(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?Be(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let t=[],r=this.rootExecutionTrees;for(;r.length>0&&r[r.length-1].status===1;){let n=r[r.length-1];t.push(n.value),r=n.children}return t}static mergePaths(t,r){if(t.length===0)return r;let n=t.split(":"),i=r.split(":"),o=+n[n.length-1]+ +i[0];return[...n.slice(0,n.length-1),`${o}`,...i.slice(1)].join(":")}toRunDetails(t,r,n,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:u1.mergePaths(r,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>n||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()}}},c1=class{constructor(e,t,r,n){this.sourceValues=e,this.shrink=t,this.runExecution=new RN(r,n),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"&&!ir.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_)}},kN=class{constructor(e,t,r){this.initialValues=e,this.maxInitialIterations=t,this.remainingSkips=r}[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}},EN=-2147483648,CN=2147483647,AN=Math.pow(2,27),IN=Math.pow(2,-53),Ed=class d1{constructor(t){this.internalRng=Hs(t.clone())}clone(){return new d1(this.internalRng)}next(t){return Es(this.internalRng,0,(1<<t)-1)}nextBoolean(){return Es(this.internalRng,0,1)===1}nextInt(t,r){return Es(this.internalRng,t===void 0?EN:t,r===void 0?CN:r)}nextBigInt(t,r){return Fb(this.internalRng,t,r)}nextDouble(){let t=this.next(26),r=this.next(27);return(t*AN+r)*IN}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState=="function")return this.internalRng.getState()}};function PN(e,t,r){return t.jump(),e.generate(new Ed(t),r)}function*f1(e,t,r,n){for(let i=0;i!==n.length;++i)yield new D(n[i],void 0);for(let i=0,o=r(t);;++i)yield PN(e,o,i)}function TN(e,t,r){return()=>e.generate(new Ed(t),r)}function*p1(e,t,r,n){yield*G(n,s=>()=>new D(s,void 0));let i=0,o=Hs(r(t));for(;;)o.jump(),yield TN(e,o,i++)}function MS(e){return e()}function h1(e,t,r){let n=t,i=e.split(":").map(s=>+s);if(i.length===0)return n.map(MS);if(!i.every(s=>!Number.isNaN(s)))throw new Error(`Unable to replay, got invalid path=${e}`);let o=n.drop(i[0]).map(MS);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=r(a).drop(s)}return o}var MN=Object.assign;function ON(e){return e.length===1?`Hint: ${e[0]}`:e.map((t,r)=>`Hint (${r+1}): ${t}`).join(`
|
|
100
|
-
`)}function
|
|
99
|
+
or you can use record.mirror to access the mirror instance during recording.`,fg={map:{},getId(){return console.error(Vr),-1},getNode(){return console.error(Vr),null},removeNodeFromMap(){console.error(Vr)},has(){return console.error(Vr),!1},reset(){console.error(Vr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(fg=new Proxy(fg,{get(e,t,r){return t==="map"&&console.error(Vr),Reflect.get(e,t,r)}}));function ri(e,t,r={}){let n=null,i=0;return function(...o){let s=Date.now();!i&&r.leading===!1&&(i=s);let a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(l,o)},a))}}function Rs(e,t,r,n,i=window){let o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>Rs(e,t,o||{},!0)}var us=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(us=()=>new Date().getTime());function eb(e){var t,r,n,i;let o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||o?.body&&((t=U.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o?.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:o?.documentElement.scrollTop||o?.body&&((n=U.parentElement(o.body))==null?void 0:n.scrollTop)||((i=o?.body)==null?void 0:i.scrollTop)||0}}function tb(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function rb(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function nb(e){return e?e.nodeType===e.ELEMENT_NODE?e:U.parentElement(e):null}function je(e,t,r,n){if(!e)return!1;let i=nb(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(es(i,t,n))return!0}catch{}return!!(r&&(i.matches(r)||n&&i.closest(r)!==null))}function k2(e,t){return t.getId(e)!==-1}function Ql(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===qn}function ib(e,t){if(zn(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let n=U.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?ib(n,t):!0}function Nu(e){return!!e.changedTouches}function E2(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 ob(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function sb(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Lu(e){return e?e instanceof Ou&&"shadowRoot"in e?!!e.shadowRoot:!!U.shadowRoot(e):!1}var $u=class{constructor(){k(this,"id",1),k(this,"styleIDMap",new WeakMap),k(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}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 ab(e){var t;let r=null;return"getRootNode"in e&&((t=U.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&U.host(U.getRootNode(e))&&(r=U.host(U.getRootNode(e))),r}function C2(e){let t=e,r;for(;r=ab(t);)t=r;return t}function A2(e){let t=U.ownerDocument(e);if(!t)return!1;let r=C2(e);return U.contains(t,r)}function lb(e){let t=U.ownerDocument(e);return t?U.contains(t,e)||A2(e):!1}var H=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(H||{}),z=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(z||{}),We=(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))(We||{}),Pt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Pt||{}),Zr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Zr||{}),Br=(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))(Br||{});var ub=(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))(ub||{});function pg(e){return"__ln"in e}var Du=class{constructor(){k(this,"length",0),k(this,"head",null),k(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){let r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&pg(t.previousSibling)){let n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&pg(t.nextSibling)&&t.nextSibling.__ln.previous){let n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){let r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},hg=(e,t)=>`${e}@${t}`,_u=class{constructor(){k(this,"frozen",!1),k(this,"locked",!1),k(this,"texts",[]),k(this,"attributes",[]),k(this,"attributeMap",new WeakMap),k(this,"removes",[]),k(this,"mapRemoves",[]),k(this,"movedMap",{}),k(this,"addedSet",new Set),k(this,"movedSet",new Set),k(this,"droppedSet",new Set),k(this,"removesSubTreeCache",new Set),k(this,"mutationCb"),k(this,"blockClass"),k(this,"blockSelector"),k(this,"maskTextClass"),k(this,"maskTextSelector"),k(this,"inlineStylesheet"),k(this,"maskInputOptions"),k(this,"maskTextFn"),k(this,"maskInputFn"),k(this,"keepIframeSrcFn"),k(this,"recordCanvas"),k(this,"inlineImages"),k(this,"slimDOMOptions"),k(this,"dataURLOptions"),k(this,"doc"),k(this,"mirror"),k(this,"iframeManager"),k(this,"stylesheetManager"),k(this,"shadowDomManager"),k(this,"canvasManager"),k(this,"processedNodeManager"),k(this,"unattachedDoc"),k(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),k(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set,n=new Du,i=l=>{let u=l,c=qn;for(;c===qn;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{let u=U.parentNode(l);if(!u||!lb(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=zn(u)?this.mirror.getId(ab(l)):this.mirror.getId(u),p=i(l);if(d===-1||p===-1)return n.addNode(l);let h=Wr(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=>{ob(f,this.mirror)&&this.iframeManager.addIframe(f),sb(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Lu(l)&&this.shadowDomManager.addShadowRoot(U.shadowRoot(l),this.doc)},onIframeLoad:(f,m)=>{this.iframeManager.attachIframe(f,m),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,m)=>{this.stylesheetManager.attachLinkElement(f,m)},cssCaptured:c});h&&(t.push({parentId:d,nextId:p,node:h}),r.add(h.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)mg(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(U.parentNode(l))||o(l);for(let l of this.addedSet)!gg(this.droppedSet,l)&&!mg(this.removesSubTreeCache,l,this.mirror)||gg(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;n.length;){let l=null;if(s){let u=this.mirror.getId(U.parentNode(s.value)),c=i(s.value);u!==-1&&c!==-1&&(l=s)}if(!l){let u=n.tail;for(;u;){let c=u;if(u=u.previous,c){let d=this.mirror.getId(U.parentNode(c.value));if(i(c.value)===-1)continue;if(d!==-1){l=c;break}else{let h=c.value,f=U.parentNode(h);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=U.host(f);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}s=l.previous,n.removeNode(l.value),o(l.value)}let a={texts:this.texts.map(l=>{let u=l.node,c=U.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!r.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=>!r.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))}),k(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(U.childNodes(t),i=>U.textContent(i)||"").join("");r.attributes.value=Zo({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Xo(t),value:n,maskInputFn:this.maskInputFn})}),k(this,"processMutation",t=>{if(!Ql(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let r=U.textContent(t.target);!je(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Tg(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,nb(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=t.attributeName,i=t.target.getAttribute(n);if(n==="value"){let s=Xo(r);i=Zo({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:i,maskInputFn:this.maskInputFn})}if(je(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)n="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Pg(r.tagName,n))if(o.attributes[n]=Ig(this.doc,gr(r.tagName),gr(n),i),n==="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(r.style)){let l=r.style.getPropertyValue(a),u=r.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))r.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else n==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(je(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),i=zn(t.target)?this.mirror.getId(U.host(t.target)):this.mirror.getId(t.target);je(t.target,this.blockClass,this.blockSelector,!1)||Ql(r,this.mirror,this.slimDOMOptions)||!k2(r,this.mirror)||(this.addedSet.has(r)?(Fu(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||ib(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[hg(n,i)]?Fu(this.movedSet,r):(this.removes.push({parentId:i,id:n,isShadow:zn(t.target)&&Gn(t.target)?!0:void 0}),I2(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),k(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Ql(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[hg(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);je(t,this.blockClass,this.blockSelector,!1)||(U.childNodes(t).forEach(n=>this.genAdds(n)),Lu(t)&&U.childNodes(U.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,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(r=>{this[r]=t[r]})}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 Fu(e,t){e.delete(t),U.childNodes(t).forEach(r=>Fu(e,r))}function I2(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),U.childNodes(n).forEach(i=>r.push(i)))}}function mg(e,t,r){return e.size===0?!1:P2(e,t)}function P2(e,t,r){let n=U.parentNode(t);return n?e.has(n):!1}function gg(e,t){return e.size===0?!1:cb(e,t)}function cb(e,t){let r=U.parentNode(t);return r?e.has(r)?!0:cb(e,r):!1}var Hn;function T2(e){Hn=e}function M2(){Hn=void 0}var Y=e=>Hn?(...r)=>{try{return e(...r)}catch(n){if(Hn&&Hn(n)===!0)return;throw n}}:e,mr=[];function ai(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 db(e,t){let r=new _u;mr.push(r),r.init(e);let n=new(Qy())(Y(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function O2({mousemoveCb:e,sampling:t,doc:r,mirror:n}){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=ri(Y(d=>{let p=Date.now()-a;e(s.map(h=>(h.timeOffset-=p,h)),d),s=[],a=null}),o),u=Y(ri(Y(d=>{let p=ai(d),{clientX:h,clientY:f}=Nu(d)?d.changedTouches[0]:d;a||(a=us()),s.push({x:h,y:f,id:n.getId(p),timeOffset:us()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?z.Drag:d instanceof MouseEvent?z.MouseMove:z.TouchMove)}),i,{trailing:!1})),c=[Fe("mousemove",u,r),Fe("touchmove",u,r),Fe("drag",u,r)];return Y(()=>{c.forEach(d=>d())})}function N2({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,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=ai(d);if(je(p,n,i,!0))return;let h=null,f=c;if("pointerType"in d){switch(d.pointerType){case"mouse":h=Pt.Mouse;break;case"touch":h=Pt.Touch;break;case"pen":h=Pt.Pen;break}h===Pt.Touch?We[c]===We.MouseDown?f="TouchStart":We[c]===We.MouseUp&&(f="TouchEnd"):Pt.Pen}else Nu(d)&&(h=Pt.Touch);h!==null?(l=h,(f.startsWith("Touch")&&h===Pt.Touch||f.startsWith("Mouse")&&h===Pt.Mouse)&&(h=null)):We[c]===We.Click&&(h=l,l=null);let m=Nu(d)?d.changedTouches[0]:d;if(!m)return;let g=r.getId(p),{clientX:S,clientY:w}=m;Y(e)({type:We[f],id:g,x:S,y:w,...h!==null&&{pointerType:h}})};return Object.keys(We).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let d=gr(c),p=u(c);if(window.PointerEvent)switch(We[c]){case We.MouseDown:case We.MouseUp:d=d.replace("mouse","pointer");break;case We.TouchStart:case We.TouchEnd:return}a.push(Fe(d,p,t))}),Y(()=>{a.forEach(c=>c())})}function fb({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){let s=Y(ri(Y(a=>{let l=ai(a);if(!l||je(l,n,i,!0))return;let u=r.getId(l);if(l===t&&t.defaultView){let c=eb(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 Fe("scroll",s,t)}function L2({viewportResizeCb:e},{win:t}){let r=-1,n=-1,i=Y(ri(Y(()=>{let o=tb(),s=rb();(r!==o||n!==s)&&(e({width:Number(s),height:Number(o)}),r=o,n=s)}),200));return Fe("resize",i,t)}var $2=["INPUT","TEXTAREA","SELECT"],yg=new WeakMap;function D2({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(w){let y=ai(w),x=w.isTrusted,E=y&&y.tagName;if(y&&E==="OPTION"&&(y=U.parentElement(y)),!y||!E||$2.indexOf(E)<0||je(y,n,i,!0)||y.classList.contains(o)||s&&y.matches(s))return;let N=y.value,I=!1,M=Xo(y)||"";M==="radio"||M==="checkbox"?I=y.checked:(a[E.toLowerCase()]||a[M])&&(N=Zo({element:y,maskInputOptions:a,tagName:E,type:M,value:N,maskInputFn:l})),p(y,c?{text:N,isChecked:I,userTriggered:x}:{text:N,isChecked:I});let C=y.name;M==="radio"&&C&&I&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(V=>{if(V!==y){let Z=V.value;p(V,c?{text:Z,isChecked:!I,userTriggered:!1}:{text:Z,isChecked:!I})}})}function p(w,y){let x=yg.get(w);if(!x||x.text!==y.text||x.isChecked!==y.isChecked){yg.set(w,y);let E=r.getId(w);Y(e)({...y,id:E})}}let f=(u.input==="last"?["change"]:["input","change"]).map(w=>Fe(w,Y(d),t)),m=t.defaultView;if(!m)return()=>{f.forEach(w=>w())};let g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),S=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&f.push(...S.map(w=>Rs(w[0],w[1],{set(){Y(d)({target:this,isTrusted:!1})}},!1,m))),Y(()=>{f.forEach(w=>w())})}function cs(e){let t=[];function r(n,i){if(Uo("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Uo("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Uo("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Uo("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let s=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(s)}else if(n.parentStyleSheet){let s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(s)}return i}return r(e,t)}function Zt(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function _2({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Y((c,d,p)=>{let[h,f]=p,{id:m,styleId:g}=Zt(d,t,r.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,adds:[{rule:h,index:f}]}),c.apply(d,p)})}),n.CSSStyleSheet.prototype.addRule=function(c,d,p=this.cssRules.length){let h=`${c} { ${d} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[h,p])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Zt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,removes:[{index:h}]}),c.apply(d,p)})}),n.CSSStyleSheet.prototype.removeRule=function(c){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Zt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,replace:h}),c.apply(d,p)})}));let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Y((c,d,p)=>{let[h]=p,{id:f,styleId:m}=Zt(d,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,replaceSync:h}),c.apply(d,p)})}));let l={};Wo("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Wo("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Wo("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Wo("CSSSupportsRule")&&(l.CSSSupportsRule=n.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:Y((p,h,f)=>{let[m,g]=f,{id:S,styleId:w}=Zt(h.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||w&&w!==-1)&&e({id:S,styleId:w,adds:[{rule:m,index:[...cs(h),g||0]}]}),p.apply(h,f)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:Y((p,h,f)=>{let[m]=f,{id:g,styleId:S}=Zt(h.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,removes:[{index:[...cs(h),m]}]}),p.apply(h,f)})})}),Y(()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,d])=>{d.prototype.insertRule=u[c].insertRule,d.prototype.deleteRule=u[c].deleteRule})})}function pb({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(U.host(r));let a=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(o=(i=r.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(r,"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}}),Y(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function F2({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Y((a,l,u)=>{var c;let[d,p,h]=u;if(r.has(d))return o.apply(l,[d,p,h]);let{id:f,styleId:m}=Zt((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,set:{property:d,value:p,priority:h},index:cs(l.parentRule)}),a.apply(l,u)})});let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Y((a,l,u)=>{var c;let[d]=u;if(r.has(d))return s.apply(l,[d]);let{id:p,styleId:h}=Zt((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,remove:{property:d},index:cs(l.parentRule)}),a.apply(l,u)})}),Y(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}function j2({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){let s=Y(l=>ri(Y(u=>{let c=ai(u);if(!c||je(c,t,r,!0))return;let{currentTime:d,volume:p,muted:h,playbackRate:f,loop:m}=c;e({type:l,id:n.getId(c),currentTime:d,volume:p,muted:h,playbackRate:f,loop:m})}),i.media||500)),a=[Fe("play",s(Br.Play),o),Fe("pause",s(Br.Pause),o),Fe("seeked",s(Br.Seeked),o),Fe("volumechange",s(Br.VolumeChange),o),Fe("ratechange",s(Br.RateChange),o)];return Y(()=>{a.forEach(l=>l())})}function V2({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],i=new WeakMap,o=r.FontFace;r.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=Sr(t.fonts,"add",function(a){return function(l){return setTimeout(Y(()=>{let u=i.get(l);u&&(e(u),i.delete(l))}),0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=o}),n.push(s),Y(()=>{n.forEach(a=>a())})}function B2(e){let{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,s=!0,a=Y(()=>{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:h,startOffset:f,endContainer:m,endOffset:g}=p;je(h,n,i,!0)||je(m,n,i,!0)||u.push({start:r.getId(h),startOffset:f,end:r.getId(m),endOffset:g})}o({ranges:u})});return a(),Fe("selectionchange",a)}function U2({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:Sr(r.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 W2(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),i(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),o(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),s(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),a(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),l(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),u(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),c(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),p(...m)},e.selectionCb=(...m)=>{t.selection&&t.selection(...m),h(...m)},e.customElementCb=(...m)=>{t.customElement&&t.customElement(...m),f(...m)}}function z2(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};W2(e,t);let n;e.recordDOM&&(n=db(e,e.doc));let i=O2(e),o=N2(e),s=fb(e),a=L2(e,{win:r}),l=D2(e),u=j2(e),c=()=>{},d=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(c=_2(e,{win:r}),d=pb(e,e.doc),p=F2(e,{win:r}),e.collectFonts&&(h=V2(e)));let f=B2(e),m=U2(e),g=[];for(let S of e.plugins)g.push(S.observer(S.callback,r,S.options));return Y(()=>{mr.forEach(S=>S.reset()),n?.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),p(),h(),f(),m(),g.forEach(S=>S())})}function Uo(e){return typeof window[e]<"u"}function Wo(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ds=class{constructor(t){k(this,"iframeIdToRemoteIdMap",new WeakMap),k(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,i){let o=n||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=o.get(r);return a||(a=this.generateIdFn(),o.set(r,a),s.set(a,r)),a}getIds(t,r){let n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,i))}getRemoteId(t,r,n){let i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=i.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},ju=class{constructor(t){k(this,"iframes",new WeakMap),k(this,"crossOriginIframeMap",new WeakMap),k(this,"crossOriginIframeMirror",new ds(Ag)),k(this,"crossOriginIframeStyleMirror"),k(this,"crossOriginIframeRootIdMap",new WeakMap),k(this,"mirror"),k(this,"mutationCb"),k(this,"wrappedEmit"),k(this,"loadListener"),k(this,"stylesheetManager"),k(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ds(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,r){var n,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.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 r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let i=this.crossOriginIframeMap.get(t.source);if(!i)return;let o=this.transformCrossOriginEvent(i,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case H.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),{timestamp:r.timestamp,type:H.IncrementalSnapshot,data:{source:z.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case H.Meta:case H.Load:case H.DomContentLoaded:return!1;case H.Plugin:return r;case H.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case H.IncrementalSnapshot:switch(r.data.source){case z.Mutation:return r.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)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case z.Drag:case z.TouchMove:case z.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case z.ViewportResize:return!1;case z.MediaInteraction:case z.MouseInteraction:case z.Scroll:case z.CanvasMutation:case z.Input:return this.replaceIds(r.data,t,["id"]),r;case z.StyleSheetRule:case z.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case z.Font:return r;case z.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case z.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}return!1}replace(t,r,n,i){for(let o of i)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==ub.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}},Vu=class{constructor(t){k(this,"shadowDoms",new WeakSet),k(this,"mutationCb"),k(this,"scrollCb"),k(this,"bypassOptions"),k(this,"mirror"),k(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,r){if(!Gn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let n=db({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(fb({...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(U.host(t))),this.restoreHandlers.push(pb({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(Sr(t.prototype,"attachShadow",function(i){return function(o){let s=i.call(this,o),a=U.shadowRoot(this);return a&&lb(this)&&n.addShadowRoot(a,r),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},zr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",G2=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Wn=0;Wn<zr.length;Wn++)G2[zr.charCodeAt(Wn)]=Wn;var Wn,H2=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=zr[t[r]>>2],i+=zr[(t[r]&3)<<4|t[r+1]>>4],i+=zr[(t[r+1]&15)<<2|t[r+2]>>6],i+=zr[t[r+2]&63];return n%3===2?i=i.substring(0,i.length-1)+"=":n%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var bg=new Map;function q2(e,t){let r=bg.get(e);return r||(r=new Map,bg.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var hb=(e,t,r)=>{if(!e||!(gb(e,t)||typeof e=="object"))return;let n=e.constructor.name,i=q2(r,n),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Ko(e,t,r){if(e instanceof Array)return e.map(n=>Ko(n,t,r));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 n=e.constructor.name,i=H2(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ko(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",i=e.toDataURL();return{rr_type:n,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Ko(e.data,t,r),e.width,e.height]};if(gb(e,t)||typeof e=="object"){let n=e.constructor.name,i=hb(e,t,r);return{rr_type:n,index:i}}}}return e}var mb=(e,t,r)=>e.map(n=>Ko(n,t,r)),gb=(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 K2(e,t,r,n){let i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=Sr(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...u){return je(this.canvas,r,n,!0)||setTimeout(()=>{let c=mb(u,t,this);e(this.canvas,{type:Zr["2D"],property:s,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=Rs(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:Zr["2D"],property:s,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(s=>s())}}function Y2(e){return e==="experimental-webgl"?"webgl":e}function Sg(e,t,r,n){let i=[];try{let o=Sr(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!je(this,t,r,!0)){let u=Y2(a);if("__context"in this||(this.__context=u),n&&["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 wg(e,t,r,n,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=Sr(e,l,function(c){return function(...d){let p=c.apply(this,d);if(hb(p,o,this),"tagName"in this.canvas&&!je(this.canvas,n,i,!0)){let h=mb(d,o,this),f={type:t,property:l,args:h};r(this.canvas,f)}return p}});s.push(u)}catch{let u=Rs(e,l,{set(c){r(this.canvas,{type:t,property:l,args:[c],setter:!0})}});s.push(u)}return s}function J2(e,t,r,n){let i=[];return i.push(...wg(t.WebGLRenderingContext.prototype,Zr.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...wg(t.WebGL2RenderingContext.prototype,Zr.WebGL2,e,r,n,t)),()=>{i.forEach(o=>o())}}var yb="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Z2=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),vg=typeof window<"u"&&window.Blob&&new Blob([Z2(yb)],{type:"text/javascript;charset=utf-8"});function X2(e){let t;try{if(t=vg&&(window.URL||window.webkitURL).createObjectURL(vg),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;base64,"+yb,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var Bu=class{constructor(t){k(this,"pendingCanvasMutations",new Map),k(this,"rafStamps",{latestId:0,invokeId:null}),k(this,"mirror"),k(this,"mutationCb"),k(this,"resetObservers"),k(this,"frozen",!1),k(this,"locked",!1),k(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:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,i,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,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,r,n,i,o){let s=Sg(r,n,i,!0),a=new Map,l=new X2;l.onmessage=f=>{let{id:m}=f.data;if(a.set(m,!1),!("base64"in f.data))return;let{base64:g,type:S,width:w,height:y}=f.data;this.mutationCb({id:m,type:Zr["2D"],commands:[{property:"clearRect",args:[0,0,w,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:S}]},0,0]}]})};let u=1e3/t,c=0,d,p=()=>{let f=[];return r.document.querySelectorAll("canvas").forEach(m=>{je(m,n,i,!0)||f.push(m)}),f},h=f=>{if(c&&f-c<u){d=requestAnimationFrame(h);return}c=f,p().forEach(async m=>{var g;let S=this.mirror.getId(m);if(a.get(S)||m.width===0||m.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(m.__context)){let y=m.getContext(m.__context);((g=y?.getContextAttributes())==null?void 0:g.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let w=await createImageBitmap(m);l.postMessage({id:S,bitmap:w,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[w])}),d=requestAnimationFrame(h)};d=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Sg(t,r,n,!1),o=K2(this.processMutation.bind(this),t,r,n),s=J2(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let i=n.map(s=>{let{type:a,...l}=s;return l}),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}},Uu=class{constructor(t){k(this,"trackedLinkElements",new WeakSet),k(this,"mutationCb"),k(this,"adoptedStyleSheetCb"),k(this,"styleMirror",new $u),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,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:Eg(a,o.href),index:l}))})),n.styleIds.push(s)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Wu=class{constructor(){k(this,"nodeMap",new WeakMap),k(this,"active",!1)}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},we,Yo,eu,fs=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Rm=e.contentWindow)==null?void 0:Rm.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var st=tP();function wr(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,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:h,maskInputFn:f,maskTextFn:m,hooks:g,packFn:S,sampling:w={},dataURLOptions:y={},mousemoveWait:x,recordDOM:E=!0,recordCanvas:N=!1,recordCrossOriginIframes:I=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:C=!1,collectFonts:V=!1,inlineImages:Z=!1,plugins:X,keepIframeSrcFn:F=()=>!1,ignoreCSSAttributes:$e=new Set([]),errorHandler:ft}=e;T2(ft);let Ie=I?window.parent===window:!0,Je=!1;if(!Ie)try{window.parent.document&&(Je=!1)}catch{Je=!0}if(Ie&&!t)throw new Error("emit function is required");if(!Ie&&!Je)return()=>{};x!==void 0&&w.mousemove===void 0&&(w.mousemove=x),st.reset();let or=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},pt=Mg(h);E2();let Sf,na=0,wf=Q=>{for(let et of X||[])et.eventProcessor&&(Q=et.eventProcessor(Q));return S&&!Je&&(Q=S(Q)),Q};we=(Q,et)=>{var ye;let be=Q;if(be.timestamp=us(),(ye=mr[0])!=null&&ye.isFrozen()&&be.type!==H.FullSnapshot&&!(be.type===H.IncrementalSnapshot&&be.data.source===z.Mutation)&&mr.forEach(Ge=>Ge.unfreeze()),Ie)t?.(wf(be),et);else if(Je){let Ge={type:"rrweb",event:wf(be),origin:window.location.origin,isCheckout:et};window.parent.postMessage(Ge,"*")}if(be.type===H.FullSnapshot)Sf=be,na=0;else if(be.type===H.IncrementalSnapshot){if(be.data.source===z.Mutation&&be.data.isAttachIframe)return;na++;let Ge=n&&na>=n,oe=r&&be.timestamp-Sf.timestamp>r;(Ge||oe)&&Yo(!0)}};let Ii=Q=>{we({type:H.IncrementalSnapshot,data:{source:z.Mutation,...Q}})},vf=Q=>we({type:H.IncrementalSnapshot,data:{source:z.Scroll,...Q}}),xf=Q=>we({type:H.IncrementalSnapshot,data:{source:z.CanvasMutation,...Q}}),ix=Q=>we({type:H.IncrementalSnapshot,data:{source:z.AdoptedStyleSheet,...Q}}),sr=new Uu({mutationCb:Ii,adoptedStyleSheetCb:ix}),ar=new ju({mirror:st,mutationCb:Ii,stylesheetManager:sr,recordCrossOriginIframes:I,wrappedEmit:we});for(let Q of X||[])Q.getMirror&&Q.getMirror({nodeMirror:st,crossOriginIframeMirror:ar.crossOriginIframeMirror,crossOriginIframeStyleMirror:ar.crossOriginIframeStyleMirror});let ia=new Wu;eu=new Bu({recordCanvas:N,mutationCb:xf,win:window,blockClass:i,blockSelector:o,mirror:st,sampling:w.canvas,dataURLOptions:y});let Pi=new Vu({mutationCb:Ii,scrollCb:vf,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:or,dataURLOptions:y,maskTextFn:m,maskInputFn:f,recordCanvas:N,inlineImages:Z,sampling:w,slimDOMOptions:pt,iframeManager:ar,stylesheetManager:sr,canvasManager:eu,keepIframeSrcFn:F,processedNodeManager:ia},mirror:st});Yo=(Q=!1)=>{if(!E)return;we({type:H.Meta,data:{href:window.location.href,width:rb(),height:tb()}},Q),sr.reset(),Pi.init(),mr.forEach(ye=>ye.lock());let et=EP(document,{mirror:st,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:or,maskTextFn:m,maskInputFn:f,slimDOM:pt,dataURLOptions:y,recordCanvas:N,inlineImages:Z,onSerialize:ye=>{ob(ye,st)&&ar.addIframe(ye),sb(ye,st)&&sr.trackLinkElement(ye),Lu(ye)&&Pi.addShadowRoot(U.shadowRoot(ye),document)},onIframeLoad:(ye,be)=>{ar.attachIframe(ye,be),Pi.observeAttachShadow(ye)},onStylesheetLoad:(ye,be)=>{sr.attachLinkElement(ye,be)},keepIframeSrcFn:F});if(!et)return console.warn("Failed to snapshot the document");we({type:H.FullSnapshot,data:{node:et,initialOffset:eb(window)}},Q),mr.forEach(ye=>ye.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&sr.adoptStyleSheets(document.adoptedStyleSheets,st.getId(document))};try{let Q=[],et=be=>{var Ge;return Y(z2)({mutationCb:Ii,mousemoveCb:(oe,oa)=>we({type:H.IncrementalSnapshot,data:{source:oa,positions:oe}}),mouseInteractionCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.MouseInteraction,...oe}}),scrollCb:vf,viewportResizeCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.ViewportResize,...oe}}),inputCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.Input,...oe}}),mediaInteractionCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.MediaInteraction,...oe}}),styleSheetRuleCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.StyleSheetRule,...oe}}),styleDeclarationCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.StyleDeclaration,...oe}}),canvasMutationCb:xf,fontCb:oe=>we({type:H.IncrementalSnapshot,data:{source:z.Font,...oe}}),selectionCb:oe=>{we({type:H.IncrementalSnapshot,data:{source:z.Selection,...oe}})},customElementCb:oe=>{we({type:H.IncrementalSnapshot,data:{source:z.CustomElement,...oe}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:or,inlineStylesheet:c,sampling:w,recordDOM:E,recordCanvas:N,inlineImages:Z,userTriggeredOnInput:C,collectFonts:V,doc:be,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:F,blockSelector:o,slimDOMOptions:pt,dataURLOptions:y,mirror:st,iframeManager:ar,stylesheetManager:sr,shadowDomManager:Pi,processedNodeManager:ia,canvasManager:eu,ignoreCSSAttributes:$e,plugins:((Ge=X?.filter(oe=>oe.observer))==null?void 0:Ge.map(oe=>({observer:oe.observer,options:oe.options,callback:oa=>we({type:H.Plugin,data:{plugin:oe.name,payload:oa}})})))||[]},g)};ar.addLoadListener(be=>{try{Q.push(et(be.contentDocument))}catch(Ge){console.warn(Ge)}});let ye=()=>{Yo(),Q.push(et(document)),fs=!0};return["interactive","complete"].includes(document.readyState)?ye():(Q.push(Fe("DOMContentLoaded",()=>{we({type:H.DomContentLoaded,data:{}}),M==="DOMContentLoaded"&&ye()})),Q.push(Fe("load",()=>{we({type:H.Load,data:{}}),M==="load"&&ye()},window))),()=>{Q.forEach(be=>{try{be()}catch(Ge){String(Ge).toLowerCase().includes("cross-origin")||console.warn(Ge)}}),ia.destroy(),fs=!1,M2()}}catch(Q){console.warn(Q)}}wr.addCustomEvent=(e,t)=>{if(!fs)throw new Error("please add custom event after start recording");we({type:H.Custom,data:{tag:e,payload:t}})};wr.freezePage=()=>{mr.forEach(e=>e.freeze())};wr.takeFullSnapshot=e=>{if(!fs)throw new Error("please take full snapshot after start recording");Yo(e)};wr.mirror=st;var xg;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(xg||(xg={}));var Pz=5*1e3;var{addCustomEvent:Tz}=wr,{freezePage:Mz}=wr,{takeFullSnapshot:Oz}=wr;var wb="__ripploEmitRrwebEvent";function vb(){return{eventTypes:bb(H),incrementalSources:bb(z)}}function bb(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,r])=>[r,t]))}var e6=Vl("@ripplo/rrweb-bundle/bundle","rrweb.js"),Sb;function xb(){return Sb??=Q2(e6,{encoding:"utf8"}),Sb}async function hc({debugDir:e,writeOtlpPortFile:t}){let r=new Map,n=wm(vb()),i=await Va({localDir:Rb.join(Rb.dirname(e),".local"),writePortFile:t,onRrwebBatch:(a,l)=>{r.get(a)?.emitRrwebBatch(l)},onSpan:a=>{let l=a.attributes["ripplo.run"];l!=null&&r.get(l)?.emit(a)}}),o=await xb();return{attach:async(a,l)=>{let u=kp({debugDir:e,runId:l,worker:n});r.set(l,u),await xm(a,l),await a.addInitScript(`globalThis.__ripploCapturePort = ${String(i.port)};`),await r6(a,u);let c=[];return{emitAction:d=>{o6(u,d)},emitAssertion:d=>{s6(u,d)},finish:()=>n6(u,{pages:c,registry:r,runId:l}),onPage:d=>{c.push(d),i6(u,o,d)}}},close:async()=>{await i.stop(),await n.terminate()},injectSpan:(a,l)=>{r.get(a)?.emit(l)}}}async function t6(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function r6(e,t){await e.exposeBinding(wb,(r,n)=>{let i=typeof n=="string"?n:JSON.stringify(n);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}async function n6(e,t){await t6(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 i6(e,t,r){r.on("load",()=>{r.addScriptTag({content:t}).catch(()=>{})}),r.on("response",n=>{c6(e,n)}),r.on("console",n=>{e.emit({kind:"console",level:n.type(),source:"browser",text:n.text(),timeNanos:Mr(Date.now())})}),r.on("pageerror",n=>{e.emit({kind:"error",message:n.message,source:"browser",stack:n.stack,timeNanos:Mr(Date.now())})})}function o6(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:a6(t),timeNanos:Mr(Date.now()),value:l6(t)})}function s6(e,t){let r=jl(t);e.emit({kind:"assertion",label:r.label,outcome:t.outcome,source:"test",step:r.step,timeNanos:Mr(Date.now())})}function a6(e){if(e.url!=null)return e.url;if(e.locator!=null)return pc(e.locator)}function pc(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${pc(e.scope)} \u25B8 ${pc(e.target)}`:`${e.role} ${e.name??""}`.trim()}function l6(e){return e.value!=null?typeof e.value=="object"?JSON.stringify(e.value):String(e.value):e.key}var u6=/^http:\/\/127\.0\.0\.1:\d+\/rrweb\//;function c6(e,t){let r=t.request(),n=r.resourceType();if(n!=="fetch"&&n!=="xhr"||u6.test(r.url()))return;let i=r.headers().traceparent?.split("-");e.emit({kind:"network",method:r.method(),resourceType:n,source:"browser",spanId:i?.[2],status:t.status(),timeNanos:Mr(Date.now()),traceId:i?.[1],url:t.url()})}import{err as j0,ok as Gd,ResultAsync as S8}from"neverthrow";function mc(e){return{invariants:Sl(e),laws:gl(e)}}var kb=Object.defineProperty,Eb=(e,t)=>{let r={};for(var n in e)kb(r,n,{get:e[n],enumerable:!0});return t||kb(r,Symbol.toStringTag,{value:"Module"}),r};var d6=class Cb{constructor(t){this.seed=t}clone(){return new Cb(this.seed)}next(){let t=gc(this.seed),r=yc(t),n=gc(t),i=yc(n);return this.seed=gc(n),yc(this.seed)+(i+(r<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function gc(e){return Math.imul(e,214013)+2531011&4294967295}function yc(e){return(e&-2147483649)>>16}function Ab(e){return new d6(e)}var f6="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",p6=class Pb{constructor(t,r){this.states=t,this.index=r}clone(){return new Pb(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=ks(this.states,this.index),t}getState(){return[this.index,...this.states]}jump(){let t=this.states.slice(),r=this.index;this.index=ks(this.states,this.index);for(let n=19932;n>0;--n)f6.charCodeAt(n/6|0)-48&1<<n%6&&Ib(this.states,this.index,t,r),this.index=ks(this.states,this.index);Ib(this.states,this.index,t,r)}};function Ib(e,t,r,n){let i=0;if(n>=t){for(;i<624-n;i++)e[i+t]^=r[i+n];for(;i<624-t;i++)e[i+t]^=r[i+n-624];for(;i<624;i++)e[i+t-624]^=r[i+n-624]}else{for(;i<624-t;i++)e[i+t]^=r[i+n];for(;i<624-n;i++)e[i+t-624]^=r[i+n];for(;i<624;i++)e[i+t-624]^=r[i+n-624]}}function ks(e,t){if(t<227){let r=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397]^r>>>1^-(r&1)&2567483615,t+1}else if(t<623){let r=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397-624]^r>>>1^-(r&1)&2567483615,t+1}else{let r=e[t]&2147483648|e[0]&2147483647;return e[t]=e[396]^r>>>1^-(r&1)&2567483615,0}}function h6(e){for(let t=0;t!==624;++t)ks(e,t)}function Tb(e){let t=[e|0];for(let r=1;r!==624;++r){let n=t[r-1]^t[r-1]>>>30;t.push(Math.imul(1812433253,n)+r|0)}return h6(t),new p6(t,0)}var m6=class Mb{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new Mb(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00^this.s00<<23,r=this.s01^(this.s01<<23|this.s00>>>9),n=t^this.s10^(t>>>18|r<<14)^(this.s10>>>5|this.s11<<27),i=r^this.s11^r>>>18^this.s11>>>5,o=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=i,this.s10=n,o}jump(){let t=0,r=0,n=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,r^=this.s00,n^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=r,this.s11=n,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function bc(e){return new m6(-1,~e,e|0,0)}var g6=class Ob{constructor(t,r,n,i){this.s01=t,this.s00=r,this.s11=n,this.s10=i}clone(){return new Ob(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00+this.s10|0,r=this.s10^this.s00,n=this.s11^this.s01,i=this.s00,o=this.s01;return this.s00=i<<24^o>>>8^r^r<<16,this.s01=o<<24^i>>>8^n^(n<<16|r>>>16),this.s10=n<<5^r>>>27,this.s11=r<<5^n>>>27,t}jump(){let t=0,r=0,n=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,r^=this.s00,n^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=r,this.s11=n,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Nb(e){return new g6(-1,~e,e|0,0)}function Lb(e,t){for(let r=0;r!==t;++r)e.next()}var $b=BigInt,y6=4294967296n;function _b(e,t,r){let n=r-t+1n,i=y6,o=1;for(;i<n;)i<<=32n,++o;let s=Db(o,e);if(s<n)return s+t;if(s+n<i)return s%n+t;let a=i-i%n;for(;s>=a;)s=Db(o,e);return s%n+t}function Db(e,t){let r=$b(t.next()+2147483648);for(let n=1;n<e;++n){let i=t.next();r=(r<<32n)+$b(i+2147483648)}return r}function li(e,t){let r=t>2?~~(4294967296/t)*t:4294967296,n=e.next()+2147483648;for(;n>=r;)n=e.next()+2147483648;return n%t}function Sc(e,t){if(t<0){let r=-t;e.sign=-1,e.data[0]=~~(r/4294967296),e.data[1]=r>>>0}else e.sign=1,e.data[0]=~~(t/4294967296),e.data[1]=t>>>0;return e}function b6(e,t,r){let n=t.data[1],i=t.data[0],o=t.sign,s=r.data[1],a=r.data[0],l=r.sign;if(e.sign=1,o===1&&l===-1){let m=n+s,g=i+a+(m>4294967295?1:0);return e.data[0]=g>>>0,e.data[1]=m>>>0,e}let u=n,c=i,d=s,p=a;o===-1&&(u=s,c=a,d=n,p=i);let h=0,f=u-d;return f<0&&(h=1,f=f>>>0),e.data[0]=c-p-h,e.data[1]=f,e}function S6(e,t,r){let n=r[0]+1;for(t[0]=li(e,n),t[1]=li(e,4294967296);t[0]>=r[0]&&(t[0]!==r[0]||t[1]>=r[1]);)t[0]=li(e,n),t[1]=li(e,4294967296);return t}var w6=Number.MAX_SAFE_INTEGER,v6={sign:1,data:[0,0]},x6={sign:1,data:[0,0]},Fb={sign:1,data:[0,0]},wc=[0,0];function R6(e,t,r,n){let i=n<=w6?Sc(Fb,n):b6(Fb,Sc(v6,r),Sc(x6,t));return i.data[1]===4294967295?(i.data[0]+=1,i.data[1]=0):i.data[1]+=1,S6(e,wc,i.data),wc[0]*4294967296+wc[1]+t}function Es(e,t,r){let n=r-t;return n<=4294967295?li(e,n+1)+t:R6(e,t,r,n)}var jb=Symbol.for("fast-check/PreconditionFailure"),ir=class extends Error{constructor(e=!1){super(),this.interruptExecution=e,this.footprint=jb}static isFailure(e){return e!=null&&e.footprint===jb}};function k6(e){if(!e)throw new ir}var E6=class{[Symbol.iterator](){return this}next(e){return{value:e,done:!0}}},C6=new E6;function A6(){return C6}function*I6(e,t){for(let r of e)yield t(r)}function*P6(e,t){for(let r of e)yield*t(r)}function*T6(e,t){for(let r of e)t(r)&&(yield r)}function*M6(e,t){for(let r=0;r<t;++r){let n=e.next();if(n.done)break;yield n.value}}function*O6(e,t){let r=e.next();for(;!r.done&&t(r.value);)yield r.value,r=e.next()}function*N6(e,t){for(let r=e.next();!r.done;r=e.next())yield r.value;for(let r of t)for(let n=r.next();!n.done;n=r.next())yield n.value}var L6=Symbol.iterator,j=class Lt{static nil(){return new Lt(A6())}static of(...t){return new Lt(t[L6]())}constructor(t){this.g=t}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(t){return new Lt(I6(this.g,t))}flatMap(t){return new Lt(P6(this.g,t))}dropWhile(t){let r=!1;function*n(i){(r||!t(i))&&(r=!0,yield i)}return this.flatMap(n)}drop(t){if(t<=0)return this;let r=0;function n(){return r++<t}return this.dropWhile(n)}takeWhile(t){return new Lt(O6(this.g,t))}take(t){return new Lt(M6(this.g,t))}filter(t){return new Lt(T6(this.g,t))}every(t){for(let r of this.g)if(!t(r))return!1;return!0}has(t){for(let r of this.g)if(t(r))return[!0,r];return[!1,null]}join(...t){return new Lt(N6(this.g,t))}getNthOrLast(t){let r=t,n=null;for(let i of this.g){if(r--===0)return i;n=i}return n}};function rr(e){return new j(e)}var Me=Symbol.for("fast-check/cloneMethod");function xr(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Me in e&&typeof e[Me]=="function"}function rn(e){return xr(e)?e[Me]():e}var $6=Object.defineProperty,_=class{constructor(e,t,r){this.value_=e,this.context=t,this.hasToBeCloned=r!==void 0||xr(e),this.readOnce=!1,this.value=e,this.hasToBeCloned&&$6(this,"value",{get:r!==void 0?r:this.getValue,enumerable:!1,configurable:!1})}getValue(){return this.hasToBeCloned?this.readOnce?this.value_[Me]():(this.readOnce=!0,this.value_):this.value_}},de=class{filter(e){return new F6(this,e)}map(e,t){return new _6(this,e,t)}chain(e){return new D6(this,e)}},D6=class extends de{constructor(e,t){super(),this.arb=e,this.chainer=t}generate(e,t){let r=e.clone(),n=this.arb.generate(e,t);return this.valueChainer(n,e,r,t)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?(t.stoppedForOriginal?j.nil():this.arb.shrink(t.originalValue,t.originalContext).map(r=>this.valueChainer(r,t.clonedMrng.clone(),t.clonedMrng,t.originalBias))).join(t.chainedArbitrary.shrink(e,t.chainedContext).map(r=>{let n={...t,chainedContext:r.context,stoppedForOriginal:!0};return new _(r.value_,n)})):j.nil()}valueChainer(e,t,r,n){let i=this.chainer(e.value_),o=i.generate(t,n),s={originalBias:n,originalValue:e.value_,originalContext:e.context,stoppedForOriginal:!1,chainedArbitrary:i,chainedContext:o.context,clonedMrng:r};return new _(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}},_6=class extends de{constructor(e,t,r){super(),this.arb=e,this.mapper=t,this.unmapper=r,this.bindValueMapper=n=>this.valueMapper(n)}generate(e,t){let r=this.arb.generate(e,t);return this.valueMapper(r)}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 r=this.unmapper(e);return this.arb.shrink(r,void 0).map(this.bindValueMapper)}return j.nil()}mapperWithCloneIfNeeded(e){let t=e.value,r=this.mapper(t);return e.hasToBeCloned&&(typeof r=="object"&&r!==null||typeof r=="function")&&Object.isExtensible(r)&&!xr(r)&&Object.defineProperty(r,Me,{get:()=>()=>this.mapperWithCloneIfNeeded(e)[0]}),[r,t]}valueMapper(e){let[t,r]=this.mapperWithCloneIfNeeded(e);return new _(t,{originalValue:r,originalContext:e.context})}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalValue"in e&&"originalContext"in e}},F6=class extends de{constructor(e,t){super(),this.arb=e,this.refinement=t,this.bindRefinementOnValue=r=>this.refinementOnValue(r)}generate(e,t){for(;;){let r=this.arb.generate(e,t);if(this.refinementOnValue(r))return r}}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 jw(e){return typeof e=="object"&&e!==null&&"generate"in e&&"shrink"in e&&"canShrinkWithoutContext"in e}function Vw(e){if(!jw(e))throw new Error("Unexpected value received: not an instance of Arbitrary")}var Bw=Function.prototype.apply,vc=Symbol("apply");function j6(e){try{return e.apply}catch{return}}function V6(e,t,r){let n=e;n[vc]=Bw;let i=n[vc](t,r);return delete n[vc],i}function q(e,t,r){return j6(e)===Bw?e.apply(t,r):V6(e,t,r)}var Uw=Array,O=BigInt,B6=BigInt64Array,U6=BigUint64Array,Ww=Boolean,Vs=Date,L=Error,zw=Float32Array,Gw=Float64Array,W6=Int8Array,z6=Int16Array,G6=Int32Array,Dt=Number,Ve=String,nn=Set,H6=Uint8Array,q6=Uint8ClampedArray,K6=Uint16Array,Y6=Uint32Array,J6=encodeURIComponent,_t=Map,Ns=Symbol,Vb=Array.prototype.forEach,Bb=Array.prototype.indexOf,Ub=Array.prototype.join,Wb=Array.prototype.map,zb=Array.prototype.flat,Gb=Array.prototype.filter,Hb=Array.prototype.push,qb=Array.prototype.pop,Kb=Array.prototype.splice,Yb=Array.prototype.slice,Jb=Array.prototype.sort,Zb=Array.prototype.every;function Z6(e){try{return e.forEach}catch{return}}function X6(e){try{return e.indexOf}catch{return}}function Q6(e){try{return e.join}catch{return}}function e4(e){try{return e.map}catch{return}}function t4(e){try{return e.flat}catch{return}}function r4(e){try{return e.filter}catch{return}}function n4(e){try{return e.push}catch{return}}function i4(e){try{return e.pop}catch{return}}function o4(e){try{return e.splice}catch{return}}function s4(e){try{return e.slice}catch{return}}function a4(e){try{return e.sort}catch{return}}function l4(e){try{return e.every}catch{return}}function Hw(e,t){return Z6(e)===Vb?e.forEach(t):q(Vb,e,[t])}function $t(e,...t){return X6(e)===Bb?e.indexOf(...t):q(Bb,e,t)}function ce(e,...t){return Q6(e)===Ub?e.join(...t):q(Ub,e,t)}function G(e,t){return e4(e)===Wb?e.map(t):q(Wb,e,[t])}function u4(e,t){return t4(e)===zb?([].flat(),e.flat(t)):q(zb,e,[t])}function c4(e,t){return r4(e)===Gb?e.filter(t):q(Gb,e,[t])}function $(e,...t){return n4(e)===Hb?e.push(...t):q(Hb,e,t)}function qw(e){return i4(e)===qb?e.pop():q(qb,e,[])}function Kw(e,...t){return o4(e)===Kb?e.splice(...t):q(Kb,e,t)}function Le(e,...t){return s4(e)===Yb?e.slice(...t):q(Yb,e,t)}function Yw(e,...t){return a4(e)===Jb?e.sort(...t):q(Jb,e,t)}function Jw(e,...t){return l4(e)===Zb?e.every(...t):q(Zb,e,t)}var Xb=Date.prototype.getTime,Qb=Date.prototype.toISOString;function d4(e){try{return e.getTime}catch{return}}function f4(e){try{return e.toISOString}catch{return}}function Bs(e){return d4(e)===Xb?e.getTime():q(Xb,e,[])}function p4(e){return f4(e)===Qb?e.toISOString():q(Qb,e,[])}var eS=Set.prototype.add,tS=Set.prototype.has;function h4(e){try{return e.add}catch{return}}function m4(e){try{return e.has}catch{return}}function pi(e,t){return h4(e)===eS?e.add(t):q(eS,e,[t])}function Us(e,t){return m4(e)===tS?e.has(t):q(tS,e,[t])}var rS=WeakMap.prototype.set,nS=WeakMap.prototype.get;function g4(e){try{return e.set}catch{return}}function y4(e){try{return e.get}catch{return}}function b4(e,t,r){return g4(e)===rS?e.set(t,r):q(rS,e,[t,r])}function S4(e,t){return y4(e)===nS?e.get(t):q(nS,e,[t])}var iS=Map.prototype.set,oS=Map.prototype.get,sS=Map.prototype.has;function w4(e){try{return e.set}catch{return}}function v4(e){try{return e.get}catch{return}}function x4(e){try{return e.has}catch{return}}function ut(e,t,r){return w4(e)===iS?e.set(t,r):q(iS,e,[t,r])}function Ye(e,t){return v4(e)===oS?e.get(t):q(oS,e,[t])}function R4(e,t){return x4(e)===sS?e.has(t):q(sS,e,[t])}var aS=String.prototype.split,lS=String.prototype.startsWith,uS=String.prototype.endsWith,cS=String.prototype.substring,dS=String.prototype.toLowerCase,fS=String.prototype.toUpperCase,pS=String.prototype.padStart,hS=String.prototype.charCodeAt,mS=String.prototype.normalize,gS=String.prototype.replace;function k4(e){try{return e.split}catch{return}}function E4(e){try{return e.startsWith}catch{return}}function C4(e){try{return e.endsWith}catch{return}}function A4(e){try{return e.substring}catch{return}}function I4(e){try{return e.toLowerCase}catch{return}}function P4(e){try{return e.toUpperCase}catch{return}}function T4(e){try{return e.padStart}catch{return}}function M4(e){try{return e.charCodeAt}catch{return}}function O4(e){try{return e.normalize}catch{return}}function N4(e){try{return e.replace}catch{return}}function Be(e,...t){return k4(e)===aS?e.split(...t):q(aS,e,t)}function L4(e,...t){return E4(e)===lS?e.startsWith(...t):q(lS,e,t)}function $4(e,...t){return C4(e)===uS?e.endsWith(...t):q(uS,e,t)}function ge(e,...t){return A4(e)===cS?e.substring(...t):q(cS,e,t)}function Hc(e){return I4(e)===dS?e.toLowerCase():q(dS,e,[])}function bd(e){return P4(e)===fS?e.toUpperCase():q(fS,e,[])}function D4(e,...t){return T4(e)===pS?e.padStart(...t):q(pS,e,t)}function on(e,t){return M4(e)===hS?e.charCodeAt(t):q(hS,e,[t])}function _4(e,t){return O4(e)===mS?e.normalize(t):q(mS,e,[t])}function F4(e,t,r){return N4(e)===gS?e.replace(t,r):q(gS,e,[t,r])}var yS=Number.prototype.toString;function j4(e){try{return e.toString}catch{return}}function hi(e,...t){return j4(e)===yS?e.toString(...t):q(yS,e,t)}var V4=Object.prototype.hasOwnProperty,B4=Object.prototype.toString;function Zw(e,t){return q(V4,e,[t])}function qc(e){return q(B4,e,[])}var U4=Error.prototype.toString;function W4(e){return q(U4,e,[])}var z4=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 tr(e){return new z4(e)}var Xw=Array.isArray,G4=Object.defineProperty;function Qw(e,t){return G4(e,Me,{value:()=>{let r=[];for(let n=0;n!==t.length;++n)$(r,t[n].value);return Qw(r,t),r}})}function e1(e){let t=!1,r=[],n=[];for(let i=0;i!==e.length;++i){let o=e[i];t=t||o.hasToBeCloned,$(r,o.value),$(n,o.context)}return t&&Qw(r,e),new _(r,n)}function t1(e,t,r){let n=[],i=Xw(r)?r:[];for(let o=0;o!==e.length;++o)$(n,tr(()=>e[o].shrink(t[o],i[o]).map(s=>{let a=G(t,(l,u)=>new _(rn(l),i[u]));return[...Le(a,0,o),s,...Le(a,o+1)]}).map(e1)));return j.nil().join(...n)}var H4=class extends de{constructor(e){super(),this.arbs=e;for(let t=0;t!==e.length;++t){let r=e[t];if(r==null||r.generate===null||r.generate===void 0)throw new Error(`Invalid parameter encountered at index ${t}: expecting an Arbitrary`)}}generate(e,t){let r=[];for(let n=0;n!==this.arbs.length;++n)$(r,this.arbs[n].generate(e,t));return e1(r)}canShrinkWithoutContext(e){if(!Xw(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 t1(this.arbs,e,t)}};function B(...e){return new H4(e)}var q4=Math.log;function r1(e){return 2+~~(q4(e+1)*.4342944819032518)}var Sd={};function K4(e){Sd=e}function ct(){return Sd}function Y4(){Sd={}}var mi=Symbol("UndefinedContextPlaceholder");function sn(e){return e.context!==void 0?e:e.hasToBeCloned?new _(e.value_,mi,()=>e.value):new _(e.value_,mi)}var bS=()=>{},J4=class{constructor(e,t){this.arb=e,this.predicate=t;let{asyncBeforeEach:r,asyncAfterEach:n,beforeEach:i,afterEach:o}=ct()||{};if(r!==void 0&&i!==void 0)throw L(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if(n!==void 0&&o!==void 0)throw L(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=r||i||bS,this.afterEachHook=n||o||bS}isAsync(){return!0}generate(e,t){return sn(this.arb.generate(e,t!==void 0?r1(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return j.nil();let t=e.context!==mi?e.context:void 0;return this.arb.shrink(e.value_,t).map(sn)}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 L("Property failed by returning false")}}catch(t){return ir.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}},n1=class extends de{constructor(e){super(),this.arb=e}generate(e,t){return sn(this.arb.generate(e,t))}canShrinkWithoutContext(e){return!0}shrink(e,t){if(t===void 0&&!this.arb.canShrinkWithoutContext(e))return j.nil();let r=t!==mi?t:void 0;return this.arb.shrink(e,r).map(sn)}};function Z4(...e){if(e.length<2)throw new Error("asyncProperty expects at least two parameters");let t=Le(e,0,e.length-1),r=e[e.length-1];return Hw(t,Vw),new J4(B(...G(t,n=>new n1(n))),n=>r(...n))}var SS=()=>{},i1=class{constructor(e,t){this.arb=e,this.predicate=t;let{beforeEach:r=SS,afterEach:n=SS,asyncBeforeEach:i,asyncAfterEach:o}=ct()||{};if(i!==void 0)throw L(`"asyncBeforeEach" can't be set when running synchronous properties`);if(o!==void 0)throw L(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=r,this.afterEachHook=n}isAsync(){return!1}generate(e,t){return sn(this.arb.generate(e,t!==void 0?r1(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return j.nil();let t=e.context!==mi?e.context:void 0;return this.arb.shrink(e.value_,t).map(sn)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(e){try{let t=this.predicate(e);return t===void 0||t===!0?null:{error:new L("Property failed by returning false")}}catch(t){return ir.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 X4(...e){if(e.length<2)throw new Error("property expects at least two parameters");let t=Le(e,0,e.length-1),r=e[e.length-1];return Hw(t,Vw),new i1(B(...G(t,n=>new n1(n))),n=>r(...n))}var Q4=(function(e){return e[e.None=0]="None",e[e.Verbose=1]="Verbose",e[e.VeryVerbose=2]="VeryVerbose",e})({});function Kc(e){return"unsafeNext"in e?e.unsafeJump===void 0?{clone:()=>Kc(e),next:()=>e.unsafeNext(),getState:()=>e.getState()}:{clone:()=>Kc(e),next:()=>e.unsafeNext(),jump:()=>e.unsafeJump(),getState:()=>e.getState()}:e}function o1(e){return"jump"in e&&typeof e.jump=="function"?e:{clone:()=>o1(e),next:()=>e.next(),jump:()=>Lb(e,42),getState:()=>e.getState()}}function Hs(e){return o1(Kc(e))}var eN=Date.now,tN=Math.min,rN=Math.random,nN=class{constructor(e){let t=e||{};this.seed=iN(t),this.randomType=oN(t),this.numRuns=sN(t),this.verbose=aN(t),this.maxSkipsPerRun=t.maxSkipsPerRun!==void 0?t.maxSkipsPerRun:100,this.timeout=Rc(t.timeout),this.skipAllAfterTimeLimit=Rc(t.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=Rc(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:r=>{console.log(r)},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 xc(e){return t=>Hs(e(t))}function iN(e){if(e.seed===void 0)return eN()^rN()*4294967296;let t=e.seed|0;return e.seed===t?t:t^(e.seed-t)*4294967296}function oN(e){if(e.randomType===void 0)return bc;if(typeof e.randomType=="string")switch(e.randomType){case"mersenne":return xc(Tb);case"congruential":case"congruential32":return xc(Ab);case"xorshift128plus":return bc;case"xoroshiro128plus":return Nb;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===Hs(t)?e.randomType:xc(e.randomType)}function sN(e){return e.numRuns!==void 0?e.numRuns:e.num_runs!==void 0?e.num_runs:100}function aN(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 Rc(e){if(e!==void 0)return tN(e,2147483647)}function wd(e){return new nN(e)}function lN(e,t,r){let n=null;return{clear:()=>r(n),promise:new Promise(i=>{n=t(()=>{i(new ir(!0))},e)})}}var wS=class{constructor(e,t,r,n,i,o){this.property=e,this.getTime=t,this.interruptExecution=n,this.setTimeoutSafe=i,this.clearTimeoutSafe=o,this.skipAfterTime=this.getTime()+r}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 r=new ir(this.interruptExecution);return this.isAsync()?Promise.resolve(r):r}if(this.interruptExecution&&this.isAsync()){let r=lN(t,this.setTimeoutSafe,this.clearTimeoutSafe),n=Promise.race([this.property.run(e),r.promise]);return n.then(r.clear,r.clear),n}return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},uN=(e,t,r)=>{let n=null;return{clear:()=>r(n),promise:new Promise(i=>{n=t(()=>{i({error:new L(`Property timeout: exceeded limit of ${e} milliseconds`)})},e)})}},cN=class{constructor(e,t,r,n){this.property=e,this.timeMs=t,this.setTimeoutSafe=r,this.clearTimeoutSafe=n}isAsync(){return!0}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}async run(e){let t=uN(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),r=Promise.race([this.property.run(e),t.promise]);return r.then(t.clear,t.clear),r}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},s1=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()}},vS=Array.from,xS=typeof Buffer<"u"?Buffer.isBuffer:void 0,Xr=JSON.stringify,RS=Number.isNaN,dN=Object.keys,fN=Object.getOwnPropertySymbols,pN=Object.getOwnPropertyDescriptor,kS=Object.getPrototypeOf,ES=Number.NEGATIVE_INFINITY,hN=Number.POSITIVE_INFINITY,dt=Symbol.for("fast-check/toStringMethod");function vd(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&dt in e&&typeof e[dt]=="function"}var Ft=Symbol.for("fast-check/asyncToStringMethod");function xd(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Ft in e&&typeof e[Ft]=="function"}var mN=/^Symbol\((.*)\)$/;function gN(e){if(e.description!==void 0)return e.description;let t=mN.exec(Ve(e));return t&&t[1].length?t[1]:null}function CS(e){switch(e){case 0:return 1/e===ES?"-0":"0";case ES:return"Number.NEGATIVE_INFINITY";case hN:return"Number.POSITIVE_INFINITY";default:return e===e?Ve(e):"Number.NaN"}}function yN(e){let t=-1;for(let r in e){let n=Number(r);if(n!==t+1)return!0;t=n}return t+1!==e.length}function Ke(e,t,r){let n=[...t,e];if(typeof e=="object"&&$t(t,e)!==-1)return"[cyclic]";if(xd(e)){let i=r(e);if(i.state==="fulfilled")return i.value}if(vd(e))try{return e[dt]()}catch{}switch(qc(e)){case"[object Array]":{let i=e;if(i.length>=50&&yN(i)){let s=[];for(let a in i)RS(Number(a))||$(s,`${a}:${Ke(i[a],n,r)}`);return s.length!==0?`Object.assign(Array(${i.length}),{${ce(s,",")}})`:`Array(${i.length})`}let o=ce(G(i,s=>Ke(s,n,r)),",");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 RS(Bs(i))?"new Date(NaN)":`new Date(${Xr(p4(i))})`}case"[object Map]":return`new Map(${Ke(Array.from(e),n,r)})`;case"[object Null]":return"null";case"[object Number]":return typeof e=="number"?CS(e):`new Number(${CS(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"?`[${Ke(o,n,r)}]`:Xr(o)}:${Ke(e[o],n,r)}`;return"{"+ce([...kS(e)===null?["__proto__:null"]:[],...G(dN(e),i),...G(c4(fN(e),o=>{let s=pN(e,o);return s&&s.enumerable}),i)],",")+"}"}case"[object Set]":return`new Set(${Ke(Array.from(e),n,r)})`;case"[object String]":return typeof e=="string"?Xr(e):`new String(${Xr(e)})`;case"[object Symbol]":{let i=e;if(Ns.keyFor(i)!==void 0)return`Symbol.for(${Xr(Ns.keyFor(i))})`;let o=gN(i);return o===null?"Symbol()":i===(o.startsWith("Symbol.")&&Ns[o.substring(7)])?o:`Symbol(${Xr(o)})`}case"[object Promise]":{let i=r(e);switch(i.state){case"fulfilled":return`Promise.resolve(${Ke(i.value,n,r)})`;case"rejected":return`Promise.reject(${Ke(i.value,n,r)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(e instanceof Error)return`new Error(${Ke(e.message,n,r)})`;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 xS=="function"&&xS(e))return`Buffer.from(${e.buffer.detached?"/*detached ArrayBuffer*/":Ke(vS(e.values()),n,r)})`;let i=kS(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(${Ke(vS(s.values()),n,r)})`}break}}try{return e.toString()}catch{return qc(e)}}function xe(e){return Ke(e,[],()=>({state:"unknown",value:void 0}))}function a1(e){let t=Ns(),r=[],n=new _t;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(n.has(c))return n.get(c);let d=i(),p=Ft in u?Promise.resolve().then(()=>u[Ft]()):u;return p.catch(()=>{}),r.push(Promise.race([p,d.delay]).then(h=>{h===t?n.set(c,{state:"pending",value:void 0}):n.set(c,{state:"fulfilled",value:h}),d.cancel()},h=>{n.set(c,{state:"rejected",value:h}),d.cancel()})),n.set(c,o),o};function a(){let l=Ke(e,[],s);return r.length===0?l:Promise.all(r.splice(0)).then(a)}return a()}async function Rd(e){return Promise.resolve(a1(e))}function AS(e){return e===null?new ir:e}function bN(...e){return e[1]?e[0].then(AS):AS(e[0])}function SN(e,t){return bN(e,t)}var IS=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=xe(e);if(this.coveredCases.has(t)){let n=this.coveredCases.get(t);return this.skipRuns?SN(n,this.property.isAsync()):n}let r=this.property.run(e);return this.coveredCases.set(t,r),r}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},PS=Date.now,kc=setTimeout,Ec=clearTimeout;function wN(e,t){let r=e;return e.isAsync()&&t.timeout!==void 0&&(r=new cN(r,t.timeout,kc,Ec)),t.unbiased&&(r=new s1(r)),t.skipAllAfterTimeLimit!==void 0&&(r=new wS(r,PS,t.skipAllAfterTimeLimit,!1,kc,Ec)),t.interruptAfterTimeLimit!==void 0&&(r=new wS(r,PS,t.interruptAfterTimeLimit,!0,kc,Ec)),t.skipEqualValues&&(r=new IS(r,!0)),t.ignoreEqualValues&&(r=new IS(r,!1)),r}var vN=(function(e){return e[e.Success=0]="Success",e[e.Skipped=-1]="Skipped",e[e.Failure=1]="Failure",e})({}),xN=class l1{constructor(t,r){this.verbosity=t,this.interruptedAsFailure=r,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(t,r){let n={status:t,value:r,children:[]};return this.currentLevelExecutionTrees.push(n),n}fail(t,r,n){if(this.verbosity>=1){let i=this.appendExecutionTree(1,t);this.currentLevelExecutionTrees=i.children}this.pathToFailure===void 0?this.pathToFailure=`${r}`:this.pathToFailure+=`:${r}`,this.value=t,this.failure=n}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?+Be(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?Be(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let t=[],r=this.rootExecutionTrees;for(;r.length>0&&r[r.length-1].status===1;){let n=r[r.length-1];t.push(n.value),r=n.children}return t}static mergePaths(t,r){if(t.length===0)return r;let n=t.split(":"),i=r.split(":"),o=+n[n.length-1]+ +i[0];return[...n.slice(0,n.length-1),`${o}`,...i.slice(1)].join(":")}toRunDetails(t,r,n,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:l1.mergePaths(r,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>n||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()}}},u1=class{constructor(e,t,r,n){this.sourceValues=e,this.shrink=t,this.runExecution=new xN(r,n),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"&&!ir.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_)}},RN=class{constructor(e,t,r){this.initialValues=e,this.maxInitialIterations=t,this.remainingSkips=r}[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}},kN=-2147483648,EN=2147483647,CN=Math.pow(2,27),AN=Math.pow(2,-53),kd=class c1{constructor(t){this.internalRng=Hs(t.clone())}clone(){return new c1(this.internalRng)}next(t){return Es(this.internalRng,0,(1<<t)-1)}nextBoolean(){return Es(this.internalRng,0,1)===1}nextInt(t,r){return Es(this.internalRng,t===void 0?kN:t,r===void 0?EN:r)}nextBigInt(t,r){return _b(this.internalRng,t,r)}nextDouble(){let t=this.next(26),r=this.next(27);return(t*CN+r)*AN}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState=="function")return this.internalRng.getState()}};function IN(e,t,r){return t.jump(),e.generate(new kd(t),r)}function*d1(e,t,r,n){for(let i=0;i!==n.length;++i)yield new _(n[i],void 0);for(let i=0,o=r(t);;++i)yield IN(e,o,i)}function PN(e,t,r){return()=>e.generate(new kd(t),r)}function*f1(e,t,r,n){yield*G(n,s=>()=>new _(s,void 0));let i=0,o=Hs(r(t));for(;;)o.jump(),yield PN(e,o,i++)}function TS(e){return e()}function p1(e,t,r){let n=t,i=e.split(":").map(s=>+s);if(i.length===0)return n.map(TS);if(!i.every(s=>!Number.isNaN(s)))throw new Error(`Unable to replay, got invalid path=${e}`);let o=n.drop(i[0]).map(TS);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=r(a).drop(s)}return o}var TN=Object.assign;function MN(e){return e.length===1?`Hint: ${e[0]}`:e.map((t,r)=>`Hint (${r+1}): ${t}`).join(`
|
|
100
|
+
`)}function ON(e,t){return`Encountered failures were:
|
|
101
101
|
- ${e.map(t).join(`
|
|
102
|
-
- `)}`}function
|
|
102
|
+
- `)}`}function Ed(e,t){let r=[],n=[];for(let i=e.length-1;i>=0;--i)n.push({depth:1,tree:e[i]});for(;n.length!==0;){let i=n.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):"";r.push(`${l}${a} ${t(o.value)}`);for(let u=o.children.length-1;u>=0;--u)n.push({depth:s+1,tree:o.children[u]})}return`Execution summary:
|
|
103
103
|
${r.join(`
|
|
104
|
-
`)}`}function
|
|
104
|
+
`)}`}function NN(e,t){let r=`Failed to run property, too many pre-condition failures encountered
|
|
105
105
|
{ seed: ${e.seed} }
|
|
106
106
|
|
|
107
107
|
Ran ${e.numRuns} time(s)
|
|
108
|
-
Skipped ${e.numSkips} time(s)`,n=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?n=
|
|
109
|
-
Got ${
|
|
108
|
+
Skipped ${e.numSkips} time(s)`,n=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?n=Ed(e.executionSummary,t):$(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:r,details:n,hints:i}}function LN(e){if(e instanceof L&&e.stack!==void 0)return e.stack;try{return Ve(e)}catch{}if(e instanceof L)try{return W4(e)}catch{}if(e!==null&&typeof e=="object")try{return qc(e)}catch{}return"Failed to serialize errorInstance"}function $N(e,t){let r=e.runConfiguration.includeErrorInReport?`
|
|
109
|
+
Got ${F4(LN(e.errorInstance),/^Error: /,"error: ")}`:"",n=`Property failed after ${e.numRuns} tests
|
|
110
110
|
{ seed: ${e.seed}, path: "${e.counterexamplePath}", endOnFailure: true }
|
|
111
111
|
Counterexample: ${t(e.counterexample)}
|
|
112
|
-
Shrunk ${e.numShrinks} time(s)${r}`,i=null,o=[];return e.verbose>=2?i=
|
|
113
|
-
{ seed: ${e.seed} }`,n=null,i=[];return e.verbose>=2?n=
|
|
112
|
+
Shrunk ${e.numShrinks} time(s)${r}`,i=null,o=[];return e.verbose>=2?i=Ed(e.executionSummary,t):e.verbose===1?i=ON(e.failures,t):$(o,"Enable verbose mode in order to have the list of all failing values encountered during the run"),{message:n,details:i,hints:o}}function DN(e,t){let r=`Property interrupted after ${e.numRuns} tests
|
|
113
|
+
{ seed: ${e.seed} }`,n=null,i=[];return e.verbose>=2?n=Ed(e.executionSummary,t):$(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:r,details:n,hints:i}}function Yc(e,t){if(!e.failed)return;let{message:r,details:n,hints:i}=e.counterexamplePath===null?e.interrupted?DN(e,t):NN(e,t):$N(e,t),o=r;return n!==null&&(o+=`
|
|
114
114
|
|
|
115
115
|
${n}`),i.length>0&&(o+=`
|
|
116
116
|
|
|
117
|
-
${ON(i)}`),o}function m1(e){return Jc(e,xe)}async function g1(e){let t=[];function r(s){let a=l1(s);return typeof a=="string"?a:(t.push(Promise.all([s,a])),"\u2026")}let n=Jc(e,r);if(t.length===0)return n;let i=new _t(await Promise.all(t));function o(s){let a=Ye(i,s);return a!==void 0?a:xe(s)}return Jc(e,o)}function y1(e,t){if(t.runConfiguration.includeErrorInReport)throw new L(e);let r=new L(e,{cause:t.errorInstance});return"cause"in r||MN(r,{cause:t.errorInstance}),r}function FN(e){if(e.failed)throw y1(m1(e),e)}async function jN(e){if(e.failed)throw y1(await g1(e),e)}function VN(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):FN(e)}async function BN(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):jN(e)}function UN(e,t,r,n,i){let o=new c1(r,t,n,i);for(let s of o){e.runBeforeEach();let a=e.run(s);e.runAfterEach(),o.handleResult(a)}return o.runExecution}async function WN(e,t,r,n,i){let o=new c1(r,t,n,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 b1(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 r=vd({...ct(),...t});if(r.reporter!==void 0&&r.asyncReporter!==void 0)throw new Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(r.asyncReporter!==void 0&&!e.isAsync())throw new Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let n=vN(e,r),i=r.path.length===0||r.path.indexOf(":")===-1?r.numRuns:-1,o=r.numRuns*r.maxSkipsPerRun,s=(...u)=>n.shrink(...u),a=new kN(r.path.length===0?f1(n,r.seed,r.randomType,r.examples):h1(r.path,rr(p1(n,r.seed,r.randomType,r.examples)),s),i,o),l=r.endOnFailure?j.nil:s;return n.isAsync()?WN(n,l,a,r.verbose,r.markInterruptAsFailure).then(u=>u.toRunDetails(r.seed,r.path,o,r)):UN(n,l,a,r.verbose,r.markInterruptAsFailure).toRunDetails(r.seed,r.path,o,r)}function zN(e,t){let r=b1(e,t);if(e.isAsync())return r.then(BN);VN(r)}function GN(e,t){let r=Object.prototype.hasOwnProperty.call(e,"isAsync")?e:new o1(e,()=>!0);return t.unbiased===!0?new a1(r):r}function S1(e,t){let r=vd(typeof t=="number"?{...ct(),numRuns:t}:{...ct(),...t}),n=GN(e,r),i=n.shrink.bind(n);return(r.path.length===0?rr(f1(n,r.seed,r.randomType,r.examples)):h1(r.path,rr(p1(n,r.seed,r.randomType,r.examples)),i)).take(r.numRuns).map(o=>o.value_)}function HN(e,t){return[...S1(e,t)]}function qN(e){return(Math.round(e*100)/100).toFixed(2)}function KN(e,t,r){let n=vd(typeof r=="number"?{...ct(),numRuns:r}:{...ct(),...r}),i={};for(let l of S1(e,r)){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],`${qN(l[1]*100/n.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)n.logger(`${l[0].padEnd(s,".")}..${l[1].padStart(a,".")}`)}var YN=Object.assign;function Zc(e,t,r,n){let i=r(),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 $(s.history,{arb:u,value:p,context:c.context,mrng:c.mrng}),o=c.mrng.clone(),p}let d=u.generate(o,t);return $(s.history,{arb:u,value:d.value_,context:d.context,mrng:o.clone()}),d.value},l=(u,...c)=>a(n(u,c));return new D(YN(l,{values(){return G(s.history,u=>u.value)},[Me](){return Zc(e,t,r,n).value},[dt](){return xe(G(s.history,u=>u.value))}}),s)}var Ac=Array.isArray,OS=Object.keys,JN=Object.is;function ZN(e){let t=new _t;return function(n,i){let o=Ye(t,n);if(o===void 0){let l=n(...i);return ut(t,n,[{args:i,value:l}]),l}let s=o;for(let l of s)if(e(i,l.args))return l.value;let a=n(...i);return $(s,{args:i,value:a}),a}}function w1(e,t){if(e!==null&&typeof e=="object"&&t!==null&&typeof t=="object"){if(Ac(e)){if(!Ac(t)||e.length!==t.length)return!1}else if(Ac(t))return!1;if(OS(e).length!==OS(t).length)return!1;for(let r in e)if(!(r in t)||!w1(e[r],t[r]))return!1;return!0}else return JN(e,t)}var XN=class extends de{constructor(...e){super(...e),this.arbitraryCache=ZN(w1)}generate(e,t){return Zc(e,t,()=>[],this.arbitraryCache)}canShrinkWithoutContext(e){return!1}shrink(e,t){if(t===void 0)return j.nil();let r=t,n=r.mrng,i=r.biasFactor,o=r.history;return r1(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 G(o,(c,d)=>({arb:c.arb,value:l[d],context:u[d],mrng:c.mrng}))}return Zc(n,i,a,this.arbitraryCache)})}};function QN(){return new XN}var e3=Math.floor,NS=Math.log;function t3(e){return e3(NS(e)/NS(2))}function r3(e){return e===O(0)?O(0):O(Ve(e).length)}function v1(e,t,r){if(e===t)return[{min:e,max:t}];if(e<0&&t>0){let s=r(-e),a=r(t);return[{min:-s,max:a},{min:t-a,max:t},{min:e,max:e+s}]}let n=r(t-e),i={min:e,max:e+n},o={min:t-n,max:t};return e<0?[o,i]:[i,o]}var n3=Math.ceil,i3=Math.floor;function LS(e){return i3(e/2)}function $S(e){return n3(e/2)}function DS(e,t,r){let n=e-t;function*i(){let s=r?void 0:t,a=r?n:LS(n);for(let l=a;l>0;l=LS(l)){let u=l===n?t:e-l;yield new D(u,s),s=u}}function*o(){let s=r?void 0:t,a=r?n:$S(n);for(let l=a;l<0;l=$S(l)){let u=l===n?t:e-l;yield new D(u,s),s=u}}return n>0?rr(i()):rr(o())}var _S=Math.sign,o3=Number.isInteger,s3=Object.is,an=class x1 extends de{constructor(t,r){super(),this.min=t,this.max=r}generate(t,r){let n=this.computeGenerateRange(t,r);return new D(t.nextInt(n.min,n.max),void 0)}canShrinkWithoutContext(t){return typeof t=="number"&&o3(t)&&!s3(t,-0)&&this.min<=t&&t<=this.max}shrink(t,r){return x1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new D(r,void 0)):DS(t,r,!1):DS(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?0:this.min<0?this.max:this.min}computeGenerateRange(t,r){if(r===void 0||t.nextInt(1,r)!==1)return{min:this.min,max:this.max};let n=v1(this.min,this.max,t3);if(n.length===1)return n[0];let i=t.nextInt(-2*(n.length-1),n.length-2);return i<0?n[0]:n[i+1]}isLastChanceTry(t,r){return t>0?t===r+1&&t>this.min:t<0?t===r-1&&t<this.max:!1}static isValidContext(t,r){if(r===void 0)return!1;if(typeof r!="number")throw new Error("Invalid context type passed to IntegerArbitrary (#1)");if(r!==0&&_S(t)!==_S(r))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},FS=Number.isInteger;function a3(e){return{min:e.min!==void 0?e.min:-2147483648,max:e.max!==void 0?e.max:2147483647}}function ie(e={}){let t=a3(e);if(t.min>t.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!FS(t.min))throw new Error("fc.integer minimum value should be an integer");if(!FS(t.max))throw new Error("fc.integer maximum value should be an integer");return new an(t.min,t.max)}var jS=new Map;function Ad(e){if(e===void 0)return{depth:0};if(typeof e!="string")return e;let t=Ye(jS,e);if(t!==void 0)return t;let r={depth:0};return ut(jS,e,r),r}function Id(){return{depth:0}}var l3=class{constructor(e,t,r){this.arb=e,this.mrng=t,this.biasFactor=r}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},u3=Math.min,c3=Math.max,d3=class{constructor(e,t,r,n){this.arb=e,this.mrng=t,this.slices=r,this.biasFactor=n,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 r=0;r!==this.slices.length;++r)this.slices[r].length===e&&$(t,r);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 D(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 D(e[0],void 0);let t=this.mrng.nextInt(0,e.length-1),r=this.mrng.nextInt(0,e.length-1);return this.nextIndexInSlice=u3(t,r),this.lastIndexInSlice=c3(t,r),new D(e[this.nextIndexInSlice++],void 0)}};function VS(e,t,r,n){return n===void 0||r.length===0||t.nextInt(1,n)!==1?new l3(e,t,n):new d3(e,t,r,n)}var f3=Math.floor,BS=Math.log,US=Math.max,p3=Array.isArray;function Ic(e,t){return e===t?e:e+f3(BS(t-e)/BS(2))}var R1=class k1 extends de{constructor(t,r,n,i,o,s,a){super(),this.arb=t,this.minLength=r,this.maxGeneratedLength=n,this.maxLength=i,this.setBuilder=s,this.customSlices=a,this.lengthArb=ie({min:r,max:n}),this.depthContext=Ad(o)}preFilter(t){if(this.setBuilder===void 0)return t;let r=this.setBuilder();for(let n=0;n!==t.length;++n)r.tryAdd(t[n]);return r.getData()}static makeItCloneable(t,r){return t[Me]=()=>{let n=[];for(let i=0;i!==r.length;++i)$(n,r[i].value);return this.makeItCloneable(n,r),n},t}generateNItemsNoDuplicates(t,r,n,i){let o=0,s=t(),a=VS(this.arb,n,this.customSlices,i);for(;s.size()<r&&o<this.maxGeneratedLength;){let l=a.next();s.tryAdd(l)?o=0:o+=1}return s.getData()}safeGenerateNItemsNoDuplicates(t,r,n,i){let o=US(0,r-Ic(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=o;try{return this.generateNItemsNoDuplicates(t,r,n,i)}finally{this.depthContext.depth-=o}}generateNItems(t,r,n){let i=[],o=VS(this.arb,r,this.customSlices,n);o.attemptExact(t);for(let s=0;s!==t;++s)$(i,o.next());return i}safeGenerateNItems(t,r,n){let i=US(0,t-Ic(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=i;try{return this.generateNItems(t,r,n)}finally{this.depthContext.depth-=i}}wrapper(t,r,n,i){let o=r?this.preFilter(t):t,s=!1,a=[],l=[];for(let u=0;u!==o.length;++u){let c=o[u];s=s||c.hasToBeCloned,$(a,c.value),$(l,c.context)}return s&&k1.makeItCloneable(a,o),new D(a,{shrunkOnce:r,lengthContext:t.length===o.length&&n!==void 0?n:void 0,itemsContexts:l,startIndex:i})}generate(t,r){let n=this.applyBias(t,r),i=n.size,o=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,i,t,n.biasFactorItems):this.safeGenerateNItems(i,t,n.biasFactorItems);return this.wrapper(o,!1,void 0,0)}applyBias(t,r){if(r===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:r};if(t.nextInt(1,r)!==1)return{size:this.lengthArb.generate(t,void 0).value};if(t.nextInt(1,r)!==1||this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:r};let n=Ic(this.minLength,this.maxGeneratedLength);return{size:ie({min:this.minLength,max:n}).generate(t,void 0).value,biasFactorItems:r}}canShrinkWithoutContext(t){if(!p3(t)||this.minLength>t.length||t.length>this.maxLength)return!1;for(let r=0;r!==t.length;++r)if(!(r in t)||!this.arb.canShrinkWithoutContext(t[r]))return!1;return this.preFilter(G(t,r=>new D(r,void 0))).length===t.length}shrinkItemByItem(t,r,n){let i=[];for(let o=r.startIndex;o<n;++o)$(i,tr(()=>this.arb.shrink(t[o],r.itemsContexts[o]).map(s=>{let a=G(Le(t,0,o),(u,c)=>new D(rn(u),r.itemsContexts[c])),l=G(Le(t,o+1),(u,c)=>new D(rn(u),r.itemsContexts[c+o+1]));return[[...a,s,...l],void 0,o]})));return j.nil().join(...i)}shrinkImpl(t,r){if(t.length===0)return j.nil();let n=r!==void 0?r:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(t.length,n.lengthContext).drop(n.shrunkOnce&&n.lengthContext===void 0&&t.length>this.minLength+1?1:0).map(i=>{let o=t.length-i.value;return[G(Le(t,o),(s,a)=>new D(rn(s),n.itemsContexts[a+o])),i.context,0]}).join(tr(()=>t.length>this.minLength?this.shrinkItemByItem(t,n,1):this.shrinkItemByItem(t,n,t.length))).join(t.length>this.minLength?tr(()=>{let i={shrunkOnce:!1,lengthContext:void 0,itemsContexts:Le(n.itemsContexts,1),startIndex:0};return this.shrinkImpl(Le(t,1),i).filter(o=>this.minLength<=o[0].length+1).map(o=>[[new D(rn(t[0]),n.itemsContexts[0]),...o[0]],void 0,0])}):j.nil())}shrink(t,r){return this.shrinkImpl(t,r).map(n=>this.wrapper(n[0],!0,n[1],n[2]))}},h3=Math.floor,m3=Math.min,Rr=2147483647,Qr=["xsmall","small","medium","large","xlarge"],g3=["-4","-3","-2","-1","=","+1","+2","+3","+4"],Pd="small";function y3(e,t){switch(t){case"xsmall":return h3(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 bi(e,t){let r=$t(g3,e);if(r===-1)return e;let n=$t(Qr,t);if(n===-1)throw new Error(`Unable to offset size based on the unknown defaulted one: ${t}`);let i=n+r-4;return i<0?Qr[0]:i>=Qr.length?Qr[Qr.length-1]:Qr[i]}function gi(e,t,r,n){let{baseSize:i=Pd,defaultSizeToMaxWhenMaxSpecified:o}=ct()||{},s=e!==void 0?e:n&&o?"max":i;return s==="max"?r:m3(y3(t,bi(s,i)),r)}function b3(e,t){if(typeof e=="number")return 1/e;let{baseSize:r=Pd,defaultSizeToMaxWhenMaxSpecified:n}=ct()||{},i=e!==void 0?e:t&&n?"max":r;if(i==="max")return 0;switch(bi(i,r)){case"xsmall":return 1;case"small":return .5;case"medium":return .25;case"large":return .125;case"xlarge":return .0625}}function Td(e){let{baseSize:t=Pd}=ct()||{};return e===void 0?t:bi(e,t)}function ae(e,t={}){let r=t.size,n=t.minLength||0,i=t.maxLength,o=t.depthIdentifier,s=i!==void 0?i:Rr;return new R1(e,n,gi(r,n,s,i!==void 0),s,o,void 0,t.experimentalCustomSlices||[])}function Cs(e){return e/O(2)}function WS(e,t,r){let n=e-t;function*i(){let s=r?void 0:t,a=r?n:Cs(n);for(let l=a;l>0;l=Cs(l)){let u=e-l;yield new D(u,s),s=u}}function*o(){let s=r?void 0:t,a=r?n:Cs(n);for(let l=a;l<0;l=Cs(l)){let u=e-l;yield new D(u,s),s=u}}return n>0?rr(i()):rr(o())}var S3=class E1 extends de{constructor(t,r){super(),this.min=t,this.max=r}generate(t,r){let n=this.computeGenerateRange(t,r);return new D(t.nextBigInt(n.min,n.max),void 0)}computeGenerateRange(t,r){if(r===void 0||t.nextInt(1,r)!==1)return{min:this.min,max:this.max};let n=v1(this.min,this.max,r3);if(n.length===1)return n[0];let i=t.nextInt(-2*(n.length-1),n.length-2);return i<0?n[0]:n[i+1]}canShrinkWithoutContext(t){return typeof t=="bigint"&&this.min<=t&&t<=this.max}shrink(t,r){return E1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new D(r,void 0)):WS(t,r,!1):WS(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?O(0):this.min<0?this.max:this.min}isLastChanceTry(t,r){return t>0?t===r+O(1)&&t>this.min:t<0?t===r-O(1)&&t<this.max:!1}static isValidContext(t,r){if(r===void 0)return!1;if(typeof r!="bigint")throw new Error("Invalid context type passed to BigIntArbitrary (#1)");let n=t>0&&r<0||t<0&&r>0;if(r!==O(0)&&n)throw new Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function w3(e){let r=O(-1)<<O(255),n=(O(1)<<O(255))-O(1),i=e.min,o=e.max;return{min:i!==void 0?i:r-(o!==void 0&&o<O(0)?o*o:O(0)),max:o!==void 0?o:n+(i!==void 0&&i>O(0)?i*i:O(0))}}function v3(e){return e[0]===void 0?{}:e[1]===void 0?e[0]:{min:e[0],max:e[1]}}function nr(...e){let t=w3(v3(e));if(t.min>t.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new S3(t.min,t.max)}var x3=Object.getPrototypeOf,ui=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 Ws(e){return x3(e)===ui.prototype&&e.generate===ui.prototype.generate&&e.canShrinkWithoutContext===ui.prototype.canShrinkWithoutContext&&e.shrink===ui.prototype.shrink?e:new ui(e)}function R3(e){return e===1}function k3(e){if(typeof e!="boolean")throw new Error("Unsupported input type");return e===!0?1:0}function Si(){return Ws(ie({min:0,max:1}).map(R3,k3))}var fi=Object.is,E3=class{constructor(e){this.values=e,this.fastValues=new nn(this.values);let t=!1,r=!1;if(Us(this.fastValues,0))for(let n=0;n!==this.values.length;++n){let i=this.values[n];t=t||fi(i,-0),r=r||fi(i,0)}this.hasMinusZero=t,this.hasPlusZero=r}has(e){return e===0?fi(e,0)?this.hasPlusZero:this.hasMinusZero:Us(this.fastValues,e)}},C1=class extends de{constructor(e){super(),this.values=e}generate(e,t){let r=this.values.length===1?0:e.nextInt(0,this.values.length-1),n=this.values[r];return xr(n)?new D(n,r,()=>n[Me]()):new D(n,r)}canShrinkWithoutContext(e){return this.values.length===1?fi(this.values[0],e):(this.fastValues===void 0&&(this.fastValues=new E3(this.values)),this.fastValues.has(e))}shrink(e,t){return t===0||fi(e,this.values[0])?j.nil():j.of(new D(this.values[0],0))}};function wt(...e){if(e.length===0)throw new Error("fc.constantFrom expects at least one parameter");return new C1(e)}function C3(e){return!e||!e.withBigInt?wt(!1,null,void 0,0,"",NaN):wt(!1,null,void 0,0,"",NaN,O(0))}function ve(e){return new C1([e])}var A3=class A1{constructor(){this.receivedLogs=[]}log(t){this.receivedLogs.push(t)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[Me](){return new A1}};function I3(){return ve(new A3)}var P3=NaN,T3=Number.isNaN;function I1(e){return new Vs(e)}function P1(e){if(!(e instanceof Vs)||e.constructor!==Vs)throw new L("Not a valid value for date unmapper");return Bs(e)}function M3(e){return t=>t===e?new Vs(P3):I1(t)}function O3(e){return t=>{let r=P1(t);return T3(r)?e:r}}var zS=Number.isNaN;function T1(e={}){let t=e.min!==void 0?Bs(e.min):-864e13,r=e.max!==void 0?Bs(e.max):864e13,n=e.noInvalidDate;if(zS(t))throw new Error("fc.date min must be valid instance of Date");if(zS(r))throw new Error("fc.date max must be valid instance of Date");if(t>r)throw new Error("fc.date max must be greater or equal to min");if(n)return ie({min:t,max:r}).map(I1,P1);let i=r+1;return ie({min:t,max:r+1}).map(M3(i),O3(i))}var N3=class extends de{constructor(e,t){super(),this.startArb=e,this.chainer=t}generate(e,t){let r=[],n=e.clone(),i=this.startArb.generate(e,t);for(r.push({arbitrary:this.startArb,value:i.value_,context:i.context,clonedMrng:n});;){let s=this.chainer(i.value_);if(s===void 0)break;let a=e.clone();i=s.generate(e,t),r.push({arbitrary:s,value:i.value_,context:i.context,clonedMrng:a})}let o={biasFactor:t,entries:r,currentShrinkLevel:0};return new D(i.value_,o)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?new j(this.shrinkIterator(t)):j.nil()}*shrinkIterator(e){let{entries:t,currentShrinkLevel:r,biasFactor:n}=e;for(let i=r;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 h=this.chainer(u.value_);if(h===void 0)break;let f=c.clone(),m=h.generate(c,n);l.push({arbitrary:h,value:m.value_,context:m.context,clonedMrng:f}),u=m}let d=l[l.length-1],p={biasFactor:n,entries:l,currentShrinkLevel:i};yield new D(d.value,p)}}}isSafeContext(e){return e!=null&&typeof e=="object"&&"biasFactor"in e&&"entries"in e&&"currentShrinkLevel"in e}};function L3(e,t){return new N3(e,t)}var $3=Symbol.iterator,D3=Array.isArray,_3=Object.is,F3=class M1 extends de{constructor(t,r){super(),this.arb=t,this.numValues=r}generate(t,r){let n=[];if(this.numValues<=0)return this.wrapper(n);for(let i=0;i!==this.numValues-1;++i)$(n,this.arb.generate(t.clone(),r));return $(n,this.arb.generate(t,r)),this.wrapper(n)}canShrinkWithoutContext(t){if(!D3(t)||t.length!==this.numValues)return!1;if(t.length===0)return!0;for(let r=1;r<t.length;++r)if(!_3(t[0],t[r]))return!1;return this.arb.canShrinkWithoutContext(t[0])}shrink(t,r){return t.length===0?j.nil():new j(this.shrinkImpl(t,r!==void 0?r:[])).map(n=>this.wrapper(n))}*shrinkImpl(t,r){let n=G(t,(o,s)=>this.arb.shrink(o,r[s])[$3]()),i=G(n,o=>o.next());for(;!i[0].done;)yield G(i,o=>o.value),i=G(n,o=>o.next())}static makeItCloneable(t,r){return t[Me]=()=>{let n=[];for(let i=0;i!==r.length;++i)$(n,r[i].value);return this.makeItCloneable(n,r),n},t}wrapper(t){let r=!1,n=[],i=[];for(let o=0;o!==t.length;++o){let s=t[o];r=r||s.hasToBeCloned,$(n,s.value),$(i,s.context)}return r&&M1.makeItCloneable(n,t),new D(n,i)}};function j3(e,t){return new F3(e,t)}var GS=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 $(this.data,e),!0}size(){return this.data.length}getData(){return this.data}},V3=Number.isNaN,B3=class{constructor(e){this.selector=e,this.selectedItemsExceptNaN=new nn,this.data=[]}tryAdd(e){let t=this.selector(e);if(V3(t))return $(this.data,e),!0;let r=this.selectedItemsExceptNaN.size;return pi(this.selectedItemsExceptNaN,t),r!==this.selectedItemsExceptNaN.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},U3=Object.is,W3=class{constructor(e){this.selector=e,this.selectedItemsExceptMinusZero=new nn,this.data=[],this.hasMinusZero=!1}tryAdd(e){let t=this.selector(e);if(U3(t,-0))return this.hasMinusZero?!1:($(this.data,e),this.hasMinusZero=!0,!0);let r=this.selectedItemsExceptMinusZero.size;return pi(this.selectedItemsExceptMinusZero,t),r!==this.selectedItemsExceptMinusZero.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},z3=class{constructor(e){this.selector=e,this.selectedItems=new nn,this.data=[]}tryAdd(e){let t=this.selector(e),r=this.selectedItems.size;return pi(this.selectedItems,t),r!==this.selectedItems.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}};function G3(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 GS(l)}let n=e.comparator,i=e.selector,o=a=>i(a.value_),s=(a,l)=>n(o(a),o(l));return()=>new GS(s)}let t=e.selector||(n=>n),r=n=>t(n.value_);switch(e.comparator){case"IsStrictlyEqual":return()=>new B3(r);case"SameValueZero":return()=>new z3(r);case"SameValue":case void 0:return()=>new W3(r)}}function kr(e,t={}){let r=t.minLength!==void 0?t.minLength:0,n=t.maxLength!==void 0?t.maxLength:Rr,i=gi(t.size,r,n,t.maxLength!==void 0),o=t.depthIdentifier,s=new R1(e,r,i,n,o,G3(t),[]);return r===0?s:s.filter(a=>a.length>=r)}var H3=Object.create,q3=Object.defineProperty,K3=Object.getOwnPropertyDescriptor,HS=Object.getPrototypeOf,Y3=Object.prototype,J3=Reflect.ownKeys;function Z3(e){let t=e[1]?H3(null):{};for(let r of e[0])q3(t,r[0],{enumerable:!0,configurable:!0,writable:!0,value:r[1]});return t}function X3(e){return e!==void 0&&!!e.configurable&&!!e.enumerable&&!!e.writable&&e.get===void 0&&e.set===void 0}function Q3(e){if(typeof e!="object"||e===null)throw new L("Incompatible instance received: should be a non-null object");let t=HS(e)===null,r=HS(e)===Y3;if(!t&&!r)throw new L("Incompatible instance received: should be of exact type Object");let n=G(J3(e),i=>[i,K3(e,i)]);if(!Zw(n,([,i])=>X3(i)))throw new L("Incompatible instance received: should contain only c/e/w properties without get/set");return[G(n,([i,o])=>[i,o.value]),t]}function eL(e){return e[0]}function Md(e,t,r={}){let n=!!r.noNullPrototype;return B(kr(B(e,t),{minLength:r.minKeys,maxLength:r.maxKeys,size:r.size,selector:eL,depthIdentifier:r.depthIdentifier}),n?ve(!1):Si()).map(Z3,Q3)}var tL=Number.POSITIVE_INFINITY,rL=Number.MAX_SAFE_INTEGER,nL=Number.isInteger,iL=Math.floor,oL=Math.pow,sL=Math.min,Xc=class O1 extends de{static from(t,r,n){if(t.length===0)throw new Error(`${n} 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(`${n} expects arbitraries to be specified`);let s=t[o].weight;if(i+=s,!nL(s))throw new Error(`${n} expects weights to be integer values`);if(s<0)throw new Error(`${n} expects weights to be superior or equal to 0`)}if(i<=0)throw new Error(`${n} expects the sum of weights to be strictly superior to 0`);return new O1(t,{depthBias:b3(r.depthSize,r.maxDepth!==void 0),maxDepth:r.maxDepth!==void 0?r.maxDepth:tL,withCrossShrink:!!r.withCrossShrink},Ad(r.depthIdentifier))}constructor(t,r,n){super(),this.warbs=t,this.constraints=r,this.context=n;let i=0;this.cumulatedWeights=[];for(let o=0;o!==t.length;++o)i+=t[o].weight,$(this.cumulatedWeights,i);this.totalWeight=i}generate(t,r){if(this.mustGenerateFirst())return this.safeGenerateForIndex(t,0,r);let n=t.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let i=0;i!==this.cumulatedWeights.length;++i)if(n<this.cumulatedWeights[i])return this.safeGenerateForIndex(t,i,r);throw new Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(t){return this.canShrinkWithoutContextIndex(t)!==-1}shrink(t,r){if(r!==void 0){let i=r,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 j.of(l).join(a)}return a}let n=this.canShrinkWithoutContextIndex(t);return n===-1?j.nil():this.defaultShrinkForFirst(n).join(this.warbs[n].arbitrary.shrink(t,void 0).map(i=>this.mapIntoValue(n,i,null,void 0)))}defaultShrinkForFirst(t){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(t)||this.warbs[0].fallbackValue===void 0)return j.nil()}finally{--this.context.depth}let r=new D(this.warbs[0].fallbackValue.default,void 0);return j.of(this.mapIntoValue(0,r,null,void 0))}canShrinkWithoutContextIndex(t){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(t)?0:-1;try{++this.context.depth;for(let r=0;r!==this.warbs.length;++r){let n=this.warbs[r];if(n.weight!==0&&n.arbitrary.canShrinkWithoutContext(t))return r}return-1}finally{--this.context.depth}}mapIntoValue(t,r,n,i){let o={selectedIndex:t,originalBias:i,originalContext:r.context,clonedMrngForFallbackFirst:n};return new D(r.value,o)}safeGenerateForIndex(t,r,n){++this.context.depth;try{let i=this.warbs[r].arbitrary.generate(t,n),o=this.mustFallbackToFirstInShrink(r)?t.clone():null;return this.mapIntoValue(r,i,o,n)}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 r=iL(oL(1+t,this.context.depth))-1;return-sL(this.totalWeight*r,rL)||0}};function aL(e){return e!=null&&typeof e=="object"&&!("generate"in e)&&!("arbitrary"in e)&&!("weight"in e)}function qS(e){return Vw(e)?{arbitrary:e,weight:1}:e}function Te(...e){let t=e[0];if(aL(t)){let n=G(Le(e,1),qS);return Xc.from(n,t,"fc.oneof")}let r=G(e,qS);return Xc.from(r,{},"fc.oneof")}var lL=Number.isInteger;function er(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(!lL(t))throw new Error("fc.nat maximum value should be an integer");return new an(0,t)}var uL=Object.is;function cL(e){let t=0,r=[];for(let n of e){let i=t;t=i+n.num;let o=t-1;r.push({from:i,to:o,entry:n})}return r}function dL(e,t){let r=0,n=e.length;for(;n-r>1;){let i=~~((r+n)/2);t<e[i].from?n=i:r=i}return e[r]}function fL(e){let t=cL(e);return function(n){let i=dL(t,n);return i.entry.build(n-i.from)}}function pL(e){let t={mapping:new _t,negativeZeroIndex:void 0},r=0;for(let n=0;n!==e.length;++n){let i=e[n];for(let o=0;o!==i.num;++o){let s=i.build(o);s===0&&1/s===Dt.NEGATIVE_INFINITY?t.negativeZeroIndex=r:ut(t.mapping,s,r),++r}}return t}function hL(e){let t=null;return function(n){t===null&&(t=pL(e));let i=uL(n,-0)?t.negativeZeroIndex:Ye(t.mapping,n);if(i===void 0)throw new L("Unknown value encountered cannot be built using this mapToConstant");return i}}function mL(e){if(e.length===0)throw new L("fc.mapToConstant expects at least one option");let t=0;for(let r=0;r!==e.length;++r){if(e[r].num<0)throw new L("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");t+=e[r].num}if(t===0)throw new L("fc.mapToConstant expects at least one choice among options");return t}function ln(...e){return er({max:mL(e)-1}).map(fL(e),hL(e))}function N1(e,t,r,n){if(t.length===0)return r>0?void 0:[];if(n<=0)return;let i=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];for(;i.length>0;){let o=Kw(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<r)break;return l}$(i,{endIndexChunks:o.endIndexChunks,nextStartIndex:s+1,chunks:o.chunks}),l.length<n&&$(i,{endIndexChunks:s,nextStartIndex:s+1,chunks:l});break}}}}function gL(e){return ce(e,"")}function L1(e){return e.minLength!==void 0?e.minLength:0}function $1(e){return e.maxLength!==void 0?e.maxLength:Rr}function yL(e,t){return L1(t)<=e.length&&e.length<=$1(t)}function bL(e,t){return function(n){if(typeof n!="string")throw new L("Unsupported value");let i=N1(e,n,L1(t),$1(t));if(i===void 0)throw new L("Unable to unmap received string");return i}}var D1=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function SL(e,t,r){let n;try{n=r(e)}catch{return}for(let i of n)if(!t.canShrinkWithoutContext(i))return;return n}function wL(e,t){let r=[];for(let n of D1){let i=SL(n,e,t);i!==void 0&&$(r,i)}return r}var KS=new WeakMap;function vL(e){let t=[];for(let r of D1){let n=N1(e,r,0,Rr);n!==void 0&&$(t,n)}return t}function xL(e,t){let r=w4(KS,e);r===void 0&&(r=vL(e),S4(KS,e,r));let n=[];for(let i of r)yL(i,t)&&$(n,i);return n}var RL=[[0,127]],kL=[[0,55295],[57344,1114111]],EL=[[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]],CL=[[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]],YS=String.fromCodePoint,AL=Math.min,IL=Math.max;function Qc(e){if(e.length===1){let r=YS(e[0]);return{num:1,build:()=>r}}let t=e[0];return{num:e[1]-e[0]+1,build:r=>YS(t+r)}}function JS(e,t){let r=[],n=0,i=0;for(;n<e.length&&i<t.length;){let o=e[n],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)n+=1;else if(c<s)i+=1;else{let d=IL(s,u),p=AL(a,c);if(r.length>=1){let h=r[r.length-1];(h.length===1?h[0]:h[1])+1===d&&(d=h[0],Kw(r))}$(r,d===p?[d]:[d,p]),a<=p&&(n+=1),c<=p&&(i+=1)}}return r}var ZS=Object.create(null);function PL(e){switch(e){case"full":return kL;case"ascii":return RL}}function TL(e,t){let r=`${e}:${t}`,n=ZS[r];if(n!==void 0)return n;let i=PL(t),o=e==="binary"?i:JS(i,EL),s=[];for(let l of o)$(s,Qc(l));if(e==="grapheme"){let l=JS(i,CL);for(let u of l){let c=Qc(u);$(s,{num:c.num,build:d=>F4(c.build(d),"NFD")})}}let a=ln(...s);return ZS[r]=a,a}function ci(e,t){return TL(e,t)}function ML(e){if(typeof e.unit=="object")return e.unit;switch(e.unit){case"grapheme":return ci("grapheme","full");case"grapheme-composite":return ci("composite","full");case"grapheme-ascii":case void 0:return ci("grapheme","ascii");case"binary":return ci("binary","full");case"binary-ascii":return ci("binary","ascii")}}function Ce(e={}){let t=ML(e),r=bL(t,e),n=xL(t,e);return ae(t,{...e,experimentalCustomSlices:n}).map(gL,r)}var _1=Map,Od=String.fromCharCode,Nd={num:26,build:e=>Od(e+97)},OL={num:26,build:e=>Od(e+65)},F1={num:10,build:e=>Od(e+48)};function NL(e){let t=Z6(e);return e!==t?t:`%${hi(on(e,0),16)}`}function LL(e){if(typeof e!="string")throw new Error("Unsupported");return decodeURIComponent(e)}var $L=()=>Ce({unit:"binary",minLength:1,maxLength:1}).map(NL,LL),Pc;function DL(){return Pc===void 0&&(Pc=ln(Nd)),Pc}var As;function ed(e){As===void 0&&(As=new _1);let t=Ye(As,e);return t===void 0&&(t=ln(Nd,F1,{num:e.length,build:r=>e[r]}),ut(As,e,t)),t}function _L(e){return ln(Nd,OL,F1,{num:e.length,build:t=>e[t]})}var Is;function Ld(e){Is===void 0&&(Is=new _1);let t=Ye(Is,e);return t===void 0&&(t=Te({weight:10,arbitrary:_L(e)},{weight:1,arbitrary:$L()}),ut(Is,e,t)),t}function jt(e,t={}){let r=t.freq===void 0?6:t.freq,n=Xw(t,"nil")?t.nil:null,i=[{arbitrary:ve(n),weight:1,fallbackValue:{default:n}},{arbitrary:e,weight:r-1}],o={withCrossShrink:!0,depthSize:t.depthSize,maxDepth:t.maxDepth,depthIdentifier:t.depthIdentifier};return Xc.from(i,o,"fc.option")}function FL(e){return e.length>63?!1:e.length<4||e[0]!=="x"||e[1]!=="n"||e[2]!=="-"||e[3]!=="-"}var j1=Symbol("adapted-value");function jL(e,t){let r=t(e.value_);return r.adapted?new D(r.value,j1):e}var VL=class extends de{constructor(e,t){super(),this.sourceArb=e,this.adapter=t,this.adaptValue=r=>jL(r,t)}generate(e,t){let r=this.sourceArb.generate(e,t);return this.adaptValue(r)}canShrinkWithoutContext(e){return this.sourceArb.canShrinkWithoutContext(e)&&!this.adapter(e).adapted}shrink(e,t){return t===j1?this.sourceArb.canShrinkWithoutContext(e)?this.sourceArb.shrink(e,void 0).map(this.adaptValue):j.nil():this.sourceArb.shrink(e,t).map(this.adaptValue)}};function V1(e,t){return new VL(e,t)}function BL([e,t]){return t===null?e:`${e}${t[0]}${t[1]}`}function UL(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 WL(e){let t=ed("");return B(t,jt(B(Ce({unit:ed("-"),size:e,maxLength:61}),t))).map(BL,UL).filter(FL)}function zL(e){return`${ce(e[0],".")}.${e[1]}`}function GL(e){if(typeof e!="string")throw new Error("Unsupported type");let t=e.lastIndexOf(".");return[Be(ge(e,0,t),"."),ge(e,t+1)]}function HL(e){let[t,r]=e,n=r.length;for(let i=0;i!==t.length;++i)if(n+=1+t[i].length,n>255)return{adapted:!0,value:[Le(t,0,i),r]};return{adapted:!1,value:e}}function $d(e={}){let t=Td(e.size),r=bi("-1",t),n=Ce({unit:DL(),minLength:2,maxLength:63,size:r});return V1(B(ae(WL(t),{size:r,minLength:1,maxLength:127}),n),HL).map(zL,GL)}function qL(e){let t=e[0].length;for(let r=1;r!==e.length;++r)if(t+=1+e[r].length,t>64)return{adapted:!0,value:Le(e,0,r)};return{adapted:!1,value:e}}function KL(e){return ce(e,".")}function YL(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,".")}function JL(e){return`${e[0]}@${e[1]}`}function ZL(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,"@",2)}function XL(e={}){return B(V1(ae(Ce({unit:ed("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:e.size}),{minLength:1,maxLength:32,size:e.size}),qL).map(KL,YL),$d({size:e.size})).map(JL,ZL)}var QL=Dt.NEGATIVE_INFINITY,td=Dt.POSITIVE_INFINITY,B1=Dt.EPSILON,Dd=O(2146435072)*O(4294967296),e$=-Dd-O(1),XS=4503599627370496,t$=O(0xfffffffffffff),QS=O("9007199254740992"),rd=new Float64Array(1),ew=new Uint32Array(rd.buffer,rd.byteOffset);function r$(e){return rd[0]=e,[ew[1],ew[0]]}function n$(e){let{0:t,1:r}=r$(e),n=t>>>31,i=t>>>20&2047,o=(t&1048575)*4294967296+r,s=i===0?-1022:i-1023,a=i===0?0:1;return a+=o*B1,a*=n===0?1:-1,{exponent:s,significand:a}}function tw(e,t){return e===-1022?O(t*XS):O((t-1)*XS)+(O(e+1023)<<O(52))}function _d(e){if(e===td)return Dd;if(e===QL)return e$;let t=n$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===td?tw(r,n):-tw(r,-n)-O(1)}function nd(e){if(e<0)return-nd(-e-O(1));if(e===Dd)return td;if(e<QS)return Dt(e)*2**-1074;let t=e-QS,r=-1021+Dt(t>>O(52));return(1+Dt(t&t$)*B1)*2**r}var rw=Number.isInteger,nw=Object.is,Tc=Number.NEGATIVE_INFINITY,Mc=Number.POSITIVE_INFINITY;function U1(e,t,r,n){let{noDefaultInfinity:i=!1,minExcluded:o=!1,maxExcluded:s=!1,min:a=i?-t:Tc,max:l=i?t:Mc}=e,u=o?a<-r?-n:Math.max(a,-r):a===Tc?Math.max(a,-n):Math.max(a,-r),c=s?l>r?n:Math.min(l,r):l===Mc?Math.min(l,n):Math.min(l,r);return{noDefaultInfinity:!1,minExcluded:o||(a!==Tc||o)&&rw(u),maxExcluded:s||(l!==Mc||s)&&rw(c),min:nw(u,-0)?0:u,max:nw(c,0)?-0:c,noNaN:e.noNaN||!1}}var W1=Number.NEGATIVE_INFINITY,z1=Number.POSITIVE_INFINITY,i$=Number.MAX_VALUE,o$=45035996273704955e-1,id=4503599627370496;function s$(e){return U1(e,i$,o$,id)}function a$(e){return e===4503599627370496?z1:e===-4503599627370496?W1:e}function l$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===z1?id:e===W1?-id:e}var u$=Number.isInteger,G1=Number.isNaN,c$=Number.NEGATIVE_INFINITY,d$=Number.POSITIVE_INFINITY,iw=Number.MAX_VALUE,f$=NaN;function ow(e,t){if(G1(e))throw new Error("fc.double constraints."+t+" must be a 64-bit float");return _d(e)}function p$(e){if(typeof e!="number")throw new Error("Unsupported type");return _d(e)}function h$(e){return!u$(e)}function sw(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-iw:c$,max:s=t?iw:d$}=e,a=ow(o,"min"),l=n?a+O(1):a,u=ow(s,"max"),c=i?u-O(1):u;if(c<l)throw new Error("fc.double constraints.min must be smaller or equal to constraints.max");if(r)return nr({min:l,max:c}).map(nd,p$);let d=c>O(0),p=d?l:l-O(1),h=d?c+O(1):c;return nr({min:p,max:h}).map(f=>c<f||f<l?f$:nd(f),f=>{if(typeof f!="number")throw new Error("Unsupported type");return G1(f)?c!==h?h:p:_d(f)})}function qs(e={}){return e.noInteger?sw(s$(e)).map(a$,l$).filter(h$):sw(e)}var m$=Number.NEGATIVE_INFINITY,od=Number.POSITIVE_INFINITY,g$=Math.imul,sd=2**127*(1+(2**23-1)/2**23),H1=2139095040,y$=-2139095041,ad=new Float32Array(1),b$=new Uint32Array(ad.buffer,ad.byteOffset);function S$(e){return ad[0]=e,b$[0]}function w$(e){let t=S$(e),r=t>>>31,n=t>>>23&255,i=t&8388607,o=n===0?-126:n-127,s=n===0?0:1;return s+=i/2**23,s*=r===0?1:-1,{exponent:o,significand:s}}function aw(e,t){return e===-126?t*8388608:g$(e+127,8388608)+(t-1)*8388608}function Fd(e){if(e===od)return H1;if(e===m$)return y$;let t=w$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===od?aw(r,n):-aw(r,-n)-1}function ld(e){if(e<0)return-ld(-e-1);if(e===H1)return od;if(e<16777216)return e*2**-149;let t=e-16777216,r=-125+(t>>23);return(1+(t&8388607)/8388608)*2**r}var q1=Number.NEGATIVE_INFINITY,K1=Number.POSITIVE_INFINITY,v$=sd,x$=83886075e-1,ud=8388608;function R$(e){return U1(e,v$,x$,ud)}function k$(e){return e===8388608?K1:e===-8388608?q1:e}function E$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===K1?ud:e===q1?-ud:e}var C$=Number.isInteger,Y1=Number.isNaN,A$=Math.fround,I$=Number.NEGATIVE_INFINITY,P$=Number.POSITIVE_INFINITY,T$=NaN;function lw(e,t){let r="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(Y1(e)||A$(e)!==e)throw new Error(r);return Fd(e)}function M$(e){if(typeof e!="number")throw new Error("Unsupported type");return Fd(e)}function O$(e){return!C$(e)}function uw(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-sd:I$,max:s=t?sd:P$}=e,a=lw(o,"min"),l=n?a+1:a,u=lw(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(r)return ie({min:l,max:c}).map(ld,M$);let d=c>0?l:l-1,p=c>0?c+1:c;return ie({min:d,max:p}).map(h=>h>c||h<l?T$:ld(h),h=>{if(typeof h!="number")throw new Error("Unsupported type");return Y1(h)?c!==p?p:d:Fd(h)})}function J1(e={}){return e.noInteger?uw(R$(e)).map(k$,E$).filter(O$):uw(e)}function N$(e){return e.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function Z1(e){return e.replace(/\*\//g,"*\\/")}var qe=[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 zs(e){let t=4294967295;for(let r=0;r<e.length;++r){let n=on(e,r);if(n<128)t=qe[t&255^n]^t>>8;else if(n<2048)t=qe[t&255^(192|n>>6&31)]^t>>8,t=qe[t&255^(128|n&63)]^t>>8;else if(n>=55296&&n<57344){let i=on(e,++r);if(n>=56320||i<56320||i>57343||Number.isNaN(i))r-=1,t=qe[t&255^239]^t>>8,t=qe[t&255^191]^t>>8,t=qe[t&255^189]^t>>8;else{let o=(n&1023)+64,s=i&1023;t=qe[t&255^(240|o>>8&7)]^t>>8,t=qe[t&255^(128|o>>2&63)]^t>>8,t=qe[t&255^(128|s>>6&15|(o&3)<<4)]^t>>8,t=qe[t&255^(128|s&63)]^t>>8}}else t=qe[t&255^(224|n>>12&15)]^t>>8,t=qe[t&255^(128|n>>6&63)]^t>>8,t=qe[t&255^(128|n&63)]^t>>8}return(t|0)+2147483648}var L$=Object.getPrototypeOf,di=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 j.nil()}};function Gs(e){return L$(e)===di.prototype&&e.generate===di.prototype.generate&&e.canShrinkWithoutContext===di.prototype.canShrinkWithoutContext&&e.shrink===di.prototype.shrink?e:new di(e)}var $$=Object.assign,D$=Object.keys;function X1(e){return B(Gs(ie()),Gs(ie({min:1,max:4294967295}))).map(([t,r])=>{let n=()=>{let i={};return $$((s,a)=>{let l=xe(s),u=xe(a),c=e(zs(`${t}${l}`)%r,zs(`${t}${u}`)%r);return i[`[${l},${u}]`]=c,c},{toString:()=>{let s=D$(i).sort().map(a=>`${a} => ${xe(i[a])}`).map(a=>`/* ${Z1(a)} */`);return`function(a, b) {
|
|
117
|
+
${MN(i)}`),o}function h1(e){return Yc(e,xe)}async function m1(e){let t=[];function r(s){let a=a1(s);return typeof a=="string"?a:(t.push(Promise.all([s,a])),"\u2026")}let n=Yc(e,r);if(t.length===0)return n;let i=new _t(await Promise.all(t));function o(s){let a=Ye(i,s);return a!==void 0?a:xe(s)}return Yc(e,o)}function g1(e,t){if(t.runConfiguration.includeErrorInReport)throw new L(e);let r=new L(e,{cause:t.errorInstance});return"cause"in r||TN(r,{cause:t.errorInstance}),r}function _N(e){if(e.failed)throw g1(h1(e),e)}async function FN(e){if(e.failed)throw g1(await m1(e),e)}function jN(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):_N(e)}async function VN(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):FN(e)}function BN(e,t,r,n,i){let o=new u1(r,t,n,i);for(let s of o){e.runBeforeEach();let a=e.run(s);e.runAfterEach(),o.handleResult(a)}return o.runExecution}async function UN(e,t,r,n,i){let o=new u1(r,t,n,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 y1(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 r=wd({...ct(),...t});if(r.reporter!==void 0&&r.asyncReporter!==void 0)throw new Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(r.asyncReporter!==void 0&&!e.isAsync())throw new Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let n=wN(e,r),i=r.path.length===0||r.path.indexOf(":")===-1?r.numRuns:-1,o=r.numRuns*r.maxSkipsPerRun,s=(...u)=>n.shrink(...u),a=new RN(r.path.length===0?d1(n,r.seed,r.randomType,r.examples):p1(r.path,rr(f1(n,r.seed,r.randomType,r.examples)),s),i,o),l=r.endOnFailure?j.nil:s;return n.isAsync()?UN(n,l,a,r.verbose,r.markInterruptAsFailure).then(u=>u.toRunDetails(r.seed,r.path,o,r)):BN(n,l,a,r.verbose,r.markInterruptAsFailure).toRunDetails(r.seed,r.path,o,r)}function WN(e,t){let r=y1(e,t);if(e.isAsync())return r.then(VN);jN(r)}function zN(e,t){let r=Object.prototype.hasOwnProperty.call(e,"isAsync")?e:new i1(e,()=>!0);return t.unbiased===!0?new s1(r):r}function b1(e,t){let r=wd(typeof t=="number"?{...ct(),numRuns:t}:{...ct(),...t}),n=zN(e,r),i=n.shrink.bind(n);return(r.path.length===0?rr(d1(n,r.seed,r.randomType,r.examples)):p1(r.path,rr(f1(n,r.seed,r.randomType,r.examples)),i)).take(r.numRuns).map(o=>o.value_)}function GN(e,t){return[...b1(e,t)]}function HN(e){return(Math.round(e*100)/100).toFixed(2)}function qN(e,t,r){let n=wd(typeof r=="number"?{...ct(),numRuns:r}:{...ct(),...r}),i={};for(let l of b1(e,r)){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],`${HN(l[1]*100/n.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)n.logger(`${l[0].padEnd(s,".")}..${l[1].padStart(a,".")}`)}var KN=Object.assign;function Jc(e,t,r,n){let i=r(),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 $(s.history,{arb:u,value:p,context:c.context,mrng:c.mrng}),o=c.mrng.clone(),p}let d=u.generate(o,t);return $(s.history,{arb:u,value:d.value_,context:d.context,mrng:o.clone()}),d.value},l=(u,...c)=>a(n(u,c));return new _(KN(l,{values(){return G(s.history,u=>u.value)},[Me](){return Jc(e,t,r,n).value},[dt](){return xe(G(s.history,u=>u.value))}}),s)}var Cc=Array.isArray,MS=Object.keys,YN=Object.is;function JN(e){let t=new _t;return function(n,i){let o=Ye(t,n);if(o===void 0){let l=n(...i);return ut(t,n,[{args:i,value:l}]),l}let s=o;for(let l of s)if(e(i,l.args))return l.value;let a=n(...i);return $(s,{args:i,value:a}),a}}function S1(e,t){if(e!==null&&typeof e=="object"&&t!==null&&typeof t=="object"){if(Cc(e)){if(!Cc(t)||e.length!==t.length)return!1}else if(Cc(t))return!1;if(MS(e).length!==MS(t).length)return!1;for(let r in e)if(!(r in t)||!S1(e[r],t[r]))return!1;return!0}else return YN(e,t)}var ZN=class extends de{constructor(...e){super(...e),this.arbitraryCache=JN(S1)}generate(e,t){return Jc(e,t,()=>[],this.arbitraryCache)}canShrinkWithoutContext(e){return!1}shrink(e,t){if(t===void 0)return j.nil();let r=t,n=r.mrng,i=r.biasFactor,o=r.history;return t1(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 G(o,(c,d)=>({arb:c.arb,value:l[d],context:u[d],mrng:c.mrng}))}return Jc(n,i,a,this.arbitraryCache)})}};function XN(){return new ZN}var QN=Math.floor,OS=Math.log;function e3(e){return QN(OS(e)/OS(2))}function t3(e){return e===O(0)?O(0):O(Ve(e).length)}function w1(e,t,r){if(e===t)return[{min:e,max:t}];if(e<0&&t>0){let s=r(-e),a=r(t);return[{min:-s,max:a},{min:t-a,max:t},{min:e,max:e+s}]}let n=r(t-e),i={min:e,max:e+n},o={min:t-n,max:t};return e<0?[o,i]:[i,o]}var r3=Math.ceil,n3=Math.floor;function NS(e){return n3(e/2)}function LS(e){return r3(e/2)}function $S(e,t,r){let n=e-t;function*i(){let s=r?void 0:t,a=r?n:NS(n);for(let l=a;l>0;l=NS(l)){let u=l===n?t:e-l;yield new _(u,s),s=u}}function*o(){let s=r?void 0:t,a=r?n:LS(n);for(let l=a;l<0;l=LS(l)){let u=l===n?t:e-l;yield new _(u,s),s=u}}return n>0?rr(i()):rr(o())}var DS=Math.sign,i3=Number.isInteger,o3=Object.is,an=class v1 extends de{constructor(t,r){super(),this.min=t,this.max=r}generate(t,r){let n=this.computeGenerateRange(t,r);return new _(t.nextInt(n.min,n.max),void 0)}canShrinkWithoutContext(t){return typeof t=="number"&&i3(t)&&!o3(t,-0)&&this.min<=t&&t<=this.max}shrink(t,r){return v1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new _(r,void 0)):$S(t,r,!1):$S(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?0:this.min<0?this.max:this.min}computeGenerateRange(t,r){if(r===void 0||t.nextInt(1,r)!==1)return{min:this.min,max:this.max};let n=w1(this.min,this.max,e3);if(n.length===1)return n[0];let i=t.nextInt(-2*(n.length-1),n.length-2);return i<0?n[0]:n[i+1]}isLastChanceTry(t,r){return t>0?t===r+1&&t>this.min:t<0?t===r-1&&t<this.max:!1}static isValidContext(t,r){if(r===void 0)return!1;if(typeof r!="number")throw new Error("Invalid context type passed to IntegerArbitrary (#1)");if(r!==0&&DS(t)!==DS(r))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},_S=Number.isInteger;function s3(e){return{min:e.min!==void 0?e.min:-2147483648,max:e.max!==void 0?e.max:2147483647}}function ie(e={}){let t=s3(e);if(t.min>t.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!_S(t.min))throw new Error("fc.integer minimum value should be an integer");if(!_S(t.max))throw new Error("fc.integer maximum value should be an integer");return new an(t.min,t.max)}var FS=new Map;function Cd(e){if(e===void 0)return{depth:0};if(typeof e!="string")return e;let t=Ye(FS,e);if(t!==void 0)return t;let r={depth:0};return ut(FS,e,r),r}function Ad(){return{depth:0}}var a3=class{constructor(e,t,r){this.arb=e,this.mrng=t,this.biasFactor=r}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},l3=Math.min,u3=Math.max,c3=class{constructor(e,t,r,n){this.arb=e,this.mrng=t,this.slices=r,this.biasFactor=n,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 r=0;r!==this.slices.length;++r)this.slices[r].length===e&&$(t,r);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 _(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 _(e[0],void 0);let t=this.mrng.nextInt(0,e.length-1),r=this.mrng.nextInt(0,e.length-1);return this.nextIndexInSlice=l3(t,r),this.lastIndexInSlice=u3(t,r),new _(e[this.nextIndexInSlice++],void 0)}};function jS(e,t,r,n){return n===void 0||r.length===0||t.nextInt(1,n)!==1?new a3(e,t,n):new c3(e,t,r,n)}var d3=Math.floor,VS=Math.log,BS=Math.max,f3=Array.isArray;function Ac(e,t){return e===t?e:e+d3(VS(t-e)/VS(2))}var x1=class R1 extends de{constructor(t,r,n,i,o,s,a){super(),this.arb=t,this.minLength=r,this.maxGeneratedLength=n,this.maxLength=i,this.setBuilder=s,this.customSlices=a,this.lengthArb=ie({min:r,max:n}),this.depthContext=Cd(o)}preFilter(t){if(this.setBuilder===void 0)return t;let r=this.setBuilder();for(let n=0;n!==t.length;++n)r.tryAdd(t[n]);return r.getData()}static makeItCloneable(t,r){return t[Me]=()=>{let n=[];for(let i=0;i!==r.length;++i)$(n,r[i].value);return this.makeItCloneable(n,r),n},t}generateNItemsNoDuplicates(t,r,n,i){let o=0,s=t(),a=jS(this.arb,n,this.customSlices,i);for(;s.size()<r&&o<this.maxGeneratedLength;){let l=a.next();s.tryAdd(l)?o=0:o+=1}return s.getData()}safeGenerateNItemsNoDuplicates(t,r,n,i){let o=BS(0,r-Ac(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=o;try{return this.generateNItemsNoDuplicates(t,r,n,i)}finally{this.depthContext.depth-=o}}generateNItems(t,r,n){let i=[],o=jS(this.arb,r,this.customSlices,n);o.attemptExact(t);for(let s=0;s!==t;++s)$(i,o.next());return i}safeGenerateNItems(t,r,n){let i=BS(0,t-Ac(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=i;try{return this.generateNItems(t,r,n)}finally{this.depthContext.depth-=i}}wrapper(t,r,n,i){let o=r?this.preFilter(t):t,s=!1,a=[],l=[];for(let u=0;u!==o.length;++u){let c=o[u];s=s||c.hasToBeCloned,$(a,c.value),$(l,c.context)}return s&&R1.makeItCloneable(a,o),new _(a,{shrunkOnce:r,lengthContext:t.length===o.length&&n!==void 0?n:void 0,itemsContexts:l,startIndex:i})}generate(t,r){let n=this.applyBias(t,r),i=n.size,o=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,i,t,n.biasFactorItems):this.safeGenerateNItems(i,t,n.biasFactorItems);return this.wrapper(o,!1,void 0,0)}applyBias(t,r){if(r===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:r};if(t.nextInt(1,r)!==1)return{size:this.lengthArb.generate(t,void 0).value};if(t.nextInt(1,r)!==1||this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:r};let n=Ac(this.minLength,this.maxGeneratedLength);return{size:ie({min:this.minLength,max:n}).generate(t,void 0).value,biasFactorItems:r}}canShrinkWithoutContext(t){if(!f3(t)||this.minLength>t.length||t.length>this.maxLength)return!1;for(let r=0;r!==t.length;++r)if(!(r in t)||!this.arb.canShrinkWithoutContext(t[r]))return!1;return this.preFilter(G(t,r=>new _(r,void 0))).length===t.length}shrinkItemByItem(t,r,n){let i=[];for(let o=r.startIndex;o<n;++o)$(i,tr(()=>this.arb.shrink(t[o],r.itemsContexts[o]).map(s=>{let a=G(Le(t,0,o),(u,c)=>new _(rn(u),r.itemsContexts[c])),l=G(Le(t,o+1),(u,c)=>new _(rn(u),r.itemsContexts[c+o+1]));return[[...a,s,...l],void 0,o]})));return j.nil().join(...i)}shrinkImpl(t,r){if(t.length===0)return j.nil();let n=r!==void 0?r:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(t.length,n.lengthContext).drop(n.shrunkOnce&&n.lengthContext===void 0&&t.length>this.minLength+1?1:0).map(i=>{let o=t.length-i.value;return[G(Le(t,o),(s,a)=>new _(rn(s),n.itemsContexts[a+o])),i.context,0]}).join(tr(()=>t.length>this.minLength?this.shrinkItemByItem(t,n,1):this.shrinkItemByItem(t,n,t.length))).join(t.length>this.minLength?tr(()=>{let i={shrunkOnce:!1,lengthContext:void 0,itemsContexts:Le(n.itemsContexts,1),startIndex:0};return this.shrinkImpl(Le(t,1),i).filter(o=>this.minLength<=o[0].length+1).map(o=>[[new _(rn(t[0]),n.itemsContexts[0]),...o[0]],void 0,0])}):j.nil())}shrink(t,r){return this.shrinkImpl(t,r).map(n=>this.wrapper(n[0],!0,n[1],n[2]))}},p3=Math.floor,h3=Math.min,Rr=2147483647,Qr=["xsmall","small","medium","large","xlarge"],m3=["-4","-3","-2","-1","=","+1","+2","+3","+4"],Id="small";function g3(e,t){switch(t){case"xsmall":return p3(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 bi(e,t){let r=$t(m3,e);if(r===-1)return e;let n=$t(Qr,t);if(n===-1)throw new Error(`Unable to offset size based on the unknown defaulted one: ${t}`);let i=n+r-4;return i<0?Qr[0]:i>=Qr.length?Qr[Qr.length-1]:Qr[i]}function gi(e,t,r,n){let{baseSize:i=Id,defaultSizeToMaxWhenMaxSpecified:o}=ct()||{},s=e!==void 0?e:n&&o?"max":i;return s==="max"?r:h3(g3(t,bi(s,i)),r)}function y3(e,t){if(typeof e=="number")return 1/e;let{baseSize:r=Id,defaultSizeToMaxWhenMaxSpecified:n}=ct()||{},i=e!==void 0?e:t&&n?"max":r;if(i==="max")return 0;switch(bi(i,r)){case"xsmall":return 1;case"small":return .5;case"medium":return .25;case"large":return .125;case"xlarge":return .0625}}function Pd(e){let{baseSize:t=Id}=ct()||{};return e===void 0?t:bi(e,t)}function ae(e,t={}){let r=t.size,n=t.minLength||0,i=t.maxLength,o=t.depthIdentifier,s=i!==void 0?i:Rr;return new x1(e,n,gi(r,n,s,i!==void 0),s,o,void 0,t.experimentalCustomSlices||[])}function Cs(e){return e/O(2)}function US(e,t,r){let n=e-t;function*i(){let s=r?void 0:t,a=r?n:Cs(n);for(let l=a;l>0;l=Cs(l)){let u=e-l;yield new _(u,s),s=u}}function*o(){let s=r?void 0:t,a=r?n:Cs(n);for(let l=a;l<0;l=Cs(l)){let u=e-l;yield new _(u,s),s=u}}return n>0?rr(i()):rr(o())}var b3=class k1 extends de{constructor(t,r){super(),this.min=t,this.max=r}generate(t,r){let n=this.computeGenerateRange(t,r);return new _(t.nextBigInt(n.min,n.max),void 0)}computeGenerateRange(t,r){if(r===void 0||t.nextInt(1,r)!==1)return{min:this.min,max:this.max};let n=w1(this.min,this.max,t3);if(n.length===1)return n[0];let i=t.nextInt(-2*(n.length-1),n.length-2);return i<0?n[0]:n[i+1]}canShrinkWithoutContext(t){return typeof t=="bigint"&&this.min<=t&&t<=this.max}shrink(t,r){return k1.isValidContext(t,r)?this.isLastChanceTry(t,r)?j.of(new _(r,void 0)):US(t,r,!1):US(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?O(0):this.min<0?this.max:this.min}isLastChanceTry(t,r){return t>0?t===r+O(1)&&t>this.min:t<0?t===r-O(1)&&t<this.max:!1}static isValidContext(t,r){if(r===void 0)return!1;if(typeof r!="bigint")throw new Error("Invalid context type passed to BigIntArbitrary (#1)");let n=t>0&&r<0||t<0&&r>0;if(r!==O(0)&&n)throw new Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function S3(e){let r=O(-1)<<O(255),n=(O(1)<<O(255))-O(1),i=e.min,o=e.max;return{min:i!==void 0?i:r-(o!==void 0&&o<O(0)?o*o:O(0)),max:o!==void 0?o:n+(i!==void 0&&i>O(0)?i*i:O(0))}}function w3(e){return e[0]===void 0?{}:e[1]===void 0?e[0]:{min:e[0],max:e[1]}}function nr(...e){let t=S3(w3(e));if(t.min>t.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new b3(t.min,t.max)}var v3=Object.getPrototypeOf,ui=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 Ws(e){return v3(e)===ui.prototype&&e.generate===ui.prototype.generate&&e.canShrinkWithoutContext===ui.prototype.canShrinkWithoutContext&&e.shrink===ui.prototype.shrink?e:new ui(e)}function x3(e){return e===1}function R3(e){if(typeof e!="boolean")throw new Error("Unsupported input type");return e===!0?1:0}function Si(){return Ws(ie({min:0,max:1}).map(x3,R3))}var fi=Object.is,k3=class{constructor(e){this.values=e,this.fastValues=new nn(this.values);let t=!1,r=!1;if(Us(this.fastValues,0))for(let n=0;n!==this.values.length;++n){let i=this.values[n];t=t||fi(i,-0),r=r||fi(i,0)}this.hasMinusZero=t,this.hasPlusZero=r}has(e){return e===0?fi(e,0)?this.hasPlusZero:this.hasMinusZero:Us(this.fastValues,e)}},E1=class extends de{constructor(e){super(),this.values=e}generate(e,t){let r=this.values.length===1?0:e.nextInt(0,this.values.length-1),n=this.values[r];return xr(n)?new _(n,r,()=>n[Me]()):new _(n,r)}canShrinkWithoutContext(e){return this.values.length===1?fi(this.values[0],e):(this.fastValues===void 0&&(this.fastValues=new k3(this.values)),this.fastValues.has(e))}shrink(e,t){return t===0||fi(e,this.values[0])?j.nil():j.of(new _(this.values[0],0))}};function wt(...e){if(e.length===0)throw new Error("fc.constantFrom expects at least one parameter");return new E1(e)}function E3(e){return!e||!e.withBigInt?wt(!1,null,void 0,0,"",NaN):wt(!1,null,void 0,0,"",NaN,O(0))}function ve(e){return new E1([e])}var C3=class C1{constructor(){this.receivedLogs=[]}log(t){this.receivedLogs.push(t)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[Me](){return new C1}};function A3(){return ve(new C3)}var I3=NaN,P3=Number.isNaN;function A1(e){return new Vs(e)}function I1(e){if(!(e instanceof Vs)||e.constructor!==Vs)throw new L("Not a valid value for date unmapper");return Bs(e)}function T3(e){return t=>t===e?new Vs(I3):A1(t)}function M3(e){return t=>{let r=I1(t);return P3(r)?e:r}}var WS=Number.isNaN;function P1(e={}){let t=e.min!==void 0?Bs(e.min):-864e13,r=e.max!==void 0?Bs(e.max):864e13,n=e.noInvalidDate;if(WS(t))throw new Error("fc.date min must be valid instance of Date");if(WS(r))throw new Error("fc.date max must be valid instance of Date");if(t>r)throw new Error("fc.date max must be greater or equal to min");if(n)return ie({min:t,max:r}).map(A1,I1);let i=r+1;return ie({min:t,max:r+1}).map(T3(i),M3(i))}var O3=class extends de{constructor(e,t){super(),this.startArb=e,this.chainer=t}generate(e,t){let r=[],n=e.clone(),i=this.startArb.generate(e,t);for(r.push({arbitrary:this.startArb,value:i.value_,context:i.context,clonedMrng:n});;){let s=this.chainer(i.value_);if(s===void 0)break;let a=e.clone();i=s.generate(e,t),r.push({arbitrary:s,value:i.value_,context:i.context,clonedMrng:a})}let o={biasFactor:t,entries:r,currentShrinkLevel:0};return new _(i.value_,o)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?new j(this.shrinkIterator(t)):j.nil()}*shrinkIterator(e){let{entries:t,currentShrinkLevel:r,biasFactor:n}=e;for(let i=r;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 h=this.chainer(u.value_);if(h===void 0)break;let f=c.clone(),m=h.generate(c,n);l.push({arbitrary:h,value:m.value_,context:m.context,clonedMrng:f}),u=m}let d=l[l.length-1],p={biasFactor:n,entries:l,currentShrinkLevel:i};yield new _(d.value,p)}}}isSafeContext(e){return e!=null&&typeof e=="object"&&"biasFactor"in e&&"entries"in e&&"currentShrinkLevel"in e}};function N3(e,t){return new O3(e,t)}var L3=Symbol.iterator,$3=Array.isArray,D3=Object.is,_3=class T1 extends de{constructor(t,r){super(),this.arb=t,this.numValues=r}generate(t,r){let n=[];if(this.numValues<=0)return this.wrapper(n);for(let i=0;i!==this.numValues-1;++i)$(n,this.arb.generate(t.clone(),r));return $(n,this.arb.generate(t,r)),this.wrapper(n)}canShrinkWithoutContext(t){if(!$3(t)||t.length!==this.numValues)return!1;if(t.length===0)return!0;for(let r=1;r<t.length;++r)if(!D3(t[0],t[r]))return!1;return this.arb.canShrinkWithoutContext(t[0])}shrink(t,r){return t.length===0?j.nil():new j(this.shrinkImpl(t,r!==void 0?r:[])).map(n=>this.wrapper(n))}*shrinkImpl(t,r){let n=G(t,(o,s)=>this.arb.shrink(o,r[s])[L3]()),i=G(n,o=>o.next());for(;!i[0].done;)yield G(i,o=>o.value),i=G(n,o=>o.next())}static makeItCloneable(t,r){return t[Me]=()=>{let n=[];for(let i=0;i!==r.length;++i)$(n,r[i].value);return this.makeItCloneable(n,r),n},t}wrapper(t){let r=!1,n=[],i=[];for(let o=0;o!==t.length;++o){let s=t[o];r=r||s.hasToBeCloned,$(n,s.value),$(i,s.context)}return r&&T1.makeItCloneable(n,t),new _(n,i)}};function F3(e,t){return new _3(e,t)}var zS=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 $(this.data,e),!0}size(){return this.data.length}getData(){return this.data}},j3=Number.isNaN,V3=class{constructor(e){this.selector=e,this.selectedItemsExceptNaN=new nn,this.data=[]}tryAdd(e){let t=this.selector(e);if(j3(t))return $(this.data,e),!0;let r=this.selectedItemsExceptNaN.size;return pi(this.selectedItemsExceptNaN,t),r!==this.selectedItemsExceptNaN.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},B3=Object.is,U3=class{constructor(e){this.selector=e,this.selectedItemsExceptMinusZero=new nn,this.data=[],this.hasMinusZero=!1}tryAdd(e){let t=this.selector(e);if(B3(t,-0))return this.hasMinusZero?!1:($(this.data,e),this.hasMinusZero=!0,!0);let r=this.selectedItemsExceptMinusZero.size;return pi(this.selectedItemsExceptMinusZero,t),r!==this.selectedItemsExceptMinusZero.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},W3=class{constructor(e){this.selector=e,this.selectedItems=new nn,this.data=[]}tryAdd(e){let t=this.selector(e),r=this.selectedItems.size;return pi(this.selectedItems,t),r!==this.selectedItems.size?($(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}};function z3(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 zS(l)}let n=e.comparator,i=e.selector,o=a=>i(a.value_),s=(a,l)=>n(o(a),o(l));return()=>new zS(s)}let t=e.selector||(n=>n),r=n=>t(n.value_);switch(e.comparator){case"IsStrictlyEqual":return()=>new V3(r);case"SameValueZero":return()=>new W3(r);case"SameValue":case void 0:return()=>new U3(r)}}function kr(e,t={}){let r=t.minLength!==void 0?t.minLength:0,n=t.maxLength!==void 0?t.maxLength:Rr,i=gi(t.size,r,n,t.maxLength!==void 0),o=t.depthIdentifier,s=new x1(e,r,i,n,o,z3(t),[]);return r===0?s:s.filter(a=>a.length>=r)}var G3=Object.create,H3=Object.defineProperty,q3=Object.getOwnPropertyDescriptor,GS=Object.getPrototypeOf,K3=Object.prototype,Y3=Reflect.ownKeys;function J3(e){let t=e[1]?G3(null):{};for(let r of e[0])H3(t,r[0],{enumerable:!0,configurable:!0,writable:!0,value:r[1]});return t}function Z3(e){return e!==void 0&&!!e.configurable&&!!e.enumerable&&!!e.writable&&e.get===void 0&&e.set===void 0}function X3(e){if(typeof e!="object"||e===null)throw new L("Incompatible instance received: should be a non-null object");let t=GS(e)===null,r=GS(e)===K3;if(!t&&!r)throw new L("Incompatible instance received: should be of exact type Object");let n=G(Y3(e),i=>[i,q3(e,i)]);if(!Jw(n,([,i])=>Z3(i)))throw new L("Incompatible instance received: should contain only c/e/w properties without get/set");return[G(n,([i,o])=>[i,o.value]),t]}function Q3(e){return e[0]}function Td(e,t,r={}){let n=!!r.noNullPrototype;return B(kr(B(e,t),{minLength:r.minKeys,maxLength:r.maxKeys,size:r.size,selector:Q3,depthIdentifier:r.depthIdentifier}),n?ve(!1):Si()).map(J3,X3)}var eL=Number.POSITIVE_INFINITY,tL=Number.MAX_SAFE_INTEGER,rL=Number.isInteger,nL=Math.floor,iL=Math.pow,oL=Math.min,Zc=class M1 extends de{static from(t,r,n){if(t.length===0)throw new Error(`${n} 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(`${n} expects arbitraries to be specified`);let s=t[o].weight;if(i+=s,!rL(s))throw new Error(`${n} expects weights to be integer values`);if(s<0)throw new Error(`${n} expects weights to be superior or equal to 0`)}if(i<=0)throw new Error(`${n} expects the sum of weights to be strictly superior to 0`);return new M1(t,{depthBias:y3(r.depthSize,r.maxDepth!==void 0),maxDepth:r.maxDepth!==void 0?r.maxDepth:eL,withCrossShrink:!!r.withCrossShrink},Cd(r.depthIdentifier))}constructor(t,r,n){super(),this.warbs=t,this.constraints=r,this.context=n;let i=0;this.cumulatedWeights=[];for(let o=0;o!==t.length;++o)i+=t[o].weight,$(this.cumulatedWeights,i);this.totalWeight=i}generate(t,r){if(this.mustGenerateFirst())return this.safeGenerateForIndex(t,0,r);let n=t.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let i=0;i!==this.cumulatedWeights.length;++i)if(n<this.cumulatedWeights[i])return this.safeGenerateForIndex(t,i,r);throw new Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(t){return this.canShrinkWithoutContextIndex(t)!==-1}shrink(t,r){if(r!==void 0){let i=r,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 j.of(l).join(a)}return a}let n=this.canShrinkWithoutContextIndex(t);return n===-1?j.nil():this.defaultShrinkForFirst(n).join(this.warbs[n].arbitrary.shrink(t,void 0).map(i=>this.mapIntoValue(n,i,null,void 0)))}defaultShrinkForFirst(t){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(t)||this.warbs[0].fallbackValue===void 0)return j.nil()}finally{--this.context.depth}let r=new _(this.warbs[0].fallbackValue.default,void 0);return j.of(this.mapIntoValue(0,r,null,void 0))}canShrinkWithoutContextIndex(t){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(t)?0:-1;try{++this.context.depth;for(let r=0;r!==this.warbs.length;++r){let n=this.warbs[r];if(n.weight!==0&&n.arbitrary.canShrinkWithoutContext(t))return r}return-1}finally{--this.context.depth}}mapIntoValue(t,r,n,i){let o={selectedIndex:t,originalBias:i,originalContext:r.context,clonedMrngForFallbackFirst:n};return new _(r.value,o)}safeGenerateForIndex(t,r,n){++this.context.depth;try{let i=this.warbs[r].arbitrary.generate(t,n),o=this.mustFallbackToFirstInShrink(r)?t.clone():null;return this.mapIntoValue(r,i,o,n)}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 r=nL(iL(1+t,this.context.depth))-1;return-oL(this.totalWeight*r,tL)||0}};function sL(e){return e!=null&&typeof e=="object"&&!("generate"in e)&&!("arbitrary"in e)&&!("weight"in e)}function HS(e){return jw(e)?{arbitrary:e,weight:1}:e}function Te(...e){let t=e[0];if(sL(t)){let n=G(Le(e,1),HS);return Zc.from(n,t,"fc.oneof")}let r=G(e,HS);return Zc.from(r,{},"fc.oneof")}var aL=Number.isInteger;function er(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(!aL(t))throw new Error("fc.nat maximum value should be an integer");return new an(0,t)}var lL=Object.is;function uL(e){let t=0,r=[];for(let n of e){let i=t;t=i+n.num;let o=t-1;r.push({from:i,to:o,entry:n})}return r}function cL(e,t){let r=0,n=e.length;for(;n-r>1;){let i=~~((r+n)/2);t<e[i].from?n=i:r=i}return e[r]}function dL(e){let t=uL(e);return function(n){let i=cL(t,n);return i.entry.build(n-i.from)}}function fL(e){let t={mapping:new _t,negativeZeroIndex:void 0},r=0;for(let n=0;n!==e.length;++n){let i=e[n];for(let o=0;o!==i.num;++o){let s=i.build(o);s===0&&1/s===Dt.NEGATIVE_INFINITY?t.negativeZeroIndex=r:ut(t.mapping,s,r),++r}}return t}function pL(e){let t=null;return function(n){t===null&&(t=fL(e));let i=lL(n,-0)?t.negativeZeroIndex:Ye(t.mapping,n);if(i===void 0)throw new L("Unknown value encountered cannot be built using this mapToConstant");return i}}function hL(e){if(e.length===0)throw new L("fc.mapToConstant expects at least one option");let t=0;for(let r=0;r!==e.length;++r){if(e[r].num<0)throw new L("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");t+=e[r].num}if(t===0)throw new L("fc.mapToConstant expects at least one choice among options");return t}function ln(...e){return er({max:hL(e)-1}).map(dL(e),pL(e))}function O1(e,t,r,n){if(t.length===0)return r>0?void 0:[];if(n<=0)return;let i=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];for(;i.length>0;){let o=qw(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<r)break;return l}$(i,{endIndexChunks:o.endIndexChunks,nextStartIndex:s+1,chunks:o.chunks}),l.length<n&&$(i,{endIndexChunks:s,nextStartIndex:s+1,chunks:l});break}}}}function mL(e){return ce(e,"")}function N1(e){return e.minLength!==void 0?e.minLength:0}function L1(e){return e.maxLength!==void 0?e.maxLength:Rr}function gL(e,t){return N1(t)<=e.length&&e.length<=L1(t)}function yL(e,t){return function(n){if(typeof n!="string")throw new L("Unsupported value");let i=O1(e,n,N1(t),L1(t));if(i===void 0)throw new L("Unable to unmap received string");return i}}var $1=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function bL(e,t,r){let n;try{n=r(e)}catch{return}for(let i of n)if(!t.canShrinkWithoutContext(i))return;return n}function SL(e,t){let r=[];for(let n of $1){let i=bL(n,e,t);i!==void 0&&$(r,i)}return r}var qS=new WeakMap;function wL(e){let t=[];for(let r of $1){let n=O1(e,r,0,Rr);n!==void 0&&$(t,n)}return t}function vL(e,t){let r=S4(qS,e);r===void 0&&(r=wL(e),b4(qS,e,r));let n=[];for(let i of r)gL(i,t)&&$(n,i);return n}var xL=[[0,127]],RL=[[0,55295],[57344,1114111]],kL=[[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]],EL=[[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]],KS=String.fromCodePoint,CL=Math.min,AL=Math.max;function Xc(e){if(e.length===1){let r=KS(e[0]);return{num:1,build:()=>r}}let t=e[0];return{num:e[1]-e[0]+1,build:r=>KS(t+r)}}function YS(e,t){let r=[],n=0,i=0;for(;n<e.length&&i<t.length;){let o=e[n],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)n+=1;else if(c<s)i+=1;else{let d=AL(s,u),p=CL(a,c);if(r.length>=1){let h=r[r.length-1];(h.length===1?h[0]:h[1])+1===d&&(d=h[0],qw(r))}$(r,d===p?[d]:[d,p]),a<=p&&(n+=1),c<=p&&(i+=1)}}return r}var JS=Object.create(null);function IL(e){switch(e){case"full":return RL;case"ascii":return xL}}function PL(e,t){let r=`${e}:${t}`,n=JS[r];if(n!==void 0)return n;let i=IL(t),o=e==="binary"?i:YS(i,kL),s=[];for(let l of o)$(s,Xc(l));if(e==="grapheme"){let l=YS(i,EL);for(let u of l){let c=Xc(u);$(s,{num:c.num,build:d=>_4(c.build(d),"NFD")})}}let a=ln(...s);return JS[r]=a,a}function ci(e,t){return PL(e,t)}function TL(e){if(typeof e.unit=="object")return e.unit;switch(e.unit){case"grapheme":return ci("grapheme","full");case"grapheme-composite":return ci("composite","full");case"grapheme-ascii":case void 0:return ci("grapheme","ascii");case"binary":return ci("binary","full");case"binary-ascii":return ci("binary","ascii")}}function Ce(e={}){let t=TL(e),r=yL(t,e),n=vL(t,e);return ae(t,{...e,experimentalCustomSlices:n}).map(mL,r)}var D1=Map,Md=String.fromCharCode,Od={num:26,build:e=>Md(e+97)},ML={num:26,build:e=>Md(e+65)},_1={num:10,build:e=>Md(e+48)};function OL(e){let t=J6(e);return e!==t?t:`%${hi(on(e,0),16)}`}function NL(e){if(typeof e!="string")throw new Error("Unsupported");return decodeURIComponent(e)}var LL=()=>Ce({unit:"binary",minLength:1,maxLength:1}).map(OL,NL),Ic;function $L(){return Ic===void 0&&(Ic=ln(Od)),Ic}var As;function Qc(e){As===void 0&&(As=new D1);let t=Ye(As,e);return t===void 0&&(t=ln(Od,_1,{num:e.length,build:r=>e[r]}),ut(As,e,t)),t}function DL(e){return ln(Od,ML,_1,{num:e.length,build:t=>e[t]})}var Is;function Nd(e){Is===void 0&&(Is=new D1);let t=Ye(Is,e);return t===void 0&&(t=Te({weight:10,arbitrary:DL(e)},{weight:1,arbitrary:LL()}),ut(Is,e,t)),t}function jt(e,t={}){let r=t.freq===void 0?6:t.freq,n=Zw(t,"nil")?t.nil:null,i=[{arbitrary:ve(n),weight:1,fallbackValue:{default:n}},{arbitrary:e,weight:r-1}],o={withCrossShrink:!0,depthSize:t.depthSize,maxDepth:t.maxDepth,depthIdentifier:t.depthIdentifier};return Zc.from(i,o,"fc.option")}function _L(e){return e.length>63?!1:e.length<4||e[0]!=="x"||e[1]!=="n"||e[2]!=="-"||e[3]!=="-"}var F1=Symbol("adapted-value");function FL(e,t){let r=t(e.value_);return r.adapted?new _(r.value,F1):e}var jL=class extends de{constructor(e,t){super(),this.sourceArb=e,this.adapter=t,this.adaptValue=r=>FL(r,t)}generate(e,t){let r=this.sourceArb.generate(e,t);return this.adaptValue(r)}canShrinkWithoutContext(e){return this.sourceArb.canShrinkWithoutContext(e)&&!this.adapter(e).adapted}shrink(e,t){return t===F1?this.sourceArb.canShrinkWithoutContext(e)?this.sourceArb.shrink(e,void 0).map(this.adaptValue):j.nil():this.sourceArb.shrink(e,t).map(this.adaptValue)}};function j1(e,t){return new jL(e,t)}function VL([e,t]){return t===null?e:`${e}${t[0]}${t[1]}`}function BL(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 UL(e){let t=Qc("");return B(t,jt(B(Ce({unit:Qc("-"),size:e,maxLength:61}),t))).map(VL,BL).filter(_L)}function WL(e){return`${ce(e[0],".")}.${e[1]}`}function zL(e){if(typeof e!="string")throw new Error("Unsupported type");let t=e.lastIndexOf(".");return[Be(ge(e,0,t),"."),ge(e,t+1)]}function GL(e){let[t,r]=e,n=r.length;for(let i=0;i!==t.length;++i)if(n+=1+t[i].length,n>255)return{adapted:!0,value:[Le(t,0,i),r]};return{adapted:!1,value:e}}function Ld(e={}){let t=Pd(e.size),r=bi("-1",t),n=Ce({unit:$L(),minLength:2,maxLength:63,size:r});return j1(B(ae(UL(t),{size:r,minLength:1,maxLength:127}),n),GL).map(WL,zL)}function HL(e){let t=e[0].length;for(let r=1;r!==e.length;++r)if(t+=1+e[r].length,t>64)return{adapted:!0,value:Le(e,0,r)};return{adapted:!1,value:e}}function qL(e){return ce(e,".")}function KL(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,".")}function YL(e){return`${e[0]}@${e[1]}`}function JL(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,"@",2)}function ZL(e={}){return B(j1(ae(Ce({unit:Qc("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:e.size}),{minLength:1,maxLength:32,size:e.size}),HL).map(qL,KL),Ld({size:e.size})).map(YL,JL)}var XL=Dt.NEGATIVE_INFINITY,ed=Dt.POSITIVE_INFINITY,V1=Dt.EPSILON,$d=O(2146435072)*O(4294967296),QL=-$d-O(1),ZS=4503599627370496,e$=O(0xfffffffffffff),XS=O("9007199254740992"),td=new Float64Array(1),QS=new Uint32Array(td.buffer,td.byteOffset);function t$(e){return td[0]=e,[QS[1],QS[0]]}function r$(e){let{0:t,1:r}=t$(e),n=t>>>31,i=t>>>20&2047,o=(t&1048575)*4294967296+r,s=i===0?-1022:i-1023,a=i===0?0:1;return a+=o*V1,a*=n===0?1:-1,{exponent:s,significand:a}}function ew(e,t){return e===-1022?O(t*ZS):O((t-1)*ZS)+(O(e+1023)<<O(52))}function Dd(e){if(e===ed)return $d;if(e===XL)return QL;let t=r$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===ed?ew(r,n):-ew(r,-n)-O(1)}function rd(e){if(e<0)return-rd(-e-O(1));if(e===$d)return ed;if(e<XS)return Dt(e)*2**-1074;let t=e-XS,r=-1021+Dt(t>>O(52));return(1+Dt(t&e$)*V1)*2**r}var tw=Number.isInteger,rw=Object.is,Pc=Number.NEGATIVE_INFINITY,Tc=Number.POSITIVE_INFINITY;function B1(e,t,r,n){let{noDefaultInfinity:i=!1,minExcluded:o=!1,maxExcluded:s=!1,min:a=i?-t:Pc,max:l=i?t:Tc}=e,u=o?a<-r?-n:Math.max(a,-r):a===Pc?Math.max(a,-n):Math.max(a,-r),c=s?l>r?n:Math.min(l,r):l===Tc?Math.min(l,n):Math.min(l,r);return{noDefaultInfinity:!1,minExcluded:o||(a!==Pc||o)&&tw(u),maxExcluded:s||(l!==Tc||s)&&tw(c),min:rw(u,-0)?0:u,max:rw(c,0)?-0:c,noNaN:e.noNaN||!1}}var U1=Number.NEGATIVE_INFINITY,W1=Number.POSITIVE_INFINITY,n$=Number.MAX_VALUE,i$=45035996273704955e-1,nd=4503599627370496;function o$(e){return B1(e,n$,i$,nd)}function s$(e){return e===4503599627370496?W1:e===-4503599627370496?U1:e}function a$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===W1?nd:e===U1?-nd:e}var l$=Number.isInteger,z1=Number.isNaN,u$=Number.NEGATIVE_INFINITY,c$=Number.POSITIVE_INFINITY,nw=Number.MAX_VALUE,d$=NaN;function iw(e,t){if(z1(e))throw new Error("fc.double constraints."+t+" must be a 64-bit float");return Dd(e)}function f$(e){if(typeof e!="number")throw new Error("Unsupported type");return Dd(e)}function p$(e){return!l$(e)}function ow(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-nw:u$,max:s=t?nw:c$}=e,a=iw(o,"min"),l=n?a+O(1):a,u=iw(s,"max"),c=i?u-O(1):u;if(c<l)throw new Error("fc.double constraints.min must be smaller or equal to constraints.max");if(r)return nr({min:l,max:c}).map(rd,f$);let d=c>O(0),p=d?l:l-O(1),h=d?c+O(1):c;return nr({min:p,max:h}).map(f=>c<f||f<l?d$:rd(f),f=>{if(typeof f!="number")throw new Error("Unsupported type");return z1(f)?c!==h?h:p:Dd(f)})}function qs(e={}){return e.noInteger?ow(o$(e)).map(s$,a$).filter(p$):ow(e)}var h$=Number.NEGATIVE_INFINITY,id=Number.POSITIVE_INFINITY,m$=Math.imul,od=2**127*(1+(2**23-1)/2**23),G1=2139095040,g$=-2139095041,sd=new Float32Array(1),y$=new Uint32Array(sd.buffer,sd.byteOffset);function b$(e){return sd[0]=e,y$[0]}function S$(e){let t=b$(e),r=t>>>31,n=t>>>23&255,i=t&8388607,o=n===0?-126:n-127,s=n===0?0:1;return s+=i/2**23,s*=r===0?1:-1,{exponent:o,significand:s}}function sw(e,t){return e===-126?t*8388608:m$(e+127,8388608)+(t-1)*8388608}function _d(e){if(e===id)return G1;if(e===h$)return g$;let t=S$(e),r=t.exponent,n=t.significand;return e>0||e===0&&1/e===id?sw(r,n):-sw(r,-n)-1}function ad(e){if(e<0)return-ad(-e-1);if(e===G1)return id;if(e<16777216)return e*2**-149;let t=e-16777216,r=-125+(t>>23);return(1+(t&8388607)/8388608)*2**r}var H1=Number.NEGATIVE_INFINITY,q1=Number.POSITIVE_INFINITY,w$=od,v$=83886075e-1,ld=8388608;function x$(e){return B1(e,w$,v$,ld)}function R$(e){return e===8388608?q1:e===-8388608?H1:e}function k$(e){if(typeof e!="number")throw new Error("Unsupported type");return e===q1?ld:e===H1?-ld:e}var E$=Number.isInteger,K1=Number.isNaN,C$=Math.fround,A$=Number.NEGATIVE_INFINITY,I$=Number.POSITIVE_INFINITY,P$=NaN;function aw(e,t){let r="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(K1(e)||C$(e)!==e)throw new Error(r);return _d(e)}function T$(e){if(typeof e!="number")throw new Error("Unsupported type");return _d(e)}function M$(e){return!E$(e)}function lw(e){let{noDefaultInfinity:t=!1,noNaN:r=!1,minExcluded:n=!1,maxExcluded:i=!1,min:o=t?-od:A$,max:s=t?od:I$}=e,a=aw(o,"min"),l=n?a+1:a,u=aw(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(r)return ie({min:l,max:c}).map(ad,T$);let d=c>0?l:l-1,p=c>0?c+1:c;return ie({min:d,max:p}).map(h=>h>c||h<l?P$:ad(h),h=>{if(typeof h!="number")throw new Error("Unsupported type");return K1(h)?c!==p?p:d:_d(h)})}function Y1(e={}){return e.noInteger?lw(x$(e)).map(R$,k$).filter(M$):lw(e)}function O$(e){return e.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function J1(e){return e.replace(/\*\//g,"*\\/")}var qe=[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 zs(e){let t=4294967295;for(let r=0;r<e.length;++r){let n=on(e,r);if(n<128)t=qe[t&255^n]^t>>8;else if(n<2048)t=qe[t&255^(192|n>>6&31)]^t>>8,t=qe[t&255^(128|n&63)]^t>>8;else if(n>=55296&&n<57344){let i=on(e,++r);if(n>=56320||i<56320||i>57343||Number.isNaN(i))r-=1,t=qe[t&255^239]^t>>8,t=qe[t&255^191]^t>>8,t=qe[t&255^189]^t>>8;else{let o=(n&1023)+64,s=i&1023;t=qe[t&255^(240|o>>8&7)]^t>>8,t=qe[t&255^(128|o>>2&63)]^t>>8,t=qe[t&255^(128|s>>6&15|(o&3)<<4)]^t>>8,t=qe[t&255^(128|s&63)]^t>>8}}else t=qe[t&255^(224|n>>12&15)]^t>>8,t=qe[t&255^(128|n>>6&63)]^t>>8,t=qe[t&255^(128|n&63)]^t>>8}return(t|0)+2147483648}var N$=Object.getPrototypeOf,di=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 j.nil()}};function Gs(e){return N$(e)===di.prototype&&e.generate===di.prototype.generate&&e.canShrinkWithoutContext===di.prototype.canShrinkWithoutContext&&e.shrink===di.prototype.shrink?e:new di(e)}var L$=Object.assign,$$=Object.keys;function Z1(e){return B(Gs(ie()),Gs(ie({min:1,max:4294967295}))).map(([t,r])=>{let n=()=>{let i={};return L$((s,a)=>{let l=xe(s),u=xe(a),c=e(zs(`${t}${l}`)%r,zs(`${t}${u}`)%r);return i[`[${l},${u}]`]=c,c},{toString:()=>{let s=$$(i).sort().map(a=>`${a} => ${xe(i[a])}`).map(a=>`/* ${J1(a)} */`);return`function(a, b) {
|
|
118
118
|
// With hash and stringify coming from fast-check${s.length!==0?`
|
|
119
119
|
${ce(s,`
|
|
120
120
|
`)}`:""}
|
|
@@ -122,20 +122,20 @@ ${ON(i)}`),o}function m1(e){return Jc(e,xe)}async function g1(e){let t=[];functi
|
|
|
122
122
|
const hA = hash('${t}' + stringify(a)) % ${r};
|
|
123
123
|
const hB = hash('${t}' + stringify(b)) % ${r};
|
|
124
124
|
return cmp(hA, hB);
|
|
125
|
-
}`},[Me]:n})};return n()})}var
|
|
125
|
+
}`},[Me]:n})};return n()})}var D$=Object.assign;function _$(){return Z1(D$((e,t)=>e<t,{toString(){return"(hA, hB) => hA < hB"}}))}var F$=Object.assign;function j$(){return Z1(F$((e,t)=>e-t,{toString(){return"(hA, hB) => hA - hB"}}))}var V$=Object.defineProperties,B$=Object.keys;function U$(e){return B(ae(e,{minLength:1}),Gs(ie())).map(([t,r])=>{let n=()=>{let i={},o=(...a)=>{let l=xe(a),u=t[zs(`${r}${l}`)%t.length];return i[l]=u,xr(u)?u[Me]():u};function s(a){let l=G(G(Yw(B$(i)),u=>`${u} => ${xe(i[u])}`),u=>`/* ${J1(u)} */`);return`function(...args) {
|
|
126
126
|
// With hash and stringify coming from fast-check${l.length!==0?`
|
|
127
127
|
${l.join(`
|
|
128
128
|
`)}`:""}
|
|
129
129
|
const outs = ${a};
|
|
130
130
|
return outs[hash('${r}' + stringify(args)) % outs.length];
|
|
131
|
-
}`}return B$(o,{toString:{value:()=>s(xe(t))},[dt]:{value:()=>s(xe(t))},[Ft]:{value:async()=>s(await kd(t))},[Me]:{value:n,configurable:!0}})};return n()})}var z$=Number.MIN_SAFE_INTEGER,G$=Number.MAX_SAFE_INTEGER;function Q1(){return new an(z$,G$)}var H$=Number.MAX_SAFE_INTEGER;function q$(){return new an(0,H$)}var K$=Number.parseInt;function Y$(e){let[t,r]=e;switch(t){case"oct":return`0${hi(r,8)}`;case"hex":return`0x${hi(r,16)}`;default:return`${r}`}}function Ls(e,t){let r=K$(e,t);if(hi(r,t)!==e)throw new Error("Invalid value");return r}function J$(e){if(typeof e!="string")throw new Error("Invalid type");return e.length>=2&&e[0]==="0"?e[1]==="x"?["hex",Ls(ge(e,2),16)]:["oct",Ls(ge(e,1),8)]:["dec",Ls(e,10)]}function Z$(e){return ce(e,".")}function X$(e){if(typeof e!="string")throw new Error("Invalid type");return G(Be(e,"."),t=>Ls(t,10))}function jd(){return B(er(255),er(255),er(255),er(255)).map(Z$,X$)}function St(e){return B(wt("dec","oct","hex"),er(e)).map(Y$,J$)}function Oc(e){return ce(e,".")}function Nc(e){if(typeof e!="string")throw new Error("Invalid type");return Be(e,".")}function e0(){return Te(B(St(255),St(255),St(255),St(255)).map(Oc,Nc),B(St(255),St(255),St(65535)).map(Oc,Nc),B(St(255),St(16777215)).map(Oc,Nc),St(4294967295))}function Vd(e){return e.length===0?[]:Be(e,":")}function Bd(e){let t=Be(e,":");return t.length>=2&&t[t.length-1].length<=4?[Le(t,0,t.length-2),`${t[t.length-2]}:${t[t.length-1]}`]:[Le(t,0,t.length-1),t[t.length-1]]}function Q$(e){return`${ce(e[0],":")}:${e[1]}`}function eD(e){if(typeof e!="string")throw new Error("Invalid type");return Bd(e)}function tD(e){return`::${ce(e[0],":")}:${e[1]}`}function rD(e){if(typeof e!="string")throw new Error("Invalid type");if(!$4(e,"::"))throw new Error("Invalid value");return Bd(ge(e,2))}function $s(e){return`${ce(e[0],":")}::${ce(e[1],":")}:${e[2]}`}function Ds(e){if(typeof e!="string")throw new Error("Invalid type");let[t,r]=Be(e,"::",2),[n,i]=Bd(r);return[Vd(t),n,i]}function nD(e){return $s([e[0],[e[1]],e[2]])}function iD(e){let t=Ds(e);return[t[0],ce(t[1],":"),t[2]]}function cw(e){return`${ce(e[0],":")}::${e[1]}`}function dw(e){if(typeof e!="string")throw new Error("Invalid type");let[t,r]=Be(e,"::",2);return[Vd(t),r]}function oD(e){return`${ce(e[0],":")}::`}function sD(e){if(typeof e!="string")throw new Error("Invalid type");if(!D4(e,"::"))throw new Error("Invalid value");return[Vd(ge(e,0,e.length-2))]}function aD([e,t]){return`${e}:${t}`}function lD(e){if(typeof e!="string")throw new L("Invalid type");if(!e.includes(":"))throw new L("Invalid value");return e.split(":",2)}var uD="0123456789abcdef",Lc;function cD(){return Lc===void 0&&(Lc=ie({min:0,max:15}).map(e=>uD[e],e=>{if(typeof e!="string")throw new L("Not a string");if(e.length!==1)throw new L("Invalid length");let t=on(e,0);if(t<=57)return t-48;if(t<97)throw new L("Invalid character");return t-87})),Lc}function t0(){let e=Ce({unit:cD(),minLength:1,maxLength:4,size:"max"}),t=Te(B(e,e).map(aD,lD),jd());return Te(B(ae(e,{minLength:6,maxLength:6,size:"max"}),t).map(Q$,eD),B(ae(e,{minLength:5,maxLength:5,size:"max"}),t).map(tD,rD),B(ae(e,{minLength:0,maxLength:1,size:"max"}),ae(e,{minLength:4,maxLength:4,size:"max"}),t).map($s,Ds),B(ae(e,{minLength:0,maxLength:2,size:"max"}),ae(e,{minLength:3,maxLength:3,size:"max"}),t).map($s,Ds),B(ae(e,{minLength:0,maxLength:3,size:"max"}),ae(e,{minLength:2,maxLength:2,size:"max"}),t).map($s,Ds),B(ae(e,{minLength:0,maxLength:4,size:"max"}),e,t).map(nD,iD),B(ae(e,{minLength:0,maxLength:5,size:"max"}),t).map(cw,dw),B(ae(e,{minLength:0,maxLength:6,size:"max"}),e).map(cw,dw),B(ae(e,{minLength:0,maxLength:7,size:"max"})).map(oD,sD))}var dD=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)}},fD=Object.getOwnPropertyNames;function pD(){let e=new _t;return r=>{let n=Ye(e,r);return n!==void 0||(n=new dD(String(r)),ut(e,r,n)),n}}function r0(e){let t=pD(),r=e(t),n=fD(r);for(let i of n){let o=t(i);o.underlying=r[i]}return r}function hD(e,t){for(let r of e){let n=t[r]||{};if(n.maxLength===void 0||n.maxLength>0)return!0}return!1}function mD(e,t){if(e.length===0)return ve([]);if(!hD(e,t))throw new L("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return B(...e.map(r=>ae(ve(r),t[r]))).map(r=>c4(r)).filter(r=>r.length>0)}var fw=Object.assign,_s=Object.create,n0=Object.defineProperty,pw=Object.getPrototypeOf,gD=Object.prototype;function yD(e){return n0(_s(null),dt,{configurable:!1,enumerable:!1,writable:!1,value:()=>e})}function hw(e,t){return yD(`<${Ve(e)}#${t}>`)}function bD(e,t){let r=_s(gD);for(let n in e){let i=e[n],o=[];for(let s of i){let a=fw(_s(pw(s)),s);o.push(a)}r[n]=o}for(let n in t){let i=t[n];for(let o=0;o!==i.length;++o){let s=i[o],a=r[n][o];for(let l in s){let u=s[l];a[l]=u.index===void 0?void 0:typeof u.index=="number"?r[u.type][u.index]:G(u.index,c=>r[u.type][c])}n0(a,dt,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let l=e[n][o],u=fw(_s(pw(l)),l);for(let c in s){let d=s[c];u[c]=d.index===void 0?void 0:typeof d.index=="number"?hw(d.type,d.index):G(d.index,p=>hw(d.type,p))}return xe(u)}})}}return r}function SD(e){let t=0,r=new _t;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=Ye(r,a.type);if(l===void 0&&(l=new _t,ut(r,a.type,l)),k4(l,a.forwardRelationship))throw new L(`Cannot declare multiple inverse relationships for the same forward relationship ${Ve(a.forwardRelationship)} on type ${Ve(a.type)}`);ut(l,a.forwardRelationship,{type:i,property:s}),t+=1}}let n=new _t;if(t===0)return n;for(let i in e){let o=e[i],s=Ye(r,i);if(s!==void 0)for(let a in o){let l=o[a];if(l.arity==="inverse")continue;let u=Ye(s,a);if(u!==void 0){if(u.type!==l.type)throw new L(`Inverse relationship ${Ve(u.property)} on type ${Ve(u.type)} references forward relationship ${Ve(a)} but types do not match`);ut(n,l,u)}}}if(n.size!==t)throw new L("Some inverse relationships could not be matched with their corresponding forward relationships");return n}var mw=Object.create;function wD(e,t,r){switch(e){case"exclusive":return ve(r);case"successor":return Ws(ie({min:t!==void 0?t+1:0,max:r}));case"any":return Ws(ie({min:0,max:r}))}}function vD(e,t,r,n,i,o,s){let a=wD(t,r,n);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(kr(a,{depthIdentifier:i,selector:d=>d===n?d+ ++l:d,minLength:1}),{nil:[],depthIdentifier:i}).generate(o,s).value,c=0;return G(u,d=>d===n?d+c++:d)}}}var xD=class extends de{constructor(e,t){super(),this.relations=e,this.defaultEntities=t;let r=new nn,n=new nn;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(Us(r,a.type))throw new L(`Cannot mix exclusive with other strategies for type ${Ve(a.type)}`);pi(n,a.type)}else{if(Us(n,a.type))throw new L(`Cannot mix exclusive with other strategies for type ${Ve(a.type)}`);pi(r,a.type)}if(a.strategy==="successor"&&a.type!==i)throw new L("Cannot mix types for the strategy successor");if(a.strategy==="successor"&&a.arity==="1")throw new L("Cannot use an arity of 1 for the strategy successor")}}}this.inversedRelations=SD(e)}createEmptyLinksInstanceFor(e){let t=mw(null),r=this.relations[e];for(let n in r){let i=r[n];i.arity==="inverse"&&(t[n]={type:i.type,index:[]})}return t}generate(e,t){let r=mw(null);for(let o in this.relations)r[o]=[];let n=[];for(let o of this.defaultEntities)$(n,{type:o,indexInType:r[o].length,depth:0}),$(r[o],this.createEmptyLinksInstanceFor(o));let i=-1;for(;++i<n.length;){let o=n[i],s=this.relations[o.type],a=r[o.type][o.indexInType],l=Id();l.depth=o.depth;for(let u in s){let c=s[u];if(c.arity==="inverse")continue;let d=c.type,p=r[d],h=p.length,f=vD(c.arity,c.strategy||"any",d===o.type?o.indexInType:void 0,p.length,l,e,t);a[u]={type:d,index:f};let m=f===void 0?[]:typeof f=="number"?[f]:f;for(let g of m){g>=h&&($(n,{type:d,indexInType:g,depth:o.depth+1}),$(p,this.createEmptyLinksInstanceFor(d)));let S=Ye(this.inversedRelations,c);if(S!==void 0){let w=p[g][S.property].index;$(w,o.indexInType)}}}}return n.length=0,new D(r,void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function RD(e,t){return new xD(e,t)}var kD=Object.keys,ED=Object.getOwnPropertySymbols,CD=Object.getOwnPropertyDescriptor;function AD(e){let t=kD(e),r=ED(e);for(let n=0;n!==r.length;++n){let i=r[n],o=CD(e,i);o&&o.enumerable&&t.push(i)}return t}var ID=Object.create,PD=Object.defineProperty,TD=Object.getOwnPropertyDescriptor,MD=Object.getOwnPropertyNames,OD=Object.getOwnPropertySymbols;function ND(e,t){return function(n){let i=n[1]?ID(null):{};for(let o=0;o!==e.length;++o){let s=n[0][o];s!==t&&PD(i,e[o],{value:s,configurable:!0,enumerable:!0,writable:!0})}return i}}function LD(e,t){return function(n){if(typeof n!="object"||n===null)throw new Error("Incompatible instance received: should be a non-null object");let i=Object.getPrototypeOf(n)===null,o="constructor"in n&&n.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=TD(n,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,$(a,d.value)}else $(a,t)}let l=MD(n).length,u=OD(n).length;if(s!==l+u)throw new Error("Incompatible instance received: should not contain extra properties");return[a,i]}}var $c=Symbol("no-key");function Dc(e,t,r){let n=AD(e),i=[];for(let o=0;o!==n.length;++o){let s=n[o],a=e[s];t===void 0||$t(t,s)!==-1?$(i,a):$(i,jt(a,{nil:$c}))}return B(B(...i),r?ve(!1):Si()).map(ND(n,$c),LD(n,$c))}function cd(e,t){let r=t!==void 0&&!!t.noNullPrototype;if(t===void 0||!("requiredKeys"in t&&t.requiredKeys!==void 0))return Dc(e,void 0,r);let n=("requiredKeys"in t?t.requiredKeys:void 0)||[];for(let i=0;i!==n.length;++i){let o=Object.getOwnPropertyDescriptor(e,n[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 Dc(e,n,r)}var $D=Object.create;function DD(e,t,r,n){let i=$D(null);for(let o in e){let s=e[o],a=cd(s,n),l=t(o),u=r(o),c={minLength:l,maxLength:l};i[o]=u!==void 0?kr(a,{...c,selector:u}):ae(a,c)}return cd(i)}var gw=Object.create,_D=Object.keys;function FD(e,t,r={}){let n=_D(e),i=r.initialPoolConstraints||gw(null),o=r.unicityConstraints||gw(null),s={noNullPrototype:r.noNullPrototype};return mD(n,i).chain(a=>RD(t,a).chain(l=>DD(e,u=>l[u].length,u=>o[u],s).map(u=>bD(u,l))))}function jD(e){return ce(G(e,t=>t[t.length-1]===","?ge(t,0,t.length-1):t)," ")}function VD(e){return function(r){if(typeof r!="string")throw new Error("Unsupported type");let n=[];for(let i of Be(r," "))if(e.canShrinkWithoutContext(i))$(n,i);else if(e.canShrinkWithoutContext(i+","))$(n,i+",");else throw new Error("Unsupported word");return n}}function BD(e){let t=ce(e," ");return t[t.length-1]===","&&(t=ge(t,0,t.length-1)),Sd(t[0])+ge(t,1)+"."}function UD(e){return function(r){if(typeof r!="string")throw new Error("Unsupported type");if(r.length<2||r[r.length-1]!=="."||r[r.length-2]===","||Sd(qc(r[0]))!==r[0])throw new Error("Unsupported value");let n=qc(r[0])+ge(r,1,r.length-1),i=[],o=Be(n," ");for(let s=0;s!==o.length;++s){let a=o[s];if(e.canShrinkWithoutContext(a))$(i,a);else if(s===o.length-1&&e.canShrinkWithoutContext(a+","))$(i,a+",");else throw new Error("Unsupported word")}return i}}function WD(e){return ce(e," ")}function zD(e){if(typeof e!="string")throw new Error("Unsupported type");let t=Be(e,". ");for(let r=0;r<t.length-1;++r)t[r]+=".";return t}var b=(e,t)=>({arbitrary:ve(e),weight:t});function GD(){return Te(b("non",6),b("adipiscing",5),b("ligula",5),b("enim",5),b("pellentesque",5),b("in",5),b("augue",5),b("et",5),b("nulla",5),b("lorem",4),b("sit",4),b("sed",4),b("diam",4),b("fermentum",4),b("ut",4),b("eu",4),b("aliquam",4),b("mauris",4),b("vitae",4),b("felis",4),b("ipsum",3),b("dolor",3),b("amet,",3),b("elit",3),b("euismod",3),b("mi",3),b("orci",3),b("erat",3),b("praesent",3),b("egestas",3),b("leo",3),b("vel",3),b("sapien",3),b("integer",3),b("curabitur",3),b("convallis",3),b("purus",3),b("risus",2),b("suspendisse",2),b("lectus",2),b("nec,",2),b("ultricies",2),b("sed,",2),b("cras",2),b("elementum",2),b("ultrices",2),b("maecenas",2),b("massa,",2),b("varius",2),b("a,",2),b("semper",2),b("proin",2),b("nec",2),b("nisl",2),b("amet",2),b("duis",2),b("congue",2),b("libero",2),b("vestibulum",2),b("pede",2),b("blandit",2),b("sodales",2),b("ante",2),b("nibh",2),b("ac",2),b("aenean",2),b("massa",2),b("suscipit",2),b("sollicitudin",2),b("fusce",2),b("tempus",2),b("aliquam,",2),b("nunc",2),b("ullamcorper",2),b("rhoncus",2),b("metus",2),b("faucibus,",2),b("justo",2),b("magna",2),b("at",2),b("tincidunt",2),b("consectetur",1),b("tortor,",1),b("dignissim",1),b("congue,",1),b("non,",1),b("porttitor,",1),b("nonummy",1),b("molestie,",1),b("est",1),b("eleifend",1),b("mi,",1),b("arcu",1),b("scelerisque",1),b("vitae,",1),b("consequat",1),b("in,",1),b("pretium",1),b("volutpat",1),b("pharetra",1),b("tempor",1),b("bibendum",1),b("odio",1),b("dui",1),b("primis",1),b("faucibus",1),b("luctus",1),b("posuere",1),b("cubilia",1),b("curae,",1),b("hendrerit",1),b("velit",1),b("mauris,",1),b("gravida",1),b("ornare",1),b("ut,",1),b("pulvinar",1),b("varius,",1),b("turpis",1),b("nibh,",1),b("eros",1),b("id",1),b("aliquet",1),b("quis",1),b("lobortis",1),b("consectetuer",1),b("morbi",1),b("vehicula",1),b("tortor",1),b("tellus,",1),b("id,",1),b("eu,",1),b("quam",1),b("feugiat,",1),b("posuere,",1),b("iaculis",1),b("lectus,",1),b("tristique",1),b("mollis,",1),b("nisl,",1),b("vulputate",1),b("sem",1),b("vivamus",1),b("placerat",1),b("imperdiet",1),b("cursus",1),b("rutrum",1),b("iaculis,",1),b("augue,",1),b("lacus",1))}function HD(e={}){let{maxCount:t,mode:r="words",size:n}=e;if(t!==void 0&&t<1)throw new Error("lorem has to produce at least one word/sentence");let i=GD();return r==="sentences"?ae(ae(i,{minLength:1,size:"small"}).map(BD,UD(i)),{minLength:1,maxLength:t,size:n}).map(WD,zD):ae(i,{minLength:1,maxLength:t,size:n}).map(jD,VD(i))}function qD(e){return new Map(e)}function KD(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 YD(e){return e[0]}function dd(e,t,r={}){return kr(B(e,t),{minLength:r.minKeys,maxLength:r.maxKeys,size:r.size,selector:YD,depthIdentifier:r.depthIdentifier,comparator:"SameValueZero"}).map(qD,KD)}var Ps=10;function JD(e){let t={};return(r=>{let n=r!==void 0?r:Ps;if(!Xw(t,n)){let i=Ps;Ps=n-1,t[n]=e(n),Ps=i}return t[n]})}function ZD(e){let t=0;for(;e>O(0);)e&O(1)&&++t,e>>=O(1);return t}function XD(e,t){let r=(O(1)<<O(t))-O(1),n=e&r,i=ZD(e-n),o=n;for(let s=O(1);s<=r&&i!==0;s<<=O(1))o&s||(o|=s,--i);return o}function Ts(e,t){let r=[];for(let n=e.length-1;n!==-1;--n)t(e[n])!==e[n]&&$(r,n);return r}function QD(e,t,r){let n=O(0);for(let i=0,o=O(1);i!==r.length;++i,o<<=O(1))e[r[i]]!==t[r[i]]&&(n|=o);return n}function _c(e,t,r,n){for(let i=0,o=O(1);i!==r.length;++i,o<<=O(1))t&o&&(e[r[i]]=n(e[r[i]]))}var e_=class extends de{constructor(e,t,r){super(),this.stringArb=e,this.toggleCase=t,this.untoggleAll=r}buildContextFor(e,t){return{rawString:e.value,rawStringContext:e.context,flags:t.value,flagsContext:t.context}}generate(e,t){let r=this.stringArb.generate(e,t),n=[...r.value],i=Ts(n,this.toggleCase),o=nr(O(0),(O(1)<<O(i.length))-O(1)).generate(e,void 0);return _c(n,o.value,i,this.toggleCase),new D(ce(n,""),this.buildContextFor(r,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 r;if(t!==void 0)r=t;else if(this.untoggleAll!==void 0){let o=this.untoggleAll(e),s=[...e],a=[...o];r={rawString:o,rawStringContext:void 0,flags:QD(a,s,Ts(a,this.toggleCase)),flagsContext:void 0}}else r={rawString:e,rawStringContext:void 0,flags:O(0),flagsContext:void 0};let n=r.rawString,i=r.flags;return this.stringArb.shrink(n,r.rawStringContext).map(o=>{let s=[...o.value],a=Ts(s,this.toggleCase),l=XD(i,a.length);return _c(s,l,a,this.toggleCase),new D(ce(s,""),this.buildContextFor(o,new D(l,void 0)))}).join(tr(()=>{let o=[...n],s=Ts(o,this.toggleCase);return nr(O(0),(O(1)<<O(s.length))-O(1)).shrink(i,r.flagsContext).map(a=>{let l=Le(o);return _c(l,a.value,s,this.toggleCase),new D(ce(l,""),this.buildContextFor(new D(n,r.rawStringContext),a))})}))}};function t_(e){let t=Sd(e);return t!==e?t:qc(e)}function r_(e,t){return new e_(e,t&&t.toggleCase||t_,t&&t.untoggleAll)}function n_(e){return Gw.from(e)}function i_(e){if(!(e instanceof Gw))throw new Error("Unexpected type");return[...e]}function i0(e={}){return ae(J1(e),e).map(n_,i_)}function o_(e){return Hw.from(e)}function s_(e){if(!(e instanceof Hw))throw new Error("Unexpected type");return[...e]}function o0(e={}){return ae(qs(e),e).map(o_,s_)}function Vt(e,t,r,n,i){let o=n.name,{min:s=t,max:a=r,...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>r)throw new Error(`Invalid max value passed to ${o}: max must be lower than or equal to ${r}`);return ae(i({min:s,max:a}),l).map(u=>n.from(u),u=>{if(!(u instanceof n))throw new Error("Invalid type");return[...u]})}function s0(e={}){return Vt(e,-32768,32767,G6,ie)}function a0(e={}){return Vt(e,-2147483648,2147483647,H6,ie)}function l0(e={}){return Vt(e,-128,127,z6,ie)}function u0(e={}){return Vt(e,0,65535,Y6,ie)}function c0(e={}){return Vt(e,0,4294967295,J6,ie)}function d0(e={}){return Vt(e,0,255,q6,ie)}function f0(e={}){return Vt(e,0,255,K6,ie)}function a_(e){return e!==void 0}function yw(e){return e.hasToBeCloned?new D(e.value_,{generatorContext:e.context},()=>e.value):new D(e.value_,{generatorContext:e.context})}function bw(e){return e.hasToBeCloned?new D(e.value_,{shrinkerContext:e.context},()=>e.value):new D(e.value_,{shrinkerContext:e.context})}var l_=class extends de{constructor(e,t){super(),this.generatorArbitrary=e,this.shrinkerArbitrary=t}generate(e,t){return yw(this.generatorArbitrary.generate(e,t))}canShrinkWithoutContext(e){return this.shrinkerArbitrary.canShrinkWithoutContext(e)}shrink(e,t){return a_(t)?"generatorContext"in t?this.generatorArbitrary.shrink(e,t.generatorContext).map(yw):this.shrinkerArbitrary.shrink(e,t.shrinkerContext).map(bw):this.shrinkerArbitrary.shrink(e,void 0).map(bw)}};function fd(e,t,r){let n=ie({min:e,max:t});return t===r?n:new l_(n,ie({min:e,max:r}))}var u_=Math.min,pd=Math.max,Sw=Ww.isArray,c_=Object.entries;function d_(e){let t=-1;for(let r=0;r!==e.length;++r)t=pd(t,e[r][0]);return t}function f_(e,t){let r=Ww(e);for(let n=0;n!==t.length;++n){let i=t[n];i[0]<e&&(r[i[0]]=i[1])}return r}function p0(e,t={}){let{size:r,minNumElements:n=0,maxLength:i=Rr,maxNumElements:o=i,noTrailingHole:s,depthIdentifier:a}=t,l=gi(r,gi(r,n,o,t.maxNumElements!==void 0),i,t.maxLength!==void 0);if(n>i)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if(n>o)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let u=u_(o,i),c=t.maxNumElements!==void 0||r!==void 0?r:"=",d=kr(B(fd(0,pd(l-1,0),pd(i-1,0)),e),{size:c,minLength:n,maxLength:u,selector:p=>p[0],depthIdentifier:a}).map(p=>f_(d_(p)+1,p),p=>{if(!Sw(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 G(c_(p),h=>[Number(h[0]),h[1]])});return s||i===n?d:B(d,fd(n,l,i)).map(p=>{let h=p[0],f=p[1];if(h.length>=f)return h;let m=Le(h);return m.length=f,m},p=>{if(!Sw(p))throw new Error("Not supported entry type");return[p,p.length]})}function p_(e){return new Set(e)}function h_(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 h0(e,t={}){return kr(e,{minLength:t.minLength,maxLength:t.maxLength,size:t.size,depthIdentifier:t.depthIdentifier,comparator:"SameValueZero"}).map(p_,h_)}function m_(e,t,r,n,i,o){return Md(e,t,{maxKeys:r,noNullPrototype:!o,size:n,depthIdentifier:i})}function g_(e){return Te(l0(e),d0(e),f0(e),s0(e),u0(e),a0(e),c0(e),i0(e),o0(e))}function m0(e){let t=e.values,r=e.depthSize,n=Id(),i=e.maxDepth,o=e.maxKeys,s=e.size,a=Te(...t,...e.withBigInt?[nr()]:[],...e.withDate?[T1()]:[]);return r0(l=>({anything:Te({maxDepth:i,depthSize:r,depthIdentifier:n},a,l("array"),l("object"),...e.withMap?[l("map")]:[],...e.withSet?[l("set")]:[],...e.withObjectString?[l("anything").map(u=>xe(u))]:[],...e.withTypedArray?[g_({maxLength:o,size:s})]:[],...e.withSparseArray?[p0(l("anything"),{maxNumElements:o,size:s,depthIdentifier:n})]:[]),keys:e.withObjectString?Te({arbitrary:e.key,weight:10},{arbitrary:l("anything").map(u=>xe(u)),weight:1}):e.key,array:ae(l("anything"),{maxLength:o,size:s,depthIdentifier:n}),set:h0(l("anything"),{maxLength:o,size:s,depthIdentifier:n}),map:Te(dd(l("keys"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n}),dd(l("anything"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n})),object:m_(l("keys"),l("anything"),o,s,n,e.withNullPrototype)})).anything}function y_(e){switch(typeof e){case"boolean":return new zw(e);case"number":return new Dt(e);case"string":return new Ve(e);default:return e}}function b_(e){return typeof e!="object"||e===null||!("constructor"in e)?e:e.constructor===zw||e.constructor===Dt||e.constructor===Ve?e.valueOf():e}function S_(e){return e.map(y_,b_)}function w_(e,t){return[Si(),Q1(),qs(),t(e),Te(t(e),ve(null),ve(void 0))]}function v_(e){return e.map(t=>S_(t))}function x_(e,t){return t?v_(e).concat(e):e}function g0(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:Ce(t),values:x_(e.values!==void 0?e.values:w_(t,Ce),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 R_(e){return Md(e.key,m0(e),{maxKeys:e.maxKeys,noNullPrototype:!e.withNullPrototype,size:e.size})}function k_(e){return R_(g0(e))}function E_(e,t){let{depthSize:r,maxDepth:n}=t;return{key:e,values:[Si(),qs({noDefaultInfinity:!0,noNaN:!0}),e,ve(null)],depthSize:r,maxDepth:n}}function y0(e){return m0(g0(e))}function b0(e={}){let t=e.noUnicodeString===void 0||e.noUnicodeString===!0;return y0(E_("stringUnit"in e?Ce({unit:e.stringUnit}):t?Ce():Ce({unit:"binary"}),e))}var C_=JSON.stringify,A_=JSON.parse;function I_(e){if(typeof e!="string")throw new L("Cannot unmap the passed value");return A_(e)}function P_(e={}){return b0(e).map(C_,I_)}var T_=Object.defineProperties;function Fc(e,t){return`Stream(${t!==void 0?`${ce(t,",")}\u2026`:`${e} emitted`})`}var M_=class extends de{constructor(e,t){super(),this.arb=e,this.history=t}generate(e,t){let r=t!==void 0&&e.nextInt(1,t)===1?t:void 0,n=()=>{let i=this.history?[]:null,o=0,s=function*(a,l){for(;;){let u=a.generate(l,r).value;o++,i!==null&&$(i,u),yield u}};return T_(new j(s(this.arb,e.clone())),{toString:{value:()=>Fc(o,i!==null?i.map(xe):void 0)},[dt]:{value:()=>Fc(o,i!==null?i.map(xe):void 0)},[Ft]:{value:async()=>Fc(o,i!==null?await Promise.all(i.map(kd)):void 0)},[Me]:{value:n,enumerable:!0}})};return new D(n(),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function O_(e,t){return new M_(e,t!==void 0&&typeof t=="object"&&"noHistory"in t?!t.noHistory:!0)}function N_(e){return ce(e,"")}function ww(e){if(typeof e!="string")throw new Error("Cannot unmap the passed value");return[...e]}function L_(e){switch(e.length%4){case 0:return e;case 3:return`${e}=`;case 2:return`${e}==`;default:return ge(e,1)}}function $_(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 jc=String.fromCharCode;function D_(e){return e<26?jc(e+65):e<52?jc(e+97-26):e<62?jc(e+48-52):e===62?"+":"/"}function __(e){if(typeof e!="string"||e.length!==1)throw new L("Invalid entry");let t=on(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 F_(){return ie({min:0,max:63}).map(D_,__)}function j_(e={}){let{minLength:t=0,maxLength:r=Rr,size:n}=e,i=t+3-(t+3)%4,o=r-r%4,s=e.maxLength===void 0&&n===void 0?"=":n;if(i>o)throw new L("Minimal length should be inferior or equal to maximal length");if(i%4!==0)throw new L("Minimal length of base64 strings must be a multiple of 4");if(o%4!==0)throw new L("Maximal length of base64 strings must be a multiple of 4");let a=F_();return ae(a,{minLength:i,maxLength:o,size:s,experimentalCustomSlices:wL(a,ww)}).map(N_,ww).map(L_,$_)}var vw=Object.is;function V_(e,t){let r=new _t,n=0;for(let i of e)vw(i,-0)?++n:ut(r,i,(Ye(r,i)||0)+1);for(let i=0;i!==t.length;++i){if(!(i in t))return!1;let o=t[i];if(vw(o,-0)){if(n===0)return!1;--n}else{let s=Ye(r,o)||0;if(s===0)return!1;ut(r,o,s-1)}}return!0}var B_=Math.floor,xw=Math.log,U_=Array.isArray,S0=class extends de{constructor(e,t,r,n){if(super(),this.originalArray=e,this.isOrdered=t,this.minLength=r,this.maxLength=n,r<0||r>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(n<0||n>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(r>n)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new an(r,n),this.biasedLengthArb=r!==n?new an(r,r+B_(xw(n-r)/xw(2))):this.lengthArb}generate(e,t){let r=(t!==void 0&&e.nextInt(1,t)===1?this.biasedLengthArb:this.lengthArb).generate(e,void 0),n=r.value,i=G(this.originalArray,(s,a)=>a),o=[];for(let s=0;s!==n;++s){let a=e.nextInt(0,i.length-1);$(o,i[a]),Yw(i,a,1)}return this.isOrdered&&Jw(o,(s,a)=>s-a),new D(G(o,s=>this.originalArray[s]),r.context)}canShrinkWithoutContext(e){return!U_(e)||!this.lengthArb.canShrinkWithoutContext(e.length)?!1:V_(this.originalArray,e)}shrink(e,t){return e.length===0?j.nil():this.lengthArb.shrink(e.length,t).map(r=>new D(Le(e,e.length-r.value),r.context)).join(e.length>this.minLength?tr(()=>this.shrink(Le(e,1),void 0).filter(r=>this.minLength<=r.value.length+1).map(r=>new D([e[0],...r.value],void 0))):j.nil())}};function W_(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new S0(e,!0,r,n)}function z_(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new S0(e,!1,r,n)}var G_={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"},H_={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 q_(e){return e<10?Ve(e):G_[e]}function Rw(e,t){let r="";for(;e.length+r.length<t;)r+="0";return r+e}function kw(e){let t="";for(let r=e;r!==0;){let n=r>>5;t=q_(r-(n<<5))+t,r=n}return t}function K_(e,t){let r=~~(e/1073741824),n=e&1073741823;return Rw(kw(r),t-6)+Rw(kw(n),6)}function w0(e){return function(r){return K_(r,e)}}function Vc(e){if(typeof e!="string")throw new L("Unsupported type");let t=0,r=1;for(let n=e.length-1;n>=0;--n){let i=H_[e[n]];if(i===void 0)throw new L("Unsupported type");t+=i*r,r*=32}return t}var Y_=w0(10),Ew=w0(8);function J_(e){return Y_(e[0])+Ew(e[1])+Ew(e[2])}function Z_(e){if(typeof e!="string"||e.length!==26)throw new Error("Unsupported type");return[Vc(e.slice(0,10)),Vc(e.slice(10,18)),Vc(e.slice(18))]}function X_(){return B(ie({min:0,max:0xffffffffffff}),ie({min:0,max:0xffffffffff}),ie({min:0,max:0xffffffffff})).map(J_,Z_)}function v0(e){return _4(hi(e,16),8,"0")}function Q_(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!==v0(t))throw new Error("Unsupported value: invalid content");return t}function Bc(e,t){return ie({min:e,max:t}).map(v0,Q_)}function e7(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 t7=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function r7(e){if(typeof e!="string")throw new Error("Unsupported type");let t=t7.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 Cw="0123456789abcdef";function n7(e){let t={},r={};for(let o=0;o!==e.length;++o){let s=Cw[o],a=Cw[e[o]];t[s]=a,r[a]=s}function n(o){return t[o[0]]+ge(o,1)}function i(o){if(typeof o!="string")throw new L("Cannot produce non-string values");let s=r[o[0]];if(s===void 0)throw new L("Cannot produce strings not starting by the version in hexa code");return s+ge(o,1)}return{versionsApplierMapper:n,versionsApplierUnmapper:i}}function i7(e){let t={};for(let r of e){if(t[r])throw new L(`Version ${r} has been requested at least twice for uuid`);if(t[r]=!0,r<1||r>15)throw new L(`Version must be a value in [1-15] for uuid, but received ${r}`);if(~~r!==r)throw new L(`Version must be an integer value for uuid, but received ${r}`)}if(e.length===0)throw new L("Must provide at least one version for uuid")}function o7(e={}){let t=Bc(0,4294967295),r=e.version!==void 0?typeof e.version=="number"?[e.version]:e.version:[1,2,3,4,5,6,7,8];i7(r);let{versionsApplierMapper:n,versionsApplierUnmapper:i}=n7(r);return B(t,Bc(0,268435456*r.length-1).map(n,i),Bc(2147483648,3221225471),t).map(e7,r7)}function s7(e){return Ce({unit:Ld("-._~!$&'()*+,;=:"),size:e})}function a7([e,t,r]){return(e===null?"":`${e}@`)+t+(r===null?"":`:${r}`)}function l7(e){if(typeof e!="string")throw new Error("Unsupported");let t=e.indexOf("@"),r=t!==-1?e.substring(0,t):null,n=/:(\d+)$/.exec(e),i=n!==null?Number(n[1]):null;return[r,n!==null?e.substring(t+1,e.length-n[1].length-1):e.substring(t+1),i]}function u7(e){return`[${e}]`}function c7(e){if(typeof e!="string"||e[0]!=="["||e[e.length-1]!=="]")throw new Error("Unsupported");return e.substring(1,e.length-1)}function x0(e){let t=e||{},r=t.size,n=[$d({size:r}),...t.withIPv4===!0?[jd()]:[],...t.withIPv6===!0?[t0().map(u7,c7)]:[],...t.withIPv4Extended===!0?[e0()]:[]];return B(t.withUserInfo===!0?jt(s7(r)):ve(null),Te(...n),t.withPort===!0?jt(er(65535)):ve(null)).map(a7,l7)}function R0(e){return Ce({unit:Ld("-._~!$&'()*+,;=:@/?"),size:e})}function k0(e={}){return R0(e.size)}function E0(e={}){return Ce({unit:Ld("-._~!$&'()*+,;=:@"),size:e.size})}function d7(e){return ce(G(e,t=>`/${t}`),"")}function f7(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 Yw(Be(e,"/"),1)}function p7(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 Uc(e,t){return ae(E0({size:e}),{size:t}).map(d7,f7)}function h7(e){let[t,r]=p7(e);return t===r?Uc(t,r):Te(Uc(t,r),Uc(r,t))}function C0(e){return h7(Td((e||{}).size))}function A0(e={}){return R0(e.size)}function m7(e){let[t,r,n]=e;return`${t}://${r}${n}${e[3]===null?"":`?${e[3]}`}${e[4]===null?"":`#${e[4]}`}`}var g7=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function y7(e){if(typeof e!="string")throw new Error("Incompatible value received: type");let t=g7.exec(e);if(t===null)throw new Error("Incompatible value received");let r=t[1],n=t[2],i=t[3],o=t[4],s=t[5];return[r,n,i,o!==void 0?o.substring(1):null,s!==void 0?s.substring(1):null]}function b7(e){let t=e||{},r=Td(t.size),n=t.authoritySettings!==void 0&&t.authoritySettings.size!==void 0?bi(t.authoritySettings.size,r):r,i={...t.authoritySettings,size:n};return B(wt(...t.validSchemes||["http","https"]),x0(i),C0({size:r}),t.withQueryParameters===!0?jt(A0({size:r})):ve(null),t.withFragments===!0?jt(k0({size:r})):ve(null)).map(m7,y7)}var S7=class I0{constructor(t,r){this.commands=t,this.metadataForReplay=r,this[Me]=function(){return new I0(this.commands.map(n=>n.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let t=this.commands.filter(n=>n.hasRan).map(n=>n.toString()).join(","),r=this.metadataForReplay();return r.length!==0?`${t} /*${r}*/`:t}},w7=class hd{constructor(t){if(this.cmd=t,this.hasRan=!1,xd(t)){let r=t[dt];this[dt]=function(){return r.call(t)}}if(Rd(t)){let r=t[Ft];this[Ft]=function(){return r.call(t)}}}check(t){return this.cmd.check(t)}run(t,r){return this.hasRan=!0,this.cmd.run(t,r)}clone(){return xr(this.cmd)?new hd(this.cmd[Me]()):new hd(this.cmd)}toString(){return this.cmd.toString()}},Aw=class{static parse(e){let[t,r]=e.split(":"),n=this.parseCounts(t),i=this.parseChanges(r);return this.parseOccurences(n,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,r)=>(t.length===0||t[t.length-1].count===64||t[t.length-1].value!==r?t.push({value:r,count:1}):t[t.length-1].count+=1,t),[])}static parseOccurences(e,t){let r=[];for(let n=0;n!==e.length;++n){let i=e[n],o=t[n];for(let s=0;s!==i;++s)r.push(o)}return r}static stringifyChanges(e){let t="";for(let r=0;r<e.length;r+=6){let n=e.slice(r,r+6).reduceRight((i,o)=>(i<<1)+(o.value?1:0),0);t+=this.intToB64(n)}return t}static parseChanges(e){let t=e.split("").map(n=>this.b64ToInt(n)),r=[];for(let n=0;n!==t.length;++n){let i=t[n];for(let o=0;o!==6;++o,i>>=1)r.push(i%2===1)}return r}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)}},v7=class extends de{constructor(e,t,r,n,i){super(),this.sourceReplayPath=n,this.disableReplayLog=i,this.oneCommandArb=Te(...e).map(o=>new w7(o)),this.lengthArb=fd(0,t,r),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(Aw.stringify(this.replayPath))}`}buildValueFor(e,t){let r=e.map(i=>i.value_),n={shrunkOnce:t,items:e};return new D(new S7(r,()=>this.metadataForReplay()),n)}generate(e){let t=this.lengthArb.generate(e,void 0).value,r=Array(t);for(let n=0;n!==t;++n)r[n]=this.oneCommandArb.generate(e,void 0);return this.replayPathPosition=0,this.buildValueFor(r,!1)}canShrinkWithoutContext(e){return!1}filterOnExecution(e){let t=[];for(let r of e)r.value_.hasRan?(this.replayPath.push(!0),t.push(r)):this.replayPath.push(!1);return t}filterOnReplay(e){return e.filter((t,r)=>{let n=this.replayPath[this.replayPathPosition+r];if(n===void 0)throw new Error("Too short replayPath");if(!n&&t.value_.hasRan)throw new Error("Mismatch between replayPath and real execution");return n})}filterForShrinkImpl(e){this.replayPathPosition===0&&(this.replayPath=this.sourceReplayPath!==null?Aw.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 j.nil();let r=t,n=r.shrunkOnce,i=r.items,o=this.filterForShrinkImpl(i);if(o.length===0)return j.nil();let s=n?j.nil():new j([[]][Symbol.iterator]()),a=[];for(let l=0;l!==o.length;++l)a.push(tr(()=>{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(tr(()=>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 D(u.value_.clone(),u.context)),!0))}};function x7(e,t={}){let{size:r,maxCommands:n=Rr,disableReplayLog:i=!1,replayPath:o=null}=t;return new v7(e,gi(r,0,n,t.maxCommands!==void 0),n,o,i)}var R7=class{constructor(e,t){this.s=e,this.cmd=t}async check(e){let t=null,r=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{r=await Promise.resolve(this.cmd.check(e))}catch(n){throw t=n,n}}}]).task).faulty)throw t;return r}async run(e,t){let r=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run(e,t)}catch(n){throw r=n,n}}}]).task).faulty)throw r}},k7=function*(e,t){for(let r of t)yield new R7(e,r)},P0=(e,t,r,n,i)=>e.then(o=>{let{model:s,real:a}=o,l=r;for(let u of t)l=i(l,()=>n(u,s,a));return l}),E7=(e,t)=>P0({then:o=>{o(e())}},t,void 0,(o,s,a)=>{o.check(s)&&o.run(s,a)},(o,s)=>s()),C7=e=>typeof e.then=="function",T0=async(e,t,r=Promise.resolve())=>await P0({then:s=>{let a=e();return C7(a)?a.then(s):s(a)}},t,r,async(s,a,l)=>{await s.check(a)&&await s.run(a,l)},(s,a)=>s.then(a));function A7(e,t){E7(e,t)}async function I7(e,t){await T0(e,t)}async function P7(e,t,r){let n=T0(t,k7(e,r),e.schedule(Promise.resolve(),"startModel"));await e.waitFor(n),await e.waitAll()}var Ms=e=>e(),M0=class md{constructor(t,r){this.act=t,this.taskSelector=r,this.lastTaskId=0,this.sourceTaskSelector=r.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[Me]=function(){return new md(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 ${N$(t.outputValue)}`:""}`}log(t,r,n,i,o,s){this.triggeredTasks.push({status:o,schedulingType:t,taskId:r,label:n,metadata:i,outputValue:s!==void 0?xe(s):void 0})}scheduleInternal(t,r,n,i,o,s){let a=++this.lastTaskId,l,u=new Promise((c,d)=>{l=()=>{let p=Promise.resolve(s!==void 0?n.then(()=>s()):n);return p.then(h=>{this.log(t,a,r,i,"resolved",h),c(h)},h=>{this.log(t,a,r,i,"rejected",h),d(h)}),p}});return this.scheduledTasks.push({original:n,trigger:l,schedulingType:t,taskId:a,label:r,metadata:i,customAct:o}),this.scheduledWatchers.length!==0&&this.scheduledWatchers[0](),u}schedule(t,r,n,i){return this.scheduleInternal("promise",r||"",t,n,i||Ms)}scheduleFunction(t,r){return(...n)=>this.scheduleInternal("function",`${t.name}(${n.map(xe).join(",")})`,t(...n),void 0,r||Ms)}scheduleSequence(t,r){let n={done:!1,faulty:!1},i={then:c=>c()},o=()=>{},s=new Promise(c=>{o=()=>c({done:n.done,faulty:n.faulty})}),a=()=>{n.faulty=!0,o()},l=()=>{n.done=!0,o()},u=(c,d)=>{if(c>=t.length){d.then(l,a);return}d.then(()=>{let p=t[c],[h,f,m]=typeof p=="function"?[p,p.name,void 0]:[p.builder,p.label,p.metadata],g=this.scheduleInternal("sequence",f,i,m,r||Ms,()=>h());u(c+1,g)},a)};return u(0,i),Object.assign(n,{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),[r]=this.scheduledTasks.splice(t,1);return r.customAct(()=>r.trigger().catch(n=>{}))}waitOne(t){let r=t||Ms;return this.act(()=>r(()=>this.internalWaitOne()))}async waitAll(t){for(;this.scheduledTasks.length>0;)await this.waitOne(t)}async internalWaitFor(t,r){let n=!1,i=r.customAct,o=r.onWaitStart,s=r.onWaitIdle,a=r.launchAwaiterOnInit,l,u,c=0,d=null,p=null,h=async()=>{for(c=50,c=50;!n&&c>0;--c)await Promise.resolve();if(!n&&this.scheduledTasks.length>0)return o!==void 0&&o(),p=this.waitOne(i),p.then(()=>(p=null,h()),S=>{throw p=null,n=!0,u(S),S});!n&&s!==void 0&&s(),d=null},f=()=>{if(d!==null){c=51;return}d=h().catch(()=>{})},m=()=>{let S=this.scheduledWatchers.indexOf(f);S!==-1&&this.scheduledWatchers.splice(S,1),S===0&&this.scheduledWatchers.length!==0&&this.scheduledWatchers[0]()},g=new Promise((S,w)=>{l=y=>{m(),S(y)},u=y=>{m(),w(y)}});return t.then(S=>{n=!0,p===null?l(S):p.then(()=>l(S),w=>u(w))},S=>{n=!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),g}waitNext(t,r){let n,i=t,o=i<=0?Promise.resolve():new Promise(s=>{n=()=>{--i<=0&&s()}});return this.internalWaitFor(o,{customAct:r,onWaitStart:n,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(t){let r,n=new Promise(i=>r=i);return this.internalWaitFor(n,{customAct:t,onWaitStart:void 0,onWaitIdle:r,launchAwaiterOnInit:!0})}waitFor(t,r){return this.internalWaitFor(t,{customAct:r,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(md.buildLog).map(t=>`-> ${t}`).join(`
|
|
132
|
-
`)+"`"}};function O0(e){let t=0;return{clone:()=>O0(e),nextTaskIndex:r=>{if(e.length<=t)throw new Error("Invalid schedulerFor defined: too many tasks have been scheduled");let n=r.findIndex(i=>i.taskId===e[t]);if(n===-1)throw new Error("Invalid schedulerFor defined: unable to find next task");return++t,n}}}function Iw(e,t){return new M0(e,O0(t))}function N0(e){let t=e.clone();return{clone:()=>N0(t),nextTaskIndex:r=>e.nextInt(0,r.length-1)}}var T7=class extends de{constructor(e){super(),this.act=e}generate(e,t){return new D(new M0(this.act,N0(e.clone())),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function M7(e){let{act:t=r=>r()}=e||{};return new T7(t)}function O7(e,t){let{act:r=n=>n()}=Array.isArray(e)?t||{}:e||{};return Array.isArray(e)?Iw(r,e):function(n,...i){return Iw(r,i)}}function N7(e={}){return Vt(e,O("-9223372036854775808"),O("9223372036854775807"),U6,nr)}function L7(e={}){return Vt(e,O(0),O("18446744073709551615"),W6,nr)}function $7(e,t){return t}var Wc=Math.floor,D7=Math.min;function Qe(e,t){switch(e.type){case"Char":return{astNode:e,minLength:1};case"Repetition":switch(e.quantifier.kind){case"*":{let r=Qe(e.expression,t);return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:t},expression:r.astNode},minLength:0}}case"+":{let r=Qe(e.expression,t),n=r.minLength>1?r.minLength:1;return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:1,to:Wc(t/n)},expression:r.astNode},minLength:r.minLength}}case"?":{let r=Qe(e.expression,t);return t<r.minLength?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:0},expression:r.astNode},minLength:0}:{astNode:{...e,expression:r.astNode},minLength:0}}case"Range":{let r=e.quantifier.from>1?Wc(t/e.quantifier.from):t,n=Qe(e.expression,r),i=n.minLength>1?n.minLength:1;return e.quantifier.to===void 0||e.quantifier.to*i>t?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",to:Wc(t/i)},expression:n.astNode},minLength:e.quantifier.from*n.minLength}:{astNode:{...e,expression:n.astNode},minLength:e.quantifier.from*n.minLength}}default:return $7(e.quantifier,{astNode:e,minLength:0})}case"Quantifier":return{astNode:e,minLength:0};case"Alternative":{let r=0,n=[];for(let o=0;o!==e.expressions.length;++o){let s=t-r,a=Qe(e.expressions[o],s);r+=a.minLength,$(n,{value:a,allowance:s})}let i=[];for(let o=0;o!==n.length;++o){let s=n[o].value,a=n[o].allowance,l=t-r+s.minLength;$(i,(l!==a?Qe(s.astNode,l):s).astNode)}return{astNode:{...e,expressions:i},minLength:r}}case"CharacterClass":return{astNode:e,minLength:1};case"ClassRange":return{astNode:e,minLength:1};case"Group":{let r=Qe(e.expression,t);return{astNode:{...e,expression:r.astNode},minLength:r.minLength}}case"Disjunction":{if(e.left===null){if(e.right===null)return{astNode:e,minLength:0};let i=Qe(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=Qe(e.left,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:o,right:null},minLength:0}}let r=Qe(e.left,t),n=Qe(e.right,t);return r.minLength>t?n:n.minLength>t?r:{astNode:{...e,left:r.astNode,right:n.astNode},minLength:D7(r.minLength,n.minLength)}}case"Assertion":return{astNode:e,minLength:0};case"Backreference":return{astNode:e,minLength:0};case"UnicodeProperty":return{astNode:e,minLength:1}}}function _7(e,t){return Qe(e,t).astNode}function F7(e){return new Error(`Unsupported AST node! Received: ${xe(e)}`)}function Fs(e,t,r){if(!t&&!r)return e;let n={hasStart:!1,hasEnd:!1},i=L0(e,t,r,n),o=t&&!n.hasStart,s=r&&!n.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 L0(e,t,r,n){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 n.hasStart=!0,n.hasEnd=!0,{...e,expressions:e.expressions.map((i,o)=>Fs(i,t&&o===0,r&&o===e.expressions.length-1))};case"CharacterClass":return e;case"ClassRange":return e;case"Group":return{...e,expression:L0(e.expression,t,r,n)};case"Disjunction":return n.hasStart=!0,n.hasEnd=!0,{...e,left:e.left!==null?Fs(e.left,t,r):null,right:e.right!==null?Fs(e.right,t,r):null};case"Assertion":if(e.kind==="^"||e.kind==="Lookahead")return n.hasStart=!0,e;if(e.kind==="$"||e.kind==="Lookbehind")return n.hasEnd=!0,e;throw new Error(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":return e;case"UnicodeProperty":return e;default:throw F7(e)}}function j7(e){return Fs(e,!0,!0)}function Pw(e,t){return e[t]>="\uD800"&&e[t]<="\uDBFF"&&e[t+1]>="\uDC00"&&e[t+1]<="\uDFFF"?2:1}function Ee(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function gd(e){return e>="0"&&e<="9"}function $0(e,t){for(let r=t;r!==e.length;++r){let n=e[r];if(n==="\\")r+=1;else if(n==="]")return r}throw new Error("Missing closing ']'")}function V7(e,t){let r=0;for(let n=t;n!==e.length;++n){let i=e[n];if(i==="\\")n+=1;else if(i===")"){if(r===0)return n;r-=1}else i==="["?n=$0(e,n):i==="("&&(r+=1)}throw new Error("Missing closing ')'")}function B7(e,t){let r=!1;for(let n=t;n!==e.length;++n){let i=e[n];if(!gd(i)){if(t===n)return-1;if(i===","){if(r)return-1;r=!0}else return i==="}"?n:-1}}return-1}function U7(e,t,r,n){switch(e[t]){case"[":return n===1?t+1:$0(e,t+1)+1;case"{":{if(n===1)return t+1;let i=B7(e,t+1);return i===-1?t+1:i+1}case"(":return n===1?t+1:V7(e,t+1)+1;case"]":case"}":case")":return t+1;case"\\":{let i=e[t+1];switch(i){case"x":if(Ee(e[t+2])&&Ee(e[t+3]))return t+4;throw new Error(`Unexpected token '${e.substring(t,t+4)}' found`);case"u":if(e[t+2]==="{"){if(!r)return t+2;if(e[t+4]==="}"){if(Ee(e[t+3]))return t+5;throw new Error(`Unexpected token '${e.substring(t,t+5)}' found`)}if(e[t+5]==="}"){if(Ee(e[t+3])&&Ee(e[t+4]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`)}if(e[t+6]==="}"){if(Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5]))return t+7;throw new Error(`Unexpected token '${e.substring(t,t+7)}' found`)}if(e[t+7]==="}"){if(Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5])&&Ee(e[t+6]))return t+8;throw new Error(`Unexpected token '${e.substring(t,t+8)}' found`)}if(e[t+8]==="}"&&Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5])&&Ee(e[t+6])&&Ee(e[t+7]))return t+9;throw new Error(`Unexpected token '${e.substring(t,t+9)}' found`)}if(Ee(e[t+2])&&Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`);case"p":case"P":{if(!r)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(!r)return t+2;throw new Error("Invalid \\k definition")}return o+1}default:if(gd(i)){let o=r?e.length:Math.min(t+4,e.length),s=t+2;for(;s<o&&gd(e[s]);++s);return s}return t+(r?Pw(e,t+1):1)+1}}default:return t+(r?Pw(e,t):1)}}function Os(e,t,r,n){let i=U7(e,t,r,n);return e.substring(t,i)}var Tw={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},Ks={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"},yi=Wd(Ks),Ud={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"},yd=Wd(Ud),D0={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"},Mw=Wd(D0);function Wd(e){let t={};for(let r of Object.keys(e)){let n=e[r];if(Array.isArray(n))for(let i=0;i!==n.length;++i)t[n[i]]=r;else t[n]=r}return t}function W7(e){return e in Ud||e in yd}function z7(e){return e in Ks||e in yi}function Ow(e){if(e in Tw)return Tw[e];if(e in yi)return yi[e];if(e in Ks||e==="General_Category"||e==="Script"||e==="Script_Extensions")return e;throw new Error(`Unknown Unicode property name: ${e}`)}function Nw(e){if(e in yd)return yd[e];if(e in Mw)return Mw[e];if(e in yi)return yi[e];if(e in Ud||e in D0||e in Ks)return e;throw new Error(`Unknown Unicode property value: ${e}`)}function G7(e,t){let r=e.indexOf("=");if(r!==-1){let n=e.substring(0,r),i=e.substring(r+1);return{type:"UnicodeProperty",name:n,value:i,negative:t,shorthand:!1,binary:!1,canonicalName:Ow(n),canonicalValue:Nw(i)}}if(W7(e))return{type:"UnicodeProperty",name:"General_Category",value:e,negative:t,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:Nw(e)};if(z7(e)){let n=Ow(e);return{type:"UnicodeProperty",name:e,value:e,negative:t,shorthand:!1,binary:!0,canonicalName:n,canonicalValue:n}}throw new Error(`Invalid Unicode property: ${e}`)}var zc=String.fromCodePoint;function Gc(e){let t=e.pop();if(t===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return t}function _0(e){return e>="0"&&e<="9"}function js(e,t){return{type:"Char",kind:"simple",symbol:e,value:e,codePoint:e.codePointAt(0)||-1,escaped:t}}function en(e,t){return{type:"Char",kind:"meta",symbol:t,value:e,codePoint:t.codePointAt(0)||-1}}function Xt(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 Hc(e){if(e[0]==="\\"){let t=e[1];switch(t){case"x":{let r=e.substring(2),n=Number.parseInt(r,16);return{type:"Char",kind:"hex",symbol:zc(n),value:e,codePoint:n}}case"u":{if(e==="\\u")return js("u",!0);let r=e[2]==="{"?e.substring(3,e.length-1):e.substring(2),n=Number.parseInt(r,16);return{type:"Char",kind:"unicode",symbol:zc(n),value:e,codePoint:n}}case"0":return en(e,"\0");case"n":return en(e,`
|
|
133
|
-
`);case"f":return en(e,"\f");case"r":return en(e,"\r");case"t":return en(e," ");case"v":return en(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(
|
|
134
|
-
\v\f`],
|
|
135
|
-
`],F0=[...""],Q7=[...bd,...F0],vr=()=>Ce({unit:"grapheme-ascii",minLength:1,maxLength:1});function jw(e){return new L(`Unsupported AST node! Received: ${xe(e)}`)}function Qt(e,t,r){switch(e.type){case"Char":if(e.kind==="meta")switch(e.value){case"\\w":return wt(...Dw);case"\\W":return vr().filter(n=>$t(Dw,n)===-1);case"\\d":return wt(..._w);case"\\D":return vr().filter(n=>$t(_w,n)===-1);case"\\s":return wt(...Fw);case"\\S":return vr().filter(n=>$t(Fw,n)===-1);case"\\b":case"\\B":throw new L(`Meta character ${e.value} not implemented yet!`);case".":{let n=r.dotAll?F0:Q7;return vr().filter(i=>$t(n,i)===-1)}}if(e.symbol===void 0)throw new L(`Unexpected undefined symbol received for non-meta Char! Received: ${xe(e)}`);return ve(e.symbol);case"Repetition":{let n=Qt(e.expression,t,r);switch(e.quantifier.kind){case"*":return Ce({...t,unit:n});case"+":return Ce({...t,minLength:1,unit:n});case"?":return Ce({...t,minLength:0,maxLength:1,unit:n});case"Range":return Ce({...t,minLength:e.quantifier.from,maxLength:e.quantifier.to,unit:n});default:throw jw(e.quantifier)}}case"Quantifier":throw new L("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return B(...G(e.expressions,n=>Qt(n,t,r))).map(n=>ce(n,""));case"CharacterClass":if(e.negative){let n=G(e.expressions,i=>Qt(i,t,r));return vr().filter(i=>Zw(n,o=>!o.canShrinkWithoutContext(i)))}return Te(...G(e.expressions,n=>Qt(n,t,r)));case"ClassRange":{let n=e.from.codePoint,i=e.to.codePoint;return ie({min:n,max:i}).map(o=>X7(o),o=>{if(typeof o!="string")throw new L("Invalid type");if([...o].length!==1)throw new L("Invalid length");return on(o,0)})}case"Group":return Qt(e.expression,t,r);case"Disjunction":return Te(e.left!==null?Qt(e.left,t,r):ve(""),e.right!==null?Qt(e.right,t,r):ve(""));case"Assertion":if(e.kind==="^"||e.kind==="$")return r.multiline?e.kind==="^"?Te(ve(""),B(Ce({unit:vr()}),wt(...bd)).map(n=>`${n[0]}${n[1]}`,n=>{if(typeof n!="string"||n.length===0)throw new L("Invalid type");return[ge(n,0,n.length-1),n[n.length-1]]})):Te(ve(""),B(wt(...bd),Ce({unit:vr()})).map(n=>`${n[0]}${n[1]}`,n=>{if(typeof n!="string"||n.length===0)throw new L("Invalid type");return[n[0],ge(n,1)]})):ve("");throw new L(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":throw new L("Backreference nodes not implemented yet!");case"UnicodeProperty":return Z7(e);default:throw jw(e)}}function e8(e,t={}){for(let a of e.flags)if(a!=="d"&&a!=="g"&&a!=="m"&&a!=="s"&&a!=="u")throw new L(`Unable to use "stringMatching" against a regex using the flag ${a}`);let r=t.maxLength,n={size:t.size,maxLength:r},i={multiline:e.multiline,dotAll:e.dotAll},o=j7(H7(e));r!==void 0&&(o=_7(o,r));let s=Qt(o,n,i);return r!==void 0?s.filter(a=>[...a].length<=r):s}function t8(e){let t=[];for(let r=0;r!==e.length;++r)t.push(e[r].next());return t}function r8(e,t){for(let r=0;r!==e.length;++r)t[r]=e[r].next()}function n8(e){for(let t=0;t!==e.length;++t)if(e[t].done)return!0;return!1}function*i8(...e){let t=t8(e);for(;!n8(t);)yield t.map(r=>r.value),r8(e,t)}function*o8(e){let t=e;for(;;)yield t,++t}var s8=class extends de{constructor(e,t){super(),this.arb=e,this.maxShrinks=t}generate(e,t){let r=this.arb.generate(e,t);return this.valueMapper(r,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,r){let n=this.maxShrinks-r;return n<=0?j.nil():new j(i8(this.arb.shrink(e,t),o8(r+1))).take(n).map(i=>this.valueMapper(i[0],i[1]))}valueMapper(e,t){let r={originalContext:e.context,length:t};return new D(e.value,r)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalContext"in e&&"length"in e}};function a8(e,t){return new s8(e,t)}var l8=Cb({Arbitrary:()=>de,ExecutionStatus:()=>xN,PreconditionFailure:()=>ir,Random:()=>Ed,Stream:()=>j,Value:()=>D,VerbosityLevel:()=>eN,__commitHash:()=>d8,__type:()=>u8,__version:()=>c8,anything:()=>y0,array:()=>ae,assert:()=>zN,asyncDefaultReportMessage:()=>g1,asyncModelRun:()=>I7,asyncProperty:()=>X4,asyncStringify:()=>kd,asyncToStringMethod:()=>Ft,base64String:()=>j_,bigInt:()=>nr,bigInt64Array:()=>N7,bigUint64Array:()=>L7,boolean:()=>Si,chainUntil:()=>L3,check:()=>b1,clone:()=>j3,cloneIfNeeded:()=>rn,cloneMethod:()=>Me,commands:()=>x7,compareBooleanFunc:()=>F$,compareFunc:()=>V$,configureGlobal:()=>Y4,constant:()=>ve,constantFrom:()=>wt,context:()=>I3,createDepthIdentifier:()=>Id,date:()=>T1,defaultReportMessage:()=>m1,dictionary:()=>Md,domain:()=>$d,double:()=>qs,emailAddress:()=>XL,entityGraph:()=>FD,falsy:()=>C3,float:()=>J1,float32Array:()=>i0,float64Array:()=>o0,func:()=>W$,gen:()=>QN,getDepthContextFor:()=>Ad,hasAsyncToStringMethod:()=>Rd,hasCloneMethod:()=>xr,hasToStringMethod:()=>xd,hash:()=>zs,infiniteStream:()=>O_,int16Array:()=>s0,int32Array:()=>a0,int8Array:()=>l0,integer:()=>ie,ipV4:()=>jd,ipV4Extended:()=>e0,ipV6:()=>t0,json:()=>P_,jsonValue:()=>b0,letrec:()=>r0,limitShrink:()=>a8,lorem:()=>HD,map:()=>dd,mapToConstant:()=>ln,maxSafeInteger:()=>Q1,maxSafeNat:()=>q$,memo:()=>JD,mixedCase:()=>r_,modelRun:()=>A7,nat:()=>er,noBias:()=>Ws,noShrink:()=>Gs,object:()=>k_,oneof:()=>Te,option:()=>jt,pre:()=>E6,property:()=>Q4,readConfigureGlobal:()=>ct,record:()=>cd,resetConfigureGlobal:()=>J4,sample:()=>HN,scheduledModelRun:()=>P7,scheduler:()=>M7,schedulerFor:()=>O7,set:()=>h0,shuffledSubarray:()=>z_,sparseArray:()=>p0,statistics:()=>KN,stream:()=>rr,string:()=>Ce,stringMatching:()=>e8,stringify:()=>xe,subarray:()=>W_,toStringMethod:()=>dt,tuple:()=>B,uint16Array:()=>u0,uint32Array:()=>c0,uint8Array:()=>d0,uint8ClampedArray:()=>f0,ulid:()=>X_,uniqueArray:()=>kr,uuid:()=>o7,webAuthority:()=>x0,webFragments:()=>k0,webPath:()=>C0,webQueryParameters:()=>A0,webSegment:()=>E0,webUrl:()=>b7}),u8="module",c8="4.8.0",d8="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c",Oe=l8;function Ys(e){return e?.values!=null&&e.values.length>0?Oe.constantFrom(...e.values):f8(e)}function f8(e){if(e?.type==="number")return Oe.integer();if(e?.type==="boolean")return Oe.boolean();let t=e?.generator==null?void 0:h8[e.generator];if(t!=null)return t;let r=e?.constraints?.kind==="string"?e.constraints:void 0;return Oe.string({maxLength:r?.maxLength,minLength:r?.minLength??1}).filter(n=>n.trim().length>0&&n===n.trim())}var p8="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],un=e=>Oe.array(Oe.constantFrom(...p8),{maxLength:e,minLength:1}).map(t=>t.join("")),zd=(e,t)=>Oe.array(un(10),{maxLength:t,minLength:1}).map(r=>r.join(e)),h8={"company.name":zd(" ",3),"date.iso":m8(),"internet.email":g8(),"internet.url":y8(),"lorem.slug":zd("-",3),"lorem.word":un(10),"person.fullName":zd(" ",2)};function m8(){return Oe.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 g8(){return Oe.tuple(un(12),un(10),Oe.constantFrom("com","dev","io","org","ai")).map(([e,t,r])=>`${e}@${t}.${r}`)}function y8(){return Oe.tuple(Oe.constantFrom("http","https"),un(12),Oe.constantFrom("app","com","dev","io","org"),Oe.array(un(8),{maxLength:3})).map(([e,t,r,n])=>{let i=n.length===0?"":`/${n.join("/")}`;return`${e}://${t}.${r}${i}`})}var j0=new WeakMap;function Gd(e){let t=j0.get(e);if(t!=null)return t;let r=Object.fromEntries(Object.entries(e.paramSpaces).map(([n,i])=>[n,S8(i)]));return j0.set(e,r),r}var b8=24301;function S8(e){let[t]=Oe.sample(Ys(e),{numRuns:1,seed:b8});if(t==null)throw new Error("arbitrary produced no sample");return t}function wi(e){return{aborted:!0,findings:[],fired:[],teardown:e}}function qd(e,t){return new w8(v8(e,t))}async function v8({browser:e,hub:t,request:r},n){if(n.aborted)return Hd(wi("skipped"));let i=A8({lockfile:r.lockfile,options:r.options,runId:r.runId,signal:n}),o=async s=>{try{return Hd(await R8({browser:e,established:s,hub:t,request:r,signal:n}))}catch(a){return V0(vn(a))}};return C8(i,r).match(o,s=>x8(s,i.teardown))}async function x8(e,t){return e.kind!=="aborted"?V0(e):Hd(wi(await B0(t)))}function B0(e){return e().match(()=>"done",()=>"failed")}async function R8(e){let t=await k8(e);if(t.kind==="completed")return await e.established.teardown().match(no,Wp),{aborted:!1,...t.result};let r=await B0(e.established.teardown);if(t.kind==="aborted")return wi(r);throw t.error}async function k8({browser:e,established:t,hub:r,request:n,signal:i}){try{qt(i);let{close:o,driver:s,emitAssertion:a}=await Ml({baseUrl:n.options.baseUrl,browser:e,capture:n.capture?{hub:r,runId:n.runId}:null,clientState:t.clientState,engine:Al(P8(n.lockfile)),reader:t.reader,session:t.auth});try{return{kind:"completed",result:await Rl({canon:za(n.lockfile),classify:Wa(n.lockfile),driver:s,initialState:{snapshot:t.snapshot},onAssertion:a,onEvent:n.onEvent??no,sequence:n.sequence??E8(n.lockfile,n.testName,n.params),...gc(n.lockfile)},i)}}finally{await o()}}catch(o){return Jp(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function E8(e,t,r){return fo(e,t).map(n=>({params:{...Gd(n),...r},transition:n}))}function C8(e,t){return Tn(t.lockfile,t.testName,{generate:Cl(El(t.options.generate,t.runId),new Date().toISOString()),materialize:e.materialize,params:t.params}).map(r=>({auth:r.auth,clientState:r.clientState,reader:e.reader,snapshot:r.snapshot,teardown:e.teardown}))}function A8({lockfile:e,options:t,runId:r,signal:n}){let i=$l({baseUrl:t.engineUrl,runId:r,secret:t.secret},n);return{materialize:al(i.setupWorld),reader:Ll(e.entities,I8(e),i.query),teardown:i.teardown}}function I8(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function P8(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}function N8({debugDir:e,headed:t,writeOtlpPortFile:r}){let n=om({headed:t}),i,o,s=async()=>(i??=mc({debugDir:e,writeOtlpPortFile:r}),o=await i,o),a=async(u,c)=>{if(c.aborted)return M8(wi("skipped"));try{let d=await s();return u.options.headed&&!t?await Ol(!0,async p=>qd({browser:p,hub:d,request:u},c)):await qd({browser:await n.acquire(),hub:d,request:u},c)}catch(d){return T8(vn(d))}};return{close:async()=>{await n.close();let u=i;i=void 0,o=void 0,u!=null&&await u.then(c=>c.close()).catch(()=>{})},injectSpan:(u,c)=>{o?.injectSpan(u,c)},runOnce:(u,c)=>new O8(a(u,c))}}function vi(e,t){let r=e.axes.flatMap(n=>n.classify(t).map(([i,o])=>`${i}:${o}`));return[t.label,...r.toSorted((n,i)=>n.localeCompare(i))].join("|")}function Kd(e){return e.axes.map(t=>t.name).join("+")}function Yd(e){return{name:`counts(${e})`,classify:({pre:t})=>[...t.entities].flatMap(([r,n])=>n.size===0?[]:[[r,$8(e,n.size)]])}}function Jd(e){let t=U0(e);return{name:"enum-fields",classify:({pre:r})=>[...r.entities].flatMap(([n,i])=>[...i.values()].flatMap(o=>L8(n,o,t)))}}function L8(e,t,r){return Object.entries(t).flatMap(([n,i])=>r.has(`${e}.${n}`)?[[`${e}.${n}`,D8(i)]]:[])}function U0(e){let t=e.valueSpaces.flatMap(n=>n.values==null?[]:[n.name]),r=new Set(t);return new Set(e.entities.flatMap(n=>Object.entries(n.props).flatMap(([i,o])=>o.type==="boolean"||o.valueSpace!=null&&r.has(o.valueSpace)?[`${n.name}.${i}`]:[])))}function $8(e,t){return e==="presence"?"1+":e==="unit"?t===1?"1":"2+":t<=2?String(t):"3+"}function D8(e){return e==null?"\u2205":String(e)}import{createHash as _8}from"crypto";import{appendFile as F8,mkdir as j8,readFile as V8}from"fs/promises";import B8 from"path";import{ResultAsync as z0}from"neverthrow";import{z as R}from"zod";var cn=R.enum(["crash","invariant","law","frame"]),W0=R.object({intent:R.string().min(1),test:R.string().min(1)}),U8=R.union([R.object({kind:R.literal("singleton-mismatch"),singleton:R.string().min(1)}),R.object({entity:R.string().min(1),kind:R.string().min(1)})]),G0=R.discriminatedUnion("kind",[R.object({divergence:U8,kind:R.literal("consistency"),layer:cn,step:W0.nullable()}),R.object({kind:R.literal("obligation"),layer:cn,source:R.string().min(1),step:W0}),R.object({intent:R.string().min(1),kind:R.literal("unfireable"),layer:cn,reason:R.string().min(1),test:R.string().min(1)}),R.object({error:R.string().min(1),kind:R.literal("driver-error"),layer:cn,step:R.string().min(1)}),R.object({kind:R.literal("illegal-transition"),layer:cn,step:R.string().min(1)})]),W8=R.object({actionHash:R.string().min(1),at:R.string().min(1),kind:R.literal("covered"),lensId:R.string().min(1),targetKey:R.string().min(1)}),z8=R.object({actionHash:R.string().min(1),at:R.string().min(1),depot:R.string().min(1),evidence:R.array(R.string().min(1)),kind:R.literal("finding"),lensId:R.string().min(1),lockfileHash:R.string().min(1),oracleLayer:cn,parts:R.array(G0),runId:R.string().min(1).optional(),signature:R.string().min(1),targetKey:R.string().min(1),trail:R.array(R.string().min(1)),trailParams:R.array(R.record(R.string(),R.union([Ze,R.null()])))}),G8=R.object({actionHash:R.string().min(1),at:R.string().min(1),depot:R.string().min(1),evidence:R.array(R.string().min(1)),kind:R.literal("flaky-candidate"),lensId:R.string().min(1),parts:R.array(G0),signature:R.string().min(1),targetKey:R.string().min(1),trail:R.array(R.string().min(1))}),H8=R.object({at:R.string().min(1),kind:R.literal("saturation"),lensId:R.string().min(1),lockfileHash:R.string().min(1),ring:R.number().int().nonnegative()}),q8=R.object({at:R.string().min(1),kind:R.literal("resolution"),signature:R.string().min(1)}),K8=R.object({arrangement:R.string().min(1),at:R.string().min(1),canonicalKey:R.string().min(1),kind:R.literal("derived-depot")}),Js=R.discriminatedUnion("kind",[W8,z8,G8,H8,q8,K8]);function Zs(e){return ef(e).slice(0,12)}function ze(e){return`${e.lensId} ${e.actionHash} ${e.targetKey}`}function xi(e){return e.reduce((t,r)=>e9(t,r),Q8())}function Ri(e){return z0.fromPromise(Y8(e),t=>({error:t,kind:"io"})).map(t=>Z8(t))}function Zd(e,t){let r=t.map(n=>`${JSON.stringify(n)}
|
|
136
|
-
`).join("");return
|
|
137
|
-
`).filter(r=>r.length>0)}function J8(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"}function Z8(e){return e.flatMap(t=>{let r=Js.safeParse(X8(t));return r.success?[r.data]:[]})}function X8(e){try{return JSON.parse(e)}catch{return null}}function ef(e){return _8("sha256").update(e).digest("hex")}function Q8(){return{covered:new Set,findings:new Map,flaky:new Map,saturations:new Map}}function e9(e,t){if(t.kind==="covered")return{...e,covered:new Set([...e.covered,ze(t)])};if(t.kind==="flaky-candidate")return{...e,covered:new Set([...e.covered,ze(t)]),flaky:t9(e.flaky,t)};if(t.kind==="finding")return{...e,covered:new Set([...e.covered,ze(t)]),findings:r9(e.findings,t)};if(t.kind==="resolution")return{...e,findings:n9(e.findings,t)};if(t.kind==="saturation"){let r=`${t.lensId} ${String(t.ring)}`;return{...e,saturations:new Map([...e.saturations,[r,t]])}}return e}function t9(e,t){let r=e.get(t.signature),n=r==null?{first:t,occurrences:1}:{first:r.first,occurrences:r.occurrences+1};return new Map([...e,[t.signature,n]])}function r9(e,t){let r=e.get(t.signature),n=r==null?{first:t,latest:t,occurrences:1,resolvedAt:void 0}:{first:r.first,latest:t,occurrences:r.occurrences+1,resolvedAt:void 0};return new Map([...e,[t.signature,n]])}function n9(e,t){let r=e.get(t.signature);return r==null?e:new Map([...e,[t.signature,{...r,resolvedAt:t.at}]])}function tf(e){let t={edges:new Map,saturationDepth:0,seen:new Set,states:0,targets:new Map},r=e.depots.map(n=>(t.seen.add(pr(n.snapshot)),{depot:n.name,lastLabel:null,snapshot:n.snapshot,trail:[]}));return o9(e,r,t),{edges:t.edges,saturationDepth:t.saturationDepth,states:t.seen.size,targets:t.targets}}var i9=24301,H0=new WeakMap;function Xs(e,t){let r=H0.get(e)??new Map;H0.set(e,r);let n=r.get(t);if(n!=null)return n;let i=Object.fromEntries(Object.entries(e.paramSpaces).map(([o,s])=>[o,d9(s,t)]));return r.set(t,i),i}function o9(e,t,r){let n=[...t],i=0;for(;i<n.length;){let o=n[i];i+=1,o!=null&&s9(e,o,r).forEach(s=>n.push(s))}}function s9(e,t,r){let n={snapshot:t.snapshot},i=o=>Xs(o,c9(t.trail,e.corpus,o));return $r(e.corpus,n,i).flatMap(o=>{let s=e.corpus[o.idx];if(s==null)return[];let a=[...t.trail,{idx:o.idx,params:o.params}],l={depot:t.depot,trail:a,transitionIndex:o.idx};return a9({acc:r,node:t,option:o,params:e,transition:s,witness:l}),l9({acc:r,node:t,option:o,params:e,trail:a})})}function a9({acc:e,node:t,option:r,params:n,transition:i,witness:o}){let s={label:r.label,params:r.params,pre:t.snapshot,spaces:i.paramSpaces},a=vi(n.lens,s);if(e.targets.has(a)||(e.targets.set(a,o),e.saturationDepth=Math.max(e.saturationDepth,o.trail.length)),t.lastLabel!=null){let l=`${t.lastLabel} \u2192 ${r.label}`;e.edges.has(l)||e.edges.set(l,o)}}function l9({acc:e,node:t,option:r,params:n,trail:i}){if(i.length>=n.maxDepth)return[];let o=r.firing.next.snapshot;if(u9(t.snapshot,o,n.maxCount))return[];let s=pr(o);return e.seen.has(s)?[]:(e.seen.add(s),[{depot:t.depot,lastLabel:r.label,snapshot:o,trail:i}])}function u9(e,t,r){return[...t.entities].some(([n,i])=>{let o=e.entities.get(n)?.size??0;return i.size>o&&i.size>r})}function c9(e,t,r){return e.filter(n=>t[n.idx]===r).length}function d9(e,t){let[r]=Oe.sample(Ys(e),{numRuns:1,seed:i9+t});if(r==null)throw new Error("arbitrary produced no sample");return r}var f9=10;function rf(e){return sf(e).reduce((t,r)=>t+K0(e,r).length,0)}function nf(e){return e.targets.size+e.edges.size}function of(e){let t=sf(e).map(o=>K0(e,o)),r=p9(e,t);if(r!=null)return r;let n=t.find(o=>o.length>0);return n==null?{kind:"saturated",ring:t.length}:{kind:"cover",target:n.reduce((o,s)=>q0(e,s)>q0(e,o)?s:o)}}function sf(e){return[{entries:e.graph.targets,index:1},{entries:e.graph.edges,index:2}]}function K0(e,t){return[...t.entries].flatMap(([r,n])=>{let i=Y0({params:e,ring:t.index,targetKey:r,witness:n});return e.covered.has(J0(e,i))?[]:[i]})}function Y0({params:e,ring:t,targetKey:r,witness:n}){let i=e.actionHashes[n.transitionIndex];if(i==null)throw new Error("transition index out of corpus range");return{actionHash:i,ring:t,targetKey:r,witness:n}}function J0(e,t){return ze({actionHash:t.actionHash,lensId:e.lensId,targetKey:t.targetKey})}function p9(e,t){if(e.tick===0||e.tick%f9!==0)return null;let r=sf(e).flatMap(i=>[...i.entries].flatMap(([o,s])=>{let a=Y0({params:e,ring:i.index,targetKey:o,witness:s});return e.covered.has(J0(e,a))?[a]:[]}));if(r.length===0||t.every(i=>i.length===0))return null;let n=r[e.tick%r.length];return n==null?null:{kind:"revalidate",target:n}}var h9=/delete|remove|cancel|deactivate|revoke|archive/i;function q0(e,t){let r=t.ring===2&&m9(e,t)?4:0,n=h9.test(t.targetKey)?2:0,i=1/(1+t.witness.trail.length);return r+n+i}function m9(e,t){return new Set(t.witness.trail.flatMap(n=>{let i=e.corpus[n.idx];return i==null?[]:[i.test]})).size>1}function g9(e){let t=y9(e,e.witnessTrail);return t==null?{covers:[],firings:[]}:S9(e,t)}function y9(e,t){return t.reduce((r,n)=>r==null?null:b9(e,r,n),{covers:[],firings:[],snapshot:e.depotSnapshot})}function b9(e,t,r){let n=e.corpus[r.idx];if(n==null)return null;let i=On(n,{snapshot:t.snapshot},r.params);if(i==null)return null;let o=Z0({params:e,planned:r,pre:t.snapshot,transition:n});return{covers:[...t.covers,o],firings:[...t.firings,r],snapshot:i.next.snapshot}}function Z0({params:e,planned:t,pre:r,transition:n}){let i={label:`${n.test}#${String(n.index)}`,params:t.params,pre:r,spaces:n.paramSpaces},o=e.actionHashes[t.idx];if(o==null)throw new Error("transition index out of corpus range");return{actionHash:o,targetKey:vi(e.lens,i)}}function S9(e,t){let r=new Set([...e.covered,...t.covers.map(i=>ze({...i,lensId:e.lensId}))]),n=X0({params:e,seen:r,state:t});return{covers:n.covers,firings:n.firings}}function X0({params:e,seen:t,state:r}){if(r.firings.length>=e.maxLength)return r;let n=w9({params:e,seen:t,state:r});return n==null?r:(t.add(ze({...n.coverage,lensId:e.lensId})),X0({params:e,seen:t,state:{covers:[...r.covers,n.coverage],firings:[...r.firings,n.planned],snapshot:n.snapshot}}))}function w9({params:e,seen:t,state:r}){let n=o=>Xs(o,v9(r.firings,e.corpus,o));return $r(e.corpus,{snapshot:r.snapshot},n).map(o=>{let s=e.corpus[o.idx];if(s==null)return null;let a={idx:o.idx,params:o.params};return{coverage:Z0({params:e,planned:a,pre:r.snapshot,transition:s}),planned:a,snapshot:o.firing.next.snapshot}}).find(o=>o!=null&&!t.has(ze({...o.coverage,lensId:e.lensId})))??null}function v9(e,t,r){return e.filter(n=>t[n.idx]===r).length}function af(e,{sweep:t}){let r=Ct(e.tests.filter(n=>!n.stub),n=>J({s:n.singletons,w:n.world})).map(n=>({name:n.name,test:n}));return t?[...r,...r.flatMap(n=>x9(n))]:r}function lf(e,t,r){return Tn({...e,tests:[t.test]},t.test.name,r)}function x9(e){return R9(e.test).map(t=>{let r={...t,as:`${t.as}~2`},n=`${e.name} +${t.entity}`;return{name:n,test:{...e.test,name:n,world:[...e.test.world,r]}}})}function R9(e){return e.world.filter(t=>{let r=J({...e,world:e.world.filter(n=>n!==t)});return!r.includes(`"${t.as}.`)&&!r.includes(`"ref":"${t.as}"`)})}async function k9(e,t){let r=await Qs({attemptIndex:0,capture:!1,firings:e.trail.firings,params:e},t);return r.kind!=="completed"?ev(r):r.findings.length===0?{kind:"clean",rows:T9(e)}:E9(e,ki(e.depot.name,r.findings),t)}function ev(e){return e.kind==="aborted"?{kind:"aborted"}:{error:e.error,kind:"error"}}async function E9(e,t,r){let n=await Qs({attemptIndex:1,capture:!1,firings:e.trail.firings,params:e},r);return n.kind!=="completed"?ev(n):ki(e.depot.name,n.findings).signature!==t.signature?{kind:"flaky",rows:[M9(e,t)]}:C9({digest:t,params:e,signal:r})}async function Qs({attemptIndex:e,capture:t,firings:r,params:n},i){let o=n.runIdFor(e);return(await n.session.runOnce({capture:t,lockfile:P9(n),onEvent:void 0,options:n.options,params:void 0,runId:o,sequence:I9(n,r),testName:n.depot.test.name},i)).match(a=>a.aborted?{kind:"aborted"}:{findings:a.findings,kind:"completed",runId:o},a=>({error:a,kind:"error"}))}async function C9({digest:e,params:t,signal:r}){let n=await tv({attemptIndex:2,budget:t.shrinkBudget,firings:t.trail.firings,params:t,signal:r,signature:e.signature});if(n.kind!=="shrunk")return n.outcome;let i=await A9({firings:n.firings,params:t,signal:r,signature:e.signature});if(i.kind==="aborted")return{kind:"aborted"};let o=$9({digest:e,minimal:n.firings,params:t,runId:i.kind==="reproduced"?i.runId:void 0});return{finding:o,kind:"finding",minimal:n.firings,rows:[o],runId:i.kind==="reproduced"?i.runId:n.runId}}async function A9({firings:e,params:t,signal:r,signature:n}){let i=await Qs({attemptIndex:t.shrinkBudget+2,capture:!0,firings:e,params:t},r);return i.kind==="aborted"?{kind:"aborted"}:i.kind==="completed"&&ki(t.depot.name,i.findings).signature===n?{kind:"reproduced",runId:i.runId}:{kind:"no-repro"}}async function tv(e){let t={firings:e.firings,kind:"shrunk",runId:e.params.runIdFor(e.attemptIndex-1)};if(e.budget<=0||e.firings.length<=1)return t;let r=e.firings.map((n,i)=>e.firings.filter((o,s)=>s!==i));return rv(e,r,t)}async function rv(e,t,r){let[n,...i]=t;if(n==null||e.budget-1<0)return r;let o=await Qs({attemptIndex:e.attemptIndex,capture:!1,firings:n,params:e.params},e.signal);if(o.kind==="aborted")return{kind:"halted",outcome:{kind:"aborted"}};let s={...e,attemptIndex:e.attemptIndex+1,budget:e.budget-1};return o.kind==="completed"&&ki(e.params.depot.name,o.findings).signature===e.signature?tv({...s,firings:n}):rv(s,i,r)}function I9(e,t){return t.map(r=>{let n=e.corpus[r.idx];if(n==null)throw new Error("transition index out of corpus range");return{params:r.params,transition:n}})}function P9(e){return e.lockfile.tests.some(r=>r.name===e.depot.test.name)?e.lockfile:{...e.lockfile,tests:[...e.lockfile.tests,e.depot.test]}}function T9(e){return e.trail.covers.map(t=>({actionHash:t.actionHash,at:e.now(),kind:"covered",lensId:e.lensId,targetKey:t.targetKey}))}function M9(e,t){return{actionHash:uf(e).actionHash,at:e.now(),depot:e.depot.name,evidence:[...t.evidence],kind:"flaky-candidate",lensId:e.lensId,parts:[...t.parts],signature:t.signature,targetKey:uf(e).targetKey,trail:e.trail.covers.map(r=>r.targetKey)}}function nv(e){return e.kind==="driver-error"||e.kind==="unfireable"?"crash":e.kind==="obligation"?e.source.kind==="invariant"?"invariant":e.source.kind==="law"?"law":"frame":"frame"}function ki(e,t){let r=t.map(i=>({line:bm(i),part:N9(i)})).toSorted((i,o)=>J(i.part).localeCompare(J(o.part))),n=r.map(i=>i.part);return{evidence:r.map(i=>i.line),layer:O9(n),parts:n,signature:J({depot:e,parts:n.map(i=>J(i))})}}var Q0={crash:0,frame:3,invariant:1,law:2};function O9(e){return e.map(r=>r.layer).toSorted((r,n)=>Q0[r]-Q0[n]).at(0)??"frame"}function N9(e){let t=nv(e);switch(e.kind){case"consistency":return{divergence:L9(e.divergence),kind:"consistency",layer:t,step:e.step==null?null:{intent:e.step.intent,test:e.step.test}};case"obligation":return{kind:"obligation",layer:t,source:e.source.kind,step:{intent:e.step.intent,test:e.step.test}};case"unfireable":return{intent:e.intent,kind:"unfireable",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"illegal-transition":return{kind:"illegal-transition",layer:t,step:e.step.intent}}}function L9(e){return e.kind==="singleton-mismatch"?{kind:e.kind,singleton:e.singleton}:{entity:e.entity,kind:e.kind}}function $9({digest:e,minimal:t,params:r,runId:n}){let i=uf(r);return{actionHash:i.actionHash,at:r.now(),depot:r.depot.name,evidence:[...e.evidence],kind:"finding",lensId:r.lensId,lockfileHash:r.lockfileHash,oracleLayer:e.layer,parts:[...e.parts],runId:n,signature:e.signature,targetKey:i.targetKey,trail:t.map(o=>{let s=r.corpus[o.idx];if(s==null)throw new Error("transition index out of corpus range");return`${s.test}#${String(s.index)}`}),trailParams:t.map(o=>o.params)}}function uf(e){let t=e.trail.covers.at(-1);if(t==null)throw new Error("trail has no coverage");return t}function pK(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 hK({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(`
|
|
138
|
-
`)}function
|
|
131
|
+
}`}return V$(o,{toString:{value:()=>s(xe(t))},[dt]:{value:()=>s(xe(t))},[Ft]:{value:async()=>s(await Rd(t))},[Me]:{value:n,configurable:!0}})};return n()})}var W$=Number.MIN_SAFE_INTEGER,z$=Number.MAX_SAFE_INTEGER;function X1(){return new an(W$,z$)}var G$=Number.MAX_SAFE_INTEGER;function H$(){return new an(0,G$)}var q$=Number.parseInt;function K$(e){let[t,r]=e;switch(t){case"oct":return`0${hi(r,8)}`;case"hex":return`0x${hi(r,16)}`;default:return`${r}`}}function Ls(e,t){let r=q$(e,t);if(hi(r,t)!==e)throw new Error("Invalid value");return r}function Y$(e){if(typeof e!="string")throw new Error("Invalid type");return e.length>=2&&e[0]==="0"?e[1]==="x"?["hex",Ls(ge(e,2),16)]:["oct",Ls(ge(e,1),8)]:["dec",Ls(e,10)]}function J$(e){return ce(e,".")}function Z$(e){if(typeof e!="string")throw new Error("Invalid type");return G(Be(e,"."),t=>Ls(t,10))}function Fd(){return B(er(255),er(255),er(255),er(255)).map(J$,Z$)}function St(e){return B(wt("dec","oct","hex"),er(e)).map(K$,Y$)}function Mc(e){return ce(e,".")}function Oc(e){if(typeof e!="string")throw new Error("Invalid type");return Be(e,".")}function Q1(){return Te(B(St(255),St(255),St(255),St(255)).map(Mc,Oc),B(St(255),St(255),St(65535)).map(Mc,Oc),B(St(255),St(16777215)).map(Mc,Oc),St(4294967295))}function jd(e){return e.length===0?[]:Be(e,":")}function Vd(e){let t=Be(e,":");return t.length>=2&&t[t.length-1].length<=4?[Le(t,0,t.length-2),`${t[t.length-2]}:${t[t.length-1]}`]:[Le(t,0,t.length-1),t[t.length-1]]}function X$(e){return`${ce(e[0],":")}:${e[1]}`}function Q$(e){if(typeof e!="string")throw new Error("Invalid type");return Vd(e)}function eD(e){return`::${ce(e[0],":")}:${e[1]}`}function tD(e){if(typeof e!="string")throw new Error("Invalid type");if(!L4(e,"::"))throw new Error("Invalid value");return Vd(ge(e,2))}function $s(e){return`${ce(e[0],":")}::${ce(e[1],":")}:${e[2]}`}function Ds(e){if(typeof e!="string")throw new Error("Invalid type");let[t,r]=Be(e,"::",2),[n,i]=Vd(r);return[jd(t),n,i]}function rD(e){return $s([e[0],[e[1]],e[2]])}function nD(e){let t=Ds(e);return[t[0],ce(t[1],":"),t[2]]}function uw(e){return`${ce(e[0],":")}::${e[1]}`}function cw(e){if(typeof e!="string")throw new Error("Invalid type");let[t,r]=Be(e,"::",2);return[jd(t),r]}function iD(e){return`${ce(e[0],":")}::`}function oD(e){if(typeof e!="string")throw new Error("Invalid type");if(!$4(e,"::"))throw new Error("Invalid value");return[jd(ge(e,0,e.length-2))]}function sD([e,t]){return`${e}:${t}`}function aD(e){if(typeof e!="string")throw new L("Invalid type");if(!e.includes(":"))throw new L("Invalid value");return e.split(":",2)}var lD="0123456789abcdef",Nc;function uD(){return Nc===void 0&&(Nc=ie({min:0,max:15}).map(e=>lD[e],e=>{if(typeof e!="string")throw new L("Not a string");if(e.length!==1)throw new L("Invalid length");let t=on(e,0);if(t<=57)return t-48;if(t<97)throw new L("Invalid character");return t-87})),Nc}function e0(){let e=Ce({unit:uD(),minLength:1,maxLength:4,size:"max"}),t=Te(B(e,e).map(sD,aD),Fd());return Te(B(ae(e,{minLength:6,maxLength:6,size:"max"}),t).map(X$,Q$),B(ae(e,{minLength:5,maxLength:5,size:"max"}),t).map(eD,tD),B(ae(e,{minLength:0,maxLength:1,size:"max"}),ae(e,{minLength:4,maxLength:4,size:"max"}),t).map($s,Ds),B(ae(e,{minLength:0,maxLength:2,size:"max"}),ae(e,{minLength:3,maxLength:3,size:"max"}),t).map($s,Ds),B(ae(e,{minLength:0,maxLength:3,size:"max"}),ae(e,{minLength:2,maxLength:2,size:"max"}),t).map($s,Ds),B(ae(e,{minLength:0,maxLength:4,size:"max"}),e,t).map(rD,nD),B(ae(e,{minLength:0,maxLength:5,size:"max"}),t).map(uw,cw),B(ae(e,{minLength:0,maxLength:6,size:"max"}),e).map(uw,cw),B(ae(e,{minLength:0,maxLength:7,size:"max"})).map(iD,oD))}var cD=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)}},dD=Object.getOwnPropertyNames;function fD(){let e=new _t;return r=>{let n=Ye(e,r);return n!==void 0||(n=new cD(String(r)),ut(e,r,n)),n}}function t0(e){let t=fD(),r=e(t),n=dD(r);for(let i of n){let o=t(i);o.underlying=r[i]}return r}function pD(e,t){for(let r of e){let n=t[r]||{};if(n.maxLength===void 0||n.maxLength>0)return!0}return!1}function hD(e,t){if(e.length===0)return ve([]);if(!pD(e,t))throw new L("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return B(...e.map(r=>ae(ve(r),t[r]))).map(r=>u4(r)).filter(r=>r.length>0)}var dw=Object.assign,_s=Object.create,r0=Object.defineProperty,fw=Object.getPrototypeOf,mD=Object.prototype;function gD(e){return r0(_s(null),dt,{configurable:!1,enumerable:!1,writable:!1,value:()=>e})}function pw(e,t){return gD(`<${Ve(e)}#${t}>`)}function yD(e,t){let r=_s(mD);for(let n in e){let i=e[n],o=[];for(let s of i){let a=dw(_s(fw(s)),s);o.push(a)}r[n]=o}for(let n in t){let i=t[n];for(let o=0;o!==i.length;++o){let s=i[o],a=r[n][o];for(let l in s){let u=s[l];a[l]=u.index===void 0?void 0:typeof u.index=="number"?r[u.type][u.index]:G(u.index,c=>r[u.type][c])}r0(a,dt,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let l=e[n][o],u=dw(_s(fw(l)),l);for(let c in s){let d=s[c];u[c]=d.index===void 0?void 0:typeof d.index=="number"?pw(d.type,d.index):G(d.index,p=>pw(d.type,p))}return xe(u)}})}}return r}function bD(e){let t=0,r=new _t;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=Ye(r,a.type);if(l===void 0&&(l=new _t,ut(r,a.type,l)),R4(l,a.forwardRelationship))throw new L(`Cannot declare multiple inverse relationships for the same forward relationship ${Ve(a.forwardRelationship)} on type ${Ve(a.type)}`);ut(l,a.forwardRelationship,{type:i,property:s}),t+=1}}let n=new _t;if(t===0)return n;for(let i in e){let o=e[i],s=Ye(r,i);if(s!==void 0)for(let a in o){let l=o[a];if(l.arity==="inverse")continue;let u=Ye(s,a);if(u!==void 0){if(u.type!==l.type)throw new L(`Inverse relationship ${Ve(u.property)} on type ${Ve(u.type)} references forward relationship ${Ve(a)} but types do not match`);ut(n,l,u)}}}if(n.size!==t)throw new L("Some inverse relationships could not be matched with their corresponding forward relationships");return n}var hw=Object.create;function SD(e,t,r){switch(e){case"exclusive":return ve(r);case"successor":return Ws(ie({min:t!==void 0?t+1:0,max:r}));case"any":return Ws(ie({min:0,max:r}))}}function wD(e,t,r,n,i,o,s){let a=SD(t,r,n);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(kr(a,{depthIdentifier:i,selector:d=>d===n?d+ ++l:d,minLength:1}),{nil:[],depthIdentifier:i}).generate(o,s).value,c=0;return G(u,d=>d===n?d+c++:d)}}}var vD=class extends de{constructor(e,t){super(),this.relations=e,this.defaultEntities=t;let r=new nn,n=new nn;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(Us(r,a.type))throw new L(`Cannot mix exclusive with other strategies for type ${Ve(a.type)}`);pi(n,a.type)}else{if(Us(n,a.type))throw new L(`Cannot mix exclusive with other strategies for type ${Ve(a.type)}`);pi(r,a.type)}if(a.strategy==="successor"&&a.type!==i)throw new L("Cannot mix types for the strategy successor");if(a.strategy==="successor"&&a.arity==="1")throw new L("Cannot use an arity of 1 for the strategy successor")}}}this.inversedRelations=bD(e)}createEmptyLinksInstanceFor(e){let t=hw(null),r=this.relations[e];for(let n in r){let i=r[n];i.arity==="inverse"&&(t[n]={type:i.type,index:[]})}return t}generate(e,t){let r=hw(null);for(let o in this.relations)r[o]=[];let n=[];for(let o of this.defaultEntities)$(n,{type:o,indexInType:r[o].length,depth:0}),$(r[o],this.createEmptyLinksInstanceFor(o));let i=-1;for(;++i<n.length;){let o=n[i],s=this.relations[o.type],a=r[o.type][o.indexInType],l=Ad();l.depth=o.depth;for(let u in s){let c=s[u];if(c.arity==="inverse")continue;let d=c.type,p=r[d],h=p.length,f=wD(c.arity,c.strategy||"any",d===o.type?o.indexInType:void 0,p.length,l,e,t);a[u]={type:d,index:f};let m=f===void 0?[]:typeof f=="number"?[f]:f;for(let g of m){g>=h&&($(n,{type:d,indexInType:g,depth:o.depth+1}),$(p,this.createEmptyLinksInstanceFor(d)));let S=Ye(this.inversedRelations,c);if(S!==void 0){let w=p[g][S.property].index;$(w,o.indexInType)}}}}return n.length=0,new _(r,void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function xD(e,t){return new vD(e,t)}var RD=Object.keys,kD=Object.getOwnPropertySymbols,ED=Object.getOwnPropertyDescriptor;function CD(e){let t=RD(e),r=kD(e);for(let n=0;n!==r.length;++n){let i=r[n],o=ED(e,i);o&&o.enumerable&&t.push(i)}return t}var AD=Object.create,ID=Object.defineProperty,PD=Object.getOwnPropertyDescriptor,TD=Object.getOwnPropertyNames,MD=Object.getOwnPropertySymbols;function OD(e,t){return function(n){let i=n[1]?AD(null):{};for(let o=0;o!==e.length;++o){let s=n[0][o];s!==t&&ID(i,e[o],{value:s,configurable:!0,enumerable:!0,writable:!0})}return i}}function ND(e,t){return function(n){if(typeof n!="object"||n===null)throw new Error("Incompatible instance received: should be a non-null object");let i=Object.getPrototypeOf(n)===null,o="constructor"in n&&n.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=PD(n,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,$(a,d.value)}else $(a,t)}let l=TD(n).length,u=MD(n).length;if(s!==l+u)throw new Error("Incompatible instance received: should not contain extra properties");return[a,i]}}var Lc=Symbol("no-key");function $c(e,t,r){let n=CD(e),i=[];for(let o=0;o!==n.length;++o){let s=n[o],a=e[s];t===void 0||$t(t,s)!==-1?$(i,a):$(i,jt(a,{nil:Lc}))}return B(B(...i),r?ve(!1):Si()).map(OD(n,Lc),ND(n,Lc))}function ud(e,t){let r=t!==void 0&&!!t.noNullPrototype;if(t===void 0||!("requiredKeys"in t&&t.requiredKeys!==void 0))return $c(e,void 0,r);let n=("requiredKeys"in t?t.requiredKeys:void 0)||[];for(let i=0;i!==n.length;++i){let o=Object.getOwnPropertyDescriptor(e,n[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 $c(e,n,r)}var LD=Object.create;function $D(e,t,r,n){let i=LD(null);for(let o in e){let s=e[o],a=ud(s,n),l=t(o),u=r(o),c={minLength:l,maxLength:l};i[o]=u!==void 0?kr(a,{...c,selector:u}):ae(a,c)}return ud(i)}var mw=Object.create,DD=Object.keys;function _D(e,t,r={}){let n=DD(e),i=r.initialPoolConstraints||mw(null),o=r.unicityConstraints||mw(null),s={noNullPrototype:r.noNullPrototype};return hD(n,i).chain(a=>xD(t,a).chain(l=>$D(e,u=>l[u].length,u=>o[u],s).map(u=>yD(u,l))))}function FD(e){return ce(G(e,t=>t[t.length-1]===","?ge(t,0,t.length-1):t)," ")}function jD(e){return function(r){if(typeof r!="string")throw new Error("Unsupported type");let n=[];for(let i of Be(r," "))if(e.canShrinkWithoutContext(i))$(n,i);else if(e.canShrinkWithoutContext(i+","))$(n,i+",");else throw new Error("Unsupported word");return n}}function VD(e){let t=ce(e," ");return t[t.length-1]===","&&(t=ge(t,0,t.length-1)),bd(t[0])+ge(t,1)+"."}function BD(e){return function(r){if(typeof r!="string")throw new Error("Unsupported type");if(r.length<2||r[r.length-1]!=="."||r[r.length-2]===","||bd(Hc(r[0]))!==r[0])throw new Error("Unsupported value");let n=Hc(r[0])+ge(r,1,r.length-1),i=[],o=Be(n," ");for(let s=0;s!==o.length;++s){let a=o[s];if(e.canShrinkWithoutContext(a))$(i,a);else if(s===o.length-1&&e.canShrinkWithoutContext(a+","))$(i,a+",");else throw new Error("Unsupported word")}return i}}function UD(e){return ce(e," ")}function WD(e){if(typeof e!="string")throw new Error("Unsupported type");let t=Be(e,". ");for(let r=0;r<t.length-1;++r)t[r]+=".";return t}var b=(e,t)=>({arbitrary:ve(e),weight:t});function zD(){return Te(b("non",6),b("adipiscing",5),b("ligula",5),b("enim",5),b("pellentesque",5),b("in",5),b("augue",5),b("et",5),b("nulla",5),b("lorem",4),b("sit",4),b("sed",4),b("diam",4),b("fermentum",4),b("ut",4),b("eu",4),b("aliquam",4),b("mauris",4),b("vitae",4),b("felis",4),b("ipsum",3),b("dolor",3),b("amet,",3),b("elit",3),b("euismod",3),b("mi",3),b("orci",3),b("erat",3),b("praesent",3),b("egestas",3),b("leo",3),b("vel",3),b("sapien",3),b("integer",3),b("curabitur",3),b("convallis",3),b("purus",3),b("risus",2),b("suspendisse",2),b("lectus",2),b("nec,",2),b("ultricies",2),b("sed,",2),b("cras",2),b("elementum",2),b("ultrices",2),b("maecenas",2),b("massa,",2),b("varius",2),b("a,",2),b("semper",2),b("proin",2),b("nec",2),b("nisl",2),b("amet",2),b("duis",2),b("congue",2),b("libero",2),b("vestibulum",2),b("pede",2),b("blandit",2),b("sodales",2),b("ante",2),b("nibh",2),b("ac",2),b("aenean",2),b("massa",2),b("suscipit",2),b("sollicitudin",2),b("fusce",2),b("tempus",2),b("aliquam,",2),b("nunc",2),b("ullamcorper",2),b("rhoncus",2),b("metus",2),b("faucibus,",2),b("justo",2),b("magna",2),b("at",2),b("tincidunt",2),b("consectetur",1),b("tortor,",1),b("dignissim",1),b("congue,",1),b("non,",1),b("porttitor,",1),b("nonummy",1),b("molestie,",1),b("est",1),b("eleifend",1),b("mi,",1),b("arcu",1),b("scelerisque",1),b("vitae,",1),b("consequat",1),b("in,",1),b("pretium",1),b("volutpat",1),b("pharetra",1),b("tempor",1),b("bibendum",1),b("odio",1),b("dui",1),b("primis",1),b("faucibus",1),b("luctus",1),b("posuere",1),b("cubilia",1),b("curae,",1),b("hendrerit",1),b("velit",1),b("mauris,",1),b("gravida",1),b("ornare",1),b("ut,",1),b("pulvinar",1),b("varius,",1),b("turpis",1),b("nibh,",1),b("eros",1),b("id",1),b("aliquet",1),b("quis",1),b("lobortis",1),b("consectetuer",1),b("morbi",1),b("vehicula",1),b("tortor",1),b("tellus,",1),b("id,",1),b("eu,",1),b("quam",1),b("feugiat,",1),b("posuere,",1),b("iaculis",1),b("lectus,",1),b("tristique",1),b("mollis,",1),b("nisl,",1),b("vulputate",1),b("sem",1),b("vivamus",1),b("placerat",1),b("imperdiet",1),b("cursus",1),b("rutrum",1),b("iaculis,",1),b("augue,",1),b("lacus",1))}function GD(e={}){let{maxCount:t,mode:r="words",size:n}=e;if(t!==void 0&&t<1)throw new Error("lorem has to produce at least one word/sentence");let i=zD();return r==="sentences"?ae(ae(i,{minLength:1,size:"small"}).map(VD,BD(i)),{minLength:1,maxLength:t,size:n}).map(UD,WD):ae(i,{minLength:1,maxLength:t,size:n}).map(FD,jD(i))}function HD(e){return new Map(e)}function qD(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 KD(e){return e[0]}function cd(e,t,r={}){return kr(B(e,t),{minLength:r.minKeys,maxLength:r.maxKeys,size:r.size,selector:KD,depthIdentifier:r.depthIdentifier,comparator:"SameValueZero"}).map(HD,qD)}var Ps=10;function YD(e){let t={};return(r=>{let n=r!==void 0?r:Ps;if(!Zw(t,n)){let i=Ps;Ps=n-1,t[n]=e(n),Ps=i}return t[n]})}function JD(e){let t=0;for(;e>O(0);)e&O(1)&&++t,e>>=O(1);return t}function ZD(e,t){let r=(O(1)<<O(t))-O(1),n=e&r,i=JD(e-n),o=n;for(let s=O(1);s<=r&&i!==0;s<<=O(1))o&s||(o|=s,--i);return o}function Ts(e,t){let r=[];for(let n=e.length-1;n!==-1;--n)t(e[n])!==e[n]&&$(r,n);return r}function XD(e,t,r){let n=O(0);for(let i=0,o=O(1);i!==r.length;++i,o<<=O(1))e[r[i]]!==t[r[i]]&&(n|=o);return n}function Dc(e,t,r,n){for(let i=0,o=O(1);i!==r.length;++i,o<<=O(1))t&o&&(e[r[i]]=n(e[r[i]]))}var QD=class extends de{constructor(e,t,r){super(),this.stringArb=e,this.toggleCase=t,this.untoggleAll=r}buildContextFor(e,t){return{rawString:e.value,rawStringContext:e.context,flags:t.value,flagsContext:t.context}}generate(e,t){let r=this.stringArb.generate(e,t),n=[...r.value],i=Ts(n,this.toggleCase),o=nr(O(0),(O(1)<<O(i.length))-O(1)).generate(e,void 0);return Dc(n,o.value,i,this.toggleCase),new _(ce(n,""),this.buildContextFor(r,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 r;if(t!==void 0)r=t;else if(this.untoggleAll!==void 0){let o=this.untoggleAll(e),s=[...e],a=[...o];r={rawString:o,rawStringContext:void 0,flags:XD(a,s,Ts(a,this.toggleCase)),flagsContext:void 0}}else r={rawString:e,rawStringContext:void 0,flags:O(0),flagsContext:void 0};let n=r.rawString,i=r.flags;return this.stringArb.shrink(n,r.rawStringContext).map(o=>{let s=[...o.value],a=Ts(s,this.toggleCase),l=ZD(i,a.length);return Dc(s,l,a,this.toggleCase),new _(ce(s,""),this.buildContextFor(o,new _(l,void 0)))}).join(tr(()=>{let o=[...n],s=Ts(o,this.toggleCase);return nr(O(0),(O(1)<<O(s.length))-O(1)).shrink(i,r.flagsContext).map(a=>{let l=Le(o);return Dc(l,a.value,s,this.toggleCase),new _(ce(l,""),this.buildContextFor(new _(n,r.rawStringContext),a))})}))}};function e_(e){let t=bd(e);return t!==e?t:Hc(e)}function t_(e,t){return new QD(e,t&&t.toggleCase||e_,t&&t.untoggleAll)}function r_(e){return zw.from(e)}function n_(e){if(!(e instanceof zw))throw new Error("Unexpected type");return[...e]}function n0(e={}){return ae(Y1(e),e).map(r_,n_)}function i_(e){return Gw.from(e)}function o_(e){if(!(e instanceof Gw))throw new Error("Unexpected type");return[...e]}function i0(e={}){return ae(qs(e),e).map(i_,o_)}function Vt(e,t,r,n,i){let o=n.name,{min:s=t,max:a=r,...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>r)throw new Error(`Invalid max value passed to ${o}: max must be lower than or equal to ${r}`);return ae(i({min:s,max:a}),l).map(u=>n.from(u),u=>{if(!(u instanceof n))throw new Error("Invalid type");return[...u]})}function o0(e={}){return Vt(e,-32768,32767,z6,ie)}function s0(e={}){return Vt(e,-2147483648,2147483647,G6,ie)}function a0(e={}){return Vt(e,-128,127,W6,ie)}function l0(e={}){return Vt(e,0,65535,K6,ie)}function u0(e={}){return Vt(e,0,4294967295,Y6,ie)}function c0(e={}){return Vt(e,0,255,H6,ie)}function d0(e={}){return Vt(e,0,255,q6,ie)}function s_(e){return e!==void 0}function gw(e){return e.hasToBeCloned?new _(e.value_,{generatorContext:e.context},()=>e.value):new _(e.value_,{generatorContext:e.context})}function yw(e){return e.hasToBeCloned?new _(e.value_,{shrinkerContext:e.context},()=>e.value):new _(e.value_,{shrinkerContext:e.context})}var a_=class extends de{constructor(e,t){super(),this.generatorArbitrary=e,this.shrinkerArbitrary=t}generate(e,t){return gw(this.generatorArbitrary.generate(e,t))}canShrinkWithoutContext(e){return this.shrinkerArbitrary.canShrinkWithoutContext(e)}shrink(e,t){return s_(t)?"generatorContext"in t?this.generatorArbitrary.shrink(e,t.generatorContext).map(gw):this.shrinkerArbitrary.shrink(e,t.shrinkerContext).map(yw):this.shrinkerArbitrary.shrink(e,void 0).map(yw)}};function dd(e,t,r){let n=ie({min:e,max:t});return t===r?n:new a_(n,ie({min:e,max:r}))}var l_=Math.min,fd=Math.max,bw=Uw.isArray,u_=Object.entries;function c_(e){let t=-1;for(let r=0;r!==e.length;++r)t=fd(t,e[r][0]);return t}function d_(e,t){let r=Uw(e);for(let n=0;n!==t.length;++n){let i=t[n];i[0]<e&&(r[i[0]]=i[1])}return r}function f0(e,t={}){let{size:r,minNumElements:n=0,maxLength:i=Rr,maxNumElements:o=i,noTrailingHole:s,depthIdentifier:a}=t,l=gi(r,gi(r,n,o,t.maxNumElements!==void 0),i,t.maxLength!==void 0);if(n>i)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if(n>o)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let u=l_(o,i),c=t.maxNumElements!==void 0||r!==void 0?r:"=",d=kr(B(dd(0,fd(l-1,0),fd(i-1,0)),e),{size:c,minLength:n,maxLength:u,selector:p=>p[0],depthIdentifier:a}).map(p=>d_(c_(p)+1,p),p=>{if(!bw(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 G(u_(p),h=>[Number(h[0]),h[1]])});return s||i===n?d:B(d,dd(n,l,i)).map(p=>{let h=p[0],f=p[1];if(h.length>=f)return h;let m=Le(h);return m.length=f,m},p=>{if(!bw(p))throw new Error("Not supported entry type");return[p,p.length]})}function f_(e){return new Set(e)}function p_(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 p0(e,t={}){return kr(e,{minLength:t.minLength,maxLength:t.maxLength,size:t.size,depthIdentifier:t.depthIdentifier,comparator:"SameValueZero"}).map(f_,p_)}function h_(e,t,r,n,i,o){return Td(e,t,{maxKeys:r,noNullPrototype:!o,size:n,depthIdentifier:i})}function m_(e){return Te(a0(e),c0(e),d0(e),o0(e),l0(e),s0(e),u0(e),n0(e),i0(e))}function h0(e){let t=e.values,r=e.depthSize,n=Ad(),i=e.maxDepth,o=e.maxKeys,s=e.size,a=Te(...t,...e.withBigInt?[nr()]:[],...e.withDate?[P1()]:[]);return t0(l=>({anything:Te({maxDepth:i,depthSize:r,depthIdentifier:n},a,l("array"),l("object"),...e.withMap?[l("map")]:[],...e.withSet?[l("set")]:[],...e.withObjectString?[l("anything").map(u=>xe(u))]:[],...e.withTypedArray?[m_({maxLength:o,size:s})]:[],...e.withSparseArray?[f0(l("anything"),{maxNumElements:o,size:s,depthIdentifier:n})]:[]),keys:e.withObjectString?Te({arbitrary:e.key,weight:10},{arbitrary:l("anything").map(u=>xe(u)),weight:1}):e.key,array:ae(l("anything"),{maxLength:o,size:s,depthIdentifier:n}),set:p0(l("anything"),{maxLength:o,size:s,depthIdentifier:n}),map:Te(cd(l("keys"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n}),cd(l("anything"),l("anything"),{maxKeys:o,size:s,depthIdentifier:n})),object:h_(l("keys"),l("anything"),o,s,n,e.withNullPrototype)})).anything}function g_(e){switch(typeof e){case"boolean":return new Ww(e);case"number":return new Dt(e);case"string":return new Ve(e);default:return e}}function y_(e){return typeof e!="object"||e===null||!("constructor"in e)?e:e.constructor===Ww||e.constructor===Dt||e.constructor===Ve?e.valueOf():e}function b_(e){return e.map(g_,y_)}function S_(e,t){return[Si(),X1(),qs(),t(e),Te(t(e),ve(null),ve(void 0))]}function w_(e){return e.map(t=>b_(t))}function v_(e,t){return t?w_(e).concat(e):e}function m0(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:Ce(t),values:v_(e.values!==void 0?e.values:S_(t,Ce),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 x_(e){return Td(e.key,h0(e),{maxKeys:e.maxKeys,noNullPrototype:!e.withNullPrototype,size:e.size})}function R_(e){return x_(m0(e))}function k_(e,t){let{depthSize:r,maxDepth:n}=t;return{key:e,values:[Si(),qs({noDefaultInfinity:!0,noNaN:!0}),e,ve(null)],depthSize:r,maxDepth:n}}function g0(e){return h0(m0(e))}function y0(e={}){let t=e.noUnicodeString===void 0||e.noUnicodeString===!0;return g0(k_("stringUnit"in e?Ce({unit:e.stringUnit}):t?Ce():Ce({unit:"binary"}),e))}var E_=JSON.stringify,C_=JSON.parse;function A_(e){if(typeof e!="string")throw new L("Cannot unmap the passed value");return C_(e)}function I_(e={}){return y0(e).map(E_,A_)}var P_=Object.defineProperties;function _c(e,t){return`Stream(${t!==void 0?`${ce(t,",")}\u2026`:`${e} emitted`})`}var T_=class extends de{constructor(e,t){super(),this.arb=e,this.history=t}generate(e,t){let r=t!==void 0&&e.nextInt(1,t)===1?t:void 0,n=()=>{let i=this.history?[]:null,o=0,s=function*(a,l){for(;;){let u=a.generate(l,r).value;o++,i!==null&&$(i,u),yield u}};return P_(new j(s(this.arb,e.clone())),{toString:{value:()=>_c(o,i!==null?i.map(xe):void 0)},[dt]:{value:()=>_c(o,i!==null?i.map(xe):void 0)},[Ft]:{value:async()=>_c(o,i!==null?await Promise.all(i.map(Rd)):void 0)},[Me]:{value:n,enumerable:!0}})};return new _(n(),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function M_(e,t){return new T_(e,t!==void 0&&typeof t=="object"&&"noHistory"in t?!t.noHistory:!0)}function O_(e){return ce(e,"")}function Sw(e){if(typeof e!="string")throw new Error("Cannot unmap the passed value");return[...e]}function N_(e){switch(e.length%4){case 0:return e;case 3:return`${e}=`;case 2:return`${e}==`;default:return ge(e,1)}}function L_(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 Fc=String.fromCharCode;function $_(e){return e<26?Fc(e+65):e<52?Fc(e+97-26):e<62?Fc(e+48-52):e===62?"+":"/"}function D_(e){if(typeof e!="string"||e.length!==1)throw new L("Invalid entry");let t=on(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 __(){return ie({min:0,max:63}).map($_,D_)}function F_(e={}){let{minLength:t=0,maxLength:r=Rr,size:n}=e,i=t+3-(t+3)%4,o=r-r%4,s=e.maxLength===void 0&&n===void 0?"=":n;if(i>o)throw new L("Minimal length should be inferior or equal to maximal length");if(i%4!==0)throw new L("Minimal length of base64 strings must be a multiple of 4");if(o%4!==0)throw new L("Maximal length of base64 strings must be a multiple of 4");let a=__();return ae(a,{minLength:i,maxLength:o,size:s,experimentalCustomSlices:SL(a,Sw)}).map(O_,Sw).map(N_,L_)}var ww=Object.is;function j_(e,t){let r=new _t,n=0;for(let i of e)ww(i,-0)?++n:ut(r,i,(Ye(r,i)||0)+1);for(let i=0;i!==t.length;++i){if(!(i in t))return!1;let o=t[i];if(ww(o,-0)){if(n===0)return!1;--n}else{let s=Ye(r,o)||0;if(s===0)return!1;ut(r,o,s-1)}}return!0}var V_=Math.floor,vw=Math.log,B_=Array.isArray,b0=class extends de{constructor(e,t,r,n){if(super(),this.originalArray=e,this.isOrdered=t,this.minLength=r,this.maxLength=n,r<0||r>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(n<0||n>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(r>n)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new an(r,n),this.biasedLengthArb=r!==n?new an(r,r+V_(vw(n-r)/vw(2))):this.lengthArb}generate(e,t){let r=(t!==void 0&&e.nextInt(1,t)===1?this.biasedLengthArb:this.lengthArb).generate(e,void 0),n=r.value,i=G(this.originalArray,(s,a)=>a),o=[];for(let s=0;s!==n;++s){let a=e.nextInt(0,i.length-1);$(o,i[a]),Kw(i,a,1)}return this.isOrdered&&Yw(o,(s,a)=>s-a),new _(G(o,s=>this.originalArray[s]),r.context)}canShrinkWithoutContext(e){return!B_(e)||!this.lengthArb.canShrinkWithoutContext(e.length)?!1:j_(this.originalArray,e)}shrink(e,t){return e.length===0?j.nil():this.lengthArb.shrink(e.length,t).map(r=>new _(Le(e,e.length-r.value),r.context)).join(e.length>this.minLength?tr(()=>this.shrink(Le(e,1),void 0).filter(r=>this.minLength<=r.value.length+1).map(r=>new _([e[0],...r.value],void 0))):j.nil())}};function U_(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new b0(e,!0,r,n)}function W_(e,t={}){let{minLength:r=0,maxLength:n=e.length}=t;return new b0(e,!1,r,n)}var z_={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"},G_={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 H_(e){return e<10?Ve(e):z_[e]}function xw(e,t){let r="";for(;e.length+r.length<t;)r+="0";return r+e}function Rw(e){let t="";for(let r=e;r!==0;){let n=r>>5;t=H_(r-(n<<5))+t,r=n}return t}function q_(e,t){let r=~~(e/1073741824),n=e&1073741823;return xw(Rw(r),t-6)+xw(Rw(n),6)}function S0(e){return function(r){return q_(r,e)}}function jc(e){if(typeof e!="string")throw new L("Unsupported type");let t=0,r=1;for(let n=e.length-1;n>=0;--n){let i=G_[e[n]];if(i===void 0)throw new L("Unsupported type");t+=i*r,r*=32}return t}var K_=S0(10),kw=S0(8);function Y_(e){return K_(e[0])+kw(e[1])+kw(e[2])}function J_(e){if(typeof e!="string"||e.length!==26)throw new Error("Unsupported type");return[jc(e.slice(0,10)),jc(e.slice(10,18)),jc(e.slice(18))]}function Z_(){return B(ie({min:0,max:0xffffffffffff}),ie({min:0,max:0xffffffffff}),ie({min:0,max:0xffffffffff})).map(Y_,J_)}function w0(e){return D4(hi(e,16),8,"0")}function X_(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!==w0(t))throw new Error("Unsupported value: invalid content");return t}function Vc(e,t){return ie({min:e,max:t}).map(w0,X_)}function Q_(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 e7=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function t7(e){if(typeof e!="string")throw new Error("Unsupported type");let t=e7.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 Ew="0123456789abcdef";function r7(e){let t={},r={};for(let o=0;o!==e.length;++o){let s=Ew[o],a=Ew[e[o]];t[s]=a,r[a]=s}function n(o){return t[o[0]]+ge(o,1)}function i(o){if(typeof o!="string")throw new L("Cannot produce non-string values");let s=r[o[0]];if(s===void 0)throw new L("Cannot produce strings not starting by the version in hexa code");return s+ge(o,1)}return{versionsApplierMapper:n,versionsApplierUnmapper:i}}function n7(e){let t={};for(let r of e){if(t[r])throw new L(`Version ${r} has been requested at least twice for uuid`);if(t[r]=!0,r<1||r>15)throw new L(`Version must be a value in [1-15] for uuid, but received ${r}`);if(~~r!==r)throw new L(`Version must be an integer value for uuid, but received ${r}`)}if(e.length===0)throw new L("Must provide at least one version for uuid")}function i7(e={}){let t=Vc(0,4294967295),r=e.version!==void 0?typeof e.version=="number"?[e.version]:e.version:[1,2,3,4,5,6,7,8];n7(r);let{versionsApplierMapper:n,versionsApplierUnmapper:i}=r7(r);return B(t,Vc(0,268435456*r.length-1).map(n,i),Vc(2147483648,3221225471),t).map(Q_,t7)}function o7(e){return Ce({unit:Nd("-._~!$&'()*+,;=:"),size:e})}function s7([e,t,r]){return(e===null?"":`${e}@`)+t+(r===null?"":`:${r}`)}function a7(e){if(typeof e!="string")throw new Error("Unsupported");let t=e.indexOf("@"),r=t!==-1?e.substring(0,t):null,n=/:(\d+)$/.exec(e),i=n!==null?Number(n[1]):null;return[r,n!==null?e.substring(t+1,e.length-n[1].length-1):e.substring(t+1),i]}function l7(e){return`[${e}]`}function u7(e){if(typeof e!="string"||e[0]!=="["||e[e.length-1]!=="]")throw new Error("Unsupported");return e.substring(1,e.length-1)}function v0(e){let t=e||{},r=t.size,n=[Ld({size:r}),...t.withIPv4===!0?[Fd()]:[],...t.withIPv6===!0?[e0().map(l7,u7)]:[],...t.withIPv4Extended===!0?[Q1()]:[]];return B(t.withUserInfo===!0?jt(o7(r)):ve(null),Te(...n),t.withPort===!0?jt(er(65535)):ve(null)).map(s7,a7)}function x0(e){return Ce({unit:Nd("-._~!$&'()*+,;=:@/?"),size:e})}function R0(e={}){return x0(e.size)}function k0(e={}){return Ce({unit:Nd("-._~!$&'()*+,;=:@"),size:e.size})}function c7(e){return ce(G(e,t=>`/${t}`),"")}function d7(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 Kw(Be(e,"/"),1)}function f7(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 Bc(e,t){return ae(k0({size:e}),{size:t}).map(c7,d7)}function p7(e){let[t,r]=f7(e);return t===r?Bc(t,r):Te(Bc(t,r),Bc(r,t))}function E0(e){return p7(Pd((e||{}).size))}function C0(e={}){return x0(e.size)}function h7(e){let[t,r,n]=e;return`${t}://${r}${n}${e[3]===null?"":`?${e[3]}`}${e[4]===null?"":`#${e[4]}`}`}var m7=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function g7(e){if(typeof e!="string")throw new Error("Incompatible value received: type");let t=m7.exec(e);if(t===null)throw new Error("Incompatible value received");let r=t[1],n=t[2],i=t[3],o=t[4],s=t[5];return[r,n,i,o!==void 0?o.substring(1):null,s!==void 0?s.substring(1):null]}function y7(e){let t=e||{},r=Pd(t.size),n=t.authoritySettings!==void 0&&t.authoritySettings.size!==void 0?bi(t.authoritySettings.size,r):r,i={...t.authoritySettings,size:n};return B(wt(...t.validSchemes||["http","https"]),v0(i),E0({size:r}),t.withQueryParameters===!0?jt(C0({size:r})):ve(null),t.withFragments===!0?jt(R0({size:r})):ve(null)).map(h7,g7)}var b7=class A0{constructor(t,r){this.commands=t,this.metadataForReplay=r,this[Me]=function(){return new A0(this.commands.map(n=>n.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let t=this.commands.filter(n=>n.hasRan).map(n=>n.toString()).join(","),r=this.metadataForReplay();return r.length!==0?`${t} /*${r}*/`:t}},S7=class pd{constructor(t){if(this.cmd=t,this.hasRan=!1,vd(t)){let r=t[dt];this[dt]=function(){return r.call(t)}}if(xd(t)){let r=t[Ft];this[Ft]=function(){return r.call(t)}}}check(t){return this.cmd.check(t)}run(t,r){return this.hasRan=!0,this.cmd.run(t,r)}clone(){return xr(this.cmd)?new pd(this.cmd[Me]()):new pd(this.cmd)}toString(){return this.cmd.toString()}},Cw=class{static parse(e){let[t,r]=e.split(":"),n=this.parseCounts(t),i=this.parseChanges(r);return this.parseOccurences(n,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,r)=>(t.length===0||t[t.length-1].count===64||t[t.length-1].value!==r?t.push({value:r,count:1}):t[t.length-1].count+=1,t),[])}static parseOccurences(e,t){let r=[];for(let n=0;n!==e.length;++n){let i=e[n],o=t[n];for(let s=0;s!==i;++s)r.push(o)}return r}static stringifyChanges(e){let t="";for(let r=0;r<e.length;r+=6){let n=e.slice(r,r+6).reduceRight((i,o)=>(i<<1)+(o.value?1:0),0);t+=this.intToB64(n)}return t}static parseChanges(e){let t=e.split("").map(n=>this.b64ToInt(n)),r=[];for(let n=0;n!==t.length;++n){let i=t[n];for(let o=0;o!==6;++o,i>>=1)r.push(i%2===1)}return r}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)}},w7=class extends de{constructor(e,t,r,n,i){super(),this.sourceReplayPath=n,this.disableReplayLog=i,this.oneCommandArb=Te(...e).map(o=>new S7(o)),this.lengthArb=dd(0,t,r),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(Cw.stringify(this.replayPath))}`}buildValueFor(e,t){let r=e.map(i=>i.value_),n={shrunkOnce:t,items:e};return new _(new b7(r,()=>this.metadataForReplay()),n)}generate(e){let t=this.lengthArb.generate(e,void 0).value,r=Array(t);for(let n=0;n!==t;++n)r[n]=this.oneCommandArb.generate(e,void 0);return this.replayPathPosition=0,this.buildValueFor(r,!1)}canShrinkWithoutContext(e){return!1}filterOnExecution(e){let t=[];for(let r of e)r.value_.hasRan?(this.replayPath.push(!0),t.push(r)):this.replayPath.push(!1);return t}filterOnReplay(e){return e.filter((t,r)=>{let n=this.replayPath[this.replayPathPosition+r];if(n===void 0)throw new Error("Too short replayPath");if(!n&&t.value_.hasRan)throw new Error("Mismatch between replayPath and real execution");return n})}filterForShrinkImpl(e){this.replayPathPosition===0&&(this.replayPath=this.sourceReplayPath!==null?Cw.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 j.nil();let r=t,n=r.shrunkOnce,i=r.items,o=this.filterForShrinkImpl(i);if(o.length===0)return j.nil();let s=n?j.nil():new j([[]][Symbol.iterator]()),a=[];for(let l=0;l!==o.length;++l)a.push(tr(()=>{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(tr(()=>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 _(u.value_.clone(),u.context)),!0))}};function v7(e,t={}){let{size:r,maxCommands:n=Rr,disableReplayLog:i=!1,replayPath:o=null}=t;return new w7(e,gi(r,0,n,t.maxCommands!==void 0),n,o,i)}var x7=class{constructor(e,t){this.s=e,this.cmd=t}async check(e){let t=null,r=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{r=await Promise.resolve(this.cmd.check(e))}catch(n){throw t=n,n}}}]).task).faulty)throw t;return r}async run(e,t){let r=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run(e,t)}catch(n){throw r=n,n}}}]).task).faulty)throw r}},R7=function*(e,t){for(let r of t)yield new x7(e,r)},I0=(e,t,r,n,i)=>e.then(o=>{let{model:s,real:a}=o,l=r;for(let u of t)l=i(l,()=>n(u,s,a));return l}),k7=(e,t)=>I0({then:o=>{o(e())}},t,void 0,(o,s,a)=>{o.check(s)&&o.run(s,a)},(o,s)=>s()),E7=e=>typeof e.then=="function",P0=async(e,t,r=Promise.resolve())=>await I0({then:s=>{let a=e();return E7(a)?a.then(s):s(a)}},t,r,async(s,a,l)=>{await s.check(a)&&await s.run(a,l)},(s,a)=>s.then(a));function C7(e,t){k7(e,t)}async function A7(e,t){await P0(e,t)}async function I7(e,t,r){let n=P0(t,R7(e,r),e.schedule(Promise.resolve(),"startModel"));await e.waitFor(n),await e.waitAll()}var Ms=e=>e(),T0=class hd{constructor(t,r){this.act=t,this.taskSelector=r,this.lastTaskId=0,this.sourceTaskSelector=r.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[Me]=function(){return new hd(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 ${O$(t.outputValue)}`:""}`}log(t,r,n,i,o,s){this.triggeredTasks.push({status:o,schedulingType:t,taskId:r,label:n,metadata:i,outputValue:s!==void 0?xe(s):void 0})}scheduleInternal(t,r,n,i,o,s){let a=++this.lastTaskId,l,u=new Promise((c,d)=>{l=()=>{let p=Promise.resolve(s!==void 0?n.then(()=>s()):n);return p.then(h=>{this.log(t,a,r,i,"resolved",h),c(h)},h=>{this.log(t,a,r,i,"rejected",h),d(h)}),p}});return this.scheduledTasks.push({original:n,trigger:l,schedulingType:t,taskId:a,label:r,metadata:i,customAct:o}),this.scheduledWatchers.length!==0&&this.scheduledWatchers[0](),u}schedule(t,r,n,i){return this.scheduleInternal("promise",r||"",t,n,i||Ms)}scheduleFunction(t,r){return(...n)=>this.scheduleInternal("function",`${t.name}(${n.map(xe).join(",")})`,t(...n),void 0,r||Ms)}scheduleSequence(t,r){let n={done:!1,faulty:!1},i={then:c=>c()},o=()=>{},s=new Promise(c=>{o=()=>c({done:n.done,faulty:n.faulty})}),a=()=>{n.faulty=!0,o()},l=()=>{n.done=!0,o()},u=(c,d)=>{if(c>=t.length){d.then(l,a);return}d.then(()=>{let p=t[c],[h,f,m]=typeof p=="function"?[p,p.name,void 0]:[p.builder,p.label,p.metadata],g=this.scheduleInternal("sequence",f,i,m,r||Ms,()=>h());u(c+1,g)},a)};return u(0,i),Object.assign(n,{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),[r]=this.scheduledTasks.splice(t,1);return r.customAct(()=>r.trigger().catch(n=>{}))}waitOne(t){let r=t||Ms;return this.act(()=>r(()=>this.internalWaitOne()))}async waitAll(t){for(;this.scheduledTasks.length>0;)await this.waitOne(t)}async internalWaitFor(t,r){let n=!1,i=r.customAct,o=r.onWaitStart,s=r.onWaitIdle,a=r.launchAwaiterOnInit,l,u,c=0,d=null,p=null,h=async()=>{for(c=50,c=50;!n&&c>0;--c)await Promise.resolve();if(!n&&this.scheduledTasks.length>0)return o!==void 0&&o(),p=this.waitOne(i),p.then(()=>(p=null,h()),S=>{throw p=null,n=!0,u(S),S});!n&&s!==void 0&&s(),d=null},f=()=>{if(d!==null){c=51;return}d=h().catch(()=>{})},m=()=>{let S=this.scheduledWatchers.indexOf(f);S!==-1&&this.scheduledWatchers.splice(S,1),S===0&&this.scheduledWatchers.length!==0&&this.scheduledWatchers[0]()},g=new Promise((S,w)=>{l=y=>{m(),S(y)},u=y=>{m(),w(y)}});return t.then(S=>{n=!0,p===null?l(S):p.then(()=>l(S),w=>u(w))},S=>{n=!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),g}waitNext(t,r){let n,i=t,o=i<=0?Promise.resolve():new Promise(s=>{n=()=>{--i<=0&&s()}});return this.internalWaitFor(o,{customAct:r,onWaitStart:n,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(t){let r,n=new Promise(i=>r=i);return this.internalWaitFor(n,{customAct:t,onWaitStart:void 0,onWaitIdle:r,launchAwaiterOnInit:!0})}waitFor(t,r){return this.internalWaitFor(t,{customAct:r,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(hd.buildLog).map(t=>`-> ${t}`).join(`
|
|
132
|
+
`)+"`"}};function M0(e){let t=0;return{clone:()=>M0(e),nextTaskIndex:r=>{if(e.length<=t)throw new Error("Invalid schedulerFor defined: too many tasks have been scheduled");let n=r.findIndex(i=>i.taskId===e[t]);if(n===-1)throw new Error("Invalid schedulerFor defined: unable to find next task");return++t,n}}}function Aw(e,t){return new T0(e,M0(t))}function O0(e){let t=e.clone();return{clone:()=>O0(t),nextTaskIndex:r=>e.nextInt(0,r.length-1)}}var P7=class extends de{constructor(e){super(),this.act=e}generate(e,t){return new _(new T0(this.act,O0(e.clone())),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return j.nil()}};function T7(e){let{act:t=r=>r()}=e||{};return new P7(t)}function M7(e,t){let{act:r=n=>n()}=Array.isArray(e)?t||{}:e||{};return Array.isArray(e)?Aw(r,e):function(n,...i){return Aw(r,i)}}function O7(e={}){return Vt(e,O("-9223372036854775808"),O("9223372036854775807"),B6,nr)}function N7(e={}){return Vt(e,O(0),O("18446744073709551615"),U6,nr)}function L7(e,t){return t}var Uc=Math.floor,$7=Math.min;function Qe(e,t){switch(e.type){case"Char":return{astNode:e,minLength:1};case"Repetition":switch(e.quantifier.kind){case"*":{let r=Qe(e.expression,t);return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:t},expression:r.astNode},minLength:0}}case"+":{let r=Qe(e.expression,t),n=r.minLength>1?r.minLength:1;return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:1,to:Uc(t/n)},expression:r.astNode},minLength:r.minLength}}case"?":{let r=Qe(e.expression,t);return t<r.minLength?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:0},expression:r.astNode},minLength:0}:{astNode:{...e,expression:r.astNode},minLength:0}}case"Range":{let r=e.quantifier.from>1?Uc(t/e.quantifier.from):t,n=Qe(e.expression,r),i=n.minLength>1?n.minLength:1;return e.quantifier.to===void 0||e.quantifier.to*i>t?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",to:Uc(t/i)},expression:n.astNode},minLength:e.quantifier.from*n.minLength}:{astNode:{...e,expression:n.astNode},minLength:e.quantifier.from*n.minLength}}default:return L7(e.quantifier,{astNode:e,minLength:0})}case"Quantifier":return{astNode:e,minLength:0};case"Alternative":{let r=0,n=[];for(let o=0;o!==e.expressions.length;++o){let s=t-r,a=Qe(e.expressions[o],s);r+=a.minLength,$(n,{value:a,allowance:s})}let i=[];for(let o=0;o!==n.length;++o){let s=n[o].value,a=n[o].allowance,l=t-r+s.minLength;$(i,(l!==a?Qe(s.astNode,l):s).astNode)}return{astNode:{...e,expressions:i},minLength:r}}case"CharacterClass":return{astNode:e,minLength:1};case"ClassRange":return{astNode:e,minLength:1};case"Group":{let r=Qe(e.expression,t);return{astNode:{...e,expression:r.astNode},minLength:r.minLength}}case"Disjunction":{if(e.left===null){if(e.right===null)return{astNode:e,minLength:0};let i=Qe(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=Qe(e.left,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:o,right:null},minLength:0}}let r=Qe(e.left,t),n=Qe(e.right,t);return r.minLength>t?n:n.minLength>t?r:{astNode:{...e,left:r.astNode,right:n.astNode},minLength:$7(r.minLength,n.minLength)}}case"Assertion":return{astNode:e,minLength:0};case"Backreference":return{astNode:e,minLength:0};case"UnicodeProperty":return{astNode:e,minLength:1}}}function D7(e,t){return Qe(e,t).astNode}function _7(e){return new Error(`Unsupported AST node! Received: ${xe(e)}`)}function Fs(e,t,r){if(!t&&!r)return e;let n={hasStart:!1,hasEnd:!1},i=N0(e,t,r,n),o=t&&!n.hasStart,s=r&&!n.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 N0(e,t,r,n){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 n.hasStart=!0,n.hasEnd=!0,{...e,expressions:e.expressions.map((i,o)=>Fs(i,t&&o===0,r&&o===e.expressions.length-1))};case"CharacterClass":return e;case"ClassRange":return e;case"Group":return{...e,expression:N0(e.expression,t,r,n)};case"Disjunction":return n.hasStart=!0,n.hasEnd=!0,{...e,left:e.left!==null?Fs(e.left,t,r):null,right:e.right!==null?Fs(e.right,t,r):null};case"Assertion":if(e.kind==="^"||e.kind==="Lookahead")return n.hasStart=!0,e;if(e.kind==="$"||e.kind==="Lookbehind")return n.hasEnd=!0,e;throw new Error(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":return e;case"UnicodeProperty":return e;default:throw _7(e)}}function F7(e){return Fs(e,!0,!0)}function Iw(e,t){return e[t]>="\uD800"&&e[t]<="\uDBFF"&&e[t+1]>="\uDC00"&&e[t+1]<="\uDFFF"?2:1}function Ee(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function md(e){return e>="0"&&e<="9"}function L0(e,t){for(let r=t;r!==e.length;++r){let n=e[r];if(n==="\\")r+=1;else if(n==="]")return r}throw new Error("Missing closing ']'")}function j7(e,t){let r=0;for(let n=t;n!==e.length;++n){let i=e[n];if(i==="\\")n+=1;else if(i===")"){if(r===0)return n;r-=1}else i==="["?n=L0(e,n):i==="("&&(r+=1)}throw new Error("Missing closing ')'")}function V7(e,t){let r=!1;for(let n=t;n!==e.length;++n){let i=e[n];if(!md(i)){if(t===n)return-1;if(i===","){if(r)return-1;r=!0}else return i==="}"?n:-1}}return-1}function B7(e,t,r,n){switch(e[t]){case"[":return n===1?t+1:L0(e,t+1)+1;case"{":{if(n===1)return t+1;let i=V7(e,t+1);return i===-1?t+1:i+1}case"(":return n===1?t+1:j7(e,t+1)+1;case"]":case"}":case")":return t+1;case"\\":{let i=e[t+1];switch(i){case"x":if(Ee(e[t+2])&&Ee(e[t+3]))return t+4;throw new Error(`Unexpected token '${e.substring(t,t+4)}' found`);case"u":if(e[t+2]==="{"){if(!r)return t+2;if(e[t+4]==="}"){if(Ee(e[t+3]))return t+5;throw new Error(`Unexpected token '${e.substring(t,t+5)}' found`)}if(e[t+5]==="}"){if(Ee(e[t+3])&&Ee(e[t+4]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`)}if(e[t+6]==="}"){if(Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5]))return t+7;throw new Error(`Unexpected token '${e.substring(t,t+7)}' found`)}if(e[t+7]==="}"){if(Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5])&&Ee(e[t+6]))return t+8;throw new Error(`Unexpected token '${e.substring(t,t+8)}' found`)}if(e[t+8]==="}"&&Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5])&&Ee(e[t+6])&&Ee(e[t+7]))return t+9;throw new Error(`Unexpected token '${e.substring(t,t+9)}' found`)}if(Ee(e[t+2])&&Ee(e[t+3])&&Ee(e[t+4])&&Ee(e[t+5]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`);case"p":case"P":{if(!r)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(!r)return t+2;throw new Error("Invalid \\k definition")}return o+1}default:if(md(i)){let o=r?e.length:Math.min(t+4,e.length),s=t+2;for(;s<o&&md(e[s]);++s);return s}return t+(r?Iw(e,t+1):1)+1}}default:return t+(r?Iw(e,t):1)}}function Os(e,t,r,n){let i=B7(e,t,r,n);return e.substring(t,i)}var Pw={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},Ks={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"},yi=Ud(Ks),Bd={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"},gd=Ud(Bd),$0={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"},Tw=Ud($0);function Ud(e){let t={};for(let r of Object.keys(e)){let n=e[r];if(Array.isArray(n))for(let i=0;i!==n.length;++i)t[n[i]]=r;else t[n]=r}return t}function U7(e){return e in Bd||e in gd}function W7(e){return e in Ks||e in yi}function Mw(e){if(e in Pw)return Pw[e];if(e in yi)return yi[e];if(e in Ks||e==="General_Category"||e==="Script"||e==="Script_Extensions")return e;throw new Error(`Unknown Unicode property name: ${e}`)}function Ow(e){if(e in gd)return gd[e];if(e in Tw)return Tw[e];if(e in yi)return yi[e];if(e in Bd||e in $0||e in Ks)return e;throw new Error(`Unknown Unicode property value: ${e}`)}function z7(e,t){let r=e.indexOf("=");if(r!==-1){let n=e.substring(0,r),i=e.substring(r+1);return{type:"UnicodeProperty",name:n,value:i,negative:t,shorthand:!1,binary:!1,canonicalName:Mw(n),canonicalValue:Ow(i)}}if(U7(e))return{type:"UnicodeProperty",name:"General_Category",value:e,negative:t,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:Ow(e)};if(W7(e)){let n=Mw(e);return{type:"UnicodeProperty",name:e,value:e,negative:t,shorthand:!1,binary:!0,canonicalName:n,canonicalValue:n}}throw new Error(`Invalid Unicode property: ${e}`)}var Wc=String.fromCodePoint;function zc(e){let t=e.pop();if(t===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return t}function D0(e){return e>="0"&&e<="9"}function js(e,t){return{type:"Char",kind:"simple",symbol:e,value:e,codePoint:e.codePointAt(0)||-1,escaped:t}}function en(e,t){return{type:"Char",kind:"meta",symbol:t,value:e,codePoint:t.codePointAt(0)||-1}}function Xt(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 Gc(e){if(e[0]==="\\"){let t=e[1];switch(t){case"x":{let r=e.substring(2),n=Number.parseInt(r,16);return{type:"Char",kind:"hex",symbol:Wc(n),value:e,codePoint:n}}case"u":{if(e==="\\u")return js("u",!0);let r=e[2]==="{"?e.substring(3,e.length-1):e.substring(2),n=Number.parseInt(r,16);return{type:"Char",kind:"unicode",symbol:Wc(n),value:e,codePoint:n}}case"0":return en(e,"\0");case"n":return en(e,`
|
|
133
|
+
`);case"f":return en(e,"\f");case"r":return en(e,"\r");case"t":return en(e," ");case"v":return en(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(D0(t)){let r=e.substring(1),n=Number(r);return{type:"Char",kind:"decimal",symbol:Wc(n),value:e,codePoint:n}}if(e.length>2&&(t==="p"||t==="P")){let r=t==="P";return z7(e.substring(3,e.length-1),r)}return js(e.substring(1),!0)}}return js(e)}function tn(e,t,r,n){let i=null;for(let o=0,s=Os(t,o,r,0);o!==t.length;o+=s.length,s=Os(t,o,r,0)){let a=s[0];switch(a){case"|":i===null&&(i=[]),i.push(Xt(e.splice(0),!0)||null);break;case".":e.push({type:"Char",kind:"meta",symbol:s,value:s,codePoint:NaN});break;case"*":case"+":{let l=zc(e);e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"?":{let l=zc(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(js(s));break}let l=zc(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,h=Os(l,p,r,1);p!==l.length;p+=h.length,h=Os(l,p,r,1)){if(p===0&&h==="^"){c=!0;continue}let f=Gc(h);if(h==="-")u.push(f),d=!0;else{let m=u.length>=2?u[u.length-2]:void 0;d&&m!==void 0&&m.type==="Char"&&f.type==="Char"?(u.pop(),u.pop(),u.push({type:"ClassRange",from:m,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]===":")tn(u,l.substring(2),r,n),e.push({type:"Group",capturing:!1,expression:Xt(u)});else if(l[1]==="="||l[1]==="!")tn(u,l.substring(2),r,n),e.push({type:"Assertion",kind:"Lookahead",negative:l[1]==="!"?!0:void 0,assertion:Xt(u)});else if(l[1]==="<"&&(l[2]==="="||l[2]==="!"))tn(u,l.substring(3),r,n),e.push({type:"Assertion",kind:"Lookbehind",negative:l[2]==="!"?!0:void 0,assertion:Xt(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=++n.lastIndex,p=c[0].substring(2);n.named.set(p,d),tn(u,c.slice(1).join(">"),r,n),e.push({type:"Group",capturing:!0,nameRaw:p,name:p,number:d,expression:Xt(u)})}else{let c=++n.lastIndex;tn(u,l,r,n),e.push({type:"Group",capturing:!0,number:c,expression:Xt(u)})}break}default:if(s==="^")e.push({type:"Assertion",kind:s});else if(s==="$")e.push({type:"Assertion",kind:s});else if(s[0]==="\\"&&D0(s[1])){let l=Number(s.substring(1));r||l<=n.lastIndex?e.push({type:"Backreference",kind:"number",number:l,reference:l}):e.push(Gc(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:n.named.get(l)||0,referenceRaw:l,reference:l})}else e.push(Gc(s));break}}if(i!==null){i.push(Xt(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 G7(e){let t=$t([...e.flags],"u")!==-1,r=e.source,n=[];return tn(n,r,t,{lastIndex:0,named:new Map}),Xt(n)}var H7=String.fromCodePoint;function q7(e){return e.binary||e.shorthand?e.canonicalValue:`${e.canonicalName}=${e.canonicalValue}`}function Nw(e,t,r,n){let i=-1;for(let o=t;o<=r;++o)if(e.test(H7(o)))i===-1&&(i=o);else if(i!==-1){let s=o-1;n.push(i===s?[s]:[i,s]),i=-1}i!==-1&&n.push(i===r?[r]:[i,r])}function K7(e,t){let r=new RegExp(`^\\${t?"P":"p"}{${e}}$`,"u"),n=[];return Nw(r,0,55295,n),Nw(r,57344,1114111,n),n}var Lw=new Map;function Y7(e,t){let r=`${t?"P":"p"}:${e}`,n=Lw.get(r);if(n!==void 0)return n;let i=K7(e,t);return Lw.set(r,i),i}function J7(e){return ln(...G(Y7(q7(e),e.negative),t=>Xc(t)))}var Z7=String.fromCodePoint,$w=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],Dw=[..."0123456789"],_w=[...` \r
|
|
134
|
+
\v\f`],yd=[...`\r
|
|
135
|
+
`],_0=[...""],X7=[...yd,..._0],vr=()=>Ce({unit:"grapheme-ascii",minLength:1,maxLength:1});function Fw(e){return new L(`Unsupported AST node! Received: ${xe(e)}`)}function Qt(e,t,r){switch(e.type){case"Char":if(e.kind==="meta")switch(e.value){case"\\w":return wt(...$w);case"\\W":return vr().filter(n=>$t($w,n)===-1);case"\\d":return wt(...Dw);case"\\D":return vr().filter(n=>$t(Dw,n)===-1);case"\\s":return wt(..._w);case"\\S":return vr().filter(n=>$t(_w,n)===-1);case"\\b":case"\\B":throw new L(`Meta character ${e.value} not implemented yet!`);case".":{let n=r.dotAll?_0:X7;return vr().filter(i=>$t(n,i)===-1)}}if(e.symbol===void 0)throw new L(`Unexpected undefined symbol received for non-meta Char! Received: ${xe(e)}`);return ve(e.symbol);case"Repetition":{let n=Qt(e.expression,t,r);switch(e.quantifier.kind){case"*":return Ce({...t,unit:n});case"+":return Ce({...t,minLength:1,unit:n});case"?":return Ce({...t,minLength:0,maxLength:1,unit:n});case"Range":return Ce({...t,minLength:e.quantifier.from,maxLength:e.quantifier.to,unit:n});default:throw Fw(e.quantifier)}}case"Quantifier":throw new L("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return B(...G(e.expressions,n=>Qt(n,t,r))).map(n=>ce(n,""));case"CharacterClass":if(e.negative){let n=G(e.expressions,i=>Qt(i,t,r));return vr().filter(i=>Jw(n,o=>!o.canShrinkWithoutContext(i)))}return Te(...G(e.expressions,n=>Qt(n,t,r)));case"ClassRange":{let n=e.from.codePoint,i=e.to.codePoint;return ie({min:n,max:i}).map(o=>Z7(o),o=>{if(typeof o!="string")throw new L("Invalid type");if([...o].length!==1)throw new L("Invalid length");return on(o,0)})}case"Group":return Qt(e.expression,t,r);case"Disjunction":return Te(e.left!==null?Qt(e.left,t,r):ve(""),e.right!==null?Qt(e.right,t,r):ve(""));case"Assertion":if(e.kind==="^"||e.kind==="$")return r.multiline?e.kind==="^"?Te(ve(""),B(Ce({unit:vr()}),wt(...yd)).map(n=>`${n[0]}${n[1]}`,n=>{if(typeof n!="string"||n.length===0)throw new L("Invalid type");return[ge(n,0,n.length-1),n[n.length-1]]})):Te(ve(""),B(wt(...yd),Ce({unit:vr()})).map(n=>`${n[0]}${n[1]}`,n=>{if(typeof n!="string"||n.length===0)throw new L("Invalid type");return[n[0],ge(n,1)]})):ve("");throw new L(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":throw new L("Backreference nodes not implemented yet!");case"UnicodeProperty":return J7(e);default:throw Fw(e)}}function Q7(e,t={}){for(let a of e.flags)if(a!=="d"&&a!=="g"&&a!=="m"&&a!=="s"&&a!=="u")throw new L(`Unable to use "stringMatching" against a regex using the flag ${a}`);let r=t.maxLength,n={size:t.size,maxLength:r},i={multiline:e.multiline,dotAll:e.dotAll},o=F7(G7(e));r!==void 0&&(o=D7(o,r));let s=Qt(o,n,i);return r!==void 0?s.filter(a=>[...a].length<=r):s}function e8(e){let t=[];for(let r=0;r!==e.length;++r)t.push(e[r].next());return t}function t8(e,t){for(let r=0;r!==e.length;++r)t[r]=e[r].next()}function r8(e){for(let t=0;t!==e.length;++t)if(e[t].done)return!0;return!1}function*n8(...e){let t=e8(e);for(;!r8(t);)yield t.map(r=>r.value),t8(e,t)}function*i8(e){let t=e;for(;;)yield t,++t}var o8=class extends de{constructor(e,t){super(),this.arb=e,this.maxShrinks=t}generate(e,t){let r=this.arb.generate(e,t);return this.valueMapper(r,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,r){let n=this.maxShrinks-r;return n<=0?j.nil():new j(n8(this.arb.shrink(e,t),i8(r+1))).take(n).map(i=>this.valueMapper(i[0],i[1]))}valueMapper(e,t){let r={originalContext:e.context,length:t};return new _(e.value,r)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalContext"in e&&"length"in e}};function s8(e,t){return new o8(e,t)}var a8=Eb({Arbitrary:()=>de,ExecutionStatus:()=>vN,PreconditionFailure:()=>ir,Random:()=>kd,Stream:()=>j,Value:()=>_,VerbosityLevel:()=>Q4,__commitHash:()=>c8,__type:()=>l8,__version:()=>u8,anything:()=>g0,array:()=>ae,assert:()=>WN,asyncDefaultReportMessage:()=>m1,asyncModelRun:()=>A7,asyncProperty:()=>Z4,asyncStringify:()=>Rd,asyncToStringMethod:()=>Ft,base64String:()=>F_,bigInt:()=>nr,bigInt64Array:()=>O7,bigUint64Array:()=>N7,boolean:()=>Si,chainUntil:()=>N3,check:()=>y1,clone:()=>F3,cloneIfNeeded:()=>rn,cloneMethod:()=>Me,commands:()=>v7,compareBooleanFunc:()=>_$,compareFunc:()=>j$,configureGlobal:()=>K4,constant:()=>ve,constantFrom:()=>wt,context:()=>A3,createDepthIdentifier:()=>Ad,date:()=>P1,defaultReportMessage:()=>h1,dictionary:()=>Td,domain:()=>Ld,double:()=>qs,emailAddress:()=>ZL,entityGraph:()=>_D,falsy:()=>E3,float:()=>Y1,float32Array:()=>n0,float64Array:()=>i0,func:()=>U$,gen:()=>XN,getDepthContextFor:()=>Cd,hasAsyncToStringMethod:()=>xd,hasCloneMethod:()=>xr,hasToStringMethod:()=>vd,hash:()=>zs,infiniteStream:()=>M_,int16Array:()=>o0,int32Array:()=>s0,int8Array:()=>a0,integer:()=>ie,ipV4:()=>Fd,ipV4Extended:()=>Q1,ipV6:()=>e0,json:()=>I_,jsonValue:()=>y0,letrec:()=>t0,limitShrink:()=>s8,lorem:()=>GD,map:()=>cd,mapToConstant:()=>ln,maxSafeInteger:()=>X1,maxSafeNat:()=>H$,memo:()=>YD,mixedCase:()=>t_,modelRun:()=>C7,nat:()=>er,noBias:()=>Ws,noShrink:()=>Gs,object:()=>R_,oneof:()=>Te,option:()=>jt,pre:()=>k6,property:()=>X4,readConfigureGlobal:()=>ct,record:()=>ud,resetConfigureGlobal:()=>Y4,sample:()=>GN,scheduledModelRun:()=>I7,scheduler:()=>T7,schedulerFor:()=>M7,set:()=>p0,shuffledSubarray:()=>W_,sparseArray:()=>f0,statistics:()=>qN,stream:()=>rr,string:()=>Ce,stringMatching:()=>Q7,stringify:()=>xe,subarray:()=>U_,toStringMethod:()=>dt,tuple:()=>B,uint16Array:()=>l0,uint32Array:()=>u0,uint8Array:()=>c0,uint8ClampedArray:()=>d0,ulid:()=>Z_,uniqueArray:()=>kr,uuid:()=>i7,webAuthority:()=>v0,webFragments:()=>R0,webPath:()=>E0,webQueryParameters:()=>C0,webSegment:()=>k0,webUrl:()=>y7}),l8="module",u8="4.8.0",c8="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c",Oe=a8;function Ys(e){return e?.values!=null&&e.values.length>0?Oe.constantFrom(...e.values):d8(e)}function d8(e){if(e?.type==="number")return Oe.integer();if(e?.type==="boolean")return Oe.boolean();let t=e?.generator==null?void 0:p8[e.generator];if(t!=null)return t;let r=e?.constraints?.kind==="string"?e.constraints:void 0;return Oe.string({maxLength:r?.maxLength,minLength:r?.minLength??1}).filter(n=>n.trim().length>0&&n===n.trim())}var f8="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],un=e=>Oe.array(Oe.constantFrom(...f8),{maxLength:e,minLength:1}).map(t=>t.join("")),Wd=(e,t)=>Oe.array(un(10),{maxLength:t,minLength:1}).map(r=>r.join(e)),p8={"company.name":Wd(" ",3),"date.iso":h8(),"internet.email":m8(),"internet.url":g8(),"lorem.slug":Wd("-",3),"lorem.word":un(10),"person.fullName":Wd(" ",2)};function h8(){return Oe.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 m8(){return Oe.tuple(un(12),un(10),Oe.constantFrom("com","dev","io","org","ai")).map(([e,t,r])=>`${e}@${t}.${r}`)}function g8(){return Oe.tuple(Oe.constantFrom("http","https"),un(12),Oe.constantFrom("app","com","dev","io","org"),Oe.array(un(8),{maxLength:3})).map(([e,t,r,n])=>{let i=n.length===0?"":`/${n.join("/")}`;return`${e}://${t}.${r}${i}`})}var F0=new WeakMap;function zd(e){let t=F0.get(e);if(t!=null)return t;let r=Object.fromEntries(Object.entries(e.paramSpaces).map(([n,i])=>[n,b8(i)]));return F0.set(e,r),r}var y8=24301;function b8(e){let[t]=Oe.sample(Ys(e),{numRuns:1,seed:y8});if(t==null)throw new Error("arbitrary produced no sample");return t}function wi(e){return{aborted:!0,findings:[],fired:[],teardown:e}}function Hd(e,t){return new S8(w8(e,t))}async function w8({browser:e,hub:t,request:r},n){if(n.aborted)return Gd(wi("skipped"));let i=C8({lockfile:r.lockfile,options:r.options,runId:r.runId,signal:n}),o=async s=>{try{return Gd(await x8({browser:e,established:s,hub:t,request:r,signal:n}))}catch(a){return j0(vn(a))}};return E8(i,r).match(o,s=>v8(s,i.teardown))}async function v8(e,t){return e.kind!=="aborted"?j0(e):Gd(wi(await V0(t)))}function V0(e){return e().match(()=>"done",()=>"failed")}async function x8(e){let t=await R8(e);if(t.kind==="completed")return await e.established.teardown().match(no,Up),{aborted:!1,...t.result};let r=await V0(e.established.teardown);if(t.kind==="aborted")return wi(r);throw t.error}async function R8({browser:e,established:t,hub:r,request:n,signal:i}){try{qt(i);let{close:o,driver:s,emitAssertion:a}=await Ml({baseUrl:n.options.baseUrl,browser:e,capture:n.capture?{hub:r,runId:n.runId}:null,clientState:t.clientState,engine:Al(I8(n.lockfile)),reader:t.reader,session:t.auth});try{return{kind:"completed",result:await Rl({canon:za(n.lockfile),classify:Wa(n.lockfile),driver:s,initialState:{snapshot:t.snapshot},onAssertion:a,onEvent:n.onEvent??no,sequence:n.sequence??k8(n.lockfile,n.testName,n.params),...mc(n.lockfile)},i)}}finally{await o()}}catch(o){return Yp(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function k8(e,t,r){return fo(e,t).map(n=>({params:{...zd(n),...r},transition:n}))}function E8(e,t){return Tn(t.lockfile,t.testName,{generate:Cl(El(t.options.generate,t.runId),new Date().toISOString()),materialize:e.materialize,params:t.params}).map(r=>({auth:r.auth,clientState:r.clientState,reader:e.reader,snapshot:r.snapshot,teardown:e.teardown}))}function C8({lockfile:e,options:t,runId:r,signal:n}){let i=$l({baseUrl:t.engineUrl,runId:r,secret:t.secret},n);return{materialize:al(i.setupWorld),reader:Ll(e.entities,A8(e),i.query),teardown:i.teardown}}function A8(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function I8(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}function O8({debugDir:e,headed:t,writeOtlpPortFile:r}){let n=im({headed:t}),i,o,s=async()=>(i??=hc({debugDir:e,writeOtlpPortFile:r}),o=await i,o),a=async(u,c)=>{if(c.aborted)return T8(wi("skipped"));try{let d=await s();return u.options.headed&&!t?await Ol(!0,async p=>Hd({browser:p,hub:d,request:u},c)):await Hd({browser:await n.acquire(),hub:d,request:u},c)}catch(d){return P8(vn(d))}};return{close:async()=>{await n.close();let u=i;i=void 0,o=void 0,u!=null&&await u.then(c=>c.close()).catch(()=>{})},injectSpan:(u,c)=>{o?.injectSpan(u,c)},runOnce:(u,c)=>new M8(a(u,c))}}function vi(e,t){let r=e.axes.flatMap(n=>n.classify(t).map(([i,o])=>`${i}:${o}`));return[t.label,...r.toSorted((n,i)=>n.localeCompare(i))].join("|")}function qd(e){return e.axes.map(t=>t.name).join("+")}function Kd(e){return{name:`counts(${e})`,classify:({pre:t})=>[...t.entities].flatMap(([r,n])=>n.size===0?[]:[[r,L8(e,n.size)]])}}function Yd(e){let t=B0(e);return{name:"enum-fields",classify:({pre:r})=>[...r.entities].flatMap(([n,i])=>[...i.values()].flatMap(o=>N8(n,o,t)))}}function N8(e,t,r){return Object.entries(t).flatMap(([n,i])=>r.has(`${e}.${n}`)?[[`${e}.${n}`,$8(i)]]:[])}function B0(e){let t=e.valueSpaces.flatMap(n=>n.values==null?[]:[n.name]),r=new Set(t);return new Set(e.entities.flatMap(n=>Object.entries(n.props).flatMap(([i,o])=>o.type==="boolean"||o.valueSpace!=null&&r.has(o.valueSpace)?[`${n.name}.${i}`]:[])))}function L8(e,t){return e==="presence"?"1+":e==="unit"?t===1?"1":"2+":t<=2?String(t):"3+"}function $8(e){return e==null?"\u2205":String(e)}import{createHash as D8}from"crypto";import{appendFile as _8,mkdir as F8,readFile as j8}from"fs/promises";import V8 from"path";import{ResultAsync as W0}from"neverthrow";import{z as R}from"zod";var cn=R.enum(["crash","invariant","law","frame"]),U0=R.object({intent:R.string().min(1),test:R.string().min(1)}),B8=R.union([R.object({kind:R.literal("singleton-mismatch"),singleton:R.string().min(1)}),R.object({entity:R.string().min(1),kind:R.string().min(1)})]),z0=R.discriminatedUnion("kind",[R.object({divergence:B8,kind:R.literal("consistency"),layer:cn,step:U0.nullable()}),R.object({kind:R.literal("obligation"),layer:cn,source:R.string().min(1),step:U0}),R.object({intent:R.string().min(1),kind:R.literal("unfireable"),layer:cn,reason:R.string().min(1),test:R.string().min(1)}),R.object({error:R.string().min(1),kind:R.literal("driver-error"),layer:cn,step:R.string().min(1)}),R.object({kind:R.literal("illegal-transition"),layer:cn,step:R.string().min(1)})]),U8=R.object({actionHash:R.string().min(1),at:R.string().min(1),kind:R.literal("covered"),lensId:R.string().min(1),targetKey:R.string().min(1)}),W8=R.object({actionHash:R.string().min(1),at:R.string().min(1),depot:R.string().min(1),evidence:R.array(R.string().min(1)),kind:R.literal("finding"),lensId:R.string().min(1),lockfileHash:R.string().min(1),oracleLayer:cn,parts:R.array(z0),runId:R.string().min(1).optional(),signature:R.string().min(1),targetKey:R.string().min(1),trail:R.array(R.string().min(1)),trailParams:R.array(R.record(R.string(),R.union([Ze,R.null()])))}),z8=R.object({actionHash:R.string().min(1),at:R.string().min(1),depot:R.string().min(1),evidence:R.array(R.string().min(1)),kind:R.literal("flaky-candidate"),lensId:R.string().min(1),parts:R.array(z0),signature:R.string().min(1),targetKey:R.string().min(1),trail:R.array(R.string().min(1))}),G8=R.object({at:R.string().min(1),kind:R.literal("saturation"),lensId:R.string().min(1),lockfileHash:R.string().min(1),ring:R.number().int().nonnegative()}),H8=R.object({at:R.string().min(1),kind:R.literal("resolution"),signature:R.string().min(1)}),q8=R.object({arrangement:R.string().min(1),at:R.string().min(1),canonicalKey:R.string().min(1),kind:R.literal("derived-depot")}),Js=R.discriminatedUnion("kind",[U8,W8,z8,G8,H8,q8]);function Zs(e){return Qd(e).slice(0,12)}function ze(e){return`${e.lensId} ${e.actionHash} ${e.targetKey}`}function xi(e){return e.reduce((t,r)=>Q8(t,r),X8())}function Ri(e){return W0.fromPromise(K8(e),t=>({error:t,kind:"io"})).map(t=>J8(t))}function Jd(e,t){let r=t.map(n=>`${JSON.stringify(n)}
|
|
136
|
+
`).join("");return W0.fromPromise(F8(V8.dirname(e),{recursive:!0}).then(()=>_8(e,r)),n=>({error:n,kind:"io"}))}function Zd(e,t){let r=J({effect:t.effectStep,guard:t.guard,nav:t.nav,params:t.paramSpaces,steps:t.steps}),n=e.entities.filter(i=>r.includes(`"${i.name}"`));return Qd(J({entities:n,spec:r}))}function Xd(e){return Qd(J(e))}async function K8(e){return(await j8(e,"utf8").catch(r=>{if(Y8(r))return"";throw r})).split(`
|
|
137
|
+
`).filter(r=>r.length>0)}function Y8(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"}function J8(e){return e.flatMap(t=>{let r=Js.safeParse(Z8(t));return r.success?[r.data]:[]})}function Z8(e){try{return JSON.parse(e)}catch{return null}}function Qd(e){return D8("sha256").update(e).digest("hex")}function X8(){return{covered:new Set,findings:new Map,flaky:new Map,saturations:new Map}}function Q8(e,t){if(t.kind==="covered")return{...e,covered:new Set([...e.covered,ze(t)])};if(t.kind==="flaky-candidate")return{...e,covered:new Set([...e.covered,ze(t)]),flaky:e9(e.flaky,t)};if(t.kind==="finding")return{...e,covered:new Set([...e.covered,ze(t)]),findings:t9(e.findings,t)};if(t.kind==="resolution")return{...e,findings:r9(e.findings,t)};if(t.kind==="saturation"){let r=`${t.lensId} ${String(t.ring)}`;return{...e,saturations:new Map([...e.saturations,[r,t]])}}return e}function e9(e,t){let r=e.get(t.signature),n=r==null?{first:t,occurrences:1}:{first:r.first,occurrences:r.occurrences+1};return new Map([...e,[t.signature,n]])}function t9(e,t){let r=e.get(t.signature),n=r==null?{first:t,latest:t,occurrences:1,resolvedAt:void 0}:{first:r.first,latest:t,occurrences:r.occurrences+1,resolvedAt:void 0};return new Map([...e,[t.signature,n]])}function r9(e,t){let r=e.get(t.signature);return r==null?e:new Map([...e,[t.signature,{...r,resolvedAt:t.at}]])}function ef(e){let t={edges:new Map,saturationDepth:0,seen:new Set,states:0,targets:new Map},r=e.depots.map(n=>(t.seen.add(pr(n.snapshot)),{depot:n.name,lastLabel:null,snapshot:n.snapshot,trail:[]}));return i9(e,r,t),{edges:t.edges,saturationDepth:t.saturationDepth,states:t.seen.size,targets:t.targets}}var n9=24301,G0=new WeakMap;function Xs(e,t){let r=G0.get(e)??new Map;G0.set(e,r);let n=r.get(t);if(n!=null)return n;let i=Object.fromEntries(Object.entries(e.paramSpaces).map(([o,s])=>[o,c9(s,t)]));return r.set(t,i),i}function i9(e,t,r){let n=[...t],i=0;for(;i<n.length;){let o=n[i];i+=1,o!=null&&o9(e,o,r).forEach(s=>n.push(s))}}function o9(e,t,r){let n={snapshot:t.snapshot},i=o=>Xs(o,u9(t.trail,e.corpus,o));return $r(e.corpus,n,i).flatMap(o=>{let s=e.corpus[o.idx];if(s==null)return[];let a=[...t.trail,{idx:o.idx,params:o.params}],l={depot:t.depot,trail:a,transitionIndex:o.idx};return s9({acc:r,node:t,option:o,params:e,transition:s,witness:l}),a9({acc:r,node:t,option:o,params:e,trail:a})})}function s9({acc:e,node:t,option:r,params:n,transition:i,witness:o}){let s={label:r.label,params:r.params,pre:t.snapshot,spaces:i.paramSpaces},a=vi(n.lens,s);if(e.targets.has(a)||(e.targets.set(a,o),e.saturationDepth=Math.max(e.saturationDepth,o.trail.length)),t.lastLabel!=null){let l=`${t.lastLabel} \u2192 ${r.label}`;e.edges.has(l)||e.edges.set(l,o)}}function a9({acc:e,node:t,option:r,params:n,trail:i}){if(i.length>=n.maxDepth)return[];let o=r.firing.next.snapshot;if(l9(t.snapshot,o,n.maxCount))return[];let s=pr(o);return e.seen.has(s)?[]:(e.seen.add(s),[{depot:t.depot,lastLabel:r.label,snapshot:o,trail:i}])}function l9(e,t,r){return[...t.entities].some(([n,i])=>{let o=e.entities.get(n)?.size??0;return i.size>o&&i.size>r})}function u9(e,t,r){return e.filter(n=>t[n.idx]===r).length}function c9(e,t){let[r]=Oe.sample(Ys(e),{numRuns:1,seed:n9+t});if(r==null)throw new Error("arbitrary produced no sample");return r}var d9=10;function tf(e){return of(e).reduce((t,r)=>t+q0(e,r).length,0)}function rf(e){return e.targets.size+e.edges.size}function nf(e){let t=of(e).map(o=>q0(e,o)),r=f9(e,t);if(r!=null)return r;let n=t.find(o=>o.length>0);return n==null?{kind:"saturated",ring:t.length}:{kind:"cover",target:n.reduce((o,s)=>H0(e,s)>H0(e,o)?s:o)}}function of(e){return[{entries:e.graph.targets,index:1},{entries:e.graph.edges,index:2}]}function q0(e,t){return[...t.entries].flatMap(([r,n])=>{let i=K0({params:e,ring:t.index,targetKey:r,witness:n});return e.covered.has(Y0(e,i))?[]:[i]})}function K0({params:e,ring:t,targetKey:r,witness:n}){let i=e.actionHashes[n.transitionIndex];if(i==null)throw new Error("transition index out of corpus range");return{actionHash:i,ring:t,targetKey:r,witness:n}}function Y0(e,t){return ze({actionHash:t.actionHash,lensId:e.lensId,targetKey:t.targetKey})}function f9(e,t){if(e.tick===0||e.tick%d9!==0)return null;let r=of(e).flatMap(i=>[...i.entries].flatMap(([o,s])=>{let a=K0({params:e,ring:i.index,targetKey:o,witness:s});return e.covered.has(Y0(e,a))?[a]:[]}));if(r.length===0||t.every(i=>i.length===0))return null;let n=r[e.tick%r.length];return n==null?null:{kind:"revalidate",target:n}}var p9=/delete|remove|cancel|deactivate|revoke|archive/i;function H0(e,t){let r=t.ring===2&&h9(e,t)?4:0,n=p9.test(t.targetKey)?2:0,i=1/(1+t.witness.trail.length);return r+n+i}function h9(e,t){return new Set(t.witness.trail.flatMap(n=>{let i=e.corpus[n.idx];return i==null?[]:[i.test]})).size>1}function m9(e){let t=g9(e,e.witnessTrail);return t==null?{covers:[],firings:[]}:b9(e,t)}function g9(e,t){return t.reduce((r,n)=>r==null?null:y9(e,r,n),{covers:[],firings:[],snapshot:e.depotSnapshot})}function y9(e,t,r){let n=e.corpus[r.idx];if(n==null)return null;let i=On(n,{snapshot:t.snapshot},r.params);if(i==null)return null;let o=J0({params:e,planned:r,pre:t.snapshot,transition:n});return{covers:[...t.covers,o],firings:[...t.firings,r],snapshot:i.next.snapshot}}function J0({params:e,planned:t,pre:r,transition:n}){let i={label:`${n.test}#${String(n.index)}`,params:t.params,pre:r,spaces:n.paramSpaces},o=e.actionHashes[t.idx];if(o==null)throw new Error("transition index out of corpus range");return{actionHash:o,targetKey:vi(e.lens,i)}}function b9(e,t){let r=new Set([...e.covered,...t.covers.map(i=>ze({...i,lensId:e.lensId}))]),n=Z0({params:e,seen:r,state:t});return{covers:n.covers,firings:n.firings}}function Z0({params:e,seen:t,state:r}){if(r.firings.length>=e.maxLength)return r;let n=S9({params:e,seen:t,state:r});return n==null?r:(t.add(ze({...n.coverage,lensId:e.lensId})),Z0({params:e,seen:t,state:{covers:[...r.covers,n.coverage],firings:[...r.firings,n.planned],snapshot:n.snapshot}}))}function S9({params:e,seen:t,state:r}){let n=o=>Xs(o,w9(r.firings,e.corpus,o));return $r(e.corpus,{snapshot:r.snapshot},n).map(o=>{let s=e.corpus[o.idx];if(s==null)return null;let a={idx:o.idx,params:o.params};return{coverage:J0({params:e,planned:a,pre:r.snapshot,transition:s}),planned:a,snapshot:o.firing.next.snapshot}}).find(o=>o!=null&&!t.has(ze({...o.coverage,lensId:e.lensId})))??null}function w9(e,t,r){return e.filter(n=>t[n.idx]===r).length}function sf(e,{sweep:t}){let r=Ct(e.tests.filter(n=>!n.stub),n=>J({s:n.singletons,w:n.world})).map(n=>({name:n.name,test:n}));return t?[...r,...r.flatMap(n=>v9(n))]:r}function af(e,t,r){return Tn({...e,tests:[t.test]},t.test.name,r)}function v9(e){return x9(e.test).map(t=>{let r={...t,as:`${t.as}~2`},n=`${e.name} +${t.entity}`;return{name:n,test:{...e.test,name:n,world:[...e.test.world,r]}}})}function x9(e){return e.world.filter(t=>{let r=J({...e,world:e.world.filter(n=>n!==t)});return!r.includes(`"${t.as}.`)&&!r.includes(`"ref":"${t.as}"`)})}async function R9(e,t){let r=await Qs({attemptIndex:0,capture:!1,firings:e.trail.firings,params:e},t);return r.kind!=="completed"?Q0(r):r.findings.length===0?{kind:"clean",rows:P9(e)}:k9(e,ki(e.depot.name,r.findings),t)}function Q0(e){return e.kind==="aborted"?{kind:"aborted"}:{error:e.error,kind:"error"}}async function k9(e,t,r){let n=await Qs({attemptIndex:1,capture:!1,firings:e.trail.firings,params:e},r);return n.kind!=="completed"?Q0(n):ki(e.depot.name,n.findings).signature!==t.signature?{kind:"flaky",rows:[T9(e,t)]}:E9({digest:t,params:e,signal:r})}async function Qs({attemptIndex:e,capture:t,firings:r,params:n},i){let o=n.runIdFor(e);return(await n.session.runOnce({capture:t,lockfile:I9(n),onEvent:void 0,options:n.options,params:void 0,runId:o,sequence:A9(n,r),testName:n.depot.test.name},i)).match(a=>a.aborted?{kind:"aborted"}:{findings:a.findings,kind:"completed",runId:o},a=>({error:a,kind:"error"}))}async function E9({digest:e,params:t,signal:r}){let n=await ev({attemptIndex:2,budget:t.shrinkBudget,firings:t.trail.firings,params:t,signal:r,signature:e.signature});if(n.kind!=="shrunk")return n.outcome;let i=await C9({firings:n.firings,params:t,signal:r,signature:e.signature});if(i.kind==="aborted")return{kind:"aborted"};let o=L9({digest:e,minimal:n.firings,params:t,runId:i.kind==="reproduced"?i.runId:void 0});return{finding:o,kind:"finding",minimal:n.firings,rows:[o],runId:i.kind==="reproduced"?i.runId:n.runId}}async function C9({firings:e,params:t,signal:r,signature:n}){let i=await Qs({attemptIndex:t.shrinkBudget+2,capture:!0,firings:e,params:t},r);return i.kind==="aborted"?{kind:"aborted"}:i.kind==="completed"&&ki(t.depot.name,i.findings).signature===n?{kind:"reproduced",runId:i.runId}:{kind:"no-repro"}}async function ev(e){let t={firings:e.firings,kind:"shrunk",runId:e.params.runIdFor(e.attemptIndex-1)};if(e.budget<=0||e.firings.length<=1)return t;let r=e.firings.map((n,i)=>e.firings.filter((o,s)=>s!==i));return tv(e,r,t)}async function tv(e,t,r){let[n,...i]=t;if(n==null||e.budget-1<0)return r;let o=await Qs({attemptIndex:e.attemptIndex,capture:!1,firings:n,params:e.params},e.signal);if(o.kind==="aborted")return{kind:"halted",outcome:{kind:"aborted"}};let s={...e,attemptIndex:e.attemptIndex+1,budget:e.budget-1};return o.kind==="completed"&&ki(e.params.depot.name,o.findings).signature===e.signature?ev({...s,firings:n}):tv(s,i,r)}function A9(e,t){return t.map(r=>{let n=e.corpus[r.idx];if(n==null)throw new Error("transition index out of corpus range");return{params:r.params,transition:n}})}function I9(e){return e.lockfile.tests.some(r=>r.name===e.depot.test.name)?e.lockfile:{...e.lockfile,tests:[...e.lockfile.tests,e.depot.test]}}function P9(e){return e.trail.covers.map(t=>({actionHash:t.actionHash,at:e.now(),kind:"covered",lensId:e.lensId,targetKey:t.targetKey}))}function T9(e,t){return{actionHash:lf(e).actionHash,at:e.now(),depot:e.depot.name,evidence:[...t.evidence],kind:"flaky-candidate",lensId:e.lensId,parts:[...t.parts],signature:t.signature,targetKey:lf(e).targetKey,trail:e.trail.covers.map(r=>r.targetKey)}}function rv(e){return e.kind==="driver-error"||e.kind==="unfireable"?"crash":e.kind==="obligation"?e.source.kind==="invariant"?"invariant":e.source.kind==="law"?"law":"frame":"frame"}function ki(e,t){let r=t.map(i=>({line:ym(i),part:O9(i)})).toSorted((i,o)=>J(i.part).localeCompare(J(o.part))),n=r.map(i=>i.part);return{evidence:r.map(i=>i.line),layer:M9(n),parts:n,signature:J({depot:e,parts:n.map(i=>J(i))})}}var X0={crash:0,frame:3,invariant:1,law:2};function M9(e){return e.map(r=>r.layer).toSorted((r,n)=>X0[r]-X0[n]).at(0)??"frame"}function O9(e){let t=rv(e);switch(e.kind){case"consistency":return{divergence:N9(e.divergence),kind:"consistency",layer:t,step:e.step==null?null:{intent:e.step.intent,test:e.step.test}};case"obligation":return{kind:"obligation",layer:t,source:e.source.kind,step:{intent:e.step.intent,test:e.step.test}};case"unfireable":return{intent:e.intent,kind:"unfireable",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"illegal-transition":return{kind:"illegal-transition",layer:t,step:e.step.intent}}}function N9(e){return e.kind==="singleton-mismatch"?{kind:e.kind,singleton:e.singleton}:{entity:e.entity,kind:e.kind}}function L9({digest:e,minimal:t,params:r,runId:n}){let i=lf(r);return{actionHash:i.actionHash,at:r.now(),depot:r.depot.name,evidence:[...e.evidence],kind:"finding",lensId:r.lensId,lockfileHash:r.lockfileHash,oracleLayer:e.layer,parts:[...e.parts],runId:n,signature:e.signature,targetKey:i.targetKey,trail:t.map(o=>{let s=r.corpus[o.idx];if(s==null)throw new Error("transition index out of corpus range");return`${s.test}#${String(s.index)}`}),trailParams:t.map(o=>o.params)}}function lf(e){let t=e.trail.covers.at(-1);if(t==null)throw new Error("trail has no coverage");return t}function fK(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 pK({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(`
|
|
138
|
+
`)}function hK(e){return`ripplo daemon: ready as local executor for session ${e} (sync happens on each \`ripplo run\`; Ctrl-C to stop)`}function mK({cwd:e,pid:t}){return`ripplo daemon: another daemon is already running for this project${t==null?"":` (pid ${String(t)})`} (cwd ${e}).`}function gK(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project; shutting down."}function yK(e){if(e.kind==="not-running")return"daemon: not running";if(e.kind==="unresponsive")return`daemon: running but did not reply within ${String(e.timeoutMs/1e3)}s \u2014 likely busy executing runs (event loop saturated); retry when the batch drains`;let{status:t}=e,r=`${String(t.active)} active, ${String(t.queued)} queued`,n=`explorer: ${t.explorer}, ${String(t.exploring)} exploring`;return`daemon: running (${r}; ${n}; ${$9(t.progress)})`}function $9(e){if(e.total===0)return"explore: idle";let t=`covered ${String(e.covered)}/${String(e.total)} targets`,r=e.deferred===0?"":` (${String(e.deferred)} deferred \u2014 timed out or errored, auto-retried after cooldown)`,n=D9(e);return`explore: ${t}${r}, ${String(e.findings)} findings, ${n}`}function bK(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:e.findings.map(t=>Fn(t)),kind:"findings"};case"error":return{detail:Et(e.error),kind:"error"};case"dispatch-failed":return{detail:e.reason,kind:"dispatch-error"}}}function D9(e){return e.saturated?e.deferred===0?"saturated":"waiting \u2014 every open target is deferred, retrying after cooldown":"searching"}import _9 from"p-queue";var F9=4,j9={"p0-ui":3,"p1-cli":2,"p2-cover":1,"p3-explore":0},ea=new _9({concurrency:F9}),Bt={headedActive:0,interactiveActive:0,interactiveQueued:0},nv={current:null};function vK({headed:e,task:t,workClass:r}){let n=j9[r];return r==="p3-explore"?ea.add(t,{priority:n}):(Bt.interactiveQueued+=1,ta(),ea.add(()=>V9({headed:e,task:t}),{priority:n}))}function xK(e){!Number.isFinite(e)||e<1||(ea.concurrency=Math.floor(e),ta())}function uf(){return{active:Bt.interactiveActive,headedActive:Bt.headedActive,poolSize:ea.concurrency,queued:Bt.interactiveQueued}}function RK(e){nv.current=e}async function V9({headed:e,task:t}){Bt.interactiveQueued-=1,Bt.interactiveActive+=1,Bt.headedActive+=e?1:0,ta();try{return await t()}finally{Bt.interactiveActive-=1,Bt.headedActive-=e?1:0,ta()}}function ta(){nv.current?.()}import cf from"fs";import df from"path";function iv(e){try{let t=B9(e);if(t==null)return;let r=df.join(t,"HEAD"),n=cf.readFileSync(r,"utf8").trim(),i="ref: refs/heads/";return n.startsWith(i)?n.slice(i.length):n.length===0?void 0:n.slice(0,7)}catch{return}}function B9(e){let t=df.join(e,".git");if(cf.statSync(t).isDirectory())return t;let n=cf.readFileSync(t,"utf8").trim(),i="gitdir:";if(!n.startsWith(i))return;let o=n.slice(i.length).trim();if(o.length!==0)return df.resolve(e,o)}import U9 from"crypto";import{graphql as W9}from"gql.tada";import{err as z9,ok as G9}from"neverthrow";var H9=W9(`
|
|
139
139
|
mutation SyncDevSession(
|
|
140
140
|
$projectId: String!
|
|
141
141
|
$cwd: String!
|
|
@@ -154,13 +154,13 @@ ${ON(i)}`),o}function m1(e){return Jc(e,xe)}async function g1(e){let t=[];functi
|
|
|
154
154
|
hooksPaused
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
`);async function
|
|
157
|
+
`);async function $K(e,t){let r=await Sn(e);if(r.isErr())return z9({error:r.error,kind:"compilation-failed"});let n=await ff({config:t,cwd:e,lockfile:r.value});return G9({devSessionId:n.devSessionId,lockfile:r.value})}async function ff(e){let t=q9(e.lockfile);return t5({config:e.config,cwd:e.cwd,payload:t})}function q9(e){let t=K9(e);return{preconditions:e.entities.map(r=>({depends:t.get(r.name)??[],description:r.description??"",name:r.name,returns:r.identity})),workflows:e.tests.map(r=>({expectedOutcome:r.intent,name:r.name,preconditions:X9(Q9(r),t),requiresKeys:r.world.map(n=>({namespace:n.as,preconditionName:n.entity})),slug:tt(r.name),sourcePath:r.sourcePath??null,spec:JSON.stringify({steps:r.steps.map((n,i)=>gn(n,i)),stub:r.stub})}))}}function K9(e){let t=e.tests.reduce((r,n)=>Y9(r,n),new Map);return new Map([...t].map(([r,n])=>[r,[...n]]))}function Y9(e,t){let r=[...t.world,...t.maybe],n=new Map(r.map(i=>[i.as,i.entity]));return r.reduce((i,o)=>{let s=J9(o,n),a=i.get(o.entity)??new Set;return new Map([...i,[o.entity,new Set([...a,...s])]])},e)}function J9(e,t){return Object.values(e.set).flatMap(r=>Z9(r)).map(r=>t.get(r)).filter(r=>r!=null&&r!==e.entity)}function Z9(e){return e==null||typeof e!="object"?[]:"ref"in e?[ov(e.ref)]:e.template.filter(t=>typeof t!="string").map(t=>ov(t.ref))}function ov(e){let[t]=e.split(".");return t??e}function X9(e,t){let r=(n,i)=>n.has(i)?n:(t.get(i)??[]).reduce((o,s)=>r(o,s),new Set([...n,i]));return[...e.reduce((n,i)=>r(n,i),new Set)]}function Q9(e){return[...new Set(e.world.map(t=>t.entity))]}function e5(e){return U9.createHash("sha256").update(JSON.stringify(e)).digest("hex")}async function t5({config:e,cwd:t,payload:r}){let n=e5(r),i=iv(t),o=await _e({config:e,document:H9,variables:{branch:i??null,cwd:t,preconditions:r.preconditions.map(s=>({depends:[...s.depends],description:s.description,name:s.name,returns:[...s.returns]})),projectId:e.projectId,workflows:r.workflows.map(s=>({expectedOutcome:s.expectedOutcome,name:s.name,preconditions:[...s.preconditions],requiresKeys:s.requiresKeys.map(a=>({namespace:a.namespace,preconditionName:a.preconditionName})),slug:s.slug,sourcePath:s.sourcePath,spec:s.spec??null}))}});if(o.syncDevSession==null)throw new Error("syncDevSession returned null");return{devSessionId:o.syncDevSession.id,hash:n,hooksPaused:o.syncDevSession.hooksPaused}}import{randomUUID as g5}from"crypto";import{CancellationTokenSource as y5,ResponseError as b5}from"vscode-jsonrpc/node";import{graphql as Cv}from"gql.tada";import{createMessageConnection as r5,NotificationType as sv,RequestType as av,RequestType0 as lv,SocketMessageReader as n5,SocketMessageWriter as i5}from"vscode-jsonrpc/node";import{z as v}from"zod";var o5="daemon.sock",s5="daemon.log";function VK(e){return Ut(e,o5)}function BK(e){return Ut(e,s5)}function uv(e){return r5(new n5(e),new i5(e))}var cv=v.object({all:v.boolean(),headed:v.boolean(),tests:v.array(v.string())}),UK=v.object({jobId:v.string(),total:v.number()}),a5=v.enum(["holder","standby","off"]),l5=v.object({covered:v.number(),deferred:v.number(),findings:v.number(),saturated:v.boolean(),total:v.number()}),WK=v.object({active:v.number(),explorer:a5,exploring:v.number(),progress:l5,queued:v.number()}),pf=v.discriminatedUnion("kind",[v.object({kind:v.literal("pass")}),v.object({findingLines:v.array(v.string()),kind:v.literal("findings")}),v.object({detail:v.string(),kind:v.literal("error")}),v.object({detail:v.string(),kind:v.literal("dispatch-error")}),v.object({detail:v.string(),kind:v.literal("infra-error")})]),u5=v.discriminatedUnion("kind",[v.object({kind:v.literal("test-started"),runId:v.string(),testName:v.string()}),v.object({kind:v.literal("test-outcome"),outcome:pf,runId:v.string(),testName:v.string()})]),zK=v.object({event:u5,jobId:v.string()}),GK=v.object({failed:v.number(),jobId:v.string(),notRun:v.number(),passed:v.number()}),HK=v.discriminatedUnion("code",[v.object({code:v.literal("compile-failed"),detail:v.string(),diagnostics:v.array(v.string()).default([])}),v.object({code:v.literal("selection-conflicting-flags")}),v.object({code:v.literal("selection-nothing-selected")}),v.object({code:v.literal("selection-unknown-ids"),known:v.array(v.string()),unknown:v.array(v.string())}),v.object({code:v.literal("scope-failed"),detail:v.string()}),v.object({code:v.literal("app-unreachable"),detail:v.string(),url:v.string()}),v.object({code:v.literal("sync-failed"),detail:v.string()}),v.object({code:v.literal("bad-message")})]),dv=v.object({findingId:v.string().min(1)}),qK=v.discriminatedUnion("kind",[v.object({kind:v.literal("resolved")}),v.object({kind:v.literal("unreachable")}),v.object({kind:v.literal("still-failing"),runId:v.string().optional()}),v.object({kind:v.literal("diverged"),runId:v.string().optional()}),v.object({kind:v.literal("flaky")}),v.object({kind:v.literal("aborted")}),v.object({kind:v.literal("finding-not-found")}),v.object({kind:v.literal("unreplayable"),reason:v.enum(["depot-missing","transition-missing","ledger-unreadable"])}),v.object({kind:v.literal("error"),reason:v.string()})]),fv=new av("ripplo/exploreReplay"),pv=new av("ripplo/enqueue"),hv=new lv("ripplo/status"),mv=new lv("ripplo/shutdownIfIdle"),gv=new sv("ripplo/jobEvent"),yv=new sv("ripplo/jobDone");import{err as hf,ok as bv}from"neverthrow";function Sv({all:e,ids:t,lockfile:r}){let n=r.tests.map(a=>a.name);if(e&&t.length>0)return hf({kind:"conflicting-flags"});if(e)return bv(r.tests.filter(a=>!a.stub).map(a=>a.name));if(t.length===0)return hf({kind:"nothing-selected"});let i=new Map(n.map(a=>[tt(a),a])),o=t.map(a=>({id:a,name:n.includes(a)?a:i.get(tt(a))})),s=o.filter(a=>a.name==null).map(a=>a.id);return s.length>0?hf({kind:"unknown-ids",known:n,unknown:s}):bv(o.flatMap(a=>a.name==null?[]:[a.name]))}import{err as mf,ok as vv}from"neverthrow";import{graphql as xv}from"gql.tada";import{execFileSync as c5}from"child_process";function ra(e,t){return c5("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}async function Rv({config:e,cwd:t,lockfile:r}){await f5({config:e,cwd:t,lockfile:r});let n=await h5(e);if(n.isErr())return mf(n.error);let i=new Map(r.tests.filter(s=>!s.stub).map(s=>[tt(s.name),s.name])),o=[...new Set(n.value)].flatMap(s=>{let a=i.get(s);return a==null?[]:[a]});return o.length===0?mf({kind:"scope-empty"}):vv(o)}var d5=xv(`
|
|
158
158
|
mutation AddDirtyTestsToScope($projectId: String!, $cwd: String!, $workflowSlugs: [String!]!) {
|
|
159
159
|
addDirtyTestsToScope(projectId: $projectId, cwd: $cwd, workflowSlugs: $workflowSlugs) {
|
|
160
160
|
__typename
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
`);async function
|
|
163
|
+
`);async function f5({config:e,cwd:t,lockfile:r}){let n=new Set(m5(t)),i=r.tests.filter(o=>o.sourcePath!=null&&n.has(o.sourcePath)).map(o=>tt(o.name));i.length!==0&&await _e({config:e,document:d5,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:i}}).catch(o=>{Se.warn({err:o},"auto-scope of dirty tests failed")})}var p5=xv(`
|
|
164
164
|
query ScopeSelection($projectId: String!, $cwd: String!) {
|
|
165
165
|
project(id: $projectId) {
|
|
166
166
|
id
|
|
@@ -176,8 +176,8 @@ ${ON(i)}`),o}function m1(e){return Jc(e,xe)}async function g1(e){let t=[];functi
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
`);async function
|
|
180
|
-
`).map(t=>t.slice(3).trim()).filter(t=>t.startsWith(
|
|
179
|
+
`);async function h5(e){try{let r=(await _e({config:e,document:p5,variables:{cwd:e.cwd,projectId:e.projectId}})).project?.devSession?.scopeItems??[];return vv(r.flatMap(n=>n.workflow==null?[]:[n.workflow.slug]))}catch(t){return mf({detail:t instanceof Error?t.message:String(t),kind:"scope-fetch-failed"})}}var wv=".ripplo/tests/";function m5(e){try{return ra(["status","--porcelain","--",".ripplo/tests"],e).split(`
|
|
180
|
+
`).map(t=>t.slice(3).trim()).filter(t=>t.startsWith(wv)&&t.endsWith(".ts")).map(t=>t.slice(wv.length)).filter(t=>t!=="index.ts"&&!t.endsWith("/index.ts"))}catch{return[]}}var S5=12e4,w5=-32099;function v5(e){let t=new AbortController;return e.isCancellationRequested?(t.abort(),t.signal):(e.onCancellationRequested(()=>{t.abort()}),t.signal)}function yY(e){let t={...e,expectations:new Map,jobs:new Map};return{claim:r=>I5(t,r),handleConnection:r=>{x5(t,r)},idle:()=>Av(t)}}function x5(e,t){let r=uv(t);r.onRequest(pv,(n,i)=>R5({connection:r,ctx:e,params:n,token:i})),r.onRequest(hv,()=>{let n=uf();return{active:n.active,queued:n.queued,...e.explorationStatus()}}),r.onRequest(fv,async(n,i)=>{let o=dv.safeParse(n);return o.success?(await e.ready,e.replayFinding(o.data.findingId,v5(i))):{kind:"error",reason:"bad-message"}}),r.onRequest(mv,()=>{let n=Av(e);return n&&e.onShutdownRequest(),n}),r.onClose(()=>{k5(e,r)}),r.onError(n=>{Se.warn({err:n},"ipc connection error")}),t.on("error",n=>{Se.warn({err:n},"ipc socket error")}),r.listen()}function Av(e){let t=uf();return e.jobs.size===0&&t.active===0&&t.queued===0}async function R5({connection:e,ctx:t,params:r,token:n}){let i=cv.safeParse(r);if(!i.success)throw kv({code:"bad-message"});await t.ready;let o=await T5({config:t.config,cwd:t.cwd,message:i.data});if(o.kind==="error")throw kv(o.error);let s=g5(),a=new y5;return n.onCancellationRequested(()=>{Iv(t,s)}),t.jobs.set(s,{cancellation:a,connection:e,failed:0,notRun:0,passed:0,total:o.testNames.length}),B5({ctx:t,headed:i.data.headed,jobId:s,testNames:o.testNames,token:a.token,workflowIdsBySlug:o.workflowIdsBySlug}).catch(l=>{Se.error({err:l},"ipc dispatch failed")}),{jobId:s,total:o.testNames.length}}function kv(e){return new b5(w5,e.code,e)}function Iv(e,t){let r=e.jobs.get(t);r!=null&&(r.cancellation.cancel(),e.jobs.delete(t),e.expectations.forEach((n,i)=>{n.filter(o=>o.jobId===t).forEach(o=>{clearTimeout(o.timer)}),e.expectations.set(i,n.filter(o=>o.jobId!==t))}))}function k5(e,t){[...e.jobs.entries()].filter(([,r])=>r.connection===t).forEach(([r])=>{Iv(e,r)})}function Ei(e,t,r){let n=e.jobs.get(t);n!=null&&(Ev(()=>n.connection.sendNotification(gv,{event:r,jobId:t})),r.kind==="test-outcome"&&(E5(n,r.outcome.kind),n.passed+n.failed+n.notRun>=n.total&&(Ev(()=>n.connection.sendNotification(yv,{failed:n.failed,jobId:t,notRun:n.notRun,passed:n.passed})),e.jobs.delete(t))))}function Ev(e){e().catch(t=>{Se.warn({err:t},"ipc notification failed")})}function E5(e,t){if(t==="pass"){e.passed+=1;return}if(t==="dispatch-error"||t==="infra-error"){e.notRun+=1;return}e.failed+=1}function Pv(e,t){let n=e.expectations.get(t)?.shift();return n==null?null:(clearTimeout(n.timer),n)}function C5(e,t){let{headed:r,jobId:n,slug:i,testName:o}=t,s=setTimeout(()=>{A5({ctx:e,jobId:n,slug:i,testName:o,timer:s})},S5);e.expectations.set(i,[...e.expectations.get(i)??[],{headed:r,jobId:n,testName:o,timer:s}])}function A5({ctx:e,jobId:t,slug:r,testName:n,timer:i}){let o=e.expectations.get(r)??[],s=o.findIndex(a=>a.timer===i);s!==-1&&(e.expectations.set(r,o.toSpliced(s,1)),Ei(e,t,{kind:"test-outcome",outcome:{detail:"dispatch-timeout",kind:"dispatch-error"},runId:"",testName:n}))}function I5(e,t){let r=Pv(e,t);if(r==null)return null;let n=e.jobs.get(r.jobId);return n==null?null:{headed:r.headed,token:n.cancellation.token,finished:(i,o)=>{Ei(e,r.jobId,{kind:"test-outcome",outcome:o,runId:i,testName:r.testName})},started:i=>{Ei(e,r.jobId,{kind:"test-started",runId:i,testName:r.testName})}}}function P5(e){return e.kind==="typecheck-failed"?e.diagnostics.slice(0,5):e.kind==="invalid-lockfile"?e.issues.slice(0,5):e.kind==="load-threw"?[e.message]:[]}async function T5({config:e,cwd:t,message:r}){return(await up(t)).match(i=>M5({config:e,cwd:t,lockfile:i,message:r}),i=>Promise.resolve({error:{code:"compile-failed",detail:i.kind,diagnostics:[...P5(i)]},kind:"error"}))}async function M5({config:e,cwd:t,lockfile:r,message:n}){let i=await N5(e.appUrl);if(i!=null)return{error:{code:"app-unreachable",detail:i,url:e.appUrl},kind:"error"};let o=await L5({config:e,cwd:t,lockfile:r});return o!=null?{error:{code:"sync-failed",detail:o},kind:"error"}:(await $5({config:e,cwd:t,lockfile:r,message:n})).match(async a=>({kind:"ready",testNames:a,workflowIdsBySlug:await j5(e,t)}),a=>Promise.resolve({error:a,kind:"error"}))}var O5=2e3;async function N5(e){try{return await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(O5)}),null}catch(t){return t instanceof Error?t.message:String(t)}}async function L5(e){try{return await ff(e),null}catch(t){return t instanceof Error?t.message:String(t)}}async function $5({config:e,cwd:t,lockfile:r,message:n}){return!n.all&&n.tests.length===0?(await Rv({config:e,cwd:t,lockfile:r})).mapErr(D5):Sv({all:n.all,ids:n.tests,lockfile:r}).mapErr(_5)}function D5(e){return e.kind==="scope-empty"?{code:"selection-nothing-selected"}:{code:"scope-failed",detail:e.detail}}function _5(e){switch(e.kind){case"conflicting-flags":return{code:"selection-conflicting-flags"};case"nothing-selected":return{code:"selection-nothing-selected"};case"unknown-ids":return{code:"selection-unknown-ids",known:[...e.known],unknown:[...e.unknown]}}}var F5=Cv(`
|
|
181
181
|
query DaemonWorkflows($projectId: String!, $cwd: String!) {
|
|
182
182
|
project(id: $projectId) {
|
|
183
183
|
id
|
|
@@ -190,7 +190,7 @@ ${ON(i)}`),o}function m1(e){return Jc(e,xe)}async function g1(e){let t=[];functi
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
`);async function
|
|
193
|
+
`);async function j5(e,t){let n=(await _e({config:e,document:F5,variables:{cwd:t,projectId:e.projectId}})).project?.devSession?.workflows??[];return new Map(n.map(i=>[i.slug,i.id]))}var V5=Cv(`
|
|
194
194
|
mutation DaemonCreateRun($workflowId: String!) {
|
|
195
195
|
createRun(workflowId: $workflowId, executor: local) {
|
|
196
196
|
__typename
|
|
@@ -199,34 +199,34 @@ ${ON(i)}`),o}function m1(e){return Jc(e,xe)}async function g1(e){let t=[];functi
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
`);async function U5(e){await e.testNames.reduce((t,r)=>t.then(()=>W5(e,r)),Promise.resolve())}async function W5(e,t){let{ctx:r,headed:n,jobId:i,token:o,workflowIdsBySlug:s}=e;if(o.isCancellationRequested)return;let a=tt(t),l=s.get(a);if(l==null){Ei(r,i,{kind:"test-outcome",outcome:{detail:"workflow-not-found",kind:"dispatch-error"},runId:"",testName:t});return}A5(r,{headed:n,jobId:i,slug:a,testName:t});let u=await z5(r.config,l);u!=null&&(Tv(r,a),Ei(r,i,{kind:"test-outcome",outcome:u,runId:"",testName:t}))}async function z5(e,t){try{let n=(await _e({config:e,document:B5,variables:{workflowId:t}})).createRun;return n==null?{detail:"create-run-null",kind:"dispatch-error"}:n.__typename==="Run"?null:{detail:n.__typename,kind:"dispatch-error"}}catch(r){return r instanceof Cr?{detail:r.message,kind:"infra-error"}:{detail:r instanceof Error?r.message:String(r),kind:"dispatch-error"}}}function G5(e){let{backoffActive:t,explorerHolder:r,headedActive:n,interactiveActive:i,interactiveQueued:o}=e,{explorationActive:s,exploreConcurrency:a,poolSize:l}=e;if(!r||n||o>0)return{abortCount:s,refillCount:0};if(t)return{abortCount:0,refillCount:0};let u=Math.min(a,l-1,l-i);return{abortCount:0,refillCount:Math.max(0,u-s)}}function wY(e){let t={active:new Map,backoffUntil:0,cancelBackoffTimer:null,cancelHeartbeat:null,holder:!1,prevInteractiveActive:e.probe().interactiveActive,stopped:!1};return Nv(t,e),{explorationActive:()=>t.active.size,explorerHolder:()=>t.holder,notifyQueueChange:()=>{H5(t,e)},setExplorerHolder:r=>{t.holder=r,Ci(t,e)},stop:()=>{t.stopped=!0,t.cancelBackoffTimer?.(),t.cancelBackoffTimer=null,t.cancelHeartbeat?.(),t.cancelHeartbeat=null,Lv(t,t.active.size)}}}function Nv(e,t){e.stopped||(e.cancelHeartbeat=t.setTimer(()=>{Ci(e,t),Nv(e,t)},15e3))}function Ci(e,t){if(e.stopped)return;let r=t.probe(),n=G5({backoffActive:t.now()<e.backoffUntil,explorationActive:e.active.size,exploreConcurrency:t.exploreConcurrency,explorerHolder:e.holder&&t.exploreEnabled,headedActive:r.headedActive>0,interactiveActive:r.interactiveActive,interactiveQueued:r.interactiveQueued,poolSize:r.poolSize});Lv(e,n.abortCount),$v({count:n.refillCount,params:t,state:e})}function Lv(e,t){[...e.active.values()].slice(0,t).forEach(({controller:r})=>{r.abort()})}function H5(e,t){let r=t.probe();r.interactiveActive<e.prevInteractiveActive&&q5(e,t),e.prevInteractiveActive=r.interactiveActive,Ci(e,t)}function q5(e,t){e.backoffUntil=t.now()+3e4,e.cancelBackoffTimer?.(),e.cancelBackoffTimer=t.setTimer(()=>{e.cancelBackoffTimer=null,Ci(e,t)},3e4)}function $v({count:e,params:t,state:r}){if(e<=0)return;let n=K5(t.sources);n!=null&&(Y5({params:t,pulled:n,state:r}),$v({count:e-1,params:t,state:r}))}function K5(e){return e.reduce((t,r)=>{if(t!=null)return t;let n=r.next();return n==null?null:{job:n,source:r}},null)}function Y5({params:e,pulled:t,state:r}){let{job:n,source:i}=t,o=new AbortController;r.active.set(n.id,{controller:o,job:n,source:i}),e.execute({job:n,priority:i.priority,signal:o.signal}).then(()=>{Ov({job:n,outcome:Mv(o.signal,null),params:e,source:i,state:r})}).catch(s=>{Ov({job:n,outcome:Mv(o.signal,{error:s}),params:e,source:i,state:r})})}function Mv(e,t){return e.aborted?{kind:"aborted"}:t==null?{kind:"completed"}:{error:t.error,kind:"error"}}function Ov({job:e,outcome:t,params:r,source:n,state:i}){i.active.delete(e.id),n.onResult(e,t),Ci(i,r)}import J5 from"fs";import Z5 from"path";async function IY(e){let t=Z5.join(e,".ripplo","index.ts");if(!J5.existsSync(t))return{appUrl:void 0,engineUrl:void 0,errors:[{message:".ripplo/index.ts not found",path:""}],valid:!1,warnings:[]};let r=await Sn(e);return r.isErr()?{appUrl:void 0,engineUrl:void 0,errors:[{message:Qi(r.error),path:".ripplo/"}],valid:!1,warnings:[]}:Vi().match(n=>({appUrl:n.appUrl,engineUrl:n.engineUrl,errors:[],valid:!0,warnings:[]}),n=>({appUrl:void 0,engineUrl:void 0,errors:[{message:Da(n),path:""}],valid:!1,warnings:[]}))}async function PY(e){try{await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(5e3)});return}catch{return`appUrl (${e}) is not responding. Make sure your dev server is running on that port.`}}async function TY({appUrl:e,engineUrl:t}){let r=t.startsWith("http://")||t.startsWith("https://")?t:`${e}${t}`;try{return(await fetch(`${r}/setup`,{body:JSON.stringify({}),headers:{"Content-Type":"application/json"},method:"PUT",signal:AbortSignal.timeout(5e3)})).ok?"Engine endpoint accepted an unsigned request \u2014 webhook signature verification may be missing.":void 0}catch{return}}import tF from"fs";import X5 from"fs";import yf from"path";var Q5=["MERGE_HEAD","rebase-merge","rebase-apply","CHERRY_PICK_HEAD","REVERT_HEAD"];function Dv(e){let t=eF(e);return t==null?!1:Q5.some(r=>X5.existsSync(yf.join(t,r)))}function eF(e){try{let t=ra(["rev-parse","--git-dir"],e).trim();return t.length===0?null:yf.isAbsolute(t)?t:yf.resolve(e,t)}catch{return null}}function rF(e){return Ut(e,"hooks-paused")}function VY(e){return tF.existsSync(rF(e))||Dv(e)?!1:xp(e)}import nF from"fs";import{lockSync as iF}from"proper-lockfile";var oF="explorer.lock",sF=15e3,aF=15e3;function lF(){return ur(oF)}function GY({onChange:e}){let t={release:null,stopped:!1},r=()=>{t.release=null,t.stopped||e(!1)},n=()=>{if(t.stopped||t.release!=null)return;let o=uF(r);o!=null&&(t.release=o,e(!0))};n();let i=setInterval(n,aF);return{holder:()=>t.release!=null,stop:()=>{t.stopped=!0,clearInterval(i),t.release?.(),t.release=null}}}function uF(e){try{pn();let t=lF(),r=iF(t,{onCompromised:e,realpath:!1,stale:sF});return nF.writeFileSync(t,String(process.pid)),()=>{try{r()}catch{}}}catch{return null}}import cF from"path";import{randomUUID as dF}from"crypto";function _v(e){return{axes:[Yd("unit"),Jd(e)]}}var Fv=12,jv=15,Vv=4,Bv=2,Uv=18e4;var Gv={covered:0,deferred:0,findings:0,saturated:!1,total:0};function eJ(){return{priority:"p3",next:()=>null,onResult:()=>{},ready:()=>Promise.resolve(),status:()=>Gv,stop:()=>Promise.resolve()}}function tJ(e){let t={claimed:new Set,consecutiveErrors:0,covered:new Set,deferred:new Map,findings:0,haltedUntil:0,prepared:null,preparing:!1,refreshing:!1,saturated:!1,tick:0},r=bf(e,t);return{priority:"p3",next:()=>gF(e,t),onResult:()=>{},ready:()=>r,status:()=>t.prepared==null?Gv:hF(t.prepared,t),stop:()=>Promise.resolve()}}async function bf(e,t){if(!t.preparing){t.preparing=!0;try{let r=await e.loadLockfile();if(r==null)return;let n=await fF(r);if(n==null)return;await Ri(Kv(e.cwd)).match(i=>{let o=xi(i);t.covered=new Set(o.covered),t.findings=[...o.findings.values()].filter(s=>s.resolvedAt==null).length,t.prepared=n,t.consecutiveErrors=0,t.haltedUntil=0,t.deferred.clear(),e.notifyWork()},i=>{Se.warn("explore ledger unreadable, exploration disabled: %s",i.kind)})}finally{t.preparing=!1}}}async function fF({fingerprint:e,lockfile:t}){let r=_v(t),n=Lr(t);if(n.length===0)return null;let i=af(t,{sweep:!1}),o=await pF(t,i),s=tf({corpus:n,depots:o,lens:r,maxCount:Bv,maxDepth:Vv});return{actionHashes:n.map(a=>Xd(t,a)),corpus:n,depots:i,fingerprint:e,graph:s,lens:r,lensIdValue:Kd(r),lockfile:t,lockfileHashValue:Qd(t)}}async function pF(e,t){let r={generate:Dr,materialize:sl(Dr,e.valueSpaces),params:void 0};return(await Promise.all(t.map(async i=>(await lf(e,i,r)).match(s=>({name:i.name,snapshot:s.snapshot}),()=>null)))).flatMap(i=>i==null?[]:[i])}var Wv=20,Hv=6e5,zv=3e5;function hF(e,t){let r=nf(e.graph),n=rf({actionHashes:e.actionHashes,corpus:e.corpus,covered:t.covered,graph:e.graph,lensId:e.lensIdValue,tick:t.tick});return{covered:r-n,deferred:Zv(t).size,findings:t.findings,saturated:t.saturated,total:r}}async function mF(e,t){if(!(t.refreshing||t.preparing||t.prepared==null)){t.refreshing=!0;try{let r=await e.loadLockfile();if(r==null||r.fingerprint===t.prepared.fingerprint)return;Se.info("exploration model changed, re-preparing target graph"),t.prepared=null,await bf(e,t)}finally{t.refreshing=!1}}}function gF(e,t){mF(e,t);let r=t.prepared;if(r==null||Date.now()<t.haltedUntil)return null;let n=of({actionHashes:r.actionHashes,corpus:r.corpus,covered:new Set([...t.covered,...t.claimed,...Zv(t)]),graph:r.graph,lensId:r.lensIdValue,tick:t.tick});if(t.tick+=1,n.kind==="saturated")return t.saturated=!0,null;t.saturated=!1;let i=EF(r,n.target);return t.claimed.add(i),{firings:yF(r,n.target),id:`explore:${dF()}`,label:n.target.targetKey,path:qv(r,n.target),run:o=>bF({choice:n.target,key:i,params:e,prepared:r,signal:o,state:t})}}function yF(e,t){return t.witness.trail.flatMap(r=>{let n=e.corpus[r.idx];return n==null?[]:[{actions:[...n.nav,...n.steps].map(i=>Vl(i.action)),label:`${n.test}#${String(n.index)}`}]})}function qv(e,t){return t.witness.trail.map(r=>{let n=e.corpus[r.idx];return n==null?"?":`${n.test}#${String(n.index)}`}).join(" -> ")}async function bF({choice:e,key:t,params:r,prepared:n,signal:i,state:o}){try{let s=wF({choice:e,prepared:n});if(s==null)return;if(!await r.probeApp()){Jv(o,"app-unreachable");return}let a=AbortSignal.timeout(Uv),l=await r.executeTrail(s,AbortSignal.any([i,a]));if(l.kind==="aborted"){xF({deadline:a,key:t,signal:i,state:o});return}if(l.kind==="error"){RF({key:t,params:r,reason:l.reason,state:o});return}o.consecutiveErrors=0,Se.info("exploration trail %s: %s @ %s",l.kind,qv(n,e),e.targetKey.slice(0,80)),await vF({outcome:SF(l,e,n),params:r,state:o})}finally{o.claimed.delete(t)}}function SF(e,t,r){let n={actionHash:t.actionHash,at:new Date().toISOString(),kind:"covered",lensId:r.lensIdValue,targetKey:t.targetKey};return{...e,rows:[...e.rows,n]}}function wF({choice:e,prepared:t}){let r=t.depots.find(n=>n.name===e.witness.depot);return r==null?null:{depotTest:r.test,firings:e.witness.trail.map(n=>({idx:n.idx,params:n.params})),lensId:t.lensIdValue,lockfileFingerprint:t.fingerprint,lockfileHash:t.lockfileHashValue,maxLength:Fv,shrinkBudget:jv}}async function vF({outcome:e,params:t,state:r}){let n=e.rows.filter(i=>i.kind!=="covered"||!r.covered.has(ze(i)));n.forEach(i=>{(i.kind==="covered"||i.kind==="finding"||i.kind==="flaky-candidate")&&r.covered.add(ze(i))}),e.kind==="finding"&&(r.findings+=1,Se.info("exploration finding recorded")),n.length!==0&&await Zd(Kv(t.cwd),n).match(()=>{},i=>{Se.warn("explore ledger append failed: %s",i.kind)})}function Kv(e){return cF.join(e,".ripplo",".local","explore-ledger.jsonl")}function xF({deadline:e,key:t,signal:r,state:n}){e.aborted&&!r.aborted&&(Yv(n,t),Se.warn("exploration trail timed out, target deferred for %ds",Hv/1e3))}function RF({key:e,params:t,reason:r,state:n}){if(r==="lockfile:fingerprint-mismatch"){kF(t,n);return}Yv(n,e),Jv(n,r)}function kF(e,t){t.preparing||(t.prepared=null,bf(e,t))}function Yv(e,t){e.deferred.set(t,Date.now()+Hv)}function Jv(e,t){e.consecutiveErrors+=1,Se.debug("exploration trail error: %s",t),e.consecutiveErrors>=Wv&&(e.haltedUntil=Date.now()+zv,e.consecutiveErrors=0,Se.warn("exploration cooling down for %ds after %d consecutive trail errors (last: %s)",zv/1e3,Wv,t))}function Zv(e){let t=Date.now();return[...e.deferred].filter(([,r])=>r<=t).forEach(([r])=>e.deferred.delete(r)),new Set(e.deferred.keys())}function EF(e,t){return ze({actionHash:t.actionHash,lensId:e.lensIdValue,targetKey:t.targetKey})}import CF from"path";var AF=3;function oJ(e){return Ri(IF(e)).map(t=>PF(xi(t)))}function IF(e){return CF.join(e,".ripplo",".local","explore-ledger.jsonl")}function PF(e){let t=[...e.findings.entries()].filter(([,n])=>n.resolvedAt==null).map(([n,i])=>TF(n,i)).toSorted(OF),r=[...e.flaky.entries()].filter(([,n])=>n.occurrences>=AF).map(([n,i])=>MF(n,i)).toSorted((n,i)=>i.occurrences-n.occurrences);return{pending:t,recurrentFlaky:r}}function TF(e,t){let r=t.latest;return{depot:r.depot,evidence:r.evidence,firstSeen:t.first.at,id:Zs(e),lastSeen:r.at,occurrences:t.occurrences,oracleLayer:r.oracleLayer,parts:r.parts,runId:r.runId,trail:r.trail}}function MF(e,t){return{at:t.first.at,depot:t.first.depot,id:Zs(e),occurrences:t.occurrences,trail:t.first.trail}}var Xv={crash:0,frame:3,invariant:1,law:2};function OF(e,t){let r=Xv[e.oracleLayer]-Xv[t.oracleLayer];return r===0?t.occurrences-e.occurrences:r}import{gzip as NF}from"zlib";import{promisify as LF}from"util";import{existsSync as $F,readFileSync as DF}from"fs";import ex from"path";import{graphql as Ai}from"gql.tada";function Qv(e){return[e.kind,e.target,e.value].filter(t=>t.length>0).join(" ")}async function yJ({config:e,cwd:t,headed:r,lockfile:n,runId:i,session:o,signal:s,test:a}){if(!await qF(e,i))return{kind:"dispatch-failed",reason:"already-claimed",runId:i};let u=ex.join(t,".ripplo","debug"),c=[];return(await o.runOnce({capture:!0,lockfile:n,options:{baseUrl:e.appUrl,engineUrl:e.engineUrl,generate:Dr,headed:r,secret:e.webhookSecret},params:void 0,runId:i,sequence:void 0,testName:a.name,onEvent:p=>{c.push(p)}},s)).match(async p=>{await _F({config:e,debugDir:u,events:c,runId:i,test:a,total:p.fired.length});let h=tx(c).flatMap(f=>f.findings);return h.length>0?{findings:h,kind:"findings",runId:i}:{kind:"pass",runId:i}},async p=>(await zF(e,i,Et(p)),{error:p,kind:"error",runId:i}))}async function _F({config:e,debugDir:t,events:r,runId:n,test:i}){let o=tx(r),s=FF(t,n);await Promise.all([BF({config:e,origin:s?.origin??0,records:o,runId:n,test:i}),s==null?Promise.resolve():GF(e,n,s)]),await HF(e,n,o)}function tx(e){return e.flatMap(t=>t.kind==="step"?[{endMs:t.endMs,findings:t.findings,index:t.index,startMs:t.startMs}]:[])}function FF(e,t){let r=ex.join(e,t,"behavior.jsonl");if(!$F(r))return null;let n=DF(r,"utf8").split(`
|
|
203
|
-
`).filter(o=>o.length>0).map(o=>
|
|
204
|
-
`),i=await
|
|
202
|
+
`);async function B5(e){await e.testNames.reduce((t,r)=>t.then(()=>U5(e,r)),Promise.resolve())}async function U5(e,t){let{ctx:r,headed:n,jobId:i,token:o,workflowIdsBySlug:s}=e;if(o.isCancellationRequested)return;let a=tt(t),l=s.get(a);if(l==null){Ei(r,i,{kind:"test-outcome",outcome:{detail:"workflow-not-found",kind:"dispatch-error"},runId:"",testName:t});return}C5(r,{headed:n,jobId:i,slug:a,testName:t});let u=await W5(r.config,l);u!=null&&(Pv(r,a),Ei(r,i,{kind:"test-outcome",outcome:u,runId:"",testName:t}))}async function W5(e,t){try{let n=(await _e({config:e,document:V5,variables:{workflowId:t}})).createRun;return n==null?{detail:"create-run-null",kind:"dispatch-error"}:n.__typename==="Run"?null:{detail:n.__typename,kind:"dispatch-error"}}catch(r){return r instanceof Cr?{detail:r.message,kind:"infra-error"}:{detail:r instanceof Error?r.message:String(r),kind:"dispatch-error"}}}function z5(e){let{backoffActive:t,explorerHolder:r,headedActive:n,interactiveActive:i,interactiveQueued:o}=e,{explorationActive:s,exploreConcurrency:a,poolSize:l}=e;if(!r||n||o>0)return{abortCount:s,refillCount:0};if(t)return{abortCount:0,refillCount:0};let u=Math.min(a,l-1,l-i);return{abortCount:0,refillCount:Math.max(0,u-s)}}function SY(e){let t={active:new Map,backoffUntil:0,cancelBackoffTimer:null,cancelHeartbeat:null,holder:!1,prevInteractiveActive:e.probe().interactiveActive,stopped:!1};return Ov(t,e),{explorationActive:()=>t.active.size,explorerHolder:()=>t.holder,notifyQueueChange:()=>{G5(t,e)},setExplorerHolder:r=>{t.holder=r,Ci(t,e)},stop:()=>{t.stopped=!0,t.cancelBackoffTimer?.(),t.cancelBackoffTimer=null,t.cancelHeartbeat?.(),t.cancelHeartbeat=null,Nv(t,t.active.size)}}}function Ov(e,t){e.stopped||(e.cancelHeartbeat=t.setTimer(()=>{Ci(e,t),Ov(e,t)},15e3))}function Ci(e,t){if(e.stopped)return;let r=t.probe(),n=z5({backoffActive:t.now()<e.backoffUntil,explorationActive:e.active.size,exploreConcurrency:t.exploreConcurrency,explorerHolder:e.holder&&t.exploreEnabled,headedActive:r.headedActive>0,interactiveActive:r.interactiveActive,interactiveQueued:r.interactiveQueued,poolSize:r.poolSize});Nv(e,n.abortCount),Lv({count:n.refillCount,params:t,state:e})}function Nv(e,t){[...e.active.values()].slice(0,t).forEach(({controller:r})=>{r.abort()})}function G5(e,t){let r=t.probe();r.interactiveActive<e.prevInteractiveActive&&H5(e,t),e.prevInteractiveActive=r.interactiveActive,Ci(e,t)}function H5(e,t){e.backoffUntil=t.now()+3e4,e.cancelBackoffTimer?.(),e.cancelBackoffTimer=t.setTimer(()=>{e.cancelBackoffTimer=null,Ci(e,t)},3e4)}function Lv({count:e,params:t,state:r}){if(e<=0)return;let n=q5(t.sources);n!=null&&(K5({params:t,pulled:n,state:r}),Lv({count:e-1,params:t,state:r}))}function q5(e){return e.reduce((t,r)=>{if(t!=null)return t;let n=r.next();return n==null?null:{job:n,source:r}},null)}function K5({params:e,pulled:t,state:r}){let{job:n,source:i}=t,o=new AbortController;r.active.set(n.id,{controller:o,job:n,source:i}),e.execute({job:n,priority:i.priority,signal:o.signal}).then(()=>{Mv({job:n,outcome:Tv(o.signal,null),params:e,source:i,state:r})}).catch(s=>{Mv({job:n,outcome:Tv(o.signal,{error:s}),params:e,source:i,state:r})})}function Tv(e,t){return e.aborted?{kind:"aborted"}:t==null?{kind:"completed"}:{error:t.error,kind:"error"}}function Mv({job:e,outcome:t,params:r,source:n,state:i}){i.active.delete(e.id),n.onResult(e,t),Ci(i,r)}import Y5 from"fs";import J5 from"path";async function AY(e){let t=J5.join(e,".ripplo","index.ts");if(!Y5.existsSync(t))return{appUrl:void 0,engineUrl:void 0,errors:[{message:".ripplo/index.ts not found",path:""}],valid:!1,warnings:[]};let r=await Sn(e);return r.isErr()?{appUrl:void 0,engineUrl:void 0,errors:[{message:Qi(r.error),path:".ripplo/"}],valid:!1,warnings:[]}:Vi().match(n=>({appUrl:n.appUrl,engineUrl:n.engineUrl,errors:[],valid:!0,warnings:[]}),n=>({appUrl:void 0,engineUrl:void 0,errors:[{message:Da(n),path:""}],valid:!1,warnings:[]}))}async function IY(e){try{await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(5e3)});return}catch{return`appUrl (${e}) is not responding. Make sure your dev server is running on that port.`}}async function PY({appUrl:e,engineUrl:t}){let r=t.startsWith("http://")||t.startsWith("https://")?t:`${e}${t}`;try{return(await fetch(`${r}/setup`,{body:JSON.stringify({}),headers:{"Content-Type":"application/json"},method:"PUT",signal:AbortSignal.timeout(5e3)})).ok?"Engine endpoint accepted an unsigned request \u2014 webhook signature verification may be missing.":void 0}catch{return}}import eF from"fs";import Z5 from"fs";import gf from"path";var X5=["MERGE_HEAD","rebase-merge","rebase-apply","CHERRY_PICK_HEAD","REVERT_HEAD"];function $v(e){let t=Q5(e);return t==null?!1:X5.some(r=>Z5.existsSync(gf.join(t,r)))}function Q5(e){try{let t=ra(["rev-parse","--git-dir"],e).trim();return t.length===0?null:gf.isAbsolute(t)?t:gf.resolve(e,t)}catch{return null}}function tF(e){return Ut(e,"hooks-paused")}function jY(e){return eF.existsSync(tF(e))||$v(e)?!1:vp(e)}import rF from"fs";import{lockSync as nF}from"proper-lockfile";var iF="explorer.lock",oF=15e3,sF=15e3;function aF(){return ur(iF)}function zY({onChange:e}){let t={release:null,stopped:!1},r=()=>{t.release=null,t.stopped||e(!1)},n=()=>{if(t.stopped||t.release!=null)return;let o=lF(r);o!=null&&(t.release=o,e(!0))};n();let i=setInterval(n,sF);return{holder:()=>t.release!=null,stop:()=>{t.stopped=!0,clearInterval(i),t.release?.(),t.release=null}}}function lF(e){try{pn();let t=aF(),r=nF(t,{onCompromised:e,realpath:!1,stale:oF});return rF.writeFileSync(t,String(process.pid)),()=>{try{r()}catch{}}}catch{return null}}import uF from"path";import{randomUUID as cF}from"crypto";function Dv(e){return{axes:[Kd("unit"),Yd(e)]}}var _v=12,Fv=15,jv=4,Vv=2,Bv=18e4;var zv={covered:0,deferred:0,findings:0,saturated:!1,total:0};function QY(){return{priority:"p3",next:()=>null,onResult:()=>{},ready:()=>Promise.resolve(),status:()=>zv,stop:()=>Promise.resolve()}}function eJ(e){let t={claimed:new Set,consecutiveErrors:0,covered:new Set,deferred:new Map,findings:0,haltedUntil:0,prepared:null,preparing:!1,refreshing:!1,saturated:!1,tick:0},r=yf(e,t);return{priority:"p3",next:()=>mF(e,t),onResult:()=>{},ready:()=>r,status:()=>t.prepared==null?zv:pF(t.prepared,t),stop:()=>Promise.resolve()}}async function yf(e,t){if(!t.preparing){t.preparing=!0;try{let r=await e.loadLockfile();if(r==null)return;let n=await dF(r);if(n==null)return;await Ri(Hv(e.cwd)).match(i=>{let o=xi(i);t.covered=new Set(o.covered),t.findings=[...o.findings.values()].filter(s=>s.resolvedAt==null).length,t.prepared=n,t.consecutiveErrors=0,t.haltedUntil=0,t.deferred.clear(),e.notifyWork()},i=>{Se.warn("explore ledger unreadable, exploration disabled: %s",i.kind)})}finally{t.preparing=!1}}}async function dF({fingerprint:e,lockfile:t}){let r=Dv(t),n=Lr(t);if(n.length===0)return null;let i=sf(t,{sweep:!1}),o=await fF(t,i),s=ef({corpus:n,depots:o,lens:r,maxCount:Vv,maxDepth:jv});return{actionHashes:n.map(a=>Zd(t,a)),corpus:n,depots:i,fingerprint:e,graph:s,lens:r,lensIdValue:qd(r),lockfile:t,lockfileHashValue:Xd(t)}}async function fF(e,t){let r={generate:Dr,materialize:sl(Dr,e.valueSpaces),params:void 0};return(await Promise.all(t.map(async i=>(await af(e,i,r)).match(s=>({name:i.name,snapshot:s.snapshot}),()=>null)))).flatMap(i=>i==null?[]:[i])}var Uv=20,Gv=6e5,Wv=3e5;function pF(e,t){let r=rf(e.graph),n=tf({actionHashes:e.actionHashes,corpus:e.corpus,covered:t.covered,graph:e.graph,lensId:e.lensIdValue,tick:t.tick});return{covered:r-n,deferred:Yv(t).size,findings:t.findings,saturated:t.saturated,total:r}}async function hF(e,t){if(!(t.refreshing||t.preparing||t.prepared==null)){t.refreshing=!0;try{let r=await e.loadLockfile();if(r==null||r.fingerprint===t.prepared.fingerprint)return;Se.info("exploration model changed, re-preparing target graph"),t.prepared=null,await yf(e,t)}finally{t.refreshing=!1}}}function mF(e,t){hF(e,t);let r=t.prepared;if(r==null||Date.now()<t.haltedUntil)return null;let n=nf({actionHashes:r.actionHashes,corpus:r.corpus,covered:new Set([...t.covered,...t.claimed,...Yv(t)]),graph:r.graph,lensId:r.lensIdValue,tick:t.tick});if(t.tick+=1,n.kind==="saturated")return t.saturated=!0,null;t.saturated=!1;let i=RF(r,n.target);return t.claimed.add(i),{id:`explore:${cF()}`,label:n.target.targetKey,run:o=>gF({choice:n.target,key:i,params:e,prepared:r,signal:o,state:t})}}async function gF({choice:e,key:t,params:r,prepared:n,signal:i,state:o}){try{let s=bF({choice:e,params:r,prepared:n});if(s==null)return;if(!await r.probeApp()){Kv(o,"app-unreachable");return}let a=AbortSignal.timeout(Bv),l=await r.executeTrail(s,AbortSignal.any([i,a]));if(l.kind==="aborted"){wF({deadline:a,key:t,signal:i,state:o});return}if(l.kind==="error"){vF({key:t,params:r,reason:l.reason,state:o});return}o.consecutiveErrors=0,Se.info("exploration trail %s: %s @ %s",l.kind,l.trail.map(u=>u.label).join(" -> "),e.targetKey.slice(0,80)),r.onTrailDone?.({kind:l.kind,label:e.targetKey,trail:l.trail}),await SF({outcome:yF(l,e,n),params:r,state:o})}finally{o.claimed.delete(t)}}function yF(e,t,r){let n={actionHash:t.actionHash,at:new Date().toISOString(),kind:"covered",lensId:r.lensIdValue,targetKey:t.targetKey};return{...e,rows:[...e.rows,n]}}function bF({choice:e,params:t,prepared:r}){let n=r.depots.find(i=>i.name===e.witness.depot);return n==null?null:{depotTest:n.test,firings:e.witness.trail.map(i=>({idx:i.idx,params:i.params})),lensId:r.lensIdValue,lockfileFingerprint:r.fingerprint,lockfileHash:r.lockfileHashValue,maxLength:t.maxTrailLength??_v,shrinkBudget:Fv}}async function SF({outcome:e,params:t,state:r}){let n=e.rows.filter(i=>i.kind!=="covered"||!r.covered.has(ze(i)));n.forEach(i=>{(i.kind==="covered"||i.kind==="finding"||i.kind==="flaky-candidate")&&r.covered.add(ze(i))}),e.kind==="finding"&&(r.findings+=1,Se.info("exploration finding recorded")),n.length!==0&&await Jd(Hv(t.cwd),n).match(()=>{},i=>{Se.warn("explore ledger append failed: %s",i.kind)})}function Hv(e){return uF.join(e,".ripplo",".local","explore-ledger.jsonl")}function wF({deadline:e,key:t,signal:r,state:n}){e.aborted&&!r.aborted&&(qv(n,t),Se.warn("exploration trail timed out, target deferred for %ds",Gv/1e3))}function vF({key:e,params:t,reason:r,state:n}){if(r==="lockfile:fingerprint-mismatch"){xF(t,n);return}qv(n,e),Kv(n,r)}function xF(e,t){t.preparing||(t.prepared=null,yf(e,t))}function qv(e,t){e.deferred.set(t,Date.now()+Gv)}function Kv(e,t){e.consecutiveErrors+=1,Se.debug("exploration trail error: %s",t),e.consecutiveErrors>=Uv&&(e.haltedUntil=Date.now()+Wv,e.consecutiveErrors=0,Se.warn("exploration cooling down for %ds after %d consecutive trail errors (last: %s)",Wv/1e3,Uv,t))}function Yv(e){let t=Date.now();return[...e.deferred].filter(([,r])=>r<=t).forEach(([r])=>e.deferred.delete(r)),new Set(e.deferred.keys())}function RF(e,t){return ze({actionHash:t.actionHash,lensId:e.lensIdValue,targetKey:t.targetKey})}import kF from"path";var EF=3;function iJ(e){return Ri(CF(e)).map(t=>AF(xi(t)))}function CF(e){return kF.join(e,".ripplo",".local","explore-ledger.jsonl")}function AF(e){let t=[...e.findings.entries()].filter(([,n])=>n.resolvedAt==null).map(([n,i])=>IF(n,i)).toSorted(TF),r=[...e.flaky.entries()].filter(([,n])=>n.occurrences>=EF).map(([n,i])=>PF(n,i)).toSorted((n,i)=>i.occurrences-n.occurrences);return{pending:t,recurrentFlaky:r}}function IF(e,t){let r=t.latest;return{depot:r.depot,evidence:r.evidence,firstSeen:t.first.at,id:Zs(e),lastSeen:r.at,occurrences:t.occurrences,oracleLayer:r.oracleLayer,parts:r.parts,runId:r.runId,trail:r.trail}}function PF(e,t){return{at:t.first.at,depot:t.first.depot,id:Zs(e),occurrences:t.occurrences,trail:t.first.trail}}var Jv={crash:0,frame:3,invariant:1,law:2};function TF(e,t){let r=Jv[e.oracleLayer]-Jv[t.oracleLayer];return r===0?t.occurrences-e.occurrences:r}import{gzip as MF}from"zlib";import{promisify as OF}from"util";import{existsSync as NF,readFileSync as LF}from"fs";import Xv from"path";import{graphql as Ai}from"gql.tada";function Zv(e){return[e.kind,e.target,e.value].filter(t=>t.length>0).join(" ")}async function gJ({config:e,cwd:t,headed:r,lockfile:n,runId:i,session:o,signal:s,test:a}){if(!await GF(e,i))return{kind:"dispatch-failed",reason:"already-claimed",runId:i};let u=Xv.join(t,".ripplo","debug"),c=[];return(await o.runOnce({capture:!0,lockfile:n,options:{baseUrl:e.appUrl,engineUrl:e.engineUrl,generate:Dr,headed:r,secret:e.webhookSecret},params:void 0,runId:i,sequence:void 0,testName:a.name,onEvent:p=>{c.push(p)}},s)).match(async p=>{await $F({config:e,debugDir:u,events:c,runId:i,test:a,total:p.fired.length});let h=Qv(c).flatMap(f=>f.findings);return h.length>0?{findings:h,kind:"findings",runId:i}:{kind:"pass",runId:i}},async p=>(await UF(e,i,Et(p)),{error:p,kind:"error",runId:i}))}async function $F({config:e,debugDir:t,events:r,runId:n,test:i}){let o=Qv(r),s=DF(t,n);await Promise.all([jF({config:e,origin:s?.origin??0,records:o,runId:n,test:i}),s==null?Promise.resolve():WF(e,n,s)]),await zF(e,n,o)}function Qv(e){return e.flatMap(t=>t.kind==="step"?[{endMs:t.endMs,findings:t.findings,index:t.index,startMs:t.startMs}]:[])}function DF(e,t){let r=Xv.join(e,t,"behavior.jsonl");if(!NF(r))return null;let n=LF(r,"utf8").split(`
|
|
203
|
+
`).filter(o=>o.length>0).map(o=>_F(o)).flatMap(o=>FF(o)?[o.event]:[]),i=n[0];return i==null?null:{events:n,origin:i.timestamp}}function _F(e){return JSON.parse(e)}function FF(e){return typeof e=="object"&&e!=null&&Reflect.get(e,"kind")==="rrweb"}async function jF({config:e,origin:t,records:r,runId:n,test:i}){let o=r.map(s=>VF({origin:t,record:s,test:i}));await _e({config:e,document:qF,variables:{items:[{runId:n,steps:o}]}})}function VF({origin:e,record:t,test:r}){let n=r.steps[t.index],i=n==null?null:gn(n,t.index);return{assertions:t.findings.map(o=>({description:Fn(o),detail:null,status:"failed"})),detail:null,duration:Math.max(0,t.endMs-t.startMs),nodeType:i?.kind??"step",recordingEndMs:Math.max(0,t.endMs-e),recordingStartMs:Math.max(0,t.startMs-e),rrwebIds:[],snapshotTimestamp:Math.max(0,t.endMs-e),status:t.findings.length>0?"failed":"passed",stepIndex:t.index,title:i==null?`step ${String(t.index)}`:Zv(i),url:""}}var BF=OF(MF);async function UF(e,t,r){await _e({config:e,document:JF,variables:{reason:r,runId:t}}).catch(n=>{Se.error(n,"failRun submission failed")})}async function WF(e,t,r){let n=r.events.map(s=>JSON.stringify(s)).join(`
|
|
204
|
+
`),i=await BF(Buffer.from(n,"utf8")),o=r.events.at(-1);await _e({config:e,document:KF,variables:{input:{bodyBase64:i.toString("base64"),chunkIndex:0,endTimestamp:Math.max(0,(o?.timestamp??r.origin)-r.origin),eventCount:r.events.length,runId:t,startTimestamp:0}}})}async function zF(e,t,r){let n=r.filter(s=>s.findings.length>0).length,i=r.length-n,o=r.reduce((s,a)=>s+Math.max(0,a.endMs-a.startMs),0);await _e({config:e,document:YF,variables:{items:[{duration:o,failCount:n,passCount:i,runId:t,status:n>0?"failed":"passed",summary:null,warnCount:0}]}})}async function GF(e,t){return((await _e({config:e,document:HF,variables:{runIds:[t]}})).startRunsBatch??[]).some(n=>n.id===t)}var HF=Ai(`
|
|
205
205
|
mutation StartRunsBatch($runIds: [String!]!) {
|
|
206
206
|
startRunsBatch(runIds: $runIds) {
|
|
207
207
|
id
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
`),
|
|
210
|
+
`),qF=Ai(`
|
|
211
211
|
mutation SubmitRunStepsBatch($items: [SubmitRunStepsItem!]!) {
|
|
212
212
|
submitRunStepsBatch(items: $items)
|
|
213
213
|
}
|
|
214
|
-
`),
|
|
214
|
+
`),KF=Ai(`
|
|
215
215
|
mutation SubmitRunRecordingChunk($input: SubmitRunRecordingChunkInput!) {
|
|
216
216
|
submitRunRecordingChunk(input: $input)
|
|
217
217
|
}
|
|
218
|
-
`),
|
|
218
|
+
`),YF=Ai(`
|
|
219
219
|
mutation CompleteRunsBatch($items: [CompleteRunItem!]!) {
|
|
220
220
|
completeRunsBatch(items: $items) {
|
|
221
221
|
id
|
|
222
222
|
status
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
`),
|
|
225
|
+
`),JF=Ai(`
|
|
226
226
|
mutation FailRun($runId: String!, $reason: String!) {
|
|
227
227
|
failRun(runId: $runId, reason: $reason)
|
|
228
228
|
}
|
|
229
|
-
`);import{createMessageConnection as
|
|
229
|
+
`);import{createMessageConnection as ex,IPCMessageReader as tx,IPCMessageWriter as rx,NotificationType as ZF,NotificationType0 as nx,RequestType as bf}from"vscode-jsonrpc/node";import{z as D}from"zod";var RJ=D.object({headed:D.boolean(),lockfileFingerprint:D.string(),runId:D.string().min(1),workflowSlug:D.string().min(1)}),kJ=D.object({fingerprint:D.string()}),EJ=D.object({lockfileJson:D.string().optional(),unavailable:D.string().optional()}),XF=D.enum(["unspecified","internal","server","client","producer","consumer"]),QF=D.enum(["unset","ok","error"]),ej=D.object({attributes:D.record(D.string(),D.string()),durationMs:D.number(),kind:D.literal("span"),name:D.string(),parentSpanId:D.union([D.string(),D.undefined()]),source:D.literal("server"),spanId:D.string(),spanKind:XF,status:D.object({code:QF,message:D.union([D.string(),D.undefined()])}),timeNanos:D.string(),traceId:D.string()}),CJ=D.object({runId:D.string().min(1),span:ej}),AJ=D.object({outcome:pf,serverNotified:D.boolean()}),IJ=D.object({depotTest:Gi,firings:D.array(D.object({idx:D.number().int().nonnegative(),params:D.record(D.string(),D.union([Ze,D.null()]))})),lensId:D.string().min(1),lockfileFingerprint:D.string(),lockfileHash:D.string().min(1),maxLength:D.number().int().positive(),shrinkBudget:D.number().int().nonnegative()}),tj=D.object({actions:D.array(D.string()),label:D.string().min(1)}),PJ=D.object({kind:D.enum(["aborted","clean","error","flaky","finding"]),reason:D.string().optional(),rows:D.array(Js),trail:D.array(tj).default([])}),TJ=new nx("worker/ready"),MJ=new bf("worker/run"),OJ=new bf("worker/lockfile"),NJ=new bf("worker/exploreTrail"),LJ=new ZF("worker/span"),$J=new nx("worker/shutdown");function DJ(e){let t=ex(new tx(e),new rx(e));return t.listen(),t}function _J(){let e=ex(new tx(process),new rx(process));return e.listen(),e}export{px as a,Se as b,xx as c,Cr as d,Rx as e,_e as f,aa as g,Ut as h,ur as i,ua as j,Ux as k,Wx as l,Fx as m,Xx as n,Qx as o,zj as p,Xj as q,Vi as r,aR as s,cR as t,dR as u,RR as v,tt as w,Xi as x,DR as y,Sn as z,Tr as A,UV as B,Qi as C,HV as D,qV as E,KV as F,eB as G,Da as H,pp as I,mp as J,pB as K,vp as L,ja as M,bB as N,ra as O,$v as P,AY as Q,IY as R,PY as S,sl as T,Lr as U,NC as V,FC as W,Dr as X,W as Y,oI as Z,sI as _,aI as $,Va as aa,mc as ba,O8 as ca,Zs as da,xi as ea,Ri as fa,Jd as ga,Zd as ha,Xd as ia,m9 as ja,sf as ka,af as la,R9 as ma,tF as na,jY as oa,zY as pa,Dv as qa,QY as ra,eJ as sa,iJ as ta,CF as ua,VK as va,BK as wa,uv as xa,UK as ya,WK as za,zK as Aa,GK as Ba,HK as Ca,qK as Da,fv as Ea,pv as Fa,hv as Ga,mv as Ha,gv as Ia,yv as Ja,fK as Ka,pK as La,hK as Ma,mK as Na,gK as Oa,yK as Pa,$9 as Qa,bK as Ra,vK as Sa,xK as Ta,uf as Ua,RK as Va,iv as Wa,$K as Xa,ff as Ya,v5 as Za,yY as _a,gJ as $a,UF as ab,RJ as bb,kJ as cb,CJ as db,AJ as eb,IJ as fb,PJ as gb,TJ as hb,MJ as ib,OJ as jb,NJ as kb,LJ as lb,$J as mb,DJ as nb,_J as ob,SY as pb};
|
|
230
230
|
/*! Bundled license information:
|
|
231
231
|
|
|
232
232
|
rrweb/dist/rrweb.js:
|