@bluepic/embed 0.1.91 → 0.1.92

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.
@@ -66,7 +66,7 @@ Use Chrome, Firefox or Internet Explorer 11`)}var Buffer$B=safeBuffer$2.exports.
66
66
  `)},pem}var hasRequiredEncoders;function requireEncoders(){return hasRequiredEncoders||(hasRequiredEncoders=1,function(m){var c=m;c.der=requireDer(),c.pem=requirePem()}(encoders)),encoders}var hasRequiredAsn1;function requireAsn1(){return hasRequiredAsn1||(hasRequiredAsn1=1,function(m){var c=m;c.bignum=bn$2.exports,c.define=requireApi().define,c.base=requireBase(),c.constants=requireConstants(),c.decoders=requireDecoders(),c.encoders=requireEncoders()}(asn1$2)),asn1$2}var asn=requireAsn1(),Time=asn.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),AttributeTypeValue=asn.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),AlgorithmIdentifier$1=asn.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),SubjectPublicKeyInfo=asn.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier$1),this.key("subjectPublicKey").bitstr())}),RelativeDistinguishedName=asn.define("RelativeDistinguishedName",function(){this.setof(AttributeTypeValue)}),RDNSequence=asn.define("RDNSequence",function(){this.seqof(RelativeDistinguishedName)}),Name=asn.define("Name",function(){this.choice({rdnSequence:this.use(RDNSequence)})}),Validity=asn.define("Validity",function(){this.seq().obj(this.key("notBefore").use(Time),this.key("notAfter").use(Time))}),Extension=asn.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),TBSCertificate=asn.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(AlgorithmIdentifier$1),this.key("issuer").use(Name),this.key("validity").use(Validity),this.key("subject").use(Name),this.key("subjectPublicKeyInfo").use(SubjectPublicKeyInfo),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(Extension).optional())}),X509Certificate=asn.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(TBSCertificate),this.key("signatureAlgorithm").use(AlgorithmIdentifier$1),this.key("signatureValue").bitstr())}),certificate=X509Certificate,asn1$1=requireAsn1();asn1$3.certificate=certificate;var RSAPrivateKey=asn1$1.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});asn1$3.RSAPrivateKey=RSAPrivateKey;var RSAPublicKey=asn1$1.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});asn1$3.RSAPublicKey=RSAPublicKey;var AlgorithmIdentifier=asn1$1.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),PublicKey=asn1$1.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier),this.key("subjectPublicKey").bitstr())});asn1$3.PublicKey=PublicKey;var PrivateKeyInfo=asn1$1.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(AlgorithmIdentifier),this.key("subjectPrivateKey").octstr())});asn1$3.PrivateKey=PrivateKeyInfo;var EncryptedPrivateKeyInfo=asn1$1.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});asn1$3.EncryptedPrivateKey=EncryptedPrivateKeyInfo;var DSAPrivateKey=asn1$1.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});asn1$3.DSAPrivateKey=DSAPrivateKey,asn1$3.DSAparam=asn1$1.define("DSAparam",function(){this.int()});var ECParameters=asn1$1.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),ECPrivateKey=asn1$1.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(ECParameters),this.key("publicKey").optional().explicit(1).bitstr())});asn1$3.ECPrivateKey=ECPrivateKey,asn1$3.signature=asn1$1.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())});const require$$1$2={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"};var findProc=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,startRegex=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,fullRegex=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,evp=evp_bytestokey,ciphers$1=browser$6,Buffer$6=safeBuffer$2.exports.Buffer,fixProc$1=function(m,c){var ne=m.toString(),we=ne.match(findProc),Pe;if(we){var Ze="aes"+we[1],ie=Buffer$6.from(we[2],"hex"),rr=Buffer$6.from(we[3].replace(/[\r\n]/g,""),"base64"),pr=evp(c,ie.slice(0,8),parseInt(we[1],10)).key,or=[],_r=ciphers$1.createDecipheriv(Ze,pr,ie);or.push(_r.update(rr)),or.push(_r.final()),Pe=Buffer$6.concat(or)}else{var Me=ne.match(fullRegex);Pe=Buffer$6.from(Me[2].replace(/[\r\n]/g,""),"base64")}var Lr=ne.match(startRegex)[1];return{tag:Lr,data:Pe}},asn1=asn1$3,aesid=require$$1$2,fixProc=fixProc$1,ciphers=browser$6,compat=browser$8,Buffer$5=safeBuffer$2.exports.Buffer;function decrypt(m,c){var ne=m.algorithm.decrypt.kde.kdeparams.salt,we=parseInt(m.algorithm.decrypt.kde.kdeparams.iters.toString(),10),Pe=aesid[m.algorithm.decrypt.cipher.algo.join(".")],Me=m.algorithm.decrypt.cipher.iv,Ze=m.subjectPrivateKey,ie=parseInt(Pe.split("-")[1],10)/8,rr=compat.pbkdf2Sync(c,ne,we,ie,"sha1"),pr=ciphers.createDecipheriv(Pe,rr,Me),or=[];return or.push(pr.update(Ze)),or.push(pr.final()),Buffer$5.concat(or)}function parseKeys$3(m){var c;typeof m=="object"&&!Buffer$5.isBuffer(m)&&(c=m.passphrase,m=m.key),typeof m=="string"&&(m=Buffer$5.from(m));var ne=fixProc(m,c),we=ne.tag,Pe=ne.data,Me,Ze;switch(we){case"CERTIFICATE":Ze=asn1.certificate.decode(Pe,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(Ze||(Ze=asn1.PublicKey.decode(Pe,"der")),Me=Ze.algorithm.algorithm.join("."),Me){case"1.2.840.113549.1.1.1":return asn1.RSAPublicKey.decode(Ze.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return Ze.subjectPrivateKey=Ze.subjectPublicKey,{type:"ec",data:Ze};case"1.2.840.10040.4.1":return Ze.algorithm.params.pub_key=asn1.DSAparam.decode(Ze.subjectPublicKey.data,"der"),{type:"dsa",data:Ze.algorithm.params};default:throw new Error("unknown key id "+Me)}case"ENCRYPTED PRIVATE KEY":Pe=asn1.EncryptedPrivateKey.decode(Pe,"der"),Pe=decrypt(Pe,c);case"PRIVATE KEY":switch(Ze=asn1.PrivateKey.decode(Pe,"der"),Me=Ze.algorithm.algorithm.join("."),Me){case"1.2.840.113549.1.1.1":return asn1.RSAPrivateKey.decode(Ze.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:Ze.algorithm.curve,privateKey:asn1.ECPrivateKey.decode(Ze.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return Ze.algorithm.params.priv_key=asn1.DSAparam.decode(Ze.subjectPrivateKey,"der"),{type:"dsa",params:Ze.algorithm.params};default:throw new Error("unknown key id "+Me)}case"RSA PUBLIC KEY":return asn1.RSAPublicKey.decode(Pe,"der");case"RSA PRIVATE KEY":return asn1.RSAPrivateKey.decode(Pe,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:asn1.DSAPrivateKey.decode(Pe,"der")};case"EC PRIVATE KEY":return Pe=asn1.ECPrivateKey.decode(Pe,"der"),{curve:Pe.parameters.value,privateKey:Pe.privateKey};default:throw new Error("unknown key type "+we)}}parseKeys$3.signature=asn1.signature;var parseAsn1=parseKeys$3;const require$$4={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"};var hasRequiredSign;function requireSign(){if(hasRequiredSign)return sign.exports;hasRequiredSign=1;var m=safeBuffer$2.exports.Buffer,c=browser$9,ne=browserifyRsa,we=requireElliptic().ec,Pe=bn$4.exports,Me=parseAsn1,Ze=require$$4,ie=1;function rr(Yr,Vr,Zr,Wr,si){var li=Me(Vr);if(li.curve){if(Wr!=="ecdsa"&&Wr!=="ecdsa/rsa")throw new Error("wrong private key type");return pr(Yr,li)}else if(li.type==="dsa"){if(Wr!=="dsa")throw new Error("wrong private key type");return or(Yr,li,Zr)}if(Wr!=="rsa"&&Wr!=="ecdsa/rsa")throw new Error("wrong private key type");if(Vr.padding!==void 0&&Vr.padding!==ie)throw new Error("illegal or unsupported padding mode");Yr=m.concat([si,Yr]);for(var yi=li.modulus.byteLength(),mi=[0,1];Yr.length+mi.length+1<yi;)mi.push(255);mi.push(0);for(var oi=-1;++oi<Yr.length;)mi.push(Yr[oi]);var ui=ne(mi,li);return ui}function pr(Yr,Vr){var Zr=Ze[Vr.curve.join(".")];if(!Zr)throw new Error("unknown curve "+Vr.curve.join("."));var Wr=new we(Zr),si=Wr.keyFromPrivate(Vr.privateKey),li=si.sign(Yr);return m.from(li.toDER())}function or(Yr,Vr,Zr){for(var Wr=Vr.params.priv_key,si=Vr.params.p,li=Vr.params.q,yi=Vr.params.g,mi=new Pe(0),oi,ui=Br(Yr,li).mod(li),gr=!1,Ae=Lr(Wr,li,Yr,Zr);gr===!1;)oi=Pr(li,Ae,Zr),mi=Nr(yi,oi,si,li),gr=oi.invm(li).imul(ui.add(Wr.mul(mi))).mod(li),gr.cmpn(0)===0&&(gr=!1,mi=new Pe(0));return _r(mi,gr)}function _r(Yr,Vr){Yr=Yr.toArray(),Vr=Vr.toArray(),Yr[0]&128&&(Yr=[0].concat(Yr)),Vr[0]&128&&(Vr=[0].concat(Vr));var Zr=Yr.length+Vr.length+4,Wr=[48,Zr,2,Yr.length];return Wr=Wr.concat(Yr,[2,Vr.length],Vr),m.from(Wr)}function Lr(Yr,Vr,Zr,Wr){if(Yr=m.from(Yr.toArray()),Yr.length<Vr.byteLength()){var si=m.alloc(Vr.byteLength()-Yr.length);Yr=m.concat([si,Yr])}var li=Zr.length,yi=Ar(Zr,Vr),mi=m.alloc(li);mi.fill(1);var oi=m.alloc(li);return oi=c(Wr,oi).update(mi).update(m.from([0])).update(Yr).update(yi).digest(),mi=c(Wr,oi).update(mi).digest(),oi=c(Wr,oi).update(mi).update(m.from([1])).update(Yr).update(yi).digest(),mi=c(Wr,oi).update(mi).digest(),{k:oi,v:mi}}function Br(Yr,Vr){var Zr=new Pe(Yr),Wr=(Yr.length<<3)-Vr.bitLength();return Wr>0&&Zr.ishrn(Wr),Zr}function Ar(Yr,Vr){Yr=Br(Yr,Vr),Yr=Yr.mod(Vr);var Zr=m.from(Yr.toArray());if(Zr.length<Vr.byteLength()){var Wr=m.alloc(Vr.byteLength()-Zr.length);Zr=m.concat([Wr,Zr])}return Zr}function Pr(Yr,Vr,Zr){var Wr,si;do{for(Wr=m.alloc(0);Wr.length*8<Yr.bitLength();)Vr.v=c(Zr,Vr.k).update(Vr.v).digest(),Wr=m.concat([Wr,Vr.v]);si=Br(Wr,Yr),Vr.k=c(Zr,Vr.k).update(Vr.v).update(m.from([0])).digest(),Vr.v=c(Zr,Vr.k).update(Vr.v).digest()}while(si.cmp(Yr)!==-1);return si}function Nr(Yr,Vr,Zr,Wr){return Yr.toRed(Pe.mont(Zr)).redPow(Vr).fromRed().mod(Wr)}return sign.exports=rr,sign.exports.getKey=Lr,sign.exports.makeKey=Pr,sign.exports}var verify_1,hasRequiredVerify;function requireVerify(){if(hasRequiredVerify)return verify_1;hasRequiredVerify=1;var m=safeBuffer$2.exports.Buffer,c=bn$4.exports,ne=requireElliptic().ec,we=parseAsn1,Pe=require$$4;function Me(pr,or,_r,Lr,Br){var Ar=we(_r);if(Ar.type==="ec"){if(Lr!=="ecdsa"&&Lr!=="ecdsa/rsa")throw new Error("wrong public key type");return Ze(pr,or,Ar)}else if(Ar.type==="dsa"){if(Lr!=="dsa")throw new Error("wrong public key type");return ie(pr,or,Ar)}if(Lr!=="rsa"&&Lr!=="ecdsa/rsa")throw new Error("wrong public key type");or=m.concat([Br,or]);for(var Pr=Ar.modulus.byteLength(),Nr=[1],Yr=0;or.length+Nr.length+2<Pr;)Nr.push(255),Yr+=1;Nr.push(0);for(var Vr=-1;++Vr<or.length;)Nr.push(or[Vr]);Nr=m.from(Nr);var Zr=c.mont(Ar.modulus);pr=new c(pr).toRed(Zr),pr=pr.redPow(new c(Ar.publicExponent)),pr=m.from(pr.fromRed().toArray());var Wr=Yr<8?1:0;for(Pr=Math.min(pr.length,Nr.length),pr.length!==Nr.length&&(Wr=1),Vr=-1;++Vr<Pr;)Wr|=pr[Vr]^Nr[Vr];return Wr===0}function Ze(pr,or,_r){var Lr=Pe[_r.data.algorithm.curve.join(".")];if(!Lr)throw new Error("unknown curve "+_r.data.algorithm.curve.join("."));var Br=new ne(Lr),Ar=_r.data.subjectPrivateKey.data;return Br.verify(or,pr,Ar)}function ie(pr,or,_r){var Lr=_r.data.p,Br=_r.data.q,Ar=_r.data.g,Pr=_r.data.pub_key,Nr=we.signature.decode(pr,"der"),Yr=Nr.s,Vr=Nr.r;rr(Yr,Br),rr(Vr,Br);var Zr=c.mont(Lr),Wr=Yr.invm(Br),si=Ar.toRed(Zr).redPow(new c(or).mul(Wr).mod(Br)).fromRed().mul(Pr.toRed(Zr).redPow(Vr.mul(Wr).mod(Br)).fromRed()).mod(Lr).mod(Br);return si.cmp(Vr)===0}function rr(pr,or){if(pr.cmpn(0)<=0)throw new Error("invalid sig");if(pr.cmp(or)>=0)throw new Error("invalid sig")}return verify_1=Me,verify_1}var browser$4,hasRequiredBrowser$1;function requireBrowser$1(){if(hasRequiredBrowser$1)return browser$4;hasRequiredBrowser$1=1;var m=safeBuffer$2.exports.Buffer,c=browser$a,ne=readableBrowser.exports,we=inherits_browser.exports,Pe=requireSign(),Me=requireVerify(),Ze=require$$6;Object.keys(Ze).forEach(function(_r){Ze[_r].id=m.from(Ze[_r].id,"hex"),Ze[_r.toLowerCase()]=Ze[_r]});function ie(_r){ne.Writable.call(this);var Lr=Ze[_r];if(!Lr)throw new Error("Unknown message digest");this._hashType=Lr.hash,this._hash=c(Lr.hash),this._tag=Lr.id,this._signType=Lr.sign}we(ie,ne.Writable),ie.prototype._write=function(Lr,Br,Ar){this._hash.update(Lr),Ar()},ie.prototype.update=function(Lr,Br){return this._hash.update(typeof Lr=="string"?m.from(Lr,Br):Lr),this},ie.prototype.sign=function(Lr,Br){this.end();var Ar=this._hash.digest(),Pr=Pe(Ar,Lr,this._hashType,this._signType,this._tag);return Br?Pr.toString(Br):Pr};function rr(_r){ne.Writable.call(this);var Lr=Ze[_r];if(!Lr)throw new Error("Unknown message digest");this._hash=c(Lr.hash),this._tag=Lr.id,this._signType=Lr.sign}we(rr,ne.Writable),rr.prototype._write=function(Lr,Br,Ar){this._hash.update(Lr),Ar()},rr.prototype.update=function(Lr,Br){return this._hash.update(typeof Lr=="string"?m.from(Lr,Br):Lr),this},rr.prototype.verify=function(Lr,Br,Ar){var Pr=typeof Br=="string"?m.from(Br,Ar):Br;this.end();var Nr=this._hash.digest();return Me(Pr,Nr,Lr,this._signType,this._tag)};function pr(_r){return new ie(_r)}function or(_r){return new rr(_r)}return browser$4={Sign:pr,Verify:or,createSign:pr,createVerify:or},browser$4}var bn$1={exports:{}};(function(m){(function(c,ne){function we(gr,Ae){if(!gr)throw new Error(Ae||"Assertion failed")}function Pe(gr,Ae){gr.super_=Ae;var ze=function(){};ze.prototype=Ae.prototype,gr.prototype=new ze,gr.prototype.constructor=gr}function Me(gr,Ae,ze){if(Me.isBN(gr))return gr;this.negative=0,this.words=null,this.length=0,this.red=null,gr!==null&&((Ae==="le"||Ae==="be")&&(ze=Ae,Ae=10),this._init(gr||0,Ae||10,ze||"be"))}typeof c=="object"?c.exports=Me:ne.BN=Me,Me.BN=Me,Me.wordSize=26;var Ze;try{typeof window<"u"&&typeof window.Buffer<"u"?Ze=window.Buffer:Ze=require$$0$4.Buffer}catch{}Me.isBN=function(Ae){return Ae instanceof Me?!0:Ae!==null&&typeof Ae=="object"&&Ae.constructor.wordSize===Me.wordSize&&Array.isArray(Ae.words)},Me.max=function(Ae,ze){return Ae.cmp(ze)>0?Ae:ze},Me.min=function(Ae,ze){return Ae.cmp(ze)<0?Ae:ze},Me.prototype._init=function(Ae,ze,Ue){if(typeof Ae=="number")return this._initNumber(Ae,ze,Ue);if(typeof Ae=="object")return this._initArray(Ae,ze,Ue);ze==="hex"&&(ze=16),we(ze===(ze|0)&&ze>=2&&ze<=36),Ae=Ae.toString().replace(/\s+/g,"");var tr=0;Ae[0]==="-"&&(tr++,this.negative=1),tr<Ae.length&&(ze===16?this._parseHex(Ae,tr,Ue):(this._parseBase(Ae,ze,tr),Ue==="le"&&this._initArray(this.toArray(),ze,Ue)))},Me.prototype._initNumber=function(Ae,ze,Ue){Ae<0&&(this.negative=1,Ae=-Ae),Ae<67108864?(this.words=[Ae&67108863],this.length=1):Ae<4503599627370496?(this.words=[Ae&67108863,Ae/67108864&67108863],this.length=2):(we(Ae<9007199254740992),this.words=[Ae&67108863,Ae/67108864&67108863,1],this.length=3),Ue==="le"&&this._initArray(this.toArray(),ze,Ue)},Me.prototype._initArray=function(Ae,ze,Ue){if(we(typeof Ae.length=="number"),Ae.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Ae.length/3),this.words=new Array(this.length);for(var tr=0;tr<this.length;tr++)this.words[tr]=0;var lr,vr,xr=0;if(Ue==="be")for(tr=Ae.length-1,lr=0;tr>=0;tr-=3)vr=Ae[tr]|Ae[tr-1]<<8|Ae[tr-2]<<16,this.words[lr]|=vr<<xr&67108863,this.words[lr+1]=vr>>>26-xr&67108863,xr+=24,xr>=26&&(xr-=26,lr++);else if(Ue==="le")for(tr=0,lr=0;tr<Ae.length;tr+=3)vr=Ae[tr]|Ae[tr+1]<<8|Ae[tr+2]<<16,this.words[lr]|=vr<<xr&67108863,this.words[lr+1]=vr>>>26-xr&67108863,xr+=24,xr>=26&&(xr-=26,lr++);return this.strip()};function ie(gr,Ae){var ze=gr.charCodeAt(Ae);return ze>=65&&ze<=70?ze-55:ze>=97&&ze<=102?ze-87:ze-48&15}function rr(gr,Ae,ze){var Ue=ie(gr,ze);return ze-1>=Ae&&(Ue|=ie(gr,ze-1)<<4),Ue}Me.prototype._parseHex=function(Ae,ze,Ue){this.length=Math.ceil((Ae.length-ze)/6),this.words=new Array(this.length);for(var tr=0;tr<this.length;tr++)this.words[tr]=0;var lr=0,vr=0,xr;if(Ue==="be")for(tr=Ae.length-1;tr>=ze;tr-=2)xr=rr(Ae,ze,tr)<<lr,this.words[vr]|=xr&67108863,lr>=18?(lr-=18,vr+=1,this.words[vr]|=xr>>>26):lr+=8;else{var nr=Ae.length-ze;for(tr=nr%2===0?ze+1:ze;tr<Ae.length;tr+=2)xr=rr(Ae,ze,tr)<<lr,this.words[vr]|=xr&67108863,lr>=18?(lr-=18,vr+=1,this.words[vr]|=xr>>>26):lr+=8}this.strip()};function pr(gr,Ae,ze,Ue){for(var tr=0,lr=Math.min(gr.length,ze),vr=Ae;vr<lr;vr++){var xr=gr.charCodeAt(vr)-48;tr*=Ue,xr>=49?tr+=xr-49+10:xr>=17?tr+=xr-17+10:tr+=xr}return tr}Me.prototype._parseBase=function(Ae,ze,Ue){this.words=[0],this.length=1;for(var tr=0,lr=1;lr<=67108863;lr*=ze)tr++;tr--,lr=lr/ze|0;for(var vr=Ae.length-Ue,xr=vr%tr,nr=Math.min(vr,vr-xr)+Ue,$e=0,ur=Ue;ur<nr;ur+=tr)$e=pr(Ae,ur,ur+tr,ze),this.imuln(lr),this.words[0]+$e<67108864?this.words[0]+=$e:this._iaddn($e);if(xr!==0){var $r=1;for($e=pr(Ae,ur,Ae.length,ze),ur=0;ur<xr;ur++)$r*=ze;this.imuln($r),this.words[0]+$e<67108864?this.words[0]+=$e:this._iaddn($e)}this.strip()},Me.prototype.copy=function(Ae){Ae.words=new Array(this.length);for(var ze=0;ze<this.length;ze++)Ae.words[ze]=this.words[ze];Ae.length=this.length,Ae.negative=this.negative,Ae.red=this.red},Me.prototype.clone=function(){var Ae=new Me(null);return this.copy(Ae),Ae},Me.prototype._expand=function(Ae){for(;this.length<Ae;)this.words[this.length++]=0;return this},Me.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},Me.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},Me.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var or=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],_r=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],Lr=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];Me.prototype.toString=function(Ae,ze){Ae=Ae||10,ze=ze|0||1;var Ue;if(Ae===16||Ae==="hex"){Ue="";for(var tr=0,lr=0,vr=0;vr<this.length;vr++){var xr=this.words[vr],nr=((xr<<tr|lr)&16777215).toString(16);lr=xr>>>24-tr&16777215,tr+=2,tr>=26&&(tr-=26,vr--),lr!==0||vr!==this.length-1?Ue=or[6-nr.length]+nr+Ue:Ue=nr+Ue}for(lr!==0&&(Ue=lr.toString(16)+Ue);Ue.length%ze!==0;)Ue="0"+Ue;return this.negative!==0&&(Ue="-"+Ue),Ue}if(Ae===(Ae|0)&&Ae>=2&&Ae<=36){var $e=_r[Ae],ur=Lr[Ae];Ue="";var $r=this.clone();for($r.negative=0;!$r.isZero();){var qr=$r.modn(ur).toString(Ae);$r=$r.idivn(ur),$r.isZero()?Ue=qr+Ue:Ue=or[$e-qr.length]+qr+Ue}for(this.isZero()&&(Ue="0"+Ue);Ue.length%ze!==0;)Ue="0"+Ue;return this.negative!==0&&(Ue="-"+Ue),Ue}we(!1,"Base should be between 2 and 36")},Me.prototype.toNumber=function(){var Ae=this.words[0];return this.length===2?Ae+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Ae+=4503599627370496+this.words[1]*67108864:this.length>2&&we(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Ae:Ae},Me.prototype.toJSON=function(){return this.toString(16)},Me.prototype.toBuffer=function(Ae,ze){return we(typeof Ze<"u"),this.toArrayLike(Ze,Ae,ze)},Me.prototype.toArray=function(Ae,ze){return this.toArrayLike(Array,Ae,ze)},Me.prototype.toArrayLike=function(Ae,ze,Ue){var tr=this.byteLength(),lr=Ue||Math.max(1,tr);we(tr<=lr,"byte array longer than desired length"),we(lr>0,"Requested array length <= 0"),this.strip();var vr=ze==="le",xr=new Ae(lr),nr,$e,ur=this.clone();if(vr){for($e=0;!ur.isZero();$e++)nr=ur.andln(255),ur.iushrn(8),xr[$e]=nr;for(;$e<lr;$e++)xr[$e]=0}else{for($e=0;$e<lr-tr;$e++)xr[$e]=0;for($e=0;!ur.isZero();$e++)nr=ur.andln(255),ur.iushrn(8),xr[lr-$e-1]=nr}return xr},Math.clz32?Me.prototype._countBits=function(Ae){return 32-Math.clz32(Ae)}:Me.prototype._countBits=function(Ae){var ze=Ae,Ue=0;return ze>=4096&&(Ue+=13,ze>>>=13),ze>=64&&(Ue+=7,ze>>>=7),ze>=8&&(Ue+=4,ze>>>=4),ze>=2&&(Ue+=2,ze>>>=2),Ue+ze},Me.prototype._zeroBits=function(Ae){if(Ae===0)return 26;var ze=Ae,Ue=0;return(ze&8191)===0&&(Ue+=13,ze>>>=13),(ze&127)===0&&(Ue+=7,ze>>>=7),(ze&15)===0&&(Ue+=4,ze>>>=4),(ze&3)===0&&(Ue+=2,ze>>>=2),(ze&1)===0&&Ue++,Ue},Me.prototype.bitLength=function(){var Ae=this.words[this.length-1],ze=this._countBits(Ae);return(this.length-1)*26+ze};function Br(gr){for(var Ae=new Array(gr.bitLength()),ze=0;ze<Ae.length;ze++){var Ue=ze/26|0,tr=ze%26;Ae[ze]=(gr.words[Ue]&1<<tr)>>>tr}return Ae}Me.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Ae=0,ze=0;ze<this.length;ze++){var Ue=this._zeroBits(this.words[ze]);if(Ae+=Ue,Ue!==26)break}return Ae},Me.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Me.prototype.toTwos=function(Ae){return this.negative!==0?this.abs().inotn(Ae).iaddn(1):this.clone()},Me.prototype.fromTwos=function(Ae){return this.testn(Ae-1)?this.notn(Ae).iaddn(1).ineg():this.clone()},Me.prototype.isNeg=function(){return this.negative!==0},Me.prototype.neg=function(){return this.clone().ineg()},Me.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},Me.prototype.iuor=function(Ae){for(;this.length<Ae.length;)this.words[this.length++]=0;for(var ze=0;ze<Ae.length;ze++)this.words[ze]=this.words[ze]|Ae.words[ze];return this.strip()},Me.prototype.ior=function(Ae){return we((this.negative|Ae.negative)===0),this.iuor(Ae)},Me.prototype.or=function(Ae){return this.length>Ae.length?this.clone().ior(Ae):Ae.clone().ior(this)},Me.prototype.uor=function(Ae){return this.length>Ae.length?this.clone().iuor(Ae):Ae.clone().iuor(this)},Me.prototype.iuand=function(Ae){var ze;this.length>Ae.length?ze=Ae:ze=this;for(var Ue=0;Ue<ze.length;Ue++)this.words[Ue]=this.words[Ue]&Ae.words[Ue];return this.length=ze.length,this.strip()},Me.prototype.iand=function(Ae){return we((this.negative|Ae.negative)===0),this.iuand(Ae)},Me.prototype.and=function(Ae){return this.length>Ae.length?this.clone().iand(Ae):Ae.clone().iand(this)},Me.prototype.uand=function(Ae){return this.length>Ae.length?this.clone().iuand(Ae):Ae.clone().iuand(this)},Me.prototype.iuxor=function(Ae){var ze,Ue;this.length>Ae.length?(ze=this,Ue=Ae):(ze=Ae,Ue=this);for(var tr=0;tr<Ue.length;tr++)this.words[tr]=ze.words[tr]^Ue.words[tr];if(this!==ze)for(;tr<ze.length;tr++)this.words[tr]=ze.words[tr];return this.length=ze.length,this.strip()},Me.prototype.ixor=function(Ae){return we((this.negative|Ae.negative)===0),this.iuxor(Ae)},Me.prototype.xor=function(Ae){return this.length>Ae.length?this.clone().ixor(Ae):Ae.clone().ixor(this)},Me.prototype.uxor=function(Ae){return this.length>Ae.length?this.clone().iuxor(Ae):Ae.clone().iuxor(this)},Me.prototype.inotn=function(Ae){we(typeof Ae=="number"&&Ae>=0);var ze=Math.ceil(Ae/26)|0,Ue=Ae%26;this._expand(ze),Ue>0&&ze--;for(var tr=0;tr<ze;tr++)this.words[tr]=~this.words[tr]&67108863;return Ue>0&&(this.words[tr]=~this.words[tr]&67108863>>26-Ue),this.strip()},Me.prototype.notn=function(Ae){return this.clone().inotn(Ae)},Me.prototype.setn=function(Ae,ze){we(typeof Ae=="number"&&Ae>=0);var Ue=Ae/26|0,tr=Ae%26;return this._expand(Ue+1),ze?this.words[Ue]=this.words[Ue]|1<<tr:this.words[Ue]=this.words[Ue]&~(1<<tr),this.strip()},Me.prototype.iadd=function(Ae){var ze;if(this.negative!==0&&Ae.negative===0)return this.negative=0,ze=this.isub(Ae),this.negative^=1,this._normSign();if(this.negative===0&&Ae.negative!==0)return Ae.negative=0,ze=this.isub(Ae),Ae.negative=1,ze._normSign();var Ue,tr;this.length>Ae.length?(Ue=this,tr=Ae):(Ue=Ae,tr=this);for(var lr=0,vr=0;vr<tr.length;vr++)ze=(Ue.words[vr]|0)+(tr.words[vr]|0)+lr,this.words[vr]=ze&67108863,lr=ze>>>26;for(;lr!==0&&vr<Ue.length;vr++)ze=(Ue.words[vr]|0)+lr,this.words[vr]=ze&67108863,lr=ze>>>26;if(this.length=Ue.length,lr!==0)this.words[this.length]=lr,this.length++;else if(Ue!==this)for(;vr<Ue.length;vr++)this.words[vr]=Ue.words[vr];return this},Me.prototype.add=function(Ae){var ze;return Ae.negative!==0&&this.negative===0?(Ae.negative=0,ze=this.sub(Ae),Ae.negative^=1,ze):Ae.negative===0&&this.negative!==0?(this.negative=0,ze=Ae.sub(this),this.negative=1,ze):this.length>Ae.length?this.clone().iadd(Ae):Ae.clone().iadd(this)},Me.prototype.isub=function(Ae){if(Ae.negative!==0){Ae.negative=0;var ze=this.iadd(Ae);return Ae.negative=1,ze._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Ae),this.negative=1,this._normSign();var Ue=this.cmp(Ae);if(Ue===0)return this.negative=0,this.length=1,this.words[0]=0,this;var tr,lr;Ue>0?(tr=this,lr=Ae):(tr=Ae,lr=this);for(var vr=0,xr=0;xr<lr.length;xr++)ze=(tr.words[xr]|0)-(lr.words[xr]|0)+vr,vr=ze>>26,this.words[xr]=ze&67108863;for(;vr!==0&&xr<tr.length;xr++)ze=(tr.words[xr]|0)+vr,vr=ze>>26,this.words[xr]=ze&67108863;if(vr===0&&xr<tr.length&&tr!==this)for(;xr<tr.length;xr++)this.words[xr]=tr.words[xr];return this.length=Math.max(this.length,xr),tr!==this&&(this.negative=1),this.strip()},Me.prototype.sub=function(Ae){return this.clone().isub(Ae)};function Ar(gr,Ae,ze){ze.negative=Ae.negative^gr.negative;var Ue=gr.length+Ae.length|0;ze.length=Ue,Ue=Ue-1|0;var tr=gr.words[0]|0,lr=Ae.words[0]|0,vr=tr*lr,xr=vr&67108863,nr=vr/67108864|0;ze.words[0]=xr;for(var $e=1;$e<Ue;$e++){for(var ur=nr>>>26,$r=nr&67108863,qr=Math.min($e,Ae.length-1),ci=Math.max(0,$e-gr.length+1);ci<=qr;ci++){var Ai=$e-ci|0;tr=gr.words[Ai]|0,lr=Ae.words[ci]|0,vr=tr*lr+$r,ur+=vr/67108864|0,$r=vr&67108863}ze.words[$e]=$r|0,nr=ur|0}return nr!==0?ze.words[$e]=nr|0:ze.length--,ze.strip()}var Pr=function(Ae,ze,Ue){var tr=Ae.words,lr=ze.words,vr=Ue.words,xr=0,nr,$e,ur,$r=tr[0]|0,qr=$r&8191,ci=$r>>>13,Ai=tr[1]|0,Ci=Ai&8191,ii=Ai>>>13,wi=tr[2]|0,ri=wi&8191,Xr=wi>>>13,bi=tr[3]|0,di=bi&8191,Fi=bi>>>13,Gi=tr[4]|0,gn=Gi&8191,dn=Gi>>>13,In=tr[5]|0,rn=In&8191,qi=In>>>13,jn=tr[6]|0,kn=jn&8191,On=jn>>>13,Po=tr[7]|0,xn=Po&8191,Dn=Po>>>13,qo=tr[8]|0,Zn=qo&8191,Kn=qo>>>13,oa=tr[9]|0,Ti=oa&8191,ti=oa>>>13,vi=lr[0]|0,xi=vi&8191,Bi=vi>>>13,wn=lr[1]|0,ln=wn&8191,Vn=wn>>>13,ho=lr[2]|0,Fn=ho&8191,Xn=ho>>>13,$o=lr[3]|0,to=$o&8191,lo=$o>>>13,Ra=lr[4]|0,ro=Ra&8191,co=Ra>>>13,An=lr[5]|0,ai=An&8191,gi=An>>>13,Di=lr[6]|0,ki=Di&8191,Li=Di>>>13,an=lr[7]|0,ji=an&8191,Ui=an>>>13,Mn=lr[8]|0,Wi=Mn&8191,en=Mn>>>13,qn=lr[9]|0,vn=qn&8191,Cn=qn>>>13;Ue.negative=Ae.negative^ze.negative,Ue.length=19,nr=Math.imul(qr,xi),$e=Math.imul(qr,Bi),$e=$e+Math.imul(ci,xi)|0,ur=Math.imul(ci,Bi);var xo=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(xo>>>26)|0,xo&=67108863,nr=Math.imul(Ci,xi),$e=Math.imul(Ci,Bi),$e=$e+Math.imul(ii,xi)|0,ur=Math.imul(ii,Bi),nr=nr+Math.imul(qr,ln)|0,$e=$e+Math.imul(qr,Vn)|0,$e=$e+Math.imul(ci,ln)|0,ur=ur+Math.imul(ci,Vn)|0;var Co=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Co>>>26)|0,Co&=67108863,nr=Math.imul(ri,xi),$e=Math.imul(ri,Bi),$e=$e+Math.imul(Xr,xi)|0,ur=Math.imul(Xr,Bi),nr=nr+Math.imul(Ci,ln)|0,$e=$e+Math.imul(Ci,Vn)|0,$e=$e+Math.imul(ii,ln)|0,ur=ur+Math.imul(ii,Vn)|0,nr=nr+Math.imul(qr,Fn)|0,$e=$e+Math.imul(qr,Xn)|0,$e=$e+Math.imul(ci,Fn)|0,ur=ur+Math.imul(ci,Xn)|0;var Io=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Io>>>26)|0,Io&=67108863,nr=Math.imul(di,xi),$e=Math.imul(di,Bi),$e=$e+Math.imul(Fi,xi)|0,ur=Math.imul(Fi,Bi),nr=nr+Math.imul(ri,ln)|0,$e=$e+Math.imul(ri,Vn)|0,$e=$e+Math.imul(Xr,ln)|0,ur=ur+Math.imul(Xr,Vn)|0,nr=nr+Math.imul(Ci,Fn)|0,$e=$e+Math.imul(Ci,Xn)|0,$e=$e+Math.imul(ii,Fn)|0,ur=ur+Math.imul(ii,Xn)|0,nr=nr+Math.imul(qr,to)|0,$e=$e+Math.imul(qr,lo)|0,$e=$e+Math.imul(ci,to)|0,ur=ur+Math.imul(ci,lo)|0;var Bo=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,nr=Math.imul(gn,xi),$e=Math.imul(gn,Bi),$e=$e+Math.imul(dn,xi)|0,ur=Math.imul(dn,Bi),nr=nr+Math.imul(di,ln)|0,$e=$e+Math.imul(di,Vn)|0,$e=$e+Math.imul(Fi,ln)|0,ur=ur+Math.imul(Fi,Vn)|0,nr=nr+Math.imul(ri,Fn)|0,$e=$e+Math.imul(ri,Xn)|0,$e=$e+Math.imul(Xr,Fn)|0,ur=ur+Math.imul(Xr,Xn)|0,nr=nr+Math.imul(Ci,to)|0,$e=$e+Math.imul(Ci,lo)|0,$e=$e+Math.imul(ii,to)|0,ur=ur+Math.imul(ii,lo)|0,nr=nr+Math.imul(qr,ro)|0,$e=$e+Math.imul(qr,co)|0,$e=$e+Math.imul(ci,ro)|0,ur=ur+Math.imul(ci,co)|0;var Jo=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,nr=Math.imul(rn,xi),$e=Math.imul(rn,Bi),$e=$e+Math.imul(qi,xi)|0,ur=Math.imul(qi,Bi),nr=nr+Math.imul(gn,ln)|0,$e=$e+Math.imul(gn,Vn)|0,$e=$e+Math.imul(dn,ln)|0,ur=ur+Math.imul(dn,Vn)|0,nr=nr+Math.imul(di,Fn)|0,$e=$e+Math.imul(di,Xn)|0,$e=$e+Math.imul(Fi,Fn)|0,ur=ur+Math.imul(Fi,Xn)|0,nr=nr+Math.imul(ri,to)|0,$e=$e+Math.imul(ri,lo)|0,$e=$e+Math.imul(Xr,to)|0,ur=ur+Math.imul(Xr,lo)|0,nr=nr+Math.imul(Ci,ro)|0,$e=$e+Math.imul(Ci,co)|0,$e=$e+Math.imul(ii,ro)|0,ur=ur+Math.imul(ii,co)|0,nr=nr+Math.imul(qr,ai)|0,$e=$e+Math.imul(qr,gi)|0,$e=$e+Math.imul(ci,ai)|0,ur=ur+Math.imul(ci,gi)|0;var Ho=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,nr=Math.imul(kn,xi),$e=Math.imul(kn,Bi),$e=$e+Math.imul(On,xi)|0,ur=Math.imul(On,Bi),nr=nr+Math.imul(rn,ln)|0,$e=$e+Math.imul(rn,Vn)|0,$e=$e+Math.imul(qi,ln)|0,ur=ur+Math.imul(qi,Vn)|0,nr=nr+Math.imul(gn,Fn)|0,$e=$e+Math.imul(gn,Xn)|0,$e=$e+Math.imul(dn,Fn)|0,ur=ur+Math.imul(dn,Xn)|0,nr=nr+Math.imul(di,to)|0,$e=$e+Math.imul(di,lo)|0,$e=$e+Math.imul(Fi,to)|0,ur=ur+Math.imul(Fi,lo)|0,nr=nr+Math.imul(ri,ro)|0,$e=$e+Math.imul(ri,co)|0,$e=$e+Math.imul(Xr,ro)|0,ur=ur+Math.imul(Xr,co)|0,nr=nr+Math.imul(Ci,ai)|0,$e=$e+Math.imul(Ci,gi)|0,$e=$e+Math.imul(ii,ai)|0,ur=ur+Math.imul(ii,gi)|0,nr=nr+Math.imul(qr,ki)|0,$e=$e+Math.imul(qr,Li)|0,$e=$e+Math.imul(ci,ki)|0,ur=ur+Math.imul(ci,Li)|0;var No=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(No>>>26)|0,No&=67108863,nr=Math.imul(xn,xi),$e=Math.imul(xn,Bi),$e=$e+Math.imul(Dn,xi)|0,ur=Math.imul(Dn,Bi),nr=nr+Math.imul(kn,ln)|0,$e=$e+Math.imul(kn,Vn)|0,$e=$e+Math.imul(On,ln)|0,ur=ur+Math.imul(On,Vn)|0,nr=nr+Math.imul(rn,Fn)|0,$e=$e+Math.imul(rn,Xn)|0,$e=$e+Math.imul(qi,Fn)|0,ur=ur+Math.imul(qi,Xn)|0,nr=nr+Math.imul(gn,to)|0,$e=$e+Math.imul(gn,lo)|0,$e=$e+Math.imul(dn,to)|0,ur=ur+Math.imul(dn,lo)|0,nr=nr+Math.imul(di,ro)|0,$e=$e+Math.imul(di,co)|0,$e=$e+Math.imul(Fi,ro)|0,ur=ur+Math.imul(Fi,co)|0,nr=nr+Math.imul(ri,ai)|0,$e=$e+Math.imul(ri,gi)|0,$e=$e+Math.imul(Xr,ai)|0,ur=ur+Math.imul(Xr,gi)|0,nr=nr+Math.imul(Ci,ki)|0,$e=$e+Math.imul(Ci,Li)|0,$e=$e+Math.imul(ii,ki)|0,ur=ur+Math.imul(ii,Li)|0,nr=nr+Math.imul(qr,ji)|0,$e=$e+Math.imul(qr,Ui)|0,$e=$e+Math.imul(ci,ji)|0,ur=ur+Math.imul(ci,Ui)|0;var Zo=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,nr=Math.imul(Zn,xi),$e=Math.imul(Zn,Bi),$e=$e+Math.imul(Kn,xi)|0,ur=Math.imul(Kn,Bi),nr=nr+Math.imul(xn,ln)|0,$e=$e+Math.imul(xn,Vn)|0,$e=$e+Math.imul(Dn,ln)|0,ur=ur+Math.imul(Dn,Vn)|0,nr=nr+Math.imul(kn,Fn)|0,$e=$e+Math.imul(kn,Xn)|0,$e=$e+Math.imul(On,Fn)|0,ur=ur+Math.imul(On,Xn)|0,nr=nr+Math.imul(rn,to)|0,$e=$e+Math.imul(rn,lo)|0,$e=$e+Math.imul(qi,to)|0,ur=ur+Math.imul(qi,lo)|0,nr=nr+Math.imul(gn,ro)|0,$e=$e+Math.imul(gn,co)|0,$e=$e+Math.imul(dn,ro)|0,ur=ur+Math.imul(dn,co)|0,nr=nr+Math.imul(di,ai)|0,$e=$e+Math.imul(di,gi)|0,$e=$e+Math.imul(Fi,ai)|0,ur=ur+Math.imul(Fi,gi)|0,nr=nr+Math.imul(ri,ki)|0,$e=$e+Math.imul(ri,Li)|0,$e=$e+Math.imul(Xr,ki)|0,ur=ur+Math.imul(Xr,Li)|0,nr=nr+Math.imul(Ci,ji)|0,$e=$e+Math.imul(Ci,Ui)|0,$e=$e+Math.imul(ii,ji)|0,ur=ur+Math.imul(ii,Ui)|0,nr=nr+Math.imul(qr,Wi)|0,$e=$e+Math.imul(qr,en)|0,$e=$e+Math.imul(ci,Wi)|0,ur=ur+Math.imul(ci,en)|0;var Qo=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Qo>>>26)|0,Qo&=67108863,nr=Math.imul(Ti,xi),$e=Math.imul(Ti,Bi),$e=$e+Math.imul(ti,xi)|0,ur=Math.imul(ti,Bi),nr=nr+Math.imul(Zn,ln)|0,$e=$e+Math.imul(Zn,Vn)|0,$e=$e+Math.imul(Kn,ln)|0,ur=ur+Math.imul(Kn,Vn)|0,nr=nr+Math.imul(xn,Fn)|0,$e=$e+Math.imul(xn,Xn)|0,$e=$e+Math.imul(Dn,Fn)|0,ur=ur+Math.imul(Dn,Xn)|0,nr=nr+Math.imul(kn,to)|0,$e=$e+Math.imul(kn,lo)|0,$e=$e+Math.imul(On,to)|0,ur=ur+Math.imul(On,lo)|0,nr=nr+Math.imul(rn,ro)|0,$e=$e+Math.imul(rn,co)|0,$e=$e+Math.imul(qi,ro)|0,ur=ur+Math.imul(qi,co)|0,nr=nr+Math.imul(gn,ai)|0,$e=$e+Math.imul(gn,gi)|0,$e=$e+Math.imul(dn,ai)|0,ur=ur+Math.imul(dn,gi)|0,nr=nr+Math.imul(di,ki)|0,$e=$e+Math.imul(di,Li)|0,$e=$e+Math.imul(Fi,ki)|0,ur=ur+Math.imul(Fi,Li)|0,nr=nr+Math.imul(ri,ji)|0,$e=$e+Math.imul(ri,Ui)|0,$e=$e+Math.imul(Xr,ji)|0,ur=ur+Math.imul(Xr,Ui)|0,nr=nr+Math.imul(Ci,Wi)|0,$e=$e+Math.imul(Ci,en)|0,$e=$e+Math.imul(ii,Wi)|0,ur=ur+Math.imul(ii,en)|0,nr=nr+Math.imul(qr,vn)|0,$e=$e+Math.imul(qr,Cn)|0,$e=$e+Math.imul(ci,vn)|0,ur=ur+Math.imul(ci,Cn)|0;var da=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(da>>>26)|0,da&=67108863,nr=Math.imul(Ti,ln),$e=Math.imul(Ti,Vn),$e=$e+Math.imul(ti,ln)|0,ur=Math.imul(ti,Vn),nr=nr+Math.imul(Zn,Fn)|0,$e=$e+Math.imul(Zn,Xn)|0,$e=$e+Math.imul(Kn,Fn)|0,ur=ur+Math.imul(Kn,Xn)|0,nr=nr+Math.imul(xn,to)|0,$e=$e+Math.imul(xn,lo)|0,$e=$e+Math.imul(Dn,to)|0,ur=ur+Math.imul(Dn,lo)|0,nr=nr+Math.imul(kn,ro)|0,$e=$e+Math.imul(kn,co)|0,$e=$e+Math.imul(On,ro)|0,ur=ur+Math.imul(On,co)|0,nr=nr+Math.imul(rn,ai)|0,$e=$e+Math.imul(rn,gi)|0,$e=$e+Math.imul(qi,ai)|0,ur=ur+Math.imul(qi,gi)|0,nr=nr+Math.imul(gn,ki)|0,$e=$e+Math.imul(gn,Li)|0,$e=$e+Math.imul(dn,ki)|0,ur=ur+Math.imul(dn,Li)|0,nr=nr+Math.imul(di,ji)|0,$e=$e+Math.imul(di,Ui)|0,$e=$e+Math.imul(Fi,ji)|0,ur=ur+Math.imul(Fi,Ui)|0,nr=nr+Math.imul(ri,Wi)|0,$e=$e+Math.imul(ri,en)|0,$e=$e+Math.imul(Xr,Wi)|0,ur=ur+Math.imul(Xr,en)|0,nr=nr+Math.imul(Ci,vn)|0,$e=$e+Math.imul(Ci,Cn)|0,$e=$e+Math.imul(ii,vn)|0,ur=ur+Math.imul(ii,Cn)|0;var Pa=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Pa>>>26)|0,Pa&=67108863,nr=Math.imul(Ti,Fn),$e=Math.imul(Ti,Xn),$e=$e+Math.imul(ti,Fn)|0,ur=Math.imul(ti,Xn),nr=nr+Math.imul(Zn,to)|0,$e=$e+Math.imul(Zn,lo)|0,$e=$e+Math.imul(Kn,to)|0,ur=ur+Math.imul(Kn,lo)|0,nr=nr+Math.imul(xn,ro)|0,$e=$e+Math.imul(xn,co)|0,$e=$e+Math.imul(Dn,ro)|0,ur=ur+Math.imul(Dn,co)|0,nr=nr+Math.imul(kn,ai)|0,$e=$e+Math.imul(kn,gi)|0,$e=$e+Math.imul(On,ai)|0,ur=ur+Math.imul(On,gi)|0,nr=nr+Math.imul(rn,ki)|0,$e=$e+Math.imul(rn,Li)|0,$e=$e+Math.imul(qi,ki)|0,ur=ur+Math.imul(qi,Li)|0,nr=nr+Math.imul(gn,ji)|0,$e=$e+Math.imul(gn,Ui)|0,$e=$e+Math.imul(dn,ji)|0,ur=ur+Math.imul(dn,Ui)|0,nr=nr+Math.imul(di,Wi)|0,$e=$e+Math.imul(di,en)|0,$e=$e+Math.imul(Fi,Wi)|0,ur=ur+Math.imul(Fi,en)|0,nr=nr+Math.imul(ri,vn)|0,$e=$e+Math.imul(ri,Cn)|0,$e=$e+Math.imul(Xr,vn)|0,ur=ur+Math.imul(Xr,Cn)|0;var ya=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(ya>>>26)|0,ya&=67108863,nr=Math.imul(Ti,to),$e=Math.imul(Ti,lo),$e=$e+Math.imul(ti,to)|0,ur=Math.imul(ti,lo),nr=nr+Math.imul(Zn,ro)|0,$e=$e+Math.imul(Zn,co)|0,$e=$e+Math.imul(Kn,ro)|0,ur=ur+Math.imul(Kn,co)|0,nr=nr+Math.imul(xn,ai)|0,$e=$e+Math.imul(xn,gi)|0,$e=$e+Math.imul(Dn,ai)|0,ur=ur+Math.imul(Dn,gi)|0,nr=nr+Math.imul(kn,ki)|0,$e=$e+Math.imul(kn,Li)|0,$e=$e+Math.imul(On,ki)|0,ur=ur+Math.imul(On,Li)|0,nr=nr+Math.imul(rn,ji)|0,$e=$e+Math.imul(rn,Ui)|0,$e=$e+Math.imul(qi,ji)|0,ur=ur+Math.imul(qi,Ui)|0,nr=nr+Math.imul(gn,Wi)|0,$e=$e+Math.imul(gn,en)|0,$e=$e+Math.imul(dn,Wi)|0,ur=ur+Math.imul(dn,en)|0,nr=nr+Math.imul(di,vn)|0,$e=$e+Math.imul(di,Cn)|0,$e=$e+Math.imul(Fi,vn)|0,ur=ur+Math.imul(Fi,Cn)|0;var Sa=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Sa>>>26)|0,Sa&=67108863,nr=Math.imul(Ti,ro),$e=Math.imul(Ti,co),$e=$e+Math.imul(ti,ro)|0,ur=Math.imul(ti,co),nr=nr+Math.imul(Zn,ai)|0,$e=$e+Math.imul(Zn,gi)|0,$e=$e+Math.imul(Kn,ai)|0,ur=ur+Math.imul(Kn,gi)|0,nr=nr+Math.imul(xn,ki)|0,$e=$e+Math.imul(xn,Li)|0,$e=$e+Math.imul(Dn,ki)|0,ur=ur+Math.imul(Dn,Li)|0,nr=nr+Math.imul(kn,ji)|0,$e=$e+Math.imul(kn,Ui)|0,$e=$e+Math.imul(On,ji)|0,ur=ur+Math.imul(On,Ui)|0,nr=nr+Math.imul(rn,Wi)|0,$e=$e+Math.imul(rn,en)|0,$e=$e+Math.imul(qi,Wi)|0,ur=ur+Math.imul(qi,en)|0,nr=nr+Math.imul(gn,vn)|0,$e=$e+Math.imul(gn,Cn)|0,$e=$e+Math.imul(dn,vn)|0,ur=ur+Math.imul(dn,Cn)|0;var Ha=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,nr=Math.imul(Ti,ai),$e=Math.imul(Ti,gi),$e=$e+Math.imul(ti,ai)|0,ur=Math.imul(ti,gi),nr=nr+Math.imul(Zn,ki)|0,$e=$e+Math.imul(Zn,Li)|0,$e=$e+Math.imul(Kn,ki)|0,ur=ur+Math.imul(Kn,Li)|0,nr=nr+Math.imul(xn,ji)|0,$e=$e+Math.imul(xn,Ui)|0,$e=$e+Math.imul(Dn,ji)|0,ur=ur+Math.imul(Dn,Ui)|0,nr=nr+Math.imul(kn,Wi)|0,$e=$e+Math.imul(kn,en)|0,$e=$e+Math.imul(On,Wi)|0,ur=ur+Math.imul(On,en)|0,nr=nr+Math.imul(rn,vn)|0,$e=$e+Math.imul(rn,Cn)|0,$e=$e+Math.imul(qi,vn)|0,ur=ur+Math.imul(qi,Cn)|0;var Fa=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,nr=Math.imul(Ti,ki),$e=Math.imul(Ti,Li),$e=$e+Math.imul(ti,ki)|0,ur=Math.imul(ti,Li),nr=nr+Math.imul(Zn,ji)|0,$e=$e+Math.imul(Zn,Ui)|0,$e=$e+Math.imul(Kn,ji)|0,ur=ur+Math.imul(Kn,Ui)|0,nr=nr+Math.imul(xn,Wi)|0,$e=$e+Math.imul(xn,en)|0,$e=$e+Math.imul(Dn,Wi)|0,ur=ur+Math.imul(Dn,en)|0,nr=nr+Math.imul(kn,vn)|0,$e=$e+Math.imul(kn,Cn)|0,$e=$e+Math.imul(On,vn)|0,ur=ur+Math.imul(On,Cn)|0;var ls=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(ls>>>26)|0,ls&=67108863,nr=Math.imul(Ti,ji),$e=Math.imul(Ti,Ui),$e=$e+Math.imul(ti,ji)|0,ur=Math.imul(ti,Ui),nr=nr+Math.imul(Zn,Wi)|0,$e=$e+Math.imul(Zn,en)|0,$e=$e+Math.imul(Kn,Wi)|0,ur=ur+Math.imul(Kn,en)|0,nr=nr+Math.imul(xn,vn)|0,$e=$e+Math.imul(xn,Cn)|0,$e=$e+Math.imul(Dn,vn)|0,ur=ur+Math.imul(Dn,Cn)|0;var us=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(us>>>26)|0,us&=67108863,nr=Math.imul(Ti,Wi),$e=Math.imul(Ti,en),$e=$e+Math.imul(ti,Wi)|0,ur=Math.imul(ti,en),nr=nr+Math.imul(Zn,vn)|0,$e=$e+Math.imul(Zn,Cn)|0,$e=$e+Math.imul(Kn,vn)|0,ur=ur+Math.imul(Kn,Cn)|0;var Xa=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Xa>>>26)|0,Xa&=67108863,nr=Math.imul(Ti,vn),$e=Math.imul(Ti,Cn),$e=$e+Math.imul(ti,vn)|0,ur=Math.imul(ti,Cn);var hs=(xr+nr|0)+(($e&8191)<<13)|0;return xr=(ur+($e>>>13)|0)+(hs>>>26)|0,hs&=67108863,vr[0]=xo,vr[1]=Co,vr[2]=Io,vr[3]=Bo,vr[4]=Jo,vr[5]=Ho,vr[6]=No,vr[7]=Zo,vr[8]=Qo,vr[9]=da,vr[10]=Pa,vr[11]=ya,vr[12]=Sa,vr[13]=Ha,vr[14]=Fa,vr[15]=ls,vr[16]=us,vr[17]=Xa,vr[18]=hs,xr!==0&&(vr[19]=xr,Ue.length++),Ue};Math.imul||(Pr=Ar);function Nr(gr,Ae,ze){ze.negative=Ae.negative^gr.negative,ze.length=gr.length+Ae.length;for(var Ue=0,tr=0,lr=0;lr<ze.length-1;lr++){var vr=tr;tr=0;for(var xr=Ue&67108863,nr=Math.min(lr,Ae.length-1),$e=Math.max(0,lr-gr.length+1);$e<=nr;$e++){var ur=lr-$e,$r=gr.words[ur]|0,qr=Ae.words[$e]|0,ci=$r*qr,Ai=ci&67108863;vr=vr+(ci/67108864|0)|0,Ai=Ai+xr|0,xr=Ai&67108863,vr=vr+(Ai>>>26)|0,tr+=vr>>>26,vr&=67108863}ze.words[lr]=xr,Ue=vr,vr=tr}return Ue!==0?ze.words[lr]=Ue:ze.length--,ze.strip()}function Yr(gr,Ae,ze){var Ue=new Vr;return Ue.mulp(gr,Ae,ze)}Me.prototype.mulTo=function(Ae,ze){var Ue,tr=this.length+Ae.length;return this.length===10&&Ae.length===10?Ue=Pr(this,Ae,ze):tr<63?Ue=Ar(this,Ae,ze):tr<1024?Ue=Nr(this,Ae,ze):Ue=Yr(this,Ae,ze),Ue};function Vr(gr,Ae){this.x=gr,this.y=Ae}Vr.prototype.makeRBT=function(Ae){for(var ze=new Array(Ae),Ue=Me.prototype._countBits(Ae)-1,tr=0;tr<Ae;tr++)ze[tr]=this.revBin(tr,Ue,Ae);return ze},Vr.prototype.revBin=function(Ae,ze,Ue){if(Ae===0||Ae===Ue-1)return Ae;for(var tr=0,lr=0;lr<ze;lr++)tr|=(Ae&1)<<ze-lr-1,Ae>>=1;return tr},Vr.prototype.permute=function(Ae,ze,Ue,tr,lr,vr){for(var xr=0;xr<vr;xr++)tr[xr]=ze[Ae[xr]],lr[xr]=Ue[Ae[xr]]},Vr.prototype.transform=function(Ae,ze,Ue,tr,lr,vr){this.permute(vr,Ae,ze,Ue,tr,lr);for(var xr=1;xr<lr;xr<<=1)for(var nr=xr<<1,$e=Math.cos(2*Math.PI/nr),ur=Math.sin(2*Math.PI/nr),$r=0;$r<lr;$r+=nr)for(var qr=$e,ci=ur,Ai=0;Ai<xr;Ai++){var Ci=Ue[$r+Ai],ii=tr[$r+Ai],wi=Ue[$r+Ai+xr],ri=tr[$r+Ai+xr],Xr=qr*wi-ci*ri;ri=qr*ri+ci*wi,wi=Xr,Ue[$r+Ai]=Ci+wi,tr[$r+Ai]=ii+ri,Ue[$r+Ai+xr]=Ci-wi,tr[$r+Ai+xr]=ii-ri,Ai!==nr&&(Xr=$e*qr-ur*ci,ci=$e*ci+ur*qr,qr=Xr)}},Vr.prototype.guessLen13b=function(Ae,ze){var Ue=Math.max(ze,Ae)|1,tr=Ue&1,lr=0;for(Ue=Ue/2|0;Ue;Ue=Ue>>>1)lr++;return 1<<lr+1+tr},Vr.prototype.conjugate=function(Ae,ze,Ue){if(!(Ue<=1))for(var tr=0;tr<Ue/2;tr++){var lr=Ae[tr];Ae[tr]=Ae[Ue-tr-1],Ae[Ue-tr-1]=lr,lr=ze[tr],ze[tr]=-ze[Ue-tr-1],ze[Ue-tr-1]=-lr}},Vr.prototype.normalize13b=function(Ae,ze){for(var Ue=0,tr=0;tr<ze/2;tr++){var lr=Math.round(Ae[2*tr+1]/ze)*8192+Math.round(Ae[2*tr]/ze)+Ue;Ae[tr]=lr&67108863,lr<67108864?Ue=0:Ue=lr/67108864|0}return Ae},Vr.prototype.convert13b=function(Ae,ze,Ue,tr){for(var lr=0,vr=0;vr<ze;vr++)lr=lr+(Ae[vr]|0),Ue[2*vr]=lr&8191,lr=lr>>>13,Ue[2*vr+1]=lr&8191,lr=lr>>>13;for(vr=2*ze;vr<tr;++vr)Ue[vr]=0;we(lr===0),we((lr&-8192)===0)},Vr.prototype.stub=function(Ae){for(var ze=new Array(Ae),Ue=0;Ue<Ae;Ue++)ze[Ue]=0;return ze},Vr.prototype.mulp=function(Ae,ze,Ue){var tr=2*this.guessLen13b(Ae.length,ze.length),lr=this.makeRBT(tr),vr=this.stub(tr),xr=new Array(tr),nr=new Array(tr),$e=new Array(tr),ur=new Array(tr),$r=new Array(tr),qr=new Array(tr),ci=Ue.words;ci.length=tr,this.convert13b(Ae.words,Ae.length,xr,tr),this.convert13b(ze.words,ze.length,ur,tr),this.transform(xr,vr,nr,$e,tr,lr),this.transform(ur,vr,$r,qr,tr,lr);for(var Ai=0;Ai<tr;Ai++){var Ci=nr[Ai]*$r[Ai]-$e[Ai]*qr[Ai];$e[Ai]=nr[Ai]*qr[Ai]+$e[Ai]*$r[Ai],nr[Ai]=Ci}return this.conjugate(nr,$e,tr),this.transform(nr,$e,ci,vr,tr,lr),this.conjugate(ci,vr,tr),this.normalize13b(ci,tr),Ue.negative=Ae.negative^ze.negative,Ue.length=Ae.length+ze.length,Ue.strip()},Me.prototype.mul=function(Ae){var ze=new Me(null);return ze.words=new Array(this.length+Ae.length),this.mulTo(Ae,ze)},Me.prototype.mulf=function(Ae){var ze=new Me(null);return ze.words=new Array(this.length+Ae.length),Yr(this,Ae,ze)},Me.prototype.imul=function(Ae){return this.clone().mulTo(Ae,this)},Me.prototype.imuln=function(Ae){we(typeof Ae=="number"),we(Ae<67108864);for(var ze=0,Ue=0;Ue<this.length;Ue++){var tr=(this.words[Ue]|0)*Ae,lr=(tr&67108863)+(ze&67108863);ze>>=26,ze+=tr/67108864|0,ze+=lr>>>26,this.words[Ue]=lr&67108863}return ze!==0&&(this.words[Ue]=ze,this.length++),this},Me.prototype.muln=function(Ae){return this.clone().imuln(Ae)},Me.prototype.sqr=function(){return this.mul(this)},Me.prototype.isqr=function(){return this.imul(this.clone())},Me.prototype.pow=function(Ae){var ze=Br(Ae);if(ze.length===0)return new Me(1);for(var Ue=this,tr=0;tr<ze.length&&ze[tr]===0;tr++,Ue=Ue.sqr());if(++tr<ze.length)for(var lr=Ue.sqr();tr<ze.length;tr++,lr=lr.sqr())ze[tr]!==0&&(Ue=Ue.mul(lr));return Ue},Me.prototype.iushln=function(Ae){we(typeof Ae=="number"&&Ae>=0);var ze=Ae%26,Ue=(Ae-ze)/26,tr=67108863>>>26-ze<<26-ze,lr;if(ze!==0){var vr=0;for(lr=0;lr<this.length;lr++){var xr=this.words[lr]&tr,nr=(this.words[lr]|0)-xr<<ze;this.words[lr]=nr|vr,vr=xr>>>26-ze}vr&&(this.words[lr]=vr,this.length++)}if(Ue!==0){for(lr=this.length-1;lr>=0;lr--)this.words[lr+Ue]=this.words[lr];for(lr=0;lr<Ue;lr++)this.words[lr]=0;this.length+=Ue}return this.strip()},Me.prototype.ishln=function(Ae){return we(this.negative===0),this.iushln(Ae)},Me.prototype.iushrn=function(Ae,ze,Ue){we(typeof Ae=="number"&&Ae>=0);var tr;ze?tr=(ze-ze%26)/26:tr=0;var lr=Ae%26,vr=Math.min((Ae-lr)/26,this.length),xr=67108863^67108863>>>lr<<lr,nr=Ue;if(tr-=vr,tr=Math.max(0,tr),nr){for(var $e=0;$e<vr;$e++)nr.words[$e]=this.words[$e];nr.length=vr}if(vr!==0)if(this.length>vr)for(this.length-=vr,$e=0;$e<this.length;$e++)this.words[$e]=this.words[$e+vr];else this.words[0]=0,this.length=1;var ur=0;for($e=this.length-1;$e>=0&&(ur!==0||$e>=tr);$e--){var $r=this.words[$e]|0;this.words[$e]=ur<<26-lr|$r>>>lr,ur=$r&xr}return nr&&ur!==0&&(nr.words[nr.length++]=ur),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},Me.prototype.ishrn=function(Ae,ze,Ue){return we(this.negative===0),this.iushrn(Ae,ze,Ue)},Me.prototype.shln=function(Ae){return this.clone().ishln(Ae)},Me.prototype.ushln=function(Ae){return this.clone().iushln(Ae)},Me.prototype.shrn=function(Ae){return this.clone().ishrn(Ae)},Me.prototype.ushrn=function(Ae){return this.clone().iushrn(Ae)},Me.prototype.testn=function(Ae){we(typeof Ae=="number"&&Ae>=0);var ze=Ae%26,Ue=(Ae-ze)/26,tr=1<<ze;if(this.length<=Ue)return!1;var lr=this.words[Ue];return!!(lr&tr)},Me.prototype.imaskn=function(Ae){we(typeof Ae=="number"&&Ae>=0);var ze=Ae%26,Ue=(Ae-ze)/26;if(we(this.negative===0,"imaskn works only with positive numbers"),this.length<=Ue)return this;if(ze!==0&&Ue++,this.length=Math.min(Ue,this.length),ze!==0){var tr=67108863^67108863>>>ze<<ze;this.words[this.length-1]&=tr}return this.strip()},Me.prototype.maskn=function(Ae){return this.clone().imaskn(Ae)},Me.prototype.iaddn=function(Ae){return we(typeof Ae=="number"),we(Ae<67108864),Ae<0?this.isubn(-Ae):this.negative!==0?this.length===1&&(this.words[0]|0)<Ae?(this.words[0]=Ae-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(Ae),this.negative=1,this):this._iaddn(Ae)},Me.prototype._iaddn=function(Ae){this.words[0]+=Ae;for(var ze=0;ze<this.length&&this.words[ze]>=67108864;ze++)this.words[ze]-=67108864,ze===this.length-1?this.words[ze+1]=1:this.words[ze+1]++;return this.length=Math.max(this.length,ze+1),this},Me.prototype.isubn=function(Ae){if(we(typeof Ae=="number"),we(Ae<67108864),Ae<0)return this.iaddn(-Ae);if(this.negative!==0)return this.negative=0,this.iaddn(Ae),this.negative=1,this;if(this.words[0]-=Ae,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var ze=0;ze<this.length&&this.words[ze]<0;ze++)this.words[ze]+=67108864,this.words[ze+1]-=1;return this.strip()},Me.prototype.addn=function(Ae){return this.clone().iaddn(Ae)},Me.prototype.subn=function(Ae){return this.clone().isubn(Ae)},Me.prototype.iabs=function(){return this.negative=0,this},Me.prototype.abs=function(){return this.clone().iabs()},Me.prototype._ishlnsubmul=function(Ae,ze,Ue){var tr=Ae.length+Ue,lr;this._expand(tr);var vr,xr=0;for(lr=0;lr<Ae.length;lr++){vr=(this.words[lr+Ue]|0)+xr;var nr=(Ae.words[lr]|0)*ze;vr-=nr&67108863,xr=(vr>>26)-(nr/67108864|0),this.words[lr+Ue]=vr&67108863}for(;lr<this.length-Ue;lr++)vr=(this.words[lr+Ue]|0)+xr,xr=vr>>26,this.words[lr+Ue]=vr&67108863;if(xr===0)return this.strip();for(we(xr===-1),xr=0,lr=0;lr<this.length;lr++)vr=-(this.words[lr]|0)+xr,xr=vr>>26,this.words[lr]=vr&67108863;return this.negative=1,this.strip()},Me.prototype._wordDiv=function(Ae,ze){var Ue=this.length-Ae.length,tr=this.clone(),lr=Ae,vr=lr.words[lr.length-1]|0,xr=this._countBits(vr);Ue=26-xr,Ue!==0&&(lr=lr.ushln(Ue),tr.iushln(Ue),vr=lr.words[lr.length-1]|0);var nr=tr.length-lr.length,$e;if(ze!=="mod"){$e=new Me(null),$e.length=nr+1,$e.words=new Array($e.length);for(var ur=0;ur<$e.length;ur++)$e.words[ur]=0}var $r=tr.clone()._ishlnsubmul(lr,1,nr);$r.negative===0&&(tr=$r,$e&&($e.words[nr]=1));for(var qr=nr-1;qr>=0;qr--){var ci=(tr.words[lr.length+qr]|0)*67108864+(tr.words[lr.length+qr-1]|0);for(ci=Math.min(ci/vr|0,67108863),tr._ishlnsubmul(lr,ci,qr);tr.negative!==0;)ci--,tr.negative=0,tr._ishlnsubmul(lr,1,qr),tr.isZero()||(tr.negative^=1);$e&&($e.words[qr]=ci)}return $e&&$e.strip(),tr.strip(),ze!=="div"&&Ue!==0&&tr.iushrn(Ue),{div:$e||null,mod:tr}},Me.prototype.divmod=function(Ae,ze,Ue){if(we(!Ae.isZero()),this.isZero())return{div:new Me(0),mod:new Me(0)};var tr,lr,vr;return this.negative!==0&&Ae.negative===0?(vr=this.neg().divmod(Ae,ze),ze!=="mod"&&(tr=vr.div.neg()),ze!=="div"&&(lr=vr.mod.neg(),Ue&&lr.negative!==0&&lr.iadd(Ae)),{div:tr,mod:lr}):this.negative===0&&Ae.negative!==0?(vr=this.divmod(Ae.neg(),ze),ze!=="mod"&&(tr=vr.div.neg()),{div:tr,mod:vr.mod}):(this.negative&Ae.negative)!==0?(vr=this.neg().divmod(Ae.neg(),ze),ze!=="div"&&(lr=vr.mod.neg(),Ue&&lr.negative!==0&&lr.isub(Ae)),{div:vr.div,mod:lr}):Ae.length>this.length||this.cmp(Ae)<0?{div:new Me(0),mod:this}:Ae.length===1?ze==="div"?{div:this.divn(Ae.words[0]),mod:null}:ze==="mod"?{div:null,mod:new Me(this.modn(Ae.words[0]))}:{div:this.divn(Ae.words[0]),mod:new Me(this.modn(Ae.words[0]))}:this._wordDiv(Ae,ze)},Me.prototype.div=function(Ae){return this.divmod(Ae,"div",!1).div},Me.prototype.mod=function(Ae){return this.divmod(Ae,"mod",!1).mod},Me.prototype.umod=function(Ae){return this.divmod(Ae,"mod",!0).mod},Me.prototype.divRound=function(Ae){var ze=this.divmod(Ae);if(ze.mod.isZero())return ze.div;var Ue=ze.div.negative!==0?ze.mod.isub(Ae):ze.mod,tr=Ae.ushrn(1),lr=Ae.andln(1),vr=Ue.cmp(tr);return vr<0||lr===1&&vr===0?ze.div:ze.div.negative!==0?ze.div.isubn(1):ze.div.iaddn(1)},Me.prototype.modn=function(Ae){we(Ae<=67108863);for(var ze=(1<<26)%Ae,Ue=0,tr=this.length-1;tr>=0;tr--)Ue=(ze*Ue+(this.words[tr]|0))%Ae;return Ue},Me.prototype.idivn=function(Ae){we(Ae<=67108863);for(var ze=0,Ue=this.length-1;Ue>=0;Ue--){var tr=(this.words[Ue]|0)+ze*67108864;this.words[Ue]=tr/Ae|0,ze=tr%Ae}return this.strip()},Me.prototype.divn=function(Ae){return this.clone().idivn(Ae)},Me.prototype.egcd=function(Ae){we(Ae.negative===0),we(!Ae.isZero());var ze=this,Ue=Ae.clone();ze.negative!==0?ze=ze.umod(Ae):ze=ze.clone();for(var tr=new Me(1),lr=new Me(0),vr=new Me(0),xr=new Me(1),nr=0;ze.isEven()&&Ue.isEven();)ze.iushrn(1),Ue.iushrn(1),++nr;for(var $e=Ue.clone(),ur=ze.clone();!ze.isZero();){for(var $r=0,qr=1;(ze.words[0]&qr)===0&&$r<26;++$r,qr<<=1);if($r>0)for(ze.iushrn($r);$r-- >0;)(tr.isOdd()||lr.isOdd())&&(tr.iadd($e),lr.isub(ur)),tr.iushrn(1),lr.iushrn(1);for(var ci=0,Ai=1;(Ue.words[0]&Ai)===0&&ci<26;++ci,Ai<<=1);if(ci>0)for(Ue.iushrn(ci);ci-- >0;)(vr.isOdd()||xr.isOdd())&&(vr.iadd($e),xr.isub(ur)),vr.iushrn(1),xr.iushrn(1);ze.cmp(Ue)>=0?(ze.isub(Ue),tr.isub(vr),lr.isub(xr)):(Ue.isub(ze),vr.isub(tr),xr.isub(lr))}return{a:vr,b:xr,gcd:Ue.iushln(nr)}},Me.prototype._invmp=function(Ae){we(Ae.negative===0),we(!Ae.isZero());var ze=this,Ue=Ae.clone();ze.negative!==0?ze=ze.umod(Ae):ze=ze.clone();for(var tr=new Me(1),lr=new Me(0),vr=Ue.clone();ze.cmpn(1)>0&&Ue.cmpn(1)>0;){for(var xr=0,nr=1;(ze.words[0]&nr)===0&&xr<26;++xr,nr<<=1);if(xr>0)for(ze.iushrn(xr);xr-- >0;)tr.isOdd()&&tr.iadd(vr),tr.iushrn(1);for(var $e=0,ur=1;(Ue.words[0]&ur)===0&&$e<26;++$e,ur<<=1);if($e>0)for(Ue.iushrn($e);$e-- >0;)lr.isOdd()&&lr.iadd(vr),lr.iushrn(1);ze.cmp(Ue)>=0?(ze.isub(Ue),tr.isub(lr)):(Ue.isub(ze),lr.isub(tr))}var $r;return ze.cmpn(1)===0?$r=tr:$r=lr,$r.cmpn(0)<0&&$r.iadd(Ae),$r},Me.prototype.gcd=function(Ae){if(this.isZero())return Ae.abs();if(Ae.isZero())return this.abs();var ze=this.clone(),Ue=Ae.clone();ze.negative=0,Ue.negative=0;for(var tr=0;ze.isEven()&&Ue.isEven();tr++)ze.iushrn(1),Ue.iushrn(1);do{for(;ze.isEven();)ze.iushrn(1);for(;Ue.isEven();)Ue.iushrn(1);var lr=ze.cmp(Ue);if(lr<0){var vr=ze;ze=Ue,Ue=vr}else if(lr===0||Ue.cmpn(1)===0)break;ze.isub(Ue)}while(!0);return Ue.iushln(tr)},Me.prototype.invm=function(Ae){return this.egcd(Ae).a.umod(Ae)},Me.prototype.isEven=function(){return(this.words[0]&1)===0},Me.prototype.isOdd=function(){return(this.words[0]&1)===1},Me.prototype.andln=function(Ae){return this.words[0]&Ae},Me.prototype.bincn=function(Ae){we(typeof Ae=="number");var ze=Ae%26,Ue=(Ae-ze)/26,tr=1<<ze;if(this.length<=Ue)return this._expand(Ue+1),this.words[Ue]|=tr,this;for(var lr=tr,vr=Ue;lr!==0&&vr<this.length;vr++){var xr=this.words[vr]|0;xr+=lr,lr=xr>>>26,xr&=67108863,this.words[vr]=xr}return lr!==0&&(this.words[vr]=lr,this.length++),this},Me.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Me.prototype.cmpn=function(Ae){var ze=Ae<0;if(this.negative!==0&&!ze)return-1;if(this.negative===0&&ze)return 1;this.strip();var Ue;if(this.length>1)Ue=1;else{ze&&(Ae=-Ae),we(Ae<=67108863,"Number is too big");var tr=this.words[0]|0;Ue=tr===Ae?0:tr<Ae?-1:1}return this.negative!==0?-Ue|0:Ue},Me.prototype.cmp=function(Ae){if(this.negative!==0&&Ae.negative===0)return-1;if(this.negative===0&&Ae.negative!==0)return 1;var ze=this.ucmp(Ae);return this.negative!==0?-ze|0:ze},Me.prototype.ucmp=function(Ae){if(this.length>Ae.length)return 1;if(this.length<Ae.length)return-1;for(var ze=0,Ue=this.length-1;Ue>=0;Ue--){var tr=this.words[Ue]|0,lr=Ae.words[Ue]|0;if(tr!==lr){tr<lr?ze=-1:tr>lr&&(ze=1);break}}return ze},Me.prototype.gtn=function(Ae){return this.cmpn(Ae)===1},Me.prototype.gt=function(Ae){return this.cmp(Ae)===1},Me.prototype.gten=function(Ae){return this.cmpn(Ae)>=0},Me.prototype.gte=function(Ae){return this.cmp(Ae)>=0},Me.prototype.ltn=function(Ae){return this.cmpn(Ae)===-1},Me.prototype.lt=function(Ae){return this.cmp(Ae)===-1},Me.prototype.lten=function(Ae){return this.cmpn(Ae)<=0},Me.prototype.lte=function(Ae){return this.cmp(Ae)<=0},Me.prototype.eqn=function(Ae){return this.cmpn(Ae)===0},Me.prototype.eq=function(Ae){return this.cmp(Ae)===0},Me.red=function(Ae){return new oi(Ae)},Me.prototype.toRed=function(Ae){return we(!this.red,"Already a number in reduction context"),we(this.negative===0,"red works only with positives"),Ae.convertTo(this)._forceRed(Ae)},Me.prototype.fromRed=function(){return we(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Me.prototype._forceRed=function(Ae){return this.red=Ae,this},Me.prototype.forceRed=function(Ae){return we(!this.red,"Already a number in reduction context"),this._forceRed(Ae)},Me.prototype.redAdd=function(Ae){return we(this.red,"redAdd works only with red numbers"),this.red.add(this,Ae)},Me.prototype.redIAdd=function(Ae){return we(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Ae)},Me.prototype.redSub=function(Ae){return we(this.red,"redSub works only with red numbers"),this.red.sub(this,Ae)},Me.prototype.redISub=function(Ae){return we(this.red,"redISub works only with red numbers"),this.red.isub(this,Ae)},Me.prototype.redShl=function(Ae){return we(this.red,"redShl works only with red numbers"),this.red.shl(this,Ae)},Me.prototype.redMul=function(Ae){return we(this.red,"redMul works only with red numbers"),this.red._verify2(this,Ae),this.red.mul(this,Ae)},Me.prototype.redIMul=function(Ae){return we(this.red,"redMul works only with red numbers"),this.red._verify2(this,Ae),this.red.imul(this,Ae)},Me.prototype.redSqr=function(){return we(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Me.prototype.redISqr=function(){return we(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Me.prototype.redSqrt=function(){return we(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Me.prototype.redInvm=function(){return we(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Me.prototype.redNeg=function(){return we(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Me.prototype.redPow=function(Ae){return we(this.red&&!Ae.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Ae)};var Zr={k256:null,p224:null,p192:null,p25519:null};function Wr(gr,Ae){this.name=gr,this.p=new Me(Ae,16),this.n=this.p.bitLength(),this.k=new Me(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Wr.prototype._tmp=function(){var Ae=new Me(null);return Ae.words=new Array(Math.ceil(this.n/13)),Ae},Wr.prototype.ireduce=function(Ae){var ze=Ae,Ue;do this.split(ze,this.tmp),ze=this.imulK(ze),ze=ze.iadd(this.tmp),Ue=ze.bitLength();while(Ue>this.n);var tr=Ue<this.n?-1:ze.ucmp(this.p);return tr===0?(ze.words[0]=0,ze.length=1):tr>0?ze.isub(this.p):ze.strip!==void 0?ze.strip():ze._strip(),ze},Wr.prototype.split=function(Ae,ze){Ae.iushrn(this.n,0,ze)},Wr.prototype.imulK=function(Ae){return Ae.imul(this.k)};function si(){Wr.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Pe(si,Wr),si.prototype.split=function(Ae,ze){for(var Ue=4194303,tr=Math.min(Ae.length,9),lr=0;lr<tr;lr++)ze.words[lr]=Ae.words[lr];if(ze.length=tr,Ae.length<=9){Ae.words[0]=0,Ae.length=1;return}var vr=Ae.words[9];for(ze.words[ze.length++]=vr&Ue,lr=10;lr<Ae.length;lr++){var xr=Ae.words[lr]|0;Ae.words[lr-10]=(xr&Ue)<<4|vr>>>22,vr=xr}vr>>>=22,Ae.words[lr-10]=vr,vr===0&&Ae.length>10?Ae.length-=10:Ae.length-=9},si.prototype.imulK=function(Ae){Ae.words[Ae.length]=0,Ae.words[Ae.length+1]=0,Ae.length+=2;for(var ze=0,Ue=0;Ue<Ae.length;Ue++){var tr=Ae.words[Ue]|0;ze+=tr*977,Ae.words[Ue]=ze&67108863,ze=tr*64+(ze/67108864|0)}return Ae.words[Ae.length-1]===0&&(Ae.length--,Ae.words[Ae.length-1]===0&&Ae.length--),Ae};function li(){Wr.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Pe(li,Wr);function yi(){Wr.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Pe(yi,Wr);function mi(){Wr.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Pe(mi,Wr),mi.prototype.imulK=function(Ae){for(var ze=0,Ue=0;Ue<Ae.length;Ue++){var tr=(Ae.words[Ue]|0)*19+ze,lr=tr&67108863;tr>>>=26,Ae.words[Ue]=lr,ze=tr}return ze!==0&&(Ae.words[Ae.length++]=ze),Ae},Me._prime=function(Ae){if(Zr[Ae])return Zr[Ae];var ze;if(Ae==="k256")ze=new si;else if(Ae==="p224")ze=new li;else if(Ae==="p192")ze=new yi;else if(Ae==="p25519")ze=new mi;else throw new Error("Unknown prime "+Ae);return Zr[Ae]=ze,ze};function oi(gr){if(typeof gr=="string"){var Ae=Me._prime(gr);this.m=Ae.p,this.prime=Ae}else we(gr.gtn(1),"modulus must be greater than 1"),this.m=gr,this.prime=null}oi.prototype._verify1=function(Ae){we(Ae.negative===0,"red works only with positives"),we(Ae.red,"red works only with red numbers")},oi.prototype._verify2=function(Ae,ze){we((Ae.negative|ze.negative)===0,"red works only with positives"),we(Ae.red&&Ae.red===ze.red,"red works only with red numbers")},oi.prototype.imod=function(Ae){return this.prime?this.prime.ireduce(Ae)._forceRed(this):Ae.umod(this.m)._forceRed(this)},oi.prototype.neg=function(Ae){return Ae.isZero()?Ae.clone():this.m.sub(Ae)._forceRed(this)},oi.prototype.add=function(Ae,ze){this._verify2(Ae,ze);var Ue=Ae.add(ze);return Ue.cmp(this.m)>=0&&Ue.isub(this.m),Ue._forceRed(this)},oi.prototype.iadd=function(Ae,ze){this._verify2(Ae,ze);var Ue=Ae.iadd(ze);return Ue.cmp(this.m)>=0&&Ue.isub(this.m),Ue},oi.prototype.sub=function(Ae,ze){this._verify2(Ae,ze);var Ue=Ae.sub(ze);return Ue.cmpn(0)<0&&Ue.iadd(this.m),Ue._forceRed(this)},oi.prototype.isub=function(Ae,ze){this._verify2(Ae,ze);var Ue=Ae.isub(ze);return Ue.cmpn(0)<0&&Ue.iadd(this.m),Ue},oi.prototype.shl=function(Ae,ze){return this._verify1(Ae),this.imod(Ae.ushln(ze))},oi.prototype.imul=function(Ae,ze){return this._verify2(Ae,ze),this.imod(Ae.imul(ze))},oi.prototype.mul=function(Ae,ze){return this._verify2(Ae,ze),this.imod(Ae.mul(ze))},oi.prototype.isqr=function(Ae){return this.imul(Ae,Ae.clone())},oi.prototype.sqr=function(Ae){return this.mul(Ae,Ae)},oi.prototype.sqrt=function(Ae){if(Ae.isZero())return Ae.clone();var ze=this.m.andln(3);if(we(ze%2===1),ze===3){var Ue=this.m.add(new Me(1)).iushrn(2);return this.pow(Ae,Ue)}for(var tr=this.m.subn(1),lr=0;!tr.isZero()&&tr.andln(1)===0;)lr++,tr.iushrn(1);we(!tr.isZero());var vr=new Me(1).toRed(this),xr=vr.redNeg(),nr=this.m.subn(1).iushrn(1),$e=this.m.bitLength();for($e=new Me(2*$e*$e).toRed(this);this.pow($e,nr).cmp(xr)!==0;)$e.redIAdd(xr);for(var ur=this.pow($e,tr),$r=this.pow(Ae,tr.addn(1).iushrn(1)),qr=this.pow(Ae,tr),ci=lr;qr.cmp(vr)!==0;){for(var Ai=qr,Ci=0;Ai.cmp(vr)!==0;Ci++)Ai=Ai.redSqr();we(Ci<ci);var ii=this.pow(ur,new Me(1).iushln(ci-Ci-1));$r=$r.redMul(ii),ur=ii.redSqr(),qr=qr.redMul(ur),ci=Ci}return $r},oi.prototype.invm=function(Ae){var ze=Ae._invmp(this.m);return ze.negative!==0?(ze.negative=0,this.imod(ze).redNeg()):this.imod(ze)},oi.prototype.pow=function(Ae,ze){if(ze.isZero())return new Me(1).toRed(this);if(ze.cmpn(1)===0)return Ae.clone();var Ue=4,tr=new Array(1<<Ue);tr[0]=new Me(1).toRed(this),tr[1]=Ae;for(var lr=2;lr<tr.length;lr++)tr[lr]=this.mul(tr[lr-1],Ae);var vr=tr[0],xr=0,nr=0,$e=ze.bitLength()%26;for($e===0&&($e=26),lr=ze.length-1;lr>=0;lr--){for(var ur=ze.words[lr],$r=$e-1;$r>=0;$r--){var qr=ur>>$r&1;if(vr!==tr[0]&&(vr=this.sqr(vr)),qr===0&&xr===0){nr=0;continue}xr<<=1,xr|=qr,nr++,!(nr!==Ue&&(lr!==0||$r!==0))&&(vr=this.mul(vr,tr[xr]),nr=0,xr=0)}$e=26}return vr},oi.prototype.convertTo=function(Ae){var ze=Ae.umod(this.m);return ze===Ae?ze.clone():ze},oi.prototype.convertFrom=function(Ae){var ze=Ae.clone();return ze.red=null,ze},Me.mont=function(Ae){return new ui(Ae)};function ui(gr){oi.call(this,gr),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new Me(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Pe(ui,oi),ui.prototype.convertTo=function(Ae){return this.imod(Ae.ushln(this.shift))},ui.prototype.convertFrom=function(Ae){var ze=this.imod(Ae.mul(this.rinv));return ze.red=null,ze},ui.prototype.imul=function(Ae,ze){if(Ae.isZero()||ze.isZero())return Ae.words[0]=0,Ae.length=1,Ae;var Ue=Ae.imul(ze),tr=Ue.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),lr=Ue.isub(tr).iushrn(this.shift),vr=lr;return lr.cmp(this.m)>=0?vr=lr.isub(this.m):lr.cmpn(0)<0&&(vr=lr.iadd(this.m)),vr._forceRed(this)},ui.prototype.mul=function(Ae,ze){if(Ae.isZero()||ze.isZero())return new Me(0)._forceRed(this);var Ue=Ae.mul(ze),tr=Ue.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),lr=Ue.isub(tr).iushrn(this.shift),vr=lr;return lr.cmp(this.m)>=0?vr=lr.isub(this.m):lr.cmpn(0)<0&&(vr=lr.iadd(this.m)),vr._forceRed(this)},ui.prototype.invm=function(Ae){var ze=this.imod(Ae._invmp(this.m).mul(this.r2));return ze._forceRed(this)}})(m,commonjsGlobal)})(bn$1);var browser$3,hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser$3;hasRequiredBrowser=1;var m=requireElliptic(),c=bn$1.exports;browser$3=function(Ze){return new we(Ze)};var ne={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};ne.p224=ne.secp224r1,ne.p256=ne.secp256r1=ne.prime256v1,ne.p192=ne.secp192r1=ne.prime192v1,ne.p384=ne.secp384r1,ne.p521=ne.secp521r1;function we(Me){this.curveType=ne[Me],this.curveType||(this.curveType={name:Me}),this.curve=new m.ec(this.curveType.name),this.keys=void 0}we.prototype.generateKeys=function(Me,Ze){return this.keys=this.curve.genKeyPair(),this.getPublicKey(Me,Ze)},we.prototype.computeSecret=function(Me,Ze,ie){Ze=Ze||"utf8",Buffer$C.isBuffer(Me)||(Me=new Buffer$C(Me,Ze));var rr=this.curve.keyFromPublic(Me).getPublic(),pr=rr.mul(this.keys.getPrivate()).getX();return Pe(pr,ie,this.curveType.byteLength)},we.prototype.getPublicKey=function(Me,Ze){var ie=this.keys.getPublic(Ze==="compressed",!0);return Ze==="hybrid"&&(ie[ie.length-1]%2?ie[0]=7:ie[0]=6),Pe(ie,Me)},we.prototype.getPrivateKey=function(Me){return Pe(this.keys.getPrivate(),Me)},we.prototype.setPublicKey=function(Me,Ze){return Ze=Ze||"utf8",Buffer$C.isBuffer(Me)||(Me=new Buffer$C(Me,Ze)),this.keys._importPublic(Me),this},we.prototype.setPrivateKey=function(Me,Ze){Ze=Ze||"utf8",Buffer$C.isBuffer(Me)||(Me=new Buffer$C(Me,Ze));var ie=new c(Me);return ie=ie.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(ie),this};function Pe(Me,Ze,ie){Array.isArray(Me)||(Me=Me.toArray());var rr=new Buffer$C(Me);if(ie&&rr.length<ie){var pr=new Buffer$C(ie-rr.length);pr.fill(0),rr=Buffer$C.concat([pr,rr])}return Ze?rr.toString(Ze):rr}return browser$3}var browser$2={},createHash$2=browser$a,Buffer$4=safeBuffer$2.exports.Buffer,mgf$2=function(m,c){for(var ne=Buffer$4.alloc(0),we=0,Pe;ne.length<c;)Pe=i2ops(we++),ne=Buffer$4.concat([ne,createHash$2("sha1").update(m).update(Pe).digest()]);return ne.slice(0,c)};function i2ops(m){var c=Buffer$4.allocUnsafe(4);return c.writeUInt32BE(m,0),c}var xor$2=function m(c,ne){for(var we=c.length,Pe=-1;++Pe<we;)c[Pe]^=ne[Pe];return c},bn={exports:{}};(function(m){(function(c,ne){function we(gr,Ae){if(!gr)throw new Error(Ae||"Assertion failed")}function Pe(gr,Ae){gr.super_=Ae;var ze=function(){};ze.prototype=Ae.prototype,gr.prototype=new ze,gr.prototype.constructor=gr}function Me(gr,Ae,ze){if(Me.isBN(gr))return gr;this.negative=0,this.words=null,this.length=0,this.red=null,gr!==null&&((Ae==="le"||Ae==="be")&&(ze=Ae,Ae=10),this._init(gr||0,Ae||10,ze||"be"))}typeof c=="object"?c.exports=Me:ne.BN=Me,Me.BN=Me,Me.wordSize=26;var Ze;try{typeof window<"u"&&typeof window.Buffer<"u"?Ze=window.Buffer:Ze=require$$0$4.Buffer}catch{}Me.isBN=function(Ae){return Ae instanceof Me?!0:Ae!==null&&typeof Ae=="object"&&Ae.constructor.wordSize===Me.wordSize&&Array.isArray(Ae.words)},Me.max=function(Ae,ze){return Ae.cmp(ze)>0?Ae:ze},Me.min=function(Ae,ze){return Ae.cmp(ze)<0?Ae:ze},Me.prototype._init=function(Ae,ze,Ue){if(typeof Ae=="number")return this._initNumber(Ae,ze,Ue);if(typeof Ae=="object")return this._initArray(Ae,ze,Ue);ze==="hex"&&(ze=16),we(ze===(ze|0)&&ze>=2&&ze<=36),Ae=Ae.toString().replace(/\s+/g,"");var tr=0;Ae[0]==="-"&&(tr++,this.negative=1),tr<Ae.length&&(ze===16?this._parseHex(Ae,tr,Ue):(this._parseBase(Ae,ze,tr),Ue==="le"&&this._initArray(this.toArray(),ze,Ue)))},Me.prototype._initNumber=function(Ae,ze,Ue){Ae<0&&(this.negative=1,Ae=-Ae),Ae<67108864?(this.words=[Ae&67108863],this.length=1):Ae<4503599627370496?(this.words=[Ae&67108863,Ae/67108864&67108863],this.length=2):(we(Ae<9007199254740992),this.words=[Ae&67108863,Ae/67108864&67108863,1],this.length=3),Ue==="le"&&this._initArray(this.toArray(),ze,Ue)},Me.prototype._initArray=function(Ae,ze,Ue){if(we(typeof Ae.length=="number"),Ae.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Ae.length/3),this.words=new Array(this.length);for(var tr=0;tr<this.length;tr++)this.words[tr]=0;var lr,vr,xr=0;if(Ue==="be")for(tr=Ae.length-1,lr=0;tr>=0;tr-=3)vr=Ae[tr]|Ae[tr-1]<<8|Ae[tr-2]<<16,this.words[lr]|=vr<<xr&67108863,this.words[lr+1]=vr>>>26-xr&67108863,xr+=24,xr>=26&&(xr-=26,lr++);else if(Ue==="le")for(tr=0,lr=0;tr<Ae.length;tr+=3)vr=Ae[tr]|Ae[tr+1]<<8|Ae[tr+2]<<16,this.words[lr]|=vr<<xr&67108863,this.words[lr+1]=vr>>>26-xr&67108863,xr+=24,xr>=26&&(xr-=26,lr++);return this.strip()};function ie(gr,Ae){var ze=gr.charCodeAt(Ae);return ze>=65&&ze<=70?ze-55:ze>=97&&ze<=102?ze-87:ze-48&15}function rr(gr,Ae,ze){var Ue=ie(gr,ze);return ze-1>=Ae&&(Ue|=ie(gr,ze-1)<<4),Ue}Me.prototype._parseHex=function(Ae,ze,Ue){this.length=Math.ceil((Ae.length-ze)/6),this.words=new Array(this.length);for(var tr=0;tr<this.length;tr++)this.words[tr]=0;var lr=0,vr=0,xr;if(Ue==="be")for(tr=Ae.length-1;tr>=ze;tr-=2)xr=rr(Ae,ze,tr)<<lr,this.words[vr]|=xr&67108863,lr>=18?(lr-=18,vr+=1,this.words[vr]|=xr>>>26):lr+=8;else{var nr=Ae.length-ze;for(tr=nr%2===0?ze+1:ze;tr<Ae.length;tr+=2)xr=rr(Ae,ze,tr)<<lr,this.words[vr]|=xr&67108863,lr>=18?(lr-=18,vr+=1,this.words[vr]|=xr>>>26):lr+=8}this.strip()};function pr(gr,Ae,ze,Ue){for(var tr=0,lr=Math.min(gr.length,ze),vr=Ae;vr<lr;vr++){var xr=gr.charCodeAt(vr)-48;tr*=Ue,xr>=49?tr+=xr-49+10:xr>=17?tr+=xr-17+10:tr+=xr}return tr}Me.prototype._parseBase=function(Ae,ze,Ue){this.words=[0],this.length=1;for(var tr=0,lr=1;lr<=67108863;lr*=ze)tr++;tr--,lr=lr/ze|0;for(var vr=Ae.length-Ue,xr=vr%tr,nr=Math.min(vr,vr-xr)+Ue,$e=0,ur=Ue;ur<nr;ur+=tr)$e=pr(Ae,ur,ur+tr,ze),this.imuln(lr),this.words[0]+$e<67108864?this.words[0]+=$e:this._iaddn($e);if(xr!==0){var $r=1;for($e=pr(Ae,ur,Ae.length,ze),ur=0;ur<xr;ur++)$r*=ze;this.imuln($r),this.words[0]+$e<67108864?this.words[0]+=$e:this._iaddn($e)}this.strip()},Me.prototype.copy=function(Ae){Ae.words=new Array(this.length);for(var ze=0;ze<this.length;ze++)Ae.words[ze]=this.words[ze];Ae.length=this.length,Ae.negative=this.negative,Ae.red=this.red},Me.prototype.clone=function(){var Ae=new Me(null);return this.copy(Ae),Ae},Me.prototype._expand=function(Ae){for(;this.length<Ae;)this.words[this.length++]=0;return this},Me.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},Me.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},Me.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var or=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],_r=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],Lr=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];Me.prototype.toString=function(Ae,ze){Ae=Ae||10,ze=ze|0||1;var Ue;if(Ae===16||Ae==="hex"){Ue="";for(var tr=0,lr=0,vr=0;vr<this.length;vr++){var xr=this.words[vr],nr=((xr<<tr|lr)&16777215).toString(16);lr=xr>>>24-tr&16777215,tr+=2,tr>=26&&(tr-=26,vr--),lr!==0||vr!==this.length-1?Ue=or[6-nr.length]+nr+Ue:Ue=nr+Ue}for(lr!==0&&(Ue=lr.toString(16)+Ue);Ue.length%ze!==0;)Ue="0"+Ue;return this.negative!==0&&(Ue="-"+Ue),Ue}if(Ae===(Ae|0)&&Ae>=2&&Ae<=36){var $e=_r[Ae],ur=Lr[Ae];Ue="";var $r=this.clone();for($r.negative=0;!$r.isZero();){var qr=$r.modn(ur).toString(Ae);$r=$r.idivn(ur),$r.isZero()?Ue=qr+Ue:Ue=or[$e-qr.length]+qr+Ue}for(this.isZero()&&(Ue="0"+Ue);Ue.length%ze!==0;)Ue="0"+Ue;return this.negative!==0&&(Ue="-"+Ue),Ue}we(!1,"Base should be between 2 and 36")},Me.prototype.toNumber=function(){var Ae=this.words[0];return this.length===2?Ae+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Ae+=4503599627370496+this.words[1]*67108864:this.length>2&&we(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Ae:Ae},Me.prototype.toJSON=function(){return this.toString(16)},Me.prototype.toBuffer=function(Ae,ze){return we(typeof Ze<"u"),this.toArrayLike(Ze,Ae,ze)},Me.prototype.toArray=function(Ae,ze){return this.toArrayLike(Array,Ae,ze)},Me.prototype.toArrayLike=function(Ae,ze,Ue){var tr=this.byteLength(),lr=Ue||Math.max(1,tr);we(tr<=lr,"byte array longer than desired length"),we(lr>0,"Requested array length <= 0"),this.strip();var vr=ze==="le",xr=new Ae(lr),nr,$e,ur=this.clone();if(vr){for($e=0;!ur.isZero();$e++)nr=ur.andln(255),ur.iushrn(8),xr[$e]=nr;for(;$e<lr;$e++)xr[$e]=0}else{for($e=0;$e<lr-tr;$e++)xr[$e]=0;for($e=0;!ur.isZero();$e++)nr=ur.andln(255),ur.iushrn(8),xr[lr-$e-1]=nr}return xr},Math.clz32?Me.prototype._countBits=function(Ae){return 32-Math.clz32(Ae)}:Me.prototype._countBits=function(Ae){var ze=Ae,Ue=0;return ze>=4096&&(Ue+=13,ze>>>=13),ze>=64&&(Ue+=7,ze>>>=7),ze>=8&&(Ue+=4,ze>>>=4),ze>=2&&(Ue+=2,ze>>>=2),Ue+ze},Me.prototype._zeroBits=function(Ae){if(Ae===0)return 26;var ze=Ae,Ue=0;return(ze&8191)===0&&(Ue+=13,ze>>>=13),(ze&127)===0&&(Ue+=7,ze>>>=7),(ze&15)===0&&(Ue+=4,ze>>>=4),(ze&3)===0&&(Ue+=2,ze>>>=2),(ze&1)===0&&Ue++,Ue},Me.prototype.bitLength=function(){var Ae=this.words[this.length-1],ze=this._countBits(Ae);return(this.length-1)*26+ze};function Br(gr){for(var Ae=new Array(gr.bitLength()),ze=0;ze<Ae.length;ze++){var Ue=ze/26|0,tr=ze%26;Ae[ze]=(gr.words[Ue]&1<<tr)>>>tr}return Ae}Me.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Ae=0,ze=0;ze<this.length;ze++){var Ue=this._zeroBits(this.words[ze]);if(Ae+=Ue,Ue!==26)break}return Ae},Me.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Me.prototype.toTwos=function(Ae){return this.negative!==0?this.abs().inotn(Ae).iaddn(1):this.clone()},Me.prototype.fromTwos=function(Ae){return this.testn(Ae-1)?this.notn(Ae).iaddn(1).ineg():this.clone()},Me.prototype.isNeg=function(){return this.negative!==0},Me.prototype.neg=function(){return this.clone().ineg()},Me.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},Me.prototype.iuor=function(Ae){for(;this.length<Ae.length;)this.words[this.length++]=0;for(var ze=0;ze<Ae.length;ze++)this.words[ze]=this.words[ze]|Ae.words[ze];return this.strip()},Me.prototype.ior=function(Ae){return we((this.negative|Ae.negative)===0),this.iuor(Ae)},Me.prototype.or=function(Ae){return this.length>Ae.length?this.clone().ior(Ae):Ae.clone().ior(this)},Me.prototype.uor=function(Ae){return this.length>Ae.length?this.clone().iuor(Ae):Ae.clone().iuor(this)},Me.prototype.iuand=function(Ae){var ze;this.length>Ae.length?ze=Ae:ze=this;for(var Ue=0;Ue<ze.length;Ue++)this.words[Ue]=this.words[Ue]&Ae.words[Ue];return this.length=ze.length,this.strip()},Me.prototype.iand=function(Ae){return we((this.negative|Ae.negative)===0),this.iuand(Ae)},Me.prototype.and=function(Ae){return this.length>Ae.length?this.clone().iand(Ae):Ae.clone().iand(this)},Me.prototype.uand=function(Ae){return this.length>Ae.length?this.clone().iuand(Ae):Ae.clone().iuand(this)},Me.prototype.iuxor=function(Ae){var ze,Ue;this.length>Ae.length?(ze=this,Ue=Ae):(ze=Ae,Ue=this);for(var tr=0;tr<Ue.length;tr++)this.words[tr]=ze.words[tr]^Ue.words[tr];if(this!==ze)for(;tr<ze.length;tr++)this.words[tr]=ze.words[tr];return this.length=ze.length,this.strip()},Me.prototype.ixor=function(Ae){return we((this.negative|Ae.negative)===0),this.iuxor(Ae)},Me.prototype.xor=function(Ae){return this.length>Ae.length?this.clone().ixor(Ae):Ae.clone().ixor(this)},Me.prototype.uxor=function(Ae){return this.length>Ae.length?this.clone().iuxor(Ae):Ae.clone().iuxor(this)},Me.prototype.inotn=function(Ae){we(typeof Ae=="number"&&Ae>=0);var ze=Math.ceil(Ae/26)|0,Ue=Ae%26;this._expand(ze),Ue>0&&ze--;for(var tr=0;tr<ze;tr++)this.words[tr]=~this.words[tr]&67108863;return Ue>0&&(this.words[tr]=~this.words[tr]&67108863>>26-Ue),this.strip()},Me.prototype.notn=function(Ae){return this.clone().inotn(Ae)},Me.prototype.setn=function(Ae,ze){we(typeof Ae=="number"&&Ae>=0);var Ue=Ae/26|0,tr=Ae%26;return this._expand(Ue+1),ze?this.words[Ue]=this.words[Ue]|1<<tr:this.words[Ue]=this.words[Ue]&~(1<<tr),this.strip()},Me.prototype.iadd=function(Ae){var ze;if(this.negative!==0&&Ae.negative===0)return this.negative=0,ze=this.isub(Ae),this.negative^=1,this._normSign();if(this.negative===0&&Ae.negative!==0)return Ae.negative=0,ze=this.isub(Ae),Ae.negative=1,ze._normSign();var Ue,tr;this.length>Ae.length?(Ue=this,tr=Ae):(Ue=Ae,tr=this);for(var lr=0,vr=0;vr<tr.length;vr++)ze=(Ue.words[vr]|0)+(tr.words[vr]|0)+lr,this.words[vr]=ze&67108863,lr=ze>>>26;for(;lr!==0&&vr<Ue.length;vr++)ze=(Ue.words[vr]|0)+lr,this.words[vr]=ze&67108863,lr=ze>>>26;if(this.length=Ue.length,lr!==0)this.words[this.length]=lr,this.length++;else if(Ue!==this)for(;vr<Ue.length;vr++)this.words[vr]=Ue.words[vr];return this},Me.prototype.add=function(Ae){var ze;return Ae.negative!==0&&this.negative===0?(Ae.negative=0,ze=this.sub(Ae),Ae.negative^=1,ze):Ae.negative===0&&this.negative!==0?(this.negative=0,ze=Ae.sub(this),this.negative=1,ze):this.length>Ae.length?this.clone().iadd(Ae):Ae.clone().iadd(this)},Me.prototype.isub=function(Ae){if(Ae.negative!==0){Ae.negative=0;var ze=this.iadd(Ae);return Ae.negative=1,ze._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Ae),this.negative=1,this._normSign();var Ue=this.cmp(Ae);if(Ue===0)return this.negative=0,this.length=1,this.words[0]=0,this;var tr,lr;Ue>0?(tr=this,lr=Ae):(tr=Ae,lr=this);for(var vr=0,xr=0;xr<lr.length;xr++)ze=(tr.words[xr]|0)-(lr.words[xr]|0)+vr,vr=ze>>26,this.words[xr]=ze&67108863;for(;vr!==0&&xr<tr.length;xr++)ze=(tr.words[xr]|0)+vr,vr=ze>>26,this.words[xr]=ze&67108863;if(vr===0&&xr<tr.length&&tr!==this)for(;xr<tr.length;xr++)this.words[xr]=tr.words[xr];return this.length=Math.max(this.length,xr),tr!==this&&(this.negative=1),this.strip()},Me.prototype.sub=function(Ae){return this.clone().isub(Ae)};function Ar(gr,Ae,ze){ze.negative=Ae.negative^gr.negative;var Ue=gr.length+Ae.length|0;ze.length=Ue,Ue=Ue-1|0;var tr=gr.words[0]|0,lr=Ae.words[0]|0,vr=tr*lr,xr=vr&67108863,nr=vr/67108864|0;ze.words[0]=xr;for(var $e=1;$e<Ue;$e++){for(var ur=nr>>>26,$r=nr&67108863,qr=Math.min($e,Ae.length-1),ci=Math.max(0,$e-gr.length+1);ci<=qr;ci++){var Ai=$e-ci|0;tr=gr.words[Ai]|0,lr=Ae.words[ci]|0,vr=tr*lr+$r,ur+=vr/67108864|0,$r=vr&67108863}ze.words[$e]=$r|0,nr=ur|0}return nr!==0?ze.words[$e]=nr|0:ze.length--,ze.strip()}var Pr=function(Ae,ze,Ue){var tr=Ae.words,lr=ze.words,vr=Ue.words,xr=0,nr,$e,ur,$r=tr[0]|0,qr=$r&8191,ci=$r>>>13,Ai=tr[1]|0,Ci=Ai&8191,ii=Ai>>>13,wi=tr[2]|0,ri=wi&8191,Xr=wi>>>13,bi=tr[3]|0,di=bi&8191,Fi=bi>>>13,Gi=tr[4]|0,gn=Gi&8191,dn=Gi>>>13,In=tr[5]|0,rn=In&8191,qi=In>>>13,jn=tr[6]|0,kn=jn&8191,On=jn>>>13,Po=tr[7]|0,xn=Po&8191,Dn=Po>>>13,qo=tr[8]|0,Zn=qo&8191,Kn=qo>>>13,oa=tr[9]|0,Ti=oa&8191,ti=oa>>>13,vi=lr[0]|0,xi=vi&8191,Bi=vi>>>13,wn=lr[1]|0,ln=wn&8191,Vn=wn>>>13,ho=lr[2]|0,Fn=ho&8191,Xn=ho>>>13,$o=lr[3]|0,to=$o&8191,lo=$o>>>13,Ra=lr[4]|0,ro=Ra&8191,co=Ra>>>13,An=lr[5]|0,ai=An&8191,gi=An>>>13,Di=lr[6]|0,ki=Di&8191,Li=Di>>>13,an=lr[7]|0,ji=an&8191,Ui=an>>>13,Mn=lr[8]|0,Wi=Mn&8191,en=Mn>>>13,qn=lr[9]|0,vn=qn&8191,Cn=qn>>>13;Ue.negative=Ae.negative^ze.negative,Ue.length=19,nr=Math.imul(qr,xi),$e=Math.imul(qr,Bi),$e=$e+Math.imul(ci,xi)|0,ur=Math.imul(ci,Bi);var xo=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(xo>>>26)|0,xo&=67108863,nr=Math.imul(Ci,xi),$e=Math.imul(Ci,Bi),$e=$e+Math.imul(ii,xi)|0,ur=Math.imul(ii,Bi),nr=nr+Math.imul(qr,ln)|0,$e=$e+Math.imul(qr,Vn)|0,$e=$e+Math.imul(ci,ln)|0,ur=ur+Math.imul(ci,Vn)|0;var Co=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Co>>>26)|0,Co&=67108863,nr=Math.imul(ri,xi),$e=Math.imul(ri,Bi),$e=$e+Math.imul(Xr,xi)|0,ur=Math.imul(Xr,Bi),nr=nr+Math.imul(Ci,ln)|0,$e=$e+Math.imul(Ci,Vn)|0,$e=$e+Math.imul(ii,ln)|0,ur=ur+Math.imul(ii,Vn)|0,nr=nr+Math.imul(qr,Fn)|0,$e=$e+Math.imul(qr,Xn)|0,$e=$e+Math.imul(ci,Fn)|0,ur=ur+Math.imul(ci,Xn)|0;var Io=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Io>>>26)|0,Io&=67108863,nr=Math.imul(di,xi),$e=Math.imul(di,Bi),$e=$e+Math.imul(Fi,xi)|0,ur=Math.imul(Fi,Bi),nr=nr+Math.imul(ri,ln)|0,$e=$e+Math.imul(ri,Vn)|0,$e=$e+Math.imul(Xr,ln)|0,ur=ur+Math.imul(Xr,Vn)|0,nr=nr+Math.imul(Ci,Fn)|0,$e=$e+Math.imul(Ci,Xn)|0,$e=$e+Math.imul(ii,Fn)|0,ur=ur+Math.imul(ii,Xn)|0,nr=nr+Math.imul(qr,to)|0,$e=$e+Math.imul(qr,lo)|0,$e=$e+Math.imul(ci,to)|0,ur=ur+Math.imul(ci,lo)|0;var Bo=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,nr=Math.imul(gn,xi),$e=Math.imul(gn,Bi),$e=$e+Math.imul(dn,xi)|0,ur=Math.imul(dn,Bi),nr=nr+Math.imul(di,ln)|0,$e=$e+Math.imul(di,Vn)|0,$e=$e+Math.imul(Fi,ln)|0,ur=ur+Math.imul(Fi,Vn)|0,nr=nr+Math.imul(ri,Fn)|0,$e=$e+Math.imul(ri,Xn)|0,$e=$e+Math.imul(Xr,Fn)|0,ur=ur+Math.imul(Xr,Xn)|0,nr=nr+Math.imul(Ci,to)|0,$e=$e+Math.imul(Ci,lo)|0,$e=$e+Math.imul(ii,to)|0,ur=ur+Math.imul(ii,lo)|0,nr=nr+Math.imul(qr,ro)|0,$e=$e+Math.imul(qr,co)|0,$e=$e+Math.imul(ci,ro)|0,ur=ur+Math.imul(ci,co)|0;var Jo=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,nr=Math.imul(rn,xi),$e=Math.imul(rn,Bi),$e=$e+Math.imul(qi,xi)|0,ur=Math.imul(qi,Bi),nr=nr+Math.imul(gn,ln)|0,$e=$e+Math.imul(gn,Vn)|0,$e=$e+Math.imul(dn,ln)|0,ur=ur+Math.imul(dn,Vn)|0,nr=nr+Math.imul(di,Fn)|0,$e=$e+Math.imul(di,Xn)|0,$e=$e+Math.imul(Fi,Fn)|0,ur=ur+Math.imul(Fi,Xn)|0,nr=nr+Math.imul(ri,to)|0,$e=$e+Math.imul(ri,lo)|0,$e=$e+Math.imul(Xr,to)|0,ur=ur+Math.imul(Xr,lo)|0,nr=nr+Math.imul(Ci,ro)|0,$e=$e+Math.imul(Ci,co)|0,$e=$e+Math.imul(ii,ro)|0,ur=ur+Math.imul(ii,co)|0,nr=nr+Math.imul(qr,ai)|0,$e=$e+Math.imul(qr,gi)|0,$e=$e+Math.imul(ci,ai)|0,ur=ur+Math.imul(ci,gi)|0;var Ho=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,nr=Math.imul(kn,xi),$e=Math.imul(kn,Bi),$e=$e+Math.imul(On,xi)|0,ur=Math.imul(On,Bi),nr=nr+Math.imul(rn,ln)|0,$e=$e+Math.imul(rn,Vn)|0,$e=$e+Math.imul(qi,ln)|0,ur=ur+Math.imul(qi,Vn)|0,nr=nr+Math.imul(gn,Fn)|0,$e=$e+Math.imul(gn,Xn)|0,$e=$e+Math.imul(dn,Fn)|0,ur=ur+Math.imul(dn,Xn)|0,nr=nr+Math.imul(di,to)|0,$e=$e+Math.imul(di,lo)|0,$e=$e+Math.imul(Fi,to)|0,ur=ur+Math.imul(Fi,lo)|0,nr=nr+Math.imul(ri,ro)|0,$e=$e+Math.imul(ri,co)|0,$e=$e+Math.imul(Xr,ro)|0,ur=ur+Math.imul(Xr,co)|0,nr=nr+Math.imul(Ci,ai)|0,$e=$e+Math.imul(Ci,gi)|0,$e=$e+Math.imul(ii,ai)|0,ur=ur+Math.imul(ii,gi)|0,nr=nr+Math.imul(qr,ki)|0,$e=$e+Math.imul(qr,Li)|0,$e=$e+Math.imul(ci,ki)|0,ur=ur+Math.imul(ci,Li)|0;var No=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(No>>>26)|0,No&=67108863,nr=Math.imul(xn,xi),$e=Math.imul(xn,Bi),$e=$e+Math.imul(Dn,xi)|0,ur=Math.imul(Dn,Bi),nr=nr+Math.imul(kn,ln)|0,$e=$e+Math.imul(kn,Vn)|0,$e=$e+Math.imul(On,ln)|0,ur=ur+Math.imul(On,Vn)|0,nr=nr+Math.imul(rn,Fn)|0,$e=$e+Math.imul(rn,Xn)|0,$e=$e+Math.imul(qi,Fn)|0,ur=ur+Math.imul(qi,Xn)|0,nr=nr+Math.imul(gn,to)|0,$e=$e+Math.imul(gn,lo)|0,$e=$e+Math.imul(dn,to)|0,ur=ur+Math.imul(dn,lo)|0,nr=nr+Math.imul(di,ro)|0,$e=$e+Math.imul(di,co)|0,$e=$e+Math.imul(Fi,ro)|0,ur=ur+Math.imul(Fi,co)|0,nr=nr+Math.imul(ri,ai)|0,$e=$e+Math.imul(ri,gi)|0,$e=$e+Math.imul(Xr,ai)|0,ur=ur+Math.imul(Xr,gi)|0,nr=nr+Math.imul(Ci,ki)|0,$e=$e+Math.imul(Ci,Li)|0,$e=$e+Math.imul(ii,ki)|0,ur=ur+Math.imul(ii,Li)|0,nr=nr+Math.imul(qr,ji)|0,$e=$e+Math.imul(qr,Ui)|0,$e=$e+Math.imul(ci,ji)|0,ur=ur+Math.imul(ci,Ui)|0;var Zo=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,nr=Math.imul(Zn,xi),$e=Math.imul(Zn,Bi),$e=$e+Math.imul(Kn,xi)|0,ur=Math.imul(Kn,Bi),nr=nr+Math.imul(xn,ln)|0,$e=$e+Math.imul(xn,Vn)|0,$e=$e+Math.imul(Dn,ln)|0,ur=ur+Math.imul(Dn,Vn)|0,nr=nr+Math.imul(kn,Fn)|0,$e=$e+Math.imul(kn,Xn)|0,$e=$e+Math.imul(On,Fn)|0,ur=ur+Math.imul(On,Xn)|0,nr=nr+Math.imul(rn,to)|0,$e=$e+Math.imul(rn,lo)|0,$e=$e+Math.imul(qi,to)|0,ur=ur+Math.imul(qi,lo)|0,nr=nr+Math.imul(gn,ro)|0,$e=$e+Math.imul(gn,co)|0,$e=$e+Math.imul(dn,ro)|0,ur=ur+Math.imul(dn,co)|0,nr=nr+Math.imul(di,ai)|0,$e=$e+Math.imul(di,gi)|0,$e=$e+Math.imul(Fi,ai)|0,ur=ur+Math.imul(Fi,gi)|0,nr=nr+Math.imul(ri,ki)|0,$e=$e+Math.imul(ri,Li)|0,$e=$e+Math.imul(Xr,ki)|0,ur=ur+Math.imul(Xr,Li)|0,nr=nr+Math.imul(Ci,ji)|0,$e=$e+Math.imul(Ci,Ui)|0,$e=$e+Math.imul(ii,ji)|0,ur=ur+Math.imul(ii,Ui)|0,nr=nr+Math.imul(qr,Wi)|0,$e=$e+Math.imul(qr,en)|0,$e=$e+Math.imul(ci,Wi)|0,ur=ur+Math.imul(ci,en)|0;var Qo=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Qo>>>26)|0,Qo&=67108863,nr=Math.imul(Ti,xi),$e=Math.imul(Ti,Bi),$e=$e+Math.imul(ti,xi)|0,ur=Math.imul(ti,Bi),nr=nr+Math.imul(Zn,ln)|0,$e=$e+Math.imul(Zn,Vn)|0,$e=$e+Math.imul(Kn,ln)|0,ur=ur+Math.imul(Kn,Vn)|0,nr=nr+Math.imul(xn,Fn)|0,$e=$e+Math.imul(xn,Xn)|0,$e=$e+Math.imul(Dn,Fn)|0,ur=ur+Math.imul(Dn,Xn)|0,nr=nr+Math.imul(kn,to)|0,$e=$e+Math.imul(kn,lo)|0,$e=$e+Math.imul(On,to)|0,ur=ur+Math.imul(On,lo)|0,nr=nr+Math.imul(rn,ro)|0,$e=$e+Math.imul(rn,co)|0,$e=$e+Math.imul(qi,ro)|0,ur=ur+Math.imul(qi,co)|0,nr=nr+Math.imul(gn,ai)|0,$e=$e+Math.imul(gn,gi)|0,$e=$e+Math.imul(dn,ai)|0,ur=ur+Math.imul(dn,gi)|0,nr=nr+Math.imul(di,ki)|0,$e=$e+Math.imul(di,Li)|0,$e=$e+Math.imul(Fi,ki)|0,ur=ur+Math.imul(Fi,Li)|0,nr=nr+Math.imul(ri,ji)|0,$e=$e+Math.imul(ri,Ui)|0,$e=$e+Math.imul(Xr,ji)|0,ur=ur+Math.imul(Xr,Ui)|0,nr=nr+Math.imul(Ci,Wi)|0,$e=$e+Math.imul(Ci,en)|0,$e=$e+Math.imul(ii,Wi)|0,ur=ur+Math.imul(ii,en)|0,nr=nr+Math.imul(qr,vn)|0,$e=$e+Math.imul(qr,Cn)|0,$e=$e+Math.imul(ci,vn)|0,ur=ur+Math.imul(ci,Cn)|0;var da=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(da>>>26)|0,da&=67108863,nr=Math.imul(Ti,ln),$e=Math.imul(Ti,Vn),$e=$e+Math.imul(ti,ln)|0,ur=Math.imul(ti,Vn),nr=nr+Math.imul(Zn,Fn)|0,$e=$e+Math.imul(Zn,Xn)|0,$e=$e+Math.imul(Kn,Fn)|0,ur=ur+Math.imul(Kn,Xn)|0,nr=nr+Math.imul(xn,to)|0,$e=$e+Math.imul(xn,lo)|0,$e=$e+Math.imul(Dn,to)|0,ur=ur+Math.imul(Dn,lo)|0,nr=nr+Math.imul(kn,ro)|0,$e=$e+Math.imul(kn,co)|0,$e=$e+Math.imul(On,ro)|0,ur=ur+Math.imul(On,co)|0,nr=nr+Math.imul(rn,ai)|0,$e=$e+Math.imul(rn,gi)|0,$e=$e+Math.imul(qi,ai)|0,ur=ur+Math.imul(qi,gi)|0,nr=nr+Math.imul(gn,ki)|0,$e=$e+Math.imul(gn,Li)|0,$e=$e+Math.imul(dn,ki)|0,ur=ur+Math.imul(dn,Li)|0,nr=nr+Math.imul(di,ji)|0,$e=$e+Math.imul(di,Ui)|0,$e=$e+Math.imul(Fi,ji)|0,ur=ur+Math.imul(Fi,Ui)|0,nr=nr+Math.imul(ri,Wi)|0,$e=$e+Math.imul(ri,en)|0,$e=$e+Math.imul(Xr,Wi)|0,ur=ur+Math.imul(Xr,en)|0,nr=nr+Math.imul(Ci,vn)|0,$e=$e+Math.imul(Ci,Cn)|0,$e=$e+Math.imul(ii,vn)|0,ur=ur+Math.imul(ii,Cn)|0;var Pa=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Pa>>>26)|0,Pa&=67108863,nr=Math.imul(Ti,Fn),$e=Math.imul(Ti,Xn),$e=$e+Math.imul(ti,Fn)|0,ur=Math.imul(ti,Xn),nr=nr+Math.imul(Zn,to)|0,$e=$e+Math.imul(Zn,lo)|0,$e=$e+Math.imul(Kn,to)|0,ur=ur+Math.imul(Kn,lo)|0,nr=nr+Math.imul(xn,ro)|0,$e=$e+Math.imul(xn,co)|0,$e=$e+Math.imul(Dn,ro)|0,ur=ur+Math.imul(Dn,co)|0,nr=nr+Math.imul(kn,ai)|0,$e=$e+Math.imul(kn,gi)|0,$e=$e+Math.imul(On,ai)|0,ur=ur+Math.imul(On,gi)|0,nr=nr+Math.imul(rn,ki)|0,$e=$e+Math.imul(rn,Li)|0,$e=$e+Math.imul(qi,ki)|0,ur=ur+Math.imul(qi,Li)|0,nr=nr+Math.imul(gn,ji)|0,$e=$e+Math.imul(gn,Ui)|0,$e=$e+Math.imul(dn,ji)|0,ur=ur+Math.imul(dn,Ui)|0,nr=nr+Math.imul(di,Wi)|0,$e=$e+Math.imul(di,en)|0,$e=$e+Math.imul(Fi,Wi)|0,ur=ur+Math.imul(Fi,en)|0,nr=nr+Math.imul(ri,vn)|0,$e=$e+Math.imul(ri,Cn)|0,$e=$e+Math.imul(Xr,vn)|0,ur=ur+Math.imul(Xr,Cn)|0;var ya=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(ya>>>26)|0,ya&=67108863,nr=Math.imul(Ti,to),$e=Math.imul(Ti,lo),$e=$e+Math.imul(ti,to)|0,ur=Math.imul(ti,lo),nr=nr+Math.imul(Zn,ro)|0,$e=$e+Math.imul(Zn,co)|0,$e=$e+Math.imul(Kn,ro)|0,ur=ur+Math.imul(Kn,co)|0,nr=nr+Math.imul(xn,ai)|0,$e=$e+Math.imul(xn,gi)|0,$e=$e+Math.imul(Dn,ai)|0,ur=ur+Math.imul(Dn,gi)|0,nr=nr+Math.imul(kn,ki)|0,$e=$e+Math.imul(kn,Li)|0,$e=$e+Math.imul(On,ki)|0,ur=ur+Math.imul(On,Li)|0,nr=nr+Math.imul(rn,ji)|0,$e=$e+Math.imul(rn,Ui)|0,$e=$e+Math.imul(qi,ji)|0,ur=ur+Math.imul(qi,Ui)|0,nr=nr+Math.imul(gn,Wi)|0,$e=$e+Math.imul(gn,en)|0,$e=$e+Math.imul(dn,Wi)|0,ur=ur+Math.imul(dn,en)|0,nr=nr+Math.imul(di,vn)|0,$e=$e+Math.imul(di,Cn)|0,$e=$e+Math.imul(Fi,vn)|0,ur=ur+Math.imul(Fi,Cn)|0;var Sa=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Sa>>>26)|0,Sa&=67108863,nr=Math.imul(Ti,ro),$e=Math.imul(Ti,co),$e=$e+Math.imul(ti,ro)|0,ur=Math.imul(ti,co),nr=nr+Math.imul(Zn,ai)|0,$e=$e+Math.imul(Zn,gi)|0,$e=$e+Math.imul(Kn,ai)|0,ur=ur+Math.imul(Kn,gi)|0,nr=nr+Math.imul(xn,ki)|0,$e=$e+Math.imul(xn,Li)|0,$e=$e+Math.imul(Dn,ki)|0,ur=ur+Math.imul(Dn,Li)|0,nr=nr+Math.imul(kn,ji)|0,$e=$e+Math.imul(kn,Ui)|0,$e=$e+Math.imul(On,ji)|0,ur=ur+Math.imul(On,Ui)|0,nr=nr+Math.imul(rn,Wi)|0,$e=$e+Math.imul(rn,en)|0,$e=$e+Math.imul(qi,Wi)|0,ur=ur+Math.imul(qi,en)|0,nr=nr+Math.imul(gn,vn)|0,$e=$e+Math.imul(gn,Cn)|0,$e=$e+Math.imul(dn,vn)|0,ur=ur+Math.imul(dn,Cn)|0;var Ha=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,nr=Math.imul(Ti,ai),$e=Math.imul(Ti,gi),$e=$e+Math.imul(ti,ai)|0,ur=Math.imul(ti,gi),nr=nr+Math.imul(Zn,ki)|0,$e=$e+Math.imul(Zn,Li)|0,$e=$e+Math.imul(Kn,ki)|0,ur=ur+Math.imul(Kn,Li)|0,nr=nr+Math.imul(xn,ji)|0,$e=$e+Math.imul(xn,Ui)|0,$e=$e+Math.imul(Dn,ji)|0,ur=ur+Math.imul(Dn,Ui)|0,nr=nr+Math.imul(kn,Wi)|0,$e=$e+Math.imul(kn,en)|0,$e=$e+Math.imul(On,Wi)|0,ur=ur+Math.imul(On,en)|0,nr=nr+Math.imul(rn,vn)|0,$e=$e+Math.imul(rn,Cn)|0,$e=$e+Math.imul(qi,vn)|0,ur=ur+Math.imul(qi,Cn)|0;var Fa=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,nr=Math.imul(Ti,ki),$e=Math.imul(Ti,Li),$e=$e+Math.imul(ti,ki)|0,ur=Math.imul(ti,Li),nr=nr+Math.imul(Zn,ji)|0,$e=$e+Math.imul(Zn,Ui)|0,$e=$e+Math.imul(Kn,ji)|0,ur=ur+Math.imul(Kn,Ui)|0,nr=nr+Math.imul(xn,Wi)|0,$e=$e+Math.imul(xn,en)|0,$e=$e+Math.imul(Dn,Wi)|0,ur=ur+Math.imul(Dn,en)|0,nr=nr+Math.imul(kn,vn)|0,$e=$e+Math.imul(kn,Cn)|0,$e=$e+Math.imul(On,vn)|0,ur=ur+Math.imul(On,Cn)|0;var ls=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(ls>>>26)|0,ls&=67108863,nr=Math.imul(Ti,ji),$e=Math.imul(Ti,Ui),$e=$e+Math.imul(ti,ji)|0,ur=Math.imul(ti,Ui),nr=nr+Math.imul(Zn,Wi)|0,$e=$e+Math.imul(Zn,en)|0,$e=$e+Math.imul(Kn,Wi)|0,ur=ur+Math.imul(Kn,en)|0,nr=nr+Math.imul(xn,vn)|0,$e=$e+Math.imul(xn,Cn)|0,$e=$e+Math.imul(Dn,vn)|0,ur=ur+Math.imul(Dn,Cn)|0;var us=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(us>>>26)|0,us&=67108863,nr=Math.imul(Ti,Wi),$e=Math.imul(Ti,en),$e=$e+Math.imul(ti,Wi)|0,ur=Math.imul(ti,en),nr=nr+Math.imul(Zn,vn)|0,$e=$e+Math.imul(Zn,Cn)|0,$e=$e+Math.imul(Kn,vn)|0,ur=ur+Math.imul(Kn,Cn)|0;var Xa=(xr+nr|0)+(($e&8191)<<13)|0;xr=(ur+($e>>>13)|0)+(Xa>>>26)|0,Xa&=67108863,nr=Math.imul(Ti,vn),$e=Math.imul(Ti,Cn),$e=$e+Math.imul(ti,vn)|0,ur=Math.imul(ti,Cn);var hs=(xr+nr|0)+(($e&8191)<<13)|0;return xr=(ur+($e>>>13)|0)+(hs>>>26)|0,hs&=67108863,vr[0]=xo,vr[1]=Co,vr[2]=Io,vr[3]=Bo,vr[4]=Jo,vr[5]=Ho,vr[6]=No,vr[7]=Zo,vr[8]=Qo,vr[9]=da,vr[10]=Pa,vr[11]=ya,vr[12]=Sa,vr[13]=Ha,vr[14]=Fa,vr[15]=ls,vr[16]=us,vr[17]=Xa,vr[18]=hs,xr!==0&&(vr[19]=xr,Ue.length++),Ue};Math.imul||(Pr=Ar);function Nr(gr,Ae,ze){ze.negative=Ae.negative^gr.negative,ze.length=gr.length+Ae.length;for(var Ue=0,tr=0,lr=0;lr<ze.length-1;lr++){var vr=tr;tr=0;for(var xr=Ue&67108863,nr=Math.min(lr,Ae.length-1),$e=Math.max(0,lr-gr.length+1);$e<=nr;$e++){var ur=lr-$e,$r=gr.words[ur]|0,qr=Ae.words[$e]|0,ci=$r*qr,Ai=ci&67108863;vr=vr+(ci/67108864|0)|0,Ai=Ai+xr|0,xr=Ai&67108863,vr=vr+(Ai>>>26)|0,tr+=vr>>>26,vr&=67108863}ze.words[lr]=xr,Ue=vr,vr=tr}return Ue!==0?ze.words[lr]=Ue:ze.length--,ze.strip()}function Yr(gr,Ae,ze){var Ue=new Vr;return Ue.mulp(gr,Ae,ze)}Me.prototype.mulTo=function(Ae,ze){var Ue,tr=this.length+Ae.length;return this.length===10&&Ae.length===10?Ue=Pr(this,Ae,ze):tr<63?Ue=Ar(this,Ae,ze):tr<1024?Ue=Nr(this,Ae,ze):Ue=Yr(this,Ae,ze),Ue};function Vr(gr,Ae){this.x=gr,this.y=Ae}Vr.prototype.makeRBT=function(Ae){for(var ze=new Array(Ae),Ue=Me.prototype._countBits(Ae)-1,tr=0;tr<Ae;tr++)ze[tr]=this.revBin(tr,Ue,Ae);return ze},Vr.prototype.revBin=function(Ae,ze,Ue){if(Ae===0||Ae===Ue-1)return Ae;for(var tr=0,lr=0;lr<ze;lr++)tr|=(Ae&1)<<ze-lr-1,Ae>>=1;return tr},Vr.prototype.permute=function(Ae,ze,Ue,tr,lr,vr){for(var xr=0;xr<vr;xr++)tr[xr]=ze[Ae[xr]],lr[xr]=Ue[Ae[xr]]},Vr.prototype.transform=function(Ae,ze,Ue,tr,lr,vr){this.permute(vr,Ae,ze,Ue,tr,lr);for(var xr=1;xr<lr;xr<<=1)for(var nr=xr<<1,$e=Math.cos(2*Math.PI/nr),ur=Math.sin(2*Math.PI/nr),$r=0;$r<lr;$r+=nr)for(var qr=$e,ci=ur,Ai=0;Ai<xr;Ai++){var Ci=Ue[$r+Ai],ii=tr[$r+Ai],wi=Ue[$r+Ai+xr],ri=tr[$r+Ai+xr],Xr=qr*wi-ci*ri;ri=qr*ri+ci*wi,wi=Xr,Ue[$r+Ai]=Ci+wi,tr[$r+Ai]=ii+ri,Ue[$r+Ai+xr]=Ci-wi,tr[$r+Ai+xr]=ii-ri,Ai!==nr&&(Xr=$e*qr-ur*ci,ci=$e*ci+ur*qr,qr=Xr)}},Vr.prototype.guessLen13b=function(Ae,ze){var Ue=Math.max(ze,Ae)|1,tr=Ue&1,lr=0;for(Ue=Ue/2|0;Ue;Ue=Ue>>>1)lr++;return 1<<lr+1+tr},Vr.prototype.conjugate=function(Ae,ze,Ue){if(!(Ue<=1))for(var tr=0;tr<Ue/2;tr++){var lr=Ae[tr];Ae[tr]=Ae[Ue-tr-1],Ae[Ue-tr-1]=lr,lr=ze[tr],ze[tr]=-ze[Ue-tr-1],ze[Ue-tr-1]=-lr}},Vr.prototype.normalize13b=function(Ae,ze){for(var Ue=0,tr=0;tr<ze/2;tr++){var lr=Math.round(Ae[2*tr+1]/ze)*8192+Math.round(Ae[2*tr]/ze)+Ue;Ae[tr]=lr&67108863,lr<67108864?Ue=0:Ue=lr/67108864|0}return Ae},Vr.prototype.convert13b=function(Ae,ze,Ue,tr){for(var lr=0,vr=0;vr<ze;vr++)lr=lr+(Ae[vr]|0),Ue[2*vr]=lr&8191,lr=lr>>>13,Ue[2*vr+1]=lr&8191,lr=lr>>>13;for(vr=2*ze;vr<tr;++vr)Ue[vr]=0;we(lr===0),we((lr&-8192)===0)},Vr.prototype.stub=function(Ae){for(var ze=new Array(Ae),Ue=0;Ue<Ae;Ue++)ze[Ue]=0;return ze},Vr.prototype.mulp=function(Ae,ze,Ue){var tr=2*this.guessLen13b(Ae.length,ze.length),lr=this.makeRBT(tr),vr=this.stub(tr),xr=new Array(tr),nr=new Array(tr),$e=new Array(tr),ur=new Array(tr),$r=new Array(tr),qr=new Array(tr),ci=Ue.words;ci.length=tr,this.convert13b(Ae.words,Ae.length,xr,tr),this.convert13b(ze.words,ze.length,ur,tr),this.transform(xr,vr,nr,$e,tr,lr),this.transform(ur,vr,$r,qr,tr,lr);for(var Ai=0;Ai<tr;Ai++){var Ci=nr[Ai]*$r[Ai]-$e[Ai]*qr[Ai];$e[Ai]=nr[Ai]*qr[Ai]+$e[Ai]*$r[Ai],nr[Ai]=Ci}return this.conjugate(nr,$e,tr),this.transform(nr,$e,ci,vr,tr,lr),this.conjugate(ci,vr,tr),this.normalize13b(ci,tr),Ue.negative=Ae.negative^ze.negative,Ue.length=Ae.length+ze.length,Ue.strip()},Me.prototype.mul=function(Ae){var ze=new Me(null);return ze.words=new Array(this.length+Ae.length),this.mulTo(Ae,ze)},Me.prototype.mulf=function(Ae){var ze=new Me(null);return ze.words=new Array(this.length+Ae.length),Yr(this,Ae,ze)},Me.prototype.imul=function(Ae){return this.clone().mulTo(Ae,this)},Me.prototype.imuln=function(Ae){we(typeof Ae=="number"),we(Ae<67108864);for(var ze=0,Ue=0;Ue<this.length;Ue++){var tr=(this.words[Ue]|0)*Ae,lr=(tr&67108863)+(ze&67108863);ze>>=26,ze+=tr/67108864|0,ze+=lr>>>26,this.words[Ue]=lr&67108863}return ze!==0&&(this.words[Ue]=ze,this.length++),this},Me.prototype.muln=function(Ae){return this.clone().imuln(Ae)},Me.prototype.sqr=function(){return this.mul(this)},Me.prototype.isqr=function(){return this.imul(this.clone())},Me.prototype.pow=function(Ae){var ze=Br(Ae);if(ze.length===0)return new Me(1);for(var Ue=this,tr=0;tr<ze.length&&ze[tr]===0;tr++,Ue=Ue.sqr());if(++tr<ze.length)for(var lr=Ue.sqr();tr<ze.length;tr++,lr=lr.sqr())ze[tr]!==0&&(Ue=Ue.mul(lr));return Ue},Me.prototype.iushln=function(Ae){we(typeof Ae=="number"&&Ae>=0);var ze=Ae%26,Ue=(Ae-ze)/26,tr=67108863>>>26-ze<<26-ze,lr;if(ze!==0){var vr=0;for(lr=0;lr<this.length;lr++){var xr=this.words[lr]&tr,nr=(this.words[lr]|0)-xr<<ze;this.words[lr]=nr|vr,vr=xr>>>26-ze}vr&&(this.words[lr]=vr,this.length++)}if(Ue!==0){for(lr=this.length-1;lr>=0;lr--)this.words[lr+Ue]=this.words[lr];for(lr=0;lr<Ue;lr++)this.words[lr]=0;this.length+=Ue}return this.strip()},Me.prototype.ishln=function(Ae){return we(this.negative===0),this.iushln(Ae)},Me.prototype.iushrn=function(Ae,ze,Ue){we(typeof Ae=="number"&&Ae>=0);var tr;ze?tr=(ze-ze%26)/26:tr=0;var lr=Ae%26,vr=Math.min((Ae-lr)/26,this.length),xr=67108863^67108863>>>lr<<lr,nr=Ue;if(tr-=vr,tr=Math.max(0,tr),nr){for(var $e=0;$e<vr;$e++)nr.words[$e]=this.words[$e];nr.length=vr}if(vr!==0)if(this.length>vr)for(this.length-=vr,$e=0;$e<this.length;$e++)this.words[$e]=this.words[$e+vr];else this.words[0]=0,this.length=1;var ur=0;for($e=this.length-1;$e>=0&&(ur!==0||$e>=tr);$e--){var $r=this.words[$e]|0;this.words[$e]=ur<<26-lr|$r>>>lr,ur=$r&xr}return nr&&ur!==0&&(nr.words[nr.length++]=ur),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},Me.prototype.ishrn=function(Ae,ze,Ue){return we(this.negative===0),this.iushrn(Ae,ze,Ue)},Me.prototype.shln=function(Ae){return this.clone().ishln(Ae)},Me.prototype.ushln=function(Ae){return this.clone().iushln(Ae)},Me.prototype.shrn=function(Ae){return this.clone().ishrn(Ae)},Me.prototype.ushrn=function(Ae){return this.clone().iushrn(Ae)},Me.prototype.testn=function(Ae){we(typeof Ae=="number"&&Ae>=0);var ze=Ae%26,Ue=(Ae-ze)/26,tr=1<<ze;if(this.length<=Ue)return!1;var lr=this.words[Ue];return!!(lr&tr)},Me.prototype.imaskn=function(Ae){we(typeof Ae=="number"&&Ae>=0);var ze=Ae%26,Ue=(Ae-ze)/26;if(we(this.negative===0,"imaskn works only with positive numbers"),this.length<=Ue)return this;if(ze!==0&&Ue++,this.length=Math.min(Ue,this.length),ze!==0){var tr=67108863^67108863>>>ze<<ze;this.words[this.length-1]&=tr}return this.strip()},Me.prototype.maskn=function(Ae){return this.clone().imaskn(Ae)},Me.prototype.iaddn=function(Ae){return we(typeof Ae=="number"),we(Ae<67108864),Ae<0?this.isubn(-Ae):this.negative!==0?this.length===1&&(this.words[0]|0)<Ae?(this.words[0]=Ae-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(Ae),this.negative=1,this):this._iaddn(Ae)},Me.prototype._iaddn=function(Ae){this.words[0]+=Ae;for(var ze=0;ze<this.length&&this.words[ze]>=67108864;ze++)this.words[ze]-=67108864,ze===this.length-1?this.words[ze+1]=1:this.words[ze+1]++;return this.length=Math.max(this.length,ze+1),this},Me.prototype.isubn=function(Ae){if(we(typeof Ae=="number"),we(Ae<67108864),Ae<0)return this.iaddn(-Ae);if(this.negative!==0)return this.negative=0,this.iaddn(Ae),this.negative=1,this;if(this.words[0]-=Ae,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var ze=0;ze<this.length&&this.words[ze]<0;ze++)this.words[ze]+=67108864,this.words[ze+1]-=1;return this.strip()},Me.prototype.addn=function(Ae){return this.clone().iaddn(Ae)},Me.prototype.subn=function(Ae){return this.clone().isubn(Ae)},Me.prototype.iabs=function(){return this.negative=0,this},Me.prototype.abs=function(){return this.clone().iabs()},Me.prototype._ishlnsubmul=function(Ae,ze,Ue){var tr=Ae.length+Ue,lr;this._expand(tr);var vr,xr=0;for(lr=0;lr<Ae.length;lr++){vr=(this.words[lr+Ue]|0)+xr;var nr=(Ae.words[lr]|0)*ze;vr-=nr&67108863,xr=(vr>>26)-(nr/67108864|0),this.words[lr+Ue]=vr&67108863}for(;lr<this.length-Ue;lr++)vr=(this.words[lr+Ue]|0)+xr,xr=vr>>26,this.words[lr+Ue]=vr&67108863;if(xr===0)return this.strip();for(we(xr===-1),xr=0,lr=0;lr<this.length;lr++)vr=-(this.words[lr]|0)+xr,xr=vr>>26,this.words[lr]=vr&67108863;return this.negative=1,this.strip()},Me.prototype._wordDiv=function(Ae,ze){var Ue=this.length-Ae.length,tr=this.clone(),lr=Ae,vr=lr.words[lr.length-1]|0,xr=this._countBits(vr);Ue=26-xr,Ue!==0&&(lr=lr.ushln(Ue),tr.iushln(Ue),vr=lr.words[lr.length-1]|0);var nr=tr.length-lr.length,$e;if(ze!=="mod"){$e=new Me(null),$e.length=nr+1,$e.words=new Array($e.length);for(var ur=0;ur<$e.length;ur++)$e.words[ur]=0}var $r=tr.clone()._ishlnsubmul(lr,1,nr);$r.negative===0&&(tr=$r,$e&&($e.words[nr]=1));for(var qr=nr-1;qr>=0;qr--){var ci=(tr.words[lr.length+qr]|0)*67108864+(tr.words[lr.length+qr-1]|0);for(ci=Math.min(ci/vr|0,67108863),tr._ishlnsubmul(lr,ci,qr);tr.negative!==0;)ci--,tr.negative=0,tr._ishlnsubmul(lr,1,qr),tr.isZero()||(tr.negative^=1);$e&&($e.words[qr]=ci)}return $e&&$e.strip(),tr.strip(),ze!=="div"&&Ue!==0&&tr.iushrn(Ue),{div:$e||null,mod:tr}},Me.prototype.divmod=function(Ae,ze,Ue){if(we(!Ae.isZero()),this.isZero())return{div:new Me(0),mod:new Me(0)};var tr,lr,vr;return this.negative!==0&&Ae.negative===0?(vr=this.neg().divmod(Ae,ze),ze!=="mod"&&(tr=vr.div.neg()),ze!=="div"&&(lr=vr.mod.neg(),Ue&&lr.negative!==0&&lr.iadd(Ae)),{div:tr,mod:lr}):this.negative===0&&Ae.negative!==0?(vr=this.divmod(Ae.neg(),ze),ze!=="mod"&&(tr=vr.div.neg()),{div:tr,mod:vr.mod}):(this.negative&Ae.negative)!==0?(vr=this.neg().divmod(Ae.neg(),ze),ze!=="div"&&(lr=vr.mod.neg(),Ue&&lr.negative!==0&&lr.isub(Ae)),{div:vr.div,mod:lr}):Ae.length>this.length||this.cmp(Ae)<0?{div:new Me(0),mod:this}:Ae.length===1?ze==="div"?{div:this.divn(Ae.words[0]),mod:null}:ze==="mod"?{div:null,mod:new Me(this.modn(Ae.words[0]))}:{div:this.divn(Ae.words[0]),mod:new Me(this.modn(Ae.words[0]))}:this._wordDiv(Ae,ze)},Me.prototype.div=function(Ae){return this.divmod(Ae,"div",!1).div},Me.prototype.mod=function(Ae){return this.divmod(Ae,"mod",!1).mod},Me.prototype.umod=function(Ae){return this.divmod(Ae,"mod",!0).mod},Me.prototype.divRound=function(Ae){var ze=this.divmod(Ae);if(ze.mod.isZero())return ze.div;var Ue=ze.div.negative!==0?ze.mod.isub(Ae):ze.mod,tr=Ae.ushrn(1),lr=Ae.andln(1),vr=Ue.cmp(tr);return vr<0||lr===1&&vr===0?ze.div:ze.div.negative!==0?ze.div.isubn(1):ze.div.iaddn(1)},Me.prototype.modn=function(Ae){we(Ae<=67108863);for(var ze=(1<<26)%Ae,Ue=0,tr=this.length-1;tr>=0;tr--)Ue=(ze*Ue+(this.words[tr]|0))%Ae;return Ue},Me.prototype.idivn=function(Ae){we(Ae<=67108863);for(var ze=0,Ue=this.length-1;Ue>=0;Ue--){var tr=(this.words[Ue]|0)+ze*67108864;this.words[Ue]=tr/Ae|0,ze=tr%Ae}return this.strip()},Me.prototype.divn=function(Ae){return this.clone().idivn(Ae)},Me.prototype.egcd=function(Ae){we(Ae.negative===0),we(!Ae.isZero());var ze=this,Ue=Ae.clone();ze.negative!==0?ze=ze.umod(Ae):ze=ze.clone();for(var tr=new Me(1),lr=new Me(0),vr=new Me(0),xr=new Me(1),nr=0;ze.isEven()&&Ue.isEven();)ze.iushrn(1),Ue.iushrn(1),++nr;for(var $e=Ue.clone(),ur=ze.clone();!ze.isZero();){for(var $r=0,qr=1;(ze.words[0]&qr)===0&&$r<26;++$r,qr<<=1);if($r>0)for(ze.iushrn($r);$r-- >0;)(tr.isOdd()||lr.isOdd())&&(tr.iadd($e),lr.isub(ur)),tr.iushrn(1),lr.iushrn(1);for(var ci=0,Ai=1;(Ue.words[0]&Ai)===0&&ci<26;++ci,Ai<<=1);if(ci>0)for(Ue.iushrn(ci);ci-- >0;)(vr.isOdd()||xr.isOdd())&&(vr.iadd($e),xr.isub(ur)),vr.iushrn(1),xr.iushrn(1);ze.cmp(Ue)>=0?(ze.isub(Ue),tr.isub(vr),lr.isub(xr)):(Ue.isub(ze),vr.isub(tr),xr.isub(lr))}return{a:vr,b:xr,gcd:Ue.iushln(nr)}},Me.prototype._invmp=function(Ae){we(Ae.negative===0),we(!Ae.isZero());var ze=this,Ue=Ae.clone();ze.negative!==0?ze=ze.umod(Ae):ze=ze.clone();for(var tr=new Me(1),lr=new Me(0),vr=Ue.clone();ze.cmpn(1)>0&&Ue.cmpn(1)>0;){for(var xr=0,nr=1;(ze.words[0]&nr)===0&&xr<26;++xr,nr<<=1);if(xr>0)for(ze.iushrn(xr);xr-- >0;)tr.isOdd()&&tr.iadd(vr),tr.iushrn(1);for(var $e=0,ur=1;(Ue.words[0]&ur)===0&&$e<26;++$e,ur<<=1);if($e>0)for(Ue.iushrn($e);$e-- >0;)lr.isOdd()&&lr.iadd(vr),lr.iushrn(1);ze.cmp(Ue)>=0?(ze.isub(Ue),tr.isub(lr)):(Ue.isub(ze),lr.isub(tr))}var $r;return ze.cmpn(1)===0?$r=tr:$r=lr,$r.cmpn(0)<0&&$r.iadd(Ae),$r},Me.prototype.gcd=function(Ae){if(this.isZero())return Ae.abs();if(Ae.isZero())return this.abs();var ze=this.clone(),Ue=Ae.clone();ze.negative=0,Ue.negative=0;for(var tr=0;ze.isEven()&&Ue.isEven();tr++)ze.iushrn(1),Ue.iushrn(1);do{for(;ze.isEven();)ze.iushrn(1);for(;Ue.isEven();)Ue.iushrn(1);var lr=ze.cmp(Ue);if(lr<0){var vr=ze;ze=Ue,Ue=vr}else if(lr===0||Ue.cmpn(1)===0)break;ze.isub(Ue)}while(!0);return Ue.iushln(tr)},Me.prototype.invm=function(Ae){return this.egcd(Ae).a.umod(Ae)},Me.prototype.isEven=function(){return(this.words[0]&1)===0},Me.prototype.isOdd=function(){return(this.words[0]&1)===1},Me.prototype.andln=function(Ae){return this.words[0]&Ae},Me.prototype.bincn=function(Ae){we(typeof Ae=="number");var ze=Ae%26,Ue=(Ae-ze)/26,tr=1<<ze;if(this.length<=Ue)return this._expand(Ue+1),this.words[Ue]|=tr,this;for(var lr=tr,vr=Ue;lr!==0&&vr<this.length;vr++){var xr=this.words[vr]|0;xr+=lr,lr=xr>>>26,xr&=67108863,this.words[vr]=xr}return lr!==0&&(this.words[vr]=lr,this.length++),this},Me.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Me.prototype.cmpn=function(Ae){var ze=Ae<0;if(this.negative!==0&&!ze)return-1;if(this.negative===0&&ze)return 1;this.strip();var Ue;if(this.length>1)Ue=1;else{ze&&(Ae=-Ae),we(Ae<=67108863,"Number is too big");var tr=this.words[0]|0;Ue=tr===Ae?0:tr<Ae?-1:1}return this.negative!==0?-Ue|0:Ue},Me.prototype.cmp=function(Ae){if(this.negative!==0&&Ae.negative===0)return-1;if(this.negative===0&&Ae.negative!==0)return 1;var ze=this.ucmp(Ae);return this.negative!==0?-ze|0:ze},Me.prototype.ucmp=function(Ae){if(this.length>Ae.length)return 1;if(this.length<Ae.length)return-1;for(var ze=0,Ue=this.length-1;Ue>=0;Ue--){var tr=this.words[Ue]|0,lr=Ae.words[Ue]|0;if(tr!==lr){tr<lr?ze=-1:tr>lr&&(ze=1);break}}return ze},Me.prototype.gtn=function(Ae){return this.cmpn(Ae)===1},Me.prototype.gt=function(Ae){return this.cmp(Ae)===1},Me.prototype.gten=function(Ae){return this.cmpn(Ae)>=0},Me.prototype.gte=function(Ae){return this.cmp(Ae)>=0},Me.prototype.ltn=function(Ae){return this.cmpn(Ae)===-1},Me.prototype.lt=function(Ae){return this.cmp(Ae)===-1},Me.prototype.lten=function(Ae){return this.cmpn(Ae)<=0},Me.prototype.lte=function(Ae){return this.cmp(Ae)<=0},Me.prototype.eqn=function(Ae){return this.cmpn(Ae)===0},Me.prototype.eq=function(Ae){return this.cmp(Ae)===0},Me.red=function(Ae){return new oi(Ae)},Me.prototype.toRed=function(Ae){return we(!this.red,"Already a number in reduction context"),we(this.negative===0,"red works only with positives"),Ae.convertTo(this)._forceRed(Ae)},Me.prototype.fromRed=function(){return we(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Me.prototype._forceRed=function(Ae){return this.red=Ae,this},Me.prototype.forceRed=function(Ae){return we(!this.red,"Already a number in reduction context"),this._forceRed(Ae)},Me.prototype.redAdd=function(Ae){return we(this.red,"redAdd works only with red numbers"),this.red.add(this,Ae)},Me.prototype.redIAdd=function(Ae){return we(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Ae)},Me.prototype.redSub=function(Ae){return we(this.red,"redSub works only with red numbers"),this.red.sub(this,Ae)},Me.prototype.redISub=function(Ae){return we(this.red,"redISub works only with red numbers"),this.red.isub(this,Ae)},Me.prototype.redShl=function(Ae){return we(this.red,"redShl works only with red numbers"),this.red.shl(this,Ae)},Me.prototype.redMul=function(Ae){return we(this.red,"redMul works only with red numbers"),this.red._verify2(this,Ae),this.red.mul(this,Ae)},Me.prototype.redIMul=function(Ae){return we(this.red,"redMul works only with red numbers"),this.red._verify2(this,Ae),this.red.imul(this,Ae)},Me.prototype.redSqr=function(){return we(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Me.prototype.redISqr=function(){return we(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Me.prototype.redSqrt=function(){return we(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Me.prototype.redInvm=function(){return we(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Me.prototype.redNeg=function(){return we(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Me.prototype.redPow=function(Ae){return we(this.red&&!Ae.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Ae)};var Zr={k256:null,p224:null,p192:null,p25519:null};function Wr(gr,Ae){this.name=gr,this.p=new Me(Ae,16),this.n=this.p.bitLength(),this.k=new Me(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Wr.prototype._tmp=function(){var Ae=new Me(null);return Ae.words=new Array(Math.ceil(this.n/13)),Ae},Wr.prototype.ireduce=function(Ae){var ze=Ae,Ue;do this.split(ze,this.tmp),ze=this.imulK(ze),ze=ze.iadd(this.tmp),Ue=ze.bitLength();while(Ue>this.n);var tr=Ue<this.n?-1:ze.ucmp(this.p);return tr===0?(ze.words[0]=0,ze.length=1):tr>0?ze.isub(this.p):ze.strip!==void 0?ze.strip():ze._strip(),ze},Wr.prototype.split=function(Ae,ze){Ae.iushrn(this.n,0,ze)},Wr.prototype.imulK=function(Ae){return Ae.imul(this.k)};function si(){Wr.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Pe(si,Wr),si.prototype.split=function(Ae,ze){for(var Ue=4194303,tr=Math.min(Ae.length,9),lr=0;lr<tr;lr++)ze.words[lr]=Ae.words[lr];if(ze.length=tr,Ae.length<=9){Ae.words[0]=0,Ae.length=1;return}var vr=Ae.words[9];for(ze.words[ze.length++]=vr&Ue,lr=10;lr<Ae.length;lr++){var xr=Ae.words[lr]|0;Ae.words[lr-10]=(xr&Ue)<<4|vr>>>22,vr=xr}vr>>>=22,Ae.words[lr-10]=vr,vr===0&&Ae.length>10?Ae.length-=10:Ae.length-=9},si.prototype.imulK=function(Ae){Ae.words[Ae.length]=0,Ae.words[Ae.length+1]=0,Ae.length+=2;for(var ze=0,Ue=0;Ue<Ae.length;Ue++){var tr=Ae.words[Ue]|0;ze+=tr*977,Ae.words[Ue]=ze&67108863,ze=tr*64+(ze/67108864|0)}return Ae.words[Ae.length-1]===0&&(Ae.length--,Ae.words[Ae.length-1]===0&&Ae.length--),Ae};function li(){Wr.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Pe(li,Wr);function yi(){Wr.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Pe(yi,Wr);function mi(){Wr.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Pe(mi,Wr),mi.prototype.imulK=function(Ae){for(var ze=0,Ue=0;Ue<Ae.length;Ue++){var tr=(Ae.words[Ue]|0)*19+ze,lr=tr&67108863;tr>>>=26,Ae.words[Ue]=lr,ze=tr}return ze!==0&&(Ae.words[Ae.length++]=ze),Ae},Me._prime=function(Ae){if(Zr[Ae])return Zr[Ae];var ze;if(Ae==="k256")ze=new si;else if(Ae==="p224")ze=new li;else if(Ae==="p192")ze=new yi;else if(Ae==="p25519")ze=new mi;else throw new Error("Unknown prime "+Ae);return Zr[Ae]=ze,ze};function oi(gr){if(typeof gr=="string"){var Ae=Me._prime(gr);this.m=Ae.p,this.prime=Ae}else we(gr.gtn(1),"modulus must be greater than 1"),this.m=gr,this.prime=null}oi.prototype._verify1=function(Ae){we(Ae.negative===0,"red works only with positives"),we(Ae.red,"red works only with red numbers")},oi.prototype._verify2=function(Ae,ze){we((Ae.negative|ze.negative)===0,"red works only with positives"),we(Ae.red&&Ae.red===ze.red,"red works only with red numbers")},oi.prototype.imod=function(Ae){return this.prime?this.prime.ireduce(Ae)._forceRed(this):Ae.umod(this.m)._forceRed(this)},oi.prototype.neg=function(Ae){return Ae.isZero()?Ae.clone():this.m.sub(Ae)._forceRed(this)},oi.prototype.add=function(Ae,ze){this._verify2(Ae,ze);var Ue=Ae.add(ze);return Ue.cmp(this.m)>=0&&Ue.isub(this.m),Ue._forceRed(this)},oi.prototype.iadd=function(Ae,ze){this._verify2(Ae,ze);var Ue=Ae.iadd(ze);return Ue.cmp(this.m)>=0&&Ue.isub(this.m),Ue},oi.prototype.sub=function(Ae,ze){this._verify2(Ae,ze);var Ue=Ae.sub(ze);return Ue.cmpn(0)<0&&Ue.iadd(this.m),Ue._forceRed(this)},oi.prototype.isub=function(Ae,ze){this._verify2(Ae,ze);var Ue=Ae.isub(ze);return Ue.cmpn(0)<0&&Ue.iadd(this.m),Ue},oi.prototype.shl=function(Ae,ze){return this._verify1(Ae),this.imod(Ae.ushln(ze))},oi.prototype.imul=function(Ae,ze){return this._verify2(Ae,ze),this.imod(Ae.imul(ze))},oi.prototype.mul=function(Ae,ze){return this._verify2(Ae,ze),this.imod(Ae.mul(ze))},oi.prototype.isqr=function(Ae){return this.imul(Ae,Ae.clone())},oi.prototype.sqr=function(Ae){return this.mul(Ae,Ae)},oi.prototype.sqrt=function(Ae){if(Ae.isZero())return Ae.clone();var ze=this.m.andln(3);if(we(ze%2===1),ze===3){var Ue=this.m.add(new Me(1)).iushrn(2);return this.pow(Ae,Ue)}for(var tr=this.m.subn(1),lr=0;!tr.isZero()&&tr.andln(1)===0;)lr++,tr.iushrn(1);we(!tr.isZero());var vr=new Me(1).toRed(this),xr=vr.redNeg(),nr=this.m.subn(1).iushrn(1),$e=this.m.bitLength();for($e=new Me(2*$e*$e).toRed(this);this.pow($e,nr).cmp(xr)!==0;)$e.redIAdd(xr);for(var ur=this.pow($e,tr),$r=this.pow(Ae,tr.addn(1).iushrn(1)),qr=this.pow(Ae,tr),ci=lr;qr.cmp(vr)!==0;){for(var Ai=qr,Ci=0;Ai.cmp(vr)!==0;Ci++)Ai=Ai.redSqr();we(Ci<ci);var ii=this.pow(ur,new Me(1).iushln(ci-Ci-1));$r=$r.redMul(ii),ur=ii.redSqr(),qr=qr.redMul(ur),ci=Ci}return $r},oi.prototype.invm=function(Ae){var ze=Ae._invmp(this.m);return ze.negative!==0?(ze.negative=0,this.imod(ze).redNeg()):this.imod(ze)},oi.prototype.pow=function(Ae,ze){if(ze.isZero())return new Me(1).toRed(this);if(ze.cmpn(1)===0)return Ae.clone();var Ue=4,tr=new Array(1<<Ue);tr[0]=new Me(1).toRed(this),tr[1]=Ae;for(var lr=2;lr<tr.length;lr++)tr[lr]=this.mul(tr[lr-1],Ae);var vr=tr[0],xr=0,nr=0,$e=ze.bitLength()%26;for($e===0&&($e=26),lr=ze.length-1;lr>=0;lr--){for(var ur=ze.words[lr],$r=$e-1;$r>=0;$r--){var qr=ur>>$r&1;if(vr!==tr[0]&&(vr=this.sqr(vr)),qr===0&&xr===0){nr=0;continue}xr<<=1,xr|=qr,nr++,!(nr!==Ue&&(lr!==0||$r!==0))&&(vr=this.mul(vr,tr[xr]),nr=0,xr=0)}$e=26}return vr},oi.prototype.convertTo=function(Ae){var ze=Ae.umod(this.m);return ze===Ae?ze.clone():ze},oi.prototype.convertFrom=function(Ae){var ze=Ae.clone();return ze.red=null,ze},Me.mont=function(Ae){return new ui(Ae)};function ui(gr){oi.call(this,gr),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new Me(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Pe(ui,oi),ui.prototype.convertTo=function(Ae){return this.imod(Ae.ushln(this.shift))},ui.prototype.convertFrom=function(Ae){var ze=this.imod(Ae.mul(this.rinv));return ze.red=null,ze},ui.prototype.imul=function(Ae,ze){if(Ae.isZero()||ze.isZero())return Ae.words[0]=0,Ae.length=1,Ae;var Ue=Ae.imul(ze),tr=Ue.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),lr=Ue.isub(tr).iushrn(this.shift),vr=lr;return lr.cmp(this.m)>=0?vr=lr.isub(this.m):lr.cmpn(0)<0&&(vr=lr.iadd(this.m)),vr._forceRed(this)},ui.prototype.mul=function(Ae,ze){if(Ae.isZero()||ze.isZero())return new Me(0)._forceRed(this);var Ue=Ae.mul(ze),tr=Ue.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),lr=Ue.isub(tr).iushrn(this.shift),vr=lr;return lr.cmp(this.m)>=0?vr=lr.isub(this.m):lr.cmpn(0)<0&&(vr=lr.iadd(this.m)),vr._forceRed(this)},ui.prototype.invm=function(Ae){var ze=this.imod(Ae._invmp(this.m).mul(this.r2));return ze._forceRed(this)}})(m,commonjsGlobal)})(bn);var BN$2=bn.exports,Buffer$3=safeBuffer$2.exports.Buffer;function withPublic$2(m,c){return Buffer$3.from(m.toRed(BN$2.mont(c.modulus)).redPow(new BN$2(c.publicExponent)).fromRed().toArray())}var withPublic_1=withPublic$2,parseKeys$2=parseAsn1,randomBytes=browser$c.exports,createHash$1=browser$a,mgf$1=mgf$2,xor$1=xor$2,BN$1=bn.exports,withPublic$1=withPublic_1,crt$1=browserifyRsa,Buffer$2=safeBuffer$2.exports.Buffer,publicEncrypt=function m(c,ne,we){var Pe;c.padding?Pe=c.padding:we?Pe=1:Pe=4;var Me=parseKeys$2(c),Ze;if(Pe===4)Ze=oaep$1(Me,ne);else if(Pe===1)Ze=pkcs1$1(Me,ne,we);else if(Pe===3){if(Ze=new BN$1(ne),Ze.cmp(Me.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return we?crt$1(Ze,Me):withPublic$1(Ze,Me)};function oaep$1(m,c){var ne=m.modulus.byteLength(),we=c.length,Pe=createHash$1("sha1").update(Buffer$2.alloc(0)).digest(),Me=Pe.length,Ze=2*Me;if(we>ne-Ze-2)throw new Error("message too long");var ie=Buffer$2.alloc(ne-we-Ze-2),rr=ne-Me-1,pr=randomBytes(Me),or=xor$1(Buffer$2.concat([Pe,ie,Buffer$2.alloc(1,1),c],rr),mgf$1(pr,rr)),_r=xor$1(pr,mgf$1(or,Me));return new BN$1(Buffer$2.concat([Buffer$2.alloc(1),_r,or],ne))}function pkcs1$1(m,c,ne){var we=c.length,Pe=m.modulus.byteLength();if(we>Pe-11)throw new Error("message too long");var Me;return ne?Me=Buffer$2.alloc(Pe-we-3,255):Me=nonZero(Pe-we-3),new BN$1(Buffer$2.concat([Buffer$2.from([0,ne?1:2]),Me,Buffer$2.alloc(1),c],Pe))}function nonZero(m){for(var c=Buffer$2.allocUnsafe(m),ne=0,we=randomBytes(m*2),Pe=0,Me;ne<m;)Pe===we.length&&(we=randomBytes(m*2),Pe=0),Me=we[Pe++],Me&&(c[ne++]=Me);return c}var parseKeys$1=parseAsn1,mgf=mgf$2,xor=xor$2,BN=bn.exports,crt=browserifyRsa,createHash=browser$a,withPublic=withPublic_1,Buffer$1=safeBuffer$2.exports.Buffer,privateDecrypt=function m(c,ne,we){var Pe;c.padding?Pe=c.padding:we?Pe=1:Pe=4;var Me=parseKeys$1(c),Ze=Me.modulus.byteLength();if(ne.length>Ze||new BN(ne).cmp(Me.modulus)>=0)throw new Error("decryption error");var ie;we?ie=withPublic(new BN(ne),Me):ie=crt(ne,Me);var rr=Buffer$1.alloc(Ze-ie.length);if(ie=Buffer$1.concat([rr,ie],Ze),Pe===4)return oaep(Me,ie);if(Pe===1)return pkcs1(Me,ie,we);if(Pe===3)return ie;throw new Error("unknown padding")};function oaep(m,c){var ne=m.modulus.byteLength(),we=createHash("sha1").update(Buffer$1.alloc(0)).digest(),Pe=we.length;if(c[0]!==0)throw new Error("decryption error");var Me=c.slice(1,Pe+1),Ze=c.slice(Pe+1),ie=xor(Me,mgf(Ze,Pe)),rr=xor(Ze,mgf(ie,ne-Pe-1));if(compare$c(we,rr.slice(0,Pe)))throw new Error("decryption error");for(var pr=Pe;rr[pr]===0;)pr++;if(rr[pr++]!==1)throw new Error("decryption error");return rr.slice(pr)}function pkcs1(m,c,ne){for(var we=c.slice(0,2),Pe=2,Me=0;c[Pe++]!==0;)if(Pe>=c.length){Me++;break}var Ze=c.slice(2,Pe-1);if((we.toString("hex")!=="0002"&&!ne||we.toString("hex")!=="0001"&&ne)&&Me++,Ze.length<8&&Me++,Me)throw new Error("decryption error");return c.slice(Pe)}function compare$c(m,c){m=Buffer$1.from(m),c=Buffer$1.from(c);var ne=0,we=m.length;m.length!==c.length&&(ne++,we=Math.min(m.length,c.length));for(var Pe=-1;++Pe<we;)ne+=m[Pe]^c[Pe];return ne}(function(m){m.publicEncrypt=publicEncrypt,m.privateDecrypt=privateDecrypt,m.privateEncrypt=function(ne,we){return m.publicEncrypt(ne,we,!0)},m.publicDecrypt=function(ne,we){return m.privateDecrypt(ne,we,!0)}})(browser$2);var browser$1={};function oldBrowser(){throw new Error(`secure random number generation not supported by this browser
67
67
  use chrome, FireFox or Internet Explorer 11`)}var safeBuffer=safeBuffer$2.exports,randombytes=browser$c.exports,Buffer=safeBuffer.Buffer,kBufferMaxLength=safeBuffer.kMaxLength,crypto$1=commonjsGlobal.crypto||commonjsGlobal.msCrypto,kMaxUint32=Math.pow(2,32)-1;function assertOffset(m,c){if(typeof m!="number"||m!==m)throw new TypeError("offset must be a number");if(m>kMaxUint32||m<0)throw new TypeError("offset must be a uint32");if(m>kBufferMaxLength||m>c)throw new RangeError("offset out of range")}function assertSize(m,c,ne){if(typeof m!="number"||m!==m)throw new TypeError("size must be a number");if(m>kMaxUint32||m<0)throw new TypeError("size must be a uint32");if(m+c>ne||m>kBufferMaxLength)throw new RangeError("buffer too small")}crypto$1&&crypto$1.getRandomValues||!process$1.browser?(browser$1.randomFill=randomFill,browser$1.randomFillSync=randomFillSync):(browser$1.randomFill=oldBrowser,browser$1.randomFillSync=oldBrowser);function randomFill(m,c,ne,we){if(!Buffer.isBuffer(m)&&!(m instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof c=="function")we=c,c=0,ne=m.length;else if(typeof ne=="function")we=ne,ne=m.length-c;else if(typeof we!="function")throw new TypeError('"cb" argument must be a function');return assertOffset(c,m.length),assertSize(ne,c,m.length),actualFill(m,c,ne,we)}function actualFill(m,c,ne,we){if(process$1.browser){var Pe=m.buffer,Me=new Uint8Array(Pe,c,ne);if(crypto$1.getRandomValues(Me),we){process$1.nextTick(function(){we(null,m)});return}return m}if(we){randombytes(ne,function(ie,rr){if(ie)return we(ie);rr.copy(m,c),we(null,m)});return}var Ze=randombytes(ne);return Ze.copy(m,c),m}function randomFillSync(m,c,ne){if(typeof c>"u"&&(c=0),!Buffer.isBuffer(m)&&!(m instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return assertOffset(c,m.length),ne===void 0&&(ne=m.length-c),assertSize(ne,c,m.length),actualFill(m,c,ne)}var hasRequiredCryptoBrowserify;function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=browser$c.exports,cryptoBrowserify.createHash=cryptoBrowserify.Hash=browser$a,cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=browser$9;var m=algos.exports,c=Object.keys(m),ne=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(c);cryptoBrowserify.getHashes=function(){return ne};var we=browser$8;cryptoBrowserify.pbkdf2=we.pbkdf2,cryptoBrowserify.pbkdf2Sync=we.pbkdf2Sync;var Pe=browser$7;cryptoBrowserify.Cipher=Pe.Cipher,cryptoBrowserify.createCipher=Pe.createCipher,cryptoBrowserify.Cipheriv=Pe.Cipheriv,cryptoBrowserify.createCipheriv=Pe.createCipheriv,cryptoBrowserify.Decipher=Pe.Decipher,cryptoBrowserify.createDecipher=Pe.createDecipher,cryptoBrowserify.Decipheriv=Pe.Decipheriv,cryptoBrowserify.createDecipheriv=Pe.createDecipheriv,cryptoBrowserify.getCiphers=Pe.getCiphers,cryptoBrowserify.listCiphers=Pe.listCiphers;var Me=requireBrowser$2();cryptoBrowserify.DiffieHellmanGroup=Me.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=Me.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=Me.getDiffieHellman,cryptoBrowserify.createDiffieHellman=Me.createDiffieHellman,cryptoBrowserify.DiffieHellman=Me.DiffieHellman;var Ze=requireBrowser$1();cryptoBrowserify.createSign=Ze.createSign,cryptoBrowserify.Sign=Ze.Sign,cryptoBrowserify.createVerify=Ze.createVerify,cryptoBrowserify.Verify=Ze.Verify,cryptoBrowserify.createECDH=requireBrowser();var ie=browser$2;cryptoBrowserify.publicEncrypt=ie.publicEncrypt,cryptoBrowserify.privateEncrypt=ie.privateEncrypt,cryptoBrowserify.publicDecrypt=ie.publicDecrypt,cryptoBrowserify.privateDecrypt=ie.privateDecrypt;var rr=browser$1;return cryptoBrowserify.randomFill=rr.randomFill,cryptoBrowserify.randomFillSync=rr.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet
68
68
  we accept pull requests
69
- https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}var cryptoBrowserifyExports=requireCryptoBrowserify();function simpleHash(m){let c=0;for(let ne=0;ne<m.length;ne++){const we=m.charCodeAt(ne);c=(c<<5)-c+we,c&=c}return new Uint32Array([c])[0].toString(36)}function hashString(m,c="sha256"){const ne=cryptoBrowserifyExports.createHash(c);return ne.update(m),ne.digest("hex")}function hashObject(m,c="sha256"){return hashString(JSON.stringify(m),c)}function hash$1(m){const c=typeof m=="string"?m:JSON.stringify(m);return simpleHash(c)}const _hoisted_1$Q=["contenteditable","data-ghost"],_hoisted_2$C=["data-paragraph"],_sfc_main$14=vue.defineComponent({__name:"RichTextDisplay",props:{paragraphs:{},noLazy:{type:Boolean},ghost:{type:Boolean},debug:{type:Boolean}},emits:["update","focus","blur"],setup(m,{expose:c,emit:ne}){const we=m,Pe=ne,Me=vue.ref(),Ze=vue.ref(we.paragraphs);vue.watch(()=>we.paragraphs,()=>{we.noLazy&&(Ze.value=we.paragraphs)},{deep:!0}),vue.watchEffect(()=>{we.debug&&console.log("lazyParagraphs",Ze.value)});const ie=_r=>{Pe("update",_r)},rr=_r=>{Pe("focus",_r)},pr=_r=>{Pe("blur",_r)};nanoid();const or=_r=>{const Lr=Object.fromEntries(Object.entries(_r).filter(([,Pr])=>Pr!==void 0)),Br=`rich-text-${hashObject(Lr)}`;let Ar=document.querySelector(`[data-rich-text-global-style='${Br}']`);return Ar||(Ar=document.createElement("style"),Ar.lang="css",Ar.setAttribute("data-rich-text-global-style",Br),document.head.appendChild(Ar)),Ar.innerHTML=`.${Br} { ${Object.entries(Lr).map(([Pr,Nr])=>`${Pr}: ${Nr};`).join(" ")} }`,Br};return c({richTextEditorDivRef:Me}),(_r,Lr)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"richTextEditorDivRef",ref:Me,class:vue.normalizeClass(["rich-text-editor",{ghost:_r.ghost}]),contenteditable:!_r.ghost,onInput:ie,onFocus:rr,onBlur:pr,"data-ghost":_r.ghost},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ze.value,(Br,Ar)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:Ar},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Br,(Pr,Nr)=>vue.renderSlot(_r.$slots,"feature",{key:Nr,text:Pr.text,format:Pr.format,cssclass:or},void 0,!0)),128)),Ar<Ze.value.length-1?(vue.openBlock(),vue.createElementBlock("br",{key:0,"data-custom-br":"true","data-paragraph":JSON.stringify(Br)},null,8,_hoisted_2$C)):vue.createCommentVNode("",!0)],64))),128))],42,_hoisted_1$Q))}}),RichTextDisplay_vue_vue_type_style_index_0_scoped_a344d5e9_lang="",RichTextDisplay=_export_sfc(_sfc_main$14,[["__scopeId","data-v-a344d5e9"]]),_hoisted_1$P={class:"rich-text-wrapper"},_hoisted_2$B=["data-feature-format"],_hoisted_3$q=["data-feature-format"],_sfc_main$13=vue.defineComponent({__name:"RichText",props:{value:{},selection:{},userAgentRichText:{type:Boolean},renderFeatureInlineStyle:{},maxLength:{},maxLengthPerLine:{},maxLines:{},multiline:{type:Boolean,default:!0}},emits:["update:value","update:visible-value","update:selection","update:warning-message","update:focus"],setup(m,{expose:c,emit:ne}){const we=m,Pe=ne;vue.computed(()=>!we.multiline);const Me=vue.ref(),Ze=vue.ref(),ie=vue.computed(()=>Me.value?.richTextEditorDivRef),{handleInputEvent:rr,paragraphs:pr,visibleParagraphs:or,manipulationState:_r,applyFormat:Lr,resolveFeatures:Br,selection:Ar}=useContentEditable(ie,vue.toRef(we,"value"),{maxLength:we.maxLength,maxLengthPerLine:we.maxLengthPerLine,maxLines:we.maxLines}),Pr=si=>{we.multiline||si.key==="Enter"&&si.preventDefault()},Nr=vue.computed(()=>isEqual(pr.value,or.value)?void 0:"Text is too long");vue.watchEffect(()=>{Pe("update:warning-message",Nr.value)});const Yr=vue.ref(!1);vue.watch(Yr,()=>{Pe("update:focus",Yr.value)},{immediate:!0});const Vr=()=>{Yr.value=!0},Zr=()=>{Yr.value=!1};vue.watch(ie,(si,li)=>{li&&(li.removeEventListener("focus",Vr),li.removeEventListener("blur",Zr)),si&&(si.addEventListener("focus",Vr),si.addEventListener("blur",Zr))}),vue.watch(Ar,()=>{isEqual(Ar.value,we.selection)||Pe("update:selection",Ar.value??void 0)}),vue.watch(pr,()=>{isEqual(pr.value,we.value)||Pe("update:value",pr.value)}),vue.watch(or,()=>{Pe("update:visible-value",or.value)}),window.addEventListener("touchmove",si=>{Ar.value&&si.preventDefault()});let Wr;return vue.onMounted(()=>{if(!Ze.value?.richTextEditorDivRef)return;const si=(li,yi)=>{Me.value?.richTextEditorDivRef,Ze.value?.richTextEditorDivRef;for(const mi of li);};Wr=new MutationObserver(si),Wr.observe(Ze.value.richTextEditorDivRef,{attributes:!0,childList:!0,subtree:!0})}),vue.onUnmounted(()=>{Wr.disconnect()}),c({applyFormat:Lr,resolveFeatures:Br}),(si,li)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["rich-text",{focus:Yr.value}])},[vue.createElementVNode("div",_hoisted_1$P,[vue.createVNode(RichTextDisplay,{ref_key:"richTextDisplayGhostInstance",ref:Ze,paragraphs:vue.unref(or),"no-lazy":"",ghost:"",debug:!1},{feature:vue.withCtx(yi=>[vue.createElementVNode("span",{"data-feature-format":JSON.stringify(yi.format),class:vue.normalizeClass(["feature-wrapper feature-wrapper-ghost",{[yi.cssclass(si.renderFeatureInlineStyle(yi.format))]:!0,"line-overflow":!!yi.format.lineOverflow,overflow:!!yi.format.overflow}])},vue.toDisplayString(yi.text),11,_hoisted_2$B)]),_:1},8,["paragraphs"]),(vue.openBlock(),vue.createBlock(RichTextDisplay,{ref_key:"richTextDisplayInstance",ref:Me,key:vue.unref(_r),paragraphs:vue.unref(pr),onUpdate:vue.unref(rr),onKeydown:Pr,style:vue.normalizeStyle({"-webkit-user-modify":si.userAgentRichText?"read-write":"read-write-plaintext-only"})},{feature:vue.withCtx(yi=>[vue.createElementVNode("span",{"data-feature-format":JSON.stringify(yi.format),class:vue.normalizeClass(["feature-wrapper",{[yi.cssclass(si.renderFeatureInlineStyle(yi.format))]:!0}])},vue.toDisplayString(yi.text),11,_hoisted_3$q)]),_:1},8,["paragraphs","onUpdate","style"]))])],2))}}),RichText_vue_vue_type_style_index_0_scoped_3bf042ff_lang="",RichText=_export_sfc(_sfc_main$13,[["__scopeId","data-v-3bf042ff"]]),colorNames={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},reverseNames=Object.create(null);for(const m in colorNames)Object.hasOwn(colorNames,m)&&(reverseNames[colorNames[m]]=m);const cs={to:{},get:{}};cs.get=function(m){const c=m.slice(0,3).toLowerCase();let ne,we;switch(c){case"hsl":{ne=cs.get.hsl(m),we="hsl";break}case"hwb":{ne=cs.get.hwb(m),we="hwb";break}default:{ne=cs.get.rgb(m),we="rgb";break}}return ne?{model:we,value:ne}:null},cs.get.rgb=function(m){if(!m)return null;const c=/^#([a-f\d]{3,4})$/i,ne=/^#([a-f\d]{6})([a-f\d]{2})?$/i,we=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,Pe=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,Me=/^(\w+)$/;let Ze=[0,0,0,1],ie,rr,pr;if(ie=m.match(ne)){for(pr=ie[2],ie=ie[1],rr=0;rr<3;rr++){const or=rr*2;Ze[rr]=Number.parseInt(ie.slice(or,or+2),16)}pr&&(Ze[3]=Number.parseInt(pr,16)/255)}else if(ie=m.match(c)){for(ie=ie[1],pr=ie[3],rr=0;rr<3;rr++)Ze[rr]=Number.parseInt(ie[rr]+ie[rr],16);pr&&(Ze[3]=Number.parseInt(pr+pr,16)/255)}else if(ie=m.match(we)){for(rr=0;rr<3;rr++)Ze[rr]=Number.parseInt(ie[rr+1],10);ie[4]&&(Ze[3]=ie[5]?Number.parseFloat(ie[4])*.01:Number.parseFloat(ie[4]))}else if(ie=m.match(Pe)){for(rr=0;rr<3;rr++)Ze[rr]=Math.round(Number.parseFloat(ie[rr+1])*2.55);ie[4]&&(Ze[3]=ie[5]?Number.parseFloat(ie[4])*.01:Number.parseFloat(ie[4]))}else return(ie=m.match(Me))?ie[1]==="transparent"?[0,0,0,0]:Object.hasOwn(colorNames,ie[1])?(Ze=colorNames[ie[1]],Ze[3]=1,Ze):null:null;for(rr=0;rr<3;rr++)Ze[rr]=clamp$1(Ze[rr],0,255);return Ze[3]=clamp$1(Ze[3],0,1),Ze},cs.get.hsl=function(m){if(!m)return null;const c=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,ne=m.match(c);if(ne){const we=Number.parseFloat(ne[4]),Pe=(Number.parseFloat(ne[1])%360+360)%360,Me=clamp$1(Number.parseFloat(ne[2]),0,100),Ze=clamp$1(Number.parseFloat(ne[3]),0,100),ie=clamp$1(Number.isNaN(we)?1:we,0,1);return[Pe,Me,Ze,ie]}return null},cs.get.hwb=function(m){if(!m)return null;const c=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,ne=m.match(c);if(ne){const we=Number.parseFloat(ne[4]),Pe=(Number.parseFloat(ne[1])%360+360)%360,Me=clamp$1(Number.parseFloat(ne[2]),0,100),Ze=clamp$1(Number.parseFloat(ne[3]),0,100),ie=clamp$1(Number.isNaN(we)?1:we,0,1);return[Pe,Me,Ze,ie]}return null},cs.to.hex=function(...m){return"#"+hexDouble(m[0])+hexDouble(m[1])+hexDouble(m[2])+(m[3]<1?hexDouble(Math.round(m[3]*255)):"")},cs.to.rgb=function(...m){return m.length<4||m[3]===1?"rgb("+Math.round(m[0])+", "+Math.round(m[1])+", "+Math.round(m[2])+")":"rgba("+Math.round(m[0])+", "+Math.round(m[1])+", "+Math.round(m[2])+", "+m[3]+")"},cs.to.rgb.percent=function(...m){const c=Math.round(m[0]/255*100),ne=Math.round(m[1]/255*100),we=Math.round(m[2]/255*100);return m.length<4||m[3]===1?"rgb("+c+"%, "+ne+"%, "+we+"%)":"rgba("+c+"%, "+ne+"%, "+we+"%, "+m[3]+")"},cs.to.hsl=function(...m){return m.length<4||m[3]===1?"hsl("+m[0]+", "+m[1]+"%, "+m[2]+"%)":"hsla("+m[0]+", "+m[1]+"%, "+m[2]+"%, "+m[3]+")"},cs.to.hwb=function(...m){let c="";return m.length>=4&&m[3]!==1&&(c=", "+m[3]),"hwb("+m[0]+", "+m[1]+"%, "+m[2]+"%"+c+")"},cs.to.keyword=function(...m){return reverseNames[m.slice(0,3)]};function clamp$1(m,c,ne){return Math.min(Math.max(c,m),ne)}function hexDouble(m){const c=Math.round(m).toString(16).toUpperCase();return c.length<2?"0"+c:c}const cssKeywords={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},reverseKeywords={};for(const m of Object.keys(cssKeywords))reverseKeywords[cssKeywords[m]]=m;const convert$1={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},LAB_FT=(6/29)**3;for(const m of Object.keys(convert$1)){if(!("channels"in convert$1[m]))throw new Error("missing channels property: "+m);if(!("labels"in convert$1[m]))throw new Error("missing channel labels property: "+m);if(convert$1[m].labels.length!==convert$1[m].channels)throw new Error("channel and label counts mismatch: "+m);const{channels:c,labels:ne}=convert$1[m];delete convert$1[m].channels,delete convert$1[m].labels,Object.defineProperty(convert$1[m],"channels",{value:c}),Object.defineProperty(convert$1[m],"labels",{value:ne})}convert$1.rgb.hsl=function(m){const c=m[0]/255,ne=m[1]/255,we=m[2]/255,Pe=Math.min(c,ne,we),Me=Math.max(c,ne,we),Ze=Me-Pe;let ie,rr;switch(Me){case Pe:{ie=0;break}case c:{ie=(ne-we)/Ze;break}case ne:{ie=2+(we-c)/Ze;break}case we:{ie=4+(c-ne)/Ze;break}}ie=Math.min(ie*60,360),ie<0&&(ie+=360);const pr=(Pe+Me)/2;return Me===Pe?rr=0:pr<=.5?rr=Ze/(Me+Pe):rr=Ze/(2-Me-Pe),[ie,rr*100,pr*100]},convert$1.rgb.hsv=function(m){let c,ne,we,Pe,Me;const Ze=m[0]/255,ie=m[1]/255,rr=m[2]/255,pr=Math.max(Ze,ie,rr),or=pr-Math.min(Ze,ie,rr),_r=function(Lr){return(pr-Lr)/6/or+1/2};if(or===0)Pe=0,Me=0;else{switch(Me=or/pr,c=_r(Ze),ne=_r(ie),we=_r(rr),pr){case Ze:{Pe=we-ne;break}case ie:{Pe=1/3+c-we;break}case rr:{Pe=2/3+ne-c;break}}Pe<0?Pe+=1:Pe>1&&(Pe-=1)}return[Pe*360,Me*100,pr*100]},convert$1.rgb.hwb=function(m){const c=m[0],ne=m[1];let we=m[2];const Pe=convert$1.rgb.hsl(m)[0],Me=1/255*Math.min(c,Math.min(ne,we));return we=1-1/255*Math.max(c,Math.max(ne,we)),[Pe,Me*100,we*100]},convert$1.rgb.cmyk=function(m){const c=m[0]/255,ne=m[1]/255,we=m[2]/255,Pe=Math.min(1-c,1-ne,1-we),Me=(1-c-Pe)/(1-Pe)||0,Ze=(1-ne-Pe)/(1-Pe)||0,ie=(1-we-Pe)/(1-Pe)||0;return[Me*100,Ze*100,ie*100,Pe*100]};function comparativeDistance(m,c){return(m[0]-c[0])**2+(m[1]-c[1])**2+(m[2]-c[2])**2}convert$1.rgb.keyword=function(m){const c=reverseKeywords[m];if(c)return c;let ne=Number.POSITIVE_INFINITY,we;for(const Pe of Object.keys(cssKeywords)){const Me=cssKeywords[Pe],Ze=comparativeDistance(m,Me);Ze<ne&&(ne=Ze,we=Pe)}return we},convert$1.keyword.rgb=function(m){return cssKeywords[m]},convert$1.rgb.xyz=function(m){let c=m[0]/255,ne=m[1]/255,we=m[2]/255;c=c>.04045?((c+.055)/1.055)**2.4:c/12.92,ne=ne>.04045?((ne+.055)/1.055)**2.4:ne/12.92,we=we>.04045?((we+.055)/1.055)**2.4:we/12.92;const Pe=c*.4124564+ne*.3575761+we*.1804375,Me=c*.2126729+ne*.7151522+we*.072175,Ze=c*.0193339+ne*.119192+we*.9503041;return[Pe*100,Me*100,Ze*100]},convert$1.rgb.lab=function(m){const c=convert$1.rgb.xyz(m);let ne=c[0],we=c[1],Pe=c[2];ne/=95.047,we/=100,Pe/=108.883,ne=ne>LAB_FT?ne**(1/3):7.787*ne+16/116,we=we>LAB_FT?we**(1/3):7.787*we+16/116,Pe=Pe>LAB_FT?Pe**(1/3):7.787*Pe+16/116;const Me=116*we-16,Ze=500*(ne-we),ie=200*(we-Pe);return[Me,Ze,ie]},convert$1.hsl.rgb=function(m){const c=m[0]/360,ne=m[1]/100,we=m[2]/100;let Pe,Me;if(ne===0)return Me=we*255,[Me,Me,Me];const Ze=we<.5?we*(1+ne):we+ne-we*ne,ie=2*we-Ze,rr=[0,0,0];for(let pr=0;pr<3;pr++)Pe=c+1/3*-(pr-1),Pe<0&&Pe++,Pe>1&&Pe--,6*Pe<1?Me=ie+(Ze-ie)*6*Pe:2*Pe<1?Me=Ze:3*Pe<2?Me=ie+(Ze-ie)*(2/3-Pe)*6:Me=ie,rr[pr]=Me*255;return rr},convert$1.hsl.hsv=function(m){const c=m[0];let ne=m[1]/100,we=m[2]/100,Pe=ne;const Me=Math.max(we,.01);we*=2,ne*=we<=1?we:2-we,Pe*=Me<=1?Me:2-Me;const Ze=(we+ne)/2,ie=we===0?2*Pe/(Me+Pe):2*ne/(we+ne);return[c,ie*100,Ze*100]},convert$1.hsv.rgb=function(m){const c=m[0]/60,ne=m[1]/100;let we=m[2]/100;const Pe=Math.floor(c)%6,Me=c-Math.floor(c),Ze=255*we*(1-ne),ie=255*we*(1-ne*Me),rr=255*we*(1-ne*(1-Me));switch(we*=255,Pe){case 0:return[we,rr,Ze];case 1:return[ie,we,Ze];case 2:return[Ze,we,rr];case 3:return[Ze,ie,we];case 4:return[rr,Ze,we];case 5:return[we,Ze,ie]}},convert$1.hsv.hsl=function(m){const c=m[0],ne=m[1]/100,we=m[2]/100,Pe=Math.max(we,.01);let Me,Ze;Ze=(2-ne)*we;const ie=(2-ne)*Pe;return Me=ne*Pe,Me/=ie<=1?ie:2-ie,Me=Me||0,Ze/=2,[c,Me*100,Ze*100]},convert$1.hwb.rgb=function(m){const c=m[0]/360;let ne=m[1]/100,we=m[2]/100;const Pe=ne+we;let Me;Pe>1&&(ne/=Pe,we/=Pe);const Ze=Math.floor(6*c),ie=1-we;Me=6*c-Ze,(Ze&1)!==0&&(Me=1-Me);const rr=ne+Me*(ie-ne);let pr,or,_r;switch(Ze){default:case 6:case 0:{pr=ie,or=rr,_r=ne;break}case 1:{pr=rr,or=ie,_r=ne;break}case 2:{pr=ne,or=ie,_r=rr;break}case 3:{pr=ne,or=rr,_r=ie;break}case 4:{pr=rr,or=ne,_r=ie;break}case 5:{pr=ie,or=ne,_r=rr;break}}return[pr*255,or*255,_r*255]},convert$1.cmyk.rgb=function(m){const c=m[0]/100,ne=m[1]/100,we=m[2]/100,Pe=m[3]/100,Me=1-Math.min(1,c*(1-Pe)+Pe),Ze=1-Math.min(1,ne*(1-Pe)+Pe),ie=1-Math.min(1,we*(1-Pe)+Pe);return[Me*255,Ze*255,ie*255]},convert$1.xyz.rgb=function(m){const c=m[0]/100,ne=m[1]/100,we=m[2]/100;let Pe,Me,Ze;return Pe=c*3.2404542+ne*-1.5371385+we*-.4985314,Me=c*-.969266+ne*1.8760108+we*.041556,Ze=c*.0556434+ne*-.2040259+we*1.0572252,Pe=Pe>.0031308?1.055*Pe**(1/2.4)-.055:Pe*12.92,Me=Me>.0031308?1.055*Me**(1/2.4)-.055:Me*12.92,Ze=Ze>.0031308?1.055*Ze**(1/2.4)-.055:Ze*12.92,Pe=Math.min(Math.max(0,Pe),1),Me=Math.min(Math.max(0,Me),1),Ze=Math.min(Math.max(0,Ze),1),[Pe*255,Me*255,Ze*255]},convert$1.xyz.lab=function(m){let c=m[0],ne=m[1],we=m[2];c/=95.047,ne/=100,we/=108.883,c=c>LAB_FT?c**(1/3):7.787*c+16/116,ne=ne>LAB_FT?ne**(1/3):7.787*ne+16/116,we=we>LAB_FT?we**(1/3):7.787*we+16/116;const Pe=116*ne-16,Me=500*(c-ne),Ze=200*(ne-we);return[Pe,Me,Ze]},convert$1.lab.xyz=function(m){const c=m[0],ne=m[1],we=m[2];let Pe,Me,Ze;Me=(c+16)/116,Pe=ne/500+Me,Ze=Me-we/200;const ie=Me**3,rr=Pe**3,pr=Ze**3;return Me=ie>LAB_FT?ie:(Me-16/116)/7.787,Pe=rr>LAB_FT?rr:(Pe-16/116)/7.787,Ze=pr>LAB_FT?pr:(Ze-16/116)/7.787,Pe*=95.047,Me*=100,Ze*=108.883,[Pe,Me,Ze]},convert$1.lab.lch=function(m){const c=m[0],ne=m[1],we=m[2];let Pe;Pe=Math.atan2(we,ne)*360/2/Math.PI,Pe<0&&(Pe+=360);const Ze=Math.sqrt(ne*ne+we*we);return[c,Ze,Pe]},convert$1.lch.lab=function(m){const c=m[0],ne=m[1],Pe=m[2]/360*2*Math.PI,Me=ne*Math.cos(Pe),Ze=ne*Math.sin(Pe);return[c,Me,Ze]},convert$1.rgb.ansi16=function(m,c=null){const[ne,we,Pe]=m;let Me=c===null?convert$1.rgb.hsv(m)[2]:c;if(Me=Math.round(Me/50),Me===0)return 30;let Ze=30+(Math.round(Pe/255)<<2|Math.round(we/255)<<1|Math.round(ne/255));return Me===2&&(Ze+=60),Ze},convert$1.hsv.ansi16=function(m){return convert$1.rgb.ansi16(convert$1.hsv.rgb(m),m[2])},convert$1.rgb.ansi256=function(m){const c=m[0],ne=m[1],we=m[2];return c>>4===ne>>4&&ne>>4===we>>4?c<8?16:c>248?231:Math.round((c-8)/247*24)+232:16+36*Math.round(c/255*5)+6*Math.round(ne/255*5)+Math.round(we/255*5)},convert$1.ansi16.rgb=function(m){m=m[0];let c=m%10;if(c===0||c===7)return m>50&&(c+=3.5),c=c/10.5*255,[c,c,c];const ne=(Math.trunc(m>50)+1)*.5,we=(c&1)*ne*255,Pe=(c>>1&1)*ne*255,Me=(c>>2&1)*ne*255;return[we,Pe,Me]},convert$1.ansi256.rgb=function(m){if(m=m[0],m>=232){const Me=(m-232)*10+8;return[Me,Me,Me]}m-=16;let c;const ne=Math.floor(m/36)/5*255,we=Math.floor((c=m%36)/6)/5*255,Pe=c%6/5*255;return[ne,we,Pe]},convert$1.rgb.hex=function(m){const ne=(((Math.round(m[0])&255)<<16)+((Math.round(m[1])&255)<<8)+(Math.round(m[2])&255)).toString(16).toUpperCase();return"000000".slice(ne.length)+ne},convert$1.hex.rgb=function(m){const c=m.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!c)return[0,0,0];let ne=c[0];c[0].length===3&&(ne=[...ne].map(ie=>ie+ie).join(""));const we=Number.parseInt(ne,16),Pe=we>>16&255,Me=we>>8&255,Ze=we&255;return[Pe,Me,Ze]},convert$1.rgb.hcg=function(m){const c=m[0]/255,ne=m[1]/255,we=m[2]/255,Pe=Math.max(Math.max(c,ne),we),Me=Math.min(Math.min(c,ne),we),Ze=Pe-Me;let ie;const rr=Ze<1?Me/(1-Ze):0;return Ze<=0?ie=0:Pe===c?ie=(ne-we)/Ze%6:Pe===ne?ie=2+(we-c)/Ze:ie=4+(c-ne)/Ze,ie/=6,ie%=1,[ie*360,Ze*100,rr*100]},convert$1.hsl.hcg=function(m){const c=m[1]/100,ne=m[2]/100,we=ne<.5?2*c*ne:2*c*(1-ne);let Pe=0;return we<1&&(Pe=(ne-.5*we)/(1-we)),[m[0],we*100,Pe*100]},convert$1.hsv.hcg=function(m){const c=m[1]/100,ne=m[2]/100,we=c*ne;let Pe=0;return we<1&&(Pe=(ne-we)/(1-we)),[m[0],we*100,Pe*100]},convert$1.hcg.rgb=function(m){const c=m[0]/360,ne=m[1]/100,we=m[2]/100;if(ne===0)return[we*255,we*255,we*255];const Pe=[0,0,0],Me=c%1*6,Ze=Me%1,ie=1-Ze;let rr=0;switch(Math.floor(Me)){case 0:{Pe[0]=1,Pe[1]=Ze,Pe[2]=0;break}case 1:{Pe[0]=ie,Pe[1]=1,Pe[2]=0;break}case 2:{Pe[0]=0,Pe[1]=1,Pe[2]=Ze;break}case 3:{Pe[0]=0,Pe[1]=ie,Pe[2]=1;break}case 4:{Pe[0]=Ze,Pe[1]=0,Pe[2]=1;break}default:Pe[0]=1,Pe[1]=0,Pe[2]=ie}return rr=(1-ne)*we,[(ne*Pe[0]+rr)*255,(ne*Pe[1]+rr)*255,(ne*Pe[2]+rr)*255]},convert$1.hcg.hsv=function(m){const c=m[1]/100,ne=m[2]/100,we=c+ne*(1-c);let Pe=0;return we>0&&(Pe=c/we),[m[0],Pe*100,we*100]},convert$1.hcg.hsl=function(m){const c=m[1]/100,we=m[2]/100*(1-c)+.5*c;let Pe=0;return we>0&&we<.5?Pe=c/(2*we):we>=.5&&we<1&&(Pe=c/(2*(1-we))),[m[0],Pe*100,we*100]},convert$1.hcg.hwb=function(m){const c=m[1]/100,ne=m[2]/100,we=c+ne*(1-c);return[m[0],(we-c)*100,(1-we)*100]},convert$1.hwb.hcg=function(m){const c=m[1]/100,we=1-m[2]/100,Pe=we-c;let Me=0;return Pe<1&&(Me=(we-Pe)/(1-Pe)),[m[0],Pe*100,Me*100]},convert$1.apple.rgb=function(m){return[m[0]/65535*255,m[1]/65535*255,m[2]/65535*255]},convert$1.rgb.apple=function(m){return[m[0]/255*65535,m[1]/255*65535,m[2]/255*65535]},convert$1.gray.rgb=function(m){return[m[0]/100*255,m[0]/100*255,m[0]/100*255]},convert$1.gray.hsl=function(m){return[0,0,m[0]]},convert$1.gray.hsv=convert$1.gray.hsl,convert$1.gray.hwb=function(m){return[0,100,m[0]]},convert$1.gray.cmyk=function(m){return[0,0,0,m[0]]},convert$1.gray.lab=function(m){return[m[0],0,0]},convert$1.gray.hex=function(m){const c=Math.round(m[0]/100*255)&255,we=((c<<16)+(c<<8)+c).toString(16).toUpperCase();return"000000".slice(we.length)+we},convert$1.rgb.gray=function(m){return[(m[0]+m[1]+m[2])/3/255*100]};function buildGraph(){const m={},c=Object.keys(convert$1);for(let{length:ne}=c,we=0;we<ne;we++)m[c[we]]={distance:-1,parent:null};return m}function deriveBFS(m){const c=buildGraph(),ne=[m];for(c[m].distance=0;ne.length>0;){const we=ne.pop(),Pe=Object.keys(convert$1[we]);for(let{length:Me}=Pe,Ze=0;Ze<Me;Ze++){const ie=Pe[Ze],rr=c[ie];rr.distance===-1&&(rr.distance=c[we].distance+1,rr.parent=we,ne.unshift(ie))}}return c}function link(m,c){return function(ne){return c(m(ne))}}function wrapConversion(m,c){const ne=[c[m].parent,m];let we=convert$1[c[m].parent][m],Pe=c[m].parent;for(;c[Pe].parent;)ne.unshift(c[Pe].parent),we=link(convert$1[c[Pe].parent][Pe],we),Pe=c[Pe].parent;return we.conversion=ne,we}function route(m){const c=deriveBFS(m),ne={},we=Object.keys(c);for(let{length:Pe}=we,Me=0;Me<Pe;Me++){const Ze=we[Me];c[Ze].parent!==null&&(ne[Ze]=wrapConversion(Ze,c))}return ne}const convert={},models=Object.keys(convert$1);function wrapRaw(m){const c=function(...ne){const we=ne[0];return we==null?we:(we.length>1&&(ne=we),m(ne))};return"conversion"in m&&(c.conversion=m.conversion),c}function wrapRounded(m){const c=function(...ne){const we=ne[0];if(we==null)return we;we.length>1&&(ne=we);const Pe=m(ne);if(typeof Pe=="object")for(let{length:Me}=Pe,Ze=0;Ze<Me;Ze++)Pe[Ze]=Math.round(Pe[Ze]);return Pe};return"conversion"in m&&(c.conversion=m.conversion),c}for(const m of models){convert[m]={},Object.defineProperty(convert[m],"channels",{value:convert$1[m].channels}),Object.defineProperty(convert[m],"labels",{value:convert$1[m].labels});const c=route(m),ne=Object.keys(c);for(const we of ne){const Pe=c[we];convert[m][we]=wrapRounded(Pe),convert[m][we].raw=wrapRaw(Pe)}}const skippedModels=["keyword","gray","hex"],hashedModelKeys={};for(const m of Object.keys(convert))hashedModelKeys[[...convert[m].labels].sort().join("")]=m;const limiters={};function Color$1(m,c){if(!(this instanceof Color$1))return new Color$1(m,c);if(c&&c in skippedModels&&(c=null),c&&!(c in convert))throw new Error("Unknown model: "+c);let ne,we;if(m==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(m instanceof Color$1)this.model=m.model,this.color=[...m.color],this.valpha=m.valpha;else if(typeof m=="string"){const Pe=cs.get(m);if(Pe===null)throw new Error("Unable to parse color from string: "+m);this.model=Pe.model,we=convert[this.model].channels,this.color=Pe.value.slice(0,we),this.valpha=typeof Pe.value[we]=="number"?Pe.value[we]:1}else if(m.length>0){this.model=c||"rgb",we=convert[this.model].channels;const Pe=Array.prototype.slice.call(m,0,we);this.color=zeroArray(Pe,we),this.valpha=typeof m[we]=="number"?m[we]:1}else if(typeof m=="number")this.model="rgb",this.color=[m>>16&255,m>>8&255,m&255],this.valpha=1;else{this.valpha=1;const Pe=Object.keys(m);"alpha"in m&&(Pe.splice(Pe.indexOf("alpha"),1),this.valpha=typeof m.alpha=="number"?m.alpha:0);const Me=Pe.sort().join("");if(!(Me in hashedModelKeys))throw new Error("Unable to parse color from object: "+JSON.stringify(m));this.model=hashedModelKeys[Me];const{labels:Ze}=convert[this.model],ie=[];for(ne=0;ne<Ze.length;ne++)ie.push(m[Ze[ne]]);this.color=zeroArray(ie)}if(limiters[this.model])for(we=convert[this.model].channels,ne=0;ne<we;ne++){const Pe=limiters[this.model][ne];Pe&&(this.color[ne]=Pe(this.color[ne]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Color$1.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(m){let c=this.model in cs.to?this:this.rgb();c=c.round(typeof m=="number"?m:1);const ne=c.valpha===1?c.color:[...c.color,this.valpha];return cs.to[c.model](...ne)},percentString(m){const c=this.rgb().round(typeof m=="number"?m:1),ne=c.valpha===1?c.color:[...c.color,this.valpha];return cs.to.rgb.percent(...ne)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const m={},{channels:c}=convert[this.model],{labels:ne}=convert[this.model];for(let we=0;we<c;we++)m[ne[we]]=this.color[we];return this.valpha!==1&&(m.alpha=this.valpha),m},unitArray(){const m=this.rgb().color;return m[0]/=255,m[1]/=255,m[2]/=255,this.valpha!==1&&m.push(this.valpha),m},unitObject(){const m=this.rgb().object();return m.r/=255,m.g/=255,m.b/=255,this.valpha!==1&&(m.alpha=this.valpha),m},round(m){return m=Math.max(m||0,0),new Color$1([...this.color.map(roundToPlace(m)),this.valpha],this.model)},alpha(m){return m!==void 0?new Color$1([...this.color,Math.max(0,Math.min(1,m))],this.model):this.valpha},red:getset("rgb",0,maxfn(255)),green:getset("rgb",1,maxfn(255)),blue:getset("rgb",2,maxfn(255)),hue:getset(["hsl","hsv","hsl","hwb","hcg"],0,m=>(m%360+360)%360),saturationl:getset("hsl",1,maxfn(100)),lightness:getset("hsl",2,maxfn(100)),saturationv:getset("hsv",1,maxfn(100)),value:getset("hsv",2,maxfn(100)),chroma:getset("hcg",1,maxfn(100)),gray:getset("hcg",2,maxfn(100)),white:getset("hwb",1,maxfn(100)),wblack:getset("hwb",2,maxfn(100)),cyan:getset("cmyk",0,maxfn(100)),magenta:getset("cmyk",1,maxfn(100)),yellow:getset("cmyk",2,maxfn(100)),black:getset("cmyk",3,maxfn(100)),x:getset("xyz",0,maxfn(95.047)),y:getset("xyz",1,maxfn(100)),z:getset("xyz",2,maxfn(108.833)),l:getset("lab",0,maxfn(100)),a:getset("lab",1),b:getset("lab",2),keyword(m){return m!==void 0?new Color$1(m):convert[this.model].keyword(this.color)},hex(m){return m!==void 0?new Color$1(m):cs.to.hex(...this.rgb().round().color)},hexa(m){if(m!==void 0)return new Color$1(m);const c=this.rgb().round().color;let ne=Math.round(this.valpha*255).toString(16).toUpperCase();return ne.length===1&&(ne="0"+ne),cs.to.hex(...c)+ne},rgbNumber(){const m=this.rgb().color;return(m[0]&255)<<16|(m[1]&255)<<8|m[2]&255},luminosity(){const m=this.rgb().color,c=[];for(const[ne,we]of m.entries()){const Pe=we/255;c[ne]=Pe<=.04045?Pe/12.92:((Pe+.055)/1.055)**2.4}return .2126*c[0]+.7152*c[1]+.0722*c[2]},contrast(m){const c=this.luminosity(),ne=m.luminosity();return c>ne?(c+.05)/(ne+.05):(ne+.05)/(c+.05)},level(m){const c=this.contrast(m);return c>=7?"AAA":c>=4.5?"AA":""},isDark(){const m=this.rgb().color;return(m[0]*2126+m[1]*7152+m[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const m=this.rgb();for(let c=0;c<3;c++)m.color[c]=255-m.color[c];return m},lighten(m){const c=this.hsl();return c.color[2]+=c.color[2]*m,c},darken(m){const c=this.hsl();return c.color[2]-=c.color[2]*m,c},saturate(m){const c=this.hsl();return c.color[1]+=c.color[1]*m,c},desaturate(m){const c=this.hsl();return c.color[1]-=c.color[1]*m,c},whiten(m){const c=this.hwb();return c.color[1]+=c.color[1]*m,c},blacken(m){const c=this.hwb();return c.color[2]+=c.color[2]*m,c},grayscale(){const m=this.rgb().color,c=m[0]*.3+m[1]*.59+m[2]*.11;return Color$1.rgb(c,c,c)},fade(m){return this.alpha(this.valpha-this.valpha*m)},opaquer(m){return this.alpha(this.valpha+this.valpha*m)},rotate(m){const c=this.hsl();let ne=c.color[0];return ne=(ne+m)%360,ne=ne<0?360+ne:ne,c.color[0]=ne,c},mix(m,c){if(!m||!m.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof m);const ne=m.rgb(),we=this.rgb(),Pe=c===void 0?.5:c,Me=2*Pe-1,Ze=ne.alpha()-we.alpha(),ie=((Me*Ze===-1?Me:(Me+Ze)/(1+Me*Ze))+1)/2,rr=1-ie;return Color$1.rgb(ie*ne.red()+rr*we.red(),ie*ne.green()+rr*we.green(),ie*ne.blue()+rr*we.blue(),ne.alpha()*Pe+we.alpha()*(1-Pe))}};for(const m of Object.keys(convert)){if(skippedModels.includes(m))continue;const{channels:c}=convert[m];Color$1.prototype[m]=function(...ne){return this.model===m?new Color$1(this):ne.length>0?new Color$1(ne,m):new Color$1([...assertArray(convert[this.model][m].raw(this.color)),this.valpha],m)},Color$1[m]=function(...ne){let we=ne[0];return typeof we=="number"&&(we=zeroArray(ne,c)),new Color$1(we,m)}}function roundTo(m,c){return Number(m.toFixed(c))}function roundToPlace(m){return function(c){return roundTo(c,m)}}function getset(m,c,ne){m=Array.isArray(m)?m:[m];for(const we of m)(limiters[we]||=[])[c]=ne;return m=m[0],function(we){let Pe;return we!==void 0?(ne&&(we=ne(we)),Pe=this[m](),Pe.color[c]=we,Pe):(Pe=this[m]().color[c],ne&&(Pe=ne(Pe)),Pe)}}function maxfn(m){return function(c){return Math.max(0,Math.min(m,c))}}function assertArray(m){return Array.isArray(m)?m:[m]}function zeroArray(m,c){for(let ne=0;ne<c;ne++)typeof m[ne]!="number"&&(m[ne]=0);return m}const _sfc_main$12=vue.defineComponent({__name:"BxRichtextInput",props:vue.mergeModels({userAgentRichText:{type:Boolean,default:!0},multiline:{type:Boolean,default:!0},maxLength:{default:1/0},maxLengthPerLine:{default:1/0},maxLines:{default:1/0}},{modelValue:{required:!0},modelModifiers:{},selection:{required:!0},selectionModifiers:{}}),emits:vue.mergeModels(["update:raw-text","update:focus"],["update:modelValue","update:selection"]),setup(m,{expose:c,emit:ne}){const we=vue.useModel(m,"modelValue"),Pe=ne,Me=vue.useModel(m,"selection"),Ze=Ar=>Ar.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),ie=Ar=>{const Pr=(()=>{if(Ar.customClass){if(Ar.customClassUIRepresentation==="bold")return{"font-weight":600};if(Ar.customClassUIRepresentation==="italic")return{"font-style":"italic"};if(Ar.customClassUIRepresentation==="textColor")return{color:Ar.customClassUIRepresentationColor??"#ff0000"};if(Ar.customClassUIRepresentation==="backgrundColor")return{backgroundColor:Ar.customClassUIRepresentationColor??"#ff0000",color:Color$1(Ar.customClassUIRepresentationColor??"#ff0000").isDark()?"white":"black"}}else return{}})(),Nr={...Object.fromEntries(Object.entries({...Ar,...(()=>Ar.customClass==="list-item"?{display:"block",marginLeft:"1em"}:{})()}).map(([Yr,Vr])=>{const Zr=Ze(Yr);return[Zr,(()=>Zr==="font-size"&&typeof Vr=="number"?`${Vr}px`:Vr)()]})),...Pr};return console.log("renderFeatureInlineStyle",Ar,Nr),Nr},rr=vue.ref(groupFeatureByLinebreaks$1(typeof we.value=="string"?[{text:we.value,format:{}}]:we.value));vue.watch(rr,Ar=>{const Pr=ungroupFeaturesDividedByLinebreaks(Ar);isEqual(Pr,we.value)||(we.value=Pr)}),vue.watch(we,()=>{const Ar=groupFeatureByLinebreaks$1(typeof we.value=="string"?[{text:we.value,format:{}}]:we.value);isEqual(Ar,we.value)||(rr.value=Ar)});const pr=vue.ref(rr.value),or=vue.computed(()=>getRawText(pr.value));vue.watch(or,()=>{Pe("update:raw-text",or.value)},{immediate:!0});const _r=vue.ref(),Lr=vue.ref(),Br=vue.ref(!1);return vue.watch(Br,()=>{Pe("update:focus",Br.value)},{immediate:!0}),c({richTextInstance:Lr}),(Ar,Pr)=>(vue.openBlock(),vue.createBlock(RichText,{ref_key:"richTextInstance",ref:Lr,selection:Me.value,"onUpdate:selection":Pr[0]||(Pr[0]=Nr=>Me.value=Nr),value:rr.value,"onUpdate:value":Pr[1]||(Pr[1]=Nr=>rr.value=Nr),"onUpdate:visibleValue":Pr[2]||(Pr[2]=Nr=>pr.value=Nr),"render-feature-inline-style":ie,"user-agent-rich-text":Ar.userAgentRichText,"max-length":Ar.maxLength,"max-length-per-line":Ar.maxLengthPerLine,"max-lines":Ar.maxLines,multiline:Ar.multiline,"onUpdate:warningMessage":Pr[3]||(Pr[3]=Nr=>_r.value=Nr),focus:Br.value,"onUpdate:focus":Pr[4]||(Pr[4]=Nr=>Br.value=Nr),class:vue.normalizeClass({warning:!!_r.value})},null,8,["selection","value","user-agent-rich-text","max-length","max-length-per-line","max-lines","multiline","focus","class"]))}}),BxRichtextInput_vue_vue_type_style_index_0_scoped_0864687f_lang="",BxRichtextInput=_export_sfc(_sfc_main$12,[["__scopeId","data-v-0864687f"]]),sides=["top","right","bottom","left"],alignments=["start","end"],placements=sides.reduce((m,c)=>m.concat(c,c+"-"+alignments[0],c+"-"+alignments[1]),[]),min=Math.min,max=Math.max,round=Math.round,createCoords=m=>({x:m,y:m}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp(m,c,ne){return max(m,min(c,ne))}function evaluate(m,c){return typeof m=="function"?m(c):m}function getSide(m){return m.split("-")[0]}function getAlignment(m){return m.split("-")[1]}function getOppositeAxis(m){return m==="x"?"y":"x"}function getAxisLength(m){return m==="y"?"height":"width"}function getSideAxis(m){return["top","bottom"].includes(getSide(m))?"y":"x"}function getAlignmentAxis(m){return getOppositeAxis(getSideAxis(m))}function getAlignmentSides(m,c,ne){ne===void 0&&(ne=!1);const we=getAlignment(m),Pe=getAlignmentAxis(m),Me=getAxisLength(Pe);let Ze=Pe==="x"?we===(ne?"end":"start")?"right":"left":we==="start"?"bottom":"top";return c.reference[Me]>c.floating[Me]&&(Ze=getOppositePlacement(Ze)),[Ze,getOppositePlacement(Ze)]}function getExpandedPlacements(m){const c=getOppositePlacement(m);return[getOppositeAlignmentPlacement(m),c,getOppositeAlignmentPlacement(c)]}function getOppositeAlignmentPlacement(m){return m.replace(/start|end/g,c=>oppositeAlignmentMap[c])}function getSideList(m,c,ne){const we=["left","right"],Pe=["right","left"],Me=["top","bottom"],Ze=["bottom","top"];switch(m){case"top":case"bottom":return ne?c?Pe:we:c?we:Pe;case"left":case"right":return c?Me:Ze;default:return[]}}function getOppositeAxisPlacements(m,c,ne,we){const Pe=getAlignment(m);let Me=getSideList(getSide(m),ne==="start",we);return Pe&&(Me=Me.map(Ze=>Ze+"-"+Pe),c&&(Me=Me.concat(Me.map(getOppositeAlignmentPlacement)))),Me}function getOppositePlacement(m){return m.replace(/left|right|bottom|top/g,c=>oppositeSideMap[c])}function expandPaddingObject(m){return{top:0,right:0,bottom:0,left:0,...m}}function getPaddingObject(m){return typeof m!="number"?expandPaddingObject(m):{top:m,right:m,bottom:m,left:m}}function rectToClientRect(m){const{x:c,y:ne,width:we,height:Pe}=m;return{width:we,height:Pe,top:ne,left:c,right:c+we,bottom:ne+Pe,x:c,y:ne}}function computeCoordsFromPlacement(m,c,ne){let{reference:we,floating:Pe}=m;const Me=getSideAxis(c),Ze=getAlignmentAxis(c),ie=getAxisLength(Ze),rr=getSide(c),pr=Me==="y",or=we.x+we.width/2-Pe.width/2,_r=we.y+we.height/2-Pe.height/2,Lr=we[ie]/2-Pe[ie]/2;let Br;switch(rr){case"top":Br={x:or,y:we.y-Pe.height};break;case"bottom":Br={x:or,y:we.y+we.height};break;case"right":Br={x:we.x+we.width,y:_r};break;case"left":Br={x:we.x-Pe.width,y:_r};break;default:Br={x:we.x,y:we.y}}switch(getAlignment(c)){case"start":Br[Ze]-=Lr*(ne&&pr?-1:1);break;case"end":Br[Ze]+=Lr*(ne&&pr?-1:1);break}return Br}const computePosition$1=async(m,c,ne)=>{const{placement:we="bottom",strategy:Pe="absolute",middleware:Me=[],platform:Ze}=ne,ie=Me.filter(Boolean),rr=await(Ze.isRTL==null?void 0:Ze.isRTL(c));let pr=await Ze.getElementRects({reference:m,floating:c,strategy:Pe}),{x:or,y:_r}=computeCoordsFromPlacement(pr,we,rr),Lr=we,Br={},Ar=0;for(let Pr=0;Pr<ie.length;Pr++){const{name:Nr,fn:Yr}=ie[Pr],{x:Vr,y:Zr,data:Wr,reset:si}=await Yr({x:or,y:_r,initialPlacement:we,placement:Lr,strategy:Pe,middlewareData:Br,rects:pr,platform:Ze,elements:{reference:m,floating:c}});or=Vr??or,_r=Zr??_r,Br={...Br,[Nr]:{...Br[Nr],...Wr}},si&&Ar<=50&&(Ar++,typeof si=="object"&&(si.placement&&(Lr=si.placement),si.rects&&(pr=si.rects===!0?await Ze.getElementRects({reference:m,floating:c,strategy:Pe}):si.rects),{x:or,y:_r}=computeCoordsFromPlacement(pr,Lr,rr)),Pr=-1)}return{x:or,y:_r,placement:Lr,strategy:Pe,middlewareData:Br}};async function detectOverflow(m,c){var ne;c===void 0&&(c={});const{x:we,y:Pe,platform:Me,rects:Ze,elements:ie,strategy:rr}=m,{boundary:pr="clippingAncestors",rootBoundary:or="viewport",elementContext:_r="floating",altBoundary:Lr=!1,padding:Br=0}=evaluate(c,m),Ar=getPaddingObject(Br),Nr=ie[Lr?_r==="floating"?"reference":"floating":_r],Yr=rectToClientRect(await Me.getClippingRect({element:(ne=await(Me.isElement==null?void 0:Me.isElement(Nr)))==null||ne?Nr:Nr.contextElement||await(Me.getDocumentElement==null?void 0:Me.getDocumentElement(ie.floating)),boundary:pr,rootBoundary:or,strategy:rr})),Vr=_r==="floating"?{x:we,y:Pe,width:Ze.floating.width,height:Ze.floating.height}:Ze.reference,Zr=await(Me.getOffsetParent==null?void 0:Me.getOffsetParent(ie.floating)),Wr=await(Me.isElement==null?void 0:Me.isElement(Zr))?await(Me.getScale==null?void 0:Me.getScale(Zr))||{x:1,y:1}:{x:1,y:1},si=rectToClientRect(Me.convertOffsetParentRelativeRectToViewportRelativeRect?await Me.convertOffsetParentRelativeRectToViewportRelativeRect({elements:ie,rect:Vr,offsetParent:Zr,strategy:rr}):Vr);return{top:(Yr.top-si.top+Ar.top)/Wr.y,bottom:(si.bottom-Yr.bottom+Ar.bottom)/Wr.y,left:(Yr.left-si.left+Ar.left)/Wr.x,right:(si.right-Yr.right+Ar.right)/Wr.x}}const arrow=m=>({name:"arrow",options:m,async fn(c){const{x:ne,y:we,placement:Pe,rects:Me,platform:Ze,elements:ie,middlewareData:rr}=c,{element:pr,padding:or=0}=evaluate(m,c)||{};if(pr==null)return{};const _r=getPaddingObject(or),Lr={x:ne,y:we},Br=getAlignmentAxis(Pe),Ar=getAxisLength(Br),Pr=await Ze.getDimensions(pr),Nr=Br==="y",Yr=Nr?"top":"left",Vr=Nr?"bottom":"right",Zr=Nr?"clientHeight":"clientWidth",Wr=Me.reference[Ar]+Me.reference[Br]-Lr[Br]-Me.floating[Ar],si=Lr[Br]-Me.reference[Br],li=await(Ze.getOffsetParent==null?void 0:Ze.getOffsetParent(pr));let yi=li?li[Zr]:0;(!yi||!await(Ze.isElement==null?void 0:Ze.isElement(li)))&&(yi=ie.floating[Zr]||Me.floating[Ar]);const mi=Wr/2-si/2,oi=yi/2-Pr[Ar]/2-1,ui=min(_r[Yr],oi),gr=min(_r[Vr],oi),Ae=ui,ze=yi-Pr[Ar]-gr,Ue=yi/2-Pr[Ar]/2+mi,tr=clamp(Ae,Ue,ze),lr=!rr.arrow&&getAlignment(Pe)!=null&&Ue!==tr&&Me.reference[Ar]/2-(Ue<Ae?ui:gr)-Pr[Ar]/2<0,vr=lr?Ue<Ae?Ue-Ae:Ue-ze:0;return{[Br]:Lr[Br]+vr,data:{[Br]:tr,centerOffset:Ue-tr-vr,...lr&&{alignmentOffset:vr}},reset:lr}}});function getPlacementList(m,c,ne){return(m?[...ne.filter(Pe=>getAlignment(Pe)===m),...ne.filter(Pe=>getAlignment(Pe)!==m)]:ne.filter(Pe=>getSide(Pe)===Pe)).filter(Pe=>m?getAlignment(Pe)===m||(c?getOppositeAlignmentPlacement(Pe)!==Pe:!1):!0)}const autoPlacement$1=function(m){return m===void 0&&(m={}),{name:"autoPlacement",options:m,async fn(c){var ne,we,Pe;const{rects:Me,middlewareData:Ze,placement:ie,platform:rr,elements:pr}=c,{crossAxis:or=!1,alignment:_r,allowedPlacements:Lr=placements,autoAlignment:Br=!0,...Ar}=evaluate(m,c),Pr=_r!==void 0||Lr===placements?getPlacementList(_r||null,Br,Lr):Lr,Nr=await detectOverflow(c,Ar),Yr=((ne=Ze.autoPlacement)==null?void 0:ne.index)||0,Vr=Pr[Yr];if(Vr==null)return{};const Zr=getAlignmentSides(Vr,Me,await(rr.isRTL==null?void 0:rr.isRTL(pr.floating)));if(ie!==Vr)return{reset:{placement:Pr[0]}};const Wr=[Nr[getSide(Vr)],Nr[Zr[0]],Nr[Zr[1]]],si=[...((we=Ze.autoPlacement)==null?void 0:we.overflows)||[],{placement:Vr,overflows:Wr}],li=Pr[Yr+1];if(li)return{data:{index:Yr+1,overflows:si},reset:{placement:li}};const yi=si.map(ui=>{const gr=getAlignment(ui.placement);return[ui.placement,gr&&or?ui.overflows.slice(0,2).reduce((Ae,ze)=>Ae+ze,0):ui.overflows[0],ui.overflows]}).sort((ui,gr)=>ui[1]-gr[1]),oi=((Pe=yi.filter(ui=>ui[2].slice(0,getAlignment(ui[0])?2:3).every(gr=>gr<=0))[0])==null?void 0:Pe[0])||yi[0][0];return oi!==ie?{data:{index:Yr+1,overflows:si},reset:{placement:oi}}:{}}}},flip=function(m){return m===void 0&&(m={}),{name:"flip",options:m,async fn(c){var ne,we;const{placement:Pe,middlewareData:Me,rects:Ze,initialPlacement:ie,platform:rr,elements:pr}=c,{mainAxis:or=!0,crossAxis:_r=!0,fallbackPlacements:Lr,fallbackStrategy:Br="bestFit",fallbackAxisSideDirection:Ar="none",flipAlignment:Pr=!0,...Nr}=evaluate(m,c);if((ne=Me.arrow)!=null&&ne.alignmentOffset)return{};const Yr=getSide(Pe),Vr=getSideAxis(ie),Zr=getSide(ie)===ie,Wr=await(rr.isRTL==null?void 0:rr.isRTL(pr.floating)),si=Lr||(Zr||!Pr?[getOppositePlacement(ie)]:getExpandedPlacements(ie)),li=Ar!=="none";!Lr&&li&&si.push(...getOppositeAxisPlacements(ie,Pr,Ar,Wr));const yi=[ie,...si],mi=await detectOverflow(c,Nr),oi=[];let ui=((we=Me.flip)==null?void 0:we.overflows)||[];if(or&&oi.push(mi[Yr]),_r){const Ue=getAlignmentSides(Pe,Ze,Wr);oi.push(mi[Ue[0]],mi[Ue[1]])}if(ui=[...ui,{placement:Pe,overflows:oi}],!oi.every(Ue=>Ue<=0)){var gr,Ae;const Ue=(((gr=Me.flip)==null?void 0:gr.index)||0)+1,tr=yi[Ue];if(tr)return{data:{index:Ue,overflows:ui},reset:{placement:tr}};let lr=(Ae=ui.filter(vr=>vr.overflows[0]<=0).sort((vr,xr)=>vr.overflows[1]-xr.overflows[1])[0])==null?void 0:Ae.placement;if(!lr)switch(Br){case"bestFit":{var ze;const vr=(ze=ui.filter(xr=>{if(li){const nr=getSideAxis(xr.placement);return nr===Vr||nr==="y"}return!0}).map(xr=>[xr.placement,xr.overflows.filter(nr=>nr>0).reduce((nr,$e)=>nr+$e,0)]).sort((xr,nr)=>xr[1]-nr[1])[0])==null?void 0:ze[0];vr&&(lr=vr);break}case"initialPlacement":lr=ie;break}if(Pe!==lr)return{reset:{placement:lr}}}return{}}}};function getSideOffsets(m,c){return{top:m.top-c.height,right:m.right-c.width,bottom:m.bottom-c.height,left:m.left-c.width}}function isAnySideFullyClipped(m){return sides.some(c=>m[c]>=0)}const hide=function(m){return m===void 0&&(m={}),{name:"hide",options:m,async fn(c){const{rects:ne}=c,{strategy:we="referenceHidden",...Pe}=evaluate(m,c);switch(we){case"referenceHidden":{const Me=await detectOverflow(c,{...Pe,elementContext:"reference"}),Ze=getSideOffsets(Me,ne.reference);return{data:{referenceHiddenOffsets:Ze,referenceHidden:isAnySideFullyClipped(Ze)}}}case"escaped":{const Me=await detectOverflow(c,{...Pe,altBoundary:!0}),Ze=getSideOffsets(Me,ne.floating);return{data:{escapedOffsets:Ze,escaped:isAnySideFullyClipped(Ze)}}}default:return{}}}}};function getBoundingRect(m){const c=min(...m.map(Me=>Me.left)),ne=min(...m.map(Me=>Me.top)),we=max(...m.map(Me=>Me.right)),Pe=max(...m.map(Me=>Me.bottom));return{x:c,y:ne,width:we-c,height:Pe-ne}}function getRectsByLine(m){const c=m.slice().sort((Pe,Me)=>Pe.y-Me.y),ne=[];let we=null;for(let Pe=0;Pe<c.length;Pe++){const Me=c[Pe];!we||Me.y-we.y>we.height/2?ne.push([Me]):ne[ne.length-1].push(Me),we=Me}return ne.map(Pe=>rectToClientRect(getBoundingRect(Pe)))}const inline=function(m){return m===void 0&&(m={}),{name:"inline",options:m,async fn(c){const{placement:ne,elements:we,rects:Pe,platform:Me,strategy:Ze}=c,{padding:ie=2,x:rr,y:pr}=evaluate(m,c),or=Array.from(await(Me.getClientRects==null?void 0:Me.getClientRects(we.reference))||[]),_r=getRectsByLine(or),Lr=rectToClientRect(getBoundingRect(or)),Br=getPaddingObject(ie);function Ar(){if(_r.length===2&&_r[0].left>_r[1].right&&rr!=null&&pr!=null)return _r.find(Nr=>rr>Nr.left-Br.left&&rr<Nr.right+Br.right&&pr>Nr.top-Br.top&&pr<Nr.bottom+Br.bottom)||Lr;if(_r.length>=2){if(getSideAxis(ne)==="y"){const ui=_r[0],gr=_r[_r.length-1],Ae=getSide(ne)==="top",ze=ui.top,Ue=gr.bottom,tr=Ae?ui.left:gr.left,lr=Ae?ui.right:gr.right,vr=lr-tr,xr=Ue-ze;return{top:ze,bottom:Ue,left:tr,right:lr,width:vr,height:xr,x:tr,y:ze}}const Nr=getSide(ne)==="left",Yr=max(..._r.map(ui=>ui.right)),Vr=min(..._r.map(ui=>ui.left)),Zr=_r.filter(ui=>Nr?ui.left===Vr:ui.right===Yr),Wr=Zr[0].top,si=Zr[Zr.length-1].bottom,li=Vr,yi=Yr,mi=yi-li,oi=si-Wr;return{top:Wr,bottom:si,left:li,right:yi,width:mi,height:oi,x:li,y:Wr}}return Lr}const Pr=await Me.getElementRects({reference:{getBoundingClientRect:Ar},floating:we.floating,strategy:Ze});return Pe.reference.x!==Pr.reference.x||Pe.reference.y!==Pr.reference.y||Pe.reference.width!==Pr.reference.width||Pe.reference.height!==Pr.reference.height?{reset:{rects:Pr}}:{}}}};async function convertValueToCoords(m,c){const{placement:ne,platform:we,elements:Pe}=m,Me=await(we.isRTL==null?void 0:we.isRTL(Pe.floating)),Ze=getSide(ne),ie=getAlignment(ne),rr=getSideAxis(ne)==="y",pr=["left","top"].includes(Ze)?-1:1,or=Me&&rr?-1:1,_r=evaluate(c,m);let{mainAxis:Lr,crossAxis:Br,alignmentAxis:Ar}=typeof _r=="number"?{mainAxis:_r,crossAxis:0,alignmentAxis:null}:{mainAxis:_r.mainAxis||0,crossAxis:_r.crossAxis||0,alignmentAxis:_r.alignmentAxis};return ie&&typeof Ar=="number"&&(Br=ie==="end"?Ar*-1:Ar),rr?{x:Br*or,y:Lr*pr}:{x:Lr*pr,y:Br*or}}const offset$1=function(m){return m===void 0&&(m=0),{name:"offset",options:m,async fn(c){var ne,we;const{x:Pe,y:Me,placement:Ze,middlewareData:ie}=c,rr=await convertValueToCoords(c,m);return Ze===((ne=ie.offset)==null?void 0:ne.placement)&&(we=ie.arrow)!=null&&we.alignmentOffset?{}:{x:Pe+rr.x,y:Me+rr.y,data:{...rr,placement:Ze}}}}},shift$1=function(m){return m===void 0&&(m={}),{name:"shift",options:m,async fn(c){const{x:ne,y:we,placement:Pe}=c,{mainAxis:Me=!0,crossAxis:Ze=!1,limiter:ie={fn:Nr=>{let{x:Yr,y:Vr}=Nr;return{x:Yr,y:Vr}}},...rr}=evaluate(m,c),pr={x:ne,y:we},or=await detectOverflow(c,rr),_r=getSideAxis(getSide(Pe)),Lr=getOppositeAxis(_r);let Br=pr[Lr],Ar=pr[_r];if(Me){const Nr=Lr==="y"?"top":"left",Yr=Lr==="y"?"bottom":"right",Vr=Br+or[Nr],Zr=Br-or[Yr];Br=clamp(Vr,Br,Zr)}if(Ze){const Nr=_r==="y"?"top":"left",Yr=_r==="y"?"bottom":"right",Vr=Ar+or[Nr],Zr=Ar-or[Yr];Ar=clamp(Vr,Ar,Zr)}const Pr=ie.fn({...c,[Lr]:Br,[_r]:Ar});return{...Pr,data:{x:Pr.x-ne,y:Pr.y-we,enabled:{[Lr]:Me,[_r]:Ze}}}}}},limitShift=function(m){return m===void 0&&(m={}),{options:m,fn(c){const{x:ne,y:we,placement:Pe,rects:Me,middlewareData:Ze}=c,{offset:ie=0,mainAxis:rr=!0,crossAxis:pr=!0}=evaluate(m,c),or={x:ne,y:we},_r=getSideAxis(Pe),Lr=getOppositeAxis(_r);let Br=or[Lr],Ar=or[_r];const Pr=evaluate(ie,c),Nr=typeof Pr=="number"?{mainAxis:Pr,crossAxis:0}:{mainAxis:0,crossAxis:0,...Pr};if(rr){const Zr=Lr==="y"?"height":"width",Wr=Me.reference[Lr]-Me.floating[Zr]+Nr.mainAxis,si=Me.reference[Lr]+Me.reference[Zr]-Nr.mainAxis;Br<Wr?Br=Wr:Br>si&&(Br=si)}if(pr){var Yr,Vr;const Zr=Lr==="y"?"width":"height",Wr=["top","left"].includes(getSide(Pe)),si=Me.reference[_r]-Me.floating[Zr]+(Wr&&((Yr=Ze.offset)==null?void 0:Yr[_r])||0)+(Wr?0:Nr.crossAxis),li=Me.reference[_r]+Me.reference[Zr]+(Wr?0:((Vr=Ze.offset)==null?void 0:Vr[_r])||0)-(Wr?Nr.crossAxis:0);Ar<si?Ar=si:Ar>li&&(Ar=li)}return{[Lr]:Br,[_r]:Ar}}}},size$1=function(m){return m===void 0&&(m={}),{name:"size",options:m,async fn(c){var ne,we;const{placement:Pe,rects:Me,platform:Ze,elements:ie}=c,{apply:rr=()=>{},...pr}=evaluate(m,c),or=await detectOverflow(c,pr),_r=getSide(Pe),Lr=getAlignment(Pe),Br=getSideAxis(Pe)==="y",{width:Ar,height:Pr}=Me.floating;let Nr,Yr;_r==="top"||_r==="bottom"?(Nr=_r,Yr=Lr===(await(Ze.isRTL==null?void 0:Ze.isRTL(ie.floating))?"start":"end")?"left":"right"):(Yr=_r,Nr=Lr==="end"?"top":"bottom");const Vr=Pr-or.top-or.bottom,Zr=Ar-or.left-or.right,Wr=min(Pr-or[Nr],Vr),si=min(Ar-or[Yr],Zr),li=!c.middlewareData.shift;let yi=Wr,mi=si;if((ne=c.middlewareData.shift)!=null&&ne.enabled.x&&(mi=Zr),(we=c.middlewareData.shift)!=null&&we.enabled.y&&(yi=Vr),li&&!Lr){const ui=max(or.left,0),gr=max(or.right,0),Ae=max(or.top,0),ze=max(or.bottom,0);Br?mi=Ar-2*(ui!==0||gr!==0?ui+gr:max(or.left,or.right)):yi=Pr-2*(Ae!==0||ze!==0?Ae+ze:max(or.top,or.bottom))}await rr({...c,availableWidth:mi,availableHeight:yi});const oi=await Ze.getDimensions(ie.floating);return Ar!==oi.width||Pr!==oi.height?{reset:{rects:!0}}:{}}}};function hasWindow(){return typeof window<"u"}function getNodeName(m){return isNode$1(m)?(m.nodeName||"").toLowerCase():"#document"}function getWindow$1(m){var c;return(m==null||(c=m.ownerDocument)==null?void 0:c.defaultView)||window}function getDocumentElement(m){var c;return(c=(isNode$1(m)?m.ownerDocument:m.document)||window.document)==null?void 0:c.documentElement}function isNode$1(m){return hasWindow()?m instanceof Node||m instanceof getWindow$1(m).Node:!1}function isElement$1(m){return hasWindow()?m instanceof Element||m instanceof getWindow$1(m).Element:!1}function isHTMLElement(m){return hasWindow()?m instanceof HTMLElement||m instanceof getWindow$1(m).HTMLElement:!1}function isShadowRoot(m){return!hasWindow()||typeof ShadowRoot>"u"?!1:m instanceof ShadowRoot||m instanceof getWindow$1(m).ShadowRoot}function isOverflowElement(m){const{overflow:c,overflowX:ne,overflowY:we,display:Pe}=getComputedStyle$2(m);return/auto|scroll|overlay|hidden|clip/.test(c+we+ne)&&!["inline","contents"].includes(Pe)}function isTableElement(m){return["table","td","th"].includes(getNodeName(m))}function isTopLayer(m){return[":popover-open",":modal"].some(c=>{try{return m.matches(c)}catch{return!1}})}function isContainingBlock(m){const c=isWebKit(),ne=isElement$1(m)?getComputedStyle$2(m):m;return["transform","translate","scale","rotate","perspective"].some(we=>ne[we]?ne[we]!=="none":!1)||(ne.containerType?ne.containerType!=="normal":!1)||!c&&(ne.backdropFilter?ne.backdropFilter!=="none":!1)||!c&&(ne.filter?ne.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(we=>(ne.willChange||"").includes(we))||["paint","layout","strict","content"].some(we=>(ne.contain||"").includes(we))}function getContainingBlock(m){let c=getParentNode(m);for(;isHTMLElement(c)&&!isLastTraversableNode(c);){if(isContainingBlock(c))return c;if(isTopLayer(c))return null;c=getParentNode(c)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(m){return["html","body","#document"].includes(getNodeName(m))}function getComputedStyle$2(m){return getWindow$1(m).getComputedStyle(m)}function getNodeScroll(m){return isElement$1(m)?{scrollLeft:m.scrollLeft,scrollTop:m.scrollTop}:{scrollLeft:m.scrollX,scrollTop:m.scrollY}}function getParentNode(m){if(getNodeName(m)==="html")return m;const c=m.assignedSlot||m.parentNode||isShadowRoot(m)&&m.host||getDocumentElement(m);return isShadowRoot(c)?c.host:c}function getNearestOverflowAncestor(m){const c=getParentNode(m);return isLastTraversableNode(c)?m.ownerDocument?m.ownerDocument.body:m.body:isHTMLElement(c)&&isOverflowElement(c)?c:getNearestOverflowAncestor(c)}function getOverflowAncestors(m,c,ne){var we;c===void 0&&(c=[]),ne===void 0&&(ne=!0);const Pe=getNearestOverflowAncestor(m),Me=Pe===((we=m.ownerDocument)==null?void 0:we.body),Ze=getWindow$1(Pe);if(Me){const ie=getFrameElement(Ze);return c.concat(Ze,Ze.visualViewport||[],isOverflowElement(Pe)?Pe:[],ie&&ne?getOverflowAncestors(ie):[])}return c.concat(Pe,getOverflowAncestors(Pe,[],ne))}function getFrameElement(m){return m.parent&&Object.getPrototypeOf(m.parent)?m.frameElement:null}function getCssDimensions(m){const c=getComputedStyle$2(m);let ne=parseFloat(c.width)||0,we=parseFloat(c.height)||0;const Pe=isHTMLElement(m),Me=Pe?m.offsetWidth:ne,Ze=Pe?m.offsetHeight:we,ie=round(ne)!==Me||round(we)!==Ze;return ie&&(ne=Me,we=Ze),{width:ne,height:we,$:ie}}function unwrapElement$1(m){return isElement$1(m)?m:m.contextElement}function getScale(m){const c=unwrapElement$1(m);if(!isHTMLElement(c))return createCoords(1);const ne=c.getBoundingClientRect(),{width:we,height:Pe,$:Me}=getCssDimensions(c);let Ze=(Me?round(ne.width):ne.width)/we,ie=(Me?round(ne.height):ne.height)/Pe;return(!Ze||!Number.isFinite(Ze))&&(Ze=1),(!ie||!Number.isFinite(ie))&&(ie=1),{x:Ze,y:ie}}const noOffsets=createCoords(0);function getVisualOffsets(m){const c=getWindow$1(m);return!isWebKit()||!c.visualViewport?noOffsets:{x:c.visualViewport.offsetLeft,y:c.visualViewport.offsetTop}}function shouldAddVisualOffsets(m,c,ne){return c===void 0&&(c=!1),!ne||c&&ne!==getWindow$1(m)?!1:c}function getBoundingClientRect(m,c,ne,we){c===void 0&&(c=!1),ne===void 0&&(ne=!1);const Pe=m.getBoundingClientRect(),Me=unwrapElement$1(m);let Ze=createCoords(1);c&&(we?isElement$1(we)&&(Ze=getScale(we)):Ze=getScale(m));const ie=shouldAddVisualOffsets(Me,ne,we)?getVisualOffsets(Me):createCoords(0);let rr=(Pe.left+ie.x)/Ze.x,pr=(Pe.top+ie.y)/Ze.y,or=Pe.width/Ze.x,_r=Pe.height/Ze.y;if(Me){const Lr=getWindow$1(Me),Br=we&&isElement$1(we)?getWindow$1(we):we;let Ar=Lr,Pr=getFrameElement(Ar);for(;Pr&&we&&Br!==Ar;){const Nr=getScale(Pr),Yr=Pr.getBoundingClientRect(),Vr=getComputedStyle$2(Pr),Zr=Yr.left+(Pr.clientLeft+parseFloat(Vr.paddingLeft))*Nr.x,Wr=Yr.top+(Pr.clientTop+parseFloat(Vr.paddingTop))*Nr.y;rr*=Nr.x,pr*=Nr.y,or*=Nr.x,_r*=Nr.y,rr+=Zr,pr+=Wr,Ar=getWindow$1(Pr),Pr=getFrameElement(Ar)}}return rectToClientRect({width:or,height:_r,x:rr,y:pr})}function getWindowScrollBarX(m,c){const ne=getNodeScroll(m).scrollLeft;return c?c.left+ne:getBoundingClientRect(getDocumentElement(m)).left+ne}function getHTMLOffset(m,c,ne){ne===void 0&&(ne=!1);const we=m.getBoundingClientRect(),Pe=we.left+c.scrollLeft-(ne?0:getWindowScrollBarX(m,we)),Me=we.top+c.scrollTop;return{x:Pe,y:Me}}function convertOffsetParentRelativeRectToViewportRelativeRect(m){let{elements:c,rect:ne,offsetParent:we,strategy:Pe}=m;const Me=Pe==="fixed",Ze=getDocumentElement(we),ie=c?isTopLayer(c.floating):!1;if(we===Ze||ie&&Me)return ne;let rr={scrollLeft:0,scrollTop:0},pr=createCoords(1);const or=createCoords(0),_r=isHTMLElement(we);if((_r||!_r&&!Me)&&((getNodeName(we)!=="body"||isOverflowElement(Ze))&&(rr=getNodeScroll(we)),isHTMLElement(we))){const Br=getBoundingClientRect(we);pr=getScale(we),or.x=Br.x+we.clientLeft,or.y=Br.y+we.clientTop}const Lr=Ze&&!_r&&!Me?getHTMLOffset(Ze,rr,!0):createCoords(0);return{width:ne.width*pr.x,height:ne.height*pr.y,x:ne.x*pr.x-rr.scrollLeft*pr.x+or.x+Lr.x,y:ne.y*pr.y-rr.scrollTop*pr.y+or.y+Lr.y}}function getClientRects(m){return Array.from(m.getClientRects())}function getDocumentRect(m){const c=getDocumentElement(m),ne=getNodeScroll(m),we=m.ownerDocument.body,Pe=max(c.scrollWidth,c.clientWidth,we.scrollWidth,we.clientWidth),Me=max(c.scrollHeight,c.clientHeight,we.scrollHeight,we.clientHeight);let Ze=-ne.scrollLeft+getWindowScrollBarX(m);const ie=-ne.scrollTop;return getComputedStyle$2(we).direction==="rtl"&&(Ze+=max(c.clientWidth,we.clientWidth)-Pe),{width:Pe,height:Me,x:Ze,y:ie}}function getViewportRect(m,c){const ne=getWindow$1(m),we=getDocumentElement(m),Pe=ne.visualViewport;let Me=we.clientWidth,Ze=we.clientHeight,ie=0,rr=0;if(Pe){Me=Pe.width,Ze=Pe.height;const pr=isWebKit();(!pr||pr&&c==="fixed")&&(ie=Pe.offsetLeft,rr=Pe.offsetTop)}return{width:Me,height:Ze,x:ie,y:rr}}function getInnerBoundingClientRect(m,c){const ne=getBoundingClientRect(m,!0,c==="fixed"),we=ne.top+m.clientTop,Pe=ne.left+m.clientLeft,Me=isHTMLElement(m)?getScale(m):createCoords(1),Ze=m.clientWidth*Me.x,ie=m.clientHeight*Me.y,rr=Pe*Me.x,pr=we*Me.y;return{width:Ze,height:ie,x:rr,y:pr}}function getClientRectFromClippingAncestor(m,c,ne){let we;if(c==="viewport")we=getViewportRect(m,ne);else if(c==="document")we=getDocumentRect(getDocumentElement(m));else if(isElement$1(c))we=getInnerBoundingClientRect(c,ne);else{const Pe=getVisualOffsets(m);we={x:c.x-Pe.x,y:c.y-Pe.y,width:c.width,height:c.height}}return rectToClientRect(we)}function hasFixedPositionAncestor(m,c){const ne=getParentNode(m);return ne===c||!isElement$1(ne)||isLastTraversableNode(ne)?!1:getComputedStyle$2(ne).position==="fixed"||hasFixedPositionAncestor(ne,c)}function getClippingElementAncestors(m,c){const ne=c.get(m);if(ne)return ne;let we=getOverflowAncestors(m,[],!1).filter(ie=>isElement$1(ie)&&getNodeName(ie)!=="body"),Pe=null;const Me=getComputedStyle$2(m).position==="fixed";let Ze=Me?getParentNode(m):m;for(;isElement$1(Ze)&&!isLastTraversableNode(Ze);){const ie=getComputedStyle$2(Ze),rr=isContainingBlock(Ze);!rr&&ie.position==="fixed"&&(Pe=null),(Me?!rr&&!Pe:!rr&&ie.position==="static"&&!!Pe&&["absolute","fixed"].includes(Pe.position)||isOverflowElement(Ze)&&!rr&&hasFixedPositionAncestor(m,Ze))?we=we.filter(or=>or!==Ze):Pe=ie,Ze=getParentNode(Ze)}return c.set(m,we),we}function getClippingRect(m){let{element:c,boundary:ne,rootBoundary:we,strategy:Pe}=m;const Ze=[...ne==="clippingAncestors"?isTopLayer(c)?[]:getClippingElementAncestors(c,this._c):[].concat(ne),we],ie=Ze[0],rr=Ze.reduce((pr,or)=>{const _r=getClientRectFromClippingAncestor(c,or,Pe);return pr.top=max(_r.top,pr.top),pr.right=min(_r.right,pr.right),pr.bottom=min(_r.bottom,pr.bottom),pr.left=max(_r.left,pr.left),pr},getClientRectFromClippingAncestor(c,ie,Pe));return{width:rr.right-rr.left,height:rr.bottom-rr.top,x:rr.left,y:rr.top}}function getDimensions(m){const{width:c,height:ne}=getCssDimensions(m);return{width:c,height:ne}}function getRectRelativeToOffsetParent(m,c,ne){const we=isHTMLElement(c),Pe=getDocumentElement(c),Me=ne==="fixed",Ze=getBoundingClientRect(m,!0,Me,c);let ie={scrollLeft:0,scrollTop:0};const rr=createCoords(0);if(we||!we&&!Me)if((getNodeName(c)!=="body"||isOverflowElement(Pe))&&(ie=getNodeScroll(c)),we){const Lr=getBoundingClientRect(c,!0,Me,c);rr.x=Lr.x+c.clientLeft,rr.y=Lr.y+c.clientTop}else Pe&&(rr.x=getWindowScrollBarX(Pe));const pr=Pe&&!we&&!Me?getHTMLOffset(Pe,ie):createCoords(0),or=Ze.left+ie.scrollLeft-rr.x-pr.x,_r=Ze.top+ie.scrollTop-rr.y-pr.y;return{x:or,y:_r,width:Ze.width,height:Ze.height}}function isStaticPositioned(m){return getComputedStyle$2(m).position==="static"}function getTrueOffsetParent(m,c){if(!isHTMLElement(m)||getComputedStyle$2(m).position==="fixed")return null;if(c)return c(m);let ne=m.offsetParent;return getDocumentElement(m)===ne&&(ne=ne.ownerDocument.body),ne}function getOffsetParent(m,c){const ne=getWindow$1(m);if(isTopLayer(m))return ne;if(!isHTMLElement(m)){let Pe=getParentNode(m);for(;Pe&&!isLastTraversableNode(Pe);){if(isElement$1(Pe)&&!isStaticPositioned(Pe))return Pe;Pe=getParentNode(Pe)}return ne}let we=getTrueOffsetParent(m,c);for(;we&&isTableElement(we)&&isStaticPositioned(we);)we=getTrueOffsetParent(we,c);return we&&isLastTraversableNode(we)&&isStaticPositioned(we)&&!isContainingBlock(we)?ne:we||getContainingBlock(m)||ne}const getElementRects=async function(m){const c=this.getOffsetParent||getOffsetParent,ne=this.getDimensions,we=await ne(m.floating);return{reference:getRectRelativeToOffsetParent(m.reference,await c(m.floating),m.strategy),floating:{x:0,y:0,width:we.width,height:we.height}}};function isRTL(m){return getComputedStyle$2(m).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement:isElement$1,isRTL},offset=offset$1,autoPlacement=autoPlacement$1,shift=shift$1,size=size$1,computePosition=(m,c,ne)=>{const we=new Map,Pe={platform,...ne},Me={...Pe.platform,_c:we};return computePosition$1(m,c,{...Pe,platform:Me})};function isComponentPublicInstance(m){return m!=null&&typeof m=="object"&&"$el"in m}function unwrapElement(m){if(isComponentPublicInstance(m)){const c=m.$el;return isNode$1(c)&&getNodeName(c)==="#comment"?null:c}return m}function toValue$1(m){return typeof m=="function"?m():vue.unref(m)}function getDPR(m){return typeof window>"u"?1:(m.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(m,c){const ne=getDPR(m);return Math.round(c*ne)/ne}function useFloating(m,c,ne){ne===void 0&&(ne={});const we=ne.whileElementsMounted,Pe=vue.computed(()=>{var yi;return(yi=toValue$1(ne.open))!=null?yi:!0}),Me=vue.computed(()=>toValue$1(ne.middleware)),Ze=vue.computed(()=>{var yi;return(yi=toValue$1(ne.placement))!=null?yi:"bottom"}),ie=vue.computed(()=>{var yi;return(yi=toValue$1(ne.strategy))!=null?yi:"absolute"}),rr=vue.computed(()=>{var yi;return(yi=toValue$1(ne.transform))!=null?yi:!0}),pr=vue.computed(()=>unwrapElement(m.value)),or=vue.computed(()=>unwrapElement(c.value)),_r=vue.ref(0),Lr=vue.ref(0),Br=vue.ref(ie.value),Ar=vue.ref(Ze.value),Pr=vue.shallowRef({}),Nr=vue.ref(!1),Yr=vue.computed(()=>{const yi={position:Br.value,left:"0",top:"0"};if(!or.value)return yi;const mi=roundByDPR(or.value,_r.value),oi=roundByDPR(or.value,Lr.value);return rr.value?{...yi,transform:"translate("+mi+"px, "+oi+"px)",...getDPR(or.value)>=1.5&&{willChange:"transform"}}:{position:Br.value,left:mi+"px",top:oi+"px"}});let Vr;function Zr(){if(pr.value==null||or.value==null)return;const yi=Pe.value;computePosition(pr.value,or.value,{middleware:Me.value,placement:Ze.value,strategy:ie.value}).then(mi=>{_r.value=mi.x,Lr.value=mi.y,Br.value=mi.strategy,Ar.value=mi.placement,Pr.value=mi.middlewareData,Nr.value=yi!==!1})}function Wr(){typeof Vr=="function"&&(Vr(),Vr=void 0)}function si(){if(Wr(),we===void 0){Zr();return}if(pr.value!=null&&or.value!=null){Vr=we(pr.value,or.value,Zr);return}}function li(){Pe.value||(Nr.value=!1)}return vue.watch([Me,Ze,ie,Pe],Zr,{flush:"sync"}),vue.watch([pr,or],si,{flush:"sync"}),vue.watch(Pe,li,{flush:"sync"}),vue.getCurrentScope()&&vue.onScopeDispose(Wr),{x:vue.shallowReadonly(_r),y:vue.shallowReadonly(Lr),strategy:vue.shallowReadonly(Br),placement:vue.shallowReadonly(Ar),middlewareData:vue.shallowReadonly(Pr),isPositioned:vue.shallowReadonly(Nr),floatingStyles:Yr,update:Zr}}const _hoisted_1$O=["data-bx-popover-id"],_hoisted_2$A=["data-origin","data-placement"],_hoisted_3$p={class:"popover-inner"},_sfc_main$11=vue.defineComponent({__name:"PopoverElement",props:{floatingElement:{},styles:{},customClasses:{},alignment:{},allowedPlacements:{},arrow:{type:Boolean},bxPopoverId:{},noPointerEvents:{type:Boolean,default:!1},overflowVisible:{type:Boolean}},emits:["close","click-outside","mouseenter","mouseleave"],setup(m,{emit:c}){const ne=m,we=c,Pe=vue.computed(()=>ne.floatingElement),Me=vue.ref(),{floatingStyles:Ze,placement:ie,middlewareData:rr}=useFloating(Pe,Me,{middleware:[autoPlacement({autoAlignment:!0,alignment:ne.alignment,allowedPlacements:ne.allowedPlacements}),shift({padding:0}),size({apply({availableWidth:Ar,availableHeight:Pr,elements:Nr}){Nr.floating.style.setProperty("--min-width",`calc(${Ar}px - 70px)`),Nr.floating.style.setProperty("--min-height",`calc(${Pr}px - 70px)`)}})]});function pr(Ar){we("mouseenter",Ar)}function or(Ar){we("mouseleave",Ar)}const _r=vue.computed(()=>{switch(ie.value){case"right":return[0,.5];case"left":return[1,.5];case"top":return[.5,1];case"bottom":return[.5,0];case"bottom-end":return[1,0];case"bottom-start":return[0,0];case"top-end":return[1,1];case"top-start":return[0,1];case"right-end":return[0,0];case"right-start":return[0,1];case"left-end":return[1,0];case"left-start":return[1,1];default:return[.5,.5]}}),Lr=Ar=>{Ar.stopPropagation()},Br=()=>{we("click-outside")};return(Ar,Pr)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["popover-wrapper",{...Object.fromEntries(Ar.customClasses.map(Nr=>[Nr,!0])),"no-pointer-events":Ar.noPointerEvents}]),onClick:Br,"data-bx-popover-id":Ar.bxPopoverId},[vue.createElementVNode("div",{ref_key:"popoverElementRef",ref:Me,class:"popover-element",style:vue.normalizeStyle({...vue.unref(Ze),...Ar.styles}),onClick:Lr,onMouseenter:pr,onMouseleave:or},[vue.createElementVNode("div",{class:vue.normalizeClass(["popover-frame-wrapper",{arrow:Ar.arrow,"overflow-visible":Ar.overflowVisible}]),"data-origin":_r.value,"data-placement":vue.unref(ie),style:vue.normalizeStyle({"--shift-left":"0px","--shift-top":"0px","transform-origin":`calc(${_r.value[0]*100}% - var(--shift-left)) calc(${_r.value[1]*100}% - var(--shift-top))`})},[vue.createElementVNode("div",{class:vue.normalizeClass(["arrow-element",{["placement-"+vue.unref(ie)]:!0}])},Pr[0]||(Pr[0]=[vue.createElementVNode("div",{class:"arrow-symbol"},null,-1)]),2),vue.createElementVNode("div",_hoisted_3$p,[vue.renderSlot(Ar.$slots,"default",{},void 0,!0)])],14,_hoisted_2$A)],36)],10,_hoisted_1$O))}}),PopoverElement_vue_vue_type_style_index_0_scoped_5f743c29_lang="",PopoverElement=_export_sfc(_sfc_main$11,[["__scopeId","data-v-5f743c29"]]),_sfc_main$10=vue.defineComponent({__name:"BxPopover",props:{show:{type:Boolean},trigger:{},customStyles:{},customClasses:{},darkenBackground:{type:Boolean,default:!0},allowedPlacements:{default:()=>["top","right","bottom","left","top-start","top-end","right-start","right-end","bottom-start","bottom-end","left-start","left-end"]},arrow:{type:Boolean,default:!0},leaveLazyness:{default:200},overflowVisible:{type:Boolean,default:!1}},emits:["update:show"],setup(m,{expose:c,emit:ne}){const we=m,Pe=ne,Me=vue.useSlots(),Ze=nanoid(),{setSlotRef:ie,slotElements:rr,vNodes:pr}=useSlotVNodes(Me.trigger),or=vue.ref(!1);vue.watch(or,()=>{or.value!==we.show&&Pe("update:show",or.value)},{immediate:!0}),vue.watch(()=>we.show,()=>{we.show!==or.value&&(or.value=we.show)},{immediate:!0});const _r=vue.computed(()=>rr.value[0]),Lr=vue.ref(!1),Br=vue.ref(!1);function Ar(){we.trigger==="click"&&(or.value=!or.value)}function Pr(){Lr.value=!0}function Nr(){Lr.value=!1}vue.watch(Lr,Wr=>{we.trigger==="hover"&&(Wr?or.value=!0:Yr())}),vue.watch(Br,Wr=>{we.trigger==="hover"&&(Wr||Yr())});function Yr(){setTimeout(()=>{!Lr.value&&!Br.value&&(or.value=!1)},we.leaveLazyness)}let Vr=[];vue.onUnmounted(()=>{for(const Wr of Vr)Wr.removeEventListener("click",Ar),Wr.removeEventListener("mouseenter",Pr),Wr.removeEventListener("mouseleave",Nr)}),vue.watch(rr,(Wr,si)=>{if(si)for(const li of si)li.removeEventListener("click",Ar),li.removeEventListener("mouseenter",Pr),li.removeEventListener("mouseleave",Nr);for(const li of Wr)li.addEventListener("click",Ar),li.addEventListener("mouseenter",Pr),li.addEventListener("mouseleave",Nr),li.nodeType===Node.ELEMENT_NODE&&(li.dataset.bxTargetPopoverId=Ze);Vr=Wr});const Zr=window.bluepicPopupProvider;return vue.onMounted(()=>{const Wr=document.querySelector(GLOBAL_APP_WRAPPER_SELECTOR);!Wr||(Wr.classList.add("bluepic-popup-app-wrapper"),Wr.parentElement?.classList.add("bluepic-popup-body"))}),vue.onUnmounted(()=>{for(const Wr of rr.value)Wr.removeEventListener("click",Ar);console.log("BX POPOVER UNMOUNTED",Ze),Zr.popoverProviderRef.pull(Ze)}),vue.watch(or,()=>{or.value?Zr.popoverProviderRef.push(Ze,()=>vue.h(PopoverElement,{floatingElement:_r.value,styles:{...we.customStyles},customClasses:we.customClasses??[],onClose(){or.value=!1},arrow:we.arrow,allowedPlacements:we.allowedPlacements,bxPopoverId:Ze,noPointerEvents:we.trigger==="hover"||we.trigger==="manual",overflowVisible:we.overflowVisible,onMouseenter(){Br.value=!0},onMouseleave(){Br.value=!1}},{default:()=>Me.content()}),{darkenBackground:we.darkenBackground,handleClickOutside(){we.trigger==="click"&&(or.value=!1)}}):Zr.popoverProviderRef.pull(Ze)}),c({close(){or.value=!1},show(){or.value=!0},destroy(){}}),(Wr,si)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(pr),(li,yi)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(li),{ref_for:!0,ref:vue.unref(ie)(yi)},null,512))),256))}}),BxPopover_vue_vue_type_style_index_0_scoped_6fc563ec_lang="",BxPopover=_export_sfc(_sfc_main$10,[["__scopeId","data-v-6fc563ec"]]),_hoisted_1$N=["onClick"],_hoisted_2$z={key:0,class:"icon-wrapper"},_hoisted_3$o={key:1,class:"icon-wrapper"},_hoisted_4$g={key:3},_hoisted_5$b={class:"active-symbol"},_sfc_main$$=vue.defineComponent({__name:"BxMenu",props:{items:{},primary:{type:Boolean,default:!1},secondary:{type:Boolean,default:!1}},emits:["action"],setup(m,{emit:c}){const ne=c,we=vue.useSlots();function Pe(Me){ne("action",Me)}return(Me,Ze)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["bx-menu",{primary:Me.primary,secondary:Me.secondary}])},[we["render-items"]?vue.renderSlot(Me.$slots,"render-items",{key:0,items:Me.items},void 0,!0):(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:1},vue.renderList(Me.items,(ie,rr)=>(vue.openBlock(),vue.createElementBlock("div",{key:rr,onClick:pr=>Pe(ie),class:vue.normalizeClass(["bx-menu__item",{active:ie.isActive===!0}])},[we["render-item-icon"]?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$z,[vue.renderSlot(Me.$slots,"render-item-icon",{item:ie,isActive:ie.isActive===!0},void 0,!0)])):ie.icon?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$o,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(ie.icon())))])):vue.createCommentVNode("",!0),we["render-item-label"]?vue.renderSlot(Me.$slots,"render-item-label",{key:2,item:ie,isActive:ie.isActive===!0},void 0,!0):(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$g,vue.toDisplayString(ie.label),1)),vue.createElementVNode("div",_hoisted_5$b,[we["render-item-active-symbol"]?vue.renderSlot(Me.$slots,"render-item-active-symbol",{key:0,item:ie,isActive:ie.isActive===!0},void 0,!0):(vue.openBlock(),vue.createBlock(BxIcon,{key:1,size:14,style:vue.normalizeStyle({opacity:ie.isActive===!0?1:0})},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(CheckmarkOutline))]),_:2},1032,["style"]))])],10,_hoisted_1$N))),128))],2))}}),BxMenu_vue_vue_type_style_index_0_scoped_ca1b34cf_lang="",BxMenu=_export_sfc(_sfc_main$$,[["__scopeId","data-v-ca1b34cf"]]);function useElementBounding$1(m){const c=vue.ref(),ne=()=>{m.value&&(c.value=m.value.getBoundingClientRect())};vue.onMounted(()=>{ne(),window.addEventListener("resize",ne)});const we=new ResizeObserver(()=>{ne()}),Pe=new MutationObserver(()=>{ne()}),Me=vue.watch(m,(Ze,ie)=>{Ze&&!ie&&(we.observe(Ze),Pe.observe(Ze,{attributes:!0,childList:!0,subtree:!0}))});return vue.onBeforeUnmount(()=>{window.removeEventListener("resize",ne),Me(),we.disconnect(),Pe.disconnect()}),{rect:c,width:vue.computed(()=>c.value?.width),height:vue.computed(()=>c.value?.height),x:vue.computed(()=>c.value?.x),y:vue.computed(()=>c.value?.y)}}const _hoisted_1$M={key:0,class:"prefix-wrapper"},_hoisted_2$y={key:1,class:"prefix-wrapper"},_hoisted_3$n={class:"select-value"},_hoisted_4$f={class:"suffix-wrapper"},iconSize="24px",_sfc_main$_=vue.defineComponent({__name:"BxSelect",props:vue.mergeModels({trigger:{default:"click"},options:{},disabled:{type:Boolean,default:!1},placeholderActiveLabel:{}},{modelValue:{required:!1},modelModifiers:{},show:{type:Boolean,required:!1,default:!1},showModifiers:{}}),emits:["update:modelValue","update:show"],setup(m,{expose:c}){const ne=m,we=vue.useSlots(),Pe=vue.useModel(m,"modelValue"),Me=vue.ref(),{width:Ze}=useElementBounding$1(Me);vue.watchEffect(()=>{console.log("bxSelectMainWidth",Ze.value)});const ie=vue.ref(),rr=vue.useModel(m,"show"),pr=vue.computed(()=>ne.options.find(Pr=>Pr.value===Pe.value)?.label),or=vue.computed(()=>{const Ar=ne.options.find(Pr=>Pr.value===Pe.value);if(!!Ar)return we["render-option-icon"]?()=>we["render-option-icon"]({option:Ar,isActive:_r(Ar)}):Ar.icon});function _r(Ar){return Ar.value===Pe.value}vue.watch(Pe,()=>{ie.value?.close()});const Lr=Ar=>{const Pr=ne.options[Number(Ar.key)];Pr&&(Pe.value=Pr.value)};c({closePopover(){ie.value?.close()},showPopover(){ie.value?.show()}});const Br=vue.computed(()=>ne.options.map((Ar,Pr)=>({label:Ar.label,key:Pr,icon:Ar.icon,isActive:_r(Ar)})));return(Ar,Pr)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"bxSelectMainRef",ref:Me,class:vue.normalizeClass(["bx-select",{disabled:Ar.disabled}]),style:vue.normalizeStyle({"--icon-size":iconSize})},[vue.createVNode(BxPopover,{ref_key:"popoverRef",ref:ie,trigger:Ar.trigger,"allowed-placements":["bottom","top"],arrow:!1,"darken-background":!1,"custom-classes":["bx-select-popover"],show:rr.value,"onUpdate:show":Pr[0]||(Pr[0]=Nr=>rr.value=Nr)},{trigger:vue.withCtx(()=>[we.trigger?vue.renderSlot(Ar.$slots,"trigger",{key:0},void 0,!0):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(["select-trigger",{focus:rr.value}])},[we.prefix?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$M,[vue.renderSlot(Ar.$slots,"prefix",{},void 0,!0)])):or.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$y,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(or.value)))])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_3$n,[vue.createElementVNode("span",{class:vue.normalizeClass({placeholder:pr.value===void 0})},[we.label?vue.renderSlot(Ar.$slots,"label",{key:0,label:pr.value??Ar.placeholderActiveLabel},void 0,!0):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createTextVNode(vue.toDisplayString(pr.value??Ar.placeholderActiveLabel),1)],64))],2)]),vue.createElementVNode("div",_hoisted_4$f,[we.suffix?vue.renderSlot(Ar.$slots,"suffix",{key:0},void 0,!0):(vue.openBlock(),vue.createBlock(BxIcon,{key:1,size:14},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ChevronDownOutline))]),_:1}))])],2))]),content:vue.withCtx(()=>[vue.createVNode(BxMenu,{items:Br.value,secondary:"",onAction:Lr,style:vue.normalizeStyle({width:`calc(${vue.unref(Ze)}px - 8px)`})},null,8,["items","style"])]),_:3},8,["trigger","show"])],6))}}),BxSelect_vue_vue_type_style_index_0_scoped_3f55a69c_lang="",BxSelect_vue_vue_type_style_index_1_lang="",BxSelect=_export_sfc(_sfc_main$_,[["__scopeId","data-v-3f55a69c"]]),_hoisted_1$L={class:"tooltip-wrapper"},_sfc_main$Z=vue.defineComponent({__name:"BxTooltip",props:vue.mergeModels({trigger:{},allowedPlacements:{},customPopoverClasses:{}},{show:{type:Boolean,required:!1,default:!1},showModifiers:{}}),emits:["update:show"],setup(m){const c=vue.useModel(m,"show"),ne=m,we=vue.useSlots(),Pe=vue.ref(),{setSlotRef:Me,slotElements:Ze,vNodes:ie}=useSlotVNodes(we.trigger);function rr(pr){}return vue.watch(Ze,()=>{for(const pr of Ze.value)pr.addEventListener("click",rr)}),vue.onUnmounted(()=>{for(const pr of Ze.value)pr.removeEventListener("click",rr)}),(pr,or)=>(vue.openBlock(),vue.createBlock(BxPopover,{ref_key:"popover",ref:Pe,show:c.value,"onUpdate:show":or[0]||(or[0]=_r=>c.value=_r),trigger:pr.trigger,"darken-background":!1,"allowed-placements":pr.allowedPlacements,"custom-classes":["tooltip-popover",...ne.customPopoverClasses??[]],"overflow-visible":!0},{trigger:vue.withCtx(()=>[vue.renderSlot(pr.$slots,"trigger",{},void 0,!0)]),content:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$L,[vue.renderSlot(pr.$slots,"content",{},void 0,!0)])]),_:3},8,["show","trigger","allowed-placements","custom-classes"]))}}),BxTooltip_vue_vue_type_style_index_0_scoped_0c1f2710_lang="",BxTooltip_vue_vue_type_style_index_1_lang="",BxTooltip=_export_sfc(_sfc_main$Z,[["__scopeId","data-v-0c1f2710"]]),_hoisted_1$K={key:0,class:"bx-input__prefix"},_hoisted_2$x=["placeholder","readonly"],_hoisted_3$m=["readonly","placeholder","type"],_hoisted_4$e={key:1,class:"bx-input__suffix"},_hoisted_5$a={key:0,class:"bx-input__loading-wrapper"},_hoisted_6$7={key:1,class:"bx-input__footer"},_hoisted_7$5={key:0,class:"bx-input__clear"},_hoisted_8$4={key:1,class:"bx-input__word-count"},_hoisted_9$4={class:"text-overflow-errors"},_hoisted_10$4={key:0,class:"text-err"},_hoisted_11$4={class:"overflow-label"},_hoisted_12$3={key:1,class:"text-err"},_hoisted_13$3={class:"overflow-label"},_hoisted_14$3={key:2,class:"text-err"},_hoisted_15$3={class:"index-label"},_hoisted_16$3={class:"overflow-label"},_sfc_main$Y=vue.defineComponent({__name:"BxInput",props:vue.mergeModels({size:{default:"medium"},loading:{type:Boolean,default:!1},round:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},inputProps:{default:()=>({})},placeholder:{},validator:{},maxLength:{default:1/0},maxLineLength:{default:1/0},maxLines:{default:1/0},showWordCount:{type:Boolean,default:!1},type:{default:"text"},state:{default:"default"},clearable:{type:Boolean,default:!1},resizeable:{type:Boolean,default:!0},richtext:{},maxHeight:{default:"100px"},readonly:{type:Boolean,default:!1}},{modelValue:{type:[String,Number,Boolean,Array],required:!1,default:""},modelModifiers:{}}),emits:vue.mergeModels(["enter","focus","blur"],["update:modelValue"]),setup(m,{expose:c,emit:ne}){const we=m,Pe=ne,Me=vue.useSlots(),Ze=vue.useModel(m,"modelValue"),ie=vue.ref(Ze.value),rr=vue.ref([]),pr=vue.ref(0),or=vue.ref(0),_r=vue.computed(()=>{if(rr.value.length>0||pr.value>0||or.value>0)return{lineOverflows:rr.value.length>0?rr.value:void 0,overlowingLines:pr.value>0?pr.value:void 0,overflowingCharacters:or.value>0?or.value:void 0}}),Lr=vue.computed({get(){return _r.value!==void 0},set(vr){}}),Br=vue.computed(()=>String(ie.value).split(`
69
+ https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}var cryptoBrowserifyExports=requireCryptoBrowserify();function simpleHash(m){let c=0;for(let ne=0;ne<m.length;ne++){const we=m.charCodeAt(ne);c=(c<<5)-c+we,c&=c}return new Uint32Array([c])[0].toString(36)}function hashString(m,c="sha256"){const ne=cryptoBrowserifyExports.createHash(c);return ne.update(m),ne.digest("hex")}function hashObject(m,c="sha256"){return hashString(JSON.stringify(m),c)}function hash$1(m){const c=typeof m=="string"?m:JSON.stringify(m);return simpleHash(c)}const _hoisted_1$Q=["contenteditable","data-ghost"],_hoisted_2$C=["data-paragraph"],_sfc_main$14=vue.defineComponent({__name:"RichTextDisplay",props:{paragraphs:{},noLazy:{type:Boolean},ghost:{type:Boolean},debug:{type:Boolean}},emits:["update","focus","blur"],setup(m,{expose:c,emit:ne}){const we=m,Pe=ne,Me=vue.ref(),Ze=vue.ref(we.paragraphs);vue.watch(()=>we.paragraphs,()=>{we.noLazy&&(Ze.value=we.paragraphs)},{deep:!0}),vue.watchEffect(()=>{we.debug&&console.log("lazyParagraphs",Ze.value)});const ie=_r=>{Pe("update",_r)},rr=_r=>{Pe("focus",_r)},pr=_r=>{Pe("blur",_r)};nanoid();const or=_r=>{const Lr=Object.fromEntries(Object.entries(_r).filter(([,Pr])=>Pr!==void 0)),Br=`rich-text-${hashObject(Lr)}`;let Ar=document.querySelector(`[data-rich-text-global-style='${Br}']`);return Ar||(Ar=document.createElement("style"),Ar.lang="css",Ar.setAttribute("data-rich-text-global-style",Br),document.head.appendChild(Ar)),Ar.innerHTML=`.${Br} { ${Object.entries(Lr).map(([Pr,Nr])=>`${Pr}: ${Nr};`).join(" ")} }`,Br};return c({richTextEditorDivRef:Me}),(_r,Lr)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"richTextEditorDivRef",ref:Me,class:vue.normalizeClass(["rich-text-editor",{ghost:_r.ghost}]),contenteditable:!_r.ghost,onInput:ie,onFocus:rr,onBlur:pr,"data-ghost":_r.ghost},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ze.value,(Br,Ar)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:Ar},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Br,(Pr,Nr)=>vue.renderSlot(_r.$slots,"feature",{key:Nr,text:Pr.text,format:Pr.format,cssclass:or},void 0,!0)),128)),Ar<Ze.value.length-1?(vue.openBlock(),vue.createElementBlock("br",{key:0,"data-custom-br":"true","data-paragraph":JSON.stringify(Br)},null,8,_hoisted_2$C)):vue.createCommentVNode("",!0)],64))),128))],42,_hoisted_1$Q))}}),RichTextDisplay_vue_vue_type_style_index_0_scoped_a344d5e9_lang="",RichTextDisplay=_export_sfc(_sfc_main$14,[["__scopeId","data-v-a344d5e9"]]),_hoisted_1$P={class:"rich-text-wrapper"},_hoisted_2$B=["data-feature-format"],_hoisted_3$q=["data-feature-format"],_sfc_main$13=vue.defineComponent({__name:"RichText",props:{value:{},selection:{},userAgentRichText:{type:Boolean},renderFeatureInlineStyle:{},maxLength:{},maxLengthPerLine:{},maxLines:{},multiline:{type:Boolean,default:!0}},emits:["update:value","update:visible-value","update:selection","update:warning-message","update:focus"],setup(m,{expose:c,emit:ne}){const we=m,Pe=ne;vue.computed(()=>!we.multiline);const Me=vue.ref(),Ze=vue.ref(),ie=vue.computed(()=>Me.value?.richTextEditorDivRef),{handleInputEvent:rr,paragraphs:pr,visibleParagraphs:or,manipulationState:_r,applyFormat:Lr,resolveFeatures:Br,selection:Ar}=useContentEditable(ie,vue.toRef(we,"value"),{maxLength:we.maxLength,maxLengthPerLine:we.maxLengthPerLine,maxLines:we.maxLines}),Pr=si=>{we.multiline||si.key==="Enter"&&si.preventDefault()},Nr=vue.computed(()=>isEqual(pr.value,or.value)?void 0:"Text is too long");vue.watchEffect(()=>{Pe("update:warning-message",Nr.value)});const Yr=vue.ref(!1);vue.watch(Yr,()=>{Pe("update:focus",Yr.value)},{immediate:!0});const Vr=()=>{Yr.value=!0},Zr=()=>{Yr.value=!1};vue.watch(ie,(si,li)=>{li&&(li.removeEventListener("focus",Vr),li.removeEventListener("blur",Zr)),si&&(si.addEventListener("focus",Vr),si.addEventListener("blur",Zr))}),vue.watch(Ar,()=>{isEqual(Ar.value,we.selection)||Pe("update:selection",Ar.value??void 0)}),vue.watch(pr,()=>{isEqual(pr.value,we.value)||Pe("update:value",pr.value)}),vue.watch(or,()=>{Pe("update:visible-value",or.value)}),window.addEventListener("touchmove",si=>{Ar.value&&si.preventDefault()});let Wr;return vue.onMounted(()=>{if(!Ze.value?.richTextEditorDivRef)return;const si=(li,yi)=>{Me.value?.richTextEditorDivRef,Ze.value?.richTextEditorDivRef;for(const mi of li);};Wr=new MutationObserver(si),Wr.observe(Ze.value.richTextEditorDivRef,{attributes:!0,childList:!0,subtree:!0})}),vue.onUnmounted(()=>{Wr.disconnect()}),c({applyFormat:Lr,resolveFeatures:Br}),(si,li)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["rich-text",{focus:Yr.value}])},[vue.createElementVNode("div",_hoisted_1$P,[vue.createVNode(RichTextDisplay,{ref_key:"richTextDisplayGhostInstance",ref:Ze,paragraphs:vue.unref(or),"no-lazy":"",ghost:"",debug:!1},{feature:vue.withCtx(yi=>[vue.createElementVNode("span",{"data-feature-format":JSON.stringify(yi.format),class:vue.normalizeClass(["feature-wrapper feature-wrapper-ghost",{[yi.cssclass(si.renderFeatureInlineStyle(yi.format))]:!0,"line-overflow":!!yi.format.lineOverflow,overflow:!!yi.format.overflow}])},vue.toDisplayString(yi.text),11,_hoisted_2$B)]),_:1},8,["paragraphs"]),(vue.openBlock(),vue.createBlock(RichTextDisplay,{ref_key:"richTextDisplayInstance",ref:Me,key:vue.unref(_r),paragraphs:vue.unref(pr),onUpdate:vue.unref(rr),onKeydown:Pr,style:vue.normalizeStyle({"-webkit-user-modify":si.userAgentRichText?"read-write":"read-write-plaintext-only"})},{feature:vue.withCtx(yi=>[vue.createElementVNode("span",{"data-feature-format":JSON.stringify(yi.format),class:vue.normalizeClass(["feature-wrapper",{[yi.cssclass(si.renderFeatureInlineStyle(yi.format))]:!0}])},vue.toDisplayString(yi.text),11,_hoisted_3$q)]),_:1},8,["paragraphs","onUpdate","style"]))])],2))}}),RichText_vue_vue_type_style_index_0_scoped_3bf042ff_lang="",RichText=_export_sfc(_sfc_main$13,[["__scopeId","data-v-3bf042ff"]]),colorNames={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},reverseNames=Object.create(null);for(const m in colorNames)Object.hasOwn(colorNames,m)&&(reverseNames[colorNames[m]]=m);const cs={to:{},get:{}};cs.get=function(m){const c=m.slice(0,3).toLowerCase();let ne,we;switch(c){case"hsl":{ne=cs.get.hsl(m),we="hsl";break}case"hwb":{ne=cs.get.hwb(m),we="hwb";break}default:{ne=cs.get.rgb(m),we="rgb";break}}return ne?{model:we,value:ne}:null},cs.get.rgb=function(m){if(!m)return null;const c=/^#([a-f\d]{3,4})$/i,ne=/^#([a-f\d]{6})([a-f\d]{2})?$/i,we=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,Pe=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,Me=/^(\w+)$/;let Ze=[0,0,0,1],ie,rr,pr;if(ie=m.match(ne)){for(pr=ie[2],ie=ie[1],rr=0;rr<3;rr++){const or=rr*2;Ze[rr]=Number.parseInt(ie.slice(or,or+2),16)}pr&&(Ze[3]=Number.parseInt(pr,16)/255)}else if(ie=m.match(c)){for(ie=ie[1],pr=ie[3],rr=0;rr<3;rr++)Ze[rr]=Number.parseInt(ie[rr]+ie[rr],16);pr&&(Ze[3]=Number.parseInt(pr+pr,16)/255)}else if(ie=m.match(we)){for(rr=0;rr<3;rr++)Ze[rr]=Number.parseInt(ie[rr+1],10);ie[4]&&(Ze[3]=ie[5]?Number.parseFloat(ie[4])*.01:Number.parseFloat(ie[4]))}else if(ie=m.match(Pe)){for(rr=0;rr<3;rr++)Ze[rr]=Math.round(Number.parseFloat(ie[rr+1])*2.55);ie[4]&&(Ze[3]=ie[5]?Number.parseFloat(ie[4])*.01:Number.parseFloat(ie[4]))}else return(ie=m.match(Me))?ie[1]==="transparent"?[0,0,0,0]:Object.hasOwn(colorNames,ie[1])?(Ze=colorNames[ie[1]],Ze[3]=1,Ze):null:null;for(rr=0;rr<3;rr++)Ze[rr]=clamp$1(Ze[rr],0,255);return Ze[3]=clamp$1(Ze[3],0,1),Ze},cs.get.hsl=function(m){if(!m)return null;const c=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,ne=m.match(c);if(ne){const we=Number.parseFloat(ne[4]),Pe=(Number.parseFloat(ne[1])%360+360)%360,Me=clamp$1(Number.parseFloat(ne[2]),0,100),Ze=clamp$1(Number.parseFloat(ne[3]),0,100),ie=clamp$1(Number.isNaN(we)?1:we,0,1);return[Pe,Me,Ze,ie]}return null},cs.get.hwb=function(m){if(!m)return null;const c=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,ne=m.match(c);if(ne){const we=Number.parseFloat(ne[4]),Pe=(Number.parseFloat(ne[1])%360+360)%360,Me=clamp$1(Number.parseFloat(ne[2]),0,100),Ze=clamp$1(Number.parseFloat(ne[3]),0,100),ie=clamp$1(Number.isNaN(we)?1:we,0,1);return[Pe,Me,Ze,ie]}return null},cs.to.hex=function(...m){return"#"+hexDouble(m[0])+hexDouble(m[1])+hexDouble(m[2])+(m[3]<1?hexDouble(Math.round(m[3]*255)):"")},cs.to.rgb=function(...m){return m.length<4||m[3]===1?"rgb("+Math.round(m[0])+", "+Math.round(m[1])+", "+Math.round(m[2])+")":"rgba("+Math.round(m[0])+", "+Math.round(m[1])+", "+Math.round(m[2])+", "+m[3]+")"},cs.to.rgb.percent=function(...m){const c=Math.round(m[0]/255*100),ne=Math.round(m[1]/255*100),we=Math.round(m[2]/255*100);return m.length<4||m[3]===1?"rgb("+c+"%, "+ne+"%, "+we+"%)":"rgba("+c+"%, "+ne+"%, "+we+"%, "+m[3]+")"},cs.to.hsl=function(...m){return m.length<4||m[3]===1?"hsl("+m[0]+", "+m[1]+"%, "+m[2]+"%)":"hsla("+m[0]+", "+m[1]+"%, "+m[2]+"%, "+m[3]+")"},cs.to.hwb=function(...m){let c="";return m.length>=4&&m[3]!==1&&(c=", "+m[3]),"hwb("+m[0]+", "+m[1]+"%, "+m[2]+"%"+c+")"},cs.to.keyword=function(...m){return reverseNames[m.slice(0,3)]};function clamp$1(m,c,ne){return Math.min(Math.max(c,m),ne)}function hexDouble(m){const c=Math.round(m).toString(16).toUpperCase();return c.length<2?"0"+c:c}const cssKeywords={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},reverseKeywords={};for(const m of Object.keys(cssKeywords))reverseKeywords[cssKeywords[m]]=m;const convert$1={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},LAB_FT=(6/29)**3;for(const m of Object.keys(convert$1)){if(!("channels"in convert$1[m]))throw new Error("missing channels property: "+m);if(!("labels"in convert$1[m]))throw new Error("missing channel labels property: "+m);if(convert$1[m].labels.length!==convert$1[m].channels)throw new Error("channel and label counts mismatch: "+m);const{channels:c,labels:ne}=convert$1[m];delete convert$1[m].channels,delete convert$1[m].labels,Object.defineProperty(convert$1[m],"channels",{value:c}),Object.defineProperty(convert$1[m],"labels",{value:ne})}convert$1.rgb.hsl=function(m){const c=m[0]/255,ne=m[1]/255,we=m[2]/255,Pe=Math.min(c,ne,we),Me=Math.max(c,ne,we),Ze=Me-Pe;let ie,rr;switch(Me){case Pe:{ie=0;break}case c:{ie=(ne-we)/Ze;break}case ne:{ie=2+(we-c)/Ze;break}case we:{ie=4+(c-ne)/Ze;break}}ie=Math.min(ie*60,360),ie<0&&(ie+=360);const pr=(Pe+Me)/2;return Me===Pe?rr=0:pr<=.5?rr=Ze/(Me+Pe):rr=Ze/(2-Me-Pe),[ie,rr*100,pr*100]},convert$1.rgb.hsv=function(m){let c,ne,we,Pe,Me;const Ze=m[0]/255,ie=m[1]/255,rr=m[2]/255,pr=Math.max(Ze,ie,rr),or=pr-Math.min(Ze,ie,rr),_r=function(Lr){return(pr-Lr)/6/or+1/2};if(or===0)Pe=0,Me=0;else{switch(Me=or/pr,c=_r(Ze),ne=_r(ie),we=_r(rr),pr){case Ze:{Pe=we-ne;break}case ie:{Pe=1/3+c-we;break}case rr:{Pe=2/3+ne-c;break}}Pe<0?Pe+=1:Pe>1&&(Pe-=1)}return[Pe*360,Me*100,pr*100]},convert$1.rgb.hwb=function(m){const c=m[0],ne=m[1];let we=m[2];const Pe=convert$1.rgb.hsl(m)[0],Me=1/255*Math.min(c,Math.min(ne,we));return we=1-1/255*Math.max(c,Math.max(ne,we)),[Pe,Me*100,we*100]},convert$1.rgb.cmyk=function(m){const c=m[0]/255,ne=m[1]/255,we=m[2]/255,Pe=Math.min(1-c,1-ne,1-we),Me=(1-c-Pe)/(1-Pe)||0,Ze=(1-ne-Pe)/(1-Pe)||0,ie=(1-we-Pe)/(1-Pe)||0;return[Me*100,Ze*100,ie*100,Pe*100]};function comparativeDistance(m,c){return(m[0]-c[0])**2+(m[1]-c[1])**2+(m[2]-c[2])**2}convert$1.rgb.keyword=function(m){const c=reverseKeywords[m];if(c)return c;let ne=Number.POSITIVE_INFINITY,we;for(const Pe of Object.keys(cssKeywords)){const Me=cssKeywords[Pe],Ze=comparativeDistance(m,Me);Ze<ne&&(ne=Ze,we=Pe)}return we},convert$1.keyword.rgb=function(m){return cssKeywords[m]},convert$1.rgb.xyz=function(m){let c=m[0]/255,ne=m[1]/255,we=m[2]/255;c=c>.04045?((c+.055)/1.055)**2.4:c/12.92,ne=ne>.04045?((ne+.055)/1.055)**2.4:ne/12.92,we=we>.04045?((we+.055)/1.055)**2.4:we/12.92;const Pe=c*.4124564+ne*.3575761+we*.1804375,Me=c*.2126729+ne*.7151522+we*.072175,Ze=c*.0193339+ne*.119192+we*.9503041;return[Pe*100,Me*100,Ze*100]},convert$1.rgb.lab=function(m){const c=convert$1.rgb.xyz(m);let ne=c[0],we=c[1],Pe=c[2];ne/=95.047,we/=100,Pe/=108.883,ne=ne>LAB_FT?ne**(1/3):7.787*ne+16/116,we=we>LAB_FT?we**(1/3):7.787*we+16/116,Pe=Pe>LAB_FT?Pe**(1/3):7.787*Pe+16/116;const Me=116*we-16,Ze=500*(ne-we),ie=200*(we-Pe);return[Me,Ze,ie]},convert$1.hsl.rgb=function(m){const c=m[0]/360,ne=m[1]/100,we=m[2]/100;let Pe,Me;if(ne===0)return Me=we*255,[Me,Me,Me];const Ze=we<.5?we*(1+ne):we+ne-we*ne,ie=2*we-Ze,rr=[0,0,0];for(let pr=0;pr<3;pr++)Pe=c+1/3*-(pr-1),Pe<0&&Pe++,Pe>1&&Pe--,6*Pe<1?Me=ie+(Ze-ie)*6*Pe:2*Pe<1?Me=Ze:3*Pe<2?Me=ie+(Ze-ie)*(2/3-Pe)*6:Me=ie,rr[pr]=Me*255;return rr},convert$1.hsl.hsv=function(m){const c=m[0];let ne=m[1]/100,we=m[2]/100,Pe=ne;const Me=Math.max(we,.01);we*=2,ne*=we<=1?we:2-we,Pe*=Me<=1?Me:2-Me;const Ze=(we+ne)/2,ie=we===0?2*Pe/(Me+Pe):2*ne/(we+ne);return[c,ie*100,Ze*100]},convert$1.hsv.rgb=function(m){const c=m[0]/60,ne=m[1]/100;let we=m[2]/100;const Pe=Math.floor(c)%6,Me=c-Math.floor(c),Ze=255*we*(1-ne),ie=255*we*(1-ne*Me),rr=255*we*(1-ne*(1-Me));switch(we*=255,Pe){case 0:return[we,rr,Ze];case 1:return[ie,we,Ze];case 2:return[Ze,we,rr];case 3:return[Ze,ie,we];case 4:return[rr,Ze,we];case 5:return[we,Ze,ie]}},convert$1.hsv.hsl=function(m){const c=m[0],ne=m[1]/100,we=m[2]/100,Pe=Math.max(we,.01);let Me,Ze;Ze=(2-ne)*we;const ie=(2-ne)*Pe;return Me=ne*Pe,Me/=ie<=1?ie:2-ie,Me=Me||0,Ze/=2,[c,Me*100,Ze*100]},convert$1.hwb.rgb=function(m){const c=m[0]/360;let ne=m[1]/100,we=m[2]/100;const Pe=ne+we;let Me;Pe>1&&(ne/=Pe,we/=Pe);const Ze=Math.floor(6*c),ie=1-we;Me=6*c-Ze,(Ze&1)!==0&&(Me=1-Me);const rr=ne+Me*(ie-ne);let pr,or,_r;switch(Ze){default:case 6:case 0:{pr=ie,or=rr,_r=ne;break}case 1:{pr=rr,or=ie,_r=ne;break}case 2:{pr=ne,or=ie,_r=rr;break}case 3:{pr=ne,or=rr,_r=ie;break}case 4:{pr=rr,or=ne,_r=ie;break}case 5:{pr=ie,or=ne,_r=rr;break}}return[pr*255,or*255,_r*255]},convert$1.cmyk.rgb=function(m){const c=m[0]/100,ne=m[1]/100,we=m[2]/100,Pe=m[3]/100,Me=1-Math.min(1,c*(1-Pe)+Pe),Ze=1-Math.min(1,ne*(1-Pe)+Pe),ie=1-Math.min(1,we*(1-Pe)+Pe);return[Me*255,Ze*255,ie*255]},convert$1.xyz.rgb=function(m){const c=m[0]/100,ne=m[1]/100,we=m[2]/100;let Pe,Me,Ze;return Pe=c*3.2404542+ne*-1.5371385+we*-.4985314,Me=c*-.969266+ne*1.8760108+we*.041556,Ze=c*.0556434+ne*-.2040259+we*1.0572252,Pe=Pe>.0031308?1.055*Pe**(1/2.4)-.055:Pe*12.92,Me=Me>.0031308?1.055*Me**(1/2.4)-.055:Me*12.92,Ze=Ze>.0031308?1.055*Ze**(1/2.4)-.055:Ze*12.92,Pe=Math.min(Math.max(0,Pe),1),Me=Math.min(Math.max(0,Me),1),Ze=Math.min(Math.max(0,Ze),1),[Pe*255,Me*255,Ze*255]},convert$1.xyz.lab=function(m){let c=m[0],ne=m[1],we=m[2];c/=95.047,ne/=100,we/=108.883,c=c>LAB_FT?c**(1/3):7.787*c+16/116,ne=ne>LAB_FT?ne**(1/3):7.787*ne+16/116,we=we>LAB_FT?we**(1/3):7.787*we+16/116;const Pe=116*ne-16,Me=500*(c-ne),Ze=200*(ne-we);return[Pe,Me,Ze]},convert$1.lab.xyz=function(m){const c=m[0],ne=m[1],we=m[2];let Pe,Me,Ze;Me=(c+16)/116,Pe=ne/500+Me,Ze=Me-we/200;const ie=Me**3,rr=Pe**3,pr=Ze**3;return Me=ie>LAB_FT?ie:(Me-16/116)/7.787,Pe=rr>LAB_FT?rr:(Pe-16/116)/7.787,Ze=pr>LAB_FT?pr:(Ze-16/116)/7.787,Pe*=95.047,Me*=100,Ze*=108.883,[Pe,Me,Ze]},convert$1.lab.lch=function(m){const c=m[0],ne=m[1],we=m[2];let Pe;Pe=Math.atan2(we,ne)*360/2/Math.PI,Pe<0&&(Pe+=360);const Ze=Math.sqrt(ne*ne+we*we);return[c,Ze,Pe]},convert$1.lch.lab=function(m){const c=m[0],ne=m[1],Pe=m[2]/360*2*Math.PI,Me=ne*Math.cos(Pe),Ze=ne*Math.sin(Pe);return[c,Me,Ze]},convert$1.rgb.ansi16=function(m,c=null){const[ne,we,Pe]=m;let Me=c===null?convert$1.rgb.hsv(m)[2]:c;if(Me=Math.round(Me/50),Me===0)return 30;let Ze=30+(Math.round(Pe/255)<<2|Math.round(we/255)<<1|Math.round(ne/255));return Me===2&&(Ze+=60),Ze},convert$1.hsv.ansi16=function(m){return convert$1.rgb.ansi16(convert$1.hsv.rgb(m),m[2])},convert$1.rgb.ansi256=function(m){const c=m[0],ne=m[1],we=m[2];return c>>4===ne>>4&&ne>>4===we>>4?c<8?16:c>248?231:Math.round((c-8)/247*24)+232:16+36*Math.round(c/255*5)+6*Math.round(ne/255*5)+Math.round(we/255*5)},convert$1.ansi16.rgb=function(m){m=m[0];let c=m%10;if(c===0||c===7)return m>50&&(c+=3.5),c=c/10.5*255,[c,c,c];const ne=(Math.trunc(m>50)+1)*.5,we=(c&1)*ne*255,Pe=(c>>1&1)*ne*255,Me=(c>>2&1)*ne*255;return[we,Pe,Me]},convert$1.ansi256.rgb=function(m){if(m=m[0],m>=232){const Me=(m-232)*10+8;return[Me,Me,Me]}m-=16;let c;const ne=Math.floor(m/36)/5*255,we=Math.floor((c=m%36)/6)/5*255,Pe=c%6/5*255;return[ne,we,Pe]},convert$1.rgb.hex=function(m){const ne=(((Math.round(m[0])&255)<<16)+((Math.round(m[1])&255)<<8)+(Math.round(m[2])&255)).toString(16).toUpperCase();return"000000".slice(ne.length)+ne},convert$1.hex.rgb=function(m){const c=m.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!c)return[0,0,0];let ne=c[0];c[0].length===3&&(ne=[...ne].map(ie=>ie+ie).join(""));const we=Number.parseInt(ne,16),Pe=we>>16&255,Me=we>>8&255,Ze=we&255;return[Pe,Me,Ze]},convert$1.rgb.hcg=function(m){const c=m[0]/255,ne=m[1]/255,we=m[2]/255,Pe=Math.max(Math.max(c,ne),we),Me=Math.min(Math.min(c,ne),we),Ze=Pe-Me;let ie;const rr=Ze<1?Me/(1-Ze):0;return Ze<=0?ie=0:Pe===c?ie=(ne-we)/Ze%6:Pe===ne?ie=2+(we-c)/Ze:ie=4+(c-ne)/Ze,ie/=6,ie%=1,[ie*360,Ze*100,rr*100]},convert$1.hsl.hcg=function(m){const c=m[1]/100,ne=m[2]/100,we=ne<.5?2*c*ne:2*c*(1-ne);let Pe=0;return we<1&&(Pe=(ne-.5*we)/(1-we)),[m[0],we*100,Pe*100]},convert$1.hsv.hcg=function(m){const c=m[1]/100,ne=m[2]/100,we=c*ne;let Pe=0;return we<1&&(Pe=(ne-we)/(1-we)),[m[0],we*100,Pe*100]},convert$1.hcg.rgb=function(m){const c=m[0]/360,ne=m[1]/100,we=m[2]/100;if(ne===0)return[we*255,we*255,we*255];const Pe=[0,0,0],Me=c%1*6,Ze=Me%1,ie=1-Ze;let rr=0;switch(Math.floor(Me)){case 0:{Pe[0]=1,Pe[1]=Ze,Pe[2]=0;break}case 1:{Pe[0]=ie,Pe[1]=1,Pe[2]=0;break}case 2:{Pe[0]=0,Pe[1]=1,Pe[2]=Ze;break}case 3:{Pe[0]=0,Pe[1]=ie,Pe[2]=1;break}case 4:{Pe[0]=Ze,Pe[1]=0,Pe[2]=1;break}default:Pe[0]=1,Pe[1]=0,Pe[2]=ie}return rr=(1-ne)*we,[(ne*Pe[0]+rr)*255,(ne*Pe[1]+rr)*255,(ne*Pe[2]+rr)*255]},convert$1.hcg.hsv=function(m){const c=m[1]/100,ne=m[2]/100,we=c+ne*(1-c);let Pe=0;return we>0&&(Pe=c/we),[m[0],Pe*100,we*100]},convert$1.hcg.hsl=function(m){const c=m[1]/100,we=m[2]/100*(1-c)+.5*c;let Pe=0;return we>0&&we<.5?Pe=c/(2*we):we>=.5&&we<1&&(Pe=c/(2*(1-we))),[m[0],Pe*100,we*100]},convert$1.hcg.hwb=function(m){const c=m[1]/100,ne=m[2]/100,we=c+ne*(1-c);return[m[0],(we-c)*100,(1-we)*100]},convert$1.hwb.hcg=function(m){const c=m[1]/100,we=1-m[2]/100,Pe=we-c;let Me=0;return Pe<1&&(Me=(we-Pe)/(1-Pe)),[m[0],Pe*100,Me*100]},convert$1.apple.rgb=function(m){return[m[0]/65535*255,m[1]/65535*255,m[2]/65535*255]},convert$1.rgb.apple=function(m){return[m[0]/255*65535,m[1]/255*65535,m[2]/255*65535]},convert$1.gray.rgb=function(m){return[m[0]/100*255,m[0]/100*255,m[0]/100*255]},convert$1.gray.hsl=function(m){return[0,0,m[0]]},convert$1.gray.hsv=convert$1.gray.hsl,convert$1.gray.hwb=function(m){return[0,100,m[0]]},convert$1.gray.cmyk=function(m){return[0,0,0,m[0]]},convert$1.gray.lab=function(m){return[m[0],0,0]},convert$1.gray.hex=function(m){const c=Math.round(m[0]/100*255)&255,we=((c<<16)+(c<<8)+c).toString(16).toUpperCase();return"000000".slice(we.length)+we},convert$1.rgb.gray=function(m){return[(m[0]+m[1]+m[2])/3/255*100]};function buildGraph(){const m={},c=Object.keys(convert$1);for(let{length:ne}=c,we=0;we<ne;we++)m[c[we]]={distance:-1,parent:null};return m}function deriveBFS(m){const c=buildGraph(),ne=[m];for(c[m].distance=0;ne.length>0;){const we=ne.pop(),Pe=Object.keys(convert$1[we]);for(let{length:Me}=Pe,Ze=0;Ze<Me;Ze++){const ie=Pe[Ze],rr=c[ie];rr.distance===-1&&(rr.distance=c[we].distance+1,rr.parent=we,ne.unshift(ie))}}return c}function link(m,c){return function(ne){return c(m(ne))}}function wrapConversion(m,c){const ne=[c[m].parent,m];let we=convert$1[c[m].parent][m],Pe=c[m].parent;for(;c[Pe].parent;)ne.unshift(c[Pe].parent),we=link(convert$1[c[Pe].parent][Pe],we),Pe=c[Pe].parent;return we.conversion=ne,we}function route(m){const c=deriveBFS(m),ne={},we=Object.keys(c);for(let{length:Pe}=we,Me=0;Me<Pe;Me++){const Ze=we[Me];c[Ze].parent!==null&&(ne[Ze]=wrapConversion(Ze,c))}return ne}const convert={},models=Object.keys(convert$1);function wrapRaw(m){const c=function(...ne){const we=ne[0];return we==null?we:(we.length>1&&(ne=we),m(ne))};return"conversion"in m&&(c.conversion=m.conversion),c}function wrapRounded(m){const c=function(...ne){const we=ne[0];if(we==null)return we;we.length>1&&(ne=we);const Pe=m(ne);if(typeof Pe=="object")for(let{length:Me}=Pe,Ze=0;Ze<Me;Ze++)Pe[Ze]=Math.round(Pe[Ze]);return Pe};return"conversion"in m&&(c.conversion=m.conversion),c}for(const m of models){convert[m]={},Object.defineProperty(convert[m],"channels",{value:convert$1[m].channels}),Object.defineProperty(convert[m],"labels",{value:convert$1[m].labels});const c=route(m),ne=Object.keys(c);for(const we of ne){const Pe=c[we];convert[m][we]=wrapRounded(Pe),convert[m][we].raw=wrapRaw(Pe)}}const skippedModels=["keyword","gray","hex"],hashedModelKeys={};for(const m of Object.keys(convert))hashedModelKeys[[...convert[m].labels].sort().join("")]=m;const limiters={};function Color$1(m,c){if(!(this instanceof Color$1))return new Color$1(m,c);if(c&&c in skippedModels&&(c=null),c&&!(c in convert))throw new Error("Unknown model: "+c);let ne,we;if(m==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(m instanceof Color$1)this.model=m.model,this.color=[...m.color],this.valpha=m.valpha;else if(typeof m=="string"){const Pe=cs.get(m);if(Pe===null)throw new Error("Unable to parse color from string: "+m);this.model=Pe.model,we=convert[this.model].channels,this.color=Pe.value.slice(0,we),this.valpha=typeof Pe.value[we]=="number"?Pe.value[we]:1}else if(m.length>0){this.model=c||"rgb",we=convert[this.model].channels;const Pe=Array.prototype.slice.call(m,0,we);this.color=zeroArray(Pe,we),this.valpha=typeof m[we]=="number"?m[we]:1}else if(typeof m=="number")this.model="rgb",this.color=[m>>16&255,m>>8&255,m&255],this.valpha=1;else{this.valpha=1;const Pe=Object.keys(m);"alpha"in m&&(Pe.splice(Pe.indexOf("alpha"),1),this.valpha=typeof m.alpha=="number"?m.alpha:0);const Me=Pe.sort().join("");if(!(Me in hashedModelKeys))throw new Error("Unable to parse color from object: "+JSON.stringify(m));this.model=hashedModelKeys[Me];const{labels:Ze}=convert[this.model],ie=[];for(ne=0;ne<Ze.length;ne++)ie.push(m[Ze[ne]]);this.color=zeroArray(ie)}if(limiters[this.model])for(we=convert[this.model].channels,ne=0;ne<we;ne++){const Pe=limiters[this.model][ne];Pe&&(this.color[ne]=Pe(this.color[ne]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Color$1.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(m){let c=this.model in cs.to?this:this.rgb();c=c.round(typeof m=="number"?m:1);const ne=c.valpha===1?c.color:[...c.color,this.valpha];return cs.to[c.model](...ne)},percentString(m){const c=this.rgb().round(typeof m=="number"?m:1),ne=c.valpha===1?c.color:[...c.color,this.valpha];return cs.to.rgb.percent(...ne)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const m={},{channels:c}=convert[this.model],{labels:ne}=convert[this.model];for(let we=0;we<c;we++)m[ne[we]]=this.color[we];return this.valpha!==1&&(m.alpha=this.valpha),m},unitArray(){const m=this.rgb().color;return m[0]/=255,m[1]/=255,m[2]/=255,this.valpha!==1&&m.push(this.valpha),m},unitObject(){const m=this.rgb().object();return m.r/=255,m.g/=255,m.b/=255,this.valpha!==1&&(m.alpha=this.valpha),m},round(m){return m=Math.max(m||0,0),new Color$1([...this.color.map(roundToPlace(m)),this.valpha],this.model)},alpha(m){return m!==void 0?new Color$1([...this.color,Math.max(0,Math.min(1,m))],this.model):this.valpha},red:getset("rgb",0,maxfn(255)),green:getset("rgb",1,maxfn(255)),blue:getset("rgb",2,maxfn(255)),hue:getset(["hsl","hsv","hsl","hwb","hcg"],0,m=>(m%360+360)%360),saturationl:getset("hsl",1,maxfn(100)),lightness:getset("hsl",2,maxfn(100)),saturationv:getset("hsv",1,maxfn(100)),value:getset("hsv",2,maxfn(100)),chroma:getset("hcg",1,maxfn(100)),gray:getset("hcg",2,maxfn(100)),white:getset("hwb",1,maxfn(100)),wblack:getset("hwb",2,maxfn(100)),cyan:getset("cmyk",0,maxfn(100)),magenta:getset("cmyk",1,maxfn(100)),yellow:getset("cmyk",2,maxfn(100)),black:getset("cmyk",3,maxfn(100)),x:getset("xyz",0,maxfn(95.047)),y:getset("xyz",1,maxfn(100)),z:getset("xyz",2,maxfn(108.833)),l:getset("lab",0,maxfn(100)),a:getset("lab",1),b:getset("lab",2),keyword(m){return m!==void 0?new Color$1(m):convert[this.model].keyword(this.color)},hex(m){return m!==void 0?new Color$1(m):cs.to.hex(...this.rgb().round().color)},hexa(m){if(m!==void 0)return new Color$1(m);const c=this.rgb().round().color;let ne=Math.round(this.valpha*255).toString(16).toUpperCase();return ne.length===1&&(ne="0"+ne),cs.to.hex(...c)+ne},rgbNumber(){const m=this.rgb().color;return(m[0]&255)<<16|(m[1]&255)<<8|m[2]&255},luminosity(){const m=this.rgb().color,c=[];for(const[ne,we]of m.entries()){const Pe=we/255;c[ne]=Pe<=.04045?Pe/12.92:((Pe+.055)/1.055)**2.4}return .2126*c[0]+.7152*c[1]+.0722*c[2]},contrast(m){const c=this.luminosity(),ne=m.luminosity();return c>ne?(c+.05)/(ne+.05):(ne+.05)/(c+.05)},level(m){const c=this.contrast(m);return c>=7?"AAA":c>=4.5?"AA":""},isDark(){const m=this.rgb().color;return(m[0]*2126+m[1]*7152+m[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const m=this.rgb();for(let c=0;c<3;c++)m.color[c]=255-m.color[c];return m},lighten(m){const c=this.hsl();return c.color[2]+=c.color[2]*m,c},darken(m){const c=this.hsl();return c.color[2]-=c.color[2]*m,c},saturate(m){const c=this.hsl();return c.color[1]+=c.color[1]*m,c},desaturate(m){const c=this.hsl();return c.color[1]-=c.color[1]*m,c},whiten(m){const c=this.hwb();return c.color[1]+=c.color[1]*m,c},blacken(m){const c=this.hwb();return c.color[2]+=c.color[2]*m,c},grayscale(){const m=this.rgb().color,c=m[0]*.3+m[1]*.59+m[2]*.11;return Color$1.rgb(c,c,c)},fade(m){return this.alpha(this.valpha-this.valpha*m)},opaquer(m){return this.alpha(this.valpha+this.valpha*m)},rotate(m){const c=this.hsl();let ne=c.color[0];return ne=(ne+m)%360,ne=ne<0?360+ne:ne,c.color[0]=ne,c},mix(m,c){if(!m||!m.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof m);const ne=m.rgb(),we=this.rgb(),Pe=c===void 0?.5:c,Me=2*Pe-1,Ze=ne.alpha()-we.alpha(),ie=((Me*Ze===-1?Me:(Me+Ze)/(1+Me*Ze))+1)/2,rr=1-ie;return Color$1.rgb(ie*ne.red()+rr*we.red(),ie*ne.green()+rr*we.green(),ie*ne.blue()+rr*we.blue(),ne.alpha()*Pe+we.alpha()*(1-Pe))}};for(const m of Object.keys(convert)){if(skippedModels.includes(m))continue;const{channels:c}=convert[m];Color$1.prototype[m]=function(...ne){return this.model===m?new Color$1(this):ne.length>0?new Color$1(ne,m):new Color$1([...assertArray(convert[this.model][m].raw(this.color)),this.valpha],m)},Color$1[m]=function(...ne){let we=ne[0];return typeof we=="number"&&(we=zeroArray(ne,c)),new Color$1(we,m)}}function roundTo(m,c){return Number(m.toFixed(c))}function roundToPlace(m){return function(c){return roundTo(c,m)}}function getset(m,c,ne){m=Array.isArray(m)?m:[m];for(const we of m)(limiters[we]||=[])[c]=ne;return m=m[0],function(we){let Pe;return we!==void 0?(ne&&(we=ne(we)),Pe=this[m](),Pe.color[c]=we,Pe):(Pe=this[m]().color[c],ne&&(Pe=ne(Pe)),Pe)}}function maxfn(m){return function(c){return Math.max(0,Math.min(m,c))}}function assertArray(m){return Array.isArray(m)?m:[m]}function zeroArray(m,c){for(let ne=0;ne<c;ne++)typeof m[ne]!="number"&&(m[ne]=0);return m}const _sfc_main$12=vue.defineComponent({__name:"BxRichtextInput",props:vue.mergeModels({userAgentRichText:{type:Boolean,default:!0},multiline:{type:Boolean,default:!0},maxLength:{default:1/0},maxLengthPerLine:{default:1/0},maxLines:{default:1/0}},{modelValue:{required:!0},modelModifiers:{},selection:{required:!0},selectionModifiers:{}}),emits:vue.mergeModels(["update:raw-text","update:focus"],["update:modelValue","update:selection"]),setup(m,{expose:c,emit:ne}){const we=vue.useModel(m,"modelValue"),Pe=ne,Me=vue.useModel(m,"selection"),Ze=Ar=>Ar.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),ie=Ar=>{const Pr=(()=>{if(Ar.customClass){if(Ar.customClassUIRepresentation==="bold")return{"font-weight":600};if(Ar.customClassUIRepresentation==="italic")return{"font-style":"italic"};if(Ar.customClassUIRepresentation==="textColor")return{color:Ar.customClassUIRepresentationColor??"#ff0000"};if(Ar.customClassUIRepresentation==="backgrundColor")return{"background-color":Ar.customClassUIRepresentationColor??"#ff0000",color:Color$1(Ar.customClassUIRepresentationColor??"#ff0000").isDark()?"white":"black"}}else return{}})();return{...Object.fromEntries(Object.entries({...Ar,...(()=>Ar.customClass==="list-item"?{display:"block",marginLeft:"1em"}:{})()}).map(([Yr,Vr])=>{const Zr=Ze(Yr);return[Zr,(()=>Zr==="font-size"&&typeof Vr=="number"?`${Vr}px`:Vr)()]})),...Pr}},rr=vue.ref(groupFeatureByLinebreaks$1(typeof we.value=="string"?[{text:we.value,format:{}}]:we.value));vue.watch(rr,Ar=>{const Pr=ungroupFeaturesDividedByLinebreaks(Ar);isEqual(Pr,we.value)||(we.value=Pr)}),vue.watch(we,()=>{const Ar=groupFeatureByLinebreaks$1(typeof we.value=="string"?[{text:we.value,format:{}}]:we.value);isEqual(Ar,we.value)||(rr.value=Ar)});const pr=vue.ref(rr.value),or=vue.computed(()=>getRawText(pr.value));vue.watch(or,()=>{Pe("update:raw-text",or.value)},{immediate:!0});const _r=vue.ref(),Lr=vue.ref(),Br=vue.ref(!1);return vue.watch(Br,()=>{Pe("update:focus",Br.value)},{immediate:!0}),c({richTextInstance:Lr}),(Ar,Pr)=>(vue.openBlock(),vue.createBlock(RichText,{ref_key:"richTextInstance",ref:Lr,selection:Me.value,"onUpdate:selection":Pr[0]||(Pr[0]=Nr=>Me.value=Nr),value:rr.value,"onUpdate:value":Pr[1]||(Pr[1]=Nr=>rr.value=Nr),"onUpdate:visibleValue":Pr[2]||(Pr[2]=Nr=>pr.value=Nr),"render-feature-inline-style":ie,"user-agent-rich-text":Ar.userAgentRichText,"max-length":Ar.maxLength,"max-length-per-line":Ar.maxLengthPerLine,"max-lines":Ar.maxLines,multiline:Ar.multiline,"onUpdate:warningMessage":Pr[3]||(Pr[3]=Nr=>_r.value=Nr),focus:Br.value,"onUpdate:focus":Pr[4]||(Pr[4]=Nr=>Br.value=Nr),class:vue.normalizeClass({warning:!!_r.value})},null,8,["selection","value","user-agent-rich-text","max-length","max-length-per-line","max-lines","multiline","focus","class"]))}}),BxRichtextInput_vue_vue_type_style_index_0_scoped_4044936e_lang="",BxRichtextInput=_export_sfc(_sfc_main$12,[["__scopeId","data-v-4044936e"]]),sides=["top","right","bottom","left"],alignments=["start","end"],placements=sides.reduce((m,c)=>m.concat(c,c+"-"+alignments[0],c+"-"+alignments[1]),[]),min=Math.min,max=Math.max,round=Math.round,createCoords=m=>({x:m,y:m}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp(m,c,ne){return max(m,min(c,ne))}function evaluate(m,c){return typeof m=="function"?m(c):m}function getSide(m){return m.split("-")[0]}function getAlignment(m){return m.split("-")[1]}function getOppositeAxis(m){return m==="x"?"y":"x"}function getAxisLength(m){return m==="y"?"height":"width"}function getSideAxis(m){return["top","bottom"].includes(getSide(m))?"y":"x"}function getAlignmentAxis(m){return getOppositeAxis(getSideAxis(m))}function getAlignmentSides(m,c,ne){ne===void 0&&(ne=!1);const we=getAlignment(m),Pe=getAlignmentAxis(m),Me=getAxisLength(Pe);let Ze=Pe==="x"?we===(ne?"end":"start")?"right":"left":we==="start"?"bottom":"top";return c.reference[Me]>c.floating[Me]&&(Ze=getOppositePlacement(Ze)),[Ze,getOppositePlacement(Ze)]}function getExpandedPlacements(m){const c=getOppositePlacement(m);return[getOppositeAlignmentPlacement(m),c,getOppositeAlignmentPlacement(c)]}function getOppositeAlignmentPlacement(m){return m.replace(/start|end/g,c=>oppositeAlignmentMap[c])}function getSideList(m,c,ne){const we=["left","right"],Pe=["right","left"],Me=["top","bottom"],Ze=["bottom","top"];switch(m){case"top":case"bottom":return ne?c?Pe:we:c?we:Pe;case"left":case"right":return c?Me:Ze;default:return[]}}function getOppositeAxisPlacements(m,c,ne,we){const Pe=getAlignment(m);let Me=getSideList(getSide(m),ne==="start",we);return Pe&&(Me=Me.map(Ze=>Ze+"-"+Pe),c&&(Me=Me.concat(Me.map(getOppositeAlignmentPlacement)))),Me}function getOppositePlacement(m){return m.replace(/left|right|bottom|top/g,c=>oppositeSideMap[c])}function expandPaddingObject(m){return{top:0,right:0,bottom:0,left:0,...m}}function getPaddingObject(m){return typeof m!="number"?expandPaddingObject(m):{top:m,right:m,bottom:m,left:m}}function rectToClientRect(m){const{x:c,y:ne,width:we,height:Pe}=m;return{width:we,height:Pe,top:ne,left:c,right:c+we,bottom:ne+Pe,x:c,y:ne}}function computeCoordsFromPlacement(m,c,ne){let{reference:we,floating:Pe}=m;const Me=getSideAxis(c),Ze=getAlignmentAxis(c),ie=getAxisLength(Ze),rr=getSide(c),pr=Me==="y",or=we.x+we.width/2-Pe.width/2,_r=we.y+we.height/2-Pe.height/2,Lr=we[ie]/2-Pe[ie]/2;let Br;switch(rr){case"top":Br={x:or,y:we.y-Pe.height};break;case"bottom":Br={x:or,y:we.y+we.height};break;case"right":Br={x:we.x+we.width,y:_r};break;case"left":Br={x:we.x-Pe.width,y:_r};break;default:Br={x:we.x,y:we.y}}switch(getAlignment(c)){case"start":Br[Ze]-=Lr*(ne&&pr?-1:1);break;case"end":Br[Ze]+=Lr*(ne&&pr?-1:1);break}return Br}const computePosition$1=async(m,c,ne)=>{const{placement:we="bottom",strategy:Pe="absolute",middleware:Me=[],platform:Ze}=ne,ie=Me.filter(Boolean),rr=await(Ze.isRTL==null?void 0:Ze.isRTL(c));let pr=await Ze.getElementRects({reference:m,floating:c,strategy:Pe}),{x:or,y:_r}=computeCoordsFromPlacement(pr,we,rr),Lr=we,Br={},Ar=0;for(let Pr=0;Pr<ie.length;Pr++){const{name:Nr,fn:Yr}=ie[Pr],{x:Vr,y:Zr,data:Wr,reset:si}=await Yr({x:or,y:_r,initialPlacement:we,placement:Lr,strategy:Pe,middlewareData:Br,rects:pr,platform:Ze,elements:{reference:m,floating:c}});or=Vr??or,_r=Zr??_r,Br={...Br,[Nr]:{...Br[Nr],...Wr}},si&&Ar<=50&&(Ar++,typeof si=="object"&&(si.placement&&(Lr=si.placement),si.rects&&(pr=si.rects===!0?await Ze.getElementRects({reference:m,floating:c,strategy:Pe}):si.rects),{x:or,y:_r}=computeCoordsFromPlacement(pr,Lr,rr)),Pr=-1)}return{x:or,y:_r,placement:Lr,strategy:Pe,middlewareData:Br}};async function detectOverflow(m,c){var ne;c===void 0&&(c={});const{x:we,y:Pe,platform:Me,rects:Ze,elements:ie,strategy:rr}=m,{boundary:pr="clippingAncestors",rootBoundary:or="viewport",elementContext:_r="floating",altBoundary:Lr=!1,padding:Br=0}=evaluate(c,m),Ar=getPaddingObject(Br),Nr=ie[Lr?_r==="floating"?"reference":"floating":_r],Yr=rectToClientRect(await Me.getClippingRect({element:(ne=await(Me.isElement==null?void 0:Me.isElement(Nr)))==null||ne?Nr:Nr.contextElement||await(Me.getDocumentElement==null?void 0:Me.getDocumentElement(ie.floating)),boundary:pr,rootBoundary:or,strategy:rr})),Vr=_r==="floating"?{x:we,y:Pe,width:Ze.floating.width,height:Ze.floating.height}:Ze.reference,Zr=await(Me.getOffsetParent==null?void 0:Me.getOffsetParent(ie.floating)),Wr=await(Me.isElement==null?void 0:Me.isElement(Zr))?await(Me.getScale==null?void 0:Me.getScale(Zr))||{x:1,y:1}:{x:1,y:1},si=rectToClientRect(Me.convertOffsetParentRelativeRectToViewportRelativeRect?await Me.convertOffsetParentRelativeRectToViewportRelativeRect({elements:ie,rect:Vr,offsetParent:Zr,strategy:rr}):Vr);return{top:(Yr.top-si.top+Ar.top)/Wr.y,bottom:(si.bottom-Yr.bottom+Ar.bottom)/Wr.y,left:(Yr.left-si.left+Ar.left)/Wr.x,right:(si.right-Yr.right+Ar.right)/Wr.x}}const arrow=m=>({name:"arrow",options:m,async fn(c){const{x:ne,y:we,placement:Pe,rects:Me,platform:Ze,elements:ie,middlewareData:rr}=c,{element:pr,padding:or=0}=evaluate(m,c)||{};if(pr==null)return{};const _r=getPaddingObject(or),Lr={x:ne,y:we},Br=getAlignmentAxis(Pe),Ar=getAxisLength(Br),Pr=await Ze.getDimensions(pr),Nr=Br==="y",Yr=Nr?"top":"left",Vr=Nr?"bottom":"right",Zr=Nr?"clientHeight":"clientWidth",Wr=Me.reference[Ar]+Me.reference[Br]-Lr[Br]-Me.floating[Ar],si=Lr[Br]-Me.reference[Br],li=await(Ze.getOffsetParent==null?void 0:Ze.getOffsetParent(pr));let yi=li?li[Zr]:0;(!yi||!await(Ze.isElement==null?void 0:Ze.isElement(li)))&&(yi=ie.floating[Zr]||Me.floating[Ar]);const mi=Wr/2-si/2,oi=yi/2-Pr[Ar]/2-1,ui=min(_r[Yr],oi),gr=min(_r[Vr],oi),Ae=ui,ze=yi-Pr[Ar]-gr,Ue=yi/2-Pr[Ar]/2+mi,tr=clamp(Ae,Ue,ze),lr=!rr.arrow&&getAlignment(Pe)!=null&&Ue!==tr&&Me.reference[Ar]/2-(Ue<Ae?ui:gr)-Pr[Ar]/2<0,vr=lr?Ue<Ae?Ue-Ae:Ue-ze:0;return{[Br]:Lr[Br]+vr,data:{[Br]:tr,centerOffset:Ue-tr-vr,...lr&&{alignmentOffset:vr}},reset:lr}}});function getPlacementList(m,c,ne){return(m?[...ne.filter(Pe=>getAlignment(Pe)===m),...ne.filter(Pe=>getAlignment(Pe)!==m)]:ne.filter(Pe=>getSide(Pe)===Pe)).filter(Pe=>m?getAlignment(Pe)===m||(c?getOppositeAlignmentPlacement(Pe)!==Pe:!1):!0)}const autoPlacement$1=function(m){return m===void 0&&(m={}),{name:"autoPlacement",options:m,async fn(c){var ne,we,Pe;const{rects:Me,middlewareData:Ze,placement:ie,platform:rr,elements:pr}=c,{crossAxis:or=!1,alignment:_r,allowedPlacements:Lr=placements,autoAlignment:Br=!0,...Ar}=evaluate(m,c),Pr=_r!==void 0||Lr===placements?getPlacementList(_r||null,Br,Lr):Lr,Nr=await detectOverflow(c,Ar),Yr=((ne=Ze.autoPlacement)==null?void 0:ne.index)||0,Vr=Pr[Yr];if(Vr==null)return{};const Zr=getAlignmentSides(Vr,Me,await(rr.isRTL==null?void 0:rr.isRTL(pr.floating)));if(ie!==Vr)return{reset:{placement:Pr[0]}};const Wr=[Nr[getSide(Vr)],Nr[Zr[0]],Nr[Zr[1]]],si=[...((we=Ze.autoPlacement)==null?void 0:we.overflows)||[],{placement:Vr,overflows:Wr}],li=Pr[Yr+1];if(li)return{data:{index:Yr+1,overflows:si},reset:{placement:li}};const yi=si.map(ui=>{const gr=getAlignment(ui.placement);return[ui.placement,gr&&or?ui.overflows.slice(0,2).reduce((Ae,ze)=>Ae+ze,0):ui.overflows[0],ui.overflows]}).sort((ui,gr)=>ui[1]-gr[1]),oi=((Pe=yi.filter(ui=>ui[2].slice(0,getAlignment(ui[0])?2:3).every(gr=>gr<=0))[0])==null?void 0:Pe[0])||yi[0][0];return oi!==ie?{data:{index:Yr+1,overflows:si},reset:{placement:oi}}:{}}}},flip=function(m){return m===void 0&&(m={}),{name:"flip",options:m,async fn(c){var ne,we;const{placement:Pe,middlewareData:Me,rects:Ze,initialPlacement:ie,platform:rr,elements:pr}=c,{mainAxis:or=!0,crossAxis:_r=!0,fallbackPlacements:Lr,fallbackStrategy:Br="bestFit",fallbackAxisSideDirection:Ar="none",flipAlignment:Pr=!0,...Nr}=evaluate(m,c);if((ne=Me.arrow)!=null&&ne.alignmentOffset)return{};const Yr=getSide(Pe),Vr=getSideAxis(ie),Zr=getSide(ie)===ie,Wr=await(rr.isRTL==null?void 0:rr.isRTL(pr.floating)),si=Lr||(Zr||!Pr?[getOppositePlacement(ie)]:getExpandedPlacements(ie)),li=Ar!=="none";!Lr&&li&&si.push(...getOppositeAxisPlacements(ie,Pr,Ar,Wr));const yi=[ie,...si],mi=await detectOverflow(c,Nr),oi=[];let ui=((we=Me.flip)==null?void 0:we.overflows)||[];if(or&&oi.push(mi[Yr]),_r){const Ue=getAlignmentSides(Pe,Ze,Wr);oi.push(mi[Ue[0]],mi[Ue[1]])}if(ui=[...ui,{placement:Pe,overflows:oi}],!oi.every(Ue=>Ue<=0)){var gr,Ae;const Ue=(((gr=Me.flip)==null?void 0:gr.index)||0)+1,tr=yi[Ue];if(tr)return{data:{index:Ue,overflows:ui},reset:{placement:tr}};let lr=(Ae=ui.filter(vr=>vr.overflows[0]<=0).sort((vr,xr)=>vr.overflows[1]-xr.overflows[1])[0])==null?void 0:Ae.placement;if(!lr)switch(Br){case"bestFit":{var ze;const vr=(ze=ui.filter(xr=>{if(li){const nr=getSideAxis(xr.placement);return nr===Vr||nr==="y"}return!0}).map(xr=>[xr.placement,xr.overflows.filter(nr=>nr>0).reduce((nr,$e)=>nr+$e,0)]).sort((xr,nr)=>xr[1]-nr[1])[0])==null?void 0:ze[0];vr&&(lr=vr);break}case"initialPlacement":lr=ie;break}if(Pe!==lr)return{reset:{placement:lr}}}return{}}}};function getSideOffsets(m,c){return{top:m.top-c.height,right:m.right-c.width,bottom:m.bottom-c.height,left:m.left-c.width}}function isAnySideFullyClipped(m){return sides.some(c=>m[c]>=0)}const hide=function(m){return m===void 0&&(m={}),{name:"hide",options:m,async fn(c){const{rects:ne}=c,{strategy:we="referenceHidden",...Pe}=evaluate(m,c);switch(we){case"referenceHidden":{const Me=await detectOverflow(c,{...Pe,elementContext:"reference"}),Ze=getSideOffsets(Me,ne.reference);return{data:{referenceHiddenOffsets:Ze,referenceHidden:isAnySideFullyClipped(Ze)}}}case"escaped":{const Me=await detectOverflow(c,{...Pe,altBoundary:!0}),Ze=getSideOffsets(Me,ne.floating);return{data:{escapedOffsets:Ze,escaped:isAnySideFullyClipped(Ze)}}}default:return{}}}}};function getBoundingRect(m){const c=min(...m.map(Me=>Me.left)),ne=min(...m.map(Me=>Me.top)),we=max(...m.map(Me=>Me.right)),Pe=max(...m.map(Me=>Me.bottom));return{x:c,y:ne,width:we-c,height:Pe-ne}}function getRectsByLine(m){const c=m.slice().sort((Pe,Me)=>Pe.y-Me.y),ne=[];let we=null;for(let Pe=0;Pe<c.length;Pe++){const Me=c[Pe];!we||Me.y-we.y>we.height/2?ne.push([Me]):ne[ne.length-1].push(Me),we=Me}return ne.map(Pe=>rectToClientRect(getBoundingRect(Pe)))}const inline=function(m){return m===void 0&&(m={}),{name:"inline",options:m,async fn(c){const{placement:ne,elements:we,rects:Pe,platform:Me,strategy:Ze}=c,{padding:ie=2,x:rr,y:pr}=evaluate(m,c),or=Array.from(await(Me.getClientRects==null?void 0:Me.getClientRects(we.reference))||[]),_r=getRectsByLine(or),Lr=rectToClientRect(getBoundingRect(or)),Br=getPaddingObject(ie);function Ar(){if(_r.length===2&&_r[0].left>_r[1].right&&rr!=null&&pr!=null)return _r.find(Nr=>rr>Nr.left-Br.left&&rr<Nr.right+Br.right&&pr>Nr.top-Br.top&&pr<Nr.bottom+Br.bottom)||Lr;if(_r.length>=2){if(getSideAxis(ne)==="y"){const ui=_r[0],gr=_r[_r.length-1],Ae=getSide(ne)==="top",ze=ui.top,Ue=gr.bottom,tr=Ae?ui.left:gr.left,lr=Ae?ui.right:gr.right,vr=lr-tr,xr=Ue-ze;return{top:ze,bottom:Ue,left:tr,right:lr,width:vr,height:xr,x:tr,y:ze}}const Nr=getSide(ne)==="left",Yr=max(..._r.map(ui=>ui.right)),Vr=min(..._r.map(ui=>ui.left)),Zr=_r.filter(ui=>Nr?ui.left===Vr:ui.right===Yr),Wr=Zr[0].top,si=Zr[Zr.length-1].bottom,li=Vr,yi=Yr,mi=yi-li,oi=si-Wr;return{top:Wr,bottom:si,left:li,right:yi,width:mi,height:oi,x:li,y:Wr}}return Lr}const Pr=await Me.getElementRects({reference:{getBoundingClientRect:Ar},floating:we.floating,strategy:Ze});return Pe.reference.x!==Pr.reference.x||Pe.reference.y!==Pr.reference.y||Pe.reference.width!==Pr.reference.width||Pe.reference.height!==Pr.reference.height?{reset:{rects:Pr}}:{}}}};async function convertValueToCoords(m,c){const{placement:ne,platform:we,elements:Pe}=m,Me=await(we.isRTL==null?void 0:we.isRTL(Pe.floating)),Ze=getSide(ne),ie=getAlignment(ne),rr=getSideAxis(ne)==="y",pr=["left","top"].includes(Ze)?-1:1,or=Me&&rr?-1:1,_r=evaluate(c,m);let{mainAxis:Lr,crossAxis:Br,alignmentAxis:Ar}=typeof _r=="number"?{mainAxis:_r,crossAxis:0,alignmentAxis:null}:{mainAxis:_r.mainAxis||0,crossAxis:_r.crossAxis||0,alignmentAxis:_r.alignmentAxis};return ie&&typeof Ar=="number"&&(Br=ie==="end"?Ar*-1:Ar),rr?{x:Br*or,y:Lr*pr}:{x:Lr*pr,y:Br*or}}const offset$1=function(m){return m===void 0&&(m=0),{name:"offset",options:m,async fn(c){var ne,we;const{x:Pe,y:Me,placement:Ze,middlewareData:ie}=c,rr=await convertValueToCoords(c,m);return Ze===((ne=ie.offset)==null?void 0:ne.placement)&&(we=ie.arrow)!=null&&we.alignmentOffset?{}:{x:Pe+rr.x,y:Me+rr.y,data:{...rr,placement:Ze}}}}},shift$1=function(m){return m===void 0&&(m={}),{name:"shift",options:m,async fn(c){const{x:ne,y:we,placement:Pe}=c,{mainAxis:Me=!0,crossAxis:Ze=!1,limiter:ie={fn:Nr=>{let{x:Yr,y:Vr}=Nr;return{x:Yr,y:Vr}}},...rr}=evaluate(m,c),pr={x:ne,y:we},or=await detectOverflow(c,rr),_r=getSideAxis(getSide(Pe)),Lr=getOppositeAxis(_r);let Br=pr[Lr],Ar=pr[_r];if(Me){const Nr=Lr==="y"?"top":"left",Yr=Lr==="y"?"bottom":"right",Vr=Br+or[Nr],Zr=Br-or[Yr];Br=clamp(Vr,Br,Zr)}if(Ze){const Nr=_r==="y"?"top":"left",Yr=_r==="y"?"bottom":"right",Vr=Ar+or[Nr],Zr=Ar-or[Yr];Ar=clamp(Vr,Ar,Zr)}const Pr=ie.fn({...c,[Lr]:Br,[_r]:Ar});return{...Pr,data:{x:Pr.x-ne,y:Pr.y-we,enabled:{[Lr]:Me,[_r]:Ze}}}}}},limitShift=function(m){return m===void 0&&(m={}),{options:m,fn(c){const{x:ne,y:we,placement:Pe,rects:Me,middlewareData:Ze}=c,{offset:ie=0,mainAxis:rr=!0,crossAxis:pr=!0}=evaluate(m,c),or={x:ne,y:we},_r=getSideAxis(Pe),Lr=getOppositeAxis(_r);let Br=or[Lr],Ar=or[_r];const Pr=evaluate(ie,c),Nr=typeof Pr=="number"?{mainAxis:Pr,crossAxis:0}:{mainAxis:0,crossAxis:0,...Pr};if(rr){const Zr=Lr==="y"?"height":"width",Wr=Me.reference[Lr]-Me.floating[Zr]+Nr.mainAxis,si=Me.reference[Lr]+Me.reference[Zr]-Nr.mainAxis;Br<Wr?Br=Wr:Br>si&&(Br=si)}if(pr){var Yr,Vr;const Zr=Lr==="y"?"width":"height",Wr=["top","left"].includes(getSide(Pe)),si=Me.reference[_r]-Me.floating[Zr]+(Wr&&((Yr=Ze.offset)==null?void 0:Yr[_r])||0)+(Wr?0:Nr.crossAxis),li=Me.reference[_r]+Me.reference[Zr]+(Wr?0:((Vr=Ze.offset)==null?void 0:Vr[_r])||0)-(Wr?Nr.crossAxis:0);Ar<si?Ar=si:Ar>li&&(Ar=li)}return{[Lr]:Br,[_r]:Ar}}}},size$1=function(m){return m===void 0&&(m={}),{name:"size",options:m,async fn(c){var ne,we;const{placement:Pe,rects:Me,platform:Ze,elements:ie}=c,{apply:rr=()=>{},...pr}=evaluate(m,c),or=await detectOverflow(c,pr),_r=getSide(Pe),Lr=getAlignment(Pe),Br=getSideAxis(Pe)==="y",{width:Ar,height:Pr}=Me.floating;let Nr,Yr;_r==="top"||_r==="bottom"?(Nr=_r,Yr=Lr===(await(Ze.isRTL==null?void 0:Ze.isRTL(ie.floating))?"start":"end")?"left":"right"):(Yr=_r,Nr=Lr==="end"?"top":"bottom");const Vr=Pr-or.top-or.bottom,Zr=Ar-or.left-or.right,Wr=min(Pr-or[Nr],Vr),si=min(Ar-or[Yr],Zr),li=!c.middlewareData.shift;let yi=Wr,mi=si;if((ne=c.middlewareData.shift)!=null&&ne.enabled.x&&(mi=Zr),(we=c.middlewareData.shift)!=null&&we.enabled.y&&(yi=Vr),li&&!Lr){const ui=max(or.left,0),gr=max(or.right,0),Ae=max(or.top,0),ze=max(or.bottom,0);Br?mi=Ar-2*(ui!==0||gr!==0?ui+gr:max(or.left,or.right)):yi=Pr-2*(Ae!==0||ze!==0?Ae+ze:max(or.top,or.bottom))}await rr({...c,availableWidth:mi,availableHeight:yi});const oi=await Ze.getDimensions(ie.floating);return Ar!==oi.width||Pr!==oi.height?{reset:{rects:!0}}:{}}}};function hasWindow(){return typeof window<"u"}function getNodeName(m){return isNode$1(m)?(m.nodeName||"").toLowerCase():"#document"}function getWindow$1(m){var c;return(m==null||(c=m.ownerDocument)==null?void 0:c.defaultView)||window}function getDocumentElement(m){var c;return(c=(isNode$1(m)?m.ownerDocument:m.document)||window.document)==null?void 0:c.documentElement}function isNode$1(m){return hasWindow()?m instanceof Node||m instanceof getWindow$1(m).Node:!1}function isElement$1(m){return hasWindow()?m instanceof Element||m instanceof getWindow$1(m).Element:!1}function isHTMLElement(m){return hasWindow()?m instanceof HTMLElement||m instanceof getWindow$1(m).HTMLElement:!1}function isShadowRoot(m){return!hasWindow()||typeof ShadowRoot>"u"?!1:m instanceof ShadowRoot||m instanceof getWindow$1(m).ShadowRoot}function isOverflowElement(m){const{overflow:c,overflowX:ne,overflowY:we,display:Pe}=getComputedStyle$2(m);return/auto|scroll|overlay|hidden|clip/.test(c+we+ne)&&!["inline","contents"].includes(Pe)}function isTableElement(m){return["table","td","th"].includes(getNodeName(m))}function isTopLayer(m){return[":popover-open",":modal"].some(c=>{try{return m.matches(c)}catch{return!1}})}function isContainingBlock(m){const c=isWebKit(),ne=isElement$1(m)?getComputedStyle$2(m):m;return["transform","translate","scale","rotate","perspective"].some(we=>ne[we]?ne[we]!=="none":!1)||(ne.containerType?ne.containerType!=="normal":!1)||!c&&(ne.backdropFilter?ne.backdropFilter!=="none":!1)||!c&&(ne.filter?ne.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(we=>(ne.willChange||"").includes(we))||["paint","layout","strict","content"].some(we=>(ne.contain||"").includes(we))}function getContainingBlock(m){let c=getParentNode(m);for(;isHTMLElement(c)&&!isLastTraversableNode(c);){if(isContainingBlock(c))return c;if(isTopLayer(c))return null;c=getParentNode(c)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(m){return["html","body","#document"].includes(getNodeName(m))}function getComputedStyle$2(m){return getWindow$1(m).getComputedStyle(m)}function getNodeScroll(m){return isElement$1(m)?{scrollLeft:m.scrollLeft,scrollTop:m.scrollTop}:{scrollLeft:m.scrollX,scrollTop:m.scrollY}}function getParentNode(m){if(getNodeName(m)==="html")return m;const c=m.assignedSlot||m.parentNode||isShadowRoot(m)&&m.host||getDocumentElement(m);return isShadowRoot(c)?c.host:c}function getNearestOverflowAncestor(m){const c=getParentNode(m);return isLastTraversableNode(c)?m.ownerDocument?m.ownerDocument.body:m.body:isHTMLElement(c)&&isOverflowElement(c)?c:getNearestOverflowAncestor(c)}function getOverflowAncestors(m,c,ne){var we;c===void 0&&(c=[]),ne===void 0&&(ne=!0);const Pe=getNearestOverflowAncestor(m),Me=Pe===((we=m.ownerDocument)==null?void 0:we.body),Ze=getWindow$1(Pe);if(Me){const ie=getFrameElement(Ze);return c.concat(Ze,Ze.visualViewport||[],isOverflowElement(Pe)?Pe:[],ie&&ne?getOverflowAncestors(ie):[])}return c.concat(Pe,getOverflowAncestors(Pe,[],ne))}function getFrameElement(m){return m.parent&&Object.getPrototypeOf(m.parent)?m.frameElement:null}function getCssDimensions(m){const c=getComputedStyle$2(m);let ne=parseFloat(c.width)||0,we=parseFloat(c.height)||0;const Pe=isHTMLElement(m),Me=Pe?m.offsetWidth:ne,Ze=Pe?m.offsetHeight:we,ie=round(ne)!==Me||round(we)!==Ze;return ie&&(ne=Me,we=Ze),{width:ne,height:we,$:ie}}function unwrapElement$1(m){return isElement$1(m)?m:m.contextElement}function getScale(m){const c=unwrapElement$1(m);if(!isHTMLElement(c))return createCoords(1);const ne=c.getBoundingClientRect(),{width:we,height:Pe,$:Me}=getCssDimensions(c);let Ze=(Me?round(ne.width):ne.width)/we,ie=(Me?round(ne.height):ne.height)/Pe;return(!Ze||!Number.isFinite(Ze))&&(Ze=1),(!ie||!Number.isFinite(ie))&&(ie=1),{x:Ze,y:ie}}const noOffsets=createCoords(0);function getVisualOffsets(m){const c=getWindow$1(m);return!isWebKit()||!c.visualViewport?noOffsets:{x:c.visualViewport.offsetLeft,y:c.visualViewport.offsetTop}}function shouldAddVisualOffsets(m,c,ne){return c===void 0&&(c=!1),!ne||c&&ne!==getWindow$1(m)?!1:c}function getBoundingClientRect(m,c,ne,we){c===void 0&&(c=!1),ne===void 0&&(ne=!1);const Pe=m.getBoundingClientRect(),Me=unwrapElement$1(m);let Ze=createCoords(1);c&&(we?isElement$1(we)&&(Ze=getScale(we)):Ze=getScale(m));const ie=shouldAddVisualOffsets(Me,ne,we)?getVisualOffsets(Me):createCoords(0);let rr=(Pe.left+ie.x)/Ze.x,pr=(Pe.top+ie.y)/Ze.y,or=Pe.width/Ze.x,_r=Pe.height/Ze.y;if(Me){const Lr=getWindow$1(Me),Br=we&&isElement$1(we)?getWindow$1(we):we;let Ar=Lr,Pr=getFrameElement(Ar);for(;Pr&&we&&Br!==Ar;){const Nr=getScale(Pr),Yr=Pr.getBoundingClientRect(),Vr=getComputedStyle$2(Pr),Zr=Yr.left+(Pr.clientLeft+parseFloat(Vr.paddingLeft))*Nr.x,Wr=Yr.top+(Pr.clientTop+parseFloat(Vr.paddingTop))*Nr.y;rr*=Nr.x,pr*=Nr.y,or*=Nr.x,_r*=Nr.y,rr+=Zr,pr+=Wr,Ar=getWindow$1(Pr),Pr=getFrameElement(Ar)}}return rectToClientRect({width:or,height:_r,x:rr,y:pr})}function getWindowScrollBarX(m,c){const ne=getNodeScroll(m).scrollLeft;return c?c.left+ne:getBoundingClientRect(getDocumentElement(m)).left+ne}function getHTMLOffset(m,c,ne){ne===void 0&&(ne=!1);const we=m.getBoundingClientRect(),Pe=we.left+c.scrollLeft-(ne?0:getWindowScrollBarX(m,we)),Me=we.top+c.scrollTop;return{x:Pe,y:Me}}function convertOffsetParentRelativeRectToViewportRelativeRect(m){let{elements:c,rect:ne,offsetParent:we,strategy:Pe}=m;const Me=Pe==="fixed",Ze=getDocumentElement(we),ie=c?isTopLayer(c.floating):!1;if(we===Ze||ie&&Me)return ne;let rr={scrollLeft:0,scrollTop:0},pr=createCoords(1);const or=createCoords(0),_r=isHTMLElement(we);if((_r||!_r&&!Me)&&((getNodeName(we)!=="body"||isOverflowElement(Ze))&&(rr=getNodeScroll(we)),isHTMLElement(we))){const Br=getBoundingClientRect(we);pr=getScale(we),or.x=Br.x+we.clientLeft,or.y=Br.y+we.clientTop}const Lr=Ze&&!_r&&!Me?getHTMLOffset(Ze,rr,!0):createCoords(0);return{width:ne.width*pr.x,height:ne.height*pr.y,x:ne.x*pr.x-rr.scrollLeft*pr.x+or.x+Lr.x,y:ne.y*pr.y-rr.scrollTop*pr.y+or.y+Lr.y}}function getClientRects(m){return Array.from(m.getClientRects())}function getDocumentRect(m){const c=getDocumentElement(m),ne=getNodeScroll(m),we=m.ownerDocument.body,Pe=max(c.scrollWidth,c.clientWidth,we.scrollWidth,we.clientWidth),Me=max(c.scrollHeight,c.clientHeight,we.scrollHeight,we.clientHeight);let Ze=-ne.scrollLeft+getWindowScrollBarX(m);const ie=-ne.scrollTop;return getComputedStyle$2(we).direction==="rtl"&&(Ze+=max(c.clientWidth,we.clientWidth)-Pe),{width:Pe,height:Me,x:Ze,y:ie}}function getViewportRect(m,c){const ne=getWindow$1(m),we=getDocumentElement(m),Pe=ne.visualViewport;let Me=we.clientWidth,Ze=we.clientHeight,ie=0,rr=0;if(Pe){Me=Pe.width,Ze=Pe.height;const pr=isWebKit();(!pr||pr&&c==="fixed")&&(ie=Pe.offsetLeft,rr=Pe.offsetTop)}return{width:Me,height:Ze,x:ie,y:rr}}function getInnerBoundingClientRect(m,c){const ne=getBoundingClientRect(m,!0,c==="fixed"),we=ne.top+m.clientTop,Pe=ne.left+m.clientLeft,Me=isHTMLElement(m)?getScale(m):createCoords(1),Ze=m.clientWidth*Me.x,ie=m.clientHeight*Me.y,rr=Pe*Me.x,pr=we*Me.y;return{width:Ze,height:ie,x:rr,y:pr}}function getClientRectFromClippingAncestor(m,c,ne){let we;if(c==="viewport")we=getViewportRect(m,ne);else if(c==="document")we=getDocumentRect(getDocumentElement(m));else if(isElement$1(c))we=getInnerBoundingClientRect(c,ne);else{const Pe=getVisualOffsets(m);we={x:c.x-Pe.x,y:c.y-Pe.y,width:c.width,height:c.height}}return rectToClientRect(we)}function hasFixedPositionAncestor(m,c){const ne=getParentNode(m);return ne===c||!isElement$1(ne)||isLastTraversableNode(ne)?!1:getComputedStyle$2(ne).position==="fixed"||hasFixedPositionAncestor(ne,c)}function getClippingElementAncestors(m,c){const ne=c.get(m);if(ne)return ne;let we=getOverflowAncestors(m,[],!1).filter(ie=>isElement$1(ie)&&getNodeName(ie)!=="body"),Pe=null;const Me=getComputedStyle$2(m).position==="fixed";let Ze=Me?getParentNode(m):m;for(;isElement$1(Ze)&&!isLastTraversableNode(Ze);){const ie=getComputedStyle$2(Ze),rr=isContainingBlock(Ze);!rr&&ie.position==="fixed"&&(Pe=null),(Me?!rr&&!Pe:!rr&&ie.position==="static"&&!!Pe&&["absolute","fixed"].includes(Pe.position)||isOverflowElement(Ze)&&!rr&&hasFixedPositionAncestor(m,Ze))?we=we.filter(or=>or!==Ze):Pe=ie,Ze=getParentNode(Ze)}return c.set(m,we),we}function getClippingRect(m){let{element:c,boundary:ne,rootBoundary:we,strategy:Pe}=m;const Ze=[...ne==="clippingAncestors"?isTopLayer(c)?[]:getClippingElementAncestors(c,this._c):[].concat(ne),we],ie=Ze[0],rr=Ze.reduce((pr,or)=>{const _r=getClientRectFromClippingAncestor(c,or,Pe);return pr.top=max(_r.top,pr.top),pr.right=min(_r.right,pr.right),pr.bottom=min(_r.bottom,pr.bottom),pr.left=max(_r.left,pr.left),pr},getClientRectFromClippingAncestor(c,ie,Pe));return{width:rr.right-rr.left,height:rr.bottom-rr.top,x:rr.left,y:rr.top}}function getDimensions(m){const{width:c,height:ne}=getCssDimensions(m);return{width:c,height:ne}}function getRectRelativeToOffsetParent(m,c,ne){const we=isHTMLElement(c),Pe=getDocumentElement(c),Me=ne==="fixed",Ze=getBoundingClientRect(m,!0,Me,c);let ie={scrollLeft:0,scrollTop:0};const rr=createCoords(0);if(we||!we&&!Me)if((getNodeName(c)!=="body"||isOverflowElement(Pe))&&(ie=getNodeScroll(c)),we){const Lr=getBoundingClientRect(c,!0,Me,c);rr.x=Lr.x+c.clientLeft,rr.y=Lr.y+c.clientTop}else Pe&&(rr.x=getWindowScrollBarX(Pe));const pr=Pe&&!we&&!Me?getHTMLOffset(Pe,ie):createCoords(0),or=Ze.left+ie.scrollLeft-rr.x-pr.x,_r=Ze.top+ie.scrollTop-rr.y-pr.y;return{x:or,y:_r,width:Ze.width,height:Ze.height}}function isStaticPositioned(m){return getComputedStyle$2(m).position==="static"}function getTrueOffsetParent(m,c){if(!isHTMLElement(m)||getComputedStyle$2(m).position==="fixed")return null;if(c)return c(m);let ne=m.offsetParent;return getDocumentElement(m)===ne&&(ne=ne.ownerDocument.body),ne}function getOffsetParent(m,c){const ne=getWindow$1(m);if(isTopLayer(m))return ne;if(!isHTMLElement(m)){let Pe=getParentNode(m);for(;Pe&&!isLastTraversableNode(Pe);){if(isElement$1(Pe)&&!isStaticPositioned(Pe))return Pe;Pe=getParentNode(Pe)}return ne}let we=getTrueOffsetParent(m,c);for(;we&&isTableElement(we)&&isStaticPositioned(we);)we=getTrueOffsetParent(we,c);return we&&isLastTraversableNode(we)&&isStaticPositioned(we)&&!isContainingBlock(we)?ne:we||getContainingBlock(m)||ne}const getElementRects=async function(m){const c=this.getOffsetParent||getOffsetParent,ne=this.getDimensions,we=await ne(m.floating);return{reference:getRectRelativeToOffsetParent(m.reference,await c(m.floating),m.strategy),floating:{x:0,y:0,width:we.width,height:we.height}}};function isRTL(m){return getComputedStyle$2(m).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement:isElement$1,isRTL},offset=offset$1,autoPlacement=autoPlacement$1,shift=shift$1,size=size$1,computePosition=(m,c,ne)=>{const we=new Map,Pe={platform,...ne},Me={...Pe.platform,_c:we};return computePosition$1(m,c,{...Pe,platform:Me})};function isComponentPublicInstance(m){return m!=null&&typeof m=="object"&&"$el"in m}function unwrapElement(m){if(isComponentPublicInstance(m)){const c=m.$el;return isNode$1(c)&&getNodeName(c)==="#comment"?null:c}return m}function toValue$1(m){return typeof m=="function"?m():vue.unref(m)}function getDPR(m){return typeof window>"u"?1:(m.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(m,c){const ne=getDPR(m);return Math.round(c*ne)/ne}function useFloating(m,c,ne){ne===void 0&&(ne={});const we=ne.whileElementsMounted,Pe=vue.computed(()=>{var yi;return(yi=toValue$1(ne.open))!=null?yi:!0}),Me=vue.computed(()=>toValue$1(ne.middleware)),Ze=vue.computed(()=>{var yi;return(yi=toValue$1(ne.placement))!=null?yi:"bottom"}),ie=vue.computed(()=>{var yi;return(yi=toValue$1(ne.strategy))!=null?yi:"absolute"}),rr=vue.computed(()=>{var yi;return(yi=toValue$1(ne.transform))!=null?yi:!0}),pr=vue.computed(()=>unwrapElement(m.value)),or=vue.computed(()=>unwrapElement(c.value)),_r=vue.ref(0),Lr=vue.ref(0),Br=vue.ref(ie.value),Ar=vue.ref(Ze.value),Pr=vue.shallowRef({}),Nr=vue.ref(!1),Yr=vue.computed(()=>{const yi={position:Br.value,left:"0",top:"0"};if(!or.value)return yi;const mi=roundByDPR(or.value,_r.value),oi=roundByDPR(or.value,Lr.value);return rr.value?{...yi,transform:"translate("+mi+"px, "+oi+"px)",...getDPR(or.value)>=1.5&&{willChange:"transform"}}:{position:Br.value,left:mi+"px",top:oi+"px"}});let Vr;function Zr(){if(pr.value==null||or.value==null)return;const yi=Pe.value;computePosition(pr.value,or.value,{middleware:Me.value,placement:Ze.value,strategy:ie.value}).then(mi=>{_r.value=mi.x,Lr.value=mi.y,Br.value=mi.strategy,Ar.value=mi.placement,Pr.value=mi.middlewareData,Nr.value=yi!==!1})}function Wr(){typeof Vr=="function"&&(Vr(),Vr=void 0)}function si(){if(Wr(),we===void 0){Zr();return}if(pr.value!=null&&or.value!=null){Vr=we(pr.value,or.value,Zr);return}}function li(){Pe.value||(Nr.value=!1)}return vue.watch([Me,Ze,ie,Pe],Zr,{flush:"sync"}),vue.watch([pr,or],si,{flush:"sync"}),vue.watch(Pe,li,{flush:"sync"}),vue.getCurrentScope()&&vue.onScopeDispose(Wr),{x:vue.shallowReadonly(_r),y:vue.shallowReadonly(Lr),strategy:vue.shallowReadonly(Br),placement:vue.shallowReadonly(Ar),middlewareData:vue.shallowReadonly(Pr),isPositioned:vue.shallowReadonly(Nr),floatingStyles:Yr,update:Zr}}const _hoisted_1$O=["data-bx-popover-id"],_hoisted_2$A=["data-origin","data-placement"],_hoisted_3$p={class:"popover-inner"},_sfc_main$11=vue.defineComponent({__name:"PopoverElement",props:{floatingElement:{},styles:{},customClasses:{},alignment:{},allowedPlacements:{},arrow:{type:Boolean},bxPopoverId:{},noPointerEvents:{type:Boolean,default:!1},overflowVisible:{type:Boolean}},emits:["close","click-outside","mouseenter","mouseleave"],setup(m,{emit:c}){const ne=m,we=c,Pe=vue.computed(()=>ne.floatingElement),Me=vue.ref(),{floatingStyles:Ze,placement:ie,middlewareData:rr}=useFloating(Pe,Me,{middleware:[autoPlacement({autoAlignment:!0,alignment:ne.alignment,allowedPlacements:ne.allowedPlacements}),shift({padding:0}),size({apply({availableWidth:Ar,availableHeight:Pr,elements:Nr}){Nr.floating.style.setProperty("--min-width",`calc(${Ar}px - 70px)`),Nr.floating.style.setProperty("--min-height",`calc(${Pr}px - 70px)`)}})]});function pr(Ar){we("mouseenter",Ar)}function or(Ar){we("mouseleave",Ar)}const _r=vue.computed(()=>{switch(ie.value){case"right":return[0,.5];case"left":return[1,.5];case"top":return[.5,1];case"bottom":return[.5,0];case"bottom-end":return[1,0];case"bottom-start":return[0,0];case"top-end":return[1,1];case"top-start":return[0,1];case"right-end":return[0,0];case"right-start":return[0,1];case"left-end":return[1,0];case"left-start":return[1,1];default:return[.5,.5]}}),Lr=Ar=>{Ar.stopPropagation()},Br=()=>{we("click-outside")};return(Ar,Pr)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["popover-wrapper",{...Object.fromEntries(Ar.customClasses.map(Nr=>[Nr,!0])),"no-pointer-events":Ar.noPointerEvents}]),onClick:Br,"data-bx-popover-id":Ar.bxPopoverId},[vue.createElementVNode("div",{ref_key:"popoverElementRef",ref:Me,class:"popover-element",style:vue.normalizeStyle({...vue.unref(Ze),...Ar.styles}),onClick:Lr,onMouseenter:pr,onMouseleave:or},[vue.createElementVNode("div",{class:vue.normalizeClass(["popover-frame-wrapper",{arrow:Ar.arrow,"overflow-visible":Ar.overflowVisible}]),"data-origin":_r.value,"data-placement":vue.unref(ie),style:vue.normalizeStyle({"--shift-left":"0px","--shift-top":"0px","transform-origin":`calc(${_r.value[0]*100}% - var(--shift-left)) calc(${_r.value[1]*100}% - var(--shift-top))`})},[vue.createElementVNode("div",{class:vue.normalizeClass(["arrow-element",{["placement-"+vue.unref(ie)]:!0}])},Pr[0]||(Pr[0]=[vue.createElementVNode("div",{class:"arrow-symbol"},null,-1)]),2),vue.createElementVNode("div",_hoisted_3$p,[vue.renderSlot(Ar.$slots,"default",{},void 0,!0)])],14,_hoisted_2$A)],36)],10,_hoisted_1$O))}}),PopoverElement_vue_vue_type_style_index_0_scoped_5f743c29_lang="",PopoverElement=_export_sfc(_sfc_main$11,[["__scopeId","data-v-5f743c29"]]),_sfc_main$10=vue.defineComponent({__name:"BxPopover",props:{show:{type:Boolean},trigger:{},customStyles:{},customClasses:{},darkenBackground:{type:Boolean,default:!0},allowedPlacements:{default:()=>["top","right","bottom","left","top-start","top-end","right-start","right-end","bottom-start","bottom-end","left-start","left-end"]},arrow:{type:Boolean,default:!0},leaveLazyness:{default:200},overflowVisible:{type:Boolean,default:!1}},emits:["update:show"],setup(m,{expose:c,emit:ne}){const we=m,Pe=ne,Me=vue.useSlots(),Ze=nanoid(),{setSlotRef:ie,slotElements:rr,vNodes:pr}=useSlotVNodes(Me.trigger),or=vue.ref(!1);vue.watch(or,()=>{or.value!==we.show&&Pe("update:show",or.value)},{immediate:!0}),vue.watch(()=>we.show,()=>{we.show!==or.value&&(or.value=we.show)},{immediate:!0});const _r=vue.computed(()=>rr.value[0]),Lr=vue.ref(!1),Br=vue.ref(!1);function Ar(){we.trigger==="click"&&(or.value=!or.value)}function Pr(){Lr.value=!0}function Nr(){Lr.value=!1}vue.watch(Lr,Wr=>{we.trigger==="hover"&&(Wr?or.value=!0:Yr())}),vue.watch(Br,Wr=>{we.trigger==="hover"&&(Wr||Yr())});function Yr(){setTimeout(()=>{!Lr.value&&!Br.value&&(or.value=!1)},we.leaveLazyness)}let Vr=[];vue.onUnmounted(()=>{for(const Wr of Vr)Wr.removeEventListener("click",Ar),Wr.removeEventListener("mouseenter",Pr),Wr.removeEventListener("mouseleave",Nr)}),vue.watch(rr,(Wr,si)=>{if(si)for(const li of si)li.removeEventListener("click",Ar),li.removeEventListener("mouseenter",Pr),li.removeEventListener("mouseleave",Nr);for(const li of Wr)li.addEventListener("click",Ar),li.addEventListener("mouseenter",Pr),li.addEventListener("mouseleave",Nr),li.nodeType===Node.ELEMENT_NODE&&(li.dataset.bxTargetPopoverId=Ze);Vr=Wr});const Zr=window.bluepicPopupProvider;return vue.onMounted(()=>{const Wr=document.querySelector(GLOBAL_APP_WRAPPER_SELECTOR);!Wr||(Wr.classList.add("bluepic-popup-app-wrapper"),Wr.parentElement?.classList.add("bluepic-popup-body"))}),vue.onUnmounted(()=>{for(const Wr of rr.value)Wr.removeEventListener("click",Ar);console.log("BX POPOVER UNMOUNTED",Ze),Zr.popoverProviderRef.pull(Ze)}),vue.watch(or,()=>{or.value?Zr.popoverProviderRef.push(Ze,()=>vue.h(PopoverElement,{floatingElement:_r.value,styles:{...we.customStyles},customClasses:we.customClasses??[],onClose(){or.value=!1},arrow:we.arrow,allowedPlacements:we.allowedPlacements,bxPopoverId:Ze,noPointerEvents:we.trigger==="hover"||we.trigger==="manual",overflowVisible:we.overflowVisible,onMouseenter(){Br.value=!0},onMouseleave(){Br.value=!1}},{default:()=>Me.content()}),{darkenBackground:we.darkenBackground,handleClickOutside(){we.trigger==="click"&&(or.value=!1)}}):Zr.popoverProviderRef.pull(Ze)}),c({close(){or.value=!1},show(){or.value=!0},destroy(){}}),(Wr,si)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(pr),(li,yi)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(li),{ref_for:!0,ref:vue.unref(ie)(yi)},null,512))),256))}}),BxPopover_vue_vue_type_style_index_0_scoped_6fc563ec_lang="",BxPopover=_export_sfc(_sfc_main$10,[["__scopeId","data-v-6fc563ec"]]),_hoisted_1$N=["onClick"],_hoisted_2$z={key:0,class:"icon-wrapper"},_hoisted_3$o={key:1,class:"icon-wrapper"},_hoisted_4$g={key:3},_hoisted_5$b={class:"active-symbol"},_sfc_main$$=vue.defineComponent({__name:"BxMenu",props:{items:{},primary:{type:Boolean,default:!1},secondary:{type:Boolean,default:!1}},emits:["action"],setup(m,{emit:c}){const ne=c,we=vue.useSlots();function Pe(Me){ne("action",Me)}return(Me,Ze)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["bx-menu",{primary:Me.primary,secondary:Me.secondary}])},[we["render-items"]?vue.renderSlot(Me.$slots,"render-items",{key:0,items:Me.items},void 0,!0):(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:1},vue.renderList(Me.items,(ie,rr)=>(vue.openBlock(),vue.createElementBlock("div",{key:rr,onClick:pr=>Pe(ie),class:vue.normalizeClass(["bx-menu__item",{active:ie.isActive===!0}])},[we["render-item-icon"]?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$z,[vue.renderSlot(Me.$slots,"render-item-icon",{item:ie,isActive:ie.isActive===!0},void 0,!0)])):ie.icon?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$o,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(ie.icon())))])):vue.createCommentVNode("",!0),we["render-item-label"]?vue.renderSlot(Me.$slots,"render-item-label",{key:2,item:ie,isActive:ie.isActive===!0},void 0,!0):(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$g,vue.toDisplayString(ie.label),1)),vue.createElementVNode("div",_hoisted_5$b,[we["render-item-active-symbol"]?vue.renderSlot(Me.$slots,"render-item-active-symbol",{key:0,item:ie,isActive:ie.isActive===!0},void 0,!0):(vue.openBlock(),vue.createBlock(BxIcon,{key:1,size:14,style:vue.normalizeStyle({opacity:ie.isActive===!0?1:0})},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(CheckmarkOutline))]),_:2},1032,["style"]))])],10,_hoisted_1$N))),128))],2))}}),BxMenu_vue_vue_type_style_index_0_scoped_ca1b34cf_lang="",BxMenu=_export_sfc(_sfc_main$$,[["__scopeId","data-v-ca1b34cf"]]);function useElementBounding$1(m){const c=vue.ref(),ne=()=>{m.value&&(c.value=m.value.getBoundingClientRect())};vue.onMounted(()=>{ne(),window.addEventListener("resize",ne)});const we=new ResizeObserver(()=>{ne()}),Pe=new MutationObserver(()=>{ne()}),Me=vue.watch(m,(Ze,ie)=>{Ze&&!ie&&(we.observe(Ze),Pe.observe(Ze,{attributes:!0,childList:!0,subtree:!0}))});return vue.onBeforeUnmount(()=>{window.removeEventListener("resize",ne),Me(),we.disconnect(),Pe.disconnect()}),{rect:c,width:vue.computed(()=>c.value?.width),height:vue.computed(()=>c.value?.height),x:vue.computed(()=>c.value?.x),y:vue.computed(()=>c.value?.y)}}const _hoisted_1$M={key:0,class:"prefix-wrapper"},_hoisted_2$y={key:1,class:"prefix-wrapper"},_hoisted_3$n={class:"select-value"},_hoisted_4$f={class:"suffix-wrapper"},iconSize="24px",_sfc_main$_=vue.defineComponent({__name:"BxSelect",props:vue.mergeModels({trigger:{default:"click"},options:{},disabled:{type:Boolean,default:!1},placeholderActiveLabel:{}},{modelValue:{required:!1},modelModifiers:{},show:{type:Boolean,required:!1,default:!1},showModifiers:{}}),emits:["update:modelValue","update:show"],setup(m,{expose:c}){const ne=m,we=vue.useSlots(),Pe=vue.useModel(m,"modelValue"),Me=vue.ref(),{width:Ze}=useElementBounding$1(Me);vue.watchEffect(()=>{console.log("bxSelectMainWidth",Ze.value)});const ie=vue.ref(),rr=vue.useModel(m,"show"),pr=vue.computed(()=>ne.options.find(Pr=>Pr.value===Pe.value)?.label),or=vue.computed(()=>{const Ar=ne.options.find(Pr=>Pr.value===Pe.value);if(!!Ar)return we["render-option-icon"]?()=>we["render-option-icon"]({option:Ar,isActive:_r(Ar)}):Ar.icon});function _r(Ar){return Ar.value===Pe.value}vue.watch(Pe,()=>{ie.value?.close()});const Lr=Ar=>{const Pr=ne.options[Number(Ar.key)];Pr&&(Pe.value=Pr.value)};c({closePopover(){ie.value?.close()},showPopover(){ie.value?.show()}});const Br=vue.computed(()=>ne.options.map((Ar,Pr)=>({label:Ar.label,key:Pr,icon:Ar.icon,isActive:_r(Ar)})));return(Ar,Pr)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"bxSelectMainRef",ref:Me,class:vue.normalizeClass(["bx-select",{disabled:Ar.disabled}]),style:vue.normalizeStyle({"--icon-size":iconSize})},[vue.createVNode(BxPopover,{ref_key:"popoverRef",ref:ie,trigger:Ar.trigger,"allowed-placements":["bottom","top"],arrow:!1,"darken-background":!1,"custom-classes":["bx-select-popover"],show:rr.value,"onUpdate:show":Pr[0]||(Pr[0]=Nr=>rr.value=Nr)},{trigger:vue.withCtx(()=>[we.trigger?vue.renderSlot(Ar.$slots,"trigger",{key:0},void 0,!0):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(["select-trigger",{focus:rr.value}])},[we.prefix?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$M,[vue.renderSlot(Ar.$slots,"prefix",{},void 0,!0)])):or.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$y,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(or.value)))])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_3$n,[vue.createElementVNode("span",{class:vue.normalizeClass({placeholder:pr.value===void 0})},[we.label?vue.renderSlot(Ar.$slots,"label",{key:0,label:pr.value??Ar.placeholderActiveLabel},void 0,!0):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createTextVNode(vue.toDisplayString(pr.value??Ar.placeholderActiveLabel),1)],64))],2)]),vue.createElementVNode("div",_hoisted_4$f,[we.suffix?vue.renderSlot(Ar.$slots,"suffix",{key:0},void 0,!0):(vue.openBlock(),vue.createBlock(BxIcon,{key:1,size:14},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ChevronDownOutline))]),_:1}))])],2))]),content:vue.withCtx(()=>[vue.createVNode(BxMenu,{items:Br.value,secondary:"",onAction:Lr,style:vue.normalizeStyle({width:`calc(${vue.unref(Ze)}px - 8px)`})},null,8,["items","style"])]),_:3},8,["trigger","show"])],6))}}),BxSelect_vue_vue_type_style_index_0_scoped_3f55a69c_lang="",BxSelect_vue_vue_type_style_index_1_lang="",BxSelect=_export_sfc(_sfc_main$_,[["__scopeId","data-v-3f55a69c"]]),_hoisted_1$L={class:"tooltip-wrapper"},_sfc_main$Z=vue.defineComponent({__name:"BxTooltip",props:vue.mergeModels({trigger:{},allowedPlacements:{},customPopoverClasses:{}},{show:{type:Boolean,required:!1,default:!1},showModifiers:{}}),emits:["update:show"],setup(m){const c=vue.useModel(m,"show"),ne=m,we=vue.useSlots(),Pe=vue.ref(),{setSlotRef:Me,slotElements:Ze,vNodes:ie}=useSlotVNodes(we.trigger);function rr(pr){}return vue.watch(Ze,()=>{for(const pr of Ze.value)pr.addEventListener("click",rr)}),vue.onUnmounted(()=>{for(const pr of Ze.value)pr.removeEventListener("click",rr)}),(pr,or)=>(vue.openBlock(),vue.createBlock(BxPopover,{ref_key:"popover",ref:Pe,show:c.value,"onUpdate:show":or[0]||(or[0]=_r=>c.value=_r),trigger:pr.trigger,"darken-background":!1,"allowed-placements":pr.allowedPlacements,"custom-classes":["tooltip-popover",...ne.customPopoverClasses??[]],"overflow-visible":!0},{trigger:vue.withCtx(()=>[vue.renderSlot(pr.$slots,"trigger",{},void 0,!0)]),content:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$L,[vue.renderSlot(pr.$slots,"content",{},void 0,!0)])]),_:3},8,["show","trigger","allowed-placements","custom-classes"]))}}),BxTooltip_vue_vue_type_style_index_0_scoped_0c1f2710_lang="",BxTooltip_vue_vue_type_style_index_1_lang="",BxTooltip=_export_sfc(_sfc_main$Z,[["__scopeId","data-v-0c1f2710"]]),_hoisted_1$K={key:0,class:"bx-input__prefix"},_hoisted_2$x=["placeholder","readonly"],_hoisted_3$m=["readonly","placeholder","type"],_hoisted_4$e={key:1,class:"bx-input__suffix"},_hoisted_5$a={key:0,class:"bx-input__loading-wrapper"},_hoisted_6$7={key:1,class:"bx-input__footer"},_hoisted_7$5={key:0,class:"bx-input__clear"},_hoisted_8$4={key:1,class:"bx-input__word-count"},_hoisted_9$4={class:"text-overflow-errors"},_hoisted_10$4={key:0,class:"text-err"},_hoisted_11$4={class:"overflow-label"},_hoisted_12$3={key:1,class:"text-err"},_hoisted_13$3={class:"overflow-label"},_hoisted_14$3={key:2,class:"text-err"},_hoisted_15$3={class:"index-label"},_hoisted_16$3={class:"overflow-label"},_sfc_main$Y=vue.defineComponent({__name:"BxInput",props:vue.mergeModels({size:{default:"medium"},loading:{type:Boolean,default:!1},round:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},inputProps:{default:()=>({})},placeholder:{},validator:{},maxLength:{default:1/0},maxLineLength:{default:1/0},maxLines:{default:1/0},showWordCount:{type:Boolean,default:!1},type:{default:"text"},state:{default:"default"},clearable:{type:Boolean,default:!1},resizeable:{type:Boolean,default:!0},richtext:{},maxHeight:{default:"100px"},readonly:{type:Boolean,default:!1}},{modelValue:{type:[String,Number,Boolean,Array],required:!1,default:""},modelModifiers:{}}),emits:vue.mergeModels(["enter","focus","blur"],["update:modelValue"]),setup(m,{expose:c,emit:ne}){const we=m,Pe=ne,Me=vue.useSlots(),Ze=vue.useModel(m,"modelValue"),ie=vue.ref(Ze.value),rr=vue.ref([]),pr=vue.ref(0),or=vue.ref(0),_r=vue.computed(()=>{if(rr.value.length>0||pr.value>0||or.value>0)return{lineOverflows:rr.value.length>0?rr.value:void 0,overlowingLines:pr.value>0?pr.value:void 0,overflowingCharacters:or.value>0?or.value:void 0}}),Lr=vue.computed({get(){return _r.value!==void 0},set(vr){}}),Br=vue.computed(()=>String(ie.value).split(`
70
70
  `).slice(0,we.maxLines??1/0).map(nr=>nr.slice(0,we.maxLineLength??1/0)).join(`
71
71
  `).slice(0,we.maxLength??1/0));vue.watch(Ze,vr=>{vr!==Br.value&&(ie.value=vr)}),vue.watch(ie,vr=>{if(typeof vr=="object"&&vr!==null)Ze.value=sliceRichText$1(vr,0,we.maxLength);else{const nr=String(vr).split(`
72
72
  `);Ze.value!==Br.value&&(Ze.value=Br.value),we.maxLineLength!==1/0&&we.maxLineLength!==null&&(rr.value=nr.filter($e=>$e.length>(we.maxLineLength??1/0)).map($e=>({index:nr.indexOf($e),length:$e.length}))),we.maxLines!==1/0&&we.maxLines!==null&&(pr.value=Math.max(0,String(vr).split(`