wuepgg3-track 2.0.0 → 2.0.1

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.
@@ -1,59 +0,0 @@
1
- var CA=Object.defineProperty;var AA=(Qr,ar,Ii)=>ar in Qr?CA(Qr,ar,{enumerable:!0,configurable:!0,writable:!0,value:Ii}):Qr[ar]=Ii;var ue=(Qr,ar,Ii)=>AA(Qr,typeof ar!="symbol"?ar+"":ar,Ii);(function(){"use strict";var Qr=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ar=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Ii=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,zs={Space_Separator:Qr,ID_Start:ar,ID_Continue:Ii},at={isSpaceSeparator(n){return typeof n=="string"&&zs.Space_Separator.test(n)},isIdStartChar(n){return typeof n=="string"&&(n>="a"&&n<="z"||n>="A"&&n<="Z"||n==="$"||n==="_"||zs.ID_Start.test(n))},isIdContinueChar(n){return typeof n=="string"&&(n>="a"&&n<="z"||n>="A"&&n<="Z"||n>="0"&&n<="9"||n==="$"||n==="_"||n==="‌"||n==="‍"||zs.ID_Continue.test(n))},isDigit(n){return typeof n=="string"&&/[0-9]/.test(n)},isHexDigit(n){return typeof n=="string"&&/[0-9A-Fa-f]/.test(n)}};let eo,St,ur,gu,Sr,Sn,gt,to,pa;var Dg=function(e,t){eo=String(e),St="start",ur=[],gu=0,Sr=1,Sn=0,gt=void 0,to=void 0,pa=void 0;do gt=yg(),Cg[St]();while(gt.type!=="eof");return typeof t=="function"?no({"":pa},"",t):pa};function no(n,e,t){const a=n[e];if(a!=null&&typeof a=="object")if(Array.isArray(a))for(let o=0;o<a.length;o++){const s=String(o),f=no(a,s,t);f===void 0?delete a[s]:Object.defineProperty(a,s,{value:f,writable:!0,enumerable:!0,configurable:!0})}else for(const o in a){const s=no(a,o,t);s===void 0?delete a[o]:Object.defineProperty(a,o,{value:s,writable:!0,enumerable:!0,configurable:!0})}return t.call(n,e,a)}let we,pe,ga,sr,ye;function yg(){for(we="default",pe="",ga=!1,sr=1;;){ye=or();const n=Hl[we]();if(n)return n}}function or(){if(eo[gu])return String.fromCodePoint(eo.codePointAt(gu))}function z(){const n=or();return n===`
2
- `?(Sr++,Sn=0):n?Sn+=n.length:Sn++,n&&(gu+=n.length),n}const Hl={default(){switch(ye){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
3
- `:case"\r":case"\u2028":case"\u2029":z();return;case"/":z(),we="comment";return;case void 0:return z(),Ze("eof")}if(at.isSpaceSeparator(ye)){z();return}return Hl[St]()},comment(){switch(ye){case"*":z(),we="multiLineComment";return;case"/":z(),we="singleLineComment";return}throw Xe(z())},multiLineComment(){switch(ye){case"*":z(),we="multiLineCommentAsterisk";return;case void 0:throw Xe(z())}z()},multiLineCommentAsterisk(){switch(ye){case"*":z();return;case"/":z(),we="default";return;case void 0:throw Xe(z())}z(),we="multiLineComment"},singleLineComment(){switch(ye){case`
4
- `:case"\r":case"\u2028":case"\u2029":z(),we="default";return;case void 0:return z(),Ze("eof")}z()},value(){switch(ye){case"{":case"[":return Ze("punctuator",z());case"n":return z(),Jr("ull"),Ze("null",null);case"t":return z(),Jr("rue"),Ze("boolean",!0);case"f":return z(),Jr("alse"),Ze("boolean",!1);case"-":case"+":z()==="-"&&(sr=-1),we="sign";return;case".":pe=z(),we="decimalPointLeading";return;case"0":pe=z(),we="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":pe=z(),we="decimalInteger";return;case"I":return z(),Jr("nfinity"),Ze("numeric",1/0);case"N":return z(),Jr("aN"),Ze("numeric",NaN);case'"':case"'":ga=z()==='"',pe="",we="string";return}throw Xe(z())},identifierNameStartEscape(){if(ye!=="u")throw Xe(z());z();const n=ro();switch(n){case"$":case"_":break;default:if(!at.isIdStartChar(n))throw Vl();break}pe+=n,we="identifierName"},identifierName(){switch(ye){case"$":case"_":case"‌":case"‍":pe+=z();return;case"\\":z(),we="identifierNameEscape";return}if(at.isIdContinueChar(ye)){pe+=z();return}return Ze("identifier",pe)},identifierNameEscape(){if(ye!=="u")throw Xe(z());z();const n=ro();switch(n){case"$":case"_":case"‌":case"‍":break;default:if(!at.isIdContinueChar(n))throw Vl();break}pe+=n,we="identifierName"},sign(){switch(ye){case".":pe=z(),we="decimalPointLeading";return;case"0":pe=z(),we="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":pe=z(),we="decimalInteger";return;case"I":return z(),Jr("nfinity"),Ze("numeric",sr*(1/0));case"N":return z(),Jr("aN"),Ze("numeric",NaN)}throw Xe(z())},zero(){switch(ye){case".":pe+=z(),we="decimalPoint";return;case"e":case"E":pe+=z(),we="decimalExponent";return;case"x":case"X":pe+=z(),we="hexadecimal";return}return Ze("numeric",sr*0)},decimalInteger(){switch(ye){case".":pe+=z(),we="decimalPoint";return;case"e":case"E":pe+=z(),we="decimalExponent";return}if(at.isDigit(ye)){pe+=z();return}return Ze("numeric",sr*Number(pe))},decimalPointLeading(){if(at.isDigit(ye)){pe+=z(),we="decimalFraction";return}throw Xe(z())},decimalPoint(){switch(ye){case"e":case"E":pe+=z(),we="decimalExponent";return}if(at.isDigit(ye)){pe+=z(),we="decimalFraction";return}return Ze("numeric",sr*Number(pe))},decimalFraction(){switch(ye){case"e":case"E":pe+=z(),we="decimalExponent";return}if(at.isDigit(ye)){pe+=z();return}return Ze("numeric",sr*Number(pe))},decimalExponent(){switch(ye){case"+":case"-":pe+=z(),we="decimalExponentSign";return}if(at.isDigit(ye)){pe+=z(),we="decimalExponentInteger";return}throw Xe(z())},decimalExponentSign(){if(at.isDigit(ye)){pe+=z(),we="decimalExponentInteger";return}throw Xe(z())},decimalExponentInteger(){if(at.isDigit(ye)){pe+=z();return}return Ze("numeric",sr*Number(pe))},hexadecimal(){if(at.isHexDigit(ye)){pe+=z(),we="hexadecimalInteger";return}throw Xe(z())},hexadecimalInteger(){if(at.isHexDigit(ye)){pe+=z();return}return Ze("numeric",sr*Number(pe))},string(){switch(ye){case"\\":z(),pe+=xg();return;case'"':if(ga)return z(),Ze("string",pe);pe+=z();return;case"'":if(!ga)return z(),Ze("string",pe);pe+=z();return;case`
5
- `:case"\r":throw Xe(z());case"\u2028":case"\u2029":Ag(ye);break;case void 0:throw Xe(z())}pe+=z()},start(){switch(ye){case"{":case"[":return Ze("punctuator",z())}we="value"},beforePropertyName(){switch(ye){case"$":case"_":pe=z(),we="identifierName";return;case"\\":z(),we="identifierNameStartEscape";return;case"}":return Ze("punctuator",z());case'"':case"'":ga=z()==='"',we="string";return}if(at.isIdStartChar(ye)){pe+=z(),we="identifierName";return}throw Xe(z())},afterPropertyName(){if(ye===":")return Ze("punctuator",z());throw Xe(z())},beforePropertyValue(){we="value"},afterPropertyValue(){switch(ye){case",":case"}":return Ze("punctuator",z())}throw Xe(z())},beforeArrayValue(){if(ye==="]")return Ze("punctuator",z());we="value"},afterArrayValue(){switch(ye){case",":case"]":return Ze("punctuator",z())}throw Xe(z())},end(){throw Xe(z())}};function Ze(n,e){return{type:n,value:e,line:Sr,column:Sn}}function Jr(n){for(const e of n){if(or()!==e)throw Xe(z());z()}}function xg(){switch(or()){case"b":return z(),"\b";case"f":return z(),"\f";case"n":return z(),`
6
- `;case"r":return z(),"\r";case"t":return z()," ";case"v":return z(),"\v";case"0":if(z(),at.isDigit(or()))throw Xe(z());return"\0";case"x":return z(),Eg();case"u":return z(),ro();case`
7
- `:case"\u2028":case"\u2029":return z(),"";case"\r":return z(),or()===`
8
- `&&z(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Xe(z());case void 0:throw Xe(z())}return z()}function Eg(){let n="",e=or();if(!at.isHexDigit(e)||(n+=z(),e=or(),!at.isHexDigit(e)))throw Xe(z());return n+=z(),String.fromCodePoint(parseInt(n,16))}function ro(){let n="",e=4;for(;e-- >0;){const t=or();if(!at.isHexDigit(t))throw Xe(z());n+=z()}return String.fromCodePoint(parseInt(n,16))}const Cg={start(){if(gt.type==="eof")throw jr();io()},beforePropertyName(){switch(gt.type){case"identifier":case"string":to=gt.value,St="afterPropertyName";return;case"punctuator":_u();return;case"eof":throw jr()}},afterPropertyName(){if(gt.type==="eof")throw jr();St="beforePropertyValue"},beforePropertyValue(){if(gt.type==="eof")throw jr();io()},beforeArrayValue(){if(gt.type==="eof")throw jr();if(gt.type==="punctuator"&&gt.value==="]"){_u();return}io()},afterPropertyValue(){if(gt.type==="eof")throw jr();switch(gt.value){case",":St="beforePropertyName";return;case"}":_u()}},afterArrayValue(){if(gt.type==="eof")throw jr();switch(gt.value){case",":St="beforeArrayValue";return;case"]":_u()}},end(){}};function io(){let n;switch(gt.type){case"punctuator":switch(gt.value){case"{":n={};break;case"[":n=[];break}break;case"null":case"boolean":case"numeric":case"string":n=gt.value;break}if(pa===void 0)pa=n;else{const e=ur[ur.length-1];Array.isArray(e)?e.push(n):Object.defineProperty(e,to,{value:n,writable:!0,enumerable:!0,configurable:!0})}if(n!==null&&typeof n=="object")ur.push(n),Array.isArray(n)?St="beforeArrayValue":St="beforePropertyName";else{const e=ur[ur.length-1];e==null?St="end":Array.isArray(e)?St="afterArrayValue":St="afterPropertyValue"}}function _u(){ur.pop();const n=ur[ur.length-1];n==null?St="end":Array.isArray(n)?St="afterArrayValue":St="afterPropertyValue"}function Xe(n){return vu(n===void 0?`JSON5: invalid end of input at ${Sr}:${Sn}`:`JSON5: invalid character '${Zl(n)}' at ${Sr}:${Sn}`)}function jr(){return vu(`JSON5: invalid end of input at ${Sr}:${Sn}`)}function Vl(){return Sn-=5,vu(`JSON5: invalid identifier character at ${Sr}:${Sn}`)}function Ag(n){console.warn(`JSON5: '${Zl(n)}' in strings is not valid ECMAScript; consider escaping`)}function Zl(n){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[n])return e[n];if(n<" "){const t=n.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return n}function vu(n){const e=new SyntaxError(n);return e.lineNumber=Sr,e.columnNumber=Sn,e}var Fg=function(e,t,a){const o=[];let s="",f,h,_="",d;if(t!=null&&typeof t=="object"&&!Array.isArray(t)&&(a=t.space,d=t.quote,t=t.replacer),typeof t=="function")h=t;else if(Array.isArray(t)){f=[];for(const F of t){let I;typeof F=="string"?I=F:(typeof F=="number"||F instanceof String||F instanceof Number)&&(I=String(F)),I!==void 0&&f.indexOf(I)<0&&f.push(I)}}return a instanceof Number?a=Number(a):a instanceof String&&(a=String(a)),typeof a=="number"?a>0&&(a=Math.min(10,Math.floor(a)),_=" ".substr(0,a)):typeof a=="string"&&(_=a.substr(0,10)),c("",{"":e});function c(F,I){let k=I[F];switch(k!=null&&(typeof k.toJSON5=="function"?k=k.toJSON5(F):typeof k.toJSON=="function"&&(k=k.toJSON(F))),h&&(k=h.call(I,F,k)),k instanceof Number?k=Number(k):k instanceof String?k=String(k):k instanceof Boolean&&(k=k.valueOf()),k){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof k=="string")return D(k);if(typeof k=="number")return String(k);if(typeof k=="object")return Array.isArray(k)?B(k):x(k)}function D(F){const I={"'":.1,'"':.2},k={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let U="";for(let S=0;S<F.length;S++){const L=F[S];switch(L){case"'":case'"':I[L]++,U+=L;continue;case"\0":if(at.isDigit(F[S+1])){U+="\\x00";continue}}if(k[L]){U+=k[L];continue}if(L<" "){let W=L.charCodeAt(0).toString(16);U+="\\x"+("00"+W).substring(W.length);continue}U+=L}const $=d||Object.keys(I).reduce((S,L)=>I[S]<I[L]?S:L);return U=U.replace(new RegExp($,"g"),k[$]),$+U+$}function x(F){if(o.indexOf(F)>=0)throw TypeError("Converting circular structure to JSON5");o.push(F);let I=s;s=s+_;let k=f||Object.keys(F),U=[];for(const S of k){const L=c(S,F);if(L!==void 0){let W=m(S)+":";_!==""&&(W+=" "),W+=L,U.push(W)}}let $;if(U.length===0)$="{}";else{let S;if(_==="")S=U.join(","),$="{"+S+"}";else{let L=`,
9
- `+s;S=U.join(L),$=`{
10
- `+s+S+`,
11
- `+I+"}"}}return o.pop(),s=I,$}function m(F){if(F.length===0)return D(F);const I=String.fromCodePoint(F.codePointAt(0));if(!at.isIdStartChar(I))return D(F);for(let k=I.length;k<F.length;k++)if(!at.isIdContinueChar(String.fromCodePoint(F.codePointAt(k))))return D(F);return F}function B(F){if(o.indexOf(F)>=0)throw TypeError("Converting circular structure to JSON5");o.push(F);let I=s;s=s+_;let k=[];for(let $=0;$<F.length;$++){const S=c(String($),F);k.push(S!==void 0?S:"null")}let U;if(k.length===0)U="[]";else if(_==="")U="["+k.join(",")+"]";else{let $=`,
12
- `+s,S=k.join($);U=`[
13
- `+s+S+`,
14
- `+I+"]"}return o.pop(),s=I,U}},Bg={parse:Dg,stringify:Fg};class Ne{constructor(e,t){if(this.start=e,this.end=t,t<e)throw new RangeError("End cannot be less than start");this.start=e,this.end=t}serialize(){return this}static deserialize(e){return new Ne(e.start,e.end)}*[Symbol.iterator](){yield this.start,yield this.end}getOverlap(e){const t=Math.max(this.start,e.start),a=Math.min(this.end,e.end);return t<a?new Ne(t,a):null}getLength(){return this.end-this.start}toString(){return`[${this.start}, ${this.end})`}}var _a=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wu(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var bu={exports:{}};/**
15
- * @license
16
- * Lodash <https://lodash.com/>
17
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
18
- * Released under MIT license <https://lodash.com/license>
19
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
20
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
21
- */bu.exports,function(n,e){(function(){var t,a="4.17.21",o=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",h="Invalid `variable` option passed into `_.template`",_="__lodash_hash_undefined__",d=500,c="__lodash_placeholder__",D=1,x=2,m=4,B=1,F=2,I=1,k=2,U=4,$=8,S=16,L=32,W=64,N=128,q=256,H=512,Z=30,Y="...",re=800,se=16,fe=1,ce=2,Me=3,Fe=1/0,Ce=9007199254740991,vn=17976931348623157e292,kt=NaN,tt=4294967295,Te=tt-1,Pn=tt>>>1,Oe=[["ary",N],["bind",I],["bindKey",k],["curry",$],["curryRight",S],["flip",H],["partial",L],["partialRight",W],["rearg",q]],ke="[object Arguments]",Dt="[object Array]",Qt="[object AsyncFunction]",Rt="[object Boolean]",wn="[object Date]",vr="[object DOMException]",yt="[object Error]",Nt="[object Function]",bn="[object GeneratorFunction]",Je="[object Map]",_t="[object Number]",tr="[object Null]",vt="[object Object]",wr="[object Promise]",bi="[object Proxy]",Jt="[object RegExp]",xt="[object Set]",mn="[object String]",br="[object Symbol]",zi="[object Undefined]",At="[object WeakMap]",ja="[object WeakSet]",mi="[object ArrayBuffer]",$t="[object DataView]",za="[object Float32Array]",E="[object Float64Array]",v="[object Int8Array]",w="[object Int16Array]",T="[object Int32Array]",P="[object Uint8Array]",V="[object Uint8ClampedArray]",Q="[object Uint16Array]",_e="[object Uint32Array]",je=/\b__p \+= '';/g,He=/\b(__p \+=) '' \+/g,ze=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$e=/&(?:amp|lt|gt|quot|#39);/g,Xd=/[&<>"']/g,Ym=RegExp($e.source),Qm=RegExp(Xd.source),Jm=/<%-([\s\S]+?)%>/g,jm=/<%([\s\S]+?)%>/g,Kd=/<%=([\s\S]+?)%>/g,zm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,eD=/^\w*$/,tD=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kf=/[\\^$.*+?()[\]{}|]/g,nD=RegExp(kf.source),Rf=/^\s+/,rD=/\s/,iD=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,aD=/\{\n\/\* \[wrapped with (.+)\] \*/,uD=/,? & /,sD=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,oD=/[()=,{}\[\]\/\s]/,fD=/\\(\\)?/g,lD=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Yd=/\w*$/,hD=/^[-+]0x[0-9a-f]+$/i,cD=/^0b[01]+$/i,dD=/^\[object .+?Constructor\]$/,pD=/^0o[0-7]+$/i,gD=/^(?:0|[1-9]\d*)$/,_D=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ls=/($^)/,vD=/['\n\r\u2028\u2029\\]/g,hs="\\ud800-\\udfff",wD="\\u0300-\\u036f",bD="\\ufe20-\\ufe2f",mD="\\u20d0-\\u20ff",Qd=wD+bD+mD,Jd="\\u2700-\\u27bf",jd="a-z\\xdf-\\xf6\\xf8-\\xff",DD="\\xac\\xb1\\xd7\\xf7",yD="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",xD="\\u2000-\\u206f",ED=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",zd="A-Z\\xc0-\\xd6\\xd8-\\xde",e1="\\ufe0e\\ufe0f",t1=DD+yD+xD+ED,Nf="['’]",CD="["+hs+"]",n1="["+t1+"]",cs="["+Qd+"]",r1="\\d+",AD="["+Jd+"]",i1="["+jd+"]",a1="[^"+hs+t1+r1+Jd+jd+zd+"]",$f="\\ud83c[\\udffb-\\udfff]",FD="(?:"+cs+"|"+$f+")",u1="[^"+hs+"]",Lf="(?:\\ud83c[\\udde6-\\uddff]){2}",Of="[\\ud800-\\udbff][\\udc00-\\udfff]",ea="["+zd+"]",s1="\\u200d",o1="(?:"+i1+"|"+a1+")",BD="(?:"+ea+"|"+a1+")",f1="(?:"+Nf+"(?:d|ll|m|re|s|t|ve))?",l1="(?:"+Nf+"(?:D|LL|M|RE|S|T|VE))?",h1=FD+"?",c1="["+e1+"]?",SD="(?:"+s1+"(?:"+[u1,Lf,Of].join("|")+")"+c1+h1+")*",ID="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",TD="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",d1=c1+h1+SD,kD="(?:"+[AD,Lf,Of].join("|")+")"+d1,RD="(?:"+[u1+cs+"?",cs,Lf,Of,CD].join("|")+")",ND=RegExp(Nf,"g"),$D=RegExp(cs,"g"),Pf=RegExp($f+"(?="+$f+")|"+RD+d1,"g"),LD=RegExp([ea+"?"+i1+"+"+f1+"(?="+[n1,ea,"$"].join("|")+")",BD+"+"+l1+"(?="+[n1,ea+o1,"$"].join("|")+")",ea+"?"+o1+"+"+f1,ea+"+"+l1,TD,ID,r1,kD].join("|"),"g"),OD=RegExp("["+s1+hs+Qd+e1+"]"),PD=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,MD=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],UD=-1,Ke={};Ke[za]=Ke[E]=Ke[v]=Ke[w]=Ke[T]=Ke[P]=Ke[V]=Ke[Q]=Ke[_e]=!0,Ke[ke]=Ke[Dt]=Ke[mi]=Ke[Rt]=Ke[$t]=Ke[wn]=Ke[yt]=Ke[Nt]=Ke[Je]=Ke[_t]=Ke[vt]=Ke[Jt]=Ke[xt]=Ke[mn]=Ke[At]=!1;var Ve={};Ve[ke]=Ve[Dt]=Ve[mi]=Ve[$t]=Ve[Rt]=Ve[wn]=Ve[za]=Ve[E]=Ve[v]=Ve[w]=Ve[T]=Ve[Je]=Ve[_t]=Ve[vt]=Ve[Jt]=Ve[xt]=Ve[mn]=Ve[br]=Ve[P]=Ve[V]=Ve[Q]=Ve[_e]=!0,Ve[yt]=Ve[Nt]=Ve[At]=!1;var WD={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},GD={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},qD={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},HD={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},VD=parseFloat,ZD=parseInt,p1=typeof _a=="object"&&_a&&_a.Object===Object&&_a,XD=typeof self=="object"&&self&&self.Object===Object&&self,Et=p1||XD||Function("return this")(),Mf=e&&!e.nodeType&&e,Di=Mf&&!0&&n&&!n.nodeType&&n,g1=Di&&Di.exports===Mf,Uf=g1&&p1.process,Dn=function(){try{var M=Di&&Di.require&&Di.require("util").types;return M||Uf&&Uf.binding&&Uf.binding("util")}catch{}}(),_1=Dn&&Dn.isArrayBuffer,v1=Dn&&Dn.isDate,w1=Dn&&Dn.isMap,b1=Dn&&Dn.isRegExp,m1=Dn&&Dn.isSet,D1=Dn&&Dn.isTypedArray;function jt(M,K,X){switch(X.length){case 0:return M.call(K);case 1:return M.call(K,X[0]);case 2:return M.call(K,X[0],X[1]);case 3:return M.call(K,X[0],X[1],X[2])}return M.apply(K,X)}function KD(M,K,X,ie){for(var de=-1,Re=M==null?0:M.length;++de<Re;){var dt=M[de];K(ie,dt,X(dt),M)}return ie}function yn(M,K){for(var X=-1,ie=M==null?0:M.length;++X<ie&&K(M[X],X,M)!==!1;);return M}function YD(M,K){for(var X=M==null?0:M.length;X--&&K(M[X],X,M)!==!1;);return M}function y1(M,K){for(var X=-1,ie=M==null?0:M.length;++X<ie;)if(!K(M[X],X,M))return!1;return!0}function Wr(M,K){for(var X=-1,ie=M==null?0:M.length,de=0,Re=[];++X<ie;){var dt=M[X];K(dt,X,M)&&(Re[de++]=dt)}return Re}function ds(M,K){var X=M==null?0:M.length;return!!X&&ta(M,K,0)>-1}function Wf(M,K,X){for(var ie=-1,de=M==null?0:M.length;++ie<de;)if(X(K,M[ie]))return!0;return!1}function et(M,K){for(var X=-1,ie=M==null?0:M.length,de=Array(ie);++X<ie;)de[X]=K(M[X],X,M);return de}function Gr(M,K){for(var X=-1,ie=K.length,de=M.length;++X<ie;)M[de+X]=K[X];return M}function Gf(M,K,X,ie){var de=-1,Re=M==null?0:M.length;for(ie&&Re&&(X=M[++de]);++de<Re;)X=K(X,M[de],de,M);return X}function QD(M,K,X,ie){var de=M==null?0:M.length;for(ie&&de&&(X=M[--de]);de--;)X=K(X,M[de],de,M);return X}function qf(M,K){for(var X=-1,ie=M==null?0:M.length;++X<ie;)if(K(M[X],X,M))return!0;return!1}var JD=Hf("length");function jD(M){return M.split("")}function zD(M){return M.match(sD)||[]}function x1(M,K,X){var ie;return X(M,function(de,Re,dt){if(K(de,Re,dt))return ie=Re,!1}),ie}function ps(M,K,X,ie){for(var de=M.length,Re=X+(ie?1:-1);ie?Re--:++Re<de;)if(K(M[Re],Re,M))return Re;return-1}function ta(M,K,X){return K===K?hy(M,K,X):ps(M,E1,X)}function ey(M,K,X,ie){for(var de=X-1,Re=M.length;++de<Re;)if(ie(M[de],K))return de;return-1}function E1(M){return M!==M}function C1(M,K){var X=M==null?0:M.length;return X?Zf(M,K)/X:kt}function Hf(M){return function(K){return K==null?t:K[M]}}function Vf(M){return function(K){return M==null?t:M[K]}}function A1(M,K,X,ie,de){return de(M,function(Re,dt,Ue){X=ie?(ie=!1,Re):K(X,Re,dt,Ue)}),X}function ty(M,K){var X=M.length;for(M.sort(K);X--;)M[X]=M[X].value;return M}function Zf(M,K){for(var X,ie=-1,de=M.length;++ie<de;){var Re=K(M[ie]);Re!==t&&(X=X===t?Re:X+Re)}return X}function Xf(M,K){for(var X=-1,ie=Array(M);++X<M;)ie[X]=K(X);return ie}function ny(M,K){return et(K,function(X){return[X,M[X]]})}function F1(M){return M&&M.slice(0,T1(M)+1).replace(Rf,"")}function zt(M){return function(K){return M(K)}}function Kf(M,K){return et(K,function(X){return M[X]})}function eu(M,K){return M.has(K)}function B1(M,K){for(var X=-1,ie=M.length;++X<ie&&ta(K,M[X],0)>-1;);return X}function S1(M,K){for(var X=M.length;X--&&ta(K,M[X],0)>-1;);return X}function ry(M,K){for(var X=M.length,ie=0;X--;)M[X]===K&&++ie;return ie}var iy=Vf(WD),ay=Vf(GD);function uy(M){return"\\"+HD[M]}function sy(M,K){return M==null?t:M[K]}function na(M){return OD.test(M)}function oy(M){return PD.test(M)}function fy(M){for(var K,X=[];!(K=M.next()).done;)X.push(K.value);return X}function Yf(M){var K=-1,X=Array(M.size);return M.forEach(function(ie,de){X[++K]=[de,ie]}),X}function I1(M,K){return function(X){return M(K(X))}}function qr(M,K){for(var X=-1,ie=M.length,de=0,Re=[];++X<ie;){var dt=M[X];(dt===K||dt===c)&&(M[X]=c,Re[de++]=X)}return Re}function gs(M){var K=-1,X=Array(M.size);return M.forEach(function(ie){X[++K]=ie}),X}function ly(M){var K=-1,X=Array(M.size);return M.forEach(function(ie){X[++K]=[ie,ie]}),X}function hy(M,K,X){for(var ie=X-1,de=M.length;++ie<de;)if(M[ie]===K)return ie;return-1}function cy(M,K,X){for(var ie=X+1;ie--;)if(M[ie]===K)return ie;return ie}function ra(M){return na(M)?py(M):JD(M)}function Mn(M){return na(M)?gy(M):jD(M)}function T1(M){for(var K=M.length;K--&&rD.test(M.charAt(K)););return K}var dy=Vf(qD);function py(M){for(var K=Pf.lastIndex=0;Pf.test(M);)++K;return K}function gy(M){return M.match(Pf)||[]}function _y(M){return M.match(LD)||[]}var vy=function M(K){K=K==null?Et:ia.defaults(Et.Object(),K,ia.pick(Et,MD));var X=K.Array,ie=K.Date,de=K.Error,Re=K.Function,dt=K.Math,Ue=K.Object,Qf=K.RegExp,wy=K.String,xn=K.TypeError,_s=X.prototype,by=Re.prototype,aa=Ue.prototype,vs=K["__core-js_shared__"],ws=by.toString,Pe=aa.hasOwnProperty,my=0,k1=function(){var i=/[^.]+$/.exec(vs&&vs.keys&&vs.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),bs=aa.toString,Dy=ws.call(Ue),yy=Et._,xy=Qf("^"+ws.call(Pe).replace(kf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ms=g1?K.Buffer:t,Hr=K.Symbol,Ds=K.Uint8Array,R1=ms?ms.allocUnsafe:t,ys=I1(Ue.getPrototypeOf,Ue),N1=Ue.create,$1=aa.propertyIsEnumerable,xs=_s.splice,L1=Hr?Hr.isConcatSpreadable:t,tu=Hr?Hr.iterator:t,yi=Hr?Hr.toStringTag:t,Es=function(){try{var i=Fi(Ue,"defineProperty");return i({},"",{}),i}catch{}}(),Ey=K.clearTimeout!==Et.clearTimeout&&K.clearTimeout,Cy=ie&&ie.now!==Et.Date.now&&ie.now,Ay=K.setTimeout!==Et.setTimeout&&K.setTimeout,Cs=dt.ceil,As=dt.floor,Jf=Ue.getOwnPropertySymbols,Fy=ms?ms.isBuffer:t,O1=K.isFinite,By=_s.join,Sy=I1(Ue.keys,Ue),pt=dt.max,Ft=dt.min,Iy=ie.now,Ty=K.parseInt,P1=dt.random,ky=_s.reverse,jf=Fi(K,"DataView"),nu=Fi(K,"Map"),zf=Fi(K,"Promise"),ua=Fi(K,"Set"),ru=Fi(K,"WeakMap"),iu=Fi(Ue,"create"),Fs=ru&&new ru,sa={},Ry=Bi(jf),Ny=Bi(nu),$y=Bi(zf),Ly=Bi(ua),Oy=Bi(ru),Bs=Hr?Hr.prototype:t,au=Bs?Bs.valueOf:t,M1=Bs?Bs.toString:t;function C(i){if(it(i)&&!ge(i)&&!(i instanceof xe)){if(i instanceof En)return i;if(Pe.call(i,"__wrapped__"))return Up(i)}return new En(i)}var oa=function(){function i(){}return function(u){if(!nt(u))return{};if(N1)return N1(u);i.prototype=u;var l=new i;return i.prototype=t,l}}();function Ss(){}function En(i,u){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=t}C.templateSettings={escape:Jm,evaluate:jm,interpolate:Kd,variable:"",imports:{_:C}},C.prototype=Ss.prototype,C.prototype.constructor=C,En.prototype=oa(Ss.prototype),En.prototype.constructor=En;function xe(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=tt,this.__views__=[]}function Py(){var i=new xe(this.__wrapped__);return i.__actions__=qt(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=qt(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=qt(this.__views__),i}function My(){if(this.__filtered__){var i=new xe(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function Uy(){var i=this.__wrapped__.value(),u=this.__dir__,l=ge(i),p=u<0,y=l?i.length:0,A=j8(0,y,this.__views__),R=A.start,O=A.end,G=O-R,J=p?O:R-1,j=this.__iteratees__,ee=j.length,ne=0,ae=Ft(G,this.__takeCount__);if(!l||!p&&y==G&&ae==G)return fp(i,this.__actions__);var le=[];e:for(;G--&&ne<ae;){J+=u;for(var be=-1,he=i[J];++be<ee;){var De=j[be],Ae=De.iteratee,nn=De.type,Pt=Ae(he);if(nn==ce)he=Pt;else if(!Pt){if(nn==fe)continue e;break e}}le[ne++]=he}return le}xe.prototype=oa(Ss.prototype),xe.prototype.constructor=xe;function xi(i){var u=-1,l=i==null?0:i.length;for(this.clear();++u<l;){var p=i[u];this.set(p[0],p[1])}}function Wy(){this.__data__=iu?iu(null):{},this.size=0}function Gy(i){var u=this.has(i)&&delete this.__data__[i];return this.size-=u?1:0,u}function qy(i){var u=this.__data__;if(iu){var l=u[i];return l===_?t:l}return Pe.call(u,i)?u[i]:t}function Hy(i){var u=this.__data__;return iu?u[i]!==t:Pe.call(u,i)}function Vy(i,u){var l=this.__data__;return this.size+=this.has(i)?0:1,l[i]=iu&&u===t?_:u,this}xi.prototype.clear=Wy,xi.prototype.delete=Gy,xi.prototype.get=qy,xi.prototype.has=Hy,xi.prototype.set=Vy;function mr(i){var u=-1,l=i==null?0:i.length;for(this.clear();++u<l;){var p=i[u];this.set(p[0],p[1])}}function Zy(){this.__data__=[],this.size=0}function Xy(i){var u=this.__data__,l=Is(u,i);if(l<0)return!1;var p=u.length-1;return l==p?u.pop():xs.call(u,l,1),--this.size,!0}function Ky(i){var u=this.__data__,l=Is(u,i);return l<0?t:u[l][1]}function Yy(i){return Is(this.__data__,i)>-1}function Qy(i,u){var l=this.__data__,p=Is(l,i);return p<0?(++this.size,l.push([i,u])):l[p][1]=u,this}mr.prototype.clear=Zy,mr.prototype.delete=Xy,mr.prototype.get=Ky,mr.prototype.has=Yy,mr.prototype.set=Qy;function Dr(i){var u=-1,l=i==null?0:i.length;for(this.clear();++u<l;){var p=i[u];this.set(p[0],p[1])}}function Jy(){this.size=0,this.__data__={hash:new xi,map:new(nu||mr),string:new xi}}function jy(i){var u=Gs(this,i).delete(i);return this.size-=u?1:0,u}function zy(i){return Gs(this,i).get(i)}function e8(i){return Gs(this,i).has(i)}function t8(i,u){var l=Gs(this,i),p=l.size;return l.set(i,u),this.size+=l.size==p?0:1,this}Dr.prototype.clear=Jy,Dr.prototype.delete=jy,Dr.prototype.get=zy,Dr.prototype.has=e8,Dr.prototype.set=t8;function Ei(i){var u=-1,l=i==null?0:i.length;for(this.__data__=new Dr;++u<l;)this.add(i[u])}function n8(i){return this.__data__.set(i,_),this}function r8(i){return this.__data__.has(i)}Ei.prototype.add=Ei.prototype.push=n8,Ei.prototype.has=r8;function Un(i){var u=this.__data__=new mr(i);this.size=u.size}function i8(){this.__data__=new mr,this.size=0}function a8(i){var u=this.__data__,l=u.delete(i);return this.size=u.size,l}function u8(i){return this.__data__.get(i)}function s8(i){return this.__data__.has(i)}function o8(i,u){var l=this.__data__;if(l instanceof mr){var p=l.__data__;if(!nu||p.length<o-1)return p.push([i,u]),this.size=++l.size,this;l=this.__data__=new Dr(p)}return l.set(i,u),this.size=l.size,this}Un.prototype.clear=i8,Un.prototype.delete=a8,Un.prototype.get=u8,Un.prototype.has=s8,Un.prototype.set=o8;function U1(i,u){var l=ge(i),p=!l&&Si(i),y=!l&&!p&&Yr(i),A=!l&&!p&&!y&&ca(i),R=l||p||y||A,O=R?Xf(i.length,wy):[],G=O.length;for(var J in i)(u||Pe.call(i,J))&&!(R&&(J=="length"||y&&(J=="offset"||J=="parent")||A&&(J=="buffer"||J=="byteLength"||J=="byteOffset")||Cr(J,G)))&&O.push(J);return O}function W1(i){var u=i.length;return u?i[ll(0,u-1)]:t}function f8(i,u){return qs(qt(i),Ci(u,0,i.length))}function l8(i){return qs(qt(i))}function el(i,u,l){(l!==t&&!Wn(i[u],l)||l===t&&!(u in i))&&yr(i,u,l)}function uu(i,u,l){var p=i[u];(!(Pe.call(i,u)&&Wn(p,l))||l===t&&!(u in i))&&yr(i,u,l)}function Is(i,u){for(var l=i.length;l--;)if(Wn(i[l][0],u))return l;return-1}function h8(i,u,l,p){return Vr(i,function(y,A,R){u(p,y,l(y),R)}),p}function G1(i,u){return i&&rr(u,wt(u),i)}function c8(i,u){return i&&rr(u,Vt(u),i)}function yr(i,u,l){u=="__proto__"&&Es?Es(i,u,{configurable:!0,enumerable:!0,value:l,writable:!0}):i[u]=l}function tl(i,u){for(var l=-1,p=u.length,y=X(p),A=i==null;++l<p;)y[l]=A?t:$l(i,u[l]);return y}function Ci(i,u,l){return i===i&&(l!==t&&(i=i<=l?i:l),u!==t&&(i=i>=u?i:u)),i}function Cn(i,u,l,p,y,A){var R,O=u&D,G=u&x,J=u&m;if(l&&(R=y?l(i,p,y,A):l(i)),R!==t)return R;if(!nt(i))return i;var j=ge(i);if(j){if(R=ex(i),!O)return qt(i,R)}else{var ee=Bt(i),ne=ee==Nt||ee==bn;if(Yr(i))return cp(i,O);if(ee==vt||ee==ke||ne&&!y){if(R=G||ne?{}:Tp(i),!O)return G?q8(i,c8(R,i)):G8(i,G1(R,i))}else{if(!Ve[ee])return y?i:{};R=tx(i,ee,O)}}A||(A=new Un);var ae=A.get(i);if(ae)return ae;A.set(i,R),ug(i)?i.forEach(function(he){R.add(Cn(he,u,l,he,i,A))}):ig(i)&&i.forEach(function(he,De){R.set(De,Cn(he,u,l,De,i,A))});var le=J?G?Dl:ml:G?Vt:wt,be=j?t:le(i);return yn(be||i,function(he,De){be&&(De=he,he=i[De]),uu(R,De,Cn(he,u,l,De,i,A))}),R}function d8(i){var u=wt(i);return function(l){return q1(l,i,u)}}function q1(i,u,l){var p=l.length;if(i==null)return!p;for(i=Ue(i);p--;){var y=l[p],A=u[y],R=i[y];if(R===t&&!(y in i)||!A(R))return!1}return!0}function H1(i,u,l){if(typeof i!="function")throw new xn(f);return du(function(){i.apply(t,l)},u)}function su(i,u,l,p){var y=-1,A=ds,R=!0,O=i.length,G=[],J=u.length;if(!O)return G;l&&(u=et(u,zt(l))),p?(A=Wf,R=!1):u.length>=o&&(A=eu,R=!1,u=new Ei(u));e:for(;++y<O;){var j=i[y],ee=l==null?j:l(j);if(j=p||j!==0?j:0,R&&ee===ee){for(var ne=J;ne--;)if(u[ne]===ee)continue e;G.push(j)}else A(u,ee,p)||G.push(j)}return G}var Vr=vp(nr),V1=vp(rl,!0);function p8(i,u){var l=!0;return Vr(i,function(p,y,A){return l=!!u(p,y,A),l}),l}function Ts(i,u,l){for(var p=-1,y=i.length;++p<y;){var A=i[p],R=u(A);if(R!=null&&(O===t?R===R&&!tn(R):l(R,O)))var O=R,G=A}return G}function g8(i,u,l,p){var y=i.length;for(l=ve(l),l<0&&(l=-l>y?0:y+l),p=p===t||p>y?y:ve(p),p<0&&(p+=y),p=l>p?0:og(p);l<p;)i[l++]=u;return i}function Z1(i,u){var l=[];return Vr(i,function(p,y,A){u(p,y,A)&&l.push(p)}),l}function Ct(i,u,l,p,y){var A=-1,R=i.length;for(l||(l=rx),y||(y=[]);++A<R;){var O=i[A];u>0&&l(O)?u>1?Ct(O,u-1,l,p,y):Gr(y,O):p||(y[y.length]=O)}return y}var nl=wp(),X1=wp(!0);function nr(i,u){return i&&nl(i,u,wt)}function rl(i,u){return i&&X1(i,u,wt)}function ks(i,u){return Wr(u,function(l){return Ar(i[l])})}function Ai(i,u){u=Xr(u,i);for(var l=0,p=u.length;i!=null&&l<p;)i=i[ir(u[l++])];return l&&l==p?i:t}function K1(i,u,l){var p=u(i);return ge(i)?p:Gr(p,l(i))}function Lt(i){return i==null?i===t?zi:tr:yi&&yi in Ue(i)?J8(i):lx(i)}function il(i,u){return i>u}function _8(i,u){return i!=null&&Pe.call(i,u)}function v8(i,u){return i!=null&&u in Ue(i)}function w8(i,u,l){return i>=Ft(u,l)&&i<pt(u,l)}function al(i,u,l){for(var p=l?Wf:ds,y=i[0].length,A=i.length,R=A,O=X(A),G=1/0,J=[];R--;){var j=i[R];R&&u&&(j=et(j,zt(u))),G=Ft(j.length,G),O[R]=!l&&(u||y>=120&&j.length>=120)?new Ei(R&&j):t}j=i[0];var ee=-1,ne=O[0];e:for(;++ee<y&&J.length<G;){var ae=j[ee],le=u?u(ae):ae;if(ae=l||ae!==0?ae:0,!(ne?eu(ne,le):p(J,le,l))){for(R=A;--R;){var be=O[R];if(!(be?eu(be,le):p(i[R],le,l)))continue e}ne&&ne.push(le),J.push(ae)}}return J}function b8(i,u,l,p){return nr(i,function(y,A,R){u(p,l(y),A,R)}),p}function ou(i,u,l){u=Xr(u,i),i=$p(i,u);var p=i==null?i:i[ir(Fn(u))];return p==null?t:jt(p,i,l)}function Y1(i){return it(i)&&Lt(i)==ke}function m8(i){return it(i)&&Lt(i)==mi}function D8(i){return it(i)&&Lt(i)==wn}function fu(i,u,l,p,y){return i===u?!0:i==null||u==null||!it(i)&&!it(u)?i!==i&&u!==u:y8(i,u,l,p,fu,y)}function y8(i,u,l,p,y,A){var R=ge(i),O=ge(u),G=R?Dt:Bt(i),J=O?Dt:Bt(u);G=G==ke?vt:G,J=J==ke?vt:J;var j=G==vt,ee=J==vt,ne=G==J;if(ne&&Yr(i)){if(!Yr(u))return!1;R=!0,j=!1}if(ne&&!j)return A||(A=new Un),R||ca(i)?Bp(i,u,l,p,y,A):Y8(i,u,G,l,p,y,A);if(!(l&B)){var ae=j&&Pe.call(i,"__wrapped__"),le=ee&&Pe.call(u,"__wrapped__");if(ae||le){var be=ae?i.value():i,he=le?u.value():u;return A||(A=new Un),y(be,he,l,p,A)}}return ne?(A||(A=new Un),Q8(i,u,l,p,y,A)):!1}function x8(i){return it(i)&&Bt(i)==Je}function ul(i,u,l,p){var y=l.length,A=y,R=!p;if(i==null)return!A;for(i=Ue(i);y--;){var O=l[y];if(R&&O[2]?O[1]!==i[O[0]]:!(O[0]in i))return!1}for(;++y<A;){O=l[y];var G=O[0],J=i[G],j=O[1];if(R&&O[2]){if(J===t&&!(G in i))return!1}else{var ee=new Un;if(p)var ne=p(J,j,G,i,u,ee);if(!(ne===t?fu(j,J,B|F,p,ee):ne))return!1}}return!0}function Q1(i){if(!nt(i)||ax(i))return!1;var u=Ar(i)?xy:dD;return u.test(Bi(i))}function E8(i){return it(i)&&Lt(i)==Jt}function C8(i){return it(i)&&Bt(i)==xt}function A8(i){return it(i)&&Ys(i.length)&&!!Ke[Lt(i)]}function J1(i){return typeof i=="function"?i:i==null?Zt:typeof i=="object"?ge(i)?ep(i[0],i[1]):z1(i):bg(i)}function sl(i){if(!cu(i))return Sy(i);var u=[];for(var l in Ue(i))Pe.call(i,l)&&l!="constructor"&&u.push(l);return u}function F8(i){if(!nt(i))return fx(i);var u=cu(i),l=[];for(var p in i)p=="constructor"&&(u||!Pe.call(i,p))||l.push(p);return l}function ol(i,u){return i<u}function j1(i,u){var l=-1,p=Ht(i)?X(i.length):[];return Vr(i,function(y,A,R){p[++l]=u(y,A,R)}),p}function z1(i){var u=xl(i);return u.length==1&&u[0][2]?Rp(u[0][0],u[0][1]):function(l){return l===i||ul(l,i,u)}}function ep(i,u){return Cl(i)&&kp(u)?Rp(ir(i),u):function(l){var p=$l(l,i);return p===t&&p===u?Ll(l,i):fu(u,p,B|F)}}function Rs(i,u,l,p,y){i!==u&&nl(u,function(A,R){if(y||(y=new Un),nt(A))B8(i,u,R,l,Rs,p,y);else{var O=p?p(Fl(i,R),A,R+"",i,u,y):t;O===t&&(O=A),el(i,R,O)}},Vt)}function B8(i,u,l,p,y,A,R){var O=Fl(i,l),G=Fl(u,l),J=R.get(G);if(J){el(i,l,J);return}var j=A?A(O,G,l+"",i,u,R):t,ee=j===t;if(ee){var ne=ge(G),ae=!ne&&Yr(G),le=!ne&&!ae&&ca(G);j=G,ne||ae||le?ge(O)?j=O:ot(O)?j=qt(O):ae?(ee=!1,j=cp(G,!0)):le?(ee=!1,j=dp(G,!0)):j=[]:pu(G)||Si(G)?(j=O,Si(O)?j=fg(O):(!nt(O)||Ar(O))&&(j=Tp(G))):ee=!1}ee&&(R.set(G,j),y(j,G,p,A,R),R.delete(G)),el(i,l,j)}function tp(i,u){var l=i.length;if(l)return u+=u<0?l:0,Cr(u,l)?i[u]:t}function np(i,u,l){u.length?u=et(u,function(A){return ge(A)?function(R){return Ai(R,A.length===1?A[0]:A)}:A}):u=[Zt];var p=-1;u=et(u,zt(oe()));var y=j1(i,function(A,R,O){var G=et(u,function(J){return J(A)});return{criteria:G,index:++p,value:A}});return ty(y,function(A,R){return W8(A,R,l)})}function S8(i,u){return rp(i,u,function(l,p){return Ll(i,p)})}function rp(i,u,l){for(var p=-1,y=u.length,A={};++p<y;){var R=u[p],O=Ai(i,R);l(O,R)&&lu(A,Xr(R,i),O)}return A}function I8(i){return function(u){return Ai(u,i)}}function fl(i,u,l,p){var y=p?ey:ta,A=-1,R=u.length,O=i;for(i===u&&(u=qt(u)),l&&(O=et(i,zt(l)));++A<R;)for(var G=0,J=u[A],j=l?l(J):J;(G=y(O,j,G,p))>-1;)O!==i&&xs.call(O,G,1),xs.call(i,G,1);return i}function ip(i,u){for(var l=i?u.length:0,p=l-1;l--;){var y=u[l];if(l==p||y!==A){var A=y;Cr(y)?xs.call(i,y,1):dl(i,y)}}return i}function ll(i,u){return i+As(P1()*(u-i+1))}function T8(i,u,l,p){for(var y=-1,A=pt(Cs((u-i)/(l||1)),0),R=X(A);A--;)R[p?A:++y]=i,i+=l;return R}function hl(i,u){var l="";if(!i||u<1||u>Ce)return l;do u%2&&(l+=i),u=As(u/2),u&&(i+=i);while(u);return l}function me(i,u){return Bl(Np(i,u,Zt),i+"")}function k8(i){return W1(da(i))}function R8(i,u){var l=da(i);return qs(l,Ci(u,0,l.length))}function lu(i,u,l,p){if(!nt(i))return i;u=Xr(u,i);for(var y=-1,A=u.length,R=A-1,O=i;O!=null&&++y<A;){var G=ir(u[y]),J=l;if(G==="__proto__"||G==="constructor"||G==="prototype")return i;if(y!=R){var j=O[G];J=p?p(j,G,O):t,J===t&&(J=nt(j)?j:Cr(u[y+1])?[]:{})}uu(O,G,J),O=O[G]}return i}var ap=Fs?function(i,u){return Fs.set(i,u),i}:Zt,N8=Es?function(i,u){return Es(i,"toString",{configurable:!0,enumerable:!1,value:Pl(u),writable:!0})}:Zt;function $8(i){return qs(da(i))}function An(i,u,l){var p=-1,y=i.length;u<0&&(u=-u>y?0:y+u),l=l>y?y:l,l<0&&(l+=y),y=u>l?0:l-u>>>0,u>>>=0;for(var A=X(y);++p<y;)A[p]=i[p+u];return A}function L8(i,u){var l;return Vr(i,function(p,y,A){return l=u(p,y,A),!l}),!!l}function Ns(i,u,l){var p=0,y=i==null?p:i.length;if(typeof u=="number"&&u===u&&y<=Pn){for(;p<y;){var A=p+y>>>1,R=i[A];R!==null&&!tn(R)&&(l?R<=u:R<u)?p=A+1:y=A}return y}return cl(i,u,Zt,l)}function cl(i,u,l,p){var y=0,A=i==null?0:i.length;if(A===0)return 0;u=l(u);for(var R=u!==u,O=u===null,G=tn(u),J=u===t;y<A;){var j=As((y+A)/2),ee=l(i[j]),ne=ee!==t,ae=ee===null,le=ee===ee,be=tn(ee);if(R)var he=p||le;else J?he=le&&(p||ne):O?he=le&&ne&&(p||!ae):G?he=le&&ne&&!ae&&(p||!be):ae||be?he=!1:he=p?ee<=u:ee<u;he?y=j+1:A=j}return Ft(A,Te)}function up(i,u){for(var l=-1,p=i.length,y=0,A=[];++l<p;){var R=i[l],O=u?u(R):R;if(!l||!Wn(O,G)){var G=O;A[y++]=R===0?0:R}}return A}function sp(i){return typeof i=="number"?i:tn(i)?kt:+i}function en(i){if(typeof i=="string")return i;if(ge(i))return et(i,en)+"";if(tn(i))return M1?M1.call(i):"";var u=i+"";return u=="0"&&1/i==-Fe?"-0":u}function Zr(i,u,l){var p=-1,y=ds,A=i.length,R=!0,O=[],G=O;if(l)R=!1,y=Wf;else if(A>=o){var J=u?null:X8(i);if(J)return gs(J);R=!1,y=eu,G=new Ei}else G=u?[]:O;e:for(;++p<A;){var j=i[p],ee=u?u(j):j;if(j=l||j!==0?j:0,R&&ee===ee){for(var ne=G.length;ne--;)if(G[ne]===ee)continue e;u&&G.push(ee),O.push(j)}else y(G,ee,l)||(G!==O&&G.push(ee),O.push(j))}return O}function dl(i,u){return u=Xr(u,i),i=$p(i,u),i==null||delete i[ir(Fn(u))]}function op(i,u,l,p){return lu(i,u,l(Ai(i,u)),p)}function $s(i,u,l,p){for(var y=i.length,A=p?y:-1;(p?A--:++A<y)&&u(i[A],A,i););return l?An(i,p?0:A,p?A+1:y):An(i,p?A+1:0,p?y:A)}function fp(i,u){var l=i;return l instanceof xe&&(l=l.value()),Gf(u,function(p,y){return y.func.apply(y.thisArg,Gr([p],y.args))},l)}function pl(i,u,l){var p=i.length;if(p<2)return p?Zr(i[0]):[];for(var y=-1,A=X(p);++y<p;)for(var R=i[y],O=-1;++O<p;)O!=y&&(A[y]=su(A[y]||R,i[O],u,l));return Zr(Ct(A,1),u,l)}function lp(i,u,l){for(var p=-1,y=i.length,A=u.length,R={};++p<y;){var O=p<A?u[p]:t;l(R,i[p],O)}return R}function gl(i){return ot(i)?i:[]}function _l(i){return typeof i=="function"?i:Zt}function Xr(i,u){return ge(i)?i:Cl(i,u)?[i]:Mp(Le(i))}var O8=me;function Kr(i,u,l){var p=i.length;return l=l===t?p:l,!u&&l>=p?i:An(i,u,l)}var hp=Ey||function(i){return Et.clearTimeout(i)};function cp(i,u){if(u)return i.slice();var l=i.length,p=R1?R1(l):new i.constructor(l);return i.copy(p),p}function vl(i){var u=new i.constructor(i.byteLength);return new Ds(u).set(new Ds(i)),u}function P8(i,u){var l=u?vl(i.buffer):i.buffer;return new i.constructor(l,i.byteOffset,i.byteLength)}function M8(i){var u=new i.constructor(i.source,Yd.exec(i));return u.lastIndex=i.lastIndex,u}function U8(i){return au?Ue(au.call(i)):{}}function dp(i,u){var l=u?vl(i.buffer):i.buffer;return new i.constructor(l,i.byteOffset,i.length)}function pp(i,u){if(i!==u){var l=i!==t,p=i===null,y=i===i,A=tn(i),R=u!==t,O=u===null,G=u===u,J=tn(u);if(!O&&!J&&!A&&i>u||A&&R&&G&&!O&&!J||p&&R&&G||!l&&G||!y)return 1;if(!p&&!A&&!J&&i<u||J&&l&&y&&!p&&!A||O&&l&&y||!R&&y||!G)return-1}return 0}function W8(i,u,l){for(var p=-1,y=i.criteria,A=u.criteria,R=y.length,O=l.length;++p<R;){var G=pp(y[p],A[p]);if(G){if(p>=O)return G;var J=l[p];return G*(J=="desc"?-1:1)}}return i.index-u.index}function gp(i,u,l,p){for(var y=-1,A=i.length,R=l.length,O=-1,G=u.length,J=pt(A-R,0),j=X(G+J),ee=!p;++O<G;)j[O]=u[O];for(;++y<R;)(ee||y<A)&&(j[l[y]]=i[y]);for(;J--;)j[O++]=i[y++];return j}function _p(i,u,l,p){for(var y=-1,A=i.length,R=-1,O=l.length,G=-1,J=u.length,j=pt(A-O,0),ee=X(j+J),ne=!p;++y<j;)ee[y]=i[y];for(var ae=y;++G<J;)ee[ae+G]=u[G];for(;++R<O;)(ne||y<A)&&(ee[ae+l[R]]=i[y++]);return ee}function qt(i,u){var l=-1,p=i.length;for(u||(u=X(p));++l<p;)u[l]=i[l];return u}function rr(i,u,l,p){var y=!l;l||(l={});for(var A=-1,R=u.length;++A<R;){var O=u[A],G=p?p(l[O],i[O],O,l,i):t;G===t&&(G=i[O]),y?yr(l,O,G):uu(l,O,G)}return l}function G8(i,u){return rr(i,El(i),u)}function q8(i,u){return rr(i,Sp(i),u)}function Ls(i,u){return function(l,p){var y=ge(l)?KD:h8,A=u?u():{};return y(l,i,oe(p,2),A)}}function fa(i){return me(function(u,l){var p=-1,y=l.length,A=y>1?l[y-1]:t,R=y>2?l[2]:t;for(A=i.length>3&&typeof A=="function"?(y--,A):t,R&&Ot(l[0],l[1],R)&&(A=y<3?t:A,y=1),u=Ue(u);++p<y;){var O=l[p];O&&i(u,O,p,A)}return u})}function vp(i,u){return function(l,p){if(l==null)return l;if(!Ht(l))return i(l,p);for(var y=l.length,A=u?y:-1,R=Ue(l);(u?A--:++A<y)&&p(R[A],A,R)!==!1;);return l}}function wp(i){return function(u,l,p){for(var y=-1,A=Ue(u),R=p(u),O=R.length;O--;){var G=R[i?O:++y];if(l(A[G],G,A)===!1)break}return u}}function H8(i,u,l){var p=u&I,y=hu(i);function A(){var R=this&&this!==Et&&this instanceof A?y:i;return R.apply(p?l:this,arguments)}return A}function bp(i){return function(u){u=Le(u);var l=na(u)?Mn(u):t,p=l?l[0]:u.charAt(0),y=l?Kr(l,1).join(""):u.slice(1);return p[i]()+y}}function la(i){return function(u){return Gf(vg(_g(u).replace(ND,"")),i,"")}}function hu(i){return function(){var u=arguments;switch(u.length){case 0:return new i;case 1:return new i(u[0]);case 2:return new i(u[0],u[1]);case 3:return new i(u[0],u[1],u[2]);case 4:return new i(u[0],u[1],u[2],u[3]);case 5:return new i(u[0],u[1],u[2],u[3],u[4]);case 6:return new i(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new i(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var l=oa(i.prototype),p=i.apply(l,u);return nt(p)?p:l}}function V8(i,u,l){var p=hu(i);function y(){for(var A=arguments.length,R=X(A),O=A,G=ha(y);O--;)R[O]=arguments[O];var J=A<3&&R[0]!==G&&R[A-1]!==G?[]:qr(R,G);if(A-=J.length,A<l)return Ep(i,u,Os,y.placeholder,t,R,J,t,t,l-A);var j=this&&this!==Et&&this instanceof y?p:i;return jt(j,this,R)}return y}function mp(i){return function(u,l,p){var y=Ue(u);if(!Ht(u)){var A=oe(l,3);u=wt(u),l=function(O){return A(y[O],O,y)}}var R=i(u,l,p);return R>-1?y[A?u[R]:R]:t}}function Dp(i){return Er(function(u){var l=u.length,p=l,y=En.prototype.thru;for(i&&u.reverse();p--;){var A=u[p];if(typeof A!="function")throw new xn(f);if(y&&!R&&Ws(A)=="wrapper")var R=new En([],!0)}for(p=R?p:l;++p<l;){A=u[p];var O=Ws(A),G=O=="wrapper"?yl(A):t;G&&Al(G[0])&&G[1]==(N|$|L|q)&&!G[4].length&&G[9]==1?R=R[Ws(G[0])].apply(R,G[3]):R=A.length==1&&Al(A)?R[O]():R.thru(A)}return function(){var J=arguments,j=J[0];if(R&&J.length==1&&ge(j))return R.plant(j).value();for(var ee=0,ne=l?u[ee].apply(this,J):j;++ee<l;)ne=u[ee].call(this,ne);return ne}})}function Os(i,u,l,p,y,A,R,O,G,J){var j=u&N,ee=u&I,ne=u&k,ae=u&($|S),le=u&H,be=ne?t:hu(i);function he(){for(var De=arguments.length,Ae=X(De),nn=De;nn--;)Ae[nn]=arguments[nn];if(ae)var Pt=ha(he),rn=ry(Ae,Pt);if(p&&(Ae=gp(Ae,p,y,ae)),A&&(Ae=_p(Ae,A,R,ae)),De-=rn,ae&&De<J){var ft=qr(Ae,Pt);return Ep(i,u,Os,he.placeholder,l,Ae,ft,O,G,J-De)}var Gn=ee?l:this,Br=ne?Gn[i]:i;return De=Ae.length,O?Ae=hx(Ae,O):le&&De>1&&Ae.reverse(),j&&G<De&&(Ae.length=G),this&&this!==Et&&this instanceof he&&(Br=be||hu(Br)),Br.apply(Gn,Ae)}return he}function yp(i,u){return function(l,p){return b8(l,i,u(p),{})}}function Ps(i,u){return function(l,p){var y;if(l===t&&p===t)return u;if(l!==t&&(y=l),p!==t){if(y===t)return p;typeof l=="string"||typeof p=="string"?(l=en(l),p=en(p)):(l=sp(l),p=sp(p)),y=i(l,p)}return y}}function wl(i){return Er(function(u){return u=et(u,zt(oe())),me(function(l){var p=this;return i(u,function(y){return jt(y,p,l)})})})}function Ms(i,u){u=u===t?" ":en(u);var l=u.length;if(l<2)return l?hl(u,i):u;var p=hl(u,Cs(i/ra(u)));return na(u)?Kr(Mn(p),0,i).join(""):p.slice(0,i)}function Z8(i,u,l,p){var y=u&I,A=hu(i);function R(){for(var O=-1,G=arguments.length,J=-1,j=p.length,ee=X(j+G),ne=this&&this!==Et&&this instanceof R?A:i;++J<j;)ee[J]=p[J];for(;G--;)ee[J++]=arguments[++O];return jt(ne,y?l:this,ee)}return R}function xp(i){return function(u,l,p){return p&&typeof p!="number"&&Ot(u,l,p)&&(l=p=t),u=Fr(u),l===t?(l=u,u=0):l=Fr(l),p=p===t?u<l?1:-1:Fr(p),T8(u,l,p,i)}}function Us(i){return function(u,l){return typeof u=="string"&&typeof l=="string"||(u=Bn(u),l=Bn(l)),i(u,l)}}function Ep(i,u,l,p,y,A,R,O,G,J){var j=u&$,ee=j?R:t,ne=j?t:R,ae=j?A:t,le=j?t:A;u|=j?L:W,u&=~(j?W:L),u&U||(u&=-4);var be=[i,u,y,ae,ee,le,ne,O,G,J],he=l.apply(t,be);return Al(i)&&Lp(he,be),he.placeholder=p,Op(he,i,u)}function bl(i){var u=dt[i];return function(l,p){if(l=Bn(l),p=p==null?0:Ft(ve(p),292),p&&O1(l)){var y=(Le(l)+"e").split("e"),A=u(y[0]+"e"+(+y[1]+p));return y=(Le(A)+"e").split("e"),+(y[0]+"e"+(+y[1]-p))}return u(l)}}var X8=ua&&1/gs(new ua([,-0]))[1]==Fe?function(i){return new ua(i)}:Wl;function Cp(i){return function(u){var l=Bt(u);return l==Je?Yf(u):l==xt?ly(u):ny(u,i(u))}}function xr(i,u,l,p,y,A,R,O){var G=u&k;if(!G&&typeof i!="function")throw new xn(f);var J=p?p.length:0;if(J||(u&=-97,p=y=t),R=R===t?R:pt(ve(R),0),O=O===t?O:ve(O),J-=y?y.length:0,u&W){var j=p,ee=y;p=y=t}var ne=G?t:yl(i),ae=[i,u,l,p,y,j,ee,A,R,O];if(ne&&ox(ae,ne),i=ae[0],u=ae[1],l=ae[2],p=ae[3],y=ae[4],O=ae[9]=ae[9]===t?G?0:i.length:pt(ae[9]-J,0),!O&&u&($|S)&&(u&=-25),!u||u==I)var le=H8(i,u,l);else u==$||u==S?le=V8(i,u,O):(u==L||u==(I|L))&&!y.length?le=Z8(i,u,l,p):le=Os.apply(t,ae);var be=ne?ap:Lp;return Op(be(le,ae),i,u)}function Ap(i,u,l,p){return i===t||Wn(i,aa[l])&&!Pe.call(p,l)?u:i}function Fp(i,u,l,p,y,A){return nt(i)&&nt(u)&&(A.set(u,i),Rs(i,u,t,Fp,A),A.delete(u)),i}function K8(i){return pu(i)?t:i}function Bp(i,u,l,p,y,A){var R=l&B,O=i.length,G=u.length;if(O!=G&&!(R&&G>O))return!1;var J=A.get(i),j=A.get(u);if(J&&j)return J==u&&j==i;var ee=-1,ne=!0,ae=l&F?new Ei:t;for(A.set(i,u),A.set(u,i);++ee<O;){var le=i[ee],be=u[ee];if(p)var he=R?p(be,le,ee,u,i,A):p(le,be,ee,i,u,A);if(he!==t){if(he)continue;ne=!1;break}if(ae){if(!qf(u,function(De,Ae){if(!eu(ae,Ae)&&(le===De||y(le,De,l,p,A)))return ae.push(Ae)})){ne=!1;break}}else if(!(le===be||y(le,be,l,p,A))){ne=!1;break}}return A.delete(i),A.delete(u),ne}function Y8(i,u,l,p,y,A,R){switch(l){case $t:if(i.byteLength!=u.byteLength||i.byteOffset!=u.byteOffset)return!1;i=i.buffer,u=u.buffer;case mi:return!(i.byteLength!=u.byteLength||!A(new Ds(i),new Ds(u)));case Rt:case wn:case _t:return Wn(+i,+u);case yt:return i.name==u.name&&i.message==u.message;case Jt:case mn:return i==u+"";case Je:var O=Yf;case xt:var G=p&B;if(O||(O=gs),i.size!=u.size&&!G)return!1;var J=R.get(i);if(J)return J==u;p|=F,R.set(i,u);var j=Bp(O(i),O(u),p,y,A,R);return R.delete(i),j;case br:if(au)return au.call(i)==au.call(u)}return!1}function Q8(i,u,l,p,y,A){var R=l&B,O=ml(i),G=O.length,J=ml(u),j=J.length;if(G!=j&&!R)return!1;for(var ee=G;ee--;){var ne=O[ee];if(!(R?ne in u:Pe.call(u,ne)))return!1}var ae=A.get(i),le=A.get(u);if(ae&&le)return ae==u&&le==i;var be=!0;A.set(i,u),A.set(u,i);for(var he=R;++ee<G;){ne=O[ee];var De=i[ne],Ae=u[ne];if(p)var nn=R?p(Ae,De,ne,u,i,A):p(De,Ae,ne,i,u,A);if(!(nn===t?De===Ae||y(De,Ae,l,p,A):nn)){be=!1;break}he||(he=ne=="constructor")}if(be&&!he){var Pt=i.constructor,rn=u.constructor;Pt!=rn&&"constructor"in i&&"constructor"in u&&!(typeof Pt=="function"&&Pt instanceof Pt&&typeof rn=="function"&&rn instanceof rn)&&(be=!1)}return A.delete(i),A.delete(u),be}function Er(i){return Bl(Np(i,t,qp),i+"")}function ml(i){return K1(i,wt,El)}function Dl(i){return K1(i,Vt,Sp)}var yl=Fs?function(i){return Fs.get(i)}:Wl;function Ws(i){for(var u=i.name+"",l=sa[u],p=Pe.call(sa,u)?l.length:0;p--;){var y=l[p],A=y.func;if(A==null||A==i)return y.name}return u}function ha(i){var u=Pe.call(C,"placeholder")?C:i;return u.placeholder}function oe(){var i=C.iteratee||Ml;return i=i===Ml?J1:i,arguments.length?i(arguments[0],arguments[1]):i}function Gs(i,u){var l=i.__data__;return ix(u)?l[typeof u=="string"?"string":"hash"]:l.map}function xl(i){for(var u=wt(i),l=u.length;l--;){var p=u[l],y=i[p];u[l]=[p,y,kp(y)]}return u}function Fi(i,u){var l=sy(i,u);return Q1(l)?l:t}function J8(i){var u=Pe.call(i,yi),l=i[yi];try{i[yi]=t;var p=!0}catch{}var y=bs.call(i);return p&&(u?i[yi]=l:delete i[yi]),y}var El=Jf?function(i){return i==null?[]:(i=Ue(i),Wr(Jf(i),function(u){return $1.call(i,u)}))}:Gl,Sp=Jf?function(i){for(var u=[];i;)Gr(u,El(i)),i=ys(i);return u}:Gl,Bt=Lt;(jf&&Bt(new jf(new ArrayBuffer(1)))!=$t||nu&&Bt(new nu)!=Je||zf&&Bt(zf.resolve())!=wr||ua&&Bt(new ua)!=xt||ru&&Bt(new ru)!=At)&&(Bt=function(i){var u=Lt(i),l=u==vt?i.constructor:t,p=l?Bi(l):"";if(p)switch(p){case Ry:return $t;case Ny:return Je;case $y:return wr;case Ly:return xt;case Oy:return At}return u});function j8(i,u,l){for(var p=-1,y=l.length;++p<y;){var A=l[p],R=A.size;switch(A.type){case"drop":i+=R;break;case"dropRight":u-=R;break;case"take":u=Ft(u,i+R);break;case"takeRight":i=pt(i,u-R);break}}return{start:i,end:u}}function z8(i){var u=i.match(aD);return u?u[1].split(uD):[]}function Ip(i,u,l){u=Xr(u,i);for(var p=-1,y=u.length,A=!1;++p<y;){var R=ir(u[p]);if(!(A=i!=null&&l(i,R)))break;i=i[R]}return A||++p!=y?A:(y=i==null?0:i.length,!!y&&Ys(y)&&Cr(R,y)&&(ge(i)||Si(i)))}function ex(i){var u=i.length,l=new i.constructor(u);return u&&typeof i[0]=="string"&&Pe.call(i,"index")&&(l.index=i.index,l.input=i.input),l}function Tp(i){return typeof i.constructor=="function"&&!cu(i)?oa(ys(i)):{}}function tx(i,u,l){var p=i.constructor;switch(u){case mi:return vl(i);case Rt:case wn:return new p(+i);case $t:return P8(i,l);case za:case E:case v:case w:case T:case P:case V:case Q:case _e:return dp(i,l);case Je:return new p;case _t:case mn:return new p(i);case Jt:return M8(i);case xt:return new p;case br:return U8(i)}}function nx(i,u){var l=u.length;if(!l)return i;var p=l-1;return u[p]=(l>1?"& ":"")+u[p],u=u.join(l>2?", ":" "),i.replace(iD,`{
22
- /* [wrapped with `+u+`] */
23
- `)}function rx(i){return ge(i)||Si(i)||!!(L1&&i&&i[L1])}function Cr(i,u){var l=typeof i;return u=u??Ce,!!u&&(l=="number"||l!="symbol"&&gD.test(i))&&i>-1&&i%1==0&&i<u}function Ot(i,u,l){if(!nt(l))return!1;var p=typeof u;return(p=="number"?Ht(l)&&Cr(u,l.length):p=="string"&&u in l)?Wn(l[u],i):!1}function Cl(i,u){if(ge(i))return!1;var l=typeof i;return l=="number"||l=="symbol"||l=="boolean"||i==null||tn(i)?!0:eD.test(i)||!zm.test(i)||u!=null&&i in Ue(u)}function ix(i){var u=typeof i;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?i!=="__proto__":i===null}function Al(i){var u=Ws(i),l=C[u];if(typeof l!="function"||!(u in xe.prototype))return!1;if(i===l)return!0;var p=yl(l);return!!p&&i===p[0]}function ax(i){return!!k1&&k1 in i}var ux=vs?Ar:ql;function cu(i){var u=i&&i.constructor,l=typeof u=="function"&&u.prototype||aa;return i===l}function kp(i){return i===i&&!nt(i)}function Rp(i,u){return function(l){return l==null?!1:l[i]===u&&(u!==t||i in Ue(l))}}function sx(i){var u=Xs(i,function(p){return l.size===d&&l.clear(),p}),l=u.cache;return u}function ox(i,u){var l=i[1],p=u[1],y=l|p,A=y<(I|k|N),R=p==N&&l==$||p==N&&l==q&&i[7].length<=u[8]||p==(N|q)&&u[7].length<=u[8]&&l==$;if(!(A||R))return i;p&I&&(i[2]=u[2],y|=l&I?0:U);var O=u[3];if(O){var G=i[3];i[3]=G?gp(G,O,u[4]):O,i[4]=G?qr(i[3],c):u[4]}return O=u[5],O&&(G=i[5],i[5]=G?_p(G,O,u[6]):O,i[6]=G?qr(i[5],c):u[6]),O=u[7],O&&(i[7]=O),p&N&&(i[8]=i[8]==null?u[8]:Ft(i[8],u[8])),i[9]==null&&(i[9]=u[9]),i[0]=u[0],i[1]=y,i}function fx(i){var u=[];if(i!=null)for(var l in Ue(i))u.push(l);return u}function lx(i){return bs.call(i)}function Np(i,u,l){return u=pt(u===t?i.length-1:u,0),function(){for(var p=arguments,y=-1,A=pt(p.length-u,0),R=X(A);++y<A;)R[y]=p[u+y];y=-1;for(var O=X(u+1);++y<u;)O[y]=p[y];return O[u]=l(R),jt(i,this,O)}}function $p(i,u){return u.length<2?i:Ai(i,An(u,0,-1))}function hx(i,u){for(var l=i.length,p=Ft(u.length,l),y=qt(i);p--;){var A=u[p];i[p]=Cr(A,l)?y[A]:t}return i}function Fl(i,u){if(!(u==="constructor"&&typeof i[u]=="function")&&u!="__proto__")return i[u]}var Lp=Pp(ap),du=Ay||function(i,u){return Et.setTimeout(i,u)},Bl=Pp(N8);function Op(i,u,l){var p=u+"";return Bl(i,nx(p,cx(z8(p),l)))}function Pp(i){var u=0,l=0;return function(){var p=Iy(),y=se-(p-l);if(l=p,y>0){if(++u>=re)return arguments[0]}else u=0;return i.apply(t,arguments)}}function qs(i,u){var l=-1,p=i.length,y=p-1;for(u=u===t?p:u;++l<u;){var A=ll(l,y),R=i[A];i[A]=i[l],i[l]=R}return i.length=u,i}var Mp=sx(function(i){var u=[];return i.charCodeAt(0)===46&&u.push(""),i.replace(tD,function(l,p,y,A){u.push(y?A.replace(fD,"$1"):p||l)}),u});function ir(i){if(typeof i=="string"||tn(i))return i;var u=i+"";return u=="0"&&1/i==-Fe?"-0":u}function Bi(i){if(i!=null){try{return ws.call(i)}catch{}try{return i+""}catch{}}return""}function cx(i,u){return yn(Oe,function(l){var p="_."+l[0];u&l[1]&&!ds(i,p)&&i.push(p)}),i.sort()}function Up(i){if(i instanceof xe)return i.clone();var u=new En(i.__wrapped__,i.__chain__);return u.__actions__=qt(i.__actions__),u.__index__=i.__index__,u.__values__=i.__values__,u}function dx(i,u,l){(l?Ot(i,u,l):u===t)?u=1:u=pt(ve(u),0);var p=i==null?0:i.length;if(!p||u<1)return[];for(var y=0,A=0,R=X(Cs(p/u));y<p;)R[A++]=An(i,y,y+=u);return R}function px(i){for(var u=-1,l=i==null?0:i.length,p=0,y=[];++u<l;){var A=i[u];A&&(y[p++]=A)}return y}function gx(){var i=arguments.length;if(!i)return[];for(var u=X(i-1),l=arguments[0],p=i;p--;)u[p-1]=arguments[p];return Gr(ge(l)?qt(l):[l],Ct(u,1))}var _x=me(function(i,u){return ot(i)?su(i,Ct(u,1,ot,!0)):[]}),vx=me(function(i,u){var l=Fn(u);return ot(l)&&(l=t),ot(i)?su(i,Ct(u,1,ot,!0),oe(l,2)):[]}),wx=me(function(i,u){var l=Fn(u);return ot(l)&&(l=t),ot(i)?su(i,Ct(u,1,ot,!0),t,l):[]});function bx(i,u,l){var p=i==null?0:i.length;return p?(u=l||u===t?1:ve(u),An(i,u<0?0:u,p)):[]}function mx(i,u,l){var p=i==null?0:i.length;return p?(u=l||u===t?1:ve(u),u=p-u,An(i,0,u<0?0:u)):[]}function Dx(i,u){return i&&i.length?$s(i,oe(u,3),!0,!0):[]}function yx(i,u){return i&&i.length?$s(i,oe(u,3),!0):[]}function xx(i,u,l,p){var y=i==null?0:i.length;return y?(l&&typeof l!="number"&&Ot(i,u,l)&&(l=0,p=y),g8(i,u,l,p)):[]}function Wp(i,u,l){var p=i==null?0:i.length;if(!p)return-1;var y=l==null?0:ve(l);return y<0&&(y=pt(p+y,0)),ps(i,oe(u,3),y)}function Gp(i,u,l){var p=i==null?0:i.length;if(!p)return-1;var y=p-1;return l!==t&&(y=ve(l),y=l<0?pt(p+y,0):Ft(y,p-1)),ps(i,oe(u,3),y,!0)}function qp(i){var u=i==null?0:i.length;return u?Ct(i,1):[]}function Ex(i){var u=i==null?0:i.length;return u?Ct(i,Fe):[]}function Cx(i,u){var l=i==null?0:i.length;return l?(u=u===t?1:ve(u),Ct(i,u)):[]}function Ax(i){for(var u=-1,l=i==null?0:i.length,p={};++u<l;){var y=i[u];p[y[0]]=y[1]}return p}function Hp(i){return i&&i.length?i[0]:t}function Fx(i,u,l){var p=i==null?0:i.length;if(!p)return-1;var y=l==null?0:ve(l);return y<0&&(y=pt(p+y,0)),ta(i,u,y)}function Bx(i){var u=i==null?0:i.length;return u?An(i,0,-1):[]}var Sx=me(function(i){var u=et(i,gl);return u.length&&u[0]===i[0]?al(u):[]}),Ix=me(function(i){var u=Fn(i),l=et(i,gl);return u===Fn(l)?u=t:l.pop(),l.length&&l[0]===i[0]?al(l,oe(u,2)):[]}),Tx=me(function(i){var u=Fn(i),l=et(i,gl);return u=typeof u=="function"?u:t,u&&l.pop(),l.length&&l[0]===i[0]?al(l,t,u):[]});function kx(i,u){return i==null?"":By.call(i,u)}function Fn(i){var u=i==null?0:i.length;return u?i[u-1]:t}function Rx(i,u,l){var p=i==null?0:i.length;if(!p)return-1;var y=p;return l!==t&&(y=ve(l),y=y<0?pt(p+y,0):Ft(y,p-1)),u===u?cy(i,u,y):ps(i,E1,y,!0)}function Nx(i,u){return i&&i.length?tp(i,ve(u)):t}var $x=me(Vp);function Vp(i,u){return i&&i.length&&u&&u.length?fl(i,u):i}function Lx(i,u,l){return i&&i.length&&u&&u.length?fl(i,u,oe(l,2)):i}function Ox(i,u,l){return i&&i.length&&u&&u.length?fl(i,u,t,l):i}var Px=Er(function(i,u){var l=i==null?0:i.length,p=tl(i,u);return ip(i,et(u,function(y){return Cr(y,l)?+y:y}).sort(pp)),p});function Mx(i,u){var l=[];if(!(i&&i.length))return l;var p=-1,y=[],A=i.length;for(u=oe(u,3);++p<A;){var R=i[p];u(R,p,i)&&(l.push(R),y.push(p))}return ip(i,y),l}function Sl(i){return i==null?i:ky.call(i)}function Ux(i,u,l){var p=i==null?0:i.length;return p?(l&&typeof l!="number"&&Ot(i,u,l)?(u=0,l=p):(u=u==null?0:ve(u),l=l===t?p:ve(l)),An(i,u,l)):[]}function Wx(i,u){return Ns(i,u)}function Gx(i,u,l){return cl(i,u,oe(l,2))}function qx(i,u){var l=i==null?0:i.length;if(l){var p=Ns(i,u);if(p<l&&Wn(i[p],u))return p}return-1}function Hx(i,u){return Ns(i,u,!0)}function Vx(i,u,l){return cl(i,u,oe(l,2),!0)}function Zx(i,u){var l=i==null?0:i.length;if(l){var p=Ns(i,u,!0)-1;if(Wn(i[p],u))return p}return-1}function Xx(i){return i&&i.length?up(i):[]}function Kx(i,u){return i&&i.length?up(i,oe(u,2)):[]}function Yx(i){var u=i==null?0:i.length;return u?An(i,1,u):[]}function Qx(i,u,l){return i&&i.length?(u=l||u===t?1:ve(u),An(i,0,u<0?0:u)):[]}function Jx(i,u,l){var p=i==null?0:i.length;return p?(u=l||u===t?1:ve(u),u=p-u,An(i,u<0?0:u,p)):[]}function jx(i,u){return i&&i.length?$s(i,oe(u,3),!1,!0):[]}function zx(i,u){return i&&i.length?$s(i,oe(u,3)):[]}var eE=me(function(i){return Zr(Ct(i,1,ot,!0))}),tE=me(function(i){var u=Fn(i);return ot(u)&&(u=t),Zr(Ct(i,1,ot,!0),oe(u,2))}),nE=me(function(i){var u=Fn(i);return u=typeof u=="function"?u:t,Zr(Ct(i,1,ot,!0),t,u)});function rE(i){return i&&i.length?Zr(i):[]}function iE(i,u){return i&&i.length?Zr(i,oe(u,2)):[]}function aE(i,u){return u=typeof u=="function"?u:t,i&&i.length?Zr(i,t,u):[]}function Il(i){if(!(i&&i.length))return[];var u=0;return i=Wr(i,function(l){if(ot(l))return u=pt(l.length,u),!0}),Xf(u,function(l){return et(i,Hf(l))})}function Zp(i,u){if(!(i&&i.length))return[];var l=Il(i);return u==null?l:et(l,function(p){return jt(u,t,p)})}var uE=me(function(i,u){return ot(i)?su(i,u):[]}),sE=me(function(i){return pl(Wr(i,ot))}),oE=me(function(i){var u=Fn(i);return ot(u)&&(u=t),pl(Wr(i,ot),oe(u,2))}),fE=me(function(i){var u=Fn(i);return u=typeof u=="function"?u:t,pl(Wr(i,ot),t,u)}),lE=me(Il);function hE(i,u){return lp(i||[],u||[],uu)}function cE(i,u){return lp(i||[],u||[],lu)}var dE=me(function(i){var u=i.length,l=u>1?i[u-1]:t;return l=typeof l=="function"?(i.pop(),l):t,Zp(i,l)});function Xp(i){var u=C(i);return u.__chain__=!0,u}function pE(i,u){return u(i),i}function Hs(i,u){return u(i)}var gE=Er(function(i){var u=i.length,l=u?i[0]:0,p=this.__wrapped__,y=function(A){return tl(A,i)};return u>1||this.__actions__.length||!(p instanceof xe)||!Cr(l)?this.thru(y):(p=p.slice(l,+l+(u?1:0)),p.__actions__.push({func:Hs,args:[y],thisArg:t}),new En(p,this.__chain__).thru(function(A){return u&&!A.length&&A.push(t),A}))});function _E(){return Xp(this)}function vE(){return new En(this.value(),this.__chain__)}function wE(){this.__values__===t&&(this.__values__=sg(this.value()));var i=this.__index__>=this.__values__.length,u=i?t:this.__values__[this.__index__++];return{done:i,value:u}}function bE(){return this}function mE(i){for(var u,l=this;l instanceof Ss;){var p=Up(l);p.__index__=0,p.__values__=t,u?y.__wrapped__=p:u=p;var y=p;l=l.__wrapped__}return y.__wrapped__=i,u}function DE(){var i=this.__wrapped__;if(i instanceof xe){var u=i;return this.__actions__.length&&(u=new xe(this)),u=u.reverse(),u.__actions__.push({func:Hs,args:[Sl],thisArg:t}),new En(u,this.__chain__)}return this.thru(Sl)}function yE(){return fp(this.__wrapped__,this.__actions__)}var xE=Ls(function(i,u,l){Pe.call(i,l)?++i[l]:yr(i,l,1)});function EE(i,u,l){var p=ge(i)?y1:p8;return l&&Ot(i,u,l)&&(u=t),p(i,oe(u,3))}function CE(i,u){var l=ge(i)?Wr:Z1;return l(i,oe(u,3))}var AE=mp(Wp),FE=mp(Gp);function BE(i,u){return Ct(Vs(i,u),1)}function SE(i,u){return Ct(Vs(i,u),Fe)}function IE(i,u,l){return l=l===t?1:ve(l),Ct(Vs(i,u),l)}function Kp(i,u){var l=ge(i)?yn:Vr;return l(i,oe(u,3))}function Yp(i,u){var l=ge(i)?YD:V1;return l(i,oe(u,3))}var TE=Ls(function(i,u,l){Pe.call(i,l)?i[l].push(u):yr(i,l,[u])});function kE(i,u,l,p){i=Ht(i)?i:da(i),l=l&&!p?ve(l):0;var y=i.length;return l<0&&(l=pt(y+l,0)),Qs(i)?l<=y&&i.indexOf(u,l)>-1:!!y&&ta(i,u,l)>-1}var RE=me(function(i,u,l){var p=-1,y=typeof u=="function",A=Ht(i)?X(i.length):[];return Vr(i,function(R){A[++p]=y?jt(u,R,l):ou(R,u,l)}),A}),NE=Ls(function(i,u,l){yr(i,l,u)});function Vs(i,u){var l=ge(i)?et:j1;return l(i,oe(u,3))}function $E(i,u,l,p){return i==null?[]:(ge(u)||(u=u==null?[]:[u]),l=p?t:l,ge(l)||(l=l==null?[]:[l]),np(i,u,l))}var LE=Ls(function(i,u,l){i[l?0:1].push(u)},function(){return[[],[]]});function OE(i,u,l){var p=ge(i)?Gf:A1,y=arguments.length<3;return p(i,oe(u,4),l,y,Vr)}function PE(i,u,l){var p=ge(i)?QD:A1,y=arguments.length<3;return p(i,oe(u,4),l,y,V1)}function ME(i,u){var l=ge(i)?Wr:Z1;return l(i,Ks(oe(u,3)))}function UE(i){var u=ge(i)?W1:k8;return u(i)}function WE(i,u,l){(l?Ot(i,u,l):u===t)?u=1:u=ve(u);var p=ge(i)?f8:R8;return p(i,u)}function GE(i){var u=ge(i)?l8:$8;return u(i)}function qE(i){if(i==null)return 0;if(Ht(i))return Qs(i)?ra(i):i.length;var u=Bt(i);return u==Je||u==xt?i.size:sl(i).length}function HE(i,u,l){var p=ge(i)?qf:L8;return l&&Ot(i,u,l)&&(u=t),p(i,oe(u,3))}var VE=me(function(i,u){if(i==null)return[];var l=u.length;return l>1&&Ot(i,u[0],u[1])?u=[]:l>2&&Ot(u[0],u[1],u[2])&&(u=[u[0]]),np(i,Ct(u,1),[])}),Zs=Cy||function(){return Et.Date.now()};function ZE(i,u){if(typeof u!="function")throw new xn(f);return i=ve(i),function(){if(--i<1)return u.apply(this,arguments)}}function Qp(i,u,l){return u=l?t:u,u=i&&u==null?i.length:u,xr(i,N,t,t,t,t,u)}function Jp(i,u){var l;if(typeof u!="function")throw new xn(f);return i=ve(i),function(){return--i>0&&(l=u.apply(this,arguments)),i<=1&&(u=t),l}}var Tl=me(function(i,u,l){var p=I;if(l.length){var y=qr(l,ha(Tl));p|=L}return xr(i,p,u,l,y)}),jp=me(function(i,u,l){var p=I|k;if(l.length){var y=qr(l,ha(jp));p|=L}return xr(u,p,i,l,y)});function zp(i,u,l){u=l?t:u;var p=xr(i,$,t,t,t,t,t,u);return p.placeholder=zp.placeholder,p}function eg(i,u,l){u=l?t:u;var p=xr(i,S,t,t,t,t,t,u);return p.placeholder=eg.placeholder,p}function tg(i,u,l){var p,y,A,R,O,G,J=0,j=!1,ee=!1,ne=!0;if(typeof i!="function")throw new xn(f);u=Bn(u)||0,nt(l)&&(j=!!l.leading,ee="maxWait"in l,A=ee?pt(Bn(l.maxWait)||0,u):A,ne="trailing"in l?!!l.trailing:ne);function ae(ft){var Gn=p,Br=y;return p=y=t,J=ft,R=i.apply(Br,Gn),R}function le(ft){return J=ft,O=du(De,u),j?ae(ft):R}function be(ft){var Gn=ft-G,Br=ft-J,mg=u-Gn;return ee?Ft(mg,A-Br):mg}function he(ft){var Gn=ft-G,Br=ft-J;return G===t||Gn>=u||Gn<0||ee&&Br>=A}function De(){var ft=Zs();if(he(ft))return Ae(ft);O=du(De,be(ft))}function Ae(ft){return O=t,ne&&p?ae(ft):(p=y=t,R)}function nn(){O!==t&&hp(O),J=0,p=G=y=O=t}function Pt(){return O===t?R:Ae(Zs())}function rn(){var ft=Zs(),Gn=he(ft);if(p=arguments,y=this,G=ft,Gn){if(O===t)return le(G);if(ee)return hp(O),O=du(De,u),ae(G)}return O===t&&(O=du(De,u)),R}return rn.cancel=nn,rn.flush=Pt,rn}var XE=me(function(i,u){return H1(i,1,u)}),KE=me(function(i,u,l){return H1(i,Bn(u)||0,l)});function YE(i){return xr(i,H)}function Xs(i,u){if(typeof i!="function"||u!=null&&typeof u!="function")throw new xn(f);var l=function(){var p=arguments,y=u?u.apply(this,p):p[0],A=l.cache;if(A.has(y))return A.get(y);var R=i.apply(this,p);return l.cache=A.set(y,R)||A,R};return l.cache=new(Xs.Cache||Dr),l}Xs.Cache=Dr;function Ks(i){if(typeof i!="function")throw new xn(f);return function(){var u=arguments;switch(u.length){case 0:return!i.call(this);case 1:return!i.call(this,u[0]);case 2:return!i.call(this,u[0],u[1]);case 3:return!i.call(this,u[0],u[1],u[2])}return!i.apply(this,u)}}function QE(i){return Jp(2,i)}var JE=O8(function(i,u){u=u.length==1&&ge(u[0])?et(u[0],zt(oe())):et(Ct(u,1),zt(oe()));var l=u.length;return me(function(p){for(var y=-1,A=Ft(p.length,l);++y<A;)p[y]=u[y].call(this,p[y]);return jt(i,this,p)})}),kl=me(function(i,u){var l=qr(u,ha(kl));return xr(i,L,t,u,l)}),ng=me(function(i,u){var l=qr(u,ha(ng));return xr(i,W,t,u,l)}),jE=Er(function(i,u){return xr(i,q,t,t,t,u)});function zE(i,u){if(typeof i!="function")throw new xn(f);return u=u===t?u:ve(u),me(i,u)}function e3(i,u){if(typeof i!="function")throw new xn(f);return u=u==null?0:pt(ve(u),0),me(function(l){var p=l[u],y=Kr(l,0,u);return p&&Gr(y,p),jt(i,this,y)})}function t3(i,u,l){var p=!0,y=!0;if(typeof i!="function")throw new xn(f);return nt(l)&&(p="leading"in l?!!l.leading:p,y="trailing"in l?!!l.trailing:y),tg(i,u,{leading:p,maxWait:u,trailing:y})}function n3(i){return Qp(i,1)}function r3(i,u){return kl(_l(u),i)}function i3(){if(!arguments.length)return[];var i=arguments[0];return ge(i)?i:[i]}function a3(i){return Cn(i,m)}function u3(i,u){return u=typeof u=="function"?u:t,Cn(i,m,u)}function s3(i){return Cn(i,D|m)}function o3(i,u){return u=typeof u=="function"?u:t,Cn(i,D|m,u)}function f3(i,u){return u==null||q1(i,u,wt(u))}function Wn(i,u){return i===u||i!==i&&u!==u}var l3=Us(il),h3=Us(function(i,u){return i>=u}),Si=Y1(function(){return arguments}())?Y1:function(i){return it(i)&&Pe.call(i,"callee")&&!$1.call(i,"callee")},ge=X.isArray,c3=_1?zt(_1):m8;function Ht(i){return i!=null&&Ys(i.length)&&!Ar(i)}function ot(i){return it(i)&&Ht(i)}function d3(i){return i===!0||i===!1||it(i)&&Lt(i)==Rt}var Yr=Fy||ql,p3=v1?zt(v1):D8;function g3(i){return it(i)&&i.nodeType===1&&!pu(i)}function _3(i){if(i==null)return!0;if(Ht(i)&&(ge(i)||typeof i=="string"||typeof i.splice=="function"||Yr(i)||ca(i)||Si(i)))return!i.length;var u=Bt(i);if(u==Je||u==xt)return!i.size;if(cu(i))return!sl(i).length;for(var l in i)if(Pe.call(i,l))return!1;return!0}function v3(i,u){return fu(i,u)}function w3(i,u,l){l=typeof l=="function"?l:t;var p=l?l(i,u):t;return p===t?fu(i,u,t,l):!!p}function Rl(i){if(!it(i))return!1;var u=Lt(i);return u==yt||u==vr||typeof i.message=="string"&&typeof i.name=="string"&&!pu(i)}function b3(i){return typeof i=="number"&&O1(i)}function Ar(i){if(!nt(i))return!1;var u=Lt(i);return u==Nt||u==bn||u==Qt||u==bi}function rg(i){return typeof i=="number"&&i==ve(i)}function Ys(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=Ce}function nt(i){var u=typeof i;return i!=null&&(u=="object"||u=="function")}function it(i){return i!=null&&typeof i=="object"}var ig=w1?zt(w1):x8;function m3(i,u){return i===u||ul(i,u,xl(u))}function D3(i,u,l){return l=typeof l=="function"?l:t,ul(i,u,xl(u),l)}function y3(i){return ag(i)&&i!=+i}function x3(i){if(ux(i))throw new de(s);return Q1(i)}function E3(i){return i===null}function C3(i){return i==null}function ag(i){return typeof i=="number"||it(i)&&Lt(i)==_t}function pu(i){if(!it(i)||Lt(i)!=vt)return!1;var u=ys(i);if(u===null)return!0;var l=Pe.call(u,"constructor")&&u.constructor;return typeof l=="function"&&l instanceof l&&ws.call(l)==Dy}var Nl=b1?zt(b1):E8;function A3(i){return rg(i)&&i>=-Ce&&i<=Ce}var ug=m1?zt(m1):C8;function Qs(i){return typeof i=="string"||!ge(i)&&it(i)&&Lt(i)==mn}function tn(i){return typeof i=="symbol"||it(i)&&Lt(i)==br}var ca=D1?zt(D1):A8;function F3(i){return i===t}function B3(i){return it(i)&&Bt(i)==At}function S3(i){return it(i)&&Lt(i)==ja}var I3=Us(ol),T3=Us(function(i,u){return i<=u});function sg(i){if(!i)return[];if(Ht(i))return Qs(i)?Mn(i):qt(i);if(tu&&i[tu])return fy(i[tu]());var u=Bt(i),l=u==Je?Yf:u==xt?gs:da;return l(i)}function Fr(i){if(!i)return i===0?i:0;if(i=Bn(i),i===Fe||i===-Fe){var u=i<0?-1:1;return u*vn}return i===i?i:0}function ve(i){var u=Fr(i),l=u%1;return u===u?l?u-l:u:0}function og(i){return i?Ci(ve(i),0,tt):0}function Bn(i){if(typeof i=="number")return i;if(tn(i))return kt;if(nt(i)){var u=typeof i.valueOf=="function"?i.valueOf():i;i=nt(u)?u+"":u}if(typeof i!="string")return i===0?i:+i;i=F1(i);var l=cD.test(i);return l||pD.test(i)?ZD(i.slice(2),l?2:8):hD.test(i)?kt:+i}function fg(i){return rr(i,Vt(i))}function k3(i){return i?Ci(ve(i),-Ce,Ce):i===0?i:0}function Le(i){return i==null?"":en(i)}var R3=fa(function(i,u){if(cu(u)||Ht(u)){rr(u,wt(u),i);return}for(var l in u)Pe.call(u,l)&&uu(i,l,u[l])}),lg=fa(function(i,u){rr(u,Vt(u),i)}),Js=fa(function(i,u,l,p){rr(u,Vt(u),i,p)}),N3=fa(function(i,u,l,p){rr(u,wt(u),i,p)}),$3=Er(tl);function L3(i,u){var l=oa(i);return u==null?l:G1(l,u)}var O3=me(function(i,u){i=Ue(i);var l=-1,p=u.length,y=p>2?u[2]:t;for(y&&Ot(u[0],u[1],y)&&(p=1);++l<p;)for(var A=u[l],R=Vt(A),O=-1,G=R.length;++O<G;){var J=R[O],j=i[J];(j===t||Wn(j,aa[J])&&!Pe.call(i,J))&&(i[J]=A[J])}return i}),P3=me(function(i){return i.push(t,Fp),jt(hg,t,i)});function M3(i,u){return x1(i,oe(u,3),nr)}function U3(i,u){return x1(i,oe(u,3),rl)}function W3(i,u){return i==null?i:nl(i,oe(u,3),Vt)}function G3(i,u){return i==null?i:X1(i,oe(u,3),Vt)}function q3(i,u){return i&&nr(i,oe(u,3))}function H3(i,u){return i&&rl(i,oe(u,3))}function V3(i){return i==null?[]:ks(i,wt(i))}function Z3(i){return i==null?[]:ks(i,Vt(i))}function $l(i,u,l){var p=i==null?t:Ai(i,u);return p===t?l:p}function X3(i,u){return i!=null&&Ip(i,u,_8)}function Ll(i,u){return i!=null&&Ip(i,u,v8)}var K3=yp(function(i,u,l){u!=null&&typeof u.toString!="function"&&(u=bs.call(u)),i[u]=l},Pl(Zt)),Y3=yp(function(i,u,l){u!=null&&typeof u.toString!="function"&&(u=bs.call(u)),Pe.call(i,u)?i[u].push(l):i[u]=[l]},oe),Q3=me(ou);function wt(i){return Ht(i)?U1(i):sl(i)}function Vt(i){return Ht(i)?U1(i,!0):F8(i)}function J3(i,u){var l={};return u=oe(u,3),nr(i,function(p,y,A){yr(l,u(p,y,A),p)}),l}function j3(i,u){var l={};return u=oe(u,3),nr(i,function(p,y,A){yr(l,y,u(p,y,A))}),l}var z3=fa(function(i,u,l){Rs(i,u,l)}),hg=fa(function(i,u,l,p){Rs(i,u,l,p)}),eC=Er(function(i,u){var l={};if(i==null)return l;var p=!1;u=et(u,function(A){return A=Xr(A,i),p||(p=A.length>1),A}),rr(i,Dl(i),l),p&&(l=Cn(l,D|x|m,K8));for(var y=u.length;y--;)dl(l,u[y]);return l});function tC(i,u){return cg(i,Ks(oe(u)))}var nC=Er(function(i,u){return i==null?{}:S8(i,u)});function cg(i,u){if(i==null)return{};var l=et(Dl(i),function(p){return[p]});return u=oe(u),rp(i,l,function(p,y){return u(p,y[0])})}function rC(i,u,l){u=Xr(u,i);var p=-1,y=u.length;for(y||(y=1,i=t);++p<y;){var A=i==null?t:i[ir(u[p])];A===t&&(p=y,A=l),i=Ar(A)?A.call(i):A}return i}function iC(i,u,l){return i==null?i:lu(i,u,l)}function aC(i,u,l,p){return p=typeof p=="function"?p:t,i==null?i:lu(i,u,l,p)}var dg=Cp(wt),pg=Cp(Vt);function uC(i,u,l){var p=ge(i),y=p||Yr(i)||ca(i);if(u=oe(u,4),l==null){var A=i&&i.constructor;y?l=p?new A:[]:nt(i)?l=Ar(A)?oa(ys(i)):{}:l={}}return(y?yn:nr)(i,function(R,O,G){return u(l,R,O,G)}),l}function sC(i,u){return i==null?!0:dl(i,u)}function oC(i,u,l){return i==null?i:op(i,u,_l(l))}function fC(i,u,l,p){return p=typeof p=="function"?p:t,i==null?i:op(i,u,_l(l),p)}function da(i){return i==null?[]:Kf(i,wt(i))}function lC(i){return i==null?[]:Kf(i,Vt(i))}function hC(i,u,l){return l===t&&(l=u,u=t),l!==t&&(l=Bn(l),l=l===l?l:0),u!==t&&(u=Bn(u),u=u===u?u:0),Ci(Bn(i),u,l)}function cC(i,u,l){return u=Fr(u),l===t?(l=u,u=0):l=Fr(l),i=Bn(i),w8(i,u,l)}function dC(i,u,l){if(l&&typeof l!="boolean"&&Ot(i,u,l)&&(u=l=t),l===t&&(typeof u=="boolean"?(l=u,u=t):typeof i=="boolean"&&(l=i,i=t)),i===t&&u===t?(i=0,u=1):(i=Fr(i),u===t?(u=i,i=0):u=Fr(u)),i>u){var p=i;i=u,u=p}if(l||i%1||u%1){var y=P1();return Ft(i+y*(u-i+VD("1e-"+((y+"").length-1))),u)}return ll(i,u)}var pC=la(function(i,u,l){return u=u.toLowerCase(),i+(l?gg(u):u)});function gg(i){return Ol(Le(i).toLowerCase())}function _g(i){return i=Le(i),i&&i.replace(_D,iy).replace($D,"")}function gC(i,u,l){i=Le(i),u=en(u);var p=i.length;l=l===t?p:Ci(ve(l),0,p);var y=l;return l-=u.length,l>=0&&i.slice(l,y)==u}function _C(i){return i=Le(i),i&&Qm.test(i)?i.replace(Xd,ay):i}function vC(i){return i=Le(i),i&&nD.test(i)?i.replace(kf,"\\$&"):i}var wC=la(function(i,u,l){return i+(l?"-":"")+u.toLowerCase()}),bC=la(function(i,u,l){return i+(l?" ":"")+u.toLowerCase()}),mC=bp("toLowerCase");function DC(i,u,l){i=Le(i),u=ve(u);var p=u?ra(i):0;if(!u||p>=u)return i;var y=(u-p)/2;return Ms(As(y),l)+i+Ms(Cs(y),l)}function yC(i,u,l){i=Le(i),u=ve(u);var p=u?ra(i):0;return u&&p<u?i+Ms(u-p,l):i}function xC(i,u,l){i=Le(i),u=ve(u);var p=u?ra(i):0;return u&&p<u?Ms(u-p,l)+i:i}function EC(i,u,l){return l||u==null?u=0:u&&(u=+u),Ty(Le(i).replace(Rf,""),u||0)}function CC(i,u,l){return(l?Ot(i,u,l):u===t)?u=1:u=ve(u),hl(Le(i),u)}function AC(){var i=arguments,u=Le(i[0]);return i.length<3?u:u.replace(i[1],i[2])}var FC=la(function(i,u,l){return i+(l?"_":"")+u.toLowerCase()});function BC(i,u,l){return l&&typeof l!="number"&&Ot(i,u,l)&&(u=l=t),l=l===t?tt:l>>>0,l?(i=Le(i),i&&(typeof u=="string"||u!=null&&!Nl(u))&&(u=en(u),!u&&na(i))?Kr(Mn(i),0,l):i.split(u,l)):[]}var SC=la(function(i,u,l){return i+(l?" ":"")+Ol(u)});function IC(i,u,l){return i=Le(i),l=l==null?0:Ci(ve(l),0,i.length),u=en(u),i.slice(l,l+u.length)==u}function TC(i,u,l){var p=C.templateSettings;l&&Ot(i,u,l)&&(u=t),i=Le(i),u=Js({},u,p,Ap);var y=Js({},u.imports,p.imports,Ap),A=wt(y),R=Kf(y,A),O,G,J=0,j=u.interpolate||ls,ee="__p += '",ne=Qf((u.escape||ls).source+"|"+j.source+"|"+(j===Kd?lD:ls).source+"|"+(u.evaluate||ls).source+"|$","g"),ae="//# sourceURL="+(Pe.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++UD+"]")+`
24
- `;i.replace(ne,function(he,De,Ae,nn,Pt,rn){return Ae||(Ae=nn),ee+=i.slice(J,rn).replace(vD,uy),De&&(O=!0,ee+=`' +
25
- __e(`+De+`) +
26
- '`),Pt&&(G=!0,ee+=`';
27
- `+Pt+`;
28
- __p += '`),Ae&&(ee+=`' +
29
- ((__t = (`+Ae+`)) == null ? '' : __t) +
30
- '`),J=rn+he.length,he}),ee+=`';
31
- `;var le=Pe.call(u,"variable")&&u.variable;if(!le)ee=`with (obj) {
32
- `+ee+`
33
- }
34
- `;else if(oD.test(le))throw new de(h);ee=(G?ee.replace(je,""):ee).replace(He,"$1").replace(ze,"$1;"),ee="function("+(le||"obj")+`) {
35
- `+(le?"":`obj || (obj = {});
36
- `)+"var __t, __p = ''"+(O?", __e = _.escape":"")+(G?`, __j = Array.prototype.join;
37
- function print() { __p += __j.call(arguments, '') }
38
- `:`;
39
- `)+ee+`return __p
40
- }`;var be=wg(function(){return Re(A,ae+"return "+ee).apply(t,R)});if(be.source=ee,Rl(be))throw be;return be}function kC(i){return Le(i).toLowerCase()}function RC(i){return Le(i).toUpperCase()}function NC(i,u,l){if(i=Le(i),i&&(l||u===t))return F1(i);if(!i||!(u=en(u)))return i;var p=Mn(i),y=Mn(u),A=B1(p,y),R=S1(p,y)+1;return Kr(p,A,R).join("")}function $C(i,u,l){if(i=Le(i),i&&(l||u===t))return i.slice(0,T1(i)+1);if(!i||!(u=en(u)))return i;var p=Mn(i),y=S1(p,Mn(u))+1;return Kr(p,0,y).join("")}function LC(i,u,l){if(i=Le(i),i&&(l||u===t))return i.replace(Rf,"");if(!i||!(u=en(u)))return i;var p=Mn(i),y=B1(p,Mn(u));return Kr(p,y).join("")}function OC(i,u){var l=Z,p=Y;if(nt(u)){var y="separator"in u?u.separator:y;l="length"in u?ve(u.length):l,p="omission"in u?en(u.omission):p}i=Le(i);var A=i.length;if(na(i)){var R=Mn(i);A=R.length}if(l>=A)return i;var O=l-ra(p);if(O<1)return p;var G=R?Kr(R,0,O).join(""):i.slice(0,O);if(y===t)return G+p;if(R&&(O+=G.length-O),Nl(y)){if(i.slice(O).search(y)){var J,j=G;for(y.global||(y=Qf(y.source,Le(Yd.exec(y))+"g")),y.lastIndex=0;J=y.exec(j);)var ee=J.index;G=G.slice(0,ee===t?O:ee)}}else if(i.indexOf(en(y),O)!=O){var ne=G.lastIndexOf(y);ne>-1&&(G=G.slice(0,ne))}return G+p}function PC(i){return i=Le(i),i&&Ym.test(i)?i.replace($e,dy):i}var MC=la(function(i,u,l){return i+(l?" ":"")+u.toUpperCase()}),Ol=bp("toUpperCase");function vg(i,u,l){return i=Le(i),u=l?t:u,u===t?oy(i)?_y(i):zD(i):i.match(u)||[]}var wg=me(function(i,u){try{return jt(i,t,u)}catch(l){return Rl(l)?l:new de(l)}}),UC=Er(function(i,u){return yn(u,function(l){l=ir(l),yr(i,l,Tl(i[l],i))}),i});function WC(i){var u=i==null?0:i.length,l=oe();return i=u?et(i,function(p){if(typeof p[1]!="function")throw new xn(f);return[l(p[0]),p[1]]}):[],me(function(p){for(var y=-1;++y<u;){var A=i[y];if(jt(A[0],this,p))return jt(A[1],this,p)}})}function GC(i){return d8(Cn(i,D))}function Pl(i){return function(){return i}}function qC(i,u){return i==null||i!==i?u:i}var HC=Dp(),VC=Dp(!0);function Zt(i){return i}function Ml(i){return J1(typeof i=="function"?i:Cn(i,D))}function ZC(i){return z1(Cn(i,D))}function XC(i,u){return ep(i,Cn(u,D))}var KC=me(function(i,u){return function(l){return ou(l,i,u)}}),YC=me(function(i,u){return function(l){return ou(i,l,u)}});function Ul(i,u,l){var p=wt(u),y=ks(u,p);l==null&&!(nt(u)&&(y.length||!p.length))&&(l=u,u=i,i=this,y=ks(u,wt(u)));var A=!(nt(l)&&"chain"in l)||!!l.chain,R=Ar(i);return yn(y,function(O){var G=u[O];i[O]=G,R&&(i.prototype[O]=function(){var J=this.__chain__;if(A||J){var j=i(this.__wrapped__),ee=j.__actions__=qt(this.__actions__);return ee.push({func:G,args:arguments,thisArg:i}),j.__chain__=J,j}return G.apply(i,Gr([this.value()],arguments))})}),i}function QC(){return Et._===this&&(Et._=yy),this}function Wl(){}function JC(i){return i=ve(i),me(function(u){return tp(u,i)})}var jC=wl(et),zC=wl(y1),eA=wl(qf);function bg(i){return Cl(i)?Hf(ir(i)):I8(i)}function tA(i){return function(u){return i==null?t:Ai(i,u)}}var nA=xp(),rA=xp(!0);function Gl(){return[]}function ql(){return!1}function iA(){return{}}function aA(){return""}function uA(){return!0}function sA(i,u){if(i=ve(i),i<1||i>Ce)return[];var l=tt,p=Ft(i,tt);u=oe(u),i-=tt;for(var y=Xf(p,u);++l<i;)u(l);return y}function oA(i){return ge(i)?et(i,ir):tn(i)?[i]:qt(Mp(Le(i)))}function fA(i){var u=++my;return Le(i)+u}var lA=Ps(function(i,u){return i+u},0),hA=bl("ceil"),cA=Ps(function(i,u){return i/u},1),dA=bl("floor");function pA(i){return i&&i.length?Ts(i,Zt,il):t}function gA(i,u){return i&&i.length?Ts(i,oe(u,2),il):t}function _A(i){return C1(i,Zt)}function vA(i,u){return C1(i,oe(u,2))}function wA(i){return i&&i.length?Ts(i,Zt,ol):t}function bA(i,u){return i&&i.length?Ts(i,oe(u,2),ol):t}var mA=Ps(function(i,u){return i*u},1),DA=bl("round"),yA=Ps(function(i,u){return i-u},0);function xA(i){return i&&i.length?Zf(i,Zt):0}function EA(i,u){return i&&i.length?Zf(i,oe(u,2)):0}return C.after=ZE,C.ary=Qp,C.assign=R3,C.assignIn=lg,C.assignInWith=Js,C.assignWith=N3,C.at=$3,C.before=Jp,C.bind=Tl,C.bindAll=UC,C.bindKey=jp,C.castArray=i3,C.chain=Xp,C.chunk=dx,C.compact=px,C.concat=gx,C.cond=WC,C.conforms=GC,C.constant=Pl,C.countBy=xE,C.create=L3,C.curry=zp,C.curryRight=eg,C.debounce=tg,C.defaults=O3,C.defaultsDeep=P3,C.defer=XE,C.delay=KE,C.difference=_x,C.differenceBy=vx,C.differenceWith=wx,C.drop=bx,C.dropRight=mx,C.dropRightWhile=Dx,C.dropWhile=yx,C.fill=xx,C.filter=CE,C.flatMap=BE,C.flatMapDeep=SE,C.flatMapDepth=IE,C.flatten=qp,C.flattenDeep=Ex,C.flattenDepth=Cx,C.flip=YE,C.flow=HC,C.flowRight=VC,C.fromPairs=Ax,C.functions=V3,C.functionsIn=Z3,C.groupBy=TE,C.initial=Bx,C.intersection=Sx,C.intersectionBy=Ix,C.intersectionWith=Tx,C.invert=K3,C.invertBy=Y3,C.invokeMap=RE,C.iteratee=Ml,C.keyBy=NE,C.keys=wt,C.keysIn=Vt,C.map=Vs,C.mapKeys=J3,C.mapValues=j3,C.matches=ZC,C.matchesProperty=XC,C.memoize=Xs,C.merge=z3,C.mergeWith=hg,C.method=KC,C.methodOf=YC,C.mixin=Ul,C.negate=Ks,C.nthArg=JC,C.omit=eC,C.omitBy=tC,C.once=QE,C.orderBy=$E,C.over=jC,C.overArgs=JE,C.overEvery=zC,C.overSome=eA,C.partial=kl,C.partialRight=ng,C.partition=LE,C.pick=nC,C.pickBy=cg,C.property=bg,C.propertyOf=tA,C.pull=$x,C.pullAll=Vp,C.pullAllBy=Lx,C.pullAllWith=Ox,C.pullAt=Px,C.range=nA,C.rangeRight=rA,C.rearg=jE,C.reject=ME,C.remove=Mx,C.rest=zE,C.reverse=Sl,C.sampleSize=WE,C.set=iC,C.setWith=aC,C.shuffle=GE,C.slice=Ux,C.sortBy=VE,C.sortedUniq=Xx,C.sortedUniqBy=Kx,C.split=BC,C.spread=e3,C.tail=Yx,C.take=Qx,C.takeRight=Jx,C.takeRightWhile=jx,C.takeWhile=zx,C.tap=pE,C.throttle=t3,C.thru=Hs,C.toArray=sg,C.toPairs=dg,C.toPairsIn=pg,C.toPath=oA,C.toPlainObject=fg,C.transform=uC,C.unary=n3,C.union=eE,C.unionBy=tE,C.unionWith=nE,C.uniq=rE,C.uniqBy=iE,C.uniqWith=aE,C.unset=sC,C.unzip=Il,C.unzipWith=Zp,C.update=oC,C.updateWith=fC,C.values=da,C.valuesIn=lC,C.without=uE,C.words=vg,C.wrap=r3,C.xor=sE,C.xorBy=oE,C.xorWith=fE,C.zip=lE,C.zipObject=hE,C.zipObjectDeep=cE,C.zipWith=dE,C.entries=dg,C.entriesIn=pg,C.extend=lg,C.extendWith=Js,Ul(C,C),C.add=lA,C.attempt=wg,C.camelCase=pC,C.capitalize=gg,C.ceil=hA,C.clamp=hC,C.clone=a3,C.cloneDeep=s3,C.cloneDeepWith=o3,C.cloneWith=u3,C.conformsTo=f3,C.deburr=_g,C.defaultTo=qC,C.divide=cA,C.endsWith=gC,C.eq=Wn,C.escape=_C,C.escapeRegExp=vC,C.every=EE,C.find=AE,C.findIndex=Wp,C.findKey=M3,C.findLast=FE,C.findLastIndex=Gp,C.findLastKey=U3,C.floor=dA,C.forEach=Kp,C.forEachRight=Yp,C.forIn=W3,C.forInRight=G3,C.forOwn=q3,C.forOwnRight=H3,C.get=$l,C.gt=l3,C.gte=h3,C.has=X3,C.hasIn=Ll,C.head=Hp,C.identity=Zt,C.includes=kE,C.indexOf=Fx,C.inRange=cC,C.invoke=Q3,C.isArguments=Si,C.isArray=ge,C.isArrayBuffer=c3,C.isArrayLike=Ht,C.isArrayLikeObject=ot,C.isBoolean=d3,C.isBuffer=Yr,C.isDate=p3,C.isElement=g3,C.isEmpty=_3,C.isEqual=v3,C.isEqualWith=w3,C.isError=Rl,C.isFinite=b3,C.isFunction=Ar,C.isInteger=rg,C.isLength=Ys,C.isMap=ig,C.isMatch=m3,C.isMatchWith=D3,C.isNaN=y3,C.isNative=x3,C.isNil=C3,C.isNull=E3,C.isNumber=ag,C.isObject=nt,C.isObjectLike=it,C.isPlainObject=pu,C.isRegExp=Nl,C.isSafeInteger=A3,C.isSet=ug,C.isString=Qs,C.isSymbol=tn,C.isTypedArray=ca,C.isUndefined=F3,C.isWeakMap=B3,C.isWeakSet=S3,C.join=kx,C.kebabCase=wC,C.last=Fn,C.lastIndexOf=Rx,C.lowerCase=bC,C.lowerFirst=mC,C.lt=I3,C.lte=T3,C.max=pA,C.maxBy=gA,C.mean=_A,C.meanBy=vA,C.min=wA,C.minBy=bA,C.stubArray=Gl,C.stubFalse=ql,C.stubObject=iA,C.stubString=aA,C.stubTrue=uA,C.multiply=mA,C.nth=Nx,C.noConflict=QC,C.noop=Wl,C.now=Zs,C.pad=DC,C.padEnd=yC,C.padStart=xC,C.parseInt=EC,C.random=dC,C.reduce=OE,C.reduceRight=PE,C.repeat=CC,C.replace=AC,C.result=rC,C.round=DA,C.runInContext=M,C.sample=UE,C.size=qE,C.snakeCase=FC,C.some=HE,C.sortedIndex=Wx,C.sortedIndexBy=Gx,C.sortedIndexOf=qx,C.sortedLastIndex=Hx,C.sortedLastIndexBy=Vx,C.sortedLastIndexOf=Zx,C.startCase=SC,C.startsWith=IC,C.subtract=yA,C.sum=xA,C.sumBy=EA,C.template=TC,C.times=sA,C.toFinite=Fr,C.toInteger=ve,C.toLength=og,C.toLower=kC,C.toNumber=Bn,C.toSafeInteger=k3,C.toString=Le,C.toUpper=RC,C.trim=NC,C.trimEnd=$C,C.trimStart=LC,C.truncate=OC,C.unescape=PC,C.uniqueId=fA,C.upperCase=MC,C.upperFirst=Ol,C.each=Kp,C.eachRight=Yp,C.first=Hp,Ul(C,function(){var i={};return nr(C,function(u,l){Pe.call(C.prototype,l)||(i[l]=u)}),i}(),{chain:!1}),C.VERSION=a,yn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){C[i].placeholder=C}),yn(["drop","take"],function(i,u){xe.prototype[i]=function(l){l=l===t?1:pt(ve(l),0);var p=this.__filtered__&&!u?new xe(this):this.clone();return p.__filtered__?p.__takeCount__=Ft(l,p.__takeCount__):p.__views__.push({size:Ft(l,tt),type:i+(p.__dir__<0?"Right":"")}),p},xe.prototype[i+"Right"]=function(l){return this.reverse()[i](l).reverse()}}),yn(["filter","map","takeWhile"],function(i,u){var l=u+1,p=l==fe||l==Me;xe.prototype[i]=function(y){var A=this.clone();return A.__iteratees__.push({iteratee:oe(y,3),type:l}),A.__filtered__=A.__filtered__||p,A}}),yn(["head","last"],function(i,u){var l="take"+(u?"Right":"");xe.prototype[i]=function(){return this[l](1).value()[0]}}),yn(["initial","tail"],function(i,u){var l="drop"+(u?"":"Right");xe.prototype[i]=function(){return this.__filtered__?new xe(this):this[l](1)}}),xe.prototype.compact=function(){return this.filter(Zt)},xe.prototype.find=function(i){return this.filter(i).head()},xe.prototype.findLast=function(i){return this.reverse().find(i)},xe.prototype.invokeMap=me(function(i,u){return typeof i=="function"?new xe(this):this.map(function(l){return ou(l,i,u)})}),xe.prototype.reject=function(i){return this.filter(Ks(oe(i)))},xe.prototype.slice=function(i,u){i=ve(i);var l=this;return l.__filtered__&&(i>0||u<0)?new xe(l):(i<0?l=l.takeRight(-i):i&&(l=l.drop(i)),u!==t&&(u=ve(u),l=u<0?l.dropRight(-u):l.take(u-i)),l)},xe.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},xe.prototype.toArray=function(){return this.take(tt)},nr(xe.prototype,function(i,u){var l=/^(?:filter|find|map|reject)|While$/.test(u),p=/^(?:head|last)$/.test(u),y=C[p?"take"+(u=="last"?"Right":""):u],A=p||/^find/.test(u);y&&(C.prototype[u]=function(){var R=this.__wrapped__,O=p?[1]:arguments,G=R instanceof xe,J=O[0],j=G||ge(R),ee=function(De){var Ae=y.apply(C,Gr([De],O));return p&&ne?Ae[0]:Ae};j&&l&&typeof J=="function"&&J.length!=1&&(G=j=!1);var ne=this.__chain__,ae=!!this.__actions__.length,le=A&&!ne,be=G&&!ae;if(!A&&j){R=be?R:new xe(this);var he=i.apply(R,O);return he.__actions__.push({func:Hs,args:[ee],thisArg:t}),new En(he,ne)}return le&&be?i.apply(this,O):(he=this.thru(ee),le?p?he.value()[0]:he.value():he)})}),yn(["pop","push","shift","sort","splice","unshift"],function(i){var u=_s[i],l=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",p=/^(?:pop|shift)$/.test(i);C.prototype[i]=function(){var y=arguments;if(p&&!this.__chain__){var A=this.value();return u.apply(ge(A)?A:[],y)}return this[l](function(R){return u.apply(ge(R)?R:[],y)})}}),nr(xe.prototype,function(i,u){var l=C[u];if(l){var p=l.name+"";Pe.call(sa,p)||(sa[p]=[]),sa[p].push({name:u,func:l})}}),sa[Os(t,k).name]=[{name:"wrapper",func:t}],xe.prototype.clone=Py,xe.prototype.reverse=My,xe.prototype.value=Uy,C.prototype.at=gE,C.prototype.chain=_E,C.prototype.commit=vE,C.prototype.next=wE,C.prototype.plant=mE,C.prototype.reverse=DE,C.prototype.toJSON=C.prototype.valueOf=C.prototype.value=yE,C.prototype.first=C.prototype.head,tu&&(C.prototype[tu]=bE),C},ia=vy();Di?((Di.exports=ia)._=ia,Mf._=ia):Et._=ia}).call(_a)}(bu,bu.exports);var Sg=bu.exports,Xt=wu(Sg);class rt extends Ne{constructor(e,t,a){super(t,a),this.chr=e,this.start=t,this.end=a}static parse(e){const t=e.replace(/,/g,"").match(/([\w:.]+)\W+(\d+)\W+(\d+)/),a=e.includes(":")?1:0;if(t){const o=t[1],s=Math.max(Number.parseInt(t[2],10)-a,0),f=Number.parseInt(t[3],10);return new rt(o,s,f)}else throw new RangeError("Could not parse interval")}static mergeAdvanced(e,t,a){const o=Xt.groupBy(e,f=>a(f).chr),s=[];for(const f in o){const h=o[f];h.sort((c,D)=>a(c).start-a(D).start);const _=h.map(a);let d=0;for(;d<_.length;){const c=_[d].start;let D=_[d].end,x=d+1;for(;x<_.length;){const[m,B]=_[x];if(m-D>t)break;B>D&&(D=B),x++}s.push({locus:new rt(f,c,D),sources:h.slice(d,x)}),d=x}}return s}static mergeOverlaps(e,t=2e3){return rt.mergeAdvanced(e,t,Xt.identity).map(o=>o.locus)}serialize(){return this}static deserialize(e){return new rt(e.chr,e.start,e.end)}*[Symbol.iterator](){yield this.start,yield this.end}getLength(){return this.end-this.start}getOverlap(e){if(this.chr!==e.chr)return null;{const t=this.toOpenInterval().getOverlap(e);return t?new rt(this.chr,t.start,t.end):null}}toString(){return`${this.chr}:${this.start}-${this.end}`}toOpenInterval(){return new Ne(this.start,this.end)}toStringWithOther(e){return`${this.chr}:${this.start}-${e.chr}:${e.end}`}}const Ig="+",Tg="-";class qn{constructor(e,t,a="",o=null){ue(this,"name");ue(this,"score");ue(this,"id");ue(this,"sequence");ue(this,"variant");ue(this,"value");this.locus=t,this.strand=a,this.name=e===void 0?t.toString():e,this.locus=t,this.strand=a,this.value=o}serialize(){return{name:this.name,locus:this.getLocus().serialize(),strand:this.strand}}static deserialize(e){return new qn(e.name,rt.deserialize(e.locus),e.strand)}getName(){return this.name}getLocus(){return this.locus}getLength(){return this.locus.getLength()}getStrand(){return this.strand}getIsForwardStrand(){return this.strand===Ig}getIsReverseStrand(){return this.strand===Tg}getHasStrand(){return this.getIsForwardStrand()||this.getIsReverseStrand()}computeNavContextCoordinates(e){return e.convertGenomeIntervalToBases(this.getLocus())}}const kg="-";class Rg extends qn{constructor(t){const a=new rt(t.chr,t.start,t.end);super(t[3].id,a,t.strand);ue(this,"queryLocus");ue(this,"targetSeq");ue(this,"querySeq");ue(this,"queryStrand");const{chr:o,start:s,stop:f,strand:h,targetseq:_,queryseq:d}=t[3].genomealign;this.queryLocus=new rt(o,s,f),this.querySeq=d||"",this.targetSeq=_||"",this.queryStrand=h}getIsReverseStrandQuery(){return this.queryStrand===kg}}class an{constructor(e,t=0,a){ue(this,"relativeStart");ue(this,"relativeEnd");if(this.feature=e,a===void 0&&(a=e.locus.end-e.locus.start),a<t)throw new RangeError("End cannot be less than start");this.feature=e,this.relativeStart=t,this.relativeEnd=a}get start(){return console.error("FeatureSegment has no prop `start`. Use `relativeStart` instead."),this.relativeStart}get end(){return console.error("FeatureSegment has no prop `end`. Use `relativeEnd` instead."),this.relativeEnd}toOpenInterval(){return new Ne(this.relativeStart,this.relativeEnd)}getName(){return this.feature.getName()}getLength(){return this.relativeEnd-this.relativeStart}getLocus(){const e=this.feature.locus;return new rt(e.chr,e.start+this.relativeStart,e.start+this.relativeEnd)}getOverlap(e){if(this.feature!==e.feature)return null;const t=this.toOpenInterval().getOverlap(e.toOpenInterval());return t?new an(this.feature,t.start,t.end):null}getGenomeOverlap(e){const t=this.feature.getLocus(),o=this.getLocus().getOverlap(e);if(!o)return null;const s=o.start-t.start,f=o.end-t.start;return new an(this.feature,s,f)}toString(){return`${this.getName()}:${this.relativeStart+1}-${this.relativeEnd}`}toStringWithOther(e){return`${this.getName()}:${this.relativeStart+1}-${e.getName()}:${e.relativeEnd}`}}const Xl="";class In{constructor(e,t){ue(this,"_name");ue(this,"_features");ue(this,"_sortedFeatureStarts");ue(this,"_minCoordinateForFeature");ue(this,"_featuresForChr");ue(this,"_totalBases");this._name=e,this._features=t,this._minCoordinateForFeature=new Map,this._sortedFeatureStarts=[],this._featuresForChr=Xt.groupBy(t,a=>a.getLocus().chr),this._totalBases=0;for(const a of t){if(this._minCoordinateForFeature.has(a))throw new Error(`Duplicate feature "${a.getName()}" detected. Features must be unique.`);this._minCoordinateForFeature.set(a,this._totalBases),this._sortedFeatureStarts.push(this._totalBases),this._totalBases+=a.getLength()}}static makeGap(e,t="Gap"){return new qn(t,new rt(Xl,0,Math.round(e)))}static isGapFeature(e){return e.getLocus().chr===Xl}_flipIfReverseStrand(e){if(e.feature.getIsReverseStrand())return new an(e.feature,t(e.relativeEnd),t(e.relativeStart));return e;function t(a){return e.feature.getLength()-a}}getName(){return this._name}getFeatures(){return this._features.slice()}getTotalBases(){return this._totalBases}getIsValidBase(e){return 0<=e&&e<this._totalBases}getFeatureStart(e){const t=this._minCoordinateForFeature.get(e);if(t===void 0)throw new RangeError(`Feature "${e.getName()}" not in this navigation context`);return t}convertBaseToFeatureCoordinate(e){if(!this.getIsValidBase(e))throw new RangeError(`Base number ${e} is invalid. Valid bases in this context: [0, ${this.getTotalBases()})`);const t=Xt.sortedLastIndex(this._sortedFeatureStarts,e)-1,a=this._features[t],o=e-this._sortedFeatureStarts[t];return new an(a,o,o+1)}convertFeatureSegmentToContextCoordinates(e){e=this._flipIfReverseStrand(e);const t=this.getFeatureStart(e.feature);return new Ne(t+e.relativeStart,t+e.relativeEnd)}convertGenomeIntervalToBases(e){const t=this._featuresForChr[e.chr]||[],a=[];for(const o of t){const s=new an(o).getGenomeOverlap(e);s&&a.push(this.convertFeatureSegmentToContextCoordinates(s))}return a}toGaplessCoordinate(e){const t=this.convertBaseToFeatureCoordinate(e),a=this._features.findIndex(f=>f===t.feature),o=this._features.slice(0,a).filter(In.isGapFeature);let s=Xt.sumBy(o,f=>f.getLength());return In.isGapFeature(t.feature)&&(s+=t.relativeStart),e-s}parse(e){const t=this._features.find(s=>s.getName()===e);if(t){const s=this.convertFeatureSegmentToContextCoordinates(new an(t)),f=.5*(s.start+s.end);return new Ne(f-3,f+3)}const a=rt.parse(e),o=this.convertGenomeIntervalToBases(a)[0];if(o)return o;throw new RangeError("Location unavailable in this context")}getFeaturesInInterval(e,t,a=!0){const o=new Ne(e,t),s=[];for(const f of this._features){if(!a&&In.isGapFeature(f))continue;const h=this.getFeatureStart(f),_=h+f.getLength(),d=new Ne(h,_).getOverlap(o);if(d){const c=d.start-h,D=d.end-h,x=new an(f,c,D);s.push(this._flipIfReverseStrand(x))}else if(s.length>0)break}return s}getLociInInterval(e,t){const o=this.getFeaturesInInterval(e,t,!1).map(s=>s.getLocus());return rt.mergeOverlaps(o)}hasFeatureWithName(e){return this._features.some(t=>t.name===e.name)}}const mu=0;class Ti{constructor(e,t=mu,a){ue(this,"_navContext");ue(this,"_startBase");ue(this,"_endBase");this._navContext=e,a===void 0&&(a=e.getTotalBases()),this.setRegion(t,a)}clone(){return new Ti(this._navContext,this._startBase,this._endBase)}getNavigationContext(){return this._navContext}getWidth(){return this._endBase-this._startBase}getContextCoordinates(){return new Ne(this._startBase,this._endBase)}getFeatureSegments(e=!0){return this._navContext.getFeaturesInInterval(this._startBase,this._endBase,e)}getGenomeIntervals(){return this._navContext.getLociInInterval(this._startBase,this._endBase)}setRegion(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))throw new RangeError("Start and end must be well-defined");if(t<e)throw new RangeError("Start must be less than or equal to end");const a=t-e,o=this._navContext.getTotalBases();return e<mu?t=mu+a:t>o&&(e=o-a),this._startBase=Math.round(Math.max(mu,e)),this._endBase=Math.round(Math.min(t,o)),this}pan(e){return this.setRegion(this._startBase+e,this._endBase+e),this}panLeft(){const e=this.getWidth();return this.pan(-e)}panRight(){const e=this.getWidth();return this.pan(e)}zoom(e,t=.5){if(e<=0)throw new RangeError("Zoom factor must be greater than 0");const a=this.getWidth()*e,o=this.getWidth()*t+this._startBase,s=a*t+this._startBase,f=o-s,h=this._startBase+f,_=this._startBase+a+f;return this.setRegion(h,_),this}currentRegionAsString(){const e=this.getFeatureSegments();if(e.length===1)return e[0].toString();{const t=e[0],a=e[e.length-1];return t.toStringWithOther(a)}}}var Kl=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Ng(n,e){return!!(n===e||Kl(n)&&Kl(e))}function $g(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!Ng(n[t],e[t]))return!1;return!0}function Lg(n,e){e===void 0&&(e=$g);var t=null;function a(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];if(t&&t.lastThis===this&&e(o,t.lastArgs))return t.lastResult;var f=n.apply(this,o);return t={lastResult:f,lastArgs:o,lastThis:this},f}return a.clear=function(){t=null},a}const va="-";function Du(n){return Xt.sumBy(n,e=>e===va?0:1)}function Yl(n,e,t=!1){const a=[],o=new RegExp(va+"+","g");let s;for(;(s=o.exec(n))!==null;)_(!0,s.index,s[0].length,e);if(t)return a;let f=0;const h=a.slice();for(const d of h)_(!1,f,d.index-f),f=d.index+d.length;return _(!1,f,n.length-f),a;function _(d,c,D,x=0){D>x&&a.push({isGap:d,index:c,length:D})}}function ao(n,e,t=!1){const a=t?-1:1,o=[];let s=e;for(const f of n)o.push(s),f!==va&&(s+=a);return o}class Og{constructor(e){ue(this,"sequence");ue(this,"_currentIndex");this.sequence=e,this._currentIndex=-1}reset(){this._currentIndex=0}getCurrentIndex(){return this._currentIndex}getIndexOfNextBase(){do this._currentIndex++;while(this.sequence.charAt(this._currentIndex)===va);return this._currentIndex}hasNextBase(){return this._currentIndex<this.sequence.length-1}advanceN(e){let t=this._currentIndex;for(let a=0;a<e;a++)t=this.getIndexOfNextBase();return t}}class uo extends an{constructor(t,a,o){super(t,a,o);ue(this,"feature");ue(this,"sequenceInterval");this.feature=t;const s=new Og(t.targetSeq),f=s.advanceN(this.relativeStart+1),h=s.advanceN(this.getLength());this.sequenceInterval=new Ne(f,h)}static fromFeatureSegment(t){return new uo(t.feature,t.relativeStart,t.relativeEnd)}getTargetSequence(){const[t,a]=this.sequenceInterval;return this.feature.targetSeq.substring(t,a)}getQueryLocus(){const{queryStrand:t,queryLocus:a}=this.feature;return new rt(a.chr,t==="+"?Math.min(a.start+this.relativeStart,a.end):Math.max(0,a.end-this.relativeEnd),t==="+"?Math.min(a.start+this.relativeEnd,a.end):a.end-this.relativeStart)}getQueryLocusFine(){const{querySeq:t,queryLocus:a}=this.feature,o=Du(t.substring(0,this.sequenceInterval.start)),s=Du(this.getQuerySequence());if(this.feature.getIsReverseStrandQuery()){const f=a.end-o;return new rt(a.chr,f-s,f)}else{const f=a.start+o;return new rt(a.chr,f,f+s)}}getQuerySequence(){const[t,a]=this.sequenceInterval;return this.feature.querySeq.substring(t,a)}}function Pg(n,e=!1){const t=n>=1e3?Math.floor(n):Math.round(n);return t>=75e4?`${(t/1e6).toFixed(1)} Mb`:t>=1e4?`${(t/1e3).toFixed(1)} Kb`:t>0?`${t} bp`:e?"<1 bp":"0 bp"}class Ql{constructor(e){ue(this,"_baseNavContext");ue(this,"_gaps");ue(this,"_cumulativeGapBases");this._baseNavContext=e,this._cumulativeGapBases=[]}setGaps(e){this._gaps=e.slice().sort((a,o)=>a.contextBase-o.contextBase),this._cumulativeGapBases=[];let t=0;for(const a of this._gaps)this._cumulativeGapBases.push(t),t+=a.length;this._cumulativeGapBases.push(t)}build(){const e=this._baseNavContext.getFeatures(),t=new Map;for(let f=0;f<e.length;f++)t.set(e[f],f);const a=[];let o=-1,s=0;for(const f of this._gaps){const h=this._baseNavContext.convertBaseToFeatureCoordinate(f.contextBase),_=h.feature,d=t.get(_),c=h.relativeStart;a.push(...e.slice(o+1,d)),d===o&&s>0&&a.pop(),s=s>c?0:s;const D=new an(_,s,c).getLocus(),x=new an(_,c).getLocus();D.getLength()>0&&a.push(new qn(_.getName(),D,_.getStrand())),a.push(In.makeGap(f.length,`${Pg(f.length)} gap`)),x.getLength()>0&&a.push(new qn(_.getName(),x,_.getStrand())),o=d,s=c}return a.push(...e.slice(o+1)),new In(this._baseNavContext.getName(),a)}convertOldCoordinates(e){const t=Xt.sortedIndexBy(this._gaps,{contextBase:e},"contextBase"),a=this._cumulativeGapBases[t]||0;return e+a}}class zr{constructor(e,t){ue(this,"_viewRegion");ue(this,"_drawWidth");ue(this,"_pixelsPerBase");ue(this,"_basesPerPixel");this._viewRegion=e,this._drawWidth=t,this._pixelsPerBase=t/e.getWidth(),this._basesPerPixel=e.getWidth()/t}getDrawWidth(){return this._drawWidth}basesToXWidth(e){return e*this._pixelsPerBase}xWidthToBases(e){return e*this._basesPerPixel}baseToX(e){return(e-this._viewRegion.getContextCoordinates().start)*this._pixelsPerBase}xToBase(e){return e*this._basesPerPixel+this._viewRegion.getContextCoordinates().start}baseSpanToXSpan(e){const t=this.baseToX(e.start),a=this.baseToX(e.end);return new Ne(t,a)}baseSpanToXCenter(e){const t=this.baseSpanToXSpan(e),a=Math.round((t.start+t.end)/2);return new Ne(a,a)}xToSegmentCoordinate(e){const t=Math.floor(this.xToBase(e));return this._viewRegion.getNavigationContext().convertBaseToFeatureCoordinate(t)}}class Mg{constructor(e,t,a){ue(this,"interaction");ue(this,"xSpan1");ue(this,"xSpan2");this.interaction=e,t.start<=a.start?(this.xSpan1=t,this.xSpan2=a):(this.xSpan1=a,this.xSpan2=t)}getWidth(){const e=this.xSpan1.start;return Math.max(this.xSpan1.end,this.xSpan2.end)-e}generateKey(){return""+this.xSpan1.start+this.xSpan1.end+this.xSpan2.start+this.xSpan2.end}}class Ug{placeFeatures(e,t,a,o=!1){const s=new zr(t,a),f=t.getContextCoordinates(),h=t.getNavigationContext(),_=[];for(const d of e)for(let c of d.computeNavContextCoordinates(h))if(c=c.getOverlap(f),c){const D=o?s.baseSpanToXCenter(c):s.baseSpanToXSpan(c),{visiblePart:x,isReverse:m}=this._locatePlacement(d,h,c);_.push({feature:d,visiblePart:x,contextLocation:c,xSpan:D,isReverse:m})}return _}_locatePlacement(e,t,a){const o=t.convertBaseToFeatureCoordinate(a.start),s=o.getLocus().start,f=o.feature.getIsReverseStrand();let h;f?h=s-a.getLength()+1:h=s;const _=h-e.getLocus().start,d=Math.max(0,_);return{visiblePart:new an(e,d,d+a.getLength()),isReverse:f}}placeFeatureSegments(e,t){const a=e.xSpan.getLength()/e.contextLocation.getLength(),o=[];for(let s of t)if(s=s.getOverlap(e.visiblePart),s){const h=(s.relativeStart-e.visiblePart.relativeStart)*a,_=s.getLength()*a;let d;e.isReverse?d=e.xSpan.end-h-_:d=e.xSpan.start+h,o.push({segment:s,xSpan:new Ne(d,d+_)})}return o}placeInteractions(e,t,a){const o=new zr(t,a),s=t.getContextCoordinates(),f=t.getNavigationContext(),h=[];for(const _ of e){let d=f.convertGenomeIntervalToBases(_.locus1),c=f.convertGenomeIntervalToBases(_.locus2);d=d.map(D=>D.getOverlap(s)),c=c.map(D=>D.getOverlap(s));for(const D of d)for(const x of c)if(D&&x){const m=o.baseSpanToXSpan(D),B=o.baseSpanToXSpan(x);h.push(new Mg(_,m,B))}}return h}placeGraphNodes(e,t,a){const o=new zr(t,a),s=t.getContextCoordinates(),f=t.getNavigationContext(),h=[],_=[];for(const d of e)for(let c of d.computeNavContextCoordinates(f))if(c=c.getOverlap(s),c){const D=o.baseSpanToXSpan(c),{visiblePart:x,isReverse:m}=this._locatePlacement(d,f,c);h.push({feature:d,visiblePart:x,contextLocation:c,xSpan:D,isReverse:m})}else _.push(d);return{placements:h,nodesOutOfView:_}}}var Wg={rgb2hsl:wa,rgb2hsv:yu,rgb2hwb:ba,rgb2cmyk:ma,rgb2keyword:Da,rgb2xyz:so,rgb2lab:oo,rgb2lch:Gg,hsl2rgb:xu,hsl2hsv:qg,hsl2hwb:Hg,hsl2cmyk:Vg,hsl2keyword:Zg,hsv2rgb:Eu,hsv2hsl:Xg,hsv2hwb:Kg,hsv2cmyk:Yg,hsv2keyword:Qg,hwb2rgb:ya,hwb2hsl:Jg,hwb2hsv:jg,hwb2cmyk:zg,hwb2keyword:e_,cmyk2rgb:xa,cmyk2hsl:t_,cmyk2hsv:n_,cmyk2hwb:r_,cmyk2keyword:i_,keyword2rgb:ei,keyword2hsl:o_,keyword2hsv:f_,keyword2hwb:l_,keyword2cmyk:h_,keyword2lab:c_,keyword2xyz:d_,xyz2rgb:Jl,xyz2lab:jl,xyz2lch:a_,lab2xyz:fo,lab2rgb:zl,lab2lch:lo,lch2lab:ho,lch2xyz:u_,lch2rgb:s_};function wa(n){var e=n[0]/255,t=n[1]/255,a=n[2]/255,o=Math.min(e,t,a),s=Math.max(e,t,a),f=s-o,h,_,d;return s==o?h=0:e==s?h=(t-a)/f:t==s?h=2+(a-e)/f:a==s&&(h=4+(e-t)/f),h=Math.min(h*60,360),h<0&&(h+=360),d=(o+s)/2,s==o?_=0:d<=.5?_=f/(s+o):_=f/(2-s-o),[h,_*100,d*100]}function yu(n){var e=n[0],t=n[1],a=n[2],o=Math.min(e,t,a),s=Math.max(e,t,a),f=s-o,h,_,d;return s==0?_=0:_=f/s*1e3/10,s==o?h=0:e==s?h=(t-a)/f:t==s?h=2+(a-e)/f:a==s&&(h=4+(e-t)/f),h=Math.min(h*60,360),h<0&&(h+=360),d=s/255*1e3/10,[h,_,d]}function ba(n){var e=n[0],t=n[1],s=n[2],a=wa(n)[0],o=1/255*Math.min(e,Math.min(t,s)),s=1-1/255*Math.max(e,Math.max(t,s));return[a,o*100,s*100]}function ma(n){var e=n[0]/255,t=n[1]/255,a=n[2]/255,o,s,f,h;return h=Math.min(1-e,1-t,1-a),o=(1-e-h)/(1-h)||0,s=(1-t-h)/(1-h)||0,f=(1-a-h)/(1-h)||0,[o*100,s*100,f*100,h*100]}function Da(n){return eh[JSON.stringify(n)]}function so(n){var e=n[0]/255,t=n[1]/255,a=n[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92;var o=e*.4124+t*.3576+a*.1805,s=e*.2126+t*.7152+a*.0722,f=e*.0193+t*.1192+a*.9505;return[o*100,s*100,f*100]}function oo(n){var e=so(n),t=e[0],a=e[1],o=e[2],s,f,h;return t/=95.047,a/=100,o/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,s=116*a-16,f=500*(t-a),h=200*(a-o),[s,f,h]}function Gg(n){return lo(oo(n))}function xu(n){var e=n[0]/360,t=n[1]/100,a=n[2]/100,o,s,f,h,_;if(t==0)return _=a*255,[_,_,_];a<.5?s=a*(1+t):s=a+t-a*t,o=2*a-s,h=[0,0,0];for(var d=0;d<3;d++)f=e+1/3*-(d-1),f<0&&f++,f>1&&f--,6*f<1?_=o+(s-o)*6*f:2*f<1?_=s:3*f<2?_=o+(s-o)*(2/3-f)*6:_=o,h[d]=_*255;return h}function qg(n){var e=n[0],t=n[1]/100,a=n[2]/100,o,s;return a===0?[0,0,0]:(a*=2,t*=a<=1?a:2-a,s=(a+t)/2,o=2*t/(a+t),[e,o*100,s*100])}function Hg(n){return ba(xu(n))}function Vg(n){return ma(xu(n))}function Zg(n){return Da(xu(n))}function Eu(n){var e=n[0]/60,t=n[1]/100,_=n[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),s=255*_*(1-t),f=255*_*(1-t*o),h=255*_*(1-t*(1-o)),_=255*_;switch(a){case 0:return[_,h,s];case 1:return[f,_,s];case 2:return[s,_,h];case 3:return[s,f,_];case 4:return[h,s,_];case 5:return[_,s,f]}}function Xg(n){var e=n[0],t=n[1]/100,a=n[2]/100,o,s;return s=(2-t)*a,o=t*a,o/=s<=1?s:2-s,o=o||0,s/=2,[e,o*100,s*100]}function Kg(n){return ba(Eu(n))}function Yg(n){return ma(Eu(n))}function Qg(n){return Da(Eu(n))}function ya(n){var e=n[0]/360,t=n[1]/100,a=n[2]/100,o=t+a,s,f,h,_;switch(o>1&&(t/=o,a/=o),s=Math.floor(6*e),f=1-a,h=6*e-s,s&1&&(h=1-h),_=t+h*(f-t),s){default:case 6:case 0:r=f,g=_,b=t;break;case 1:r=_,g=f,b=t;break;case 2:r=t,g=f,b=_;break;case 3:r=t,g=_,b=f;break;case 4:r=_,g=t,b=f;break;case 5:r=f,g=t,b=_;break}return[r*255,g*255,b*255]}function Jg(n){return wa(ya(n))}function jg(n){return yu(ya(n))}function zg(n){return ma(ya(n))}function e_(n){return Da(ya(n))}function xa(n){var e=n[0]/100,t=n[1]/100,a=n[2]/100,o=n[3]/100,s,f,h;return s=1-Math.min(1,e*(1-o)+o),f=1-Math.min(1,t*(1-o)+o),h=1-Math.min(1,a*(1-o)+o),[s*255,f*255,h*255]}function t_(n){return wa(xa(n))}function n_(n){return yu(xa(n))}function r_(n){return ba(xa(n))}function i_(n){return Da(xa(n))}function Jl(n){var e=n[0]/100,t=n[1]/100,a=n[2]/100,o,s,f;return o=e*3.2406+t*-1.5372+a*-.4986,s=e*-.9689+t*1.8758+a*.0415,f=e*.0557+t*-.204+a*1.057,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s=s*12.92,f=f>.0031308?1.055*Math.pow(f,1/2.4)-.055:f=f*12.92,o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),f=Math.min(Math.max(0,f),1),[o*255,s*255,f*255]}function jl(n){var e=n[0],t=n[1],a=n[2],o,s,f;return e/=95.047,t/=100,a/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=116*t-16,s=500*(e-t),f=200*(t-a),[o,s,f]}function a_(n){return lo(jl(n))}function fo(n){var e=n[0],t=n[1],a=n[2],o,s,f,h;return e<=8?(s=e*100/903.3,h=7.787*(s/100)+16/116):(s=100*Math.pow((e+16)/116,3),h=Math.pow(s/100,1/3)),o=o/95.047<=.008856?o=95.047*(t/500+h-16/116)/7.787:95.047*Math.pow(t/500+h,3),f=f/108.883<=.008859?f=108.883*(h-a/200-16/116)/7.787:108.883*Math.pow(h-a/200,3),[o,s,f]}function lo(n){var e=n[0],t=n[1],a=n[2],o,s,f;return o=Math.atan2(a,t),s=o*360/2/Math.PI,s<0&&(s+=360),f=Math.sqrt(t*t+a*a),[e,f,s]}function zl(n){return Jl(fo(n))}function ho(n){var e=n[0],t=n[1],a=n[2],o,s,f;return f=a/360*2*Math.PI,o=t*Math.cos(f),s=t*Math.sin(f),[e,o,s]}function u_(n){return fo(ho(n))}function s_(n){return zl(ho(n))}function ei(n){return co[n]}function o_(n){return wa(ei(n))}function f_(n){return yu(ei(n))}function l_(n){return ba(ei(n))}function h_(n){return ma(ei(n))}function c_(n){return oo(ei(n))}function d_(n){return so(ei(n))}var co={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]},eh={};for(var th in co)eh[JSON.stringify(co[th])]=th;var po=Wg,ki=function(){return new Ca};for(var Ea in po){ki[Ea+"Raw"]=function(n){return function(e){return typeof e=="number"&&(e=Array.prototype.slice.call(arguments)),po[n](e)}}(Ea);var nh=/(\w+)2(\w+)/.exec(Ea),go=nh[1],p_=nh[2];ki[go]=ki[go]||{},ki[go][p_]=ki[Ea]=function(n){return function(e){typeof e=="number"&&(e=Array.prototype.slice.call(arguments));var t=po[n](e);if(typeof t=="string"||t===void 0)return t;for(var a=0;a<t.length;a++)t[a]=Math.round(t[a]);return t}}(Ea)}var Ca=function(){this.convs={}};Ca.prototype.routeSpace=function(n,e){var t=e[0];return t===void 0?this.getValues(n):(typeof t=="number"&&(t=Array.prototype.slice.call(e)),this.setValues(n,t))},Ca.prototype.setValues=function(n,e){return this.space=n,this.convs={},this.convs[n]=e,this},Ca.prototype.getValues=function(n){var e=this.convs[n];if(!e){var t=this.space,a=this.convs[t];e=ki[t][n](a),this.convs[n]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(n){Ca.prototype[n]=function(e){return this.routeSpace(n,arguments)}});const rh=globalThis||void 0||self;var bt=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof rh<"u"&&rh||{},It={searchParams:"URLSearchParams"in bt,iterable:"Symbol"in bt&&"iterator"in Symbol,blob:"FileReader"in bt&&"Blob"in bt&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in bt,arrayBuffer:"ArrayBuffer"in bt};function g_(n){return n&&DataView.prototype.isPrototypeOf(n)}if(It.arrayBuffer)var __=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v_=ArrayBuffer.isView||function(n){return n&&__.indexOf(Object.prototype.toString.call(n))>-1};function Ri(n){if(typeof n!="string"&&(n=String(n)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(n)||n==="")throw new TypeError('Invalid character in header field name: "'+n+'"');return n.toLowerCase()}function _o(n){return typeof n!="string"&&(n=String(n)),n}function vo(n){var e={next:function(){var t=n.shift();return{done:t===void 0,value:t}}};return It.iterable&&(e[Symbol.iterator]=function(){return e}),e}function ht(n){this.map={},n instanceof ht?n.forEach(function(e,t){this.append(t,e)},this):Array.isArray(n)?n.forEach(function(e){if(e.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):n&&Object.getOwnPropertyNames(n).forEach(function(e){this.append(e,n[e])},this)}ht.prototype.append=function(n,e){n=Ri(n),e=_o(e);var t=this.map[n];this.map[n]=t?t+", "+e:e},ht.prototype.delete=function(n){delete this.map[Ri(n)]},ht.prototype.get=function(n){return n=Ri(n),this.has(n)?this.map[n]:null},ht.prototype.has=function(n){return this.map.hasOwnProperty(Ri(n))},ht.prototype.set=function(n,e){this.map[Ri(n)]=_o(e)},ht.prototype.forEach=function(n,e){for(var t in this.map)this.map.hasOwnProperty(t)&&n.call(e,this.map[t],t,this)},ht.prototype.keys=function(){var n=[];return this.forEach(function(e,t){n.push(t)}),vo(n)},ht.prototype.values=function(){var n=[];return this.forEach(function(e){n.push(e)}),vo(n)},ht.prototype.entries=function(){var n=[];return this.forEach(function(e,t){n.push([t,e])}),vo(n)},It.iterable&&(ht.prototype[Symbol.iterator]=ht.prototype.entries);function wo(n){if(!n._noBody){if(n.bodyUsed)return Promise.reject(new TypeError("Already read"));n.bodyUsed=!0}}function ih(n){return new Promise(function(e,t){n.onload=function(){e(n.result)},n.onerror=function(){t(n.error)}})}function w_(n){var e=new FileReader,t=ih(e);return e.readAsArrayBuffer(n),t}function b_(n){var e=new FileReader,t=ih(e),a=/charset=([A-Za-z0-9_-]+)/.exec(n.type),o=a?a[1]:"utf-8";return e.readAsText(n,o),t}function m_(n){for(var e=new Uint8Array(n),t=new Array(e.length),a=0;a<e.length;a++)t[a]=String.fromCharCode(e[a]);return t.join("")}function ah(n){if(n.slice)return n.slice(0);var e=new Uint8Array(n.byteLength);return e.set(new Uint8Array(n)),e.buffer}function uh(){return this.bodyUsed=!1,this._initBody=function(n){this.bodyUsed=this.bodyUsed,this._bodyInit=n,n?typeof n=="string"?this._bodyText=n:It.blob&&Blob.prototype.isPrototypeOf(n)?this._bodyBlob=n:It.formData&&FormData.prototype.isPrototypeOf(n)?this._bodyFormData=n:It.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)?this._bodyText=n.toString():It.arrayBuffer&&It.blob&&g_(n)?(this._bodyArrayBuffer=ah(n.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):It.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(n)||v_(n))?this._bodyArrayBuffer=ah(n):this._bodyText=n=Object.prototype.toString.call(n):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof n=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):It.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},It.blob&&(this.blob=function(){var n=wo(this);if(n)return n;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var n=wo(this);return n||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(It.blob)return this.blob().then(w_);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var n=wo(this);if(n)return n;if(this._bodyBlob)return b_(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(m_(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},It.formData&&(this.formData=function(){return this.text().then(x_)}),this.json=function(){return this.text().then(JSON.parse)},this}var D_=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function y_(n){var e=n.toUpperCase();return D_.indexOf(e)>-1?e:n}function ti(n,e){if(!(this instanceof ti))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var t=e.body;if(n instanceof ti){if(n.bodyUsed)throw new TypeError("Already read");this.url=n.url,this.credentials=n.credentials,e.headers||(this.headers=new ht(n.headers)),this.method=n.method,this.mode=n.mode,this.signal=n.signal,!t&&n._bodyInit!=null&&(t=n._bodyInit,n.bodyUsed=!0)}else this.url=String(n);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new ht(e.headers)),this.method=y_(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in bt){var s=new AbortController;return s.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&t)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(t),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var a=/([?&])_=[^&]*/;if(a.test(this.url))this.url=this.url.replace(a,"$1_="+new Date().getTime());else{var o=/\?/;this.url+=(o.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}ti.prototype.clone=function(){return new ti(this,{body:this._bodyInit})};function x_(n){var e=new FormData;return n.trim().split("&").forEach(function(t){if(t){var a=t.split("="),o=a.shift().replace(/\+/g," "),s=a.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(s))}}),e}function E_(n){var e=new ht,t=n.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(a){return a.indexOf(`
41
- `)===0?a.substr(1,a.length):a}).forEach(function(a){var o=a.split(":"),s=o.shift().trim();if(s){var f=o.join(":").trim();try{e.append(s,f)}catch(h){console.warn("Response "+h.message)}}}),e}uh.call(ti.prototype);function Hn(n,e){if(!(this instanceof Hn))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new ht(e.headers),this.url=e.url||"",this._initBody(n)}uh.call(Hn.prototype),Hn.prototype.clone=function(){return new Hn(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new ht(this.headers),url:this.url})},Hn.error=function(){var n=new Hn(null,{status:200,statusText:""});return n.ok=!1,n.status=0,n.type="error",n};var C_=[301,302,303,307,308];Hn.redirect=function(n,e){if(C_.indexOf(e)===-1)throw new RangeError("Invalid status code");return new Hn(null,{status:e,headers:{location:n}})};var ni=bt.DOMException;try{new ni}catch{ni=function(e,t){this.message=e,this.name=t;var a=Error(e);this.stack=a.stack},ni.prototype=Object.create(Error.prototype),ni.prototype.constructor=ni}function sh(n,e){return new Promise(function(t,a){var o=new ti(n,e);if(o.signal&&o.signal.aborted)return a(new ni("Aborted","AbortError"));var s=new XMLHttpRequest;function f(){s.abort()}s.onload=function(){var d={statusText:s.statusText,headers:E_(s.getAllResponseHeaders()||"")};o.url.indexOf("file://")===0&&(s.status<200||s.status>599)?d.status=200:d.status=s.status,d.url="responseURL"in s?s.responseURL:d.headers.get("X-Request-URL");var c="response"in s?s.response:s.responseText;setTimeout(function(){t(new Hn(c,d))},0)},s.onerror=function(){setTimeout(function(){a(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){a(new TypeError("Network request timed out"))},0)},s.onabort=function(){setTimeout(function(){a(new ni("Aborted","AbortError"))},0)};function h(d){try{return d===""&&bt.location.href?bt.location.href:d}catch{return d}}if(s.open(o.method,h(o.url),!0),o.credentials==="include"?s.withCredentials=!0:o.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(It.blob?s.responseType="blob":It.arrayBuffer&&(s.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof ht||bt.Headers&&e.headers instanceof bt.Headers)){var _=[];Object.getOwnPropertyNames(e.headers).forEach(function(d){_.push(Ri(d)),s.setRequestHeader(d,_o(e.headers[d]))}),o.headers.forEach(function(d,c){_.indexOf(c)===-1&&s.setRequestHeader(c,d)})}else o.headers.forEach(function(d,c){s.setRequestHeader(c,d)});o.signal&&(o.signal.addEventListener("abort",f),s.onreadystatechange=function(){s.readyState===4&&o.signal.removeEventListener("abort",f)}),s.send(typeof o._bodyInit>"u"?null:o._bodyInit)})}sh.polyfill=!0,bt.fetch||(bt.fetch=sh,bt.Headers=ht,bt.Request=ti,bt.Response=Hn);var A_=self.fetch.bind(self),bo=wu(A_);function F_(n,e){if(n.length<=e)return n;const t=[];for(let a=0;a<e;a++){const o=a/e,s=Math.ceil(o*n.length);t.push(n[s])}return t}function Ni(n,e=!1){const t=n>=1e3?Math.floor(n):Math.round(n);return t>=75e4?`${(t/1e6).toFixed(1)} Mb`:t>=1e4?`${(t/1e3).toFixed(1)} Kb`:t>0?`${t} bp`:e?"<1 bp":"0 bp"}const B_=10,mo=5,oh=.99,S_=200,I_=5,T_=new Ug;class k_{constructor(e){ue(this,"primaryGenome");this.primaryGenome=e,this.multiAlign=Lg(this.multiAlign)}multiAlign(e,t){const{visRegion:a,visWidth:o,viewWindowRegion:s}=e,h=new zr(a,o).xWidthToBases(1)<B_;let _;if(h){const d=t,{newRecordsArray:c,allGaps:D}=this.refineRecordsArray(d,e);_=c;const x=this.calculatePrimaryVis(D,e);return _.reduce((m,B)=>({...m,[B.query]:B.isBigChain?this.alignRough(B.id,B.query,B.records,e):this.alignFine(B.id,B.query,B.records,e,x,D)}),{})}else return _=t,_.reduce((d,c)=>({...d,[c.query]:this.alignRough(c.id,c.query,c.records,e)}),{})}calculatePrimaryVis(e,t){const{visRegion:a,viewWindow:o,viewWindowRegion:s}=t,f=a.getNavigationContext(),h=new Ql(f);h.setGaps(e);const _=h.build(),d=F(a),c=F(s),D=o.getLength()/c.getWidth(),x=d.getWidth()*D,B=new zr(d,x).baseSpanToXSpan(c.getContextCoordinates());return{visRegion:d,visWidth:x,viewWindowRegion:c,viewWindow:B};function F(I){const[k,U]=I.getContextCoordinates();return new Ti(_,h.convertOldCoordinates(k),h.convertOldCoordinates(U))}}refineRecordsArray(e,t){const a=oh,o=[],s={};for(const d of e){const c=this._computeContextLocations(d.records,t),x=this._getPrimaryGenomeGaps(c,a).reduce((m,B)=>({...m,[B.contextBase]:B.length}),{});o.push({recordsObj:d,placements:c,primaryGapsObj:x});for(const m of Object.keys(x))m in s?s[m]=Math.max(s[m],x[m]):s[m]=x[m]}const f=[];for(const d of Object.keys(s))f.push({contextBase:Number(d),length:s[d]});if(f.sort((d,c)=>d.contextBase-c.contextBase),o.length>1)for(const d of o){const c=[];for(const D of Object.keys(s))if(D in d.primaryGapsObj){const x=s[D]-d.primaryGapsObj[D];x>0&&c.push({contextBase:Number(D),length:x})}else c.push({contextBase:Number(D),length:s[D]});c.sort((D,x)=>x.contextBase-D.contextBase);for(const D of c){const x="-".repeat(D.length),m=D.contextBase,B=d.placements.filter(F=>F.contextSpan.start<m&&F.contextSpan.end>m)[0];if(B){const F=B.visiblePart.getTargetSequence(),I=_(F,m-B.contextSpan.start),k=B.visiblePart.sequenceInterval.start+I,U=B.record.targetSeq,$=B.record.querySeq;B.record.targetSeq=U.slice(0,k)+x+U.slice(k),B.record.querySeq=$.slice(0,k)+x+$.slice(k)}}d.recordsObj.records=d.placements.map(D=>D.record)}return{newRecordsArray:o.map(d=>d.recordsObj),allGaps:f};function _(d,c){let D=0;for(const x of d)if(D++,x!==va&&c--,c===0)break;return D}}alignFine(e,t,a,o,s,f){const{visRegion:h,visWidth:_}=s,d=new zr(h,_),c=oh,D=o.visRegion.getNavigationContext(),x=this._computeContextLocations(a,o),m=new Ql(D);m.setGaps(f);for(const $ of x){const S=$.contextSpan,L=$.visiblePart,W=new Ne(m.convertOldCoordinates(S.start),m.convertOldCoordinates(S.end)),N=d.baseSpanToXSpan(W),q=L.getTargetSequence(),H=L.getQuerySequence();$.contextSpan=W,$.targetXSpan=N,$.queryXSpan=N,$.targetSegments=this._placeSequenceSegments(q,c,N.start,d),$.querySegments=this._placeSequenceSegments(H,c,N.start,d)}const B=[],F=new Do(mo),I=new Do(mo);for(let $=1;$<x.length;$++){const S=x[$-1],L=x[$],W=S.targetXSpan.end,N=L.targetXSpan.start,q=S.record.locus.chr,H=S.record.locus.end,Z=S.record.queryLocus.chr,Y=S.record.queryStrand,re=Y==="+"?S.record.queryLocus.end:S.record.queryLocus.start,se=L.record.locus.chr,fe=L.record.locus.start,ce=L.record.queryLocus.chr,Me=L.record.queryStrand,Fe=Me==="+"?L.record.queryLocus.start:L.record.queryLocus.end;let Ce;Z===ce?Y==="+"&&Me==="+"?(Ce=Fe>=re?"":"overlap ",Ce+=Ni(Math.abs(Fe-re))):Y==="-"&&Me==="-"?(Ce=re>=Fe?"":"overlap ",Ce+=Ni(Math.abs(re-Fe))):Ce="reverse direction":Ce="not connected";const vn=(W+N)/2,kt=(S.queryXSpan.end+L.queryXSpan.start)/2,tt=q===se?Ni(fe-H):"not connected",Pn=.5*(tt.length*5),Oe=vn-Pn,ke=vn+Pn,Dt=Oe<=W||ke>=N,Qt=Dt?F.place(new Ne(Oe,ke)):new Ne(Oe,ke),Rt=new Ne(W,N),vr=.5*(Ce.length*5),yt=kt-vr,Nt=kt+vr,bn=yt<=S.queryXSpan.end||Nt>=L.queryXSpan.start,Je=bn?I.place(new Ne(yt,Nt)):new Ne(yt,Nt),_t=new Ne(S.queryXSpan.end,L.queryXSpan.start);B.push({targetGapText:tt,targetXSpan:Rt,targetTextXSpan:Qt,queryGapText:Ce,queryXSpan:_t,queryTextXSpan:Je,shiftTarget:Dt,shiftQuery:bn})}const k=this._getQueryPieces(x),U=this._makeQueryGenomeRegion(k,_,d);return{id:e,isFineMode:!0,primaryVisData:s,queryRegion:U,drawData:x,drawGapText:B,primaryGenome:this.primaryGenome,queryGenome:t,basesPerPixel:d.xWidthToBases(1),navContextBuilder:m}}alignRough(e,t,a,o){const{visRegion:s,visWidth:f}=o,h=new zr(s,f),_=h.xWidthToBases(S_),c=a.reduce((F,I)=>F+(I.getIsReverseStrandQuery()?-1*I.getLength():I.getLength()),0)<0?"-":"+",D=this._computeContextLocations(a,o);let x=rt.mergeAdvanced(D,_,F=>F.visiblePart.getQueryLocus());x=x.sort((F,I)=>I.locus.getLength()-F.locus.getLength());const m=new Do(mo),B=[];for(const F of x){const I=F.locus,k=F.sources,U=h.basesToXWidth(I.getLength()),$=.5*U;if(U<I_)continue;const S=R_(k.map(fe=>fe.targetXSpan)),L=Math.min(...k.map(fe=>fe.targetXSpan.start)),W=Math.max(...k.map(fe=>fe.targetXSpan.end)),N=new Ne(L,W),q=S-$,H=S+$,Z=m.place(new Ne(q,H)),Y=k.map(fe=>fe.record.queryLocus),re=c==="-",se=this._placeInternalLoci(I,Y,Z,re,h);for(let fe=0;fe<Y.length;fe++)k[fe].queryXSpan=se[fe];B.push({queryFeature:new qn(void 0,I,c),targetXSpan:N,queryXSpan:Z,segments:k})}return{id:e,isFineMode:!1,primaryVisData:o,queryRegion:this._makeQueryGenomeRegion(B,f,h),drawData:B,plotStrand:c,primaryGenome:this.primaryGenome,queryGenome:t,basesPerPixel:h.xWidthToBases(1)}}_computeContextLocations(e,t){const{visRegion:a,visWidth:o}=t;return T_.placeFeatures(e,a,o).map(s=>({record:s.feature,visiblePart:uo.fromFeatureSegment(s.visiblePart),contextSpan:s.contextLocation,targetXSpan:s.xSpan,queryXSpan:null}))}_getPrimaryGenomeGaps(e,t){const a=[];for(const o of e){const{visiblePart:s,contextSpan:f}=o,h=Yl(s.getTargetSequence(),t,!0),_=ao(s.getTargetSequence(),f.start);for(const d of h)a.push({contextBase:_[d.index],length:d.length})}return a}_placeSequenceSegments(e,t,a,o){const s=Yl(e,t);s.sort((h,_)=>h.index-_.index);let f=a;for(const h of s){const _=h.isGap?h.length:Du(e.substr(h.index,h.length)),d=o.basesToXWidth(_);h.xSpan=new Ne(f,f+d),f+=d}return s}_getQueryPieces(e){const t=[];for(const a of e){const{record:o,visiblePart:s}=a,f=o.getIsReverseStrandQuery(),h=s.getQuerySequence();let _;f?_=ao(h,s.getQueryLocusFine().end,!0):_=ao(h,s.getQueryLocusFine().start);const d=o.queryLocus.chr;for(const c of a.querySegments){const{isGap:D,index:x,length:m,xSpan:B}=c;if(D)continue;const F=_[x],I=Du(h.substr(x,m));let k;f?k=new rt(d,F-I,F):k=new rt(d,F,F+I),t.push({queryFeature:new qn(void 0,k,o.queryStrand),queryXSpan:B})}}return t}_makeQueryGenomeRegion(e,t,a){const o=e.slice().sort((d,c)=>d.queryXSpan.start-c.queryXSpan.start),s=[];let f=0,h=new rt("",-1,-1);for(const d of o){const{queryXSpan:c,queryFeature:D}=d,x=D.getLocus(),m=c.start-f,B=Math.round(a.xWidthToBases(m));if(B>=1){const F=N_(x,h)?`${Ni(B)} gap`:void 0;s.push(In.makeGap(B,F))}s.push(D),f=c.end,h=x}const _=Math.round(a.xWidthToBases(t-f));return _>0&&s.push(In.makeGap(_)),new Ti(new In("",s))}_placeInternalLoci(e,t,a,o,s){const f=[];if(o)for(const h of t){const _=h.start-e.start,d=s.basesToXWidth(_),c=a.end-d,D=s.basesToXWidth(h.getLength()),x=c<a.end?c:a.end,m=c-D>a.start?c-D:a.start;f.push(new Ne(m,x))}else for(const h of t){const _=h.start-e.start,d=s.basesToXWidth(_),c=a.start+d,D=s.basesToXWidth(h.getLength()),x=c>a.start?c:a.start,m=c+D<a.end?c+D:a.end;f.push(new Ne(x,m))}return f}}class Do{constructor(e=0){ue(this,"leftExtent");ue(this,"rightExtent");ue(this,"margin");ue(this,"_placements");this.leftExtent=1/0,this.rightExtent=-1/0,this.margin=e,this._placements=[]}place(e){let t=e;if(this._placements.some(a=>a.getOverlap(e)!=null)){const a=.5*(e.start+e.end);t=Math.abs(a-this.leftExtent)<Math.abs(a-this.rightExtent)?new Ne(this.leftExtent-e.getLength(),this.leftExtent):new Ne(this.rightExtent,this.rightExtent+e.getLength())}return this._placements.push(t),t.start<this.leftExtent&&(this.leftExtent=t.start-this.margin),t.end>this.rightExtent&&(this.rightExtent=t.end+this.margin),t}retrievePlacements(){return this._placements}}function R_(n){const e=Xt.sumBy(n,a=>.5*a.getLength()*(a.start+a.end)),t=Xt.sumBy(n,a=>a.getLength());return e/t}function N_(n,e){return n.chr!==e.chr?!1:n.end===e.start||e.end===n.start}class $_{}class L_{constructor(){this.signals=new Set,this.abortController=new AbortController}addSignal(e=new $_){if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(e),e.aborted?this.handleAborted(e):typeof e.addEventListener=="function"&&e.addEventListener("abort",()=>{this.handleAborted(e)})}handleAborted(e){this.signals.delete(e),this.signals.size===0&&this.abortController.abort()}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}}class O_{constructor(){this.callbacks=new Set}addCallback(e=()=>{}){this.callbacks.add(e),e(this.currentMessage)}callback(e){this.currentMessage=e;for(const t of this.callbacks)t(e)}}class Aa{constructor({fill:e,cache:t}){if(typeof e!="function")throw new TypeError("must pass a fill function");if(typeof t!="object")throw new TypeError("must pass a cache object");if(typeof t.get!="function"||typeof t.set!="function"||typeof t.delete!="function")throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=t,this.fillCallback=e}static isAbortException(e){return e.name==="AbortError"||e.code==="ERR_ABORTED"||e.message==="AbortError: aborted"||e.message==="Error: aborted"}evict(e,t){this.cache.get(e)===t&&this.cache.delete(e)}fill(e,t,a,o){const s=new L_,f=new O_;f.addCallback(o);const h={aborter:s,promise:this.fillCallback(t,s.signal,_=>{f.callback(_)}),settled:!1,statusReporter:f,get aborted(){return this.aborter.signal.aborted}};h.aborter.addSignal(a),h.aborter.signal.addEventListener("abort",()=>{h.settled||this.evict(e,h)}),h.promise.then(()=>{h.settled=!0},()=>{h.settled=!0,this.evict(e,h)}).catch(_=>{throw console.error(_),_}),this.cache.set(e,h)}static checkSinglePromise(e,t){function a(){if(t!=null&&t.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return e.then(o=>(a(),o),o=>{throw a(),o})}has(e){return this.cache.has(e)}get(e,t,a,o){if(!a&&t instanceof AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");const s=this.cache.get(e);return s?s.aborted&&!s.settled?(this.evict(e,s),this.get(e,t,a,o)):s.settled?s.promise:(s.aborter.addSignal(a),s.statusReporter.addCallback(o),Aa.checkSinglePromise(s.promise,a)):(this.fill(e,t,a,o),Aa.checkSinglePromise(this.cache.get(e).promise,a))}delete(e){const t=this.cache.get(e);t&&(t.settled||t.aborter.abort(),this.cache.delete(e))}clear(){const e=this.cache.keys();let t=0;for(let a=e.next();!a.done;a=e.next())this.delete(a.value),t+=1;return t}}class P_{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,t){this.cache.set(e,t),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){const t=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,t),t}}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){const t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[e]of this)yield e}*values(){for(const[,e]of this)yield e}*[Symbol.iterator](){for(const e of this.cache)yield e;for(const e of this.oldCache){const[t]=e;this.cache.has(t)||(yield e)}}get size(){let e=0;for(const t of this.oldCache.keys())this.cache.has(t)||e++;return this._size+e}}var M_=P_,fh=wu(M_),lh={},Cu={};Cu.byteLength=G_,Cu.toByteArray=H_,Cu.fromByteArray=X_;for(var Vn=[],un=[],U_=typeof Uint8Array<"u"?Uint8Array:Array,yo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$i=0,W_=yo.length;$i<W_;++$i)Vn[$i]=yo[$i],un[yo.charCodeAt($i)]=$i;un[45]=62,un[95]=63;function hh(n){var e=n.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=n.indexOf("=");t===-1&&(t=e);var a=t===e?0:4-t%4;return[t,a]}function G_(n){var e=hh(n),t=e[0],a=e[1];return(t+a)*3/4-a}function q_(n,e,t){return(e+t)*3/4-t}function H_(n){var e,t=hh(n),a=t[0],o=t[1],s=new U_(q_(n,a,o)),f=0,h=o>0?a-4:a,_;for(_=0;_<h;_+=4)e=un[n.charCodeAt(_)]<<18|un[n.charCodeAt(_+1)]<<12|un[n.charCodeAt(_+2)]<<6|un[n.charCodeAt(_+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=e&255;return o===2&&(e=un[n.charCodeAt(_)]<<2|un[n.charCodeAt(_+1)]>>4,s[f++]=e&255),o===1&&(e=un[n.charCodeAt(_)]<<10|un[n.charCodeAt(_+1)]<<4|un[n.charCodeAt(_+2)]>>2,s[f++]=e>>8&255,s[f++]=e&255),s}function V_(n){return Vn[n>>18&63]+Vn[n>>12&63]+Vn[n>>6&63]+Vn[n&63]}function Z_(n,e,t){for(var a,o=[],s=e;s<t;s+=3)a=(n[s]<<16&16711680)+(n[s+1]<<8&65280)+(n[s+2]&255),o.push(V_(a));return o.join("")}function X_(n){for(var e,t=n.length,a=t%3,o=[],s=16383,f=0,h=t-a;f<h;f+=s)o.push(Z_(n,f,f+s>h?h:f+s));return a===1?(e=n[t-1],o.push(Vn[e>>2]+Vn[e<<4&63]+"==")):a===2&&(e=(n[t-2]<<8)+n[t-1],o.push(Vn[e>>10]+Vn[e>>4&63]+Vn[e<<2&63]+"=")),o.join("")}var xo={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */xo.read=function(n,e,t,a,o){var s,f,h=o*8-a-1,_=(1<<h)-1,d=_>>1,c=-7,D=t?o-1:0,x=t?-1:1,m=n[e+D];for(D+=x,s=m&(1<<-c)-1,m>>=-c,c+=h;c>0;s=s*256+n[e+D],D+=x,c-=8);for(f=s&(1<<-c)-1,s>>=-c,c+=a;c>0;f=f*256+n[e+D],D+=x,c-=8);if(s===0)s=1-d;else{if(s===_)return f?NaN:(m?-1:1)*(1/0);f=f+Math.pow(2,a),s=s-d}return(m?-1:1)*f*Math.pow(2,s-a)},xo.write=function(n,e,t,a,o,s){var f,h,_,d=s*8-o-1,c=(1<<d)-1,D=c>>1,x=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=a?0:s-1,B=a?1:-1,F=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(h=isNaN(e)?1:0,f=c):(f=Math.floor(Math.log(e)/Math.LN2),e*(_=Math.pow(2,-f))<1&&(f--,_*=2),f+D>=1?e+=x/_:e+=x*Math.pow(2,1-D),e*_>=2&&(f++,_/=2),f+D>=c?(h=0,f=c):f+D>=1?(h=(e*_-1)*Math.pow(2,o),f=f+D):(h=e*Math.pow(2,D-1)*Math.pow(2,o),f=0));o>=8;n[t+m]=h&255,m+=B,h/=256,o-=8);for(f=f<<o|h,d+=o;d>0;n[t+m]=f&255,m+=B,f/=256,d-=8);n[t+m-B]|=F*128};/*!
42
- * The buffer module from node.js, for the browser.
43
- *
44
- * @author Feross Aboukhadijeh <https://feross.org>
45
- * @license MIT
46
- */(function(n){const e=Cu,t=xo,a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=c,n.SlowBuffer=L,n.INSPECT_MAX_BYTES=50;const o=2147483647;n.kMaxLength=o;const{Uint8Array:s,ArrayBuffer:f,SharedArrayBuffer:h}=globalThis;c.TYPED_ARRAY_SUPPORT=_(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function _(){try{const E=new s(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,s.prototype),Object.setPrototypeOf(E,v),E.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function d(E){if(E>o)throw new RangeError('The value "'+E+'" is invalid for option "size"');const v=new s(E);return Object.setPrototypeOf(v,c.prototype),v}function c(E,v,w){if(typeof E=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return B(E)}return D(E,v,w)}c.poolSize=8192;function D(E,v,w){if(typeof E=="string")return F(E,v);if(f.isView(E))return k(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(At(E,f)||E&&At(E.buffer,f)||typeof h<"u"&&(At(E,h)||E&&At(E.buffer,h)))return U(E,v,w);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const T=E.valueOf&&E.valueOf();if(T!=null&&T!==E)return c.from(T,v,w);const P=$(E);if(P)return P;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return c.from(E[Symbol.toPrimitive]("string"),v,w);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}c.from=function(E,v,w){return D(E,v,w)},Object.setPrototypeOf(c.prototype,s.prototype),Object.setPrototypeOf(c,s);function x(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function m(E,v,w){return x(E),E<=0?d(E):v!==void 0?typeof w=="string"?d(E).fill(v,w):d(E).fill(v):d(E)}c.alloc=function(E,v,w){return m(E,v,w)};function B(E){return x(E),d(E<0?0:S(E)|0)}c.allocUnsafe=function(E){return B(E)},c.allocUnsafeSlow=function(E){return B(E)};function F(E,v){if((typeof v!="string"||v==="")&&(v="utf8"),!c.isEncoding(v))throw new TypeError("Unknown encoding: "+v);const w=W(E,v)|0;let T=d(w);const P=T.write(E,v);return P!==w&&(T=T.slice(0,P)),T}function I(E){const v=E.length<0?0:S(E.length)|0,w=d(v);for(let T=0;T<v;T+=1)w[T]=E[T]&255;return w}function k(E){if(At(E,s)){const v=new s(E);return U(v.buffer,v.byteOffset,v.byteLength)}return I(E)}function U(E,v,w){if(v<0||E.byteLength<v)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<v+(w||0))throw new RangeError('"length" is outside of buffer bounds');let T;return v===void 0&&w===void 0?T=new s(E):w===void 0?T=new s(E,v):T=new s(E,v,w),Object.setPrototypeOf(T,c.prototype),T}function $(E){if(c.isBuffer(E)){const v=S(E.length)|0,w=d(v);return w.length===0||E.copy(w,0,0,v),w}if(E.length!==void 0)return typeof E.length!="number"||ja(E.length)?d(0):I(E);if(E.type==="Buffer"&&Array.isArray(E.data))return I(E.data)}function S(E){if(E>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return E|0}function L(E){return+E!=E&&(E=0),c.alloc(+E)}c.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==c.prototype},c.compare=function(v,w){if(At(v,s)&&(v=c.from(v,v.offset,v.byteLength)),At(w,s)&&(w=c.from(w,w.offset,w.byteLength)),!c.isBuffer(v)||!c.isBuffer(w))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===w)return 0;let T=v.length,P=w.length;for(let V=0,Q=Math.min(T,P);V<Q;++V)if(v[V]!==w[V]){T=v[V],P=w[V];break}return T<P?-1:P<T?1:0},c.isEncoding=function(v){switch(String(v).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(v,w){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return c.alloc(0);let T;if(w===void 0)for(w=0,T=0;T<v.length;++T)w+=v[T].length;const P=c.allocUnsafe(w);let V=0;for(T=0;T<v.length;++T){let Q=v[T];if(At(Q,s))V+Q.length>P.length?(c.isBuffer(Q)||(Q=c.from(Q)),Q.copy(P,V)):s.prototype.set.call(P,Q,V);else if(c.isBuffer(Q))Q.copy(P,V);else throw new TypeError('"list" argument must be an Array of Buffers');V+=Q.length}return P};function W(E,v){if(c.isBuffer(E))return E.length;if(f.isView(E)||At(E,f))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const w=E.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&w===0)return 0;let P=!1;for(;;)switch(v){case"ascii":case"latin1":case"binary":return w;case"utf8":case"utf-8":return Jt(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w*2;case"hex":return w>>>1;case"base64":return br(E).length;default:if(P)return T?-1:Jt(E).length;v=(""+v).toLowerCase(),P=!0}}c.byteLength=W;function N(E,v,w){let T=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((w===void 0||w>this.length)&&(w=this.length),w<=0)||(w>>>=0,v>>>=0,w<=v))return"";for(E||(E="utf8");;)switch(E){case"hex":return Te(this,v,w);case"utf8":case"utf-8":return Fe(this,v,w);case"ascii":return kt(this,v,w);case"latin1":case"binary":return tt(this,v,w);case"base64":return Me(this,v,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pn(this,v,w);default:if(T)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),T=!0}}c.prototype._isBuffer=!0;function q(E,v,w){const T=E[v];E[v]=E[w],E[w]=T}c.prototype.swap16=function(){const v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let w=0;w<v;w+=2)q(this,w,w+1);return this},c.prototype.swap32=function(){const v=this.length;if(v%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let w=0;w<v;w+=4)q(this,w,w+3),q(this,w+1,w+2);return this},c.prototype.swap64=function(){const v=this.length;if(v%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let w=0;w<v;w+=8)q(this,w,w+7),q(this,w+1,w+6),q(this,w+2,w+5),q(this,w+3,w+4);return this},c.prototype.toString=function(){const v=this.length;return v===0?"":arguments.length===0?Fe(this,0,v):N.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(v){if(!c.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v?!0:c.compare(this,v)===0},c.prototype.inspect=function(){let v="";const w=n.INSPECT_MAX_BYTES;return v=this.toString("hex",0,w).replace(/(.{2})/g,"$1 ").trim(),this.length>w&&(v+=" ... "),"<Buffer "+v+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(v,w,T,P,V){if(At(v,s)&&(v=c.from(v,v.offset,v.byteLength)),!c.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(w===void 0&&(w=0),T===void 0&&(T=v?v.length:0),P===void 0&&(P=0),V===void 0&&(V=this.length),w<0||T>v.length||P<0||V>this.length)throw new RangeError("out of range index");if(P>=V&&w>=T)return 0;if(P>=V)return-1;if(w>=T)return 1;if(w>>>=0,T>>>=0,P>>>=0,V>>>=0,this===v)return 0;let Q=V-P,_e=T-w;const je=Math.min(Q,_e),He=this.slice(P,V),ze=v.slice(w,T);for(let $e=0;$e<je;++$e)if(He[$e]!==ze[$e]){Q=He[$e],_e=ze[$e];break}return Q<_e?-1:_e<Q?1:0};function H(E,v,w,T,P){if(E.length===0)return-1;if(typeof w=="string"?(T=w,w=0):w>2147483647?w=2147483647:w<-2147483648&&(w=-2147483648),w=+w,ja(w)&&(w=P?0:E.length-1),w<0&&(w=E.length+w),w>=E.length){if(P)return-1;w=E.length-1}else if(w<0)if(P)w=0;else return-1;if(typeof v=="string"&&(v=c.from(v,T)),c.isBuffer(v))return v.length===0?-1:Z(E,v,w,T,P);if(typeof v=="number")return v=v&255,typeof s.prototype.indexOf=="function"?P?s.prototype.indexOf.call(E,v,w):s.prototype.lastIndexOf.call(E,v,w):Z(E,[v],w,T,P);throw new TypeError("val must be string, number or Buffer")}function Z(E,v,w,T,P){let V=1,Q=E.length,_e=v.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(E.length<2||v.length<2)return-1;V=2,Q/=2,_e/=2,w/=2}function je(ze,$e){return V===1?ze[$e]:ze.readUInt16BE($e*V)}let He;if(P){let ze=-1;for(He=w;He<Q;He++)if(je(E,He)===je(v,ze===-1?0:He-ze)){if(ze===-1&&(ze=He),He-ze+1===_e)return ze*V}else ze!==-1&&(He-=He-ze),ze=-1}else for(w+_e>Q&&(w=Q-_e),He=w;He>=0;He--){let ze=!0;for(let $e=0;$e<_e;$e++)if(je(E,He+$e)!==je(v,$e)){ze=!1;break}if(ze)return He}return-1}c.prototype.includes=function(v,w,T){return this.indexOf(v,w,T)!==-1},c.prototype.indexOf=function(v,w,T){return H(this,v,w,T,!0)},c.prototype.lastIndexOf=function(v,w,T){return H(this,v,w,T,!1)};function Y(E,v,w,T){w=Number(w)||0;const P=E.length-w;T?(T=Number(T),T>P&&(T=P)):T=P;const V=v.length;T>V/2&&(T=V/2);let Q;for(Q=0;Q<T;++Q){const _e=parseInt(v.substr(Q*2,2),16);if(ja(_e))return Q;E[w+Q]=_e}return Q}function re(E,v,w,T){return zi(Jt(v,E.length-w),E,w,T)}function se(E,v,w,T){return zi(xt(v),E,w,T)}function fe(E,v,w,T){return zi(br(v),E,w,T)}function ce(E,v,w,T){return zi(mn(v,E.length-w),E,w,T)}c.prototype.write=function(v,w,T,P){if(w===void 0)P="utf8",T=this.length,w=0;else if(T===void 0&&typeof w=="string")P=w,T=this.length,w=0;else if(isFinite(w))w=w>>>0,isFinite(T)?(T=T>>>0,P===void 0&&(P="utf8")):(P=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const V=this.length-w;if((T===void 0||T>V)&&(T=V),v.length>0&&(T<0||w<0)||w>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let Q=!1;for(;;)switch(P){case"hex":return Y(this,v,w,T);case"utf8":case"utf-8":return re(this,v,w,T);case"ascii":case"latin1":case"binary":return se(this,v,w,T);case"base64":return fe(this,v,w,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(this,v,w,T);default:if(Q)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),Q=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Me(E,v,w){return v===0&&w===E.length?e.fromByteArray(E):e.fromByteArray(E.slice(v,w))}function Fe(E,v,w){w=Math.min(E.length,w);const T=[];let P=v;for(;P<w;){const V=E[P];let Q=null,_e=V>239?4:V>223?3:V>191?2:1;if(P+_e<=w){let je,He,ze,$e;switch(_e){case 1:V<128&&(Q=V);break;case 2:je=E[P+1],(je&192)===128&&($e=(V&31)<<6|je&63,$e>127&&(Q=$e));break;case 3:je=E[P+1],He=E[P+2],(je&192)===128&&(He&192)===128&&($e=(V&15)<<12|(je&63)<<6|He&63,$e>2047&&($e<55296||$e>57343)&&(Q=$e));break;case 4:je=E[P+1],He=E[P+2],ze=E[P+3],(je&192)===128&&(He&192)===128&&(ze&192)===128&&($e=(V&15)<<18|(je&63)<<12|(He&63)<<6|ze&63,$e>65535&&$e<1114112&&(Q=$e))}}Q===null?(Q=65533,_e=1):Q>65535&&(Q-=65536,T.push(Q>>>10&1023|55296),Q=56320|Q&1023),T.push(Q),P+=_e}return vn(T)}const Ce=4096;function vn(E){const v=E.length;if(v<=Ce)return String.fromCharCode.apply(String,E);let w="",T=0;for(;T<v;)w+=String.fromCharCode.apply(String,E.slice(T,T+=Ce));return w}function kt(E,v,w){let T="";w=Math.min(E.length,w);for(let P=v;P<w;++P)T+=String.fromCharCode(E[P]&127);return T}function tt(E,v,w){let T="";w=Math.min(E.length,w);for(let P=v;P<w;++P)T+=String.fromCharCode(E[P]);return T}function Te(E,v,w){const T=E.length;(!v||v<0)&&(v=0),(!w||w<0||w>T)&&(w=T);let P="";for(let V=v;V<w;++V)P+=mi[E[V]];return P}function Pn(E,v,w){const T=E.slice(v,w);let P="";for(let V=0;V<T.length-1;V+=2)P+=String.fromCharCode(T[V]+T[V+1]*256);return P}c.prototype.slice=function(v,w){const T=this.length;v=~~v,w=w===void 0?T:~~w,v<0?(v+=T,v<0&&(v=0)):v>T&&(v=T),w<0?(w+=T,w<0&&(w=0)):w>T&&(w=T),w<v&&(w=v);const P=this.subarray(v,w);return Object.setPrototypeOf(P,c.prototype),P};function Oe(E,v,w){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+v>w)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(v,w,T){v=v>>>0,w=w>>>0,T||Oe(v,w,this.length);let P=this[v],V=1,Q=0;for(;++Q<w&&(V*=256);)P+=this[v+Q]*V;return P},c.prototype.readUintBE=c.prototype.readUIntBE=function(v,w,T){v=v>>>0,w=w>>>0,T||Oe(v,w,this.length);let P=this[v+--w],V=1;for(;w>0&&(V*=256);)P+=this[v+--w]*V;return P},c.prototype.readUint8=c.prototype.readUInt8=function(v,w){return v=v>>>0,w||Oe(v,1,this.length),this[v]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(v,w){return v=v>>>0,w||Oe(v,2,this.length),this[v]|this[v+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(v,w){return v=v>>>0,w||Oe(v,2,this.length),this[v]<<8|this[v+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(v,w){return v=v>>>0,w||Oe(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(v,w){return v=v>>>0,w||Oe(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},c.prototype.readBigUInt64LE=$t(function(v){v=v>>>0,tr(v,"offset");const w=this[v],T=this[v+7];(w===void 0||T===void 0)&&vt(v,this.length-8);const P=w+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24,V=this[++v]+this[++v]*2**8+this[++v]*2**16+T*2**24;return BigInt(P)+(BigInt(V)<<BigInt(32))}),c.prototype.readBigUInt64BE=$t(function(v){v=v>>>0,tr(v,"offset");const w=this[v],T=this[v+7];(w===void 0||T===void 0)&&vt(v,this.length-8);const P=w*2**24+this[++v]*2**16+this[++v]*2**8+this[++v],V=this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+T;return(BigInt(P)<<BigInt(32))+BigInt(V)}),c.prototype.readIntLE=function(v,w,T){v=v>>>0,w=w>>>0,T||Oe(v,w,this.length);let P=this[v],V=1,Q=0;for(;++Q<w&&(V*=256);)P+=this[v+Q]*V;return V*=128,P>=V&&(P-=Math.pow(2,8*w)),P},c.prototype.readIntBE=function(v,w,T){v=v>>>0,w=w>>>0,T||Oe(v,w,this.length);let P=w,V=1,Q=this[v+--P];for(;P>0&&(V*=256);)Q+=this[v+--P]*V;return V*=128,Q>=V&&(Q-=Math.pow(2,8*w)),Q},c.prototype.readInt8=function(v,w){return v=v>>>0,w||Oe(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},c.prototype.readInt16LE=function(v,w){v=v>>>0,w||Oe(v,2,this.length);const T=this[v]|this[v+1]<<8;return T&32768?T|4294901760:T},c.prototype.readInt16BE=function(v,w){v=v>>>0,w||Oe(v,2,this.length);const T=this[v+1]|this[v]<<8;return T&32768?T|4294901760:T},c.prototype.readInt32LE=function(v,w){return v=v>>>0,w||Oe(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},c.prototype.readInt32BE=function(v,w){return v=v>>>0,w||Oe(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},c.prototype.readBigInt64LE=$t(function(v){v=v>>>0,tr(v,"offset");const w=this[v],T=this[v+7];(w===void 0||T===void 0)&&vt(v,this.length-8);const P=this[v+4]+this[v+5]*2**8+this[v+6]*2**16+(T<<24);return(BigInt(P)<<BigInt(32))+BigInt(w+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24)}),c.prototype.readBigInt64BE=$t(function(v){v=v>>>0,tr(v,"offset");const w=this[v],T=this[v+7];(w===void 0||T===void 0)&&vt(v,this.length-8);const P=(w<<24)+this[++v]*2**16+this[++v]*2**8+this[++v];return(BigInt(P)<<BigInt(32))+BigInt(this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+T)}),c.prototype.readFloatLE=function(v,w){return v=v>>>0,w||Oe(v,4,this.length),t.read(this,v,!0,23,4)},c.prototype.readFloatBE=function(v,w){return v=v>>>0,w||Oe(v,4,this.length),t.read(this,v,!1,23,4)},c.prototype.readDoubleLE=function(v,w){return v=v>>>0,w||Oe(v,8,this.length),t.read(this,v,!0,52,8)},c.prototype.readDoubleBE=function(v,w){return v=v>>>0,w||Oe(v,8,this.length),t.read(this,v,!1,52,8)};function ke(E,v,w,T,P,V){if(!c.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>P||v<V)throw new RangeError('"value" argument is out of bounds');if(w+T>E.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(v,w,T,P){if(v=+v,w=w>>>0,T=T>>>0,!P){const _e=Math.pow(2,8*T)-1;ke(this,v,w,T,_e,0)}let V=1,Q=0;for(this[w]=v&255;++Q<T&&(V*=256);)this[w+Q]=v/V&255;return w+T},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(v,w,T,P){if(v=+v,w=w>>>0,T=T>>>0,!P){const _e=Math.pow(2,8*T)-1;ke(this,v,w,T,_e,0)}let V=T-1,Q=1;for(this[w+V]=v&255;--V>=0&&(Q*=256);)this[w+V]=v/Q&255;return w+T},c.prototype.writeUint8=c.prototype.writeUInt8=function(v,w,T){return v=+v,w=w>>>0,T||ke(this,v,w,1,255,0),this[w]=v&255,w+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(v,w,T){return v=+v,w=w>>>0,T||ke(this,v,w,2,65535,0),this[w]=v&255,this[w+1]=v>>>8,w+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(v,w,T){return v=+v,w=w>>>0,T||ke(this,v,w,2,65535,0),this[w]=v>>>8,this[w+1]=v&255,w+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(v,w,T){return v=+v,w=w>>>0,T||ke(this,v,w,4,4294967295,0),this[w+3]=v>>>24,this[w+2]=v>>>16,this[w+1]=v>>>8,this[w]=v&255,w+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(v,w,T){return v=+v,w=w>>>0,T||ke(this,v,w,4,4294967295,0),this[w]=v>>>24,this[w+1]=v>>>16,this[w+2]=v>>>8,this[w+3]=v&255,w+4};function Dt(E,v,w,T,P){_t(v,T,P,E,w,7);let V=Number(v&BigInt(4294967295));E[w++]=V,V=V>>8,E[w++]=V,V=V>>8,E[w++]=V,V=V>>8,E[w++]=V;let Q=Number(v>>BigInt(32)&BigInt(4294967295));return E[w++]=Q,Q=Q>>8,E[w++]=Q,Q=Q>>8,E[w++]=Q,Q=Q>>8,E[w++]=Q,w}function Qt(E,v,w,T,P){_t(v,T,P,E,w,7);let V=Number(v&BigInt(4294967295));E[w+7]=V,V=V>>8,E[w+6]=V,V=V>>8,E[w+5]=V,V=V>>8,E[w+4]=V;let Q=Number(v>>BigInt(32)&BigInt(4294967295));return E[w+3]=Q,Q=Q>>8,E[w+2]=Q,Q=Q>>8,E[w+1]=Q,Q=Q>>8,E[w]=Q,w+8}c.prototype.writeBigUInt64LE=$t(function(v,w=0){return Dt(this,v,w,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=$t(function(v,w=0){return Qt(this,v,w,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(v,w,T,P){if(v=+v,w=w>>>0,!P){const je=Math.pow(2,8*T-1);ke(this,v,w,T,je-1,-je)}let V=0,Q=1,_e=0;for(this[w]=v&255;++V<T&&(Q*=256);)v<0&&_e===0&&this[w+V-1]!==0&&(_e=1),this[w+V]=(v/Q>>0)-_e&255;return w+T},c.prototype.writeIntBE=function(v,w,T,P){if(v=+v,w=w>>>0,!P){const je=Math.pow(2,8*T-1);ke(this,v,w,T,je-1,-je)}let V=T-1,Q=1,_e=0;for(this[w+V]=v&255;--V>=0&&(Q*=256);)v<0&&_e===0&&this[w+V+1]!==0&&(_e=1),this[w+V]=(v/Q>>0)-_e&255;return w+T},c.prototype.writeInt8=function(v,w,T){return v=+v,w=w>>>0,T||ke(this,v,w,1,127,-128),v<0&&(v=255+v+1),this[w]=v&255,w+1},c.prototype.writeInt16LE=function(v,w,T){return v=+v,w=w>>>0,T||ke(this,v,w,2,32767,-32768),this[w]=v&255,this[w+1]=v>>>8,w+2},c.prototype.writeInt16BE=function(v,w,T){return v=+v,w=w>>>0,T||ke(this,v,w,2,32767,-32768),this[w]=v>>>8,this[w+1]=v&255,w+2},c.prototype.writeInt32LE=function(v,w,T){return v=+v,w=w>>>0,T||ke(this,v,w,4,2147483647,-2147483648),this[w]=v&255,this[w+1]=v>>>8,this[w+2]=v>>>16,this[w+3]=v>>>24,w+4},c.prototype.writeInt32BE=function(v,w,T){return v=+v,w=w>>>0,T||ke(this,v,w,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[w]=v>>>24,this[w+1]=v>>>16,this[w+2]=v>>>8,this[w+3]=v&255,w+4},c.prototype.writeBigInt64LE=$t(function(v,w=0){return Dt(this,v,w,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=$t(function(v,w=0){return Qt(this,v,w,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Rt(E,v,w,T,P,V){if(w+T>E.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("Index out of range")}function wn(E,v,w,T,P){return v=+v,w=w>>>0,P||Rt(E,v,w,4),t.write(E,v,w,T,23,4),w+4}c.prototype.writeFloatLE=function(v,w,T){return wn(this,v,w,!0,T)},c.prototype.writeFloatBE=function(v,w,T){return wn(this,v,w,!1,T)};function vr(E,v,w,T,P){return v=+v,w=w>>>0,P||Rt(E,v,w,8),t.write(E,v,w,T,52,8),w+8}c.prototype.writeDoubleLE=function(v,w,T){return vr(this,v,w,!0,T)},c.prototype.writeDoubleBE=function(v,w,T){return vr(this,v,w,!1,T)},c.prototype.copy=function(v,w,T,P){if(!c.isBuffer(v))throw new TypeError("argument should be a Buffer");if(T||(T=0),!P&&P!==0&&(P=this.length),w>=v.length&&(w=v.length),w||(w=0),P>0&&P<T&&(P=T),P===T||v.length===0||this.length===0)return 0;if(w<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),v.length-w<P-T&&(P=v.length-w+T);const V=P-T;return this===v&&typeof s.prototype.copyWithin=="function"?this.copyWithin(w,T,P):s.prototype.set.call(v,this.subarray(T,P),w),V},c.prototype.fill=function(v,w,T,P){if(typeof v=="string"){if(typeof w=="string"?(P=w,w=0,T=this.length):typeof T=="string"&&(P=T,T=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!c.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(v.length===1){const Q=v.charCodeAt(0);(P==="utf8"&&Q<128||P==="latin1")&&(v=Q)}}else typeof v=="number"?v=v&255:typeof v=="boolean"&&(v=Number(v));if(w<0||this.length<w||this.length<T)throw new RangeError("Out of range index");if(T<=w)return this;w=w>>>0,T=T===void 0?this.length:T>>>0,v||(v=0);let V;if(typeof v=="number")for(V=w;V<T;++V)this[V]=v;else{const Q=c.isBuffer(v)?v:c.from(v,P),_e=Q.length;if(_e===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(V=0;V<T-w;++V)this[V+w]=Q[V%_e]}return this};const yt={};function Nt(E,v,w){yt[E]=class extends w{constructor(){super(),Object.defineProperty(this,"message",{value:v.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}Nt("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Nt("ERR_INVALID_ARG_TYPE",function(E,v){return`The "${E}" argument must be of type number. Received type ${typeof v}`},TypeError),Nt("ERR_OUT_OF_RANGE",function(E,v,w){let T=`The value of "${E}" is out of range.`,P=w;return Number.isInteger(w)&&Math.abs(w)>2**32?P=bn(String(w)):typeof w=="bigint"&&(P=String(w),(w>BigInt(2)**BigInt(32)||w<-(BigInt(2)**BigInt(32)))&&(P=bn(P)),P+="n"),T+=` It must be ${v}. Received ${P}`,T},RangeError);function bn(E){let v="",w=E.length;const T=E[0]==="-"?1:0;for(;w>=T+4;w-=3)v=`_${E.slice(w-3,w)}${v}`;return`${E.slice(0,w)}${v}`}function Je(E,v,w){tr(v,"offset"),(E[v]===void 0||E[v+w]===void 0)&&vt(v,E.length-(w+1))}function _t(E,v,w,T,P,V){if(E>w||E<v){const Q=typeof v=="bigint"?"n":"";let _e;throw v===0||v===BigInt(0)?_e=`>= 0${Q} and < 2${Q} ** ${(V+1)*8}${Q}`:_e=`>= -(2${Q} ** ${(V+1)*8-1}${Q}) and < 2 ** ${(V+1)*8-1}${Q}`,new yt.ERR_OUT_OF_RANGE("value",_e,E)}Je(T,P,V)}function tr(E,v){if(typeof E!="number")throw new yt.ERR_INVALID_ARG_TYPE(v,"number",E)}function vt(E,v,w){throw Math.floor(E)!==E?(tr(E,w),new yt.ERR_OUT_OF_RANGE("offset","an integer",E)):v<0?new yt.ERR_BUFFER_OUT_OF_BOUNDS:new yt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${v}`,E)}const wr=/[^+/0-9A-Za-z-_]/g;function bi(E){if(E=E.split("=")[0],E=E.trim().replace(wr,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function Jt(E,v){v=v||1/0;let w;const T=E.length;let P=null;const V=[];for(let Q=0;Q<T;++Q){if(w=E.charCodeAt(Q),w>55295&&w<57344){if(!P){if(w>56319){(v-=3)>-1&&V.push(239,191,189);continue}else if(Q+1===T){(v-=3)>-1&&V.push(239,191,189);continue}P=w;continue}if(w<56320){(v-=3)>-1&&V.push(239,191,189),P=w;continue}w=(P-55296<<10|w-56320)+65536}else P&&(v-=3)>-1&&V.push(239,191,189);if(P=null,w<128){if((v-=1)<0)break;V.push(w)}else if(w<2048){if((v-=2)<0)break;V.push(w>>6|192,w&63|128)}else if(w<65536){if((v-=3)<0)break;V.push(w>>12|224,w>>6&63|128,w&63|128)}else if(w<1114112){if((v-=4)<0)break;V.push(w>>18|240,w>>12&63|128,w>>6&63|128,w&63|128)}else throw new Error("Invalid code point")}return V}function xt(E){const v=[];for(let w=0;w<E.length;++w)v.push(E.charCodeAt(w)&255);return v}function mn(E,v){let w,T,P;const V=[];for(let Q=0;Q<E.length&&!((v-=2)<0);++Q)w=E.charCodeAt(Q),T=w>>8,P=w%256,V.push(P),V.push(T);return V}function br(E){return e.toByteArray(bi(E))}function zi(E,v,w,T){let P;for(P=0;P<T&&!(P+w>=v.length||P>=E.length);++P)v[P+w]=E[P];return P}function At(E,v){return E instanceof v||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===v.name}function ja(E){return E!==E}const mi=function(){const E="0123456789abcdef",v=new Array(256);for(let w=0;w<16;++w){const T=w*16;for(let P=0;P<16;++P)v[T+P]=E[w]+E[P]}return v}();function $t(E){return typeof BigInt>"u"?za:E}function za(){throw new Error("BigInt not supported")}})(lh);const Tn=lh.Buffer;var Fa={};function ch(n){return(typeof n=="object"&&n!==null&&"message"in n?n.message:`${n}`).replace(/\.$/,"")}class Zn{async getBufferFromResponse(e){const t=await e.arrayBuffer();return Tn.from(t)}constructor(e,t={}){this.baseOverrides={},this.url=e;const a=t.fetch||globalThis.fetch.bind(globalThis);if(!a)throw new TypeError("no fetch function supplied, and none found in global environment");t.overrides&&(this.baseOverrides=t.overrides),this.fetchImplementation=a}async fetch(e,t){let a;try{a=await this.fetchImplementation(e,t)}catch(o){if(`${o}`.includes("Failed to fetch")){console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);try{a=await this.fetchImplementation(e,{...t,cache:"reload"})}catch(s){throw new Error(`${ch(s)} fetching ${e}`,{cause:s})}}else throw new Error(`${ch(o)} fetching ${e}`,{cause:o})}return a}async read(e,t=0,a,o=0,s={}){const{headers:f={},signal:h,overrides:_={}}=s;a<1/0?f.range=`bytes=${o}-${o+a}`:a===1/0&&o!==0&&(f.range=`bytes=${o}-`);const d=await this.fetch(this.url,{...this.baseOverrides,..._,headers:{...f,..._.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:h});if(!d.ok)throw new Error(`HTTP ${d.status} fetching ${this.url}`);if(d.status===200&&o===0||d.status===206){const c=await this.getBufferFromResponse(d),D=c.copy(e,t,0,Math.min(a,c.length)),x=d.headers.get("content-range"),m=/\/(\d+)$/.exec(x||"");return m!=null&&m[1]&&(this._stat={size:parseInt(m[1],10)}),{bytesRead:D,buffer:e}}throw d.status===200?new Error(`${this.url} fetch returned status 200, expected 206`):new Error(`HTTP ${d.status} fetching ${this.url}`)}async readFile(e={}){let t,a;typeof e=="string"?(t=e,a={}):(t=e.encoding,a=e,delete a.encoding);const{headers:o={},signal:s,overrides:f={}}=a,h=await this.fetch(this.url,{headers:o,method:"GET",redirect:"follow",mode:"cors",signal:s,...this.baseOverrides,...f});if(h.status!==200)throw new Error(`HTTP ${h.status} fetching ${this.url}`);if(t==="utf8")return h.text();if(t)throw new Error(`unsupported encoding: ${t}`);return this.getBufferFromResponse(h)}async stat(){if(!this._stat){const e=Tn.allocUnsafe(10);if(await this.read(e,0,10,0),!this._stat)throw new Error(`unable to determine size of file at ${this.url}`)}return this._stat}async close(){}}function dh(n){const e=new FileReader;return new Promise((t,a)=>{e.onerror=()=>{e.abort(),a(new Error("problem reading blob"))},e.onabort=()=>{a(new Error("blob reading was aborted"))},e.onload=()=>{e.result&&typeof e.result!="string"?t(e.result):a(new Error("unknown error reading blob"))},e.readAsArrayBuffer(n)})}function K_(n){const e=new FileReader;return new Promise((t,a)=>{e.onerror=()=>{e.abort(),a(new Error("problem reading blob"))},e.onabort=()=>{a(new Error("blob reading was aborted"))},e.onload=()=>{e.result&&typeof e.result=="string"?t(e.result):a(new Error("unknown error reading blob"))},e.readAsText(n)})}class ph{constructor(e){this.blob=e,this.size=e.size}async read(e,t=0,a,o=0){if(!a)return{bytesRead:0,buffer:e};const s=o,f=s+a,h=await dh(this.blob.slice(s,f)),_=Tn.from(h);return{bytesRead:_.copy(e,t),buffer:_}}async readFile(e){const t=typeof e=="string"?e:e==null?void 0:e.encoding;if(t==="utf8")return K_(this.blob);if(t)throw new Error(`unsupported encoding: ${t}`);const a=await dh(this.blob);return Tn.from(a)}async stat(){return{size:this.size}}async close(){}}var fr={};(function(n){var e=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function t(s,f){return Object.prototype.hasOwnProperty.call(s,f)}n.assign=function(s){for(var f=Array.prototype.slice.call(arguments,1);f.length;){var h=f.shift();if(h){if(typeof h!="object")throw new TypeError(h+"must be non-object");for(var _ in h)t(h,_)&&(s[_]=h[_])}}return s},n.shrinkBuf=function(s,f){return s.length===f?s:s.subarray?s.subarray(0,f):(s.length=f,s)};var a={arraySet:function(s,f,h,_,d){if(f.subarray&&s.subarray){s.set(f.subarray(h,h+_),d);return}for(var c=0;c<_;c++)s[d+c]=f[h+c]},flattenChunks:function(s){var f,h,_,d,c,D;for(_=0,f=0,h=s.length;f<h;f++)_+=s[f].length;for(D=new Uint8Array(_),d=0,f=0,h=s.length;f<h;f++)c=s[f],D.set(c,d),d+=c.length;return D}},o={arraySet:function(s,f,h,_,d){for(var c=0;c<_;c++)s[d+c]=f[h+c]},flattenChunks:function(s){return[].concat.apply([],s)}};n.setTyped=function(s){s?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,a)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(e)})(fr);var Ba={},Xn={},Li={},Y_=fr,Q_=4,gh=0,_h=1,J_=2;function Oi(n){for(var e=n.length;--e>=0;)n[e]=0}var j_=0,vh=1,z_=2,e2=3,t2=258,Eo=29,Sa=256,Ia=Sa+1+Eo,Pi=30,Co=19,wh=2*Ia+1,ri=15,Ao=16,n2=7,Fo=256,bh=16,mh=17,Dh=18,Bo=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Au=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],r2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],yh=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],i2=512,lr=new Array((Ia+2)*2);Oi(lr);var Ta=new Array(Pi*2);Oi(Ta);var ka=new Array(i2);Oi(ka);var Ra=new Array(t2-e2+1);Oi(Ra);var So=new Array(Eo);Oi(So);var Fu=new Array(Pi);Oi(Fu);function Io(n,e,t,a,o){this.static_tree=n,this.extra_bits=e,this.extra_base=t,this.elems=a,this.max_length=o,this.has_stree=n&&n.length}var xh,Eh,Ch;function To(n,e){this.dyn_tree=n,this.max_code=0,this.stat_desc=e}function Ah(n){return n<256?ka[n]:ka[256+(n>>>7)]}function Na(n,e){n.pending_buf[n.pending++]=e&255,n.pending_buf[n.pending++]=e>>>8&255}function Mt(n,e,t){n.bi_valid>Ao-t?(n.bi_buf|=e<<n.bi_valid&65535,Na(n,n.bi_buf),n.bi_buf=e>>Ao-n.bi_valid,n.bi_valid+=t-Ao):(n.bi_buf|=e<<n.bi_valid&65535,n.bi_valid+=t)}function Kn(n,e,t){Mt(n,t[e*2],t[e*2+1])}function Fh(n,e){var t=0;do t|=n&1,n>>>=1,t<<=1;while(--e>0);return t>>>1}function a2(n){n.bi_valid===16?(Na(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=n.bi_buf&255,n.bi_buf>>=8,n.bi_valid-=8)}function u2(n,e){var t=e.dyn_tree,a=e.max_code,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,h=e.stat_desc.extra_base,_=e.stat_desc.max_length,d,c,D,x,m,B,F=0;for(x=0;x<=ri;x++)n.bl_count[x]=0;for(t[n.heap[n.heap_max]*2+1]=0,d=n.heap_max+1;d<wh;d++)c=n.heap[d],x=t[t[c*2+1]*2+1]+1,x>_&&(x=_,F++),t[c*2+1]=x,!(c>a)&&(n.bl_count[x]++,m=0,c>=h&&(m=f[c-h]),B=t[c*2],n.opt_len+=B*(x+m),s&&(n.static_len+=B*(o[c*2+1]+m)));if(F!==0){do{for(x=_-1;n.bl_count[x]===0;)x--;n.bl_count[x]--,n.bl_count[x+1]+=2,n.bl_count[_]--,F-=2}while(F>0);for(x=_;x!==0;x--)for(c=n.bl_count[x];c!==0;)D=n.heap[--d],!(D>a)&&(t[D*2+1]!==x&&(n.opt_len+=(x-t[D*2+1])*t[D*2],t[D*2+1]=x),c--)}}function Bh(n,e,t){var a=new Array(ri+1),o=0,s,f;for(s=1;s<=ri;s++)a[s]=o=o+t[s-1]<<1;for(f=0;f<=e;f++){var h=n[f*2+1];h!==0&&(n[f*2]=Fh(a[h]++,h))}}function s2(){var n,e,t,a,o,s=new Array(ri+1);for(t=0,a=0;a<Eo-1;a++)for(So[a]=t,n=0;n<1<<Bo[a];n++)Ra[t++]=a;for(Ra[t-1]=a,o=0,a=0;a<16;a++)for(Fu[a]=o,n=0;n<1<<Au[a];n++)ka[o++]=a;for(o>>=7;a<Pi;a++)for(Fu[a]=o<<7,n=0;n<1<<Au[a]-7;n++)ka[256+o++]=a;for(e=0;e<=ri;e++)s[e]=0;for(n=0;n<=143;)lr[n*2+1]=8,n++,s[8]++;for(;n<=255;)lr[n*2+1]=9,n++,s[9]++;for(;n<=279;)lr[n*2+1]=7,n++,s[7]++;for(;n<=287;)lr[n*2+1]=8,n++,s[8]++;for(Bh(lr,Ia+1,s),n=0;n<Pi;n++)Ta[n*2+1]=5,Ta[n*2]=Fh(n,5);xh=new Io(lr,Bo,Sa+1,Ia,ri),Eh=new Io(Ta,Au,0,Pi,ri),Ch=new Io(new Array(0),r2,0,Co,n2)}function Sh(n){var e;for(e=0;e<Ia;e++)n.dyn_ltree[e*2]=0;for(e=0;e<Pi;e++)n.dyn_dtree[e*2]=0;for(e=0;e<Co;e++)n.bl_tree[e*2]=0;n.dyn_ltree[Fo*2]=1,n.opt_len=n.static_len=0,n.last_lit=n.matches=0}function Ih(n){n.bi_valid>8?Na(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0}function o2(n,e,t,a){Ih(n),Na(n,t),Na(n,~t),Y_.arraySet(n.pending_buf,n.window,e,t,n.pending),n.pending+=t}function Th(n,e,t,a){var o=e*2,s=t*2;return n[o]<n[s]||n[o]===n[s]&&a[e]<=a[t]}function ko(n,e,t){for(var a=n.heap[t],o=t<<1;o<=n.heap_len&&(o<n.heap_len&&Th(e,n.heap[o+1],n.heap[o],n.depth)&&o++,!Th(e,a,n.heap[o],n.depth));)n.heap[t]=n.heap[o],t=o,o<<=1;n.heap[t]=a}function kh(n,e,t){var a,o,s=0,f,h;if(n.last_lit!==0)do a=n.pending_buf[n.d_buf+s*2]<<8|n.pending_buf[n.d_buf+s*2+1],o=n.pending_buf[n.l_buf+s],s++,a===0?Kn(n,o,e):(f=Ra[o],Kn(n,f+Sa+1,e),h=Bo[f],h!==0&&(o-=So[f],Mt(n,o,h)),a--,f=Ah(a),Kn(n,f,t),h=Au[f],h!==0&&(a-=Fu[f],Mt(n,a,h)));while(s<n.last_lit);Kn(n,Fo,e)}function Ro(n,e){var t=e.dyn_tree,a=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.elems,f,h,_=-1,d;for(n.heap_len=0,n.heap_max=wh,f=0;f<s;f++)t[f*2]!==0?(n.heap[++n.heap_len]=_=f,n.depth[f]=0):t[f*2+1]=0;for(;n.heap_len<2;)d=n.heap[++n.heap_len]=_<2?++_:0,t[d*2]=1,n.depth[d]=0,n.opt_len--,o&&(n.static_len-=a[d*2+1]);for(e.max_code=_,f=n.heap_len>>1;f>=1;f--)ko(n,t,f);d=s;do f=n.heap[1],n.heap[1]=n.heap[n.heap_len--],ko(n,t,1),h=n.heap[1],n.heap[--n.heap_max]=f,n.heap[--n.heap_max]=h,t[d*2]=t[f*2]+t[h*2],n.depth[d]=(n.depth[f]>=n.depth[h]?n.depth[f]:n.depth[h])+1,t[f*2+1]=t[h*2+1]=d,n.heap[1]=d++,ko(n,t,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],u2(n,e),Bh(t,_,n.bl_count)}function Rh(n,e,t){var a,o=-1,s,f=e[0*2+1],h=0,_=7,d=4;for(f===0&&(_=138,d=3),e[(t+1)*2+1]=65535,a=0;a<=t;a++)s=f,f=e[(a+1)*2+1],!(++h<_&&s===f)&&(h<d?n.bl_tree[s*2]+=h:s!==0?(s!==o&&n.bl_tree[s*2]++,n.bl_tree[bh*2]++):h<=10?n.bl_tree[mh*2]++:n.bl_tree[Dh*2]++,h=0,o=s,f===0?(_=138,d=3):s===f?(_=6,d=3):(_=7,d=4))}function Nh(n,e,t){var a,o=-1,s,f=e[0*2+1],h=0,_=7,d=4;for(f===0&&(_=138,d=3),a=0;a<=t;a++)if(s=f,f=e[(a+1)*2+1],!(++h<_&&s===f)){if(h<d)do Kn(n,s,n.bl_tree);while(--h!==0);else s!==0?(s!==o&&(Kn(n,s,n.bl_tree),h--),Kn(n,bh,n.bl_tree),Mt(n,h-3,2)):h<=10?(Kn(n,mh,n.bl_tree),Mt(n,h-3,3)):(Kn(n,Dh,n.bl_tree),Mt(n,h-11,7));h=0,o=s,f===0?(_=138,d=3):s===f?(_=6,d=3):(_=7,d=4)}}function f2(n){var e;for(Rh(n,n.dyn_ltree,n.l_desc.max_code),Rh(n,n.dyn_dtree,n.d_desc.max_code),Ro(n,n.bl_desc),e=Co-1;e>=3&&n.bl_tree[yh[e]*2+1]===0;e--);return n.opt_len+=3*(e+1)+5+5+4,e}function l2(n,e,t,a){var o;for(Mt(n,e-257,5),Mt(n,t-1,5),Mt(n,a-4,4),o=0;o<a;o++)Mt(n,n.bl_tree[yh[o]*2+1],3);Nh(n,n.dyn_ltree,e-1),Nh(n,n.dyn_dtree,t-1)}function h2(n){var e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&n.dyn_ltree[t*2]!==0)return gh;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return _h;for(t=32;t<Sa;t++)if(n.dyn_ltree[t*2]!==0)return _h;return gh}var $h=!1;function c2(n){$h||(s2(),$h=!0),n.l_desc=new To(n.dyn_ltree,xh),n.d_desc=new To(n.dyn_dtree,Eh),n.bl_desc=new To(n.bl_tree,Ch),n.bi_buf=0,n.bi_valid=0,Sh(n)}function Lh(n,e,t,a){Mt(n,(j_<<1)+(a?1:0),3),o2(n,e,t)}function d2(n){Mt(n,vh<<1,3),Kn(n,Fo,lr),a2(n)}function p2(n,e,t,a){var o,s,f=0;n.level>0?(n.strm.data_type===J_&&(n.strm.data_type=h2(n)),Ro(n,n.l_desc),Ro(n,n.d_desc),f=f2(n),o=n.opt_len+3+7>>>3,s=n.static_len+3+7>>>3,s<=o&&(o=s)):o=s=t+5,t+4<=o&&e!==-1?Lh(n,e,t,a):n.strategy===Q_||s===o?(Mt(n,(vh<<1)+(a?1:0),3),kh(n,lr,Ta)):(Mt(n,(z_<<1)+(a?1:0),3),l2(n,n.l_desc.max_code+1,n.d_desc.max_code+1,f+1),kh(n,n.dyn_ltree,n.dyn_dtree)),Sh(n),a&&Ih(n)}function g2(n,e,t){return n.pending_buf[n.d_buf+n.last_lit*2]=e>>>8&255,n.pending_buf[n.d_buf+n.last_lit*2+1]=e&255,n.pending_buf[n.l_buf+n.last_lit]=t&255,n.last_lit++,e===0?n.dyn_ltree[t*2]++:(n.matches++,e--,n.dyn_ltree[(Ra[t]+Sa+1)*2]++,n.dyn_dtree[Ah(e)*2]++),n.last_lit===n.lit_bufsize-1}Li._tr_init=c2,Li._tr_stored_block=Lh,Li._tr_flush_block=p2,Li._tr_tally=g2,Li._tr_align=d2;function _2(n,e,t,a){for(var o=n&65535|0,s=n>>>16&65535|0,f=0;t!==0;){f=t>2e3?2e3:t,t-=f;do o=o+e[a++]|0,s=s+o|0;while(--f);o%=65521,s%=65521}return o|s<<16|0}var Oh=_2;function v2(){for(var n,e=[],t=0;t<256;t++){n=t;for(var a=0;a<8;a++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}var w2=v2();function b2(n,e,t,a){var o=w2,s=a+t;n^=-1;for(var f=a;f<s;f++)n=n>>>8^o[(n^e[f])&255];return n^-1}var Ph=b2,No={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Tt=fr,sn=Li,Mh=Oh,Ir=Ph,m2=No,ii=0,D2=1,y2=3,Tr=4,Uh=5,Yn=0,Wh=1,on=-2,x2=-3,$o=-5,E2=-1,C2=1,Bu=2,A2=3,F2=4,B2=0,S2=2,Su=8,I2=9,T2=15,k2=8,R2=29,N2=256,Lo=N2+1+R2,$2=30,L2=19,O2=2*Lo+1,P2=15,Ee=3,kr=258,kn=kr+Ee+1,M2=32,Iu=42,Oo=69,Tu=73,ku=91,Ru=103,ai=113,$a=666,ct=1,La=2,ui=3,Mi=4,U2=3;function Rr(n,e){return n.msg=m2[e],e}function Gh(n){return(n<<1)-(n>4?9:0)}function Nr(n){for(var e=n.length;--e>=0;)n[e]=0}function $r(n){var e=n.state,t=e.pending;t>n.avail_out&&(t=n.avail_out),t!==0&&(Tt.arraySet(n.output,e.pending_buf,e.pending_out,t,n.next_out),n.next_out+=t,e.pending_out+=t,n.total_out+=t,n.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))}function mt(n,e){sn._tr_flush_block(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,e),n.block_start=n.strstart,$r(n.strm)}function Se(n,e){n.pending_buf[n.pending++]=e}function Oa(n,e){n.pending_buf[n.pending++]=e>>>8&255,n.pending_buf[n.pending++]=e&255}function W2(n,e,t,a){var o=n.avail_in;return o>a&&(o=a),o===0?0:(n.avail_in-=o,Tt.arraySet(e,n.input,n.next_in,o,t),n.state.wrap===1?n.adler=Mh(n.adler,e,o,t):n.state.wrap===2&&(n.adler=Ir(n.adler,e,o,t)),n.next_in+=o,n.total_in+=o,o)}function qh(n,e){var t=n.max_chain_length,a=n.strstart,o,s,f=n.prev_length,h=n.nice_match,_=n.strstart>n.w_size-kn?n.strstart-(n.w_size-kn):0,d=n.window,c=n.w_mask,D=n.prev,x=n.strstart+kr,m=d[a+f-1],B=d[a+f];n.prev_length>=n.good_match&&(t>>=2),h>n.lookahead&&(h=n.lookahead);do if(o=e,!(d[o+f]!==B||d[o+f-1]!==m||d[o]!==d[a]||d[++o]!==d[a+1])){a+=2,o++;do;while(d[++a]===d[++o]&&d[++a]===d[++o]&&d[++a]===d[++o]&&d[++a]===d[++o]&&d[++a]===d[++o]&&d[++a]===d[++o]&&d[++a]===d[++o]&&d[++a]===d[++o]&&a<x);if(s=kr-(x-a),a=x-kr,s>f){if(n.match_start=e,f=s,s>=h)break;m=d[a+f-1],B=d[a+f]}}while((e=D[e&c])>_&&--t!==0);return f<=n.lookahead?f:n.lookahead}function si(n){var e=n.w_size,t,a,o,s,f;do{if(s=n.window_size-n.lookahead-n.strstart,n.strstart>=e+(e-kn)){Tt.arraySet(n.window,n.window,e,e,0),n.match_start-=e,n.strstart-=e,n.block_start-=e,a=n.hash_size,t=a;do o=n.head[--t],n.head[t]=o>=e?o-e:0;while(--a);a=e,t=a;do o=n.prev[--t],n.prev[t]=o>=e?o-e:0;while(--a);s+=e}if(n.strm.avail_in===0)break;if(a=W2(n.strm,n.window,n.strstart+n.lookahead,s),n.lookahead+=a,n.lookahead+n.insert>=Ee)for(f=n.strstart-n.insert,n.ins_h=n.window[f],n.ins_h=(n.ins_h<<n.hash_shift^n.window[f+1])&n.hash_mask;n.insert&&(n.ins_h=(n.ins_h<<n.hash_shift^n.window[f+Ee-1])&n.hash_mask,n.prev[f&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=f,f++,n.insert--,!(n.lookahead+n.insert<Ee)););}while(n.lookahead<kn&&n.strm.avail_in!==0)}function G2(n,e){var t=65535;for(t>n.pending_buf_size-5&&(t=n.pending_buf_size-5);;){if(n.lookahead<=1){if(si(n),n.lookahead===0&&e===ii)return ct;if(n.lookahead===0)break}n.strstart+=n.lookahead,n.lookahead=0;var a=n.block_start+t;if((n.strstart===0||n.strstart>=a)&&(n.lookahead=n.strstart-a,n.strstart=a,mt(n,!1),n.strm.avail_out===0)||n.strstart-n.block_start>=n.w_size-kn&&(mt(n,!1),n.strm.avail_out===0))return ct}return n.insert=0,e===Tr?(mt(n,!0),n.strm.avail_out===0?ui:Mi):(n.strstart>n.block_start&&(mt(n,!1),n.strm.avail_out===0),ct)}function Po(n,e){for(var t,a;;){if(n.lookahead<kn){if(si(n),n.lookahead<kn&&e===ii)return ct;if(n.lookahead===0)break}if(t=0,n.lookahead>=Ee&&(n.ins_h=(n.ins_h<<n.hash_shift^n.window[n.strstart+Ee-1])&n.hash_mask,t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),t!==0&&n.strstart-t<=n.w_size-kn&&(n.match_length=qh(n,t)),n.match_length>=Ee)if(a=sn._tr_tally(n,n.strstart-n.match_start,n.match_length-Ee),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=Ee){n.match_length--;do n.strstart++,n.ins_h=(n.ins_h<<n.hash_shift^n.window[n.strstart+Ee-1])&n.hash_mask,t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart;while(--n.match_length!==0);n.strstart++}else n.strstart+=n.match_length,n.match_length=0,n.ins_h=n.window[n.strstart],n.ins_h=(n.ins_h<<n.hash_shift^n.window[n.strstart+1])&n.hash_mask;else a=sn._tr_tally(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(a&&(mt(n,!1),n.strm.avail_out===0))return ct}return n.insert=n.strstart<Ee-1?n.strstart:Ee-1,e===Tr?(mt(n,!0),n.strm.avail_out===0?ui:Mi):n.last_lit&&(mt(n,!1),n.strm.avail_out===0)?ct:La}function Ui(n,e){for(var t,a,o;;){if(n.lookahead<kn){if(si(n),n.lookahead<kn&&e===ii)return ct;if(n.lookahead===0)break}if(t=0,n.lookahead>=Ee&&(n.ins_h=(n.ins_h<<n.hash_shift^n.window[n.strstart+Ee-1])&n.hash_mask,t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),n.prev_length=n.match_length,n.prev_match=n.match_start,n.match_length=Ee-1,t!==0&&n.prev_length<n.max_lazy_match&&n.strstart-t<=n.w_size-kn&&(n.match_length=qh(n,t),n.match_length<=5&&(n.strategy===C2||n.match_length===Ee&&n.strstart-n.match_start>4096)&&(n.match_length=Ee-1)),n.prev_length>=Ee&&n.match_length<=n.prev_length){o=n.strstart+n.lookahead-Ee,a=sn._tr_tally(n,n.strstart-1-n.prev_match,n.prev_length-Ee),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=o&&(n.ins_h=(n.ins_h<<n.hash_shift^n.window[n.strstart+Ee-1])&n.hash_mask,t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart);while(--n.prev_length!==0);if(n.match_available=0,n.match_length=Ee-1,n.strstart++,a&&(mt(n,!1),n.strm.avail_out===0))return ct}else if(n.match_available){if(a=sn._tr_tally(n,0,n.window[n.strstart-1]),a&&mt(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return ct}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(a=sn._tr_tally(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart<Ee-1?n.strstart:Ee-1,e===Tr?(mt(n,!0),n.strm.avail_out===0?ui:Mi):n.last_lit&&(mt(n,!1),n.strm.avail_out===0)?ct:La}function q2(n,e){for(var t,a,o,s,f=n.window;;){if(n.lookahead<=kr){if(si(n),n.lookahead<=kr&&e===ii)return ct;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=Ee&&n.strstart>0&&(o=n.strstart-1,a=f[o],a===f[++o]&&a===f[++o]&&a===f[++o])){s=n.strstart+kr;do;while(a===f[++o]&&a===f[++o]&&a===f[++o]&&a===f[++o]&&a===f[++o]&&a===f[++o]&&a===f[++o]&&a===f[++o]&&o<s);n.match_length=kr-(s-o),n.match_length>n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=Ee?(t=sn._tr_tally(n,1,n.match_length-Ee),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(t=sn._tr_tally(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),t&&(mt(n,!1),n.strm.avail_out===0))return ct}return n.insert=0,e===Tr?(mt(n,!0),n.strm.avail_out===0?ui:Mi):n.last_lit&&(mt(n,!1),n.strm.avail_out===0)?ct:La}function H2(n,e){for(var t;;){if(n.lookahead===0&&(si(n),n.lookahead===0)){if(e===ii)return ct;break}if(n.match_length=0,t=sn._tr_tally(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,t&&(mt(n,!1),n.strm.avail_out===0))return ct}return n.insert=0,e===Tr?(mt(n,!0),n.strm.avail_out===0?ui:Mi):n.last_lit&&(mt(n,!1),n.strm.avail_out===0)?ct:La}function Qn(n,e,t,a,o){this.good_length=n,this.max_lazy=e,this.nice_length=t,this.max_chain=a,this.func=o}var Wi;Wi=[new Qn(0,0,0,0,G2),new Qn(4,4,8,4,Po),new Qn(4,5,16,8,Po),new Qn(4,6,32,32,Po),new Qn(4,4,16,16,Ui),new Qn(8,16,32,32,Ui),new Qn(8,16,128,128,Ui),new Qn(8,32,128,256,Ui),new Qn(32,128,258,1024,Ui),new Qn(32,258,258,4096,Ui)];function V2(n){n.window_size=2*n.w_size,Nr(n.head),n.max_lazy_match=Wi[n.level].max_lazy,n.good_match=Wi[n.level].good_length,n.nice_match=Wi[n.level].nice_length,n.max_chain_length=Wi[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=Ee-1,n.match_available=0,n.ins_h=0}function Z2(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Su,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Tt.Buf16(O2*2),this.dyn_dtree=new Tt.Buf16((2*$2+1)*2),this.bl_tree=new Tt.Buf16((2*L2+1)*2),Nr(this.dyn_ltree),Nr(this.dyn_dtree),Nr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Tt.Buf16(P2+1),this.heap=new Tt.Buf16(2*Lo+1),Nr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Tt.Buf16(2*Lo+1),Nr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Hh(n){var e;return!n||!n.state?Rr(n,on):(n.total_in=n.total_out=0,n.data_type=S2,e=n.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?Iu:ai,n.adler=e.wrap===2?0:1,e.last_flush=ii,sn._tr_init(e),Yn)}function Vh(n){var e=Hh(n);return e===Yn&&V2(n.state),e}function X2(n,e){return!n||!n.state||n.state.wrap!==2?on:(n.state.gzhead=e,Yn)}function Zh(n,e,t,a,o,s){if(!n)return on;var f=1;if(e===E2&&(e=6),a<0?(f=0,a=-a):a>15&&(f=2,a-=16),o<1||o>I2||t!==Su||a<8||a>15||e<0||e>9||s<0||s>F2)return Rr(n,on);a===8&&(a=9);var h=new Z2;return n.state=h,h.strm=n,h.wrap=f,h.gzhead=null,h.w_bits=a,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=o+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+Ee-1)/Ee),h.window=new Tt.Buf8(h.w_size*2),h.head=new Tt.Buf16(h.hash_size),h.prev=new Tt.Buf16(h.w_size),h.lit_bufsize=1<<o+6,h.pending_buf_size=h.lit_bufsize*4,h.pending_buf=new Tt.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=s,h.method=t,Vh(n)}function K2(n,e){return Zh(n,e,Su,T2,k2,B2)}function Y2(n,e){var t,a,o,s;if(!n||!n.state||e>Uh||e<0)return n?Rr(n,on):on;if(a=n.state,!n.output||!n.input&&n.avail_in!==0||a.status===$a&&e!==Tr)return Rr(n,n.avail_out===0?$o:on);if(a.strm=n,t=a.last_flush,a.last_flush=e,a.status===Iu)if(a.wrap===2)n.adler=0,Se(a,31),Se(a,139),Se(a,8),a.gzhead?(Se(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),Se(a,a.gzhead.time&255),Se(a,a.gzhead.time>>8&255),Se(a,a.gzhead.time>>16&255),Se(a,a.gzhead.time>>24&255),Se(a,a.level===9?2:a.strategy>=Bu||a.level<2?4:0),Se(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(Se(a,a.gzhead.extra.length&255),Se(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(n.adler=Ir(n.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=Oo):(Se(a,0),Se(a,0),Se(a,0),Se(a,0),Se(a,0),Se(a,a.level===9?2:a.strategy>=Bu||a.level<2?4:0),Se(a,U2),a.status=ai);else{var f=Su+(a.w_bits-8<<4)<<8,h=-1;a.strategy>=Bu||a.level<2?h=0:a.level<6?h=1:a.level===6?h=2:h=3,f|=h<<6,a.strstart!==0&&(f|=M2),f+=31-f%31,a.status=ai,Oa(a,f),a.strstart!==0&&(Oa(a,n.adler>>>16),Oa(a,n.adler&65535)),n.adler=1}if(a.status===Oo)if(a.gzhead.extra){for(o=a.pending;a.gzindex<(a.gzhead.extra.length&65535)&&!(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(n.adler=Ir(n.adler,a.pending_buf,a.pending-o,o)),$r(n),o=a.pending,a.pending===a.pending_buf_size));)Se(a,a.gzhead.extra[a.gzindex]&255),a.gzindex++;a.gzhead.hcrc&&a.pending>o&&(n.adler=Ir(n.adler,a.pending_buf,a.pending-o,o)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=Tu)}else a.status=Tu;if(a.status===Tu)if(a.gzhead.name){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(n.adler=Ir(n.adler,a.pending_buf,a.pending-o,o)),$r(n),o=a.pending,a.pending===a.pending_buf_size)){s=1;break}a.gzindex<a.gzhead.name.length?s=a.gzhead.name.charCodeAt(a.gzindex++)&255:s=0,Se(a,s)}while(s!==0);a.gzhead.hcrc&&a.pending>o&&(n.adler=Ir(n.adler,a.pending_buf,a.pending-o,o)),s===0&&(a.gzindex=0,a.status=ku)}else a.status=ku;if(a.status===ku)if(a.gzhead.comment){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(n.adler=Ir(n.adler,a.pending_buf,a.pending-o,o)),$r(n),o=a.pending,a.pending===a.pending_buf_size)){s=1;break}a.gzindex<a.gzhead.comment.length?s=a.gzhead.comment.charCodeAt(a.gzindex++)&255:s=0,Se(a,s)}while(s!==0);a.gzhead.hcrc&&a.pending>o&&(n.adler=Ir(n.adler,a.pending_buf,a.pending-o,o)),s===0&&(a.status=Ru)}else a.status=Ru;if(a.status===Ru&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&$r(n),a.pending+2<=a.pending_buf_size&&(Se(a,n.adler&255),Se(a,n.adler>>8&255),n.adler=0,a.status=ai)):a.status=ai),a.pending!==0){if($r(n),n.avail_out===0)return a.last_flush=-1,Yn}else if(n.avail_in===0&&Gh(e)<=Gh(t)&&e!==Tr)return Rr(n,$o);if(a.status===$a&&n.avail_in!==0)return Rr(n,$o);if(n.avail_in!==0||a.lookahead!==0||e!==ii&&a.status!==$a){var _=a.strategy===Bu?H2(a,e):a.strategy===A2?q2(a,e):Wi[a.level].func(a,e);if((_===ui||_===Mi)&&(a.status=$a),_===ct||_===ui)return n.avail_out===0&&(a.last_flush=-1),Yn;if(_===La&&(e===D2?sn._tr_align(a):e!==Uh&&(sn._tr_stored_block(a,0,0,!1),e===y2&&(Nr(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),$r(n),n.avail_out===0))return a.last_flush=-1,Yn}return e!==Tr?Yn:a.wrap<=0?Wh:(a.wrap===2?(Se(a,n.adler&255),Se(a,n.adler>>8&255),Se(a,n.adler>>16&255),Se(a,n.adler>>24&255),Se(a,n.total_in&255),Se(a,n.total_in>>8&255),Se(a,n.total_in>>16&255),Se(a,n.total_in>>24&255)):(Oa(a,n.adler>>>16),Oa(a,n.adler&65535)),$r(n),a.wrap>0&&(a.wrap=-a.wrap),a.pending!==0?Yn:Wh)}function Q2(n){var e;return!n||!n.state?on:(e=n.state.status,e!==Iu&&e!==Oo&&e!==Tu&&e!==ku&&e!==Ru&&e!==ai&&e!==$a?Rr(n,on):(n.state=null,e===ai?Rr(n,x2):Yn))}function J2(n,e){var t=e.length,a,o,s,f,h,_,d,c;if(!n||!n.state||(a=n.state,f=a.wrap,f===2||f===1&&a.status!==Iu||a.lookahead))return on;for(f===1&&(n.adler=Mh(n.adler,e,t,0)),a.wrap=0,t>=a.w_size&&(f===0&&(Nr(a.head),a.strstart=0,a.block_start=0,a.insert=0),c=new Tt.Buf8(a.w_size),Tt.arraySet(c,e,t-a.w_size,a.w_size,0),e=c,t=a.w_size),h=n.avail_in,_=n.next_in,d=n.input,n.avail_in=t,n.next_in=0,n.input=e,si(a);a.lookahead>=Ee;){o=a.strstart,s=a.lookahead-(Ee-1);do a.ins_h=(a.ins_h<<a.hash_shift^a.window[o+Ee-1])&a.hash_mask,a.prev[o&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=o,o++;while(--s);a.strstart=o,a.lookahead=Ee-1,si(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=Ee-1,a.match_available=0,n.next_in=_,n.input=d,n.avail_in=h,a.wrap=f,Yn}Xn.deflateInit=K2,Xn.deflateInit2=Zh,Xn.deflateReset=Vh,Xn.deflateResetKeep=Hh,Xn.deflateSetHeader=X2,Xn.deflate=Y2,Xn.deflateEnd=Q2,Xn.deflateSetDictionary=J2,Xn.deflateInfo="pako deflate (from Nodeca project)";var oi={},Nu=fr,Xh=!0,Kh=!0;try{String.fromCharCode.apply(null,[0])}catch{Xh=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Kh=!1}for(var Pa=new Nu.Buf8(256),Lr=0;Lr<256;Lr++)Pa[Lr]=Lr>=252?6:Lr>=248?5:Lr>=240?4:Lr>=224?3:Lr>=192?2:1;Pa[254]=Pa[254]=1,oi.string2buf=function(n){var e,t,a,o,s,f=n.length,h=0;for(o=0;o<f;o++)t=n.charCodeAt(o),(t&64512)===55296&&o+1<f&&(a=n.charCodeAt(o+1),(a&64512)===56320&&(t=65536+(t-55296<<10)+(a-56320),o++)),h+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Nu.Buf8(h),s=0,o=0;s<h;o++)t=n.charCodeAt(o),(t&64512)===55296&&o+1<f&&(a=n.charCodeAt(o+1),(a&64512)===56320&&(t=65536+(t-55296<<10)+(a-56320),o++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e};function Yh(n,e){if(e<65534&&(n.subarray&&Kh||!n.subarray&&Xh))return String.fromCharCode.apply(null,Nu.shrinkBuf(n,e));for(var t="",a=0;a<e;a++)t+=String.fromCharCode(n[a]);return t}oi.buf2binstring=function(n){return Yh(n,n.length)},oi.binstring2buf=function(n){for(var e=new Nu.Buf8(n.length),t=0,a=e.length;t<a;t++)e[t]=n.charCodeAt(t);return e},oi.buf2string=function(n,e){var t,a,o,s,f=e||n.length,h=new Array(f*2);for(a=0,t=0;t<f;){if(o=n[t++],o<128){h[a++]=o;continue}if(s=Pa[o],s>4){h[a++]=65533,t+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&t<f;)o=o<<6|n[t++]&63,s--;if(s>1){h[a++]=65533;continue}o<65536?h[a++]=o:(o-=65536,h[a++]=55296|o>>10&1023,h[a++]=56320|o&1023)}return Yh(h,a)},oi.utf8border=function(n,e){var t;for(e=e||n.length,e>n.length&&(e=n.length),t=e-1;t>=0&&(n[t]&192)===128;)t--;return t<0||t===0?e:t+Pa[n[t]]>e?t:e};function j2(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Qh=j2,Ma=Xn,Ua=fr,Mo=oi,Uo=No,z2=Qh,Jh=Object.prototype.toString,ev=0,Wo=4,Gi=0,jh=1,zh=2,tv=-1,nv=0,rv=8;function fi(n){if(!(this instanceof fi))return new fi(n);this.options=Ua.assign({level:tv,method:rv,chunkSize:16384,windowBits:15,memLevel:8,strategy:nv,to:""},n||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new z2,this.strm.avail_out=0;var t=Ma.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==Gi)throw new Error(Uo[t]);if(e.header&&Ma.deflateSetHeader(this.strm,e.header),e.dictionary){var a;if(typeof e.dictionary=="string"?a=Mo.string2buf(e.dictionary):Jh.call(e.dictionary)==="[object ArrayBuffer]"?a=new Uint8Array(e.dictionary):a=e.dictionary,t=Ma.deflateSetDictionary(this.strm,a),t!==Gi)throw new Error(Uo[t]);this._dict_set=!0}}fi.prototype.push=function(n,e){var t=this.strm,a=this.options.chunkSize,o,s;if(this.ended)return!1;s=e===~~e?e:e===!0?Wo:ev,typeof n=="string"?t.input=Mo.string2buf(n):Jh.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;do{if(t.avail_out===0&&(t.output=new Ua.Buf8(a),t.next_out=0,t.avail_out=a),o=Ma.deflate(t,s),o!==jh&&o!==Gi)return this.onEnd(o),this.ended=!0,!1;(t.avail_out===0||t.avail_in===0&&(s===Wo||s===zh))&&(this.options.to==="string"?this.onData(Mo.buf2binstring(Ua.shrinkBuf(t.output,t.next_out))):this.onData(Ua.shrinkBuf(t.output,t.next_out)))}while((t.avail_in>0||t.avail_out===0)&&o!==jh);return s===Wo?(o=Ma.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Gi):(s===zh&&(this.onEnd(Gi),t.avail_out=0),!0)},fi.prototype.onData=function(n){this.chunks.push(n)},fi.prototype.onEnd=function(n){n===Gi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ua.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Go(n,e){var t=new fi(e);if(t.push(n,!0),t.err)throw t.msg||Uo[t.err];return t.result}function iv(n,e){return e=e||{},e.raw=!0,Go(n,e)}function av(n,e){return e=e||{},e.gzip=!0,Go(n,e)}Ba.Deflate=fi,Ba.deflate=Go,Ba.deflateRaw=iv,Ba.gzip=av;var Wa={},Rn={},$u=30,uv=12,sv=function(e,t){var a,o,s,f,h,_,d,c,D,x,m,B,F,I,k,U,$,S,L,W,N,q,H,Z,Y;a=e.state,o=e.next_in,Z=e.input,s=o+(e.avail_in-5),f=e.next_out,Y=e.output,h=f-(t-e.avail_out),_=f+(e.avail_out-257),d=a.dmax,c=a.wsize,D=a.whave,x=a.wnext,m=a.window,B=a.hold,F=a.bits,I=a.lencode,k=a.distcode,U=(1<<a.lenbits)-1,$=(1<<a.distbits)-1;e:do{F<15&&(B+=Z[o++]<<F,F+=8,B+=Z[o++]<<F,F+=8),S=I[B&U];t:for(;;){if(L=S>>>24,B>>>=L,F-=L,L=S>>>16&255,L===0)Y[f++]=S&65535;else if(L&16){W=S&65535,L&=15,L&&(F<L&&(B+=Z[o++]<<F,F+=8),W+=B&(1<<L)-1,B>>>=L,F-=L),F<15&&(B+=Z[o++]<<F,F+=8,B+=Z[o++]<<F,F+=8),S=k[B&$];n:for(;;){if(L=S>>>24,B>>>=L,F-=L,L=S>>>16&255,L&16){if(N=S&65535,L&=15,F<L&&(B+=Z[o++]<<F,F+=8,F<L&&(B+=Z[o++]<<F,F+=8)),N+=B&(1<<L)-1,N>d){e.msg="invalid distance too far back",a.mode=$u;break e}if(B>>>=L,F-=L,L=f-h,N>L){if(L=N-L,L>D&&a.sane){e.msg="invalid distance too far back",a.mode=$u;break e}if(q=0,H=m,x===0){if(q+=c-L,L<W){W-=L;do Y[f++]=m[q++];while(--L);q=f-N,H=Y}}else if(x<L){if(q+=c+x-L,L-=x,L<W){W-=L;do Y[f++]=m[q++];while(--L);if(q=0,x<W){L=x,W-=L;do Y[f++]=m[q++];while(--L);q=f-N,H=Y}}}else if(q+=x-L,L<W){W-=L;do Y[f++]=m[q++];while(--L);q=f-N,H=Y}for(;W>2;)Y[f++]=H[q++],Y[f++]=H[q++],Y[f++]=H[q++],W-=3;W&&(Y[f++]=H[q++],W>1&&(Y[f++]=H[q++]))}else{q=f-N;do Y[f++]=Y[q++],Y[f++]=Y[q++],Y[f++]=Y[q++],W-=3;while(W>2);W&&(Y[f++]=Y[q++],W>1&&(Y[f++]=Y[q++]))}}else if(L&64){e.msg="invalid distance code",a.mode=$u;break e}else{S=k[(S&65535)+(B&(1<<L)-1)];continue n}break}}else if(L&64)if(L&32){a.mode=uv;break e}else{e.msg="invalid literal/length code",a.mode=$u;break e}else{S=I[(S&65535)+(B&(1<<L)-1)];continue t}break}}while(o<s&&f<_);W=F>>3,o-=W,F-=W<<3,B&=(1<<F)-1,e.next_in=o,e.next_out=f,e.avail_in=o<s?5+(s-o):5-(o-s),e.avail_out=f<_?257+(_-f):257-(f-_),a.hold=B,a.bits=F},e0=fr,qi=15,t0=852,n0=592,r0=0,qo=1,i0=2,ov=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],fv=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],lv=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],hv=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],cv=function(e,t,a,o,s,f,h,_){var d=_.bits,c=0,D=0,x=0,m=0,B=0,F=0,I=0,k=0,U=0,$=0,S,L,W,N,q,H=null,Z=0,Y,re=new e0.Buf16(qi+1),se=new e0.Buf16(qi+1),fe=null,ce=0,Me,Fe,Ce;for(c=0;c<=qi;c++)re[c]=0;for(D=0;D<o;D++)re[t[a+D]]++;for(B=d,m=qi;m>=1&&re[m]===0;m--);if(B>m&&(B=m),m===0)return s[f++]=1<<24|64<<16|0,s[f++]=1<<24|64<<16|0,_.bits=1,0;for(x=1;x<m&&re[x]===0;x++);for(B<x&&(B=x),k=1,c=1;c<=qi;c++)if(k<<=1,k-=re[c],k<0)return-1;if(k>0&&(e===r0||m!==1))return-1;for(se[1]=0,c=1;c<qi;c++)se[c+1]=se[c]+re[c];for(D=0;D<o;D++)t[a+D]!==0&&(h[se[t[a+D]]++]=D);if(e===r0?(H=fe=h,Y=19):e===qo?(H=ov,Z-=257,fe=fv,ce-=257,Y=256):(H=lv,fe=hv,Y=-1),$=0,D=0,c=x,q=f,F=B,I=0,W=-1,U=1<<B,N=U-1,e===qo&&U>t0||e===i0&&U>n0)return 1;for(;;){Me=c-I,h[D]<Y?(Fe=0,Ce=h[D]):h[D]>Y?(Fe=fe[ce+h[D]],Ce=H[Z+h[D]]):(Fe=96,Ce=0),S=1<<c-I,L=1<<F,x=L;do L-=S,s[q+($>>I)+L]=Me<<24|Fe<<16|Ce|0;while(L!==0);for(S=1<<c-1;$&S;)S>>=1;if(S!==0?($&=S-1,$+=S):$=0,D++,--re[c]===0){if(c===m)break;c=t[a+h[D]]}if(c>B&&($&N)!==W){for(I===0&&(I=B),q+=x,F=c-I,k=1<<F;F+I<m&&(k-=re[F+I],!(k<=0));)F++,k<<=1;if(U+=1<<F,e===qo&&U>t0||e===i0&&U>n0)return 1;W=$&N,s[W]=B<<24|F<<16|q-f|0}}return $!==0&&(s[q+$]=c-I<<24|64<<16|0),_.bits=B,0},Kt=fr,Ho=Oh,Jn=Ph,dv=sv,Ga=cv,pv=0,a0=1,u0=2,s0=4,gv=5,Lu=6,li=0,_v=1,vv=2,fn=-2,o0=-3,f0=-4,wv=-5,l0=8,h0=1,c0=2,d0=3,p0=4,g0=5,_0=6,v0=7,w0=8,b0=9,m0=10,Ou=11,hr=12,Vo=13,D0=14,Zo=15,y0=16,x0=17,E0=18,C0=19,Pu=20,Mu=21,A0=22,F0=23,B0=24,S0=25,I0=26,Xo=27,T0=28,k0=29,Ye=30,R0=31,bv=32,mv=852,Dv=592,yv=15,xv=yv;function N0(n){return(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24)}function Ev(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Kt.Buf16(320),this.work=new Kt.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function $0(n){var e;return!n||!n.state?fn:(e=n.state,n.total_in=n.total_out=e.total=0,n.msg="",e.wrap&&(n.adler=e.wrap&1),e.mode=h0,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Kt.Buf32(mv),e.distcode=e.distdyn=new Kt.Buf32(Dv),e.sane=1,e.back=-1,li)}function L0(n){var e;return!n||!n.state?fn:(e=n.state,e.wsize=0,e.whave=0,e.wnext=0,$0(n))}function O0(n,e){var t,a;return!n||!n.state||(a=n.state,e<0?(t=0,e=-e):(t=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?fn:(a.window!==null&&a.wbits!==e&&(a.window=null),a.wrap=t,a.wbits=e,L0(n))}function P0(n,e){var t,a;return n?(a=new Ev,n.state=a,a.window=null,t=O0(n,e),t!==li&&(n.state=null),t):fn}function Cv(n){return P0(n,xv)}var M0=!0,Ko,Yo;function Av(n){if(M0){var e;for(Ko=new Kt.Buf32(512),Yo=new Kt.Buf32(32),e=0;e<144;)n.lens[e++]=8;for(;e<256;)n.lens[e++]=9;for(;e<280;)n.lens[e++]=7;for(;e<288;)n.lens[e++]=8;for(Ga(a0,n.lens,0,288,Ko,0,n.work,{bits:9}),e=0;e<32;)n.lens[e++]=5;Ga(u0,n.lens,0,32,Yo,0,n.work,{bits:5}),M0=!1}n.lencode=Ko,n.lenbits=9,n.distcode=Yo,n.distbits=5}function U0(n,e,t,a){var o,s=n.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Kt.Buf8(s.wsize)),a>=s.wsize?(Kt.arraySet(s.window,e,t-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>a&&(o=a),Kt.arraySet(s.window,e,t-a,o,s.wnext),a-=o,a?(Kt.arraySet(s.window,e,t-a,a,0),s.wnext=a,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}function Fv(n,e){var t,a,o,s,f,h,_,d,c,D,x,m,B,F,I=0,k,U,$,S,L,W,N,q,H=new Kt.Buf8(4),Z,Y,re=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!n||!n.state||!n.output||!n.input&&n.avail_in!==0)return fn;t=n.state,t.mode===hr&&(t.mode=Vo),f=n.next_out,o=n.output,_=n.avail_out,s=n.next_in,a=n.input,h=n.avail_in,d=t.hold,c=t.bits,D=h,x=_,q=li;e:for(;;)switch(t.mode){case h0:if(t.wrap===0){t.mode=Vo;break}for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.wrap&2&&d===35615){t.check=0,H[0]=d&255,H[1]=d>>>8&255,t.check=Jn(t.check,H,2,0),d=0,c=0,t.mode=c0;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((d&255)<<8)+(d>>8))%31){n.msg="incorrect header check",t.mode=Ye;break}if((d&15)!==l0){n.msg="unknown compression method",t.mode=Ye;break}if(d>>>=4,c-=4,N=(d&15)+8,t.wbits===0)t.wbits=N;else if(N>t.wbits){n.msg="invalid window size",t.mode=Ye;break}t.dmax=1<<N,n.adler=t.check=1,t.mode=d&512?m0:hr,d=0,c=0;break;case c0:for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.flags=d,(t.flags&255)!==l0){n.msg="unknown compression method",t.mode=Ye;break}if(t.flags&57344){n.msg="unknown header flags set",t.mode=Ye;break}t.head&&(t.head.text=d>>8&1),t.flags&512&&(H[0]=d&255,H[1]=d>>>8&255,t.check=Jn(t.check,H,2,0)),d=0,c=0,t.mode=d0;case d0:for(;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.head&&(t.head.time=d),t.flags&512&&(H[0]=d&255,H[1]=d>>>8&255,H[2]=d>>>16&255,H[3]=d>>>24&255,t.check=Jn(t.check,H,4,0)),d=0,c=0,t.mode=p0;case p0:for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.head&&(t.head.xflags=d&255,t.head.os=d>>8),t.flags&512&&(H[0]=d&255,H[1]=d>>>8&255,t.check=Jn(t.check,H,2,0)),d=0,c=0,t.mode=g0;case g0:if(t.flags&1024){for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.length=d,t.head&&(t.head.extra_len=d),t.flags&512&&(H[0]=d&255,H[1]=d>>>8&255,t.check=Jn(t.check,H,2,0)),d=0,c=0}else t.head&&(t.head.extra=null);t.mode=_0;case _0:if(t.flags&1024&&(m=t.length,m>h&&(m=h),m&&(t.head&&(N=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),Kt.arraySet(t.head.extra,a,s,m,N)),t.flags&512&&(t.check=Jn(t.check,a,m,s)),h-=m,s+=m,t.length-=m),t.length))break e;t.length=0,t.mode=v0;case v0:if(t.flags&2048){if(h===0)break e;m=0;do N=a[s+m++],t.head&&N&&t.length<65536&&(t.head.name+=String.fromCharCode(N));while(N&&m<h);if(t.flags&512&&(t.check=Jn(t.check,a,m,s)),h-=m,s+=m,N)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=w0;case w0:if(t.flags&4096){if(h===0)break e;m=0;do N=a[s+m++],t.head&&N&&t.length<65536&&(t.head.comment+=String.fromCharCode(N));while(N&&m<h);if(t.flags&512&&(t.check=Jn(t.check,a,m,s)),h-=m,s+=m,N)break e}else t.head&&(t.head.comment=null);t.mode=b0;case b0:if(t.flags&512){for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(d!==(t.check&65535)){n.msg="header crc mismatch",t.mode=Ye;break}d=0,c=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),n.adler=t.check=0,t.mode=hr;break;case m0:for(;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}n.adler=t.check=N0(d),d=0,c=0,t.mode=Ou;case Ou:if(t.havedict===0)return n.next_out=f,n.avail_out=_,n.next_in=s,n.avail_in=h,t.hold=d,t.bits=c,vv;n.adler=t.check=1,t.mode=hr;case hr:if(e===gv||e===Lu)break e;case Vo:if(t.last){d>>>=c&7,c-=c&7,t.mode=Xo;break}for(;c<3;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}switch(t.last=d&1,d>>>=1,c-=1,d&3){case 0:t.mode=D0;break;case 1:if(Av(t),t.mode=Pu,e===Lu){d>>>=2,c-=2;break e}break;case 2:t.mode=x0;break;case 3:n.msg="invalid block type",t.mode=Ye}d>>>=2,c-=2;break;case D0:for(d>>>=c&7,c-=c&7;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if((d&65535)!==(d>>>16^65535)){n.msg="invalid stored block lengths",t.mode=Ye;break}if(t.length=d&65535,d=0,c=0,t.mode=Zo,e===Lu)break e;case Zo:t.mode=y0;case y0:if(m=t.length,m){if(m>h&&(m=h),m>_&&(m=_),m===0)break e;Kt.arraySet(o,a,s,m,f),h-=m,s+=m,_-=m,f+=m,t.length-=m;break}t.mode=hr;break;case x0:for(;c<14;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.nlen=(d&31)+257,d>>>=5,c-=5,t.ndist=(d&31)+1,d>>>=5,c-=5,t.ncode=(d&15)+4,d>>>=4,c-=4,t.nlen>286||t.ndist>30){n.msg="too many length or distance symbols",t.mode=Ye;break}t.have=0,t.mode=E0;case E0:for(;t.have<t.ncode;){for(;c<3;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.lens[re[t.have++]]=d&7,d>>>=3,c-=3}for(;t.have<19;)t.lens[re[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,Z={bits:t.lenbits},q=Ga(pv,t.lens,0,19,t.lencode,0,t.work,Z),t.lenbits=Z.bits,q){n.msg="invalid code lengths set",t.mode=Ye;break}t.have=0,t.mode=C0;case C0:for(;t.have<t.nlen+t.ndist;){for(;I=t.lencode[d&(1<<t.lenbits)-1],k=I>>>24,U=I>>>16&255,$=I&65535,!(k<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if($<16)d>>>=k,c-=k,t.lens[t.have++]=$;else{if($===16){for(Y=k+2;c<Y;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(d>>>=k,c-=k,t.have===0){n.msg="invalid bit length repeat",t.mode=Ye;break}N=t.lens[t.have-1],m=3+(d&3),d>>>=2,c-=2}else if($===17){for(Y=k+3;c<Y;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=k,c-=k,N=0,m=3+(d&7),d>>>=3,c-=3}else{for(Y=k+7;c<Y;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=k,c-=k,N=0,m=11+(d&127),d>>>=7,c-=7}if(t.have+m>t.nlen+t.ndist){n.msg="invalid bit length repeat",t.mode=Ye;break}for(;m--;)t.lens[t.have++]=N}}if(t.mode===Ye)break;if(t.lens[256]===0){n.msg="invalid code -- missing end-of-block",t.mode=Ye;break}if(t.lenbits=9,Z={bits:t.lenbits},q=Ga(a0,t.lens,0,t.nlen,t.lencode,0,t.work,Z),t.lenbits=Z.bits,q){n.msg="invalid literal/lengths set",t.mode=Ye;break}if(t.distbits=6,t.distcode=t.distdyn,Z={bits:t.distbits},q=Ga(u0,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,Z),t.distbits=Z.bits,q){n.msg="invalid distances set",t.mode=Ye;break}if(t.mode=Pu,e===Lu)break e;case Pu:t.mode=Mu;case Mu:if(h>=6&&_>=258){n.next_out=f,n.avail_out=_,n.next_in=s,n.avail_in=h,t.hold=d,t.bits=c,dv(n,x),f=n.next_out,o=n.output,_=n.avail_out,s=n.next_in,a=n.input,h=n.avail_in,d=t.hold,c=t.bits,t.mode===hr&&(t.back=-1);break}for(t.back=0;I=t.lencode[d&(1<<t.lenbits)-1],k=I>>>24,U=I>>>16&255,$=I&65535,!(k<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(U&&!(U&240)){for(S=k,L=U,W=$;I=t.lencode[W+((d&(1<<S+L)-1)>>S)],k=I>>>24,U=I>>>16&255,$=I&65535,!(S+k<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=S,c-=S,t.back+=S}if(d>>>=k,c-=k,t.back+=k,t.length=$,U===0){t.mode=I0;break}if(U&32){t.back=-1,t.mode=hr;break}if(U&64){n.msg="invalid literal/length code",t.mode=Ye;break}t.extra=U&15,t.mode=A0;case A0:if(t.extra){for(Y=t.extra;c<Y;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.length+=d&(1<<t.extra)-1,d>>>=t.extra,c-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=F0;case F0:for(;I=t.distcode[d&(1<<t.distbits)-1],k=I>>>24,U=I>>>16&255,$=I&65535,!(k<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(!(U&240)){for(S=k,L=U,W=$;I=t.distcode[W+((d&(1<<S+L)-1)>>S)],k=I>>>24,U=I>>>16&255,$=I&65535,!(S+k<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=S,c-=S,t.back+=S}if(d>>>=k,c-=k,t.back+=k,U&64){n.msg="invalid distance code",t.mode=Ye;break}t.offset=$,t.extra=U&15,t.mode=B0;case B0:if(t.extra){for(Y=t.extra;c<Y;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.offset+=d&(1<<t.extra)-1,d>>>=t.extra,c-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){n.msg="invalid distance too far back",t.mode=Ye;break}t.mode=S0;case S0:if(_===0)break e;if(m=x-_,t.offset>m){if(m=t.offset-m,m>t.whave&&t.sane){n.msg="invalid distance too far back",t.mode=Ye;break}m>t.wnext?(m-=t.wnext,B=t.wsize-m):B=t.wnext-m,m>t.length&&(m=t.length),F=t.window}else F=o,B=f-t.offset,m=t.length;m>_&&(m=_),_-=m,t.length-=m;do o[f++]=F[B++];while(--m);t.length===0&&(t.mode=Mu);break;case I0:if(_===0)break e;o[f++]=t.length,_--,t.mode=Mu;break;case Xo:if(t.wrap){for(;c<32;){if(h===0)break e;h--,d|=a[s++]<<c,c+=8}if(x-=_,n.total_out+=x,t.total+=x,x&&(n.adler=t.check=t.flags?Jn(t.check,o,x,f-x):Ho(t.check,o,x,f-x)),x=_,(t.flags?d:N0(d))!==t.check){n.msg="incorrect data check",t.mode=Ye;break}d=0,c=0}t.mode=T0;case T0:if(t.wrap&&t.flags){for(;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(d!==(t.total&4294967295)){n.msg="incorrect length check",t.mode=Ye;break}d=0,c=0}t.mode=k0;case k0:q=_v;break e;case Ye:q=o0;break e;case R0:return f0;case bv:default:return fn}return n.next_out=f,n.avail_out=_,n.next_in=s,n.avail_in=h,t.hold=d,t.bits=c,(t.wsize||x!==n.avail_out&&t.mode<Ye&&(t.mode<Xo||e!==s0))&&U0(n,n.output,n.next_out,x-n.avail_out),D-=n.avail_in,x-=n.avail_out,n.total_in+=D,n.total_out+=x,t.total+=x,t.wrap&&x&&(n.adler=t.check=t.flags?Jn(t.check,o,x,n.next_out-x):Ho(t.check,o,x,n.next_out-x)),n.data_type=t.bits+(t.last?64:0)+(t.mode===hr?128:0)+(t.mode===Pu||t.mode===Zo?256:0),(D===0&&x===0||e===s0)&&q===li&&(q=wv),q}function Bv(n){if(!n||!n.state)return fn;var e=n.state;return e.window&&(e.window=null),n.state=null,li}function Sv(n,e){var t;return!n||!n.state||(t=n.state,!(t.wrap&2))?fn:(t.head=e,e.done=!1,li)}function Iv(n,e){var t=e.length,a,o,s;return!n||!n.state||(a=n.state,a.wrap!==0&&a.mode!==Ou)?fn:a.mode===Ou&&(o=1,o=Ho(o,e,t,0),o!==a.check)?o0:(s=U0(n,e,t,t),s?(a.mode=R0,f0):(a.havedict=1,li))}Rn.inflateReset=L0,Rn.inflateReset2=O0,Rn.inflateResetKeep=$0,Rn.inflateInit=Cv,Rn.inflateInit2=P0,Rn.inflate=Fv,Rn.inflateEnd=Bv,Rn.inflateGetHeader=Sv,Rn.inflateSetDictionary=Iv,Rn.inflateInfo="pako inflate (from Nodeca project)";var W0={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};function Tv(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var kv=Tv,Hi=Rn,qa=fr,Uu=oi,ut=W0,Qo=No,Rv=Qh,Nv=kv,G0=Object.prototype.toString;function hi(n){if(!(this instanceof hi))return new hi(n);this.options=qa.assign({chunkSize:16384,windowBits:0,to:""},n||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(n&&n.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Rv,this.strm.avail_out=0;var t=Hi.inflateInit2(this.strm,e.windowBits);if(t!==ut.Z_OK)throw new Error(Qo[t]);if(this.header=new Nv,Hi.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Uu.string2buf(e.dictionary):G0.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=Hi.inflateSetDictionary(this.strm,e.dictionary),t!==ut.Z_OK)))throw new Error(Qo[t])}hi.prototype.push=function(n,e){var t=this.strm,a=this.options.chunkSize,o=this.options.dictionary,s,f,h,_,d,c=!1;if(this.ended)return!1;f=e===~~e?e:e===!0?ut.Z_FINISH:ut.Z_NO_FLUSH,typeof n=="string"?t.input=Uu.binstring2buf(n):G0.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;do{if(t.avail_out===0&&(t.output=new qa.Buf8(a),t.next_out=0,t.avail_out=a),s=Hi.inflate(t,ut.Z_NO_FLUSH),s===ut.Z_NEED_DICT&&o&&(s=Hi.inflateSetDictionary(this.strm,o)),s===ut.Z_BUF_ERROR&&c===!0&&(s=ut.Z_OK,c=!1),s!==ut.Z_STREAM_END&&s!==ut.Z_OK)return this.onEnd(s),this.ended=!0,!1;t.next_out&&(t.avail_out===0||s===ut.Z_STREAM_END||t.avail_in===0&&(f===ut.Z_FINISH||f===ut.Z_SYNC_FLUSH))&&(this.options.to==="string"?(h=Uu.utf8border(t.output,t.next_out),_=t.next_out-h,d=Uu.buf2string(t.output,h),t.next_out=_,t.avail_out=a-_,_&&qa.arraySet(t.output,t.output,h,_,0),this.onData(d)):this.onData(qa.shrinkBuf(t.output,t.next_out))),t.avail_in===0&&t.avail_out===0&&(c=!0)}while((t.avail_in>0||t.avail_out===0)&&s!==ut.Z_STREAM_END);return s===ut.Z_STREAM_END&&(f=ut.Z_FINISH),f===ut.Z_FINISH?(s=Hi.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===ut.Z_OK):(f===ut.Z_SYNC_FLUSH&&(this.onEnd(ut.Z_OK),t.avail_out=0),!0)},hi.prototype.onData=function(n){this.chunks.push(n)},hi.prototype.onEnd=function(n){n===ut.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=qa.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Jo(n,e){var t=new hi(e);if(t.push(n,!0),t.err)throw t.msg||Qo[t.err];return t.result}function $v(n,e){return e=e||{},e.raw=!0,Jo(n,e)}Wa.Inflate=hi,Wa.inflate=Jo,Wa.inflateRaw=$v,Wa.ungzip=Jo;var Lv=fr.assign,Ov=Ba,Pv=Wa,Mv=W0,q0={};Lv(q0,Ov,Pv,Mv);var Wu=q0;async function jo(n){try{let e,t=0,a=0;const o=[];let s=0,f;do{const _=n.subarray(t);if(f=new Wu.Inflate,{strm:e}=f,f.push(_,Wu.Z_SYNC_FLUSH),f.err)throw new Error(f.msg);t+=e.next_in,o[a]=f.result,s+=o[a].length,a+=1}while(e.avail_in);const h=new Uint8Array(s);for(let _=0,d=0;_<o.length;_++)h.set(o[_],d),d+=o[_].length;return Tn.from(h)}catch(e){throw/incorrect header check/.exec(`${e}`)?new Error("problem decompressing block: incorrect gzip header check"):e}}async function Uv(n,e){try{let t;const{minv:a,maxv:o}=e;let s=a.blockPosition,f=a.dataPosition;const h=[],_=[],d=[];let c=0,D=0;do{const B=n.subarray(s-a.blockPosition),F=new Wu.Inflate;if({strm:t}=F,F.push(B,Wu.Z_SYNC_FLUSH),F.err)throw new Error(F.msg);const I=F.result;h.push(I);let k=I.length;_.push(s),d.push(f),h.length===1&&a.dataPosition&&(h[0]=h[0].subarray(a.dataPosition),k=h[0].length);const U=s;if(s+=t.next_in,f+=k,U>=o.blockPosition){h[D]=h[D].subarray(0,o.blockPosition===a.blockPosition?o.dataPosition-a.dataPosition+1:o.dataPosition+1),_.push(s),d.push(f),c+=h[D].length;break}c+=h[D].length,D++}while(t.avail_in);const x=new Uint8Array(c);for(let B=0,F=0;B<h.length;B++)x.set(h[B],F),F+=h[B].length;return{buffer:Tn.from(x),cpositions:_,dpositions:d}}catch(t){throw/incorrect header check/.exec(`${t}`)?new Error("problem decompressing block: incorrect gzip header check"):t}}var Wv=We,ln=null;try{ln=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function We(n,e,t){this.low=n|0,this.high=e|0,this.unsigned=!!t}We.prototype.__isLong__,Object.defineProperty(We.prototype,"__isLong__",{value:!0});function Ut(n){return(n&&n.__isLong__)===!0}We.isLong=Ut;var H0={},V0={};function ci(n,e){var t,a,o;return e?(n>>>=0,(o=0<=n&&n<256)&&(a=V0[n],a)?a:(t=Ge(n,(n|0)<0?-1:0,!0),o&&(V0[n]=t),t)):(n|=0,(o=-128<=n&&n<128)&&(a=H0[n],a)?a:(t=Ge(n,n<0?-1:0,!1),o&&(H0[n]=t),t))}We.fromInt=ci;function hn(n,e){if(isNaN(n))return e?di:cn;if(e){if(n<0)return di;if(n>=X0)return j0}else{if(n<=-K0)return Wt;if(n+1>=K0)return J0}return n<0?hn(-n,e).neg():Ge(n%Vi|0,n/Vi|0,e)}We.fromNumber=hn;function Ge(n,e,t){return new We(n,e,t)}We.fromBits=Ge;var Gu=Math.pow;function zo(n,e,t){if(n.length===0)throw Error("empty string");if(n==="NaN"||n==="Infinity"||n==="+Infinity"||n==="-Infinity")return cn;if(typeof e=="number"?(t=e,e=!1):e=!!e,t=t||10,t<2||36<t)throw RangeError("radix");var a;if((a=n.indexOf("-"))>0)throw Error("interior hyphen");if(a===0)return zo(n.substring(1),e,t).neg();for(var o=hn(Gu(t,8)),s=cn,f=0;f<n.length;f+=8){var h=Math.min(8,n.length-f),_=parseInt(n.substring(f,f+h),t);if(h<8){var d=hn(Gu(t,h));s=s.mul(d).add(hn(_))}else s=s.mul(o),s=s.add(hn(_))}return s.unsigned=e,s}We.fromString=zo;function Nn(n,e){return typeof n=="number"?hn(n,e):typeof n=="string"?zo(n,e):Ge(n.low,n.high,typeof e=="boolean"?e:n.unsigned)}We.fromValue=Nn;var Z0=65536,Gv=1<<24,Vi=Z0*Z0,X0=Vi*Vi,K0=X0/2,Y0=ci(Gv),cn=ci(0);We.ZERO=cn;var di=ci(0,!0);We.UZERO=di;var Zi=ci(1);We.ONE=Zi;var Q0=ci(1,!0);We.UONE=Q0;var ef=ci(-1);We.NEG_ONE=ef;var J0=Ge(-1,2147483647,!1);We.MAX_VALUE=J0;var j0=Ge(-1,-1,!0);We.MAX_UNSIGNED_VALUE=j0;var Wt=Ge(0,-2147483648,!1);We.MIN_VALUE=Wt;var te=We.prototype;te.toInt=function(){return this.unsigned?this.low>>>0:this.low},te.toNumber=function(){return this.unsigned?(this.high>>>0)*Vi+(this.low>>>0):this.high*Vi+(this.low>>>0)},te.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Wt)){var t=hn(e),a=this.div(t),o=a.mul(t).sub(this);return a.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=hn(Gu(e,6),this.unsigned),f=this,h="";;){var _=f.div(s),d=f.sub(_.mul(s)).toInt()>>>0,c=d.toString(e);if(f=_,f.isZero())return c+h;for(;c.length<6;)c="0"+c;h=""+c+h}},te.getHighBits=function(){return this.high},te.getHighBitsUnsigned=function(){return this.high>>>0},te.getLowBits=function(){return this.low},te.getLowBitsUnsigned=function(){return this.low>>>0},te.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Wt)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return this.high!=0?t+33:t+1},te.isZero=function(){return this.high===0&&this.low===0},te.eqz=te.isZero,te.isNegative=function(){return!this.unsigned&&this.high<0},te.isPositive=function(){return this.unsigned||this.high>=0},te.isOdd=function(){return(this.low&1)===1},te.isEven=function(){return(this.low&1)===0},te.equals=function(e){return Ut(e)||(e=Nn(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low},te.eq=te.equals,te.notEquals=function(e){return!this.eq(e)},te.neq=te.notEquals,te.ne=te.notEquals,te.lessThan=function(e){return this.comp(e)<0},te.lt=te.lessThan,te.lessThanOrEqual=function(e){return this.comp(e)<=0},te.lte=te.lessThanOrEqual,te.le=te.lessThanOrEqual,te.greaterThan=function(e){return this.comp(e)>0},te.gt=te.greaterThan,te.greaterThanOrEqual=function(e){return this.comp(e)>=0},te.gte=te.greaterThanOrEqual,te.ge=te.greaterThanOrEqual,te.compare=function(e){if(Ut(e)||(e=Nn(e)),this.eq(e))return 0;var t=this.isNegative(),a=e.isNegative();return t&&!a?-1:!t&&a?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},te.comp=te.compare,te.negate=function(){return!this.unsigned&&this.eq(Wt)?Wt:this.not().add(Zi)},te.neg=te.negate,te.add=function(e){Ut(e)||(e=Nn(e));var t=this.high>>>16,a=this.high&65535,o=this.low>>>16,s=this.low&65535,f=e.high>>>16,h=e.high&65535,_=e.low>>>16,d=e.low&65535,c=0,D=0,x=0,m=0;return m+=s+d,x+=m>>>16,m&=65535,x+=o+_,D+=x>>>16,x&=65535,D+=a+h,c+=D>>>16,D&=65535,c+=t+f,c&=65535,Ge(x<<16|m,c<<16|D,this.unsigned)},te.subtract=function(e){return Ut(e)||(e=Nn(e)),this.add(e.neg())},te.sub=te.subtract,te.multiply=function(e){if(this.isZero())return cn;if(Ut(e)||(e=Nn(e)),ln){var t=ln.mul(this.low,this.high,e.low,e.high);return Ge(t,ln.get_high(),this.unsigned)}if(e.isZero())return cn;if(this.eq(Wt))return e.isOdd()?Wt:cn;if(e.eq(Wt))return this.isOdd()?Wt:cn;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(Y0)&&e.lt(Y0))return hn(this.toNumber()*e.toNumber(),this.unsigned);var a=this.high>>>16,o=this.high&65535,s=this.low>>>16,f=this.low&65535,h=e.high>>>16,_=e.high&65535,d=e.low>>>16,c=e.low&65535,D=0,x=0,m=0,B=0;return B+=f*c,m+=B>>>16,B&=65535,m+=s*c,x+=m>>>16,m&=65535,m+=f*d,x+=m>>>16,m&=65535,x+=o*c,D+=x>>>16,x&=65535,x+=s*d,D+=x>>>16,x&=65535,x+=f*_,D+=x>>>16,x&=65535,D+=a*c+o*d+s*_+f*h,D&=65535,Ge(m<<16|B,D<<16|x,this.unsigned)},te.mul=te.multiply,te.divide=function(e){if(Ut(e)||(e=Nn(e)),e.isZero())throw Error("division by zero");if(ln){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var t=(this.unsigned?ln.div_u:ln.div_s)(this.low,this.high,e.low,e.high);return Ge(t,ln.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?di:cn;var a,o,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return di;if(e.gt(this.shru(1)))return Q0;s=di}else{if(this.eq(Wt)){if(e.eq(Zi)||e.eq(ef))return Wt;if(e.eq(Wt))return Zi;var f=this.shr(1);return a=f.div(e).shl(1),a.eq(cn)?e.isNegative()?Zi:ef:(o=this.sub(e.mul(a)),s=a.add(o.div(e)),s)}else if(e.eq(Wt))return this.unsigned?di:cn;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=cn}for(o=this;o.gte(e);){a=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var h=Math.ceil(Math.log(a)/Math.LN2),_=h<=48?1:Gu(2,h-48),d=hn(a),c=d.mul(e);c.isNegative()||c.gt(o);)a-=_,d=hn(a,this.unsigned),c=d.mul(e);d.isZero()&&(d=Zi),s=s.add(d),o=o.sub(c)}return s},te.div=te.divide,te.modulo=function(e){if(Ut(e)||(e=Nn(e)),ln){var t=(this.unsigned?ln.rem_u:ln.rem_s)(this.low,this.high,e.low,e.high);return Ge(t,ln.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},te.mod=te.modulo,te.rem=te.modulo,te.not=function(){return Ge(~this.low,~this.high,this.unsigned)},te.and=function(e){return Ut(e)||(e=Nn(e)),Ge(this.low&e.low,this.high&e.high,this.unsigned)},te.or=function(e){return Ut(e)||(e=Nn(e)),Ge(this.low|e.low,this.high|e.high,this.unsigned)},te.xor=function(e){return Ut(e)||(e=Nn(e)),Ge(this.low^e.low,this.high^e.high,this.unsigned)},te.shiftLeft=function(e){return Ut(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Ge(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):Ge(0,this.low<<e-32,this.unsigned)},te.shl=te.shiftLeft,te.shiftRight=function(e){return Ut(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Ge(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):Ge(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},te.shr=te.shiftRight,te.shiftRightUnsigned=function(e){if(Ut(e)&&(e=e.toInt()),e&=63,e===0)return this;var t=this.high;if(e<32){var a=this.low;return Ge(a>>>e|t<<32-e,t>>>e,this.unsigned)}else return e===32?Ge(t,0,this.unsigned):Ge(t>>>e-32,0,this.unsigned)},te.shru=te.shiftRightUnsigned,te.shr_u=te.shiftRightUnsigned,te.toSigned=function(){return this.unsigned?Ge(this.low,this.high,!1):this},te.toUnsigned=function(){return this.unsigned?this:Ge(this.low,this.high,!0)},te.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},te.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},te.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},We.fromBytes=function(e,t,a){return a?We.fromBytesLE(e,t):We.fromBytesBE(e,t)},We.fromBytesLE=function(e,t){return new We(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},We.fromBytesBE=function(e,t){return new We(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};var z0=wu(Wv);function ec(n){if(n.greaterThan(Number.MAX_SAFE_INTEGER)||n.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");return n.toNumber()}let qv=class extends Error{};function Ha(n){if(n&&n.aborted){if(typeof DOMException<"u")throw new DOMException("aborted","AbortError");{const e=new qv("aborted");throw e.code="ERR_ABORTED",e}}}function Hv(n,e){return e.minv.blockPosition-n.maxv.blockPosition<65e3&&e.maxv.blockPosition-n.minv.blockPosition<5e6}function tc(n,e){const t=[];let a=null;return n.length===0?n:(n.sort(function(o,s){const f=o.minv.blockPosition-s.minv.blockPosition;return f!==0?f:o.minv.dataPosition-s.minv.dataPosition}),n.forEach(o=>{(!e||o.maxv.compareTo(e)>0)&&(a===null?(t.push(o),a=o):Hv(a,o)?o.maxv.compareTo(a.maxv)>0&&(a.maxv=o.maxv):(t.push(o),a=o))}),t)}class tf{constructor(e,t){this.blockPosition=e,this.dataPosition=t}toString(){return`${this.blockPosition}:${this.dataPosition}`}compareTo(e){return this.blockPosition-e.blockPosition||this.dataPosition-e.dataPosition}}function Xi(n,e=0,t=!1){if(t)throw new Error("big-endian virtual file offsets not implemented");return new tf(n[e+7]*1099511627776+n[e+6]*4294967296+n[e+5]*16777216+n[e+4]*65536+n[e+3]*256+n[e+2],n[e+1]<<8|n[e])}class qu{constructor(e,t,a,o=void 0){this.minv=e,this.maxv=t,this.bin=a,this._fetchedSize=o}toUniqueString(){return`${this.minv}..${this.maxv} (bin ${this.bin}, fetchedSize ${this.fetchedSize()})`}toString(){return this.toUniqueString()}compareTo(e){return this.minv.compareTo(e.minv)||this.maxv.compareTo(e.maxv)||this.bin-e.bin}fetchedSize(){return this._fetchedSize!==void 0?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}}class nc{constructor({filehandle:e,renameRefSeqs:t=a=>a}){this.filehandle=e,this.renameRefSeq=t}async getMetadata(e={}){const{indices:t,...a}=await this.parse(e);return a}_findFirstData(e,t){return e?e.compareTo(t)>0?t:e:t}async parse(e={}){return this.parseP||(this.parseP=this._parse(e).catch(t=>{throw this.parseP=void 0,t})),this.parseP}async hasRefSeq(e,t={}){var a;return!!(!((a=(await this.parse(t)).indices[e])===null||a===void 0)&&a.binIndex)}}const Vv=21578324,rc=14;function Zv(n,e){return n+=1,e-=1,[[0,0],[1+(n>>26),1+(e>>26)],[9+(n>>23),9+(e>>23)],[73+(n>>20),73+(e>>20)],[585+(n>>17),585+(e>>17)],[4681+(n>>14),4681+(e>>14)]]}class Va extends nc{async lineCount(e,t={}){const a=await this.parse(t),o=a.refNameToId[e];if(o===void 0||!a.indices[o])return-1;const{stats:f}=a.indices[o];return f?f.lineCount:-1}async _parse(e={}){const t=await this.filehandle.readFile(e),a=await jo(t);if(Ha(e.signal),a.readUInt32LE(0)!==Vv)throw new Error("Not a TBI file");const o=a.readInt32LE(4),s=a.readInt32LE(8),f=s&65536?"zero-based-half-open":"1-based-closed",_={0:"generic",1:"SAM",2:"VCF"}[s&15];if(!_)throw new Error(`invalid Tabix preset format flags ${s}`);const d={ref:a.readInt32LE(12),start:a.readInt32LE(16),end:a.readInt32LE(20)},c=a.readInt32LE(24),D=5,x=((1<<(D+1)*3)-1)/7,m=2**(14+D*3),B=c?String.fromCharCode(c):null,F=a.readInt32LE(28),I=a.readInt32LE(32),{refNameToId:k,refIdToName:U}=this._parseNameBytes(a.slice(36,36+I));let $=36+I,S;return{indices:new Array(o).fill(0).map(()=>{const W=a.readInt32LE($);$+=4;const N={};let q;for(let Y=0;Y<W;Y+=1){const re=a.readUInt32LE($);if($+=4,re>x+1)throw new Error("tabix index contains too many bins, please use a CSI index");if(re===x+1){const se=a.readInt32LE($);$+=4,se===2&&(q=this.parsePseudoBin(a,$)),$+=16*se}else{const se=a.readInt32LE($);$+=4;const fe=new Array(se);for(let ce=0;ce<se;ce+=1){const Me=Xi(a,$),Fe=Xi(a,$+8);$+=16,S=this._findFirstData(S,Me),fe[ce]=new qu(Me,Fe,re)}N[re]=fe}}const H=a.readInt32LE($);$+=4;const Z=new Array(H);for(let Y=0;Y<H;Y+=1)Z[Y]=Xi(a,$),$+=8,S=this._findFirstData(S,Z[Y]);return{binIndex:N,linearIndex:Z,stats:q}}),metaChar:B,maxBinNumber:x,maxRefLength:m,skipLines:F,firstDataLine:S,columnNumbers:d,coordinateType:f,format:_,refIdToName:U,refNameToId:k,maxBlockSize:65536}}parsePseudoBin(e,t){return{lineCount:ec(z0.fromBytesLE(e.slice(t+16,t+24),!0))}}_parseNameBytes(e){let t=0,a=0;const o=[],s={};for(let f=0;f<e.length;f+=1)if(!e[f]){if(a<f){let h=e.toString("utf8",a,f);h=this.renameRefSeq(h),o[t]=h,s[h]=t}a=f+1,t+=1}return{refNameToId:s,refIdToName:o}}async blocksForRange(e,t,a,o={}){t<0&&(t=0);const s=await this.parse(o),f=s.refNameToId[e];if(f===void 0)return[];const h=s.indices[f];if(!h)return[];(h.linearIndex.length?h.linearIndex[t>>rc>=h.linearIndex.length?h.linearIndex.length-1:t>>rc]:new tf(0,0))||console.warn("querying outside of possible tabix range");const d=Zv(t,a),c=[];for(const[F,I]of d)for(let k=F;k<=I;k++)if(h.binIndex[k])for(const U of h.binIndex[k])c.push(new qu(U.minv,U.maxv,k));const D=h.linearIndex.length;let x=null;const m=Math.min(t>>14,D-1),B=Math.min(a>>14,D-1);for(let F=m;F<=B;++F){const I=h.linearIndex[F];I&&(!x||I.compareTo(x)<0)&&(x=I)}return tc(c,x)}}const Xv=21582659,Kv=38359875;function Yv(n,e){return n*2**e}function ic(n,e){return Math.floor(n/2**e)}class nf extends nc{constructor(e){super(e),this.maxBinNumber=0,this.depth=0,this.minShift=0}async lineCount(e,t={}){const a=await this.parse(t),o=a.refNameToId[e];if(o===void 0||!a.indices[o])return-1;const{stats:f}=a.indices[o];return f?f.lineCount:-1}indexCov(){throw new Error("CSI indexes do not support indexcov")}parseAuxData(e,t){const a=e.readInt32LE(t),o=a&65536?"zero-based-half-open":"1-based-closed",s={0:"generic",1:"SAM",2:"VCF"}[a&15];if(!s)throw new Error(`invalid Tabix preset format flags ${a}`);const f={ref:e.readInt32LE(t+4),start:e.readInt32LE(t+8),end:e.readInt32LE(t+12)},h=e.readInt32LE(t+16),_=h?String.fromCharCode(h):null,d=e.readInt32LE(t+20),c=e.readInt32LE(t+24),{refIdToName:D,refNameToId:x}=this._parseNameBytes(e.slice(t+28,t+28+c));return{refIdToName:D,refNameToId:x,skipLines:d,metaChar:_,columnNumbers:f,format:s,coordinateType:o}}_parseNameBytes(e){let t=0,a=0;const o=[],s={};for(let f=0;f<e.length;f+=1)if(!e[f]){if(a<f){let h=e.toString("utf8",a,f);h=this.renameRefSeq(h),o[t]=h,s[h]=t}a=f+1,t+=1}return{refNameToId:s,refIdToName:o}}async _parse(e={}){const t=await jo(await this.filehandle.readFile(e));let a;if(t.readUInt32LE(0)===Xv)a=1;else if(t.readUInt32LE(0)===Kv)a=2;else throw new Error("Not a CSI file");this.minShift=t.readInt32LE(4),this.depth=t.readInt32LE(8),this.maxBinNumber=((1<<(this.depth+1)*3)-1)/7;const o=2**(this.minShift+this.depth*3),s=t.readInt32LE(12),f=s&&s>=30?this.parseAuxData(t,16):{refIdToName:[],refNameToId:{},metaChar:null,columnNumbers:{ref:0,start:1,end:2},coordinateType:"zero-based-half-open",format:"generic"},h=t.readInt32LE(16+s);let _,d=16+s+4;const c=new Array(h).fill(0).map(()=>{const D=t.readInt32LE(d);d+=4;const x={};let m;for(let B=0;B<D;B+=1){const F=t.readUInt32LE(d);if(F>this.maxBinNumber)m=this.parsePseudoBin(t,d+4),d+=48;else{const I=Xi(t,d+4);_=this._findFirstData(_,I);const k=t.readInt32LE(d+12);d+=16;const U=new Array(k);for(let $=0;$<k;$+=1){const S=Xi(t,d),L=Xi(t,d+8);d+=16,U[$]=new qu(S,L,F)}x[F]=U}}return{binIndex:x,stats:m}});return{...f,csi:!0,refCount:h,maxBlockSize:65536,firstDataLine:_,csiVersion:a,indices:c,depth:this.depth,maxBinNumber:this.maxBinNumber,maxRefLength:o}}parsePseudoBin(e,t){return{lineCount:ec(z0.fromBytesLE(e.slice(t+28,t+36),!0))}}async blocksForRange(e,t,a,o={}){t<0&&(t=0);const s=await this.parse(o),f=s.refNameToId[e];if(f===void 0)return[];const h=s.indices[f];if(!h)return[];const _=this.reg2bins(t,a),d=[];for(const[c,D]of _)for(let x=c;x<=D;x++)if(h.binIndex[x])for(const m of h.binIndex[x])d.push(new qu(m.minv,m.maxv,x));return tc(d,new tf(0,0))}reg2bins(e,t){e-=1,e<1&&(e=1),t>2**50&&(t=2**34),t-=1;let a=0,o=0,s=this.minShift+this.depth*3;const f=[];for(;a<=this.depth;s-=3,o+=Yv(1,a*3),a+=1){const h=o+ic(e,s),_=o+ic(t,s);if(_-h+f.length>this.maxBinNumber)throw new Error(`query ${e}-${t} is too large for current binning scheme (shift ${this.minShift}, depth ${this.depth}), try a smaller query or a coarser index binning scheme`);f.push([h,_])}return f}}function Qv(n){return/^[\u0000-\u007F]*$/.test(n)}const Ki=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;class ac{constructor({path:e,filehandle:t,url:a,tbiPath:o,tbiUrl:s,tbiFilehandle:f,csiPath:h,csiUrl:_,csiFilehandle:d,renameRefSeqs:c=x=>x,chunkCacheSize:D=5*2**20}){if(t)this.filehandle=t;else if(e)this.filehandle=new Fa(e);else if(a)this.filehandle=new Zn(a);else throw new TypeError("must provide either filehandle or path");if(f)this.index=new Va({filehandle:f,renameRefSeqs:c});else if(d)this.index=new nf({filehandle:d,renameRefSeqs:c});else if(o)this.index=new Va({filehandle:new Fa(o),renameRefSeqs:c});else if(h)this.index=new nf({filehandle:new Fa(h),renameRefSeqs:c});else if(e)this.index=new Va({filehandle:new Fa(`${e}.tbi`),renameRefSeqs:c});else if(_)this.index=new nf({filehandle:new Zn(_)});else if(s)this.index=new Va({filehandle:new Zn(s)});else if(a)this.index=new Va({filehandle:new Zn(`${a}.tbi`)});else throw new TypeError("must provide one of tbiFilehandle, tbiPath, csiFilehandle, csiPath, tbiUrl, csiUrl");this.renameRefSeq=c,this.chunkCache=new Aa({cache:new fh({maxSize:Math.floor(D/65536)}),fill:(x,m)=>this.readChunk(x,{signal:m})})}async getLines(e,t,a,o){var s,f;let h,_={},d;typeof o=="function"?d=o:(_=o,d=o.lineCallback,h=o.signal);const c=await this.index.getMetadata(_);Ha(h);const D=t??0,x=a??c.maxRefLength;if(!(D<=x))throw new TypeError("invalid start and end coordinates. start must be less than or equal to end");if(D===x)return;const m=await this.index.blocksForRange(e,D,x,_);Ha(h);for(const B of m){const{buffer:F,cpositions:I,dpositions:k}=await this.chunkCache.get(B.toString(),B,h);Ha(h);let U=0,$=0;const S=(s=Ki==null?void 0:Ki.decode(F))!==null&&s!==void 0?s:F.toString(),L=F.length<5e8&&Qv(S);for(;U<S.length;){let W,N;if(L){if(N=S.indexOf(`
47
- `,U),N===-1)break;W=S.slice(U,N)}else{if(N=F.indexOf(`
48
- `,U),N===-1)break;const Z=F.slice(U,N);W=(f=Ki==null?void 0:Ki.decode(Z))!==null&&f!==void 0?f:Z.toString()}if(k){for(;U+B.minv.dataPosition>=k[$++];);$--}const{startCoordinate:q,overlaps:H}=this.checkLine(c,e,D,x,W);if(H)d(W,I[$]*256+(U-k[$])+B.minv.dataPosition+1);else if(q!==void 0&&q>=x)return;U=N+1}}}async getMetadata(e={}){return this.index.getMetadata(e)}async getHeaderBuffer(e={}){const{firstDataLine:t,metaChar:a,maxBlockSize:o}=await this.getMetadata(e);Ha(e.signal);const s=((t==null?void 0:t.blockPosition)||0)+o,f=await this._readRegion(0,s,e),h=await jo(f);if(a){let _=-1;const d=10,c=a.charCodeAt(0);for(let D=0;D<h.length&&!(D===_+1&&h[D]!==c);D+=1)h[D]===d&&(_=D);return h.subarray(0,_+1)}return h}async getHeader(e={}){return(await this.getHeaderBuffer(e)).toString("utf8")}async getReferenceSequenceNames(e={}){return(await this.getMetadata(e)).refIdToName}checkLine(e,t,a,o,s){const{columnNumbers:f,metaChar:h,coordinateType:_,format:d}=e;if(h&&s.startsWith(h))return{overlaps:!1};let{ref:c,start:D,end:x}=f;c||(c=0),D||(D=0),x||(x=0),d==="VCF"&&(x=8);const m=Math.max(c,D,x);let B=1,F=0,I="",k=-1/0;const U=s.length;for(let $=0;$<U+1;$++)if(s[$]===" "||$===U){if(B===c){if(this.renameRefSeq(s.slice(F,$))!==t)return{overlaps:!1}}else if(B===D){if(k=parseInt(s.slice(F,$),10),_==="1-based-closed"&&(k-=1),k>=o)return{startCoordinate:k,overlaps:!1};if((x===0||x===D)&&k+1<=a)return{startCoordinate:k,overlaps:!1}}else if(d==="VCF"&&B===4)I=s.slice(F,$);else if(B===x&&(d==="VCF"?this._getVcfEnd(k,I,s.slice(F,$)):Number.parseInt(s.slice(F,$),10))<=a)return{overlaps:!1};if(F=$+1,B+=1,B>m)break}return{startCoordinate:k,overlaps:!0}}_getVcfEnd(e,t,a){let o=e+t.length;const s=a.includes("SVTYPE=TRA");if(a[0]!=="."&&!s){let f=";";for(let h=0;h<a.length;h+=1){if(f===";"&&a.slice(h,h+4)==="END="){let _=a.indexOf(";",h);_===-1&&(_=a.length),o=parseInt(a.slice(h+4,_),10);break}f=a[h]}}else if(s)return e+1;return o}async lineCount(e,t={}){return this.index.lineCount(e,t)}async _readRegion(e,t,a={}){const o=Tn.alloc(t),{bytesRead:s,buffer:f}=await this.filehandle.read(o,0,t,e,a);return f.subarray(0,s)}async readChunk(e,t={}){const a=await this._readRegion(e.minv.blockPosition,e.fetchedSize(),t);return Uv(a,e)}}class Jv{constructor(e,t=null,a=1e5){ue(this,"url");ue(this,"indexUrl");ue(this,"dataLimit");ue(this,"tabix");ue(this,"getData",async(e,t,a)=>{const o=e.map(f=>{let h=a&&a.ensemblStyle?f.chr.replace("chr",""):f.chr;return h==="M"&&(h="MT"),this.getDataForLocus(h,f.start,f.end)}),s=await Promise.all(o);return a&&a.ensemblStyle&&e.forEach((f,h)=>{s[h].forEach(_=>_.chr=f.chr)}),Xt.flatten(s)});ue(this,"getDataForLocus",async(e,t,a)=>{const o=[];await this.tabix.getLines(e,t,a,f=>o.push(f));let s;return o.length>this.dataLimit?s=F_(o,this.dataLimit):s=o,s.map(this._parseLine)});ue(this,"_parseLine",e=>{const t=e.split(" ");if(t.length<3)return;let a={chr:t[0],start:Number.parseInt(t[1],10),end:Number.parseInt(t[2],10),n:t.length};for(let o=3;o<t.length;o++)a[o]=t[o];return a});this.url=e,this.indexUrl=t||e+".tbi",this.dataLimit=a,this.tabix=new ac({filehandle:new Zn(e,{fetch:bo}),tbiFilehandle:new Zn(this.indexUrl,{fetch:bo})})}}const Hu=BigInt(32);function jv(n,e,t){const a=+!!t,o=+!t;return BigInt(n.getInt32(e,t)*o+n.getInt32(e+4,t)*a)<<Hu|BigInt(n.getUint32(e,t)*a+n.getUint32(e+4,t)*o)}function zv(n,e,t){const a=n.getUint32(e,t),o=n.getUint32(e+4,t),s=+!!t,f=+!t;return BigInt(a*f+o*s)<<Hu|BigInt(a*s+o*f)}function ew(n,e,t,a){const o=Number(t>>Hu),s=Number(t&BigInt(4294967295));a?(n.setInt32(e+4,o,a),n.setUint32(e,s,a)):(n.setInt32(e,o,a),n.setUint32(e+4,s,a))}function tw(n,e,t,a){const o=Number(t>>Hu),s=Number(t&BigInt(4294967295));a?(n.setUint32(e+4,o,a),n.setUint32(e,s,a)):(n.setUint32(e,o,a),n.setUint32(e+4,s,a))}"getBigInt64"in DataView||(DataView.prototype.getBigInt64=function(n,e){return jv(this,n,e)}),"getBigUint64"in DataView||(DataView.prototype.getBigUint64=function(n,e){return zv(this,n,e)}),"setBigInt64"in DataView||(DataView.prototype.setBigInt64=function(n,e,t){ew(this,n,e,t)}),"setBigUint64"in DataView||(DataView.prototype.setBigUint64=function(n,e,t){tw(this,n,e,t)});class nw{constructor(e,t){this.code="",this.scopes=[["vars"]],this.bitFields=[],this.tmpVariableCount=0,this.references=new Map,this.imports=[],this.reverseImports=new Map,this.useContextVariables=!1,this.importPath=e,this.useContextVariables=t}generateVariable(e){const t=[...this.scopes[this.scopes.length-1]];return e&&t.push(e),t.join(".")}generateOption(e){switch(typeof e){case"number":return e.toString();case"string":return this.generateVariable(e);case"function":return`${this.addImport(e)}.call(${this.generateVariable()}, vars)`}}generateError(e){this.pushCode(`throw new Error(${e});`)}generateTmpVariable(){return"$tmp"+this.tmpVariableCount++}pushCode(e){this.code+=e+`
49
- `}pushPath(e){e&&this.scopes[this.scopes.length-1].push(e)}popPath(e){e&&this.scopes[this.scopes.length-1].pop()}pushScope(e){this.scopes.push([e])}popScope(){this.scopes.pop()}addImport(e){if(!this.importPath)return`(${e})`;let t=this.reverseImports.get(e);return t||(t=this.imports.push(e)-1,this.reverseImports.set(e,t)),`${this.importPath}[${t}]`}addReference(e){this.references.has(e)||this.references.set(e,{resolved:!1,requested:!1})}markResolved(e){const t=this.references.get(e);t&&(t.resolved=!0)}markRequested(e){e.forEach(t=>{const a=this.references.get(t);a&&(a.requested=!0)})}getUnresolvedReferences(){return Array.from(this.references).filter(([e,t])=>!t.resolved&&!t.requested).map(([e,t])=>e)}}const $n=new Map,pi="___parser_",Ln={uint8:1,uint16le:2,uint16be:2,uint32le:4,uint32be:4,int8:1,int16le:2,int16be:2,int32le:4,int32be:4,int64be:8,int64le:8,uint64be:8,uint64le:8,floatle:4,floatbe:4,doublele:8,doublebe:8},Vu={uint8:"Uint8",uint16le:"Uint16",uint16be:"Uint16",uint32le:"Uint32",uint32be:"Uint32",int8:"Int8",int16le:"Int16",int16be:"Int16",int32le:"Int32",int32be:"Int32",int64be:"BigInt64",int64le:"BigInt64",uint64be:"BigUint64",uint64le:"BigUint64",floatle:"Float32",floatbe:"Float32",doublele:"Float64",doublebe:"Float64"},Zu={uint8:!1,uint16le:!0,uint16be:!1,uint32le:!0,uint32be:!1,int8:!1,int16le:!0,int16be:!1,int32le:!0,int32be:!1,int64be:!1,int64le:!0,uint64be:!1,uint64le:!0,floatle:!0,floatbe:!1,doublele:!0,doublebe:!1};class Ie{constructor(){this.varName="",this.type="",this.options={},this.endian="be",this.useContextVariables=!1}static start(){return new Ie}primitiveGenerateN(e,t){const a=Vu[e],o=Zu[e];t.pushCode(`${t.generateVariable(this.varName)} = dataView.get${a}(offset, ${o});`),t.pushCode(`offset += ${Ln[e]};`)}primitiveN(e,t,a){return this.setNextParser(e,t,a)}useThisEndian(e){return e+this.endian.toLowerCase()}uint8(e,t={}){return this.primitiveN("uint8",e,t)}uint16(e,t={}){return this.primitiveN(this.useThisEndian("uint16"),e,t)}uint16le(e,t={}){return this.primitiveN("uint16le",e,t)}uint16be(e,t={}){return this.primitiveN("uint16be",e,t)}uint32(e,t={}){return this.primitiveN(this.useThisEndian("uint32"),e,t)}uint32le(e,t={}){return this.primitiveN("uint32le",e,t)}uint32be(e,t={}){return this.primitiveN("uint32be",e,t)}int8(e,t={}){return this.primitiveN("int8",e,t)}int16(e,t={}){return this.primitiveN(this.useThisEndian("int16"),e,t)}int16le(e,t={}){return this.primitiveN("int16le",e,t)}int16be(e,t={}){return this.primitiveN("int16be",e,t)}int32(e,t={}){return this.primitiveN(this.useThisEndian("int32"),e,t)}int32le(e,t={}){return this.primitiveN("int32le",e,t)}int32be(e,t={}){return this.primitiveN("int32be",e,t)}bigIntVersionCheck(){if(!DataView.prototype.getBigInt64)throw new Error("BigInt64 is unsupported on this runtime")}int64(e,t={}){return this.bigIntVersionCheck(),this.primitiveN(this.useThisEndian("int64"),e,t)}int64be(e,t={}){return this.bigIntVersionCheck(),this.primitiveN("int64be",e,t)}int64le(e,t={}){return this.bigIntVersionCheck(),this.primitiveN("int64le",e,t)}uint64(e,t={}){return this.bigIntVersionCheck(),this.primitiveN(this.useThisEndian("uint64"),e,t)}uint64be(e,t={}){return this.bigIntVersionCheck(),this.primitiveN("uint64be",e,t)}uint64le(e,t={}){return this.bigIntVersionCheck(),this.primitiveN("uint64le",e,t)}floatle(e,t={}){return this.primitiveN("floatle",e,t)}floatbe(e,t={}){return this.primitiveN("floatbe",e,t)}doublele(e,t={}){return this.primitiveN("doublele",e,t)}doublebe(e,t={}){return this.primitiveN("doublebe",e,t)}bitN(e,t,a){return a.length=e,this.setNextParser("bit",t,a)}bit1(e,t={}){return this.bitN(1,e,t)}bit2(e,t={}){return this.bitN(2,e,t)}bit3(e,t={}){return this.bitN(3,e,t)}bit4(e,t={}){return this.bitN(4,e,t)}bit5(e,t={}){return this.bitN(5,e,t)}bit6(e,t={}){return this.bitN(6,e,t)}bit7(e,t={}){return this.bitN(7,e,t)}bit8(e,t={}){return this.bitN(8,e,t)}bit9(e,t={}){return this.bitN(9,e,t)}bit10(e,t={}){return this.bitN(10,e,t)}bit11(e,t={}){return this.bitN(11,e,t)}bit12(e,t={}){return this.bitN(12,e,t)}bit13(e,t={}){return this.bitN(13,e,t)}bit14(e,t={}){return this.bitN(14,e,t)}bit15(e,t={}){return this.bitN(15,e,t)}bit16(e,t={}){return this.bitN(16,e,t)}bit17(e,t={}){return this.bitN(17,e,t)}bit18(e,t={}){return this.bitN(18,e,t)}bit19(e,t={}){return this.bitN(19,e,t)}bit20(e,t={}){return this.bitN(20,e,t)}bit21(e,t={}){return this.bitN(21,e,t)}bit22(e,t={}){return this.bitN(22,e,t)}bit23(e,t={}){return this.bitN(23,e,t)}bit24(e,t={}){return this.bitN(24,e,t)}bit25(e,t={}){return this.bitN(25,e,t)}bit26(e,t={}){return this.bitN(26,e,t)}bit27(e,t={}){return this.bitN(27,e,t)}bit28(e,t={}){return this.bitN(28,e,t)}bit29(e,t={}){return this.bitN(29,e,t)}bit30(e,t={}){return this.bitN(30,e,t)}bit31(e,t={}){return this.bitN(31,e,t)}bit32(e,t={}){return this.bitN(32,e,t)}namely(e){return $n.set(e,this),this.alias=e,this}skip(e,t={}){return this.seek(e,t)}seek(e,t={}){if(t.assert)throw new Error("assert option on seek is not allowed.");return this.setNextParser("seek","",{length:e})}string(e,t){if(!t.zeroTerminated&&!t.length&&!t.greedy)throw new Error("One of length, zeroTerminated, or greedy must be defined for string.");if((t.zeroTerminated||t.length)&&t.greedy)throw new Error("greedy is mutually exclusive with length and zeroTerminated for string.");if(t.stripNull&&!(t.length||t.greedy))throw new Error("length or greedy must be defined if stripNull is enabled.");return t.encoding=t.encoding||"utf8",this.setNextParser("string",e,t)}buffer(e,t){if(!t.length&&!t.readUntil)throw new Error("length or readUntil must be defined for buffer.");return this.setNextParser("buffer",e,t)}wrapped(e,t){if(typeof t!="object"&&typeof e=="object"&&(t=e,e=""),!t||!t.wrapper||!t.type)throw new Error("Both wrapper and type must be defined for wrapped.");if(!t.length&&!t.readUntil)throw new Error("length or readUntil must be defined for wrapped.");return this.setNextParser("wrapper",e,t)}array(e,t){if(!t.readUntil&&!t.length&&!t.lengthInBytes)throw new Error("One of readUntil, length and lengthInBytes must be defined for array.");if(!t.type)throw new Error("type is required for array.");if(typeof t.type=="string"&&!$n.has(t.type)&&!(t.type in Ln))throw new Error(`Array element type "${t.type}" is unkown.`);return this.setNextParser("array",e,t)}choice(e,t){if(typeof t!="object"&&typeof e=="object"&&(t=e,e=""),!t)throw new Error("tag and choices are are required for choice.");if(!t.tag)throw new Error("tag is requird for choice.");if(!t.choices)throw new Error("choices is required for choice.");for(const a in t.choices){const o=parseInt(a,10),s=t.choices[o];if(isNaN(o))throw new Error(`Choice key "${a}" is not a number.`);if(typeof s=="string"&&!$n.has(s)&&!(s in Ln))throw new Error(`Choice type "${s}" is unkown.`)}return this.setNextParser("choice",e,t)}nest(e,t){if(typeof t!="object"&&typeof e=="object"&&(t=e,e=""),!t||!t.type)throw new Error("type is required for nest.");if(!(t.type instanceof Ie)&&!$n.has(t.type))throw new Error("type must be a known parser name or a Parser object.");if(!(t.type instanceof Ie)&&!e)throw new Error("type must be a Parser object if the variable name is omitted.");return this.setNextParser("nest",e,t)}pointer(e,t){if(!t.offset)throw new Error("offset is required for pointer.");if(!t.type)throw new Error("type is required for pointer.");if(typeof t.type=="string"&&!(t.type in Ln)&&!$n.has(t.type))throw new Error(`Pointer type "${t.type}" is unkown.`);return this.setNextParser("pointer",e,t)}saveOffset(e,t={}){return this.setNextParser("saveOffset",e,t)}endianness(e){switch(e.toLowerCase()){case"little":this.endian="le";break;case"big":this.endian="be";break;default:throw new Error('endianness must be one of "little" or "big"')}return this}endianess(e){return this.endianness(e)}useContextVars(e=!0){return this.useContextVariables=e,this}create(e){if(!(e instanceof Function))throw new Error("Constructor must be a Function object.");return this.constructorFn=e,this}getContext(e){const t=new nw(e,this.useContextVariables);return t.pushCode("var dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);"),this.alias?(this.addAliasedCode(t),t.pushCode(`return ${pi+this.alias}(0).result;`)):this.addRawCode(t),t}getCode(){return this.getContext("imports").code}addRawCode(e){e.pushCode("var offset = 0;"),e.pushCode(`var vars = ${this.constructorFn?"new constructorFn()":"{}"};`),e.pushCode("vars.$parent = null;"),e.pushCode("vars.$root = vars;"),this.generate(e),this.resolveReferences(e),e.pushCode("delete vars.$parent;"),e.pushCode("delete vars.$root;"),e.pushCode("return vars;")}addAliasedCode(e){return e.pushCode(`function ${pi+this.alias}(offset, context) {`),e.pushCode(`var vars = ${this.constructorFn?"new constructorFn()":"{}"};`),e.pushCode("var ctx = Object.assign({$parent: null, $root: vars}, context || {});"),e.pushCode("vars = Object.assign(vars, ctx);"),this.generate(e),e.markResolved(this.alias),this.resolveReferences(e),e.pushCode("Object.keys(ctx).forEach(function (item) { delete vars[item]; });"),e.pushCode("return { offset: offset, result: vars };"),e.pushCode("}"),e}resolveReferences(e){const t=e.getUnresolvedReferences();e.markRequested(t),t.forEach(a=>{var o;(o=$n.get(a))===null||o===void 0||o.addAliasedCode(e)})}compile(){const e="imports",t=this.getContext(e);this.compiled=new Function(e,"TextDecoder",`return function (buffer, constructorFn) { ${t.code} };`)(t.imports,TextDecoder)}sizeOf(){let e=NaN;if(Object.keys(Ln).indexOf(this.type)>=0)e=Ln[this.type];else if(this.type==="string"&&typeof this.options.length=="number")e=this.options.length;else if(this.type==="buffer"&&typeof this.options.length=="number")e=this.options.length;else if(this.type==="array"&&typeof this.options.length=="number"){let t=NaN;typeof this.options.type=="string"?t=Ln[this.options.type]:this.options.type instanceof Ie&&(t=this.options.type.sizeOf()),e=this.options.length*t}else this.type==="seek"?e=this.options.length:this.type==="nest"?e=this.options.type.sizeOf():this.type||(e=0);return this.next&&(e+=this.next.sizeOf()),e}parse(e){return this.compiled||this.compile(),this.compiled(e,this.constructorFn)}setNextParser(e,t,a){const o=new Ie;return o.type=e,o.varName=t,o.options=a,o.endian=this.endian,this.head?this.head.next=o:this.next=o,this.head=o,this}generate(e){if(this.type){switch(this.type){case"uint8":case"uint16le":case"uint16be":case"uint32le":case"uint32be":case"int8":case"int16le":case"int16be":case"int32le":case"int32be":case"int64be":case"int64le":case"uint64be":case"uint64le":case"floatle":case"floatbe":case"doublele":case"doublebe":this.primitiveGenerateN(this.type,e);break;case"bit":this.generateBit(e);break;case"string":this.generateString(e);break;case"buffer":this.generateBuffer(e);break;case"seek":this.generateSeek(e);break;case"nest":this.generateNest(e);break;case"array":this.generateArray(e);break;case"choice":this.generateChoice(e);break;case"pointer":this.generatePointer(e);break;case"saveOffset":this.generateSaveOffset(e);break;case"wrapper":this.generateWrapper(e);break}this.type!=="bit"&&this.generateAssert(e)}const t=e.generateVariable(this.varName);return this.options.formatter&&this.type!=="bit"&&this.generateFormatter(e,t,this.options.formatter),this.generateNext(e)}generateAssert(e){if(!this.options.assert)return;const t=e.generateVariable(this.varName);switch(typeof this.options.assert){case"function":{const a=e.addImport(this.options.assert);e.pushCode(`if (!${a}.call(vars, ${t})) {`)}break;case"number":e.pushCode(`if (${this.options.assert} !== ${t}) {`);break;case"string":e.pushCode(`if (${JSON.stringify(this.options.assert)} !== ${t}) {`);break;default:throw new Error("assert option must be a string, number or a function.")}e.generateError(`"Assertion error: ${t} is " + ${JSON.stringify(this.options.assert.toString())}`),e.pushCode("}")}generateNext(e){return this.next&&(e=this.next.generate(e)),e}generateBit(e){const t=JSON.parse(JSON.stringify(this));if(t.options=this.options,t.generateAssert=this.generateAssert.bind(this),t.generateFormatter=this.generateFormatter.bind(this),t.varName=e.generateVariable(t.varName),e.bitFields.push(t),!this.next||this.next&&["bit","nest"].indexOf(this.next.type)<0){const a=e.generateTmpVariable();e.pushCode(`var ${a} = 0;`);const o=(c=0)=>{let D=0;for(let x=c;x<e.bitFields.length;x++){const m=e.bitFields[x].options.length;if(D+m>32)break;D+=m}return D},s=c=>(c<=8?(e.pushCode(`${a} = dataView.getUint8(offset);`),c=8):c<=16?(e.pushCode(`${a} = dataView.getUint16(offset);`),c=16):c<=24?(e.pushCode(`${a} = (dataView.getUint16(offset) << 8) | dataView.getUint8(offset + 2);`),c=24):(e.pushCode(`${a} = dataView.getUint32(offset);`),c=32),e.pushCode(`offset += ${c/8};`),c);let f=0;const h=this.endian==="be";let _=0,d=0;e.bitFields.forEach((c,D)=>{let x=c.options.length;if(x>d){if(d){const F=-1>>>32-d;e.pushCode(`${c.varName} = (${a} & 0x${F.toString(16)}) << ${x-d};`),x-=d}f=0,d=_=s(o(D)-d)}const m=h?_-f-x:f,B=-1>>>32-x;e.pushCode(`${c.varName} ${x<c.options.length?"|=":"="} ${a} >> ${m} & 0x${B.toString(16)};`),c.options.length===32&&e.pushCode(`${c.varName} >>>= 0`),c.options.assert&&c.generateAssert(e),c.options.formatter&&c.generateFormatter(e,c.varName,c.options.formatter),f+=x,d-=x}),e.bitFields=[]}}generateSeek(e){const t=e.generateOption(this.options.length);e.pushCode(`offset += ${t};`)}generateString(e){const t=e.generateVariable(this.varName),a=e.generateTmpVariable(),o=this.options.encoding,s=o.toLowerCase()==="hex",f='b => b.toString(16).padStart(2, "0")';if(this.options.length&&this.options.zeroTerminated){const h=this.options.length;e.pushCode(`var ${a} = offset;`),e.pushCode(`while(dataView.getUint8(offset++) !== 0 && offset - ${a} < ${h});`);const _=`offset - ${a} < ${h} ? offset - 1 : offset`;e.pushCode(s?`${t} = Array.from(buffer.subarray(${a}, ${_}), ${f}).join('');`:`${t} = new TextDecoder('${o}').decode(buffer.subarray(${a}, ${_}));`)}else if(this.options.length){const h=e.generateOption(this.options.length);e.pushCode(s?`${t} = Array.from(buffer.subarray(offset, offset + ${h}), ${f}).join('');`:`${t} = new TextDecoder('${o}').decode(buffer.subarray(offset, offset + ${h}));`),e.pushCode(`offset += ${h};`)}else this.options.zeroTerminated?(e.pushCode(`var ${a} = offset;`),e.pushCode("while(dataView.getUint8(offset++) !== 0);"),e.pushCode(s?`${t} = Array.from(buffer.subarray(${a}, offset - 1), ${f}).join('');`:`${t} = new TextDecoder('${o}').decode(buffer.subarray(${a}, offset - 1));`)):this.options.greedy&&(e.pushCode(`var ${a} = offset;`),e.pushCode("while(buffer.length > offset++);"),e.pushCode(s?`${t} = Array.from(buffer.subarray(${a}, offset), ${f}).join('');`:`${t} = new TextDecoder('${o}').decode(buffer.subarray(${a}, offset));`));this.options.stripNull&&e.pushCode(`${t} = ${t}.replace(/\\x00+$/g, '')`)}generateBuffer(e){const t=e.generateVariable(this.varName);if(typeof this.options.readUntil=="function"){const a=this.options.readUntil,o=e.generateTmpVariable(),s=e.generateTmpVariable();e.pushCode(`var ${o} = offset;`),e.pushCode(`var ${s} = 0;`),e.pushCode("while (offset < buffer.length) {"),e.pushCode(`${s} = dataView.getUint8(offset);`);const f=e.addImport(a);e.pushCode(`if (${f}.call(${e.generateVariable()}, ${s}, buffer.subarray(offset))) break;`),e.pushCode("offset += 1;"),e.pushCode("}"),e.pushCode(`${t} = buffer.subarray(${o}, offset);`)}else if(this.options.readUntil==="eof")e.pushCode(`${t} = buffer.subarray(offset);`);else{const a=e.generateOption(this.options.length);e.pushCode(`${t} = buffer.subarray(offset, offset + ${a});`),e.pushCode(`offset += ${a};`)}this.options.clone&&e.pushCode(`${t} = buffer.constructor.from(${t});`)}generateArray(e){const t=e.generateOption(this.options.length),a=e.generateOption(this.options.lengthInBytes),o=this.options.type,s=e.generateTmpVariable(),f=e.generateVariable(this.varName),h=e.generateTmpVariable(),_=this.options.key,d=typeof _=="string";if(d?e.pushCode(`${f} = {};`):e.pushCode(`${f} = [];`),typeof this.options.readUntil=="function"?e.pushCode("do {"):this.options.readUntil==="eof"?e.pushCode(`for (var ${s} = 0; offset < buffer.length; ${s}++) {`):a!==void 0?e.pushCode(`for (var ${s} = offset + ${a}; offset < ${s}; ) {`):e.pushCode(`for (var ${s} = ${t}; ${s} > 0; ${s}--) {`),typeof o=="string")if($n.get(o)){const c=e.generateTmpVariable();if(e.pushCode(`var ${c} = ${pi+o}(offset, {`),e.useContextVariables){const D=e.generateVariable();e.pushCode(`$parent: ${D},`),e.pushCode(`$root: ${D}.$root,`),!this.options.readUntil&&a===void 0&&e.pushCode(`$index: ${t} - ${s},`)}e.pushCode("});"),e.pushCode(`var ${h} = ${c}.result; offset = ${c}.offset;`),o!==this.alias&&e.addReference(o)}else{const c=Vu[o],D=Zu[o];e.pushCode(`var ${h} = dataView.get${c}(offset, ${D});`),e.pushCode(`offset += ${Ln[o]};`)}else if(o instanceof Ie){e.pushCode(`var ${h} = {};`);const c=e.generateVariable();e.pushScope(h),e.useContextVariables&&(e.pushCode(`${h}.$parent = ${c};`),e.pushCode(`${h}.$root = ${c}.$root;`),!this.options.readUntil&&a===void 0&&e.pushCode(`${h}.$index = ${t} - ${s};`)),o.generate(e),e.useContextVariables&&(e.pushCode(`delete ${h}.$parent;`),e.pushCode(`delete ${h}.$root;`),e.pushCode(`delete ${h}.$index;`)),e.popScope()}if(d?e.pushCode(`${f}[${h}.${_}] = ${h};`):e.pushCode(`${f}.push(${h});`),e.pushCode("}"),typeof this.options.readUntil=="function"){const c=this.options.readUntil,D=e.addImport(c);e.pushCode(`while (!${D}.call(${e.generateVariable()}, ${h}, buffer.subarray(offset)));`)}}generateChoiceCase(e,t,a){if(typeof a=="string"){const o=e.generateVariable(this.varName);if($n.has(a)){const s=e.generateTmpVariable();e.pushCode(`var ${s} = ${pi+a}(offset, {`),e.useContextVariables&&(e.pushCode(`$parent: ${o}.$parent,`),e.pushCode(`$root: ${o}.$root,`)),e.pushCode("});"),e.pushCode(`${o} = ${s}.result; offset = ${s}.offset;`),a!==this.alias&&e.addReference(a)}else{const s=Vu[a],f=Zu[a];e.pushCode(`${o} = dataView.get${s}(offset, ${f});`),e.pushCode(`offset += ${Ln[a]}`)}}else a instanceof Ie&&(e.pushPath(t),a.generate(e),e.popPath(t))}generateChoice(e){const t=e.generateOption(this.options.tag),a=e.generateVariable(this.varName);if(this.varName&&(e.pushCode(`${a} = {};`),e.useContextVariables)){const o=e.generateVariable();e.pushCode(`${a}.$parent = ${o};`),e.pushCode(`${a}.$root = ${o}.$root;`)}e.pushCode(`switch(${t}) {`);for(const o in this.options.choices){const s=parseInt(o,10),f=this.options.choices[s];e.pushCode(`case ${s}:`),this.generateChoiceCase(e,this.varName,f),e.pushCode("break;")}e.pushCode("default:"),this.options.defaultChoice?this.generateChoiceCase(e,this.varName,this.options.defaultChoice):e.generateError(`"Met undefined tag value " + ${t} + " at choice"`),e.pushCode("}"),this.varName&&e.useContextVariables&&(e.pushCode(`delete ${a}.$parent;`),e.pushCode(`delete ${a}.$root;`))}generateNest(e){const t=e.generateVariable(this.varName);if(this.options.type instanceof Ie){if(this.varName&&(e.pushCode(`${t} = {};`),e.useContextVariables)){const a=e.generateVariable();e.pushCode(`${t}.$parent = ${a};`),e.pushCode(`${t}.$root = ${a}.$root;`)}e.pushPath(this.varName),this.options.type.generate(e),e.popPath(this.varName),this.varName&&e.useContextVariables&&e.useContextVariables&&(e.pushCode(`delete ${t}.$parent;`),e.pushCode(`delete ${t}.$root;`))}else if($n.has(this.options.type)){const a=e.generateTmpVariable();if(e.pushCode(`var ${a} = ${pi+this.options.type}(offset, {`),e.useContextVariables){const o=e.generateVariable();e.pushCode(`$parent: ${o},`),e.pushCode(`$root: ${o}.$root,`)}e.pushCode("});"),e.pushCode(`${t} = ${a}.result; offset = ${a}.offset;`),this.options.type!==this.alias&&e.addReference(this.options.type)}}generateWrapper(e){const t=e.generateVariable(this.varName),a=e.generateTmpVariable();if(typeof this.options.readUntil=="function"){const _=this.options.readUntil,d=e.generateTmpVariable(),c=e.generateTmpVariable();e.pushCode(`var ${d} = offset;`),e.pushCode(`var ${c} = 0;`),e.pushCode("while (offset < buffer.length) {"),e.pushCode(`${c} = dataView.getUint8(offset);`);const D=e.addImport(_);e.pushCode(`if (${D}.call(${e.generateVariable()}, ${c}, buffer.subarray(offset))) break;`),e.pushCode("offset += 1;"),e.pushCode("}"),e.pushCode(`${a} = buffer.subarray(${d}, offset);`)}else if(this.options.readUntil==="eof")e.pushCode(`${a} = buffer.subarray(offset);`);else{const _=e.generateOption(this.options.length);e.pushCode(`${a} = buffer.subarray(offset, offset + ${_});`),e.pushCode(`offset += ${_};`)}this.options.clone&&e.pushCode(`${a} = buffer.constructor.from(${a});`);const o=e.generateTmpVariable(),s=e.generateTmpVariable(),f=e.generateTmpVariable(),h=e.addImport(this.options.wrapper);if(e.pushCode(`${a} = ${h}.call(this, ${a}).subarray(0);`),e.pushCode(`var ${o} = buffer;`),e.pushCode(`var ${s} = offset;`),e.pushCode(`var ${f} = dataView;`),e.pushCode(`buffer = ${a};`),e.pushCode("offset = 0;"),e.pushCode("dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);"),this.options.type instanceof Ie)this.varName&&e.pushCode(`${t} = {};`),e.pushPath(this.varName),this.options.type.generate(e),e.popPath(this.varName);else if($n.has(this.options.type)){const _=e.generateTmpVariable();e.pushCode(`var ${_} = ${pi+this.options.type}(0);`),e.pushCode(`${t} = ${_}.result;`),this.options.type!==this.alias&&e.addReference(this.options.type)}e.pushCode(`buffer = ${o};`),e.pushCode(`dataView = ${f};`),e.pushCode(`offset = ${s};`)}generateFormatter(e,t,a){if(typeof a=="function"){const o=e.addImport(a);e.pushCode(`${t} = ${o}.call(${e.generateVariable()}, ${t});`)}}generatePointer(e){const t=this.options.type,a=e.generateOption(this.options.offset),o=e.generateTmpVariable(),s=e.generateVariable(this.varName);if(e.pushCode(`var ${o} = offset;`),e.pushCode(`offset = ${a};`),this.options.type instanceof Ie){if(e.pushCode(`${s} = {};`),e.useContextVariables){const f=e.generateVariable();e.pushCode(`${s}.$parent = ${f};`),e.pushCode(`${s}.$root = ${f}.$root;`)}e.pushPath(this.varName),this.options.type.generate(e),e.popPath(this.varName),e.useContextVariables&&(e.pushCode(`delete ${s}.$parent;`),e.pushCode(`delete ${s}.$root;`))}else if($n.has(this.options.type)){const f=e.generateTmpVariable();if(e.pushCode(`var ${f} = ${pi+this.options.type}(offset, {`),e.useContextVariables){const h=e.generateVariable();e.pushCode(`$parent: ${h},`),e.pushCode(`$root: ${h}.$root,`)}e.pushCode("});"),e.pushCode(`${s} = ${f}.result; offset = ${f}.offset;`),this.options.type!==this.alias&&e.addReference(this.options.type)}else if(Object.keys(Ln).indexOf(this.options.type)>=0){const f=Vu[t],h=Zu[t];e.pushCode(`${s} = dataView.get${f}(offset, ${h});`),e.pushCode(`offset += ${Ln[t]};`)}e.pushCode(`offset = ${o};`)}generateSaveOffset(e){const t=e.generateVariable(this.varName);e.pushCode(`${t} = offset`)}}let uc=class js{constructor(e){this.ranges=e}get min(){return this.ranges[0].min}get max(){return this.ranges[this.ranges.length-1].max}contains(e){for(const t of this.ranges)if(t.min<=e&&t.max>=e)return!0;return!1}isContiguous(){return this.ranges.length>1}getRanges(){return this.ranges.map(e=>new js([{min:e.min,max:e.max}]))}toString(){return this.ranges.map(e=>`[${e.min}-${e.max}]`).join(",")}union(e){const t=[...this.getRanges(),...e.getRanges()].sort((s,f)=>s.min<f.min?-1:s.min>f.min?1:s.max<f.max?-1:f.max>s.max?1:0),a=[];let o=t[0];for(const s of t)s.min>o.max+1?(a.push(o),o=s):s.max>o.max&&(o=new js([{min:o.min,max:s.max}]));return a.push(o),a.length===1?a[0]:new js(a)}};function Yi(n){let e=n.length;for(;--e>=0;)n[e]=0}const rw=3,iw=258,sc=29,aw=256+1+sc,oc=30,uw=512,sw=new Array((aw+2)*2);Yi(sw);const ow=new Array(oc*2);Yi(ow);const fw=new Array(uw);Yi(fw);const lw=new Array(iw-rw+1);Yi(lw);const hw=new Array(sc);Yi(hw);const cw=new Array(oc);Yi(cw);var rf=(n,e,t,a)=>{let o=n&65535|0,s=n>>>16&65535|0,f=0;for(;t!==0;){f=t>2e3?2e3:t,t-=f;do o=o+e[a++]|0,s=s+o|0;while(--f);o%=65521,s%=65521}return o|s<<16|0};const dw=()=>{let n,e=[];for(var t=0;t<256;t++){n=t;for(var a=0;a<8;a++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e},pw=new Uint32Array(dw());var jn=(n,e,t,a)=>{const o=pw,s=a+t;n^=-1;for(let f=a;f<s;f++)n=n>>>8^o[(n^e[f])&255];return n^-1},af={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},fc={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const gw=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var _w=function(n){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const a in t)gw(t,a)&&(n[a]=t[a])}}return n},vw=n=>{let e=0;for(let a=0,o=n.length;a<o;a++)e+=n[a].length;const t=new Uint8Array(e);for(let a=0,o=0,s=n.length;a<s;a++){let f=n[a];t.set(f,o),o+=f.length}return t},lc={assign:_w,flattenChunks:vw};let hc=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{hc=!1}const Za=new Uint8Array(256);for(let n=0;n<256;n++)Za[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;Za[254]=Za[254]=1;var ww=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let e,t,a,o,s,f=n.length,h=0;for(o=0;o<f;o++)t=n.charCodeAt(o),(t&64512)===55296&&o+1<f&&(a=n.charCodeAt(o+1),(a&64512)===56320&&(t=65536+(t-55296<<10)+(a-56320),o++)),h+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(h),s=0,o=0;s<h;o++)t=n.charCodeAt(o),(t&64512)===55296&&o+1<f&&(a=n.charCodeAt(o+1),(a&64512)===56320&&(t=65536+(t-55296<<10)+(a-56320),o++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e};const bw=(n,e)=>{if(e<65534&&n.subarray&&hc)return String.fromCharCode.apply(null,n.length===e?n:n.subarray(0,e));let t="";for(let a=0;a<e;a++)t+=String.fromCharCode(n[a]);return t};var mw=(n,e)=>{const t=e||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,e));let a,o;const s=new Array(t*2);for(o=0,a=0;a<t;){let f=n[a++];if(f<128){s[o++]=f;continue}let h=Za[f];if(h>4){s[o++]=65533,a+=h-1;continue}for(f&=h===2?31:h===3?15:7;h>1&&a<t;)f=f<<6|n[a++]&63,h--;if(h>1){s[o++]=65533;continue}f<65536?s[o++]=f:(f-=65536,s[o++]=55296|f>>10&1023,s[o++]=56320|f&1023)}return bw(s,o)},Dw=(n,e)=>{e=e||n.length,e>n.length&&(e=n.length);let t=e-1;for(;t>=0&&(n[t]&192)===128;)t--;return t<0||t===0?e:t+Za[n[t]]>e?t:e},uf={string2buf:ww,buf2string:mw,utf8border:Dw};function yw(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var xw=yw;const Xu=16209,Ew=16191;var Cw=function(e,t){let a,o,s,f,h,_,d,c,D,x,m,B,F,I,k,U,$,S,L,W,N,q,H,Z;const Y=e.state;a=e.next_in,H=e.input,o=a+(e.avail_in-5),s=e.next_out,Z=e.output,f=s-(t-e.avail_out),h=s+(e.avail_out-257),_=Y.dmax,d=Y.wsize,c=Y.whave,D=Y.wnext,x=Y.window,m=Y.hold,B=Y.bits,F=Y.lencode,I=Y.distcode,k=(1<<Y.lenbits)-1,U=(1<<Y.distbits)-1;e:do{B<15&&(m+=H[a++]<<B,B+=8,m+=H[a++]<<B,B+=8),$=F[m&k];t:for(;;){if(S=$>>>24,m>>>=S,B-=S,S=$>>>16&255,S===0)Z[s++]=$&65535;else if(S&16){L=$&65535,S&=15,S&&(B<S&&(m+=H[a++]<<B,B+=8),L+=m&(1<<S)-1,m>>>=S,B-=S),B<15&&(m+=H[a++]<<B,B+=8,m+=H[a++]<<B,B+=8),$=I[m&U];n:for(;;){if(S=$>>>24,m>>>=S,B-=S,S=$>>>16&255,S&16){if(W=$&65535,S&=15,B<S&&(m+=H[a++]<<B,B+=8,B<S&&(m+=H[a++]<<B,B+=8)),W+=m&(1<<S)-1,W>_){e.msg="invalid distance too far back",Y.mode=Xu;break e}if(m>>>=S,B-=S,S=s-f,W>S){if(S=W-S,S>c&&Y.sane){e.msg="invalid distance too far back",Y.mode=Xu;break e}if(N=0,q=x,D===0){if(N+=d-S,S<L){L-=S;do Z[s++]=x[N++];while(--S);N=s-W,q=Z}}else if(D<S){if(N+=d+D-S,S-=D,S<L){L-=S;do Z[s++]=x[N++];while(--S);if(N=0,D<L){S=D,L-=S;do Z[s++]=x[N++];while(--S);N=s-W,q=Z}}}else if(N+=D-S,S<L){L-=S;do Z[s++]=x[N++];while(--S);N=s-W,q=Z}for(;L>2;)Z[s++]=q[N++],Z[s++]=q[N++],Z[s++]=q[N++],L-=3;L&&(Z[s++]=q[N++],L>1&&(Z[s++]=q[N++]))}else{N=s-W;do Z[s++]=Z[N++],Z[s++]=Z[N++],Z[s++]=Z[N++],L-=3;while(L>2);L&&(Z[s++]=Z[N++],L>1&&(Z[s++]=Z[N++]))}}else if(S&64){e.msg="invalid distance code",Y.mode=Xu;break e}else{$=I[($&65535)+(m&(1<<S)-1)];continue n}break}}else if(S&64)if(S&32){Y.mode=Ew;break e}else{e.msg="invalid literal/length code",Y.mode=Xu;break e}else{$=F[($&65535)+(m&(1<<S)-1)];continue t}break}}while(a<o&&s<h);L=B>>3,a-=L,B-=L<<3,m&=(1<<B)-1,e.next_in=a,e.next_out=s,e.avail_in=a<o?5+(o-a):5-(a-o),e.avail_out=s<h?257+(h-s):257-(s-h),Y.hold=m,Y.bits=B};const Qi=15,cc=852,dc=592,pc=0,sf=1,gc=2,Aw=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Fw=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Bw=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Sw=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Xa=(n,e,t,a,o,s,f,h)=>{const _=h.bits;let d=0,c=0,D=0,x=0,m=0,B=0,F=0,I=0,k=0,U=0,$,S,L,W,N,q=null,H;const Z=new Uint16Array(Qi+1),Y=new Uint16Array(Qi+1);let re=null,se,fe,ce;for(d=0;d<=Qi;d++)Z[d]=0;for(c=0;c<a;c++)Z[e[t+c]]++;for(m=_,x=Qi;x>=1&&Z[x]===0;x--);if(m>x&&(m=x),x===0)return o[s++]=1<<24|64<<16|0,o[s++]=1<<24|64<<16|0,h.bits=1,0;for(D=1;D<x&&Z[D]===0;D++);for(m<D&&(m=D),I=1,d=1;d<=Qi;d++)if(I<<=1,I-=Z[d],I<0)return-1;if(I>0&&(n===pc||x!==1))return-1;for(Y[1]=0,d=1;d<Qi;d++)Y[d+1]=Y[d]+Z[d];for(c=0;c<a;c++)e[t+c]!==0&&(f[Y[e[t+c]]++]=c);if(n===pc?(q=re=f,H=20):n===sf?(q=Aw,re=Fw,H=257):(q=Bw,re=Sw,H=0),U=0,c=0,d=D,N=s,B=m,F=0,L=-1,k=1<<m,W=k-1,n===sf&&k>cc||n===gc&&k>dc)return 1;for(;;){se=d-F,f[c]+1<H?(fe=0,ce=f[c]):f[c]>=H?(fe=re[f[c]-H],ce=q[f[c]-H]):(fe=96,ce=0),$=1<<d-F,S=1<<B,D=S;do S-=$,o[N+(U>>F)+S]=se<<24|fe<<16|ce|0;while(S!==0);for($=1<<d-1;U&$;)$>>=1;if($!==0?(U&=$-1,U+=$):U=0,c++,--Z[d]===0){if(d===x)break;d=e[t+f[c]]}if(d>m&&(U&W)!==L){for(F===0&&(F=m),N+=D,B=d-F,I=1<<B;B+F<x&&(I-=Z[B+F],!(I<=0));)B++,I<<=1;if(k+=1<<B,n===sf&&k>cc||n===gc&&k>dc)return 1;L=U&W,o[L]=m<<24|B<<16|N-s|0}}return U!==0&&(o[N+U]=d-F<<24|64<<16|0),h.bits=m,0};const Iw=0,_c=1,vc=2,{Z_FINISH:wc,Z_BLOCK:Tw,Z_TREES:Ku,Z_OK:gi,Z_STREAM_END:kw,Z_NEED_DICT:Rw,Z_STREAM_ERROR:dn,Z_DATA_ERROR:bc,Z_MEM_ERROR:mc,Z_BUF_ERROR:Nw,Z_DEFLATED:Dc}=fc,Yu=16180,yc=16181,xc=16182,Ec=16183,Cc=16184,Ac=16185,Fc=16186,Bc=16187,Sc=16188,Ic=16189,Qu=16190,cr=16191,of=16192,Tc=16193,ff=16194,kc=16195,Rc=16196,Nc=16197,$c=16198,Ju=16199,ju=16200,Lc=16201,Oc=16202,Pc=16203,Mc=16204,Uc=16205,lf=16206,Wc=16207,Gc=16208,Qe=16209,qc=16210,Hc=16211,$w=852,Lw=592,Ow=15,Vc=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function Pw(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const _i=n=>{if(!n)return 1;const e=n.state;return!e||e.strm!==n||e.mode<Yu||e.mode>Hc?1:0},Zc=n=>{if(_i(n))return dn;const e=n.state;return n.total_in=n.total_out=e.total=0,n.msg="",e.wrap&&(n.adler=e.wrap&1),e.mode=Yu,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array($w),e.distcode=e.distdyn=new Int32Array(Lw),e.sane=1,e.back=-1,gi},Xc=n=>{if(_i(n))return dn;const e=n.state;return e.wsize=0,e.whave=0,e.wnext=0,Zc(n)},Kc=(n,e)=>{let t;if(_i(n))return dn;const a=n.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?dn:(a.window!==null&&a.wbits!==e&&(a.window=null),a.wrap=t,a.wbits=e,Xc(n))},Yc=(n,e)=>{if(!n)return dn;const t=new Pw;n.state=t,t.strm=n,t.window=null,t.mode=Yu;const a=Kc(n,e);return a!==gi&&(n.state=null),a},Mw=n=>Yc(n,Ow);let Qc=!0,hf,cf;const Uw=n=>{if(Qc){hf=new Int32Array(512),cf=new Int32Array(32);let e=0;for(;e<144;)n.lens[e++]=8;for(;e<256;)n.lens[e++]=9;for(;e<280;)n.lens[e++]=7;for(;e<288;)n.lens[e++]=8;for(Xa(_c,n.lens,0,288,hf,0,n.work,{bits:9}),e=0;e<32;)n.lens[e++]=5;Xa(vc,n.lens,0,32,cf,0,n.work,{bits:5}),Qc=!1}n.lencode=hf,n.lenbits=9,n.distcode=cf,n.distbits=5},Jc=(n,e,t,a)=>{let o;const s=n.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),a>=s.wsize?(s.window.set(e.subarray(t-s.wsize,t),0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>a&&(o=a),s.window.set(e.subarray(t-a,t-a+o),s.wnext),a-=o,a?(s.window.set(e.subarray(t-a,t),0),s.wnext=a,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0},Ww=(n,e)=>{let t,a,o,s,f,h,_,d,c,D,x,m,B,F,I=0,k,U,$,S,L,W,N,q;const H=new Uint8Array(4);let Z,Y;const re=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(_i(n)||!n.output||!n.input&&n.avail_in!==0)return dn;t=n.state,t.mode===cr&&(t.mode=of),f=n.next_out,o=n.output,_=n.avail_out,s=n.next_in,a=n.input,h=n.avail_in,d=t.hold,c=t.bits,D=h,x=_,q=gi;e:for(;;)switch(t.mode){case Yu:if(t.wrap===0){t.mode=of;break}for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.wrap&2&&d===35615){t.wbits===0&&(t.wbits=15),t.check=0,H[0]=d&255,H[1]=d>>>8&255,t.check=jn(t.check,H,2,0),d=0,c=0,t.mode=yc;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((d&255)<<8)+(d>>8))%31){n.msg="incorrect header check",t.mode=Qe;break}if((d&15)!==Dc){n.msg="unknown compression method",t.mode=Qe;break}if(d>>>=4,c-=4,N=(d&15)+8,t.wbits===0&&(t.wbits=N),N>15||N>t.wbits){n.msg="invalid window size",t.mode=Qe;break}t.dmax=1<<t.wbits,t.flags=0,n.adler=t.check=1,t.mode=d&512?Ic:cr,d=0,c=0;break;case yc:for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.flags=d,(t.flags&255)!==Dc){n.msg="unknown compression method",t.mode=Qe;break}if(t.flags&57344){n.msg="unknown header flags set",t.mode=Qe;break}t.head&&(t.head.text=d>>8&1),t.flags&512&&t.wrap&4&&(H[0]=d&255,H[1]=d>>>8&255,t.check=jn(t.check,H,2,0)),d=0,c=0,t.mode=xc;case xc:for(;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.head&&(t.head.time=d),t.flags&512&&t.wrap&4&&(H[0]=d&255,H[1]=d>>>8&255,H[2]=d>>>16&255,H[3]=d>>>24&255,t.check=jn(t.check,H,4,0)),d=0,c=0,t.mode=Ec;case Ec:for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.head&&(t.head.xflags=d&255,t.head.os=d>>8),t.flags&512&&t.wrap&4&&(H[0]=d&255,H[1]=d>>>8&255,t.check=jn(t.check,H,2,0)),d=0,c=0,t.mode=Cc;case Cc:if(t.flags&1024){for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.length=d,t.head&&(t.head.extra_len=d),t.flags&512&&t.wrap&4&&(H[0]=d&255,H[1]=d>>>8&255,t.check=jn(t.check,H,2,0)),d=0,c=0}else t.head&&(t.head.extra=null);t.mode=Ac;case Ac:if(t.flags&1024&&(m=t.length,m>h&&(m=h),m&&(t.head&&(N=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(a.subarray(s,s+m),N)),t.flags&512&&t.wrap&4&&(t.check=jn(t.check,a,m,s)),h-=m,s+=m,t.length-=m),t.length))break e;t.length=0,t.mode=Fc;case Fc:if(t.flags&2048){if(h===0)break e;m=0;do N=a[s+m++],t.head&&N&&t.length<65536&&(t.head.name+=String.fromCharCode(N));while(N&&m<h);if(t.flags&512&&t.wrap&4&&(t.check=jn(t.check,a,m,s)),h-=m,s+=m,N)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=Bc;case Bc:if(t.flags&4096){if(h===0)break e;m=0;do N=a[s+m++],t.head&&N&&t.length<65536&&(t.head.comment+=String.fromCharCode(N));while(N&&m<h);if(t.flags&512&&t.wrap&4&&(t.check=jn(t.check,a,m,s)),h-=m,s+=m,N)break e}else t.head&&(t.head.comment=null);t.mode=Sc;case Sc:if(t.flags&512){for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.wrap&4&&d!==(t.check&65535)){n.msg="header crc mismatch",t.mode=Qe;break}d=0,c=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),n.adler=t.check=0,t.mode=cr;break;case Ic:for(;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}n.adler=t.check=Vc(d),d=0,c=0,t.mode=Qu;case Qu:if(t.havedict===0)return n.next_out=f,n.avail_out=_,n.next_in=s,n.avail_in=h,t.hold=d,t.bits=c,Rw;n.adler=t.check=1,t.mode=cr;case cr:if(e===Tw||e===Ku)break e;case of:if(t.last){d>>>=c&7,c-=c&7,t.mode=lf;break}for(;c<3;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}switch(t.last=d&1,d>>>=1,c-=1,d&3){case 0:t.mode=Tc;break;case 1:if(Uw(t),t.mode=Ju,e===Ku){d>>>=2,c-=2;break e}break;case 2:t.mode=Rc;break;case 3:n.msg="invalid block type",t.mode=Qe}d>>>=2,c-=2;break;case Tc:for(d>>>=c&7,c-=c&7;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if((d&65535)!==(d>>>16^65535)){n.msg="invalid stored block lengths",t.mode=Qe;break}if(t.length=d&65535,d=0,c=0,t.mode=ff,e===Ku)break e;case ff:t.mode=kc;case kc:if(m=t.length,m){if(m>h&&(m=h),m>_&&(m=_),m===0)break e;o.set(a.subarray(s,s+m),f),h-=m,s+=m,_-=m,f+=m,t.length-=m;break}t.mode=cr;break;case Rc:for(;c<14;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.nlen=(d&31)+257,d>>>=5,c-=5,t.ndist=(d&31)+1,d>>>=5,c-=5,t.ncode=(d&15)+4,d>>>=4,c-=4,t.nlen>286||t.ndist>30){n.msg="too many length or distance symbols",t.mode=Qe;break}t.have=0,t.mode=Nc;case Nc:for(;t.have<t.ncode;){for(;c<3;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.lens[re[t.have++]]=d&7,d>>>=3,c-=3}for(;t.have<19;)t.lens[re[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,Z={bits:t.lenbits},q=Xa(Iw,t.lens,0,19,t.lencode,0,t.work,Z),t.lenbits=Z.bits,q){n.msg="invalid code lengths set",t.mode=Qe;break}t.have=0,t.mode=$c;case $c:for(;t.have<t.nlen+t.ndist;){for(;I=t.lencode[d&(1<<t.lenbits)-1],k=I>>>24,U=I>>>16&255,$=I&65535,!(k<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if($<16)d>>>=k,c-=k,t.lens[t.have++]=$;else{if($===16){for(Y=k+2;c<Y;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(d>>>=k,c-=k,t.have===0){n.msg="invalid bit length repeat",t.mode=Qe;break}N=t.lens[t.have-1],m=3+(d&3),d>>>=2,c-=2}else if($===17){for(Y=k+3;c<Y;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=k,c-=k,N=0,m=3+(d&7),d>>>=3,c-=3}else{for(Y=k+7;c<Y;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=k,c-=k,N=0,m=11+(d&127),d>>>=7,c-=7}if(t.have+m>t.nlen+t.ndist){n.msg="invalid bit length repeat",t.mode=Qe;break}for(;m--;)t.lens[t.have++]=N}}if(t.mode===Qe)break;if(t.lens[256]===0){n.msg="invalid code -- missing end-of-block",t.mode=Qe;break}if(t.lenbits=9,Z={bits:t.lenbits},q=Xa(_c,t.lens,0,t.nlen,t.lencode,0,t.work,Z),t.lenbits=Z.bits,q){n.msg="invalid literal/lengths set",t.mode=Qe;break}if(t.distbits=6,t.distcode=t.distdyn,Z={bits:t.distbits},q=Xa(vc,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,Z),t.distbits=Z.bits,q){n.msg="invalid distances set",t.mode=Qe;break}if(t.mode=Ju,e===Ku)break e;case Ju:t.mode=ju;case ju:if(h>=6&&_>=258){n.next_out=f,n.avail_out=_,n.next_in=s,n.avail_in=h,t.hold=d,t.bits=c,Cw(n,x),f=n.next_out,o=n.output,_=n.avail_out,s=n.next_in,a=n.input,h=n.avail_in,d=t.hold,c=t.bits,t.mode===cr&&(t.back=-1);break}for(t.back=0;I=t.lencode[d&(1<<t.lenbits)-1],k=I>>>24,U=I>>>16&255,$=I&65535,!(k<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(U&&!(U&240)){for(S=k,L=U,W=$;I=t.lencode[W+((d&(1<<S+L)-1)>>S)],k=I>>>24,U=I>>>16&255,$=I&65535,!(S+k<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=S,c-=S,t.back+=S}if(d>>>=k,c-=k,t.back+=k,t.length=$,U===0){t.mode=Uc;break}if(U&32){t.back=-1,t.mode=cr;break}if(U&64){n.msg="invalid literal/length code",t.mode=Qe;break}t.extra=U&15,t.mode=Lc;case Lc:if(t.extra){for(Y=t.extra;c<Y;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.length+=d&(1<<t.extra)-1,d>>>=t.extra,c-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Oc;case Oc:for(;I=t.distcode[d&(1<<t.distbits)-1],k=I>>>24,U=I>>>16&255,$=I&65535,!(k<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(!(U&240)){for(S=k,L=U,W=$;I=t.distcode[W+((d&(1<<S+L)-1)>>S)],k=I>>>24,U=I>>>16&255,$=I&65535,!(S+k<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=S,c-=S,t.back+=S}if(d>>>=k,c-=k,t.back+=k,U&64){n.msg="invalid distance code",t.mode=Qe;break}t.offset=$,t.extra=U&15,t.mode=Pc;case Pc:if(t.extra){for(Y=t.extra;c<Y;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.offset+=d&(1<<t.extra)-1,d>>>=t.extra,c-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){n.msg="invalid distance too far back",t.mode=Qe;break}t.mode=Mc;case Mc:if(_===0)break e;if(m=x-_,t.offset>m){if(m=t.offset-m,m>t.whave&&t.sane){n.msg="invalid distance too far back",t.mode=Qe;break}m>t.wnext?(m-=t.wnext,B=t.wsize-m):B=t.wnext-m,m>t.length&&(m=t.length),F=t.window}else F=o,B=f-t.offset,m=t.length;m>_&&(m=_),_-=m,t.length-=m;do o[f++]=F[B++];while(--m);t.length===0&&(t.mode=ju);break;case Uc:if(_===0)break e;o[f++]=t.length,_--,t.mode=ju;break;case lf:if(t.wrap){for(;c<32;){if(h===0)break e;h--,d|=a[s++]<<c,c+=8}if(x-=_,n.total_out+=x,t.total+=x,t.wrap&4&&x&&(n.adler=t.check=t.flags?jn(t.check,o,x,f-x):rf(t.check,o,x,f-x)),x=_,t.wrap&4&&(t.flags?d:Vc(d))!==t.check){n.msg="incorrect data check",t.mode=Qe;break}d=0,c=0}t.mode=Wc;case Wc:if(t.wrap&&t.flags){for(;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.wrap&4&&d!==(t.total&4294967295)){n.msg="incorrect length check",t.mode=Qe;break}d=0,c=0}t.mode=Gc;case Gc:q=kw;break e;case Qe:q=bc;break e;case qc:return mc;case Hc:default:return dn}return n.next_out=f,n.avail_out=_,n.next_in=s,n.avail_in=h,t.hold=d,t.bits=c,(t.wsize||x!==n.avail_out&&t.mode<Qe&&(t.mode<lf||e!==wc))&&Jc(n,n.output,n.next_out,x-n.avail_out),D-=n.avail_in,x-=n.avail_out,n.total_in+=D,n.total_out+=x,t.total+=x,t.wrap&4&&x&&(n.adler=t.check=t.flags?jn(t.check,o,x,n.next_out-x):rf(t.check,o,x,n.next_out-x)),n.data_type=t.bits+(t.last?64:0)+(t.mode===cr?128:0)+(t.mode===Ju||t.mode===ff?256:0),(D===0&&x===0||e===wc)&&q===gi&&(q=Nw),q},Gw=n=>{if(_i(n))return dn;let e=n.state;return e.window&&(e.window=null),n.state=null,gi},qw=(n,e)=>{if(_i(n))return dn;const t=n.state;return t.wrap&2?(t.head=e,e.done=!1,gi):dn},Hw=(n,e)=>{const t=e.length;let a,o,s;return _i(n)||(a=n.state,a.wrap!==0&&a.mode!==Qu)?dn:a.mode===Qu&&(o=1,o=rf(o,e,t,0),o!==a.check)?bc:(s=Jc(n,e,t,t),s?(a.mode=qc,mc):(a.havedict=1,gi))};var Vw=Xc,Zw=Kc,Xw=Zc,Kw=Mw,Yw=Yc,Qw=Ww,Jw=Gw,jw=qw,zw=Hw,eb="pako inflate (from Nodeca project)",dr={inflateReset:Vw,inflateReset2:Zw,inflateResetKeep:Xw,inflateInit:Kw,inflateInit2:Yw,inflate:Qw,inflateEnd:Jw,inflateGetHeader:jw,inflateSetDictionary:zw,inflateInfo:eb};function tb(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var nb=tb;const jc=Object.prototype.toString,{Z_NO_FLUSH:rb,Z_FINISH:ib,Z_OK:Ka,Z_STREAM_END:df,Z_NEED_DICT:pf,Z_STREAM_ERROR:ab,Z_DATA_ERROR:zc,Z_MEM_ERROR:ub}=fc;function zu(n){this.options=lc.assign({chunkSize:1024*64,windowBits:15,to:""},n||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(n&&n.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new xw,this.strm.avail_out=0;let t=dr.inflateInit2(this.strm,e.windowBits);if(t!==Ka)throw new Error(af[t]);if(this.header=new nb,dr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=uf.string2buf(e.dictionary):jc.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=dr.inflateSetDictionary(this.strm,e.dictionary),t!==Ka)))throw new Error(af[t])}zu.prototype.push=function(n,e){const t=this.strm,a=this.options.chunkSize,o=this.options.dictionary;let s,f,h;if(this.ended)return!1;for(e===~~e?f=e:f=e===!0?ib:rb,jc.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(a),t.next_out=0,t.avail_out=a),s=dr.inflate(t,f),s===pf&&o&&(s=dr.inflateSetDictionary(t,o),s===Ka?s=dr.inflate(t,f):s===zc&&(s=pf));t.avail_in>0&&s===df&&t.state.wrap>0&&n[t.next_in]!==0;)dr.inflateReset(t),s=dr.inflate(t,f);switch(s){case ab:case zc:case pf:case ub:return this.onEnd(s),this.ended=!0,!1}if(h=t.avail_out,t.next_out&&(t.avail_out===0||s===df))if(this.options.to==="string"){let _=uf.utf8border(t.output,t.next_out),d=t.next_out-_,c=uf.buf2string(t.output,_);t.next_out=d,t.avail_out=a-d,d&&t.output.set(t.output.subarray(_,_+d),0),this.onData(c)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(s===Ka&&h===0)){if(s===df)return s=dr.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},zu.prototype.onData=function(n){this.chunks.push(n)},zu.prototype.onEnd=function(n){n===Ka&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=lc.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function sb(n,e){const t=new zu(e);if(t.push(n),t.err)throw t.msg||af[t.err];return t.result}function ob(n,e){return e=e||{},e.raw=!0,sb(n,e)}var fb=ob,lb={inflateRaw:fb};const{inflateRaw:hb}=lb;var cb=hb;function db(n){return cb(n.subarray(2))}class pb extends Error{constructor(e){super(e),this.code="ERR_ABORTED"}}function gb(n){n.sort((o,s)=>Number(o.offset)-Number(s.offset));const e=[];let t,a;for(const o of n)t&&a&&Number(o.offset)-a<=2e3?(t.length=BigInt(Number(t.length)+Number(o.length)-a+Number(o.offset)),t.blocks.push(o)):e.push(t={blocks:[o],length:o.length,offset:o.offset}),a=Number(t.offset)+Number(t.length);return e}function es(n){if(n&&n.aborted)if(typeof DOMException>"u"){const e=new pb("aborted");throw e.code="ERR_ABORTED",e}else throw new DOMException("aborted","AbortError")}const _b=1,vb=2,wb=3;function gf(n,e,t,a){return n<a&&e>=t}function bb(n){const e=n?"big":"little",t=new Ie().endianess(e).uint32("chromId").uint32("start").uint32("end").uint32("validCnt").floatle("minScore").floatle("maxScore").floatle("sumData").floatle("sumSqData").saveOffset("offset"),a=new Ie().endianess(e).uint8("isLeaf").skip(1).uint16("cnt").choice({tag:"isLeaf",choices:{1:new Ie().endianess(e).array("blocksToFetch",{length:"cnt",type:new Ie().endianess(e).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").uint64("blockSize").saveOffset("offset")}),0:new Ie().array("recurOffsets",{length:"cnt",type:new Ie().endianess(e).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").saveOffset("offset")})}}),o=new Ie().endianess(e).uint32("chromId").int32("start").int32("end").string("rest",{zeroTerminated:!0}).saveOffset("offset");return{bigWigParser:new Ie().endianess(e).skip(4).int32("blockStart").skip(4).uint32("itemStep").uint32("itemSpan").uint8("blockType").skip(1).uint16("itemCount").choice({tag:"blockType",choices:{[wb]:new Ie().array("items",{length:"itemCount",type:new Ie().floatle("score")}),[vb]:new Ie().array("items",{length:"itemCount",type:new Ie().endianess(e).int32("start").floatle("score")}),[_b]:new Ie().array("items",{length:"itemCount",type:new Ie().endianess(e).int32("start").int32("end").floatle("score")})}}),bigBedParser:o,summaryParser:t,leafParser:a}}class ed{constructor(e,t,a,o,s,f){if(this.bbi=e,this.refsByName=t,this.cirTreeOffset=a,this.isBigEndian=o,this.isCompressed=s,this.blockType=f,this.featureCache=new Aa({cache:new fh({maxSize:1e3}),fill:async(_,d)=>{const c=Number(_.length),D=Number(_.offset),{buffer:x}=await this.bbi.read(Tn.alloc(c),0,c,D,{signal:d});return x}}),!(a>=0))throw new Error("invalid cirTreeOffset!");const h=bb(o);this.leafParser=h.leafParser,this.bigBedParser=h.bigBedParser}async readWigData(e,t,a,o,s){try{const{refsByName:f,bbi:h,cirTreeOffset:_,isBigEndian:d}=this,c=f[e];c===void 0&&o.complete();const D={chrId:c,start:t,end:a};this.cirTreePromise||(this.cirTreePromise=h.read(Tn.alloc(48),0,48,Number(_),s));const{buffer:x}=await this.cirTreePromise,m=d?x.readUInt32BE(4):x.readUInt32LE(4);let B=[],F=0;const I=(S,L,W)=>{try{const N=S.subarray(L),q=this.leafParser.parse(N);if(q.blocksToFetch&&(B=B.concat(q.blocksToFetch.filter(H=>k(H)).map(H=>({offset:H.blockOffset,length:H.blockSize})))),q.recurOffsets){const H=q.recurOffsets.filter(Z=>k(Z)).map(Z=>Number(Z.blockOffset));H.length>0&&$(H,W+1)}}catch(N){o.error(N)}},k=S=>{const{startChrom:L,startBase:W,endChrom:N,endBase:q}=S;return(L<c||L===c&&W<=a)&&(N>c||N===c&&q>=t)},U=async(S,L,W)=>{try{const N=L.max-L.min,q=L.min,H=await this.featureCache.get(`${N}_${q}`,{length:N,offset:q},s==null?void 0:s.signal);for(const Z of S)L.contains(Z)&&(I(H,Z-q,W),F-=1,F===0&&this.readFeatures(o,B,{...s,request:D}).catch(Y=>o.error(Y)))}catch(N){o.error(N)}},$=(S,L)=>{try{F+=S.length;const W=4+Number(m)*32;let N=new uc([{min:S[0],max:S[0]+W}]);for(let q=1;q<S.length;q+=1){const H=new uc([{min:S[q],max:S[q]+W}]);N=N.union(H)}N.getRanges().map(q=>U(S,q,L))}catch(W){o.error(W)}};return $([Number(_)+48],1)}catch(f){o.error(f)}}parseSummaryBlock(e,t,a){const o=[];let s=t;const f=new DataView(e.buffer,e.byteOffset,e.length);for(;s<e.byteLength;){const h=f.getUint32(s,!0);s+=4;const _=f.getUint32(s,!0);s+=4;const d=f.getUint32(s,!0);s+=4;const c=f.getUint32(s,!0);s+=4;const D=f.getFloat32(s,!0);s+=4;const x=f.getFloat32(s,!0);s+=4;const m=f.getFloat32(s,!0);s+=4,s+=4,(!a||h===a.chrId&&gf(_,d,a.start,a.end))&&o.push({start:_,end:d,maxScore:x,minScore:D,summary:!0,score:m/(c||1)})}return o}parseBigBedBlock(e,t,a,o){const s=[];let f=t;for(;f<e.byteLength;){const h=this.bigBedParser.parse(e.subarray(f));h.uniqueId=`bb-${a+f}`,s.push(h),f+=h.offset}return o?s.filter(h=>gf(h.start,h.end,o.start,o.end)):s}parseBigWigBlock(e,t,a){const o=e.subarray(t),s=new DataView(o.buffer,o.byteOffset,o.length);let f=0;f+=4;const h=s.getInt32(f,!0);f+=8;const _=s.getUint32(f,!0);f+=4;const d=s.getUint32(f,!0);f+=4;const c=s.getUint8(f);f+=2;const D=s.getUint16(f,!0);f+=2;const x=new Array(D);switch(c){case 1:{for(let m=0;m<D;m++){const B=s.getInt32(f,!0);f+=4;const F=s.getInt32(f,!0);f+=4;const I=s.getFloat32(f,!0);f+=4,x[m]={start:B,end:F,score:I}}break}case 2:{for(let m=0;m<D;m++){const B=s.getInt32(f,!0);f+=4;const F=s.getFloat32(f,!0);f+=4,x[m]={score:F,start:B,end:B+d}}break}case 3:{for(let m=0;m<D;m++){const B=s.getFloat32(f,!0);f+=4;const F=h+m*_;x[m]={score:B,start:F,end:F+d}}break}}return a?x.filter(m=>gf(m.start,m.end,a.start,a.end)):x}async readFeatures(e,t,a={}){try{const{blockType:o,isCompressed:s}=this,{signal:f,request:h}=a,_=gb(t);es(f),await Promise.all(_.map(async d=>{es(f);const{length:c,offset:D}=d,x=await this.featureCache.get(`${c}_${D}`,d,f);for(const m of d.blocks){es(f);let B=Number(m.offset)-Number(d.offset),F=x;switch(s&&(F=db(x.subarray(B)),B=0),es(f),o){case"summary":{e.next(this.parseSummaryBlock(F,B,h));break}case"bigwig":{e.next(this.parseBigWigBlock(F,B,h));break}case"bigbed":{e.next(this.parseBigBedBlock(F,B,Number(m.offset)*256,h));break}default:console.warn(`Don't know what to do with ${o}`)}}})),e.complete()}catch(o){e.error(o)}}}var _f=function(n,e){return _f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(t[o]=a[o])},_f(n,e)};function vf(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");_f(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function td(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],a=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function wf(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var a=t.call(n),o,s=[],f;try{for(;(e===void 0||e-- >0)&&!(o=a.next()).done;)s.push(o.value)}catch(h){f={error:h}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(f)throw f.error}}return s}function bf(n,e,t){if(t||arguments.length===2)for(var a=0,o=e.length,s;a<o;a++)(s||!(a in e))&&(s||(s=Array.prototype.slice.call(e,0,a)),s[a]=e[a]);return n.concat(s||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;function zn(n){return typeof n=="function"}function nd(n){var e=function(a){Error.call(a),a.stack=new Error().stack},t=n(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var mf=nd(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription:
50
- `+t.map(function(a,o){return o+1+") "+a.toString()}).join(`
51
- `):"",this.name="UnsubscriptionError",this.errors=t}});function rd(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var Df=function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var e,t,a,o,s;if(!this.closed){this.closed=!0;var f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var h=td(f),_=h.next();!_.done;_=h.next()){var d=_.value;d.remove(this)}}catch(F){e={error:F}}finally{try{_&&!_.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}else f.remove(this);var c=this.initialTeardown;if(zn(c))try{c()}catch(F){s=F instanceof mf?F.errors:[F]}var D=this._finalizers;if(D){this._finalizers=null;try{for(var x=td(D),m=x.next();!m.done;m=x.next()){var B=m.value;try{ad(B)}catch(F){s=s??[],F instanceof mf?s=bf(bf([],wf(s)),wf(F.errors)):s.push(F)}}}catch(F){a={error:F}}finally{try{m&&!m.done&&(o=x.return)&&o.call(x)}finally{if(a)throw a.error}}}if(s)throw new mf(s)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)ad(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},n.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},n.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},n.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&rd(t,e)},n.prototype.remove=function(e){var t=this._finalizers;t&&rd(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=function(){var e=new n;return e.closed=!0,e}(),n}();Df.EMPTY;function id(n){return n instanceof Df||n&&"closed"in n&&zn(n.remove)&&zn(n.add)&&zn(n.unsubscribe)}function ad(n){zn(n)?n():n.unsubscribe()}var mb={Promise:void 0},Db={setTimeout:function(n,e){for(var t=[],a=2;a<arguments.length;a++)t[a-2]=arguments[a];return setTimeout.apply(void 0,bf([n,e],wf(t)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function yb(n){Db.setTimeout(function(){throw n})}function ud(){}function xb(n){n()}var yf=function(n){vf(e,n);function e(t){var a=n.call(this)||this;return a.isStopped=!1,t?(a.destination=t,id(t)&&t.add(a)):a.destination=Ab,a}return e.create=function(t,a,o){return new ts(t,a,o)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Df),Eb=function(){function n(e){this.partialObserver=e}return n.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(a){ns(a)}},n.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(a){ns(a)}else ns(e)},n.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){ns(t)}},n}(),ts=function(n){vf(e,n);function e(t,a,o){var s=n.call(this)||this,f;return zn(t)||!t?f={next:t??void 0,error:a??void 0,complete:o??void 0}:f=t,s.destination=new Eb(f),s}return e}(yf);function ns(n){yb(n)}function Cb(n){throw n}var Ab={closed:!0,next:ud,error:Cb,complete:ud},Fb=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Bb(n){return n}function Sb(n){return n.length===0?Bb:n.length===1?n[0]:function(t){return n.reduce(function(a,o){return o(a)},t)}}var Ib=function(){function n(e){e&&(this._subscribe=e)}return n.prototype.lift=function(e){var t=new n;return t.source=this,t.operator=e,t},n.prototype.subscribe=function(e,t,a){var o=this,s=kb(e)?e:new ts(e,t,a);return xb(function(){var f=o,h=f.operator,_=f.source;s.add(h?h.call(s,_):_?o._subscribe(s):o._trySubscribe(s))}),s},n.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},n.prototype.forEach=function(e,t){var a=this;return t=sd(t),new t(function(o,s){var f=new ts({next:function(h){try{e(h)}catch(_){s(_),f.unsubscribe()}},error:s,complete:o});a.subscribe(f)})},n.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},n.prototype[Fb]=function(){return this},n.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Sb(e)(this)},n.prototype.toPromise=function(e){var t=this;return e=sd(e),new e(function(a,o){var s;t.subscribe(function(f){return s=f},function(f){return o(f)},function(){return a(s)})})},n.create=function(e){return new n(e)},n}();function sd(n){var e;return(e=n??mb.Promise)!==null&&e!==void 0?e:Promise}function Tb(n){return n&&zn(n.next)&&zn(n.error)&&zn(n.complete)}function kb(n){return n&&n instanceof yf||Tb(n)&&id(n)}function Rb(n){return zn(n==null?void 0:n.lift)}function od(n){return function(e){if(Rb(e))return e.lift(function(t){try{return n(t,this)}catch(a){this.error(a)}});throw new TypeError("Unable to lift unknown Observable type")}}function Nb(n,e,t,a,o){return new $b(n,e,t,a,o)}var $b=function(n){vf(e,n);function e(t,a,o,s,f,h){var _=n.call(this,t)||this;return _.onFinalize=f,_.shouldUnsubscribe=h,_._next=a?function(d){try{a(d)}catch(c){t.error(c)}}:n.prototype._next,_._error=s?function(d){try{s(d)}catch(c){t.error(c)}finally{this.unsubscribe()}}:n.prototype._error,_._complete=o?function(){try{o()}catch(d){t.error(d)}finally{this.unsubscribe()}}:n.prototype._complete,_}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var a=this.closed;n.prototype.unsubscribe.call(this),!a&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(yf),Lb=nd(function(n){return function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}});function Ob(n,e){return new Promise(function(t,a){var o=new ts({next:function(s){t(s),o.unsubscribe()},error:a,complete:function(){a(new Lb)}});n.subscribe(o)})}function Pb(n,e,t,a,o){return function(s,f){var h=t,_=e,d=0;s.subscribe(Nb(f,function(c){var D=d++;_=h?n(_,c,D):(h=!0,c)},function(){h&&f.next(_),f.complete()}))}}function Mb(n,e){return od(Pb(n,e,arguments.length>=2,!1,!0))}var Ub=function(n,e){return n.push(e),n};function Wb(){return od(function(n,e){Mb(Ub,[])(n).subscribe(e)})}const fd=-2003829722,xf=-2021002517;function Gb(n){return new TextDecoder().decode(n)}function ld(n){const e=n?"big":"little",t=new Ie().endianess(e).int32("magic").uint16("version").uint16("numZoomLevels").uint64("chromTreeOffset").uint64("unzoomedDataOffset").uint64("unzoomedIndexOffset").uint16("fieldCount").uint16("definedFieldCount").uint64("asOffset").uint64("totalSummaryOffset").uint32("uncompressBufSize").uint64("extHeaderOffset").array("zoomLevels",{length:"numZoomLevels",type:new Ie().endianess(e).uint32("reductionLevel").uint32("reserved").uint64("dataOffset").uint64("indexOffset")}),a=new Ie().endianess(e).uint64("basesCovered").doublele("scoreMin").doublele("scoreMax").doublele("scoreSum").doublele("scoreSumSquares"),o=new Ie().endianess(e).uint32("magic").uint32("blockSize").uint32("keySize").uint32("valSize").uint64("itemCount"),s=new Ie().endianess(e).uint8("isLeafNode").skip(1).uint16("cnt").saveOffset("offset");return{chromTreeParser:o,totalSummaryParser:a,headerParser:t,isLeafNode:s}}class qb{getHeader(e){return this.headerP||(this.headerP=this._getHeader(e).catch(t=>{throw this.headerP=void 0,t})),this.headerP}constructor(e){const{filehandle:t,renameRefSeqs:a=f=>f,path:o,url:s}=e;if(this.renameRefSeqs=a,t)this.bbi=t;else if(s)this.bbi=new Zn(s);else if(o)this.bbi=new Fa(o);else throw new Error("no file given")}async _getHeader(e){const t=await this._getMainHeader(e),a=await this._readChromTree(t,e);return{...t,...a}}async _getMainHeader(e,t=2e3){const{buffer:a}=await this.bbi.read(Tn.alloc(t),0,t,0,e),o=this._isBigEndian(a),s=ld(o),f=s.headerParser.parse(a),{magic:h,asOffset:_,totalSummaryOffset:d}=f;if(f.fileType=h===xf?"bigbed":"bigwig",_>t||d>t)return this._getMainHeader(e,t*2);if(_){const c=Number(f.asOffset);f.autoSql=Gb(a.subarray(c,a.indexOf(0,c)))}if(f.totalSummaryOffset>t-8*5)return this._getMainHeader(e,t*2);if(f.totalSummaryOffset){const c=a.subarray(Number(f.totalSummaryOffset)),D=s.totalSummaryParser.parse(c);f.totalSummary={...D,basesCovered:Number(D.basesCovered)}}return{...f,isBigEndian:o}}_isBigEndian(e){let t=e.readInt32LE(0);if(t===fd||t===xf)return!1;if(t=e.readInt32BE(0),t===fd||t===xf)return!0;throw new Error("not a BigWig/BigBed file")}async _readChromTree(e,t){const a=e.isBigEndian,o=a?"big":"little",s=[],f={};let h=Number(e.unzoomedDataOffset);const _=Number(e.chromTreeOffset);for(;h%4!==0;)h+=1;const d=h-_,{buffer:c}=await this.bbi.read(Tn.alloc(d),0,d,Number(_),t),D=ld(a),{keySize:x}=D.chromTreeParser.parse(c),m=new Ie().endianess(o).string("key",{stripNull:!0,length:x}).uint32("refId").uint32("refSize").saveOffset("offset"),B=new Ie().endianess(o).skip(x).uint64("childOffset").saveOffset("offset"),F=32,I=async k=>{let U=k;if(U>=c.length)throw new Error("reading beyond end of buffer");const $=D.isLeafNode.parse(c.subarray(U)),{isLeafNode:S,cnt:L}=$;if(U+=$.offset,S)for(let W=0;W<L;W+=1){const N=m.parse(c.subarray(U));U+=N.offset;const{key:q,refId:H,refSize:Z}=N,Y={name:q,id:H,length:Z};f[this.renameRefSeqs(q)]=H,s[H]=Y}else{const W=[];for(let N=0;N<L;N+=1){const q=B.parse(c.subarray(U)),{childOffset:H}=q;U+=q.offset,W.push(I(Number(H)-Number(_)))}await Promise.all(W)}};return await I(F),{refsByName:f,refsByNumber:s}}async getUnzoomedView(e){const{unzoomedIndexOffset:t,refsByName:a,uncompressBufSize:o,isBigEndian:s,fileType:f}=await this.getHeader(e);return new ed(this.bbi,a,t,s,o>0,f)}async getFeatureStream(e,t,a,o){await this.getHeader(o);const s=this.renameRefSeqs(e);let f;const{basesPerSpan:h,scale:_}=o||{};return h?f=await this.getView(1/h,o):_?f=await this.getView(_,o):f=await this.getView(1,o),new Ib(d=>{f.readWigData(s,t,a,d,o).catch(c=>d.error(c))})}async getFeatures(e,t,a,o){const s=await this.getFeatureStream(e,t,a,o);return(await Ob(s.pipe(Wb()))).flat()}}let Hb=class extends qb{async getView(e,t){const{zoomLevels:a,refsByName:o,fileSize:s,isBigEndian:f,uncompressBufSize:h}=await this.getHeader(t),_=1/e;let d=a.length;s||(d-=1);for(let c=d;c>=0;c-=1){const D=a[c];if(D&&D.reductionLevel<=2*_){const x=Number(D.indexOffset);return new ed(this.bbi,o,x,f,h>0,"summary")}}return this.getUnzoomedView(t)}};class Ef{constructor(e){ue(this,"url");ue(this,"bw");this.url=e,this.bw=new Hb({filehandle:new Zn(e,{fetch:bo})})}async getData(e,t){const a=e.map(f=>{let h=t.ensemblStyle?f.chr.replace("chr",""):f.chr;return h==="M"&&(h="MT"),this.bw.getFeatures(h,f.start,f.end)}),o=await Promise.all(a);return e.forEach((f,h)=>{o[h].forEach(_=>_.chr=f.chr)}),Xt.flatten(o)}}const Vb=1e3;class Zb{constructor(e){ue(this,"maxBasesPerPixel");ue(this,"workerSource");this.maxBasesPerPixel=Vb,this.workerSource=new Ef(e)}getData(e,t,a){return t>this.maxBasesPerPixel?Promise.resolve([]):this.workerSource.getData(e,a)}}const Xb=2;class Kb{constructor(e){ue(this,"maxBasesPerPixel");ue(this,"workerSource");this.maxBasesPerPixel=Xb,this.workerSource=new Ef(e)}getData(e,t,a){return t>this.maxBasesPerPixel?Promise.resolve([]):this.workerSource.getData(e,a)}}var rs={InfoFields:{AA:{Number:1,Type:"String",Description:"Ancestral allele"},AC:{Number:"A",Type:"Integer",Description:"Allele count in genotypes, for each ALT allele, in the same order as listed"},AD:{Number:"R",Type:"Integer",Description:"Total read depth for each allele"},ADF:{Number:"R",Type:"Integer",Description:"Read depth for each allele on the forward strand"},ADR:{Number:"R",Type:"Integer",Description:"Read depth for each allele on the reverse strand"},AF:{Number:"A",Type:"Float",Description:"Allele frequency for each ALT allele in the same order as listed (estimated from primary data, not called genotypes)"},AN:{Number:1,Type:"Integer",Description:"Total number of alleles in called genotypes"},BQ:{Number:1,Type:"Float",Description:"RMS base quality"},CIGAR:{Number:1,Type:"Float",Description:"Cigar string describing how to align an alternate allele to the reference allele"},DB:{Number:0,Type:"Flag",Description:"dbSNP membership"},DP:{Number:1,Type:"Integer",Description:"combined depth across samples"},END:{Number:1,Type:"Integer",Description:"End position (for use with symbolic alleles)"},H2:{Number:0,Type:"Flag",Description:"HapMap2 membership"},H3:{Number:0,Type:"Flag",Description:"HapMap3 membership"},MQ:{Number:1,Type:null,Description:"RMS mapping quality"},MQ0:{Number:1,Type:"Integer",Description:"Number of MAPQ == 0 reads"},NS:{Number:1,Type:"Integer",Description:"Number of samples with data"},SB:{Number:4,Type:"Integer",Description:"Strand bias"},SOMATIC:{Number:0,Type:"Flag",Description:"Somatic mutation (for cancer genomics)"},VALIDATED:{Number:0,Type:"Flag",Description:"Validated by follow-up experiment"},"1000G":{Number:0,Type:"Flag",Description:"1000 Genomes membership"},IMPRECISE:{Number:0,Type:"Flag",Description:"Imprecise structural variation"},NOVEL:{Number:0,Type:"Flag",Description:"Indicates a novel structural variation"},SVTYPE:{Number:1,Type:"String",Description:"Type of structural variant"},SVLEN:{Number:null,Type:"Integer",Description:"Difference in length between REF and ALT alleles"},CIPOS:{Number:2,Type:"Integer",Description:"Confidence interval around POS for imprecise variants"},CIEND:{Number:2,Type:"Integer",Description:"Confidence interval around END for imprecise variants"},HOMLEN:{Type:"Integer",Description:"Length of base pair identical micro-homology at event breakpoints"},HOMSEQ:{Type:"String",Description:"Sequence of base pair identical micro-homology at event breakpoints"},BKPTID:{Type:"String",Description:"ID of the assembled alternate allele in the assembly file"},MEINFO:{Number:4,Type:"String",Description:"Mobile element info of the form NAME,START,END,POLARITY"},METRANS:{Number:4,Type:"String",Description:"Mobile element transduction info of the form CHR,START,END,POLARITY"},DGVID:{Number:1,Type:"String",Description:"ID of this element in Database of Genomic Variation"},DBVARID:{Number:1,Type:"String",Description:"ID of this element in DBVAR"},DBRIPID:{Number:1,Type:"String",Description:"ID of this element in DBRIP"},MATEID:{Number:null,Type:"String",Description:"ID of mate breakends"},PARID:{Number:1,Type:"String",Description:"ID of partner breakend"},EVENT:{Number:1,Type:"String",Description:"ID of event associated to breakend"},CILEN:{Number:2,Type:"Integer",Description:"Confidence interval around the inserted material between breakend"},DPADJ:{Type:"Integer",Description:"Read Depth of adjacency"},CN:{Number:1,Type:"Integer",Description:"Copy number of segment containing breakend"},CNADJ:{Number:null,Type:"Integer",Description:"Copy number of adjacency"},CICN:{Number:2,Type:"Integer",Description:"Confidence interval around copy number for the segment"},CICNADJ:{Number:null,Type:"Integer",Description:"Confidence interval around copy number for the adjacency"}},GenotypeFields:{AD:{Number:"R",Type:"Integer",Description:"Read depth for each allele"},ADF:{Number:"R",Type:"Integer",Description:"Read depth for each allele on the forward strand"},ADR:{Number:"R",Type:"Integer",Description:"Read depth for each allele on the reverse strand"},DP:{Number:1,Type:"Integer",Description:"Read depth"},EC:{Number:"A",Type:"Integer",Description:"Expected alternate allele counts"},FT:{Number:1,Type:"String",Description:'Filter indicating if this genotype was "called"'},GL:{Number:"G",Type:"Float",Description:"Genotype likelihoods"},GP:{Number:"G",Type:"Float",Description:"Genotype posterior probabilities"},GQ:{Number:1,Type:"Integer",Description:"Conditional genotype quality"},GT:{Number:1,Type:"String",Description:"Genotype"},HQ:{Number:2,Type:"Integer",Description:"Haplotype quality"},MQ:{Number:1,Type:"Integer",Description:"RMS mapping quality"},PL:{Number:"G",Type:"Integer",Description:"Phred-scaled genotype likelihoods rounded to the closest integer"},PQ:{Number:1,Type:"Integer",Description:"Phasing quality"},PS:{Number:1,Type:"Integer",Description:"Phase set"}},AltTypes:{DEL:{Description:"Deletion relative to the reference"},INS:{Description:"Insertion of novel sequence relative to the reference"},DUP:{Description:"Region of elevated copy number relative to the reference"},INV:{Description:"Inversion of reference sequence"},CNV:{Description:"Copy number variable region (may be both deletion and duplication)"},"DUP:TANDEM":{Description:"Tandem duplication"},"DEL:ME":{Description:"Deletion of mobile element relative to the reference"},"INS:ME":{Description:"Insertion of a mobile element relative to the reference"},NON_REF:{Description:"Represents any possible alternative allele at this location"},"*":{Description:"Represents any possible alternative allele at this location"}},FilterTypes:{PASS:{Description:"Passed all filters"}}};function Yb(n){Object.assign(this,n)}function Qb(n){try{return decodeURIComponent(n)}catch{return n}}class Jb{constructor({header:e="",strict:t=!0}){if(!e||!e.length)throw new Error("empty header received");const a=e.split(/[\r\n]+/).filter(_=>_);if(!a.length)throw new Error("no non-empty header lines specified");this.strict=t,this.metadata=JSON.parse(JSON.stringify({INFO:rs.InfoFields,FORMAT:rs.GenotypeFields,ALT:rs.AltTypes,FILTER:rs.FilterTypes}));let o;if(a.forEach(_=>{if(_.startsWith("#"))_.startsWith("##")?this._parseMetadata(_):o=_;else throw new Error(`Bad line in header:
52
- ${_}`)}),!o)throw new Error("No format line found in header");const s=o.trim().split(" "),f=s.slice(0,8),h=["#CHROM","POS","ID","REF","ALT","QUAL","FILTER","INFO"];if(s.length<8)throw new Error(`VCF header missing columns:
53
- ${o}`);if(f.length!==h.length||!f.every((_,d)=>_===h[d]))throw new Error(`VCF column headers not correct:
54
- ${o}`);this.samples=s.slice(9)}_parseGenotypes(e,t){const a=t.split(" "),o={},s=e==null?void 0:e.split(":");return s&&this.samples.forEach((f,h)=>{o[f]={},s.forEach(_=>{o[f][_]=null}),a[h].split(":").filter(_=>_).forEach((_,d)=>{let c;if(_===""||_==="."||_===void 0)c=null;else{const D=_.split(",").map(m=>m==="."?null:m),x=this.getMetadata("FORMAT",s[d],"Type");x==="Integer"||x==="Float"?c=D.map(m=>m&&+m):c=D}o[f][s[d]]=c},{})}),o}_parseMetadata(e){const t=e.trim().match(/^##(.+?)=(.*)/);if(!t)throw new Error(`Line is not a valid metadata line: ${e}`);const[a,o]=t.slice(1,3);if(o.startsWith("<")){a in this.metadata||(this.metadata[a]={});const[s,f]=this._parseStructuredMetaVal(o);this.metadata[a][s]=f}else this.metadata[a]=o}_parseStructuredMetaVal(e){const t=this._parseKeyValue(e.replace(/^<|>$/g,""),","),a=t.ID;return delete t.ID,"Number"in t&&(Number.isNaN(Number(t.Number))||(t.Number=Number(t.Number))),[a,t]}getMetadata(...e){let t=this.metadata;for(let a=0;a<e.length;a+=1)if(t=t[e[a]],!t)return t;return t}_parseKeyValue(e,t=";"){const a={};let o="",s="",f=1;for(let h=0;h<e.length;h+=1)f===1?e[h]==="="?f=2:e[h]!==t?o+=e[h]:s===""&&(a[o]=null,o=""):f===2?e[h]===t?(a[o]=s,o="",s="",f=1):e[h]==='"'?f=3:s+=e[h]:f===3&&(e[h]!=='"'?s+=e[h]:f=2);return f===2||f===3?a[o]=s:f===1&&(a[o]=null),a}parseLine(e){if(e=e.trim(),!e.length)return;const t=this;let a=0;for(let W=0;a<e.length&&(e[a]===" "&&(W+=1),W!==9);a+=1);const o=e.substr(0,a).split(" "),s=e.substr(a+1),[f,h,_,d,c,D,x]=o,m=f,B=+h,F=_==="."?null:_.split(";"),I=d,k=c==="."?null:c.split(","),U=D==="."?null:+D,$=x==="."?null:x.split(";");if(this.strict&&o[7]===void 0)throw new Error("no INFO field specified, must contain at least a '.' (turn off strict mode to allow)");const S=o[7]===void 0||o[7]==="."?{}:this._parseKeyValue(o[7]);Object.keys(S).forEach(W=>{let N;S[W]?N=S[W].split(",").map(H=>H==="."?null:H).map(H=>H&&Qb(H)):N=S[W];const q=this.getMetadata("INFO",W,"Type");q&&(q==="Integer"||q==="Float"?N=N.map(H=>H===null?null:Number(H)):q==="Flag"&&(S[W]?console.warn(`Info field ${W} is a Flag and should not have a value (got value ${S[W]})`):N=!0)),S[W]=N});const L=new Yb({CHROM:m,POS:B,ALT:k,INFO:S,REF:I,FILTER:$&&$.length===1&&$[0]==="PASS"?"PASS":$,ID:F,QUAL:U});return Object.defineProperty(L,"SAMPLES",{get(){const W=t._parseGenotypes(o[8],s);return Object.defineProperty(this,"SAMPLES",{value:W,configurable:!1}),W},configurable:!0}),L}}class jb{constructor(e,t=null){ue(this,"header");ue(this,"vcf");ue(this,"parser");let a,o;Array.isArray(e)?(a=new ph(e.filter(s=>!s.name.endsWith(".tbi"))[0]),o=new ph(e.filter(s=>s.name.endsWith(".tbi"))[0])):(a=new Zn(e),o=new Zn(t||e+".tbi")),this.vcf=new ac({filehandle:a,tbiFilehandle:o}),this.header=null,this.parser=null}async getData(e,t,a){this.header||(this.header=await this.vcf.getHeader()),this.parser||(this.parser=new Jb({header:this.header}));const o=e.map(h=>this._getDataInLocus(h,a)),s=await Promise.all(o);return Xt.flatten(s)}async _getDataInLocus(e,t){const a=[];let o=t&&t.ensemblStyle?e.chr.replace("chr",""):e.chr;if(o==="M"&&(o="MT"),await this.vcf.getLines(o,e.start+1,e.end,s=>a.push(this.parser.parseLine(s))),t&&t.ensemblStyle)for(let s of a)s.CHROM=e.chr;return a}}const zb={AUTO:"auto"};function Gt(n,e){if(typeof n!="number"||typeof e!="number")throw"Bad range "+n+","+e;this._min=n,this._max=e}Gt.prototype.min=function(){return this._min},Gt.prototype.max=function(){return this._max},Gt.prototype.contains=function(n){return n>=this._min&&n<=this._max},Gt.prototype.isContiguous=function(){return!0},Gt.prototype.ranges=function(){return[this]},Gt.prototype._pushRanges=function(n){n.push(this)},Gt.prototype.toString=function(){return"["+this._min+"-"+this._max+"]"};function pn(n){var e=n.sort(hd),t=[],a=e.shift();e.forEach(function(o){o._min<=a._max?o._max>a._max&&(a._max=o._max):(t.push(a),a=o)}),t.push(a),this._ranges=t}pn.prototype.min=function(){return this._ranges[0].min()},pn.prototype.max=function(){return this._ranges[this._ranges.length-1].max()},pn.prototype.lower_bound=function(n){var e=this.ranges();if(n>this.max())return e.length;if(n<this.min())return 0;for(var t=0,a=e.length-1;t<=a;){var o=Math.floor((t+a)/2);if(n>e[o]._max)t=o+1;else if(n<e[o]._min)a=o-1;else return o}return t},pn.prototype.contains=function(n){var e=this.lower_bound(n);return!!(e<this._ranges.length&&this._ranges[e].contains(n))},pn.prototype.insertRange=function(n){var e=this.lower_bound(n._min);if(e===this._ranges.length){this._ranges.push(n);return}var t=this.ranges();if(n._max<t[e]._min){this._ranges.splice(e,0,n);return}t[e]._min<n._min&&(n._min=t[e]._min);for(var a=e+1;a<t.length&&t[a]._min<=n._max;)a++;a--,t[a]._max>n._max&&(n._max=t[a]._max),this._ranges.splice(e,a-e+1,n)},pn.prototype.isContiguous=function(){return this._ranges.length>1},pn.prototype.ranges=function(){return this._ranges},pn.prototype._pushRanges=function(n){for(var e=0;e<this._ranges.length;++e)n.push(this._ranges[e])},pn.prototype.toString=function(){for(var n="",e=0;e<this._ranges.length;++e)e>0&&(n=n+","),n=n+this._ranges[e].toString();return n};function em(n,e){return n instanceof pn||(n instanceof Array||(n=[n]),n=new pn(n)),e&&n.insertRange(e),n}function tm(n,e){for(var t=n.ranges(),a=e.ranges(),o=t.length,s=a.length,f=0,h=0,_=[];f<o&&h<s;){var n=t[f],e=a[h],d=Math.max(n.min(),e.min()),c=Math.min(n.max(),e.max());c>=d&&_.push(new Gt(d,c)),n.max()>e.max()?++h:++f}return _.length==0?null:_.length==1?_[0]:new pn(_)}function nm(n){for(var e=0,t=n.ranges(),a=0;a<t.length;++a){var o=t[a];e+=o.max()-o.min()+1}return e}function rm(n,e){return n.min()<e.min()?-1:n.min()>e.min()?1:n.max()<e.max()?-1:e.max()>n.max()?1:0}function hd(n,e){return n._min<e._min?-1:n._min>e._min?1:n._max<e._max?-1:e._max>n._max?1:0}typeof module<"u"&&(module.exports={Range:Gt,union:em,intersection:tm,coverage:nm,rangeOver:rm,_rangeOrder:hd});var im=15,cd=im,dd=1440,Or=15,am=32,um=0,sm=4,om=8,Be=0,pr=1,fm=2,gn=-2,qe=-3,pd=-4,er=-5,gd=0,_d=1,vd=2,wd=3,bd=4,md=5,Cf=6,Ya=7,Dd=8,yd=9,xd=10,Ed=11,is=12,_n=13,Yt=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],Ji=0,Af=1,Cd=2,Ad=3,Fd=4,Bd=5,as=6,us=7,lm=8,ss=9,hm=9,cm=5,dm=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],pm=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],gm=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],_m=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],vm=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],wm=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function ji(){}ji.prototype.inflateInit=function(n,e){return n||(n=cd),e&&(e=!1),this.istate=new Pr,this.istate.inflateInit(this,e?-n:n)},ji.prototype.inflate=function(n){return this.istate==null?gn:this.istate.inflate(this,n)},ji.prototype.inflateEnd=function(){if(this.istate==null)return gn;var n=istate.inflateEnd(this);return this.istate=null,n},ji.prototype.inflateSync=function(){return istate.inflateSync(this)},ji.prototype.inflateSetDictionary=function(n,e){return istate.inflateSetDictionary(this,n,e)};function Pr(){this.was=[0]}Pr.prototype.inflateReset=function(n){return n==null||n.istate==null?gn:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=n.istate.nowrap!=0?Ya:gd,n.istate.blocks.reset(n,null),Be)},Pr.prototype.inflateEnd=function(n){return this.blocks!=null&&this.blocks.free(n),this.blocks=null,Be},Pr.prototype.inflateInit=function(n,e){return n.msg=null,this.blocks=null,e<0&&(e=-e),e<8||e>15?(this.inflateEnd(n),gn):(this.wbits=e,n.istate.blocks=new vi(n,n.istate.nowrap!=0?null:this,1<<e),this.inflateReset(n),Be)},Pr.prototype.inflate=function(n,e){var t,a;if(n==null||n.istate==null||n.next_in==null)return gn;for(e=e==sm?er:Be,t=er;;)switch(n.istate.mode){case gd:if(n.avail_in==0)return t;if(t=e,n.avail_in--,n.total_in++,((n.istate.method=n.next_in[n.next_in_index++])&15)!=om){n.istate.mode=_n,n.msg="unknown compression method",n.istate.marker=5;break}if((n.istate.method>>4)+8>n.istate.wbits){n.istate.mode=_n,n.msg="invalid window size",n.istate.marker=5;break}n.istate.mode=_d;case _d:if(n.avail_in==0)return t;if(t=e,n.avail_in--,n.total_in++,a=n.next_in[n.next_in_index++]&255,((n.istate.method<<8)+a)%31!=0){n.istate.mode=_n,n.msg="incorrect header check",n.istate.marker=5;break}if(!(a&am)){n.istate.mode=Ya;break}n.istate.mode=vd;case vd:if(n.avail_in==0)return t;t=e,n.avail_in--,n.total_in++,n.istate.need=(n.next_in[n.next_in_index++]&255)<<24&4278190080,n.istate.mode=wd;case wd:if(n.avail_in==0)return t;t=e,n.avail_in--,n.total_in++,n.istate.need+=(n.next_in[n.next_in_index++]&255)<<16&16711680,n.istate.mode=bd;case bd:if(n.avail_in==0)return t;t=e,n.avail_in--,n.total_in++,n.istate.need+=(n.next_in[n.next_in_index++]&255)<<8&65280,n.istate.mode=md;case md:return n.avail_in==0?t:(t=e,n.avail_in--,n.total_in++,n.istate.need+=n.next_in[n.next_in_index++]&255,n.adler=n.istate.need,n.istate.mode=Cf,fm);case Cf:return n.istate.mode=_n,n.msg="need dictionary",n.istate.marker=0,gn;case Ya:if(t=n.istate.blocks.proc(n,t),t==qe){n.istate.mode=_n,n.istate.marker=0;break}if(t==Be&&(t=e),t!=pr)return t;if(t=e,n.istate.blocks.reset(n,n.istate.was),n.istate.nowrap!=0){n.istate.mode=is;break}n.istate.mode=Dd;case Dd:if(n.avail_in==0)return t;t=e,n.avail_in--,n.total_in++,n.istate.need=(n.next_in[n.next_in_index++]&255)<<24&4278190080,n.istate.mode=yd;case yd:if(n.avail_in==0)return t;t=e,n.avail_in--,n.total_in++,n.istate.need+=(n.next_in[n.next_in_index++]&255)<<16&16711680,n.istate.mode=xd;case xd:if(n.avail_in==0)return t;t=e,n.avail_in--,n.total_in++,n.istate.need+=(n.next_in[n.next_in_index++]&255)<<8&65280,n.istate.mode=Ed;case Ed:if(n.avail_in==0)return t;if(t=e,n.avail_in--,n.total_in++,n.istate.need+=n.next_in[n.next_in_index++]&255,n.istate.was[0]!=n.istate.need){n.istate.mode=_n,n.msg="incorrect data check",n.istate.marker=5;break}n.istate.mode=is;case is:return pr;case _n:return qe;default:return gn}},Pr.prototype.inflateSetDictionary=function(n,e,t){var a=0,o=t;return n==null||n.istate==null||n.istate.mode!=Cf?gn:n._adler.adler32(1,e,0,t)!=n.adler?qe:(n.adler=n._adler.adler32(0,null,0,0),o>=1<<n.istate.wbits&&(o=(1<<n.istate.wbits)-1,a=t-o),n.istate.blocks.set_dictionary(e,a,o),n.istate.mode=Ya,Be)};var bm=[0,0,255,255];Pr.prototype.inflateSync=function(n){var e,t,a,o,s;if(n==null||n.istate==null)return gn;if(n.istate.mode!=_n&&(n.istate.mode=_n,n.istate.marker=0),(e=n.avail_in)==0)return er;for(t=n.next_in_index,a=n.istate.marker;e!=0&&a<4;)n.next_in[t]==bm[a]?a++:n.next_in[t]!=0?a=0:a=4-a,t++,e--;return n.total_in+=t-n.next_in_index,n.next_in_index=t,n.avail_in=e,n.istate.marker=a,a!=4?qe:(o=n.total_in,s=n.total_out,this.inflateReset(n),n.total_in=o,n.total_out=s,n.istate.mode=Ya,Be)},Pr.prototype.inflateSyncPoint=function(n){return n==null||n.istate==null||n.istate.blocks==null?gn:n.istate.blocks.sync_point()};var Sd=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function vi(n,e,t){this.hufts=new Int32Array(dd*3),this.window=new Uint8Array(t),this.end=t,this.checkfn=e,this.mode=Ji,this.reset(n,null),this.left=0,this.table=0,this.index=0,this.blens=null,this.bb=new Int32Array(1),this.tb=new Int32Array(1),this.codes=new Qa,this.last=0,this.bitk=0,this.bitb=0,this.read=0,this.write=0,this.check=0,this.inftree=new Ja}vi.prototype.reset=function(n,e){e&&(e[0]=this.check),this.mode==as&&this.codes.free(n),this.mode=Ji,this.bitk=0,this.bitb=0,this.read=this.write=0,this.checkfn&&(n.adler=this.check=n._adler.adler32(0,null,0,0))},vi.prototype.proc=function(n,e){var t,a,o,s,f,h,_;for(s=n.next_in_index,f=n.avail_in,a=this.bitb,o=this.bitk,h=this.write,_=h<this.read?this.read-h-1:this.end-h;;)switch(this.mode){case Ji:for(;o<3;){if(f!=0)e=Be;else return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);f--,a|=(n.next_in[s++]&255)<<o,o+=8}switch(t=a&7,this.last=t&1,t>>>1){case 0:a>>>=3,o-=3,t=o&7,a>>>=t,o-=t,this.mode=Af;break;case 1:{var d=new Int32Array(1),c=new Int32Array(1),D=[],x=[];mm(d,c,D,x),this.codes.init(d[0],c[0],D[0],0,x[0],0,n)}a>>>=3,o-=3,this.mode=as;break;case 2:a>>>=3,o-=3,this.mode=Ad;break;case 3:return a>>>=3,o-=3,this.mode=_n,n.msg="invalid block type",e=qe,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e)}break;case Af:for(;o<32;){if(f!=0)e=Be;else return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);f--,a|=(n.next_in[s++]&255)<<o,o+=8}if((~a>>>16&65535)!=(a&65535))return this.mode=_n,n.msg="invalid stored block lengths",e=qe,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);this.left=a&65535,a=o=0,this.mode=this.left!=0?Cd:this.last!=0?us:Ji;break;case Cd:if(f==0)return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,write=h,this.inflate_flush(n,e);if(_==0&&(h==end&&read!=0&&(h=0,_=h<this.read?this.read-h-1:this.end-h),_==0&&(this.write=h,e=this.inflate_flush(n,e),h=this.write,_=h<this.read?this.read-h-1:this.end-h,h==this.end&&this.read!=0&&(h=0,_=h<this.read?this.read-h-1:this.end-h),_==0)))return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);if(e=Be,t=this.left,t>f&&(t=f),t>_&&(t=_),On(n.next_in,s,this.window,h,t),s+=t,f-=t,h+=t,_-=t,(this.left-=t)!=0)break;this.mode=this.last!=0?us:Ji;break;case Ad:for(;o<14;){if(f!=0)e=Be;else return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);f--,a|=(n.next_in[s++]&255)<<o,o+=8}if(this.table=t=a&16383,(t&31)>29||(t>>5&31)>29)return this.mode=ss,n.msg="too many length or distance symbols",e=qe,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);if(t=258+(t&31)+(t>>5&31),this.blens==null||this.blens.length<t)this.blens=new Int32Array(t);else for(var m=0;m<t;m++)this.blens[m]=0;a>>>=14,o-=14,this.index=0;let I=Fd;case Fd:for(;this.index<4+(this.table>>>10);){for(;o<3;){if(f!=0)e=Be;else return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);f--,a|=(n.next_in[s++]&255)<<o,o+=8}this.blens[Sd[this.index++]]=a&7,a>>>=3,o-=3}for(;this.index<19;)this.blens[Sd[this.index++]]=0;if(this.bb[0]=7,t=this.inftree.inflate_trees_bits(this.blens,this.bb,this.tb,this.hufts,n),t!=Be)return e=t,e==qe&&(this.blens=null,this.mode=ss),this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,write=h,this.inflate_flush(n,e);this.index=0,this.mode=Bd;case Bd:for(;t=this.table,this.index<258+(t&31)+(t>>5&31);){var m,B,F;for(t=this.bb[0];o<t;){if(f!=0)e=Be;else return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);f--,a|=(n.next_in[s++]&255)<<o,o+=8}if(t=this.hufts[(this.tb[0]+(a&Yt[t]))*3+1],F=this.hufts[(this.tb[0]+(a&Yt[t]))*3+2],F<16)a>>>=t,o-=t,this.blens[this.index++]=F;else{for(m=F==18?7:F-14,B=F==18?11:3;o<t+m;){if(f!=0)e=Be;else return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);f--,a|=(n.next_in[s++]&255)<<o,o+=8}if(a>>>=t,o-=t,B+=a&Yt[m],a>>>=m,o-=m,m=this.index,t=this.table,m+B>258+(t&31)+(t>>5&31)||F==16&&m<1)return this.blens=null,this.mode=ss,n.msg="invalid bit length repeat",e=qe,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);F=F==16?this.blens[m-1]:0;do this.blens[m++]=F;while(--B!=0);this.index=m}}this.tb[0]=-1;{var d=new Int32Array(1),c=new Int32Array(1),D=new Int32Array(1),x=new Int32Array(1);if(d[0]=9,c[0]=6,t=this.table,t=this.inftree.inflate_trees_dynamic(257+(t&31),1+(t>>5&31),this.blens,d,c,D,x,this.hufts,n),t!=Be)return t==qe&&(this.blens=null,this.mode=_n),e=t,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);this.codes.init(d[0],c[0],this.hufts,D[0],this.hufts,x[0],n)}this.mode=as;case as:if(this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,(e=this.codes.proc(this,n,e))!=pr)return this.inflate_flush(n,e);if(e=Be,this.codes.free(n),s=n.next_in_index,f=n.avail_in,a=this.bitb,o=this.bitk,h=this.write,_=h<this.read?this.read-h-1:this.end-h,this.last==0){this.mode=Ji;break}this.mode=us;case us:if(this.write=h,e=this.inflate_flush(n,e),h=this.write,_=h<this.read?this.read-h-1:this.end-h,this.read!=this.write)return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);I=is;case lm:return e=pr,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);case ss:return e=qe,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e);default:return e=gn,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=s-n.next_in_index,n.next_in_index=s,this.write=h,this.inflate_flush(n,e)}},vi.prototype.free=function(n){this.reset(n,null),this.window=null,this.hufts=null},vi.prototype.set_dictionary=function(n,e,t){On(n,e,window,0,t),this.read=this.write=t},vi.prototype.sync_point=function(){return this.mode==Af},vi.prototype.inflate_flush=function(n,e){var t,a,o;return a=n.next_out_index,o=this.read,t=(o<=this.write?this.write:this.end)-o,t>n.avail_out&&(t=n.avail_out),t!=0&&e==er&&(e=Be),n.avail_out-=t,n.total_out+=t,this.checkfn!=null&&(n.adler=this.check=n._adler.adler32(this.check,this.window,o,t)),On(this.window,o,n.next_out,a,t),a+=t,o+=t,o==this.end&&(o=0,this.write==this.end&&(this.write=0),t=this.write-o,t>n.avail_out&&(t=n.avail_out),t!=0&&e==er&&(e=Be),n.avail_out-=t,n.total_out+=t,this.checkfn!=null&&(n.adler=this.check=n._adler.adler32(this.check,this.window,o,t)),On(this.window,o,n.next_out,a,t),a+=t,o+=t),n.next_out_index=a,this.read=o,e};var os=0,Id=1,Td=2,kd=3,Rd=4,Nd=5,$d=6,Ff=7,Ld=8,fs=9;function Qa(){}Qa.prototype.init=function(n,e,t,a,o,s,f){this.mode=os,this.lbits=n,this.dbits=e,this.ltree=t,this.ltree_index=a,this.dtree=o,this.dtree_index=s,this.tree=null},Qa.prototype.proc=function(n,e,t){var a,o,s,f=0,h=0,_=0,d,c,D,x;for(_=e.next_in_index,d=e.avail_in,f=n.bitb,h=n.bitk,c=n.write,D=c<n.read?n.read-c-1:n.end-c;;)switch(this.mode){case os:if(D>=258&&d>=10&&(n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=_-e.next_in_index,e.next_in_index=_,n.write=c,t=this.inflate_fast(this.lbits,this.dbits,this.ltree,this.ltree_index,this.dtree,this.dtree_index,n,e),_=e.next_in_index,d=e.avail_in,f=n.bitb,h=n.bitk,c=n.write,D=c<n.read?n.read-c-1:n.end-c,t!=Be)){this.mode=t==pr?Ff:fs;break}this.need=this.lbits,this.tree=this.ltree,this.tree_index=this.ltree_index,this.mode=Id;case Id:for(a=this.need;h<a;){if(d!=0)t=Be;else return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=_-e.next_in_index,e.next_in_index=_,n.write=c,n.inflate_flush(e,t);d--,f|=(e.next_in[_++]&255)<<h,h+=8}if(o=(this.tree_index+(f&Yt[a]))*3,f>>>=this.tree[o+1],h-=this.tree[o+1],s=this.tree[o],s==0){this.lit=this.tree[o+2],this.mode=$d;break}if(s&16){this.get=s&15,this.len=this.tree[o+2],this.mode=Td;break}if(!(s&64)){this.need=s,this.tree_index=o/3+this.tree[o+2];break}if(s&32){this.mode=Ff;break}return this.mode=fs,e.msg="invalid literal/length code",t=qe,n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=_-e.next_in_index,e.next_in_index=_,n.write=c,n.inflate_flush(e,t);case Td:for(a=this.get;h<a;){if(d!=0)t=Be;else return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=_-e.next_in_index,e.next_in_index=_,n.write=c,n.inflate_flush(e,t);d--,f|=(e.next_in[_++]&255)<<h,h+=8}this.len+=f&Yt[a],f>>=a,h-=a,this.need=this.dbits,this.tree=this.dtree,this.tree_index=this.dtree_index,this.mode=kd;case kd:for(a=this.need;h<a;){if(d!=0)t=Be;else return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=_-e.next_in_index,e.next_in_index=_,n.write=c,n.inflate_flush(e,t);d--,f|=(e.next_in[_++]&255)<<h,h+=8}if(o=(this.tree_index+(f&Yt[a]))*3,f>>=this.tree[o+1],h-=this.tree[o+1],s=this.tree[o],s&16){this.get=s&15,this.dist=this.tree[o+2],this.mode=Rd;break}if(!(s&64)){this.need=s,this.tree_index=o/3+this.tree[o+2];break}return this.mode=fs,e.msg="invalid distance code",t=qe,n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=_-e.next_in_index,e.next_in_index=_,n.write=c,n.inflate_flush(e,t);case Rd:for(a=this.get;h<a;){if(d!=0)t=Be;else return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=_-e.next_in_index,e.next_in_index=_,n.write=c,n.inflate_flush(e,t);d--,f|=(e.next_in[_++]&255)<<h,h+=8}this.dist+=f&Yt[a],f>>=a,h-=a,this.mode=Nd;case Nd:for(x=c-this.dist;x<0;)x+=n.end;for(;this.len!=0;){if(D==0&&(c==n.end&&n.read!=0&&(c=0,D=c<n.read?n.read-c-1:n.end-c),D==0&&(n.write=c,t=n.inflate_flush(e,t),c=n.write,D=c<n.read?n.read-c-1:n.end-c,c==n.end&&n.read!=0&&(c=0,D=c<n.read?n.read-c-1:n.end-c),D==0)))return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=_-e.next_in_index,e.next_in_index=_,n.write=c,n.inflate_flush(e,t);n.window[c++]=n.window[x++],D--,x==n.end&&(x=0),this.len--}this.mode=os;break;case $d:if(D==0&&(c==n.end&&n.read!=0&&(c=0,D=c<n.read?n.read-c-1:n.end-c),D==0&&(n.write=c,t=n.inflate_flush(e,t),c=n.write,D=c<n.read?n.read-c-1:n.end-c,c==n.end&&n.read!=0&&(c=0,D=c<n.read?n.read-c-1:n.end-c),D==0)))return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=_-e.next_in_index,e.next_in_index=_,n.write=c,n.inflate_flush(e,t);t=Be,n.window[c++]=this.lit,D--,this.mode=os;break;case Ff:if(h>7&&(h-=8,d++,_--),n.write=c,t=n.inflate_flush(e,t),c=n.write,D=c<n.read?n.read-c-1:n.end-c,n.read!=n.write)return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=_-e.next_in_index,e.next_in_index=_,n.write=c,n.inflate_flush(e,t);this.mode=Ld;case Ld:return t=pr,n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=_-e.next_in_index,e.next_in_index=_,n.write=c,n.inflate_flush(e,t);case fs:return t=qe,n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=_-e.next_in_index,e.next_in_index=_,n.write=c,n.inflate_flush(e,t);default:return t=gn,n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=_-e.next_in_index,e.next_in_index=_,n.write=c,n.inflate_flush(e,t)}},Qa.prototype.free=function(n){},Qa.prototype.inflate_fast=function(n,e,t,a,o,s,f,h){var _,d,c,D,x,m,B,F,I,k,U,$,S,L,W,N;B=h.next_in_index,F=h.avail_in,x=f.bitb,m=f.bitk,I=f.write,k=I<f.read?f.read-I-1:f.end-I,U=Yt[n],$=Yt[e];do{for(;m<20;)F--,x|=(h.next_in[B++]&255)<<m,m+=8;if(_=x&U,d=t,c=a,N=(c+_)*3,(D=d[N])==0){x>>=d[N+1],m-=d[N+1],f.window[I++]=d[N+2],k--;continue}do{if(x>>=d[N+1],m-=d[N+1],D&16){for(D&=15,S=d[N+2]+(x&Yt[D]),x>>=D,m-=D;m<15;)F--,x|=(h.next_in[B++]&255)<<m,m+=8;_=x&$,d=o,c=s,N=(c+_)*3,D=d[N];do if(x>>=d[N+1],m-=d[N+1],D&16){for(D&=15;m<D;)F--,x|=(h.next_in[B++]&255)<<m,m+=8;if(L=d[N+2]+(x&Yt[D]),x>>=D,m-=D,k-=S,I>=L)W=I-L,I-W>0&&2>I-W,f.window[I++]=f.window[W++],f.window[I++]=f.window[W++],S-=2;else{W=I-L;do W+=f.end;while(W<0);if(D=f.end-W,S>D){if(S-=D,I-W>0&&D>I-W)do f.window[I++]=f.window[W++];while(--D!=0);else On(f.window,W,f.window,I,D),I+=D,W+=D,D=0;W=0}}do f.window[I++]=f.window[W++];while(--S!=0);break}else if(!(D&64))_+=d[N+2],_+=x&Yt[D],N=(c+_)*3,D=d[N];else return h.msg="invalid distance code",S=h.avail_in-F,S=m>>3<S?m>>3:S,F+=S,B-=S,m-=S<<3,f.bitb=x,f.bitk=m,h.avail_in=F,h.total_in+=B-h.next_in_index,h.next_in_index=B,f.write=I,qe;while(!0);break}if(D&64)return D&32?(S=h.avail_in-F,S=m>>3<S?m>>3:S,F+=S,B-=S,m-=S<<3,f.bitb=x,f.bitk=m,h.avail_in=F,h.total_in+=B-h.next_in_index,h.next_in_index=B,f.write=I,pr):(h.msg="invalid literal/length code",S=h.avail_in-F,S=m>>3<S?m>>3:S,F+=S,B-=S,m-=S<<3,f.bitb=x,f.bitk=m,h.avail_in=F,h.total_in+=B-h.next_in_index,h.next_in_index=B,f.write=I,qe);if(_+=d[N+2],_+=x&Yt[D],N=(c+_)*3,(D=d[N])==0){x>>=d[N+1],m-=d[N+1],f.window[I++]=d[N+2],k--;break}}while(!0)}while(k>=258&&F>=10);return S=h.avail_in-F,S=m>>3<S?m>>3:S,F+=S,B-=S,m-=S<<3,f.bitb=x,f.bitk=m,h.avail_in=F,h.total_in+=B-h.next_in_index,h.next_in_index=B,f.write=I,Be};function Ja(){}Ja.prototype.huft_build=function(n,e,t,a,o,s,f,h,_,d,c){var D,x,m,B,F,I,k,U,$,S,L,W,N,q,H;S=0,F=t;do this.c[n[e+S]]++,S++,F--;while(F!=0);if(this.c[0]==t)return f[0]=-1,h[0]=0,Be;for(U=h[0],I=1;I<=Or&&this.c[I]==0;I++);for(k=I,U<I&&(U=I),F=Or;F!=0&&this.c[F]==0;F--);for(m=F,U>F&&(U=F),h[0]=U,q=1<<I;I<F;I++,q<<=1)if((q-=this.c[I])<0)return qe;if((q-=this.c[F])<0)return qe;for(this.c[F]+=q,this.x[1]=I=0,S=1,N=2;--F!=0;)this.x[N]=I+=this.c[S],N++,S++;F=0,S=0;do(I=n[e+S])!=0&&(this.v[this.x[I]++]=F),S++;while(++F<t);for(t=this.x[m],this.x[0]=F=0,S=0,B=-1,W=-U,this.u[0]=0,L=0,H=0;k<=m;k++)for(D=this.c[k];D--!=0;){for(;k>W+U;){if(B++,W+=U,H=m-W,H=H>U?U:H,(x=1<<(I=k-W))>D+1&&(x-=D+1,N=k,I<H))for(;++I<H&&!((x<<=1)<=this.c[++N]);)x-=this.c[N];if(H=1<<I,this.hn[0]+H>dd)return qe;this.u[B]=L=this.hn[0],this.hn[0]+=H,B!=0?(this.x[B]=F,this.r[0]=I,this.r[1]=U,I=F>>>W-U,this.r[2]=L-this.u[B-1]-I,On(this.r,0,_,(this.u[B-1]+I)*3,3)):f[0]=L}for(this.r[1]=k-W,S>=t?this.r[0]=192:c[S]<a?(this.r[0]=this.v[S]<256?0:96,this.r[2]=this.v[S++]):(this.r[0]=s[this.v[S]-a]+16+64,this.r[2]=o[this.v[S++]-a]),x=1<<k-W,I=F>>>W;I<H;I+=x)On(this.r,0,_,(L+I)*3,3);for(I=1<<k-1;F&I;I>>>=1)F^=I;for(F^=I,$=(1<<W)-1;(F&$)!=this.x[B];)B--,W-=U,$=(1<<W)-1}return q!=0&&m!=1?er:Be},Ja.prototype.inflate_trees_bits=function(n,e,t,a,o){var s;return this.initWorkArea(19),this.hn[0]=0,s=this.huft_build(n,0,19,19,null,null,t,e,a,this.hn,this.v),s==qe?o.msg="oversubscribed dynamic bit lengths tree":(s==er||e[0]==0)&&(o.msg="incomplete dynamic bit lengths tree",s=qe),s},Ja.prototype.inflate_trees_dynamic=function(n,e,t,a,o,s,f,h,_){var d;return this.initWorkArea(288),this.hn[0]=0,d=this.huft_build(t,0,n,257,gm,_m,s,a,h,this.hn,this.v),d!=Be||a[0]==0?(d==qe?_.msg="oversubscribed literal/length tree":d!=pd&&(_.msg="incomplete literal/length tree",d=qe),d):(this.initWorkArea(288),d=this.huft_build(t,n,e,0,vm,wm,f,o,h,this.hn,this.v),d!=Be||o[0]==0&&n>257?(d==qe?_.msg="oversubscribed distance tree":d==er?(_.msg="incomplete distance tree",d=qe):d!=pd&&(_.msg="empty distance tree with lengths",d=qe),d):Be)};function mm(n,e,t,a,o){return n[0]=hm,e[0]=cm,t[0]=dm,a[0]=pm,Be}Ja.prototype.initWorkArea=function(n){this.hn==null&&(this.hn=new Int32Array(1),this.v=new Int32Array(n),this.c=new Int32Array(Or+1),this.r=new Int32Array(3),this.u=new Int32Array(Or),this.x=new Int32Array(Or+1)),this.v.length<n&&(this.v=new Int32Array(n));for(var e=0;e<n;e++)this.v[e]=0;for(var e=0;e<Or+1;e++)this.c[e]=0;for(var e=0;e<3;e++)this.r[e]=0;On(this.c,0,this.u,0,Or),On(this.c,0,this.x,0,Or+1)};var Dm=new Uint8Array(1),ym=typeof Dm.subarray=="function";function On(n,e,t,a,o){if(o!=0){if(n){if(!t)throw"Undef dest"}else throw"Undef src";e==0&&o==n.length?Bf(n,t,a):ym?Bf(n.subarray(e,e+o),t,a):n.BYTES_PER_ELEMENT==1&&o>100?Bf(new Uint8Array(n.buffer,n.byteOffset+e,o),t,a):xm(n,e,t,a,o)}}function xm(n,e,t,a,o){for(var s=0;s<o;++s)t[a+s]=n[e+s]}function Bf(n,e,t){e.set(n,t)}function Em(n,e,t,a){e?t?n=new Uint8Array(n,e,t):n=new Uint8Array(n,e,n.byteLength-e):n=new Uint8Array(n);var o=new ji;o.inflateInit(cd,!0),o.next_in=n,o.next_in_index=0,o.avail_in=n.length;for(var s=[],f=0;;){var h=new Uint8Array(32e3);o.next_out=h,o.next_out_index=0,o.avail_out=h.length;var _=o.inflate(um);if(_!=Be&&_!=pr&&_!=er)throw o.msg;if(o.avail_out!=0){var d=new Uint8Array(h.length-o.avail_out);On(h,0,d,0,h.length-o.avail_out),h=d}if(s.push(h),f+=h.length,_==pr||_==er)break}if(s.length==1)return s[0].buffer;for(var c=new Uint8Array(f),D=0,x=0;x<s.length;++x){var m=s[x];On(m,0,c,D,m.length),D+=m.length}return c.buffer}function Od(){}function Pd(n){n&&(this.id=n)}typeof module<"u"&&(module.exports={DASGroup:Pd,DASFeature:Od});var Cm=2291137574,Am=654086024,Fm=2273964779,Bm=3958540679,Sm=1,Im=2,Tm=3,Md=256,Ud=256*256,Wd=256*256*256,km=256*256*256*256,Rm=new RegExp("^[0-9]+,[0-9]+,[0-9]+");function lt(n,e){var t=n[e]+n[e+1]*Md+n[e+2]*Ud+n[e+3]*Wd+n[e+4]*km;return t}function gr(){}gr.prototype.readChromTree=function(n){var e=this;this.chromsToIDs={},this.idsToChroms={},this.chrAlias={1:"chr1",2:"chr2",3:"chr3",4:"chr4",5:"chr5",6:"chr6",7:"chr7",8:"chr8",9:"chr9",10:"chr10",11:"chr11",12:"chr12",13:"chr13",14:"chr14",15:"chr15",16:"chr16",17:"chr17",18:"chr18",19:"chr19",20:"chr20",21:"chr21",22:"chr22",X:"chrX",Y:"chrY",M:"chrM",MT:"chrM"},this.maxID=0;var t=this.unzoomedDataOffset,a=t-this.chromTreeOffset&3;t=t+4-a,this.data.slice(this.chromTreeOffset,t-this.chromTreeOffset).fetch(function(o){var s=new Uint8Array(o),f=new Int16Array(o),h=new Int32Array(o);h[0],h[1];var _=h[2];h[3],lt(s,16);var d=32,c=function(D){var x=s[D],m=f[D/2+1];D+=4;for(var B=0;B<m;++B)if(x==0){D+=_;var F=lt(s,D);D+=8,F-=e.chromTreeOffset,c(F)}else{for(var I="",k=0;k<_;++k){var U=s[D++];U!=0&&(I+=String.fromCharCode(U))}var $=s[D+3]<<24|s[D+2]<<16|s[D+1]<<8|s[D+0];s[D+7]<<24|s[D+6]<<16|s[D+5]<<8|s[D+4],D+=8,e.chromsToIDs[I]=$,e.idsToChroms[$]=I,e.chrAlias.hasOwnProperty(I)&&(e.chromsToIDs[e.chrAlias[I]]=$,e.idsToChroms[$]=e.chrAlias[I]),e.maxID=Math.max(e.maxID,$)}};c(d),n(e)})};function Mr(n,e,t,a){this.bwg=n,this.cirTreeOffset=e,this.cirTreeLength=t,this.isSummary=a}Mr.prototype.readWigData=function(n,e,t,a){var o=this.bwg.chromsToIDs[n];if(o===void 0)return a([]);this.readWigDataById(o,e,t,a)},Mr.prototype.readWigDataById=function(n,e,t,a){var o=this;if(!this.cirHeader){this.bwg.data.slice(this.cirTreeOffset,48).fetch(function(D){o.cirHeader=D;var x=new Int32Array(o.cirHeader);o.cirBlockSize=x[1],o.readWigDataById(n,e,t,a)});return}var s=[],f=0,h=function(D,x,m,B){return(n<0||D==n)&&x<=t&&m>=e},_=function(D,x){if(o.bwg.instrument&&console.log("level="+x+"; offset="+D+"; time="+(Date.now()|0)),f+=D.length,D.length==1&&D[0]-o.cirTreeOffset==48&&o.cachedCirRoot){c(o.cachedCirRoot,0,x),--f,f==0&&o.fetchFeatures(h,s,a);return}for(var m=4+o.cirBlockSize*32,B,F=0;F<D.length;++F){var I=new Gt(D[F],D[F]+m);B=B?union(B,I):I}for(var k=B.ranges(),U=0;U<k.length;++U){var $=k[U];d(D,$,x)}},d=function(D,x,m,B){x.max()-x.min(),o.bwg.data.slice(x.min(),x.max()-x.min()).fetch(function(F){for(var I=0;I<D.length;++I)x.contains(D[I])&&(c(F,D[I]-x.min(),m),D[I]-o.cirTreeOffset==48&&D[I]-x.min()==0&&(o.cachedCirRoot=F),--f,f==0&&o.fetchFeatures(h,s,a))})},c=function(D,x,m){var B=new Uint8Array(D),F=new Int16Array(D),I=new Int32Array(D),k=B[x],U=F[x/2+1];if(x+=4,k!=0)for(var $=0;$<U;++$){var S=x/4,L=I[S],W=I[S+1],N=I[S+2],q=I[S+3],H=lt(B,x+16),Z=lt(B,x+24);(n<0||L<n||L==n&&W<=t)&&(n<0||N>n||N==n&&q>=e)&&s.push({offset:H,size:Z}),x+=32}else{for(var Y=[],$=0;$<U;++$){var S=x/4,L=I[S],W=I[S+1],N=I[S+2],q=I[S+3],H=lt(B,x+16);(n<0||L<n||L==n&&W<=t)&&(n<0||N>n||N==n&&q>=e)&&Y.push(H),x+=24}Y.length>0&&_(Y,m+1)}};_([o.cirTreeOffset+48],1)},Mr.prototype.fetchFeatures=function(n,e,t){var a=this;if(e.sort(function(h,_){return(h.offset|0)-(_.offset|0)}),e.length==0)t([]);else{var o=[],s=function(h,_,d,c){c||(c={});var D=new Od;D._chromId=h,D.segment=a.bwg.idsToChroms[h],D.min=_,D.max=d,D.type=a.bwg.type;for(var x in c)D[x]=c[x];o.push(D)},f=function(){if(e.length==0){t(o);return}else{var h=e[0];if(h.data)a.parseFeatures(h.data,s,n),e.splice(0,1),f();else{for(var _=h.offset,d=h.size,c=1;c<e.length&&e[c].offset==_+d;)d+=e[c].size,++c;a.bwg.data.slice(_,d).fetch(function(D){for(var x=0,m=0;x<d;){var B=e[m],F;if(a.bwg.uncompressBufSize>0)F=Em(D,x+2,B.size-2);else{var I=new Uint8Array(B.size);arrayCopy(new Uint8Array(D,x,B.size),0,I,0,B.size),F=I.buffer}B.data=F,x+=B.size,++m}f()})}}};f()}},Mr.prototype.parseFeatures=function(n,e,t){var a=new Uint8Array(n);if(this.isSummary)for(var o=new Int16Array(n),s=new Int32Array(n),f=new Float32Array(n),h=n.byteLength/32,_=0;_<h;++_){var d=s[_*8],c=s[_*8+1],D=s[_*8+2],x=s[_*8+3];f[_*8+4];var m=f[_*8+5],B=f[_*8+6];if(f[_*8+7],t(d,c+1,D)){var F={type:"bigwig",score:B/x,maxScore:m};this.bwg.type=="bigbed"&&(F.type="density"),e(d,c+1,D,F)}}else if(this.bwg.type=="bigwig"){var o=new Int16Array(n),s=new Int32Array(n),f=new Float32Array(n),d=s[0],I=s[1];s[2];var k=s[3],U=s[4],$=a[20],h=o[11];if($==Tm)for(var _=0;_<h;++_){var S=f[_+6],L=I+_*k+1,W=I+_*k+U;t(d,L,W)&&e(d,L,W,{score:S})}else if($==Im)for(var _=0;_<h;++_){var c=s[_*2+6]+1,D=c+U-1,S=f[_*2+7];t(d,c,D)&&e(d,c,D,{score:S})}else if($==Sm)for(var _=0;_<h;++_){var c=s[_*3+6]+1,D=s[_*3+7],S=f[_*3+8];c>D&&(c=D),t(d,c,D)&&e(d,c,D,{score:S})}else console.log("Currently not handling bwgType="+$)}else if(this.bwg.type=="bigbed")for(var N=0,q=this.bwg.definedFieldCount,H=this.bwg.schema;N<a.length;){var d=a[N+3]<<24|a[N+2]<<16|a[N+1]<<8|a[N+0],c=a[N+7]<<24|a[N+6]<<16|a[N+5]<<8|a[N+4],D=a[N+11]<<24|a[N+10]<<16|a[N+9]<<8|a[N+8];N+=12;for(var Z="";;){var Y=a[N++];if(Y!=0)Z+=String.fromCharCode(Y);else break}var re={},se;if(Z.length>0?se=Z.split(" "):se=[],se.length>0&&q>3&&(re.label=se[0]),se.length>1&&q>4){var S=parseInt(se[1]);isNaN(S)||(re.score=S)}if(se.length>2&&q>5&&(re.orientation=se[2]),se.length>5&&q>8){var fe=se[5];Rm.test(fe)&&(re.itemRgb="rgb("+fe+")")}if(se.length>q-3&&H)for(var ce=q-3;ce<se.length;++ce)re[H.fields[ce+3].name]=se[ce];if(t(d,c+1,D,se))if(q<12)e(d,c+1,D,re);else{var Me=se[3]|0,Fe=se[4]|0,Ce=se[6]|0,vn=se[7].split(","),kt=se[8].split(",");if(re.exonFrames){var tt=re.exonFrames.split(",");re.exonFrames=void 0}re.type="transcript";var Te=new Pd;for(var Pn in re)Te[Pn]=re[Pn];if(Te.id=se[0],Te.segment=this.bwg.idsToChroms[d],Te.min=c+1,Te.max=D,Te.notes=[],re.groups=[Te],se.length>9){var Oe=re.geneName||se[9],ke=Oe;se.length>10&&(ke=se[10]),re.geneName2&&(ke=re.geneName2);var Dt=shallowCopy(Te);Dt.id=Oe,Dt.label=ke,Dt.type="gene",re.groups.push(Dt)}for(var Qt=[],Rt=0;Rt<Ce;++Rt){var wn=(kt[Rt]|0)+c,vr=wn+(vn[Rt]|0),yt=new Gt(wn,vr);Qt.push(yt)}for(var Nt=union(Qt),bn=Nt.ranges(),Je=0;Je<bn.length;++Je){var _t=bn[Je];e(d,_t.min()+1,_t.max(),re)}if(Fe>Me){var tr=re.orientation=="+"?new Gt(Me,Fe+3):new Gt(Me-3,Fe),vt=intersection(Nt,tr);if(vt){re.type="translation";for(var wr=vt.ranges(),bi=0,Jt=0;wr[0].min()>bn[Jt].max();)Jt++;for(var Je=0;Je<wr.length;++Je){var xt=Je;re.orientation=="-"&&(xt=wr.length-Je-1);var _t=wr[xt];if(re.readframe=bi,tt){var mn=parseInt(tt[xt+Jt]);typeof mn=="number"&&mn>=0&&mn<=2&&(re.readframe=mn,re.readframeExplicit=!0)}var br=_t.max()-_t.min();bi=(bi+br)%3,e(d,_t.min()+1,_t.max(),re)}}}}}else throw Error("Don't know what to do with "+this.bwg.type)},Mr.prototype.getFirstAdjacent=function(n,e,t,a){var o=this.bwg.chromsToIDs[n];if(o===void 0)return a([]);this.getFirstAdjacentById(o,e,t,a)},Mr.prototype.getFirstAdjacentById=function(n,e,t,a){var o=this;if(!this.cirHeader){this.bwg.data.slice(this.cirTreeOffset,48).fetch(function(x){o.cirHeader=x;var m=new Int32Array(o.cirHeader);o.cirBlockSize=m[1],o.getFirstAdjacentById(n,e,t,a)});return}var s=null,f=-1,h=-1,_=0,d=function(x,m){_+=x.length;for(var B=4+o.cirBlockSize*32,F,I=0;I<x.length;++I){var k=new Gt(x[I],x[I]+B);F=F?union(F,k):k}for(var U=F.ranges(),$=0;$<U.length;++$){var S=U[$];c(x,S)}},c=function(x,m,B,F){m.max()-m.min(),o.bwg.data.slice(m.min(),m.max()-m.min()).fetch(function(I){for(var k=0;k<x.length;++k)if(m.contains(x[k])&&(D(I,x[k]-m.min()),--_,_==0)){if(!s)return t>0&&(n!=0||e>0)?o.getFirstAdjacentById(0,0,t,a):t<0&&(n!=o.bwg.maxID||e<1e9)?o.getFirstAdjacentById(o.bwg.maxID,1e9,t,a):a([]);o.fetchFeatures(function(U,$,S,L){return t<0&&(U<n||S<e)||t>0&&(U>n||$>e)},[s],function(U){for(var $=null,S=-1,L=-1,W=0;W<U.length;++W){var N=U[W],q=N._chromId,H=N.min,Z=N.max;($==null||t<0&&(q>S||Z>L)||t>0&&(q<S||H<L))&&($=N,L=t<0?Z:H,S=q)}return $!=null?a([$]):a([])})}})},D=function(x,m,B){var F=new Uint8Array(x),I=new Int16Array(x),k=new Int32Array(x),U=F[m],$=I[m/2+1];if(m+=4,U!=0)for(var S=0;S<$;++S){var L=m/4,W=k[L],N=k[L+1],q=k[L+2],H=k[L+3],Z=lt(F,m+16),Y=lt(F,m+24);(t<0&&(W<n||W==n&&N<=e)||t>0&&(q>n||q==n&&H>=e))&&(/_random/.exec(o.bwg.idsToChroms[W])||(s==null||t<0&&(q>f||q==f&&H>h)||t>0&&(W<f||W==f&&N<h))&&(s={offset:Z,size:Y},h=t<0?H:N,f=t<0?q:W)),m+=32}else{for(var re=-1,se=-1,S=0;S<$;++S){var L=m/4,W=k[L],N=k[L+1],q=k[L+2],H=k[L+3],Z=k[L+4]<<32|k[L+5];(t<0&&(W<n||W==n&&N<=e)&&q>=n||t>0&&(q>n||q==n&&H>=e)&&W<=n)&&(re<0||H>se)&&(re=Z,se=t<0?H:N),m+=24}re>=0&&d([re])}};d([o.cirTreeOffset+48])},gr.prototype.readWigData=function(n,e,t,a){this.getUnzoomedView().readWigData(n,e,t,a)},gr.prototype.getUnzoomedView=function(){if(!this.unzoomedView){var n=4e3,e=this.zoomLevels[0];e&&(n=this.zoomLevels[0].dataOffset-this.unzoomedIndexOffset),this.unzoomedView=new Mr(this,this.unzoomedIndexOffset,n,!1)}return this.unzoomedView},gr.prototype.getZoomedView=function(n){var e=this.zoomLevels[n];return e.view||(e.view=new Mr(this,e.indexOffset,4e3,!0)),e.view};function Nm(n,e,t){var a=new gr;a.data=n,a.name=t,a.data.slice(0,512).salted().fetch(function(o){if(!o)return e(null,"Couldn't fetch file");var s=o,f=new Uint8Array(s),h=new Int16Array(s),_=new Int32Array(s),d=f[0]+Md*f[1]+Ud*f[2]+Wd*f[3];if(d==Cm)a.type="bigwig";else if(d==Fm)a.type="bigbed";else return d==Am||d==Bm?e(null,"Currently don't support big-endian BBI files"):e(null,"Not a supported format, magic=0x"+d.toString(16));a.version=h[2],a.numZoomLevels=h[3],a.chromTreeOffset=lt(f,8),a.unzoomedDataOffset=lt(f,16),a.unzoomedIndexOffset=lt(f,24),a.fieldCount=h[16],a.definedFieldCount=h[17],a.asOffset=lt(f,36),a.totalSummaryOffset=lt(f,44),a.uncompressBufSize=_[13],a.extHeaderOffset=lt(f,56),a.zoomLevels=[];for(var c=0;c<a.numZoomLevels;++c){var D=_[c*6+16],x=lt(f,c*24+72),m=lt(f,c*24+80);a.zoomLevels.push({reduction:D,dataOffset:x,indexOffset:m})}a.readChromTree(function(){a.getAutoSQL(function(B){return a.schema=B,e(a)})})},{timeout:5e3})}gr.prototype._tsFetch=function(n,e,t,a,o){var s=this;if(n>=this.zoomLevels.length-1)if(!this.topLevelReductionCache)this.getZoomedView(this.zoomLevels.length-1).readWigDataById(-1,0,3e8,function(c){return s.topLevelReductionCache=c,s._tsFetch(n,e,t,a,o)});else{for(var f=[],h=this.topLevelReductionCache,_=0;_<h.length;++_)h[_]._chromId==e&&f.push(h[_]);return o(f)}else{var d;return n<0?d=this.getUnzoomedView():d=this.getZoomedView(n),d.readWigDataById(e,t,a,o)}},gr.prototype.thresholdSearch=function(n,e,t,a,o){t=t<0?-1:1;for(var s=this,f=this.chromsToIDs[n],h=[{chrOrd:0,chr:f,zoom:s.zoomLevels.length-4,min:0,max:3e8,fromRef:!0}],_=1;_<=this.maxID+1;++_){var d=(f+t*_)%(this.maxID+1);d<0&&(d+=this.maxID+1),h.push({chrOrd:_,chr:d,zoom:s.zoomLevels.length-1,min:0,max:3e8})}function c(){if(h.length==0)return o(null);h.sort(function(x,m){var B=x.zoom-m.zoom;return B!=0||(B=x.chrOrd-m.chrOrd,B!=0)?B:x.min-m.min*t});var D=h.splice(0,1)[0];s._tsFetch(D.zoom,D.chr,D.min,D.max,function(x){var m=t>0?0:3e8;D.fromRef&&(m=e);for(var B=0;B<x.length;++B){var F=x[B],I;if(F.maxScore!=null?I=F.maxScore:I=F.score,t>0){if(I>a)if(D.zoom<0){if(F.min>m)return o(F)}else F.max>m&&h.push({chr:D.chr,chrOrd:D.chrOrd,zoom:D.zoom-2,min:F.min,max:F.max,fromRef:D.fromRef})}else if(I>a)if(D.zoom<0){if(F.max<m)return o(F)}else F.min<m&&h.push({chr:D.chr,chrOrd:D.chrOrd,zoom:D.zoom-2,min:F.min,max:F.max,fromRef:D.fromRef})}c()})}c()},gr.prototype.getAutoSQL=function(n){if(!this.asOffset)return n(null);this.data.slice(this.asOffset,2048).fetch(function(e){for(var t=new Uint8Array(e),a="",o=0;o<t.length&&t[o]!=0;++o)a+=String.fromCharCode(t[o]);var s=/(\w+)\s+(\w+)\s+("([^"]+)")?\s+\(\s*/,f=/([\w\[\]]+)\s+(\w+)\s*;\s*("([^"]+)")?\s*/g,h=s.exec(a);if(h){var _={declType:h[1],name:h[2],comment:h[4],fields:[]};a=a.substring(h[0]);for(var d=f.exec(a);d!=null;d=f.exec(a))_.fields.push({type:d[1],name:d[2],comment:d[4]});return n(_)}})},gr.prototype.getExtraIndices=function(n){var e=this;if(this.version<4||this.extHeaderOffset==0||this.type!="bigbed")return n(null);this.data.slice(this.extHeaderOffset,64).fetch(function(t){if(!t)return n(null,"Couldn't fetch extension header");var a=new Uint8Array(t),o=new Int16Array(t);o[0];var s=o[1],f=lt(a,4);if(s==0)return n(null);e.data.slice(f,s*20).fetch(function(h){if(!h)return n(null,"Couldn't fetch index info");for(var _=new Uint8Array(h),d=new Int16Array(h),c=[],D=0;D<s;++D){var x=d[D*10],m=d[D*10+1],B=lt(_,D*20+4),F=d[D*10+8],I=new Gd(e,x,m,B,F);c.push(I)}n(c)})})};function Gd(n,e,t,a,o){this.bbi=n,this.type=e,this.fieldCount=t,this.offset=a,this.field=o}Gd.prototype.lookup=function(n,e){var t=this;this.bbi.data.slice(this.offset,32).fetch(function(a){var o=new Uint8Array(a),s=new Int32Array(a);s[0];var f=s[1],h=s[2],_=s[3];lt(o,16);var d=32;function c(D){t.bbi.data.slice(D,4+f*(h+_)).fetch(function(x){var m=new Uint8Array(x),B=new Uint16Array(x),F=m[0],I=B[1],k=4;if(F==0){for(var U=null,$=0;$<I;++$){for(var S="",L=0;L<h;++L){var W=m[k++];W!=0&&(S+=String.fromCharCode(W))}var N=lt(m,k);if(k+=8,n.localeCompare(S)<0&&U){c(U);return}U=N}c(U)}else{for(var $=0;$<I;++$){for(var S="",L=0;L<h;++L){var W=m[k++];W!=0&&(S+=String.fromCharCode(W))}if(S==n){var q=lt(m,k),H=readInt(m,k+8);return t.bbi.getUnzoomedView().fetchFeatures(function(re,se,fe,ce){if(ce&&ce.length>t.field-3)return ce[t.field-3]==n},[{offset:q,size:H}],e)}k+=_}return e([])}})}c(t.offset+d)})};var $m="";function Lm(n){return Om(qd(Hd(n)))}function Sf(n){return Pm(qd(Hd(n)))}function qd(n){return Um(Wm(Mm(n),n.length*8))}function Om(n){for(var e="0123456789abcdef",t="",a,o=0;o<n.length;o++)a=n.charCodeAt(o),t+=e.charAt(a>>>4&15)+e.charAt(a&15);return t}function Pm(n){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="",a=n.length,o=0;o<a;o+=3)for(var s=n.charCodeAt(o)<<16|(o+1<a?n.charCodeAt(o+1)<<8:0)|(o+2<a?n.charCodeAt(o+2):0),f=0;f<4;f++)o*8+f*6>n.length*8?t+=$m:t+=e.charAt(s>>>6*(3-f)&63);return t}function Hd(n){for(var e="",t=-1,a,o;++t<n.length;)a=n.charCodeAt(t),o=t+1<n.length?n.charCodeAt(t+1):0,55296<=a&&a<=56319&&56320<=o&&o<=57343&&(a=65536+((a&1023)<<10)+(o&1023),t++),a<=127?e+=String.fromCharCode(a):a<=2047?e+=String.fromCharCode(192|a>>>6&31,128|a&63):a<=65535?e+=String.fromCharCode(224|a>>>12&15,128|a>>>6&63,128|a&63):a<=2097151&&(e+=String.fromCharCode(240|a>>>18&7,128|a>>>12&63,128|a>>>6&63,128|a&63));return e}function Mm(n){for(var e=Array(n.length>>2),t=0;t<e.length;t++)e[t]=0;for(var t=0;t<n.length*8;t+=8)e[t>>5]|=(n.charCodeAt(t/8)&255)<<24-t%32;return e}function Um(n){for(var e="",t=0;t<n.length*32;t+=8)e+=String.fromCharCode(n[t>>5]>>>24-t%32&255);return e}function Wm(n,e){n[e>>5]|=128<<24-e%32,n[(e+64>>9<<4)+15]=e;for(var t=Array(80),a=1732584193,o=-271733879,s=-1732584194,f=271733878,h=-1009589776,_=0;_<n.length;_+=16){for(var d=a,c=o,D=s,x=f,m=h,B=0;B<80;B++){B<16?t[B]=n[_+B]:t[B]=If(t[B-3]^t[B-8]^t[B-14]^t[B-16],1);var F=_r(_r(If(a,5),Gm(B,o,s,f)),_r(_r(h,t[B]),qm(B)));h=f,f=s,s=If(o,30),o=a,a=F}a=_r(a,d),o=_r(o,c),s=_r(s,D),f=_r(f,x),h=_r(h,m)}return Array(a,o,s,f,h)}function Gm(n,e,t,a){return n<20?e&t|~e&a:n<40?e^t^a:n<60?e&t|e&a|t&a:e^t^a}function qm(n){return n<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514}function _r(n,e){var t=(n&65535)+(e&65535),a=(n>>16)+(e>>16)+(t>>16);return a<<16|t&65535}function If(n,e){return n<<e|n>>>32-e}typeof module<"u"&&(module.exports={b64_sha1:Sf,hex_sha1:Lm});function Hm(n){var e={};for(var t in n)e[t]=n[t];return e}function wi(n,e,t,a){a||(typeof e=="object"?(a=e,e=void 0):a={}),this.url=n,this.start=e||0,t&&(this.end=t),this.opts=a}wi.prototype.slice=function(n,e){if(n<0)throw"Bad slice "+n;var t=this.start,a=this.end;return t&&n?t=t+n:t=n||t,e&&t?a=t+e-1:a=a||e-1,new wi(this.url,t,a,this.opts)};var Vd=0,Zd=navigator.userAgent.indexOf("Safari")>=0&&navigator.userAgent.indexOf("Chrome")<0;wi.prototype.fetchAsText=function(n){try{var e=new XMLHttpRequest,t,a=this.url;if((Zd||this.opts.salt)&&a.indexOf("?")<0&&(a=a+"?salt="+Sf(""+Date.now()+","+ ++Vd)),e.open("GET",a,!0),this.end){if(this.end-this.start>1e8)throw"Monster fetch!";e.setRequestHeader("Range","bytes="+this.start+"-"+this.end),e.setRequestHeader("accept-encoding","gzip,deflate"),t=this.end-this.start+1}e.onreadystatechange=function(){if(e.readyState==4)return e.status==200||e.status==206?n(e.responseText):n(null)},this.opts.credentials&&(e.withCredentials=!0),e.send("")}catch{return n(null)}},wi.prototype.salted=function(){var n=Hm(this.opts);return n.salt=!0,new wi(this.url,this.start,this.end,n)},wi.prototype.fetch=function(n,e){var t=this;e=e||{};var a=e.attempt||1,o=e.truncatedLength;if(a>3)return n(null);try{var s,f=new XMLHttpRequest,h,_=this.url;if((Zd||this.opts.salt)&&_.indexOf("?")<0&&(_=_+"?salt="+Sf(""+Date.now()+","+ ++Vd)),f.open("GET",_,!0),f.overrideMimeType("text/plain; charset=x-user-defined"),this.end){if(this.end-this.start>1e8)throw"Monster fetch!";f.setRequestHeader("Range","bytes="+this.start+"-"+this.end),h=this.end-this.start+1}f.responseType="arraybuffer",f.onreadystatechange=function(){if(f.readyState==4)if(s&&clearTimeout(s),f.status==200||f.status==206)if(f.response){var d=f.response.byteLength;return h&&h!=d&&(!o||d!=o)?t.fetch(n,{attempt:a+1,truncatedLength:d}):n(f.response)}else{if(f.mozResponseArrayBuffer)return n(f.mozResponseArrayBuffer);var c=f.responseText;return h&&h!=c.length&&(!o||c.length!=o)?t.fetch(n,{attempt:a+1,truncatedLength:c.length}):n(Vm(f.responseText))}else return t.fetch(n,{attempt:a+1})},this.opts.credentials&&f.setRequestHeader("Authorization",this.opts.credentials),f.send("")}catch{return n(null)}};function Vm(n){if(!n)return null;for(var e=new Uint8Array(n.length),t=0;t<e.length;++t)e[t]=n.charCodeAt(t);return e.buffer}/**
55
- * Reads and gets data from bigwig or bigbed files hosted remotely. Gets DASFeature records, which vary in schema
56
- * depending on the file.
57
- *
58
- * @license MIT
59
- */class Zm{constructor(e){ue(this,"url");ue(this,"bigWigPromise");this.url=e,this.bigWigPromise=this.loadBigWig(e)}async loadBigWig(e){try{return new Promise((t,a)=>{Nm(new wi(e),(o,s)=>{s?a(s):t(o)})})}catch(t){return console.error("Failed to dynamically load the BigWig module:",t),Promise.reject(t)}}async getData(e,t,a){const o=await this.bigWigPromise,s=a.zoomLevel===void 0||a.zoomLevel===zb.AUTO?this._getMatchingZoomLevel(o,t):Number.parseInt(a.zoomLevel);let f=e.map(d=>this._getDataForChromosome(d,o,s));const h=await Promise.all(f),_=Xt.flatten(h);for(let d of _)d.min-=1;return _}_getMatchingZoomLevel(e,t){if(!t)return-1;if(e.zoomLevels.length===1)return 0;let o=e.zoomLevels.slice().sort((s,f)=>f.reduction-s.reduction).find(s=>s.reduction<t);return e.zoomLevels.findIndex(s=>s===o)}_getDataForChromosome(e,t,a){const o=e.start+1,s=e.end;return new Promise((f,h)=>{try{a===-1?t.readWigData(e.chr,o,s,f):t.getZoomedView(a).readWigData(e.chr,o,s,f)}catch(_){h(_)}})}}let Ur={};const Tf={WashU:"https://lambda.epigenomegateway.org/v3"},Xm={geneannotation:async function(e){let t,a;const o=e.trackModel;o.apiConfig&&o.apiConfig.genome?t=o.apiConfig.genome:t=e.genomeName,o.apiConfig&&o.apiConfig.format in Tf?a=Tf[`${o.apiConfig.format}`]:a=Tf.WashU;let s=`${a}/${t}/genes/${e.name}/queryRegion?chr=${e.chr}&start=${e.start}&end=${e.end}`;return(await fetch(s,{method:"GET"})).json()},snp:async function(e){const t={hg19:"https://grch37.rest.ensembl.org/overlap/region/human",hg38:"https://rest.ensembl.org/overlap/region/human"},a=e.genomeName in t?t[`${e.genomeName}`]:null;if(!a)return[];const o={"Content-Type":"application/json"};if(e.end-e.start<=3e4){const s=`${a}/${e.chr.substr(3)}:${e.start}-${e.end+"?content-type=application%2Fjson&feature=variation"}`;return fetch(s,{headers:o}).then(f=>{if(!f.ok)throw new Error("Network response was not ok");return f.json()}).catch(f=>(console.error("There was a problem with the fetch operation:",f),{data:[]}))}else return[]},bed:async function(e){return st(e,"bedOrTabix")},bedcolor:async function(e){return st(e,"bedOrTabix")},omeroidr:async function(e){return st(e,"bedOrTabix")},bedgraph:async function(e){return st(e,"bedOrTabix")},qbed:async function(e){return st(e,"bedOrTabix")},dbedgraph:async function(e){return st(e,"bedOrTabix")},boxplot:async function(e){return st(e,"big")},modbed:async function(e){return st(e,"bedOrTabix")},jaspar:async function(e){return st(e,"jaspar")},bigbed:async function(e){return st(e,"bigbed")},refbed:async function(e){return st(e,"bedOrTabix")},matplot:async function(e){return st(e,"bedOrTabix")},bigwig:async function(e){return st(e,"big")},categorical:async function(e){return st(e,"bedOrTabix")},longrange:async function(e){return st(e,"bedOrTabix")},dynseq:async function(e){return st(e,"big")},repeatmasker:async function(e){return st(e,"repeat")},biginteract:async function(e){return st(e,"big")},methylc:async function(e){return st(e,"bedOrTabix")},genomealign:function(e){return st(e,"bedOrTabix")},vcf:function(e){return st(e,"vcf")}};function st(n,e){let t=null;n.trackModel.indexUrl&&(t=n.trackModel.indexUrl),n.trackModel.id in Ur||(e==="bedOrTabix"?Ur[`${n.trackModel.id}`]=new Jv(n.trackModel.url,t):e==="vcf"?Ur[`${n.trackModel.id}`]=new jb(n.trackModel.url,t):e==="bigbed"?Ur[`${n.trackModel.id}`]=new Zm(n.trackModel.url):e==="big"?Ur[`${n.trackModel.id}`]=new Ef(n.trackModel.url):e==="repeat"?Ur[`${n.trackModel.id}`]=new Zb(n.trackModel.url):e==="jaspar"&&(Ur[`${n.trackModel.id}`]=new Kb(n.trackModel.url)));let a=Ur[`${n.trackModel.id}`];return e in{repeat:"",jaspar:"",bigbed:""}?a.getData(n.nav,n.basesPerPixel,n.trackModel.options):a.getData(n.nav,n.trackModel.options)}async function Km(n){const e=n.regionExpandLoci,t=n.trackToFetch,a=n.genomicLoci,o={},s={},f={},h=n.useFineModeNav,_=n.primaryGenName,d=n.initGenomicLoci;f[`${_}`]={genomicLoci:a,regionExpandLoci:e,initGenomicLoci:d};const c=t,D=[e];c.length>0&&await x(n.visData.visRegion,c);async function x(B,F){let I=[];for(let Z of n.visData.visRegion._navContext._features){let Y=new rt(Z.locus.chr,Z.locus.start,Z.locus.end);I.push(new qn(Z.name,Y))}let k=new In(n.visData.visRegion._navContext._name,I),U=new Ti(k,B._startBase,B._endBase),$=[];for(let Z of n.visData.viewWindowRegion._navContext._features){let Y=new rt(Z.locus.chr,Z.locus.start,Z.locus.end);$.push(new qn(Z.name,Y))}let S=new In(n.visData.viewWindowRegion._navContext._name,$),L=new Ti(S,n.visData.viewWindowRegion._startBase,n.visData.viewWindowRegion._endBase),W={visWidth:n.visData.visWidth,visRegion:U,viewWindow:new Ne(n.windowWidth,n.windowWidth*2),viewWindowRegion:L};await Promise.all(F.map(async(Z,Y)=>{let re;await Promise.all(D.map(async(se,fe)=>{try{const ce=await Xm.genomealign({nav:se,options:{height:40,isCombineStrands:!1,colorsForContext:{CG:{color:"rgb(100,139,216)",background:"#d9d9d9"},CHG:{color:"rgb(255,148,77)",background:"#ffe0cc"},CHH:{color:"rgb(255,0,255)",background:"#ffe5ff"}},depthColor:"#525252",depthFilter:0,maxMethyl:1,label:""},url:Z.url,trackModel:Z});let Me=[];for(const Fe of ce){let Ce=Bg.parse("{"+Fe[3]+"}");Fe[3]=Ce,Me.push(new Rg(Fe))}re=Me,s[`${Z.id}`]=""}catch{re={error:`Error processing genome align track with id ${Z.id}: Error`}}})),o[`${Z.id}`]={name:Z.name,records:re,query:Z.querygenome,id:Z.id,trackModel:Z,metadata:Z.metadata,isBigChain:!1}}));let N=[];for(const Z in o)"error"in o[Z].records||N.push(o[Z]);let H=new k_(n.primaryGenName).multiAlign(W,N);for(let Z in H){let Y;if(!h){Y=[].concat.apply([],H[`${Z}`].drawData.map(Te=>Te.segments));const fe=Y.map(Te=>Te.record.queryStrand),ce=Y.map(Te=>Te.targetXSpan),Me=Y.map(Te=>Te.queryXSpan),Fe=Y.map(Te=>Te.visiblePart.getLocus().toString()),Ce=Y.map(Te=>Te.visiblePart.getQueryLocus().toString()),vn=Y.map(Te=>Ni(Te.visiblePart.getLength())),kt=Y.map(Te=>Ni(Te.visiblePart.getQueryLocus().getLength()));let tt={};tt={strandList:fe,targetXSpanList:ce,queryXSpanList:Me,targetLocusList:Fe,queryLocusList:Ce,lengthList:vn,queryLengthList:kt},H[`${Z}`]={...H[`${Z}`],...tt}}for(let fe=0;fe<H[`${Z}`].drawData.length;fe++){let ce=H[`${Z}`].drawData[fe],Me={};const{targetXSpan:Fe}=ce;if(h){const Ce=ce.visiblePart.getTargetSequence(),vn=ce.visiblePart.getQuerySequence(),kt=Fe.getLength()/Ce.length,tt=ce.visiblePart.getLocus().toString(),Te=ce.visiblePart.getQueryLocus().toString(),Pn=ce.visiblePart.getQueryLocusFine(),Oe=ce.targetSegments.filter(Qt=>!Qt.isGap),ke=ce.querySegments.filter(Qt=>!Qt.isGap),Dt=ce.record.getIsReverseStrandQuery();Me={targetSequence:Ce,querySequence:vn,nonGapsQuery:ke,baseWidth:kt,targetLocus:tt,queryLocus:Te,nonGapsTarget:Oe,isReverseStrandQuery:Dt,queryLocusFine:Pn}}else Me={estimatedLabelWidth:ce.queryFeature.toString().length};H[`${Z}`].drawData[fe]={...ce,...Me}}let re=[],se=H[`${Z}`].queryRegion._navContext._featuresForChr;for(let fe in se)if(fe!==""){let ce=m(se[`${fe}`][0].name).start,Me=m(se[`${fe}`][se[`${fe}`].length-1].name).end;re.push({chr:fe,start:ce,end:Me})}f[`${_}`].primaryVisData=H[`${Z}`].primaryVisData,f[`${Z}`]={queryGenomicCoord:new Array(re),id:H[`${Z}`].id,queryRegion:H[`${Z}`].queryRegion},o[`${H[`${Z}`].id}`].records=H[`${Z}`]}}function m(B){const[F,I]=B.split(":"),[k,U]=I.split("-"),$=F.slice(3),S=parseInt(k,10),L=parseInt(U,10);return{chr:$,start:S,end:L}}return{fetchResults:o,navData:{...n,genomicFetchCoord:f,trackToDrawId:s,regionSetStartBp:n.visData.visRegion._endBase-n.visData.visRegion._startBase===n.bpRegionSize?0:null}}}typeof self<"u"&&"postMessage"in self&&"onmessage"in self&&typeof window>"u"&&(self.onmessage=async n=>{try{const e=await Km(n.data);postMessage(e)}catch(e){console.error("Worker error:",e),postMessage({error:e instanceof Error?e.message:"Unknown error"})}})})();