@loaders.gl/tile-converter 3.1.7 → 3.1.8

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.
@@ -289,4 +289,4 @@ var n=r(11),i=r(30).parse,a=["acl","location","logging","notification","partNumb
289
289
  */
290
290
  e.exports=r(443)},function(e){e.exports=JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/oauth-authz-req+jwt":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana"},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sarif-external-properties+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana"},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gnas":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gtpc":{"source":"iana"},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.lpp":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ngap":{"source":"iana"},"application/vnd.3gpp.pfcp":{"source":"iana"},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.s1ap":{"source":"iana"},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.cryptomator.vault":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujifilm.fb.docuworks":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.container":{"source":"iana"},"application/vnd.fujifilm.fb.jfi+xml":{"source":"iana","compressible":true},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana","extensions":["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"source":"iana","compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana"},"image/avcs":{"source":"iana"},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.pytha.pyox":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"source":"iana","extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"compressible":true,"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}')},function(e,t,r){e.exports=u,u.SSL=l;var n=r(1),i=r(39).Agent,a=r(98),o=r(237),s=r(50).Agent;function c(e,t){return"string"==typeof e?e+":"+t:e.host+":"+e.port+":"+(e.localAddress?e.localAddress+":":":")}function u(e){var t=this;t.options=e||{},t.requests={},t.sockets={},t.freeSockets={},t.maxSockets=t.options.maxSockets||i.defaultMaxSockets,t.minSockets=t.options.minSockets||u.defaultMinSockets,t.on("free",(function(e,r,n){var i=c(r,n);if(t.requests[i]&&t.requests[i].length)t.requests[i].shift().onSocket(e);else if(t.sockets[i].length<t.minSockets){t.freeSockets[i]||(t.freeSockets[i]=[]),t.freeSockets[i].push(e);var a=function(){e.destroy()};e._onIdleError=a,e.on("error",a)}else e.destroy()}))}function l(e){u.call(this,e)}n.inherits(u,i),u.defaultMinSockets=5,u.prototype.createConnection=a.createConnection,u.prototype.addRequestNoreuse=i.prototype.addRequest,u.prototype.addRequest=function(e,t,r){var n=c(t,r);if("string"!=typeof t){var i=t;r=i.port,t=i.host}if(this.freeSockets[n]&&this.freeSockets[n].length>0&&!e.useChunkedEncodingByDefault){var a=this.freeSockets[n].pop();a.removeListener("error",a._onIdleError),delete a._onIdleError,e._reusedSocket=!0,e.onSocket(a)}else this.addRequestNoreuse(e,t,r)},u.prototype.removeSocket=function(e,t,r,n){var i;this.sockets[t]?-1!==(i=this.sockets[t].indexOf(e))&&this.sockets[t].splice(i,1):this.sockets[t]&&0===this.sockets[t].length&&(delete this.sockets[t],delete this.requests[t]);this.freeSockets[t]&&(-1!==(i=this.freeSockets[t].indexOf(e))&&(this.freeSockets[t].splice(i,1),0===this.freeSockets[t].length&&delete this.freeSockets[t]));this.requests[t]&&this.requests[t].length&&this.createSocket(t,r,n).emit("free")},n.inherits(l,u),l.prototype.createConnection=function(e,t,r){r="object"==typeof e?e:"object"==typeof t?t:"object"==typeof r?r:{};"number"==typeof e&&(r.port=e);"string"==typeof t&&(r.host=t);return o.connect(r)},l.prototype.addRequestNoreuse=s.prototype.addRequest},function(e,t,r){var n=r(238),i=r(1),a=r(2),o=r(39),s=r(50),c=r(30).parse,u=r(3),l=r(107),h=r(447),p=r(451);function f(e){if(!(this instanceof f))return new f;for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],n.call(this),e=e||{})this[t]=e[t]}e.exports=f,i.inherits(f,n),f.LINE_BREAK="\r\n",f.DEFAULT_CONTENT_TYPE="application/octet-stream",f.prototype.append=function(e,t,r){"string"==typeof(r=r||{})&&(r={filename:r});var a=n.prototype.append.bind(this);if("number"==typeof t&&(t=""+t),i.isArray(t))this._error(new Error("Arrays are not supported."));else{var o=this._multiPartHeader(e,t,r),s=this._multiPartFooter();a(o),a(t),a(s),this._trackLength(o,t,r)}},f.prototype._trackLength=function(e,t,r){var n=0;null!=r.knownLength?n+=+r.knownLength:Buffer.isBuffer(t)?n=t.length:"string"==typeof t&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+f.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion"))&&(r.knownLength||this._valuesToMeasure.push(t))},f.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):u.stat(e.path,(function(r,n){var i;r?t(r):(i=n.size-(e.start?e.start:0),t(null,i))})):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(r){e.pause(),t(null,+r.headers["content-length"])})),e.resume()):t("Unknown stream")},f.prototype._multiPartHeader=function(e,t,r){if("string"==typeof r.header)return r.header;var n,i=this._getContentDisposition(t,r),a=this._getContentType(t,r),o="",s={"Content-Disposition":["form-data",'name="'+e+'"'].concat(i||[]),"Content-Type":[].concat(a||[])};for(var c in"object"==typeof r.header&&p(s,r.header),s)s.hasOwnProperty(c)&&null!=(n=s[c])&&(Array.isArray(n)||(n=[n]),n.length&&(o+=c+": "+n.join("; ")+f.LINE_BREAK));return"--"+this.getBoundary()+f.LINE_BREAK+o+f.LINE_BREAK},f.prototype._getContentDisposition=function(e,t){var r,n;return"string"==typeof t.filepath?r=a.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?r=a.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(r=a.basename(e.client._httpMessage.path)),r&&(n='filename="'+r+'"'),n},f.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e.name&&(r=l.lookup(e.name)),!r&&e.path&&(r=l.lookup(e.path)),!r&&e.readable&&e.hasOwnProperty("httpVersion")&&(r=e.headers["content-type"]),r||!t.filepath&&!t.filename||(r=l.lookup(t.filepath||t.filename)),r||"object"!=typeof e||(r=f.DEFAULT_CONTENT_TYPE),r},f.prototype._multiPartFooter=function(){return function(e){var t=f.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},f.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+f.LINE_BREAK},f.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(r[t.toLowerCase()]=e[t]);return r},f.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},f.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},f.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},f.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},f.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?h.parallel(this._valuesToMeasure,this._lengthRetriever,(function(r,n){r?e(r):(n.forEach((function(e){t+=e})),e(null,t))})):process.nextTick(e.bind(this,null,t))},f.prototype.submit=function(e,t){var r,n,i={method:"post"};return"string"==typeof e?(e=c(e),n=p({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=p(e,i)).port||(n.port="https:"==n.protocol?443:80),n.headers=this.getHeaders(e.headers),r="https:"==n.protocol?s.request(n):o.request(n),this.getLength(function(e,n){e?this._error(e):(r.setHeader("Content-Length",n),this.pipe(r),t&&(r.on("error",t),r.on("response",t.bind(this,null))))}.bind(this)),r},f.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},f.prototype.toString=function(){return"[object FormData]"}},function(e,t,r){var n=r(5).Stream,i=r(1);function a(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}e.exports=a,i.inherits(a,n),a.create=function(e,t){var r=new this;for(var n in t=t||{})r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",(function(){})),r.pauseStream&&e.pause(),r},Object.defineProperty(a.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),a.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},a.prototype.resume=function(){this._released||this.release(),this.source.resume()},a.prototype.pause=function(){this.source.pause()},a.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},a.prototype.pipe=function(){var e=n.prototype.pipe.apply(this,arguments);return this.resume(),e},a.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},a.prototype._checkIfMaxDataSizeExceeded=function(){if(!(this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}},function(e,t,r){e.exports={parallel:r(448),serial:r(450),serialOrdered:r(244)}},function(e,t,r){var n=r(239),i=r(242),a=r(243);e.exports=function(e,t,r){var o=i(e);for(;o.index<(o.keyedList||e).length;)n(e,t,o,(function(e,t){e?r(e,t):0!==Object.keys(o.jobs).length||r(null,o.results)})),o.index++;return a.bind(o,r)}},function(e,t){e.exports=function(e){var t="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;t?t(e):setTimeout(e,0)}},function(e,t,r){var n=r(244);e.exports=function(e,t,r){return n(e,t,null,r)}},function(e,t){e.exports=function(e,t){return Object.keys(t).forEach((function(r){e[r]=e[r]||t[r]})),e}},function(e,t){e.exports=i,i.strict=a,i.loose=o;var r=Object.prototype.toString,n={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function i(e){return a(e)||o(e)}function a(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[r.call(e)]}},function(e,t,r){"use strict";function n(e){return e.replace(/^\.*/,".").toLowerCase()}function i(e){var t=(e=e.trim().toLowerCase()).split(":",2);return{hostname:n(t[0]),port:t[1],hasPort:e.indexOf(":")>-1}}e.exports=function(e){var t=process.env.NO_PROXY||process.env.no_proxy||"";return"*"===t||""!==t&&function(e,t){var r=e.port||("https:"===e.protocol?"443":"80"),a=n(e.hostname);return t.split(",").map(i).some((function(e){var t=a.indexOf(e.hostname),n=t>-1&&t===a.length-e.hostname.length;return e.hasPort?r===e.port&&n:n}))}(e,t)?null:"http:"===e.protocol?process.env.HTTP_PROXY||process.env.http_proxy||null:"https:"===e.protocol&&(process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy)||null}},function(e,t,r){"use strict";var n=r(246),i=r(100);function a(e){this.request=e,this.lib=null,this.useQuerystring=null,this.parseOptions=null,this.stringifyOptions=null}a.prototype.init=function(e){this.lib||(this.useQuerystring=e.useQuerystring,this.lib=this.useQuerystring?i:n,this.parseOptions=e.qsParseOptions||{},this.stringifyOptions=e.qsStringifyOptions||{})},a.prototype.stringify=function(e){return this.useQuerystring?this.rfc3986(this.lib.stringify(e,this.stringifyOptions.sep||null,this.stringifyOptions.eq||null,this.stringifyOptions)):this.lib.stringify(e,this.stringifyOptions)},a.prototype.parse=function(e){return this.useQuerystring?this.lib.parse(e,this.parseOptions.sep||null,this.parseOptions.eq||null,this.parseOptions):this.lib.parse(e,this.parseOptions)},a.prototype.rfc3986=function(e){return e.replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))},a.prototype.unescape=i.unescape,t.Querystring=a},function(e,t,r){"use strict";var n=r(247),i=r(248),a={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},o=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,serializeDate:function(e){return o.call(e)},skipNulls:!1,strictNullHandling:!1},c=function e(t,r,i,a,o,c,u,l,h,p,f,d){var m=t;if("function"==typeof u)m=u(r,m);else if(m instanceof Date)m=p(m);else if(null===m){if(a)return c&&!d?c(r,s.encoder):r;m=""}if("string"==typeof m||"number"==typeof m||"boolean"==typeof m||n.isBuffer(m))return c?[f(d?r:c(r,s.encoder))+"="+f(c(m,s.encoder))]:[f(r)+"="+f(String(m))];var g,b=[];if(void 0===m)return b;if(Array.isArray(u))g=u;else{var y=Object.keys(m);g=l?y.sort(l):y}for(var v=0;v<g.length;++v){var w=g[v];o&&null===m[w]||(b=Array.isArray(m)?b.concat(e(m[w],i(r,w),i,a,o,c,u,l,h,p,f,d)):b.concat(e(m[w],r+(h?"."+w:"["+w+"]"),i,a,o,c,u,l,h,p,f,d)))}return b};e.exports=function(e,t){var r=e,o=t?n.assign({},t):{};if(null!==o.encoder&&void 0!==o.encoder&&"function"!=typeof o.encoder)throw new TypeError("Encoder has to be a function.");var u=void 0===o.delimiter?s.delimiter:o.delimiter,l="boolean"==typeof o.strictNullHandling?o.strictNullHandling:s.strictNullHandling,h="boolean"==typeof o.skipNulls?o.skipNulls:s.skipNulls,p="boolean"==typeof o.encode?o.encode:s.encode,f="function"==typeof o.encoder?o.encoder:s.encoder,d="function"==typeof o.sort?o.sort:null,m=void 0!==o.allowDots&&o.allowDots,g="function"==typeof o.serializeDate?o.serializeDate:s.serializeDate,b="boolean"==typeof o.encodeValuesOnly?o.encodeValuesOnly:s.encodeValuesOnly;if(void 0===o.format)o.format=i.default;else if(!Object.prototype.hasOwnProperty.call(i.formatters,o.format))throw new TypeError("Unknown format option provided.");var y,v,w=i.formatters[o.format];"function"==typeof o.filter?r=(v=o.filter)("",r):Array.isArray(o.filter)&&(y=v=o.filter);var _,k=[];if("object"!=typeof r||null===r)return"";_=o.arrayFormat in a?o.arrayFormat:"indices"in o?o.indices?"indices":"repeat":"indices";var x=a[_];y||(y=Object.keys(r)),d&&y.sort(d);for(var E=0;E<y.length;++E){var A=y[E];h&&null===r[A]||(k=k.concat(c(r[A],A,x,l,h,p?f:null,v,d,m,g,w,b)))}var S=k.join(u),j=!0===o.addQueryPrefix?"?":"";return S.length>0?j+S:""}},function(e,t,r){"use strict";var n=r(247),i=Object.prototype.hasOwnProperty,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:n.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},o=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,o=/(\[[^[\]]*])/.exec(n),s=o?n.slice(0,o.index):n,c=[];if(s){if(!r.plainObjects&&i.call(Object.prototype,s)&&!r.allowPrototypes)return;c.push(s)}for(var u=0;null!==(o=a.exec(n))&&u<r.depth;){if(u+=1,!r.plainObjects&&i.call(Object.prototype,o[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(o[1])}return o&&c.push("["+n.slice(o.index)+"]"),function(e,t,r){for(var n=t,i=e.length-1;i>=0;--i){var a,o=e[i];if("[]"===o)a=(a=[]).concat(n);else{a=r.plainObjects?Object.create(null):{};var s="["===o.charAt(0)&&"]"===o.charAt(o.length-1)?o.slice(1,-1):o,c=parseInt(s,10);!isNaN(c)&&o!==s&&String(c)===s&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(a=[])[c]=n:a[s]=n}n=a}return n}(c,t,r)}};e.exports=function(e,t){var r=t?n.assign({},t):{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.ignoreQueryPrefix=!0===r.ignoreQueryPrefix,r.delimiter="string"==typeof r.delimiter||n.isRegExp(r.delimiter)?r.delimiter:a.delimiter,r.depth="number"==typeof r.depth?r.depth:a.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:a.arrayLimit,r.parseArrays=!1!==r.parseArrays,r.decoder="function"==typeof r.decoder?r.decoder:a.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:a.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:a.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:a.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:a.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:a.strictNullHandling,""===e||null==e)return r.plainObjects?Object.create(null):{};for(var s="string"==typeof e?function(e,t){for(var r={},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,s=n.split(t.delimiter,o),c=0;c<s.length;++c){var u,l,h=s[c],p=h.indexOf("]="),f=-1===p?h.indexOf("="):p+1;-1===f?(u=t.decoder(h,a.decoder),l=t.strictNullHandling?null:""):(u=t.decoder(h.slice(0,f),a.decoder),l=t.decoder(h.slice(f+1),a.decoder)),i.call(r,u)?r[u]=[].concat(r[u]).concat(l):r[u]=l}return r}(e,r):e,c=r.plainObjects?Object.create(null):{},u=Object.keys(s),l=0;l<u.length;++l){var h=u[l],p=o(h,s[h],r);c=n.merge(c,p,r)}return n.compact(c)}},function(e,t,r){"use strict";var n=r(3),i=r(100),a=r(458),o=r(97);function s(e){this.request=e}s.prototype.reducer=function(e,t){if(void 0===e[t.name])return e[t.name]=t.value,e;var r=[e[t.name],t.value];return e[t.name]=r,e},s.prototype.prep=function(e){if(e.queryObj={},e.headersObj={},e.postData.jsonObj=!1,e.postData.paramsObj=!1,e.queryString&&e.queryString.length&&(e.queryObj=e.queryString.reduce(this.reducer,{})),e.headers&&e.headers.length&&(e.headersObj=e.headers.reduceRight((function(e,t){return e[t.name]=t.value,e}),{})),e.cookies&&e.cookies.length){var t=e.cookies.map((function(e){return e.name+"="+e.value}));t.length&&(e.headersObj.cookie=t.join("; "))}function r(t){return t.some((function(t){return 0===e.postData.mimeType.indexOf(t)}))}if(r(["multipart/mixed","multipart/related","multipart/form-data","multipart/alternative"]))e.postData.mimeType="multipart/form-data";else if(r(["application/x-www-form-urlencoded"]))e.postData.params?(e.postData.paramsObj=e.postData.params.reduce(this.reducer,{}),e.postData.text=i.stringify(e.postData.paramsObj)):e.postData.text="";else if(r(["text/json","text/x-json","application/json","application/x-json"])&&(e.postData.mimeType="application/json",e.postData.text))try{e.postData.jsonObj=JSON.parse(e.postData.text)}catch(t){this.request.debug(t),e.postData.mimeType="text/plain"}return e},s.prototype.options=function(e){if(!e.har)return e;var t={};if(o(t,e.har),t.log&&t.log.entries&&(t=t.log.entries[0]),t.url=t.url||e.url||e.uri||e.baseUrl||"/",t.httpVersion=t.httpVersion||"HTTP/1.1",t.queryString=t.queryString||[],t.headers=t.headers||[],t.cookies=t.cookies||[],t.postData=t.postData||{},t.postData.mimeType=t.postData.mimeType||"application/octet-stream",t.bodySize=0,t.headersSize=0,t.postData.size=0,!a.request(t))return e;var r=this.prep(t);function i(e){return 0===r.postData.mimeType.indexOf(e)}return r.url&&(e.url=r.url),r.method&&(e.method=r.method),Object.keys(r.queryObj).length&&(e.qs=r.queryObj),Object.keys(r.headersObj).length&&(e.headers=r.headersObj),i("application/x-www-form-urlencoded")?e.form=r.postData.paramsObj:i("application/json")?r.postData.jsonObj&&(e.body=r.postData.jsonObj,e.json=!0):i("multipart/form-data")?(e.formData={},r.postData.params.forEach((function(t){var r={};t.fileName||t.contentType?(t.fileName&&!t.value?r.value=n.createReadStream(t.fileName):t.value&&(r.value=t.value),t.fileName&&(r.options={filename:t.fileName,contentType:t.contentType?t.contentType:null}),e.formData[t.name]=r):e.formData[t.name]=t.value}))):r.postData.text&&(e.body=r.postData.text),e},t.Har=s},function(e,t,r){var n,i=r(459),a=r(493),o=r(494);function s(e,t){t=t||{};var s=(n=n||function(){var e=new i({allErrors:!0});return e.addMetaSchema(r(513)),e.addSchema(o),e}()).getSchema(e+".json");return new Promise((function(e,r){s(t)?e(t):r(new a(s.errors))}))}t.afterRequest=function(e){return s("afterRequest",e)},t.beforeRequest=function(e){return s("beforeRequest",e)},t.browser=function(e){return s("browser",e)},t.cache=function(e){return s("cache",e)},t.content=function(e){return s("content",e)},t.cookie=function(e){return s("cookie",e)},t.creator=function(e){return s("creator",e)},t.entry=function(e){return s("entry",e)},t.har=function(e){return s("har",e)},t.header=function(e){return s("header",e)},t.log=function(e){return s("log",e)},t.page=function(e){return s("page",e)},t.pageTimings=function(e){return s("pageTimings",e)},t.postData=function(e){return s("postData",e)},t.query=function(e){return s("query",e)},t.request=function(e){return s("request",e)},t.response=function(e){return s("response",e)},t.timings=function(e){return s("timings",e)}},function(e,t,r){"use strict";var n=r(460),i=r(109),a=r(464),o=r(249),s=r(250),c=r(465),u=r(466),l=r(487),h=r(49);e.exports=b,b.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var n=this._addSchema(e);r=n.validate||this._compile(n)}var i=r(t);!0!==r.$async&&(this.errors=r.errors);return i},b.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},b.prototype.addSchema=function(e,t,r,n){if(Array.isArray(e)){for(var a=0;a<e.length;a++)this.addSchema(e[a],void 0,r,n);return this}var o=this._getId(e);if(void 0!==o&&"string"!=typeof o)throw new Error("schema id must be string");return x(this,t=i.normalizeId(t||o)),this._schemas[t]=this._addSchema(e,r,n,!0),this},b.prototype.addMetaSchema=function(e,t,r){return this.addSchema(e,t,r,!0),this},b.prototype.validateSchema=function(e,t){var r=e.$schema;if(void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(!(r=r||this._opts.defaultMeta||function(e){var t=e._opts.meta;return e._opts.defaultMeta="object"==typeof t?e._getId(t)||t:e.getSchema(d)?d:void 0,e._opts.defaultMeta}(this)))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var n=this.validate(r,e);if(!n&&t){var i="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(i);this.logger.error(i)}return n},b.prototype.getSchema=function(e){var t=y(this,e);switch(typeof t){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return function(e,t){var r=i.schema.call(e,{schema:{}},t);if(r){var a=r.schema,s=r.root,c=r.baseId,u=n.call(e,a,s,void 0,c);return e._fragments[t]=new o({ref:t,fragment:!0,schema:a,root:s,baseId:c,validate:u}),u}}(this,e)}},b.prototype.removeSchema=function(e){if(e instanceof RegExp)return v(this,this._schemas,e),v(this,this._refs,e),this;switch(typeof e){case"undefined":return v(this,this._schemas),v(this,this._refs),this._cache.clear(),this;case"string":var t=y(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var r=this._opts.serialize,n=r?r(e):e;this._cache.del(n);var a=this._getId(e);a&&(a=i.normalizeId(a),delete this._schemas[a],delete this._refs[a])}return this},b.prototype.addFormat=function(e,t){"string"==typeof t&&(t=new RegExp(t));return this._formats[e]=t,this},b.prototype.errorsText=function(e,t){if(!(e=e||this.errors))return"No errors";for(var r=void 0===(t=t||{}).separator?", ":t.separator,n=void 0===t.dataVar?"data":t.dataVar,i="",a=0;a<e.length;a++){var o=e[a];o&&(i+=n+o.dataPath+" "+o.message+r)}return i.slice(0,-r.length)},b.prototype._addSchema=function(e,t,r,n){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var a=this._opts.serialize,s=a?a(e):e,c=this._cache.get(s);if(c)return c;n=n||!1!==this._opts.addUsedSchema;var u=i.normalizeId(this._getId(e));u&&n&&x(this,u);var l,h=!1!==this._opts.validateSchema&&!t;h&&!(l=u&&u==i.normalizeId(e.$schema))&&this.validateSchema(e,!0);var p=i.ids.call(this,e),f=new o({id:u,schema:e,localRefs:p,cacheKey:s,meta:r});"#"!=u[0]&&n&&(this._refs[u]=f);this._cache.put(s,f),h&&l&&this.validateSchema(e,!0);return f},b.prototype._compile=function(e,t){if(e.compiling)return e.validate=a,a.schema=e.schema,a.errors=null,a.root=t||a,!0===e.schema.$async&&(a.$async=!0),a;var r,i;e.compiling=!0,e.meta&&(r=this._opts,this._opts=this._metaOpts);try{i=n.call(this,e.schema,t,e.localRefs)}catch(t){throw delete e.validate,t}finally{e.compiling=!1,e.meta&&(this._opts=r)}return e.validate=i,e.refs=i.refs,e.refVal=i.refVal,e.root=i.root,i;function a(){var t=e.validate,r=t.apply(this,arguments);return a.errors=t.errors,r}},b.prototype.compileAsync=r(488);var p=r(489);b.prototype.addKeyword=p.add,b.prototype.getKeyword=p.get,b.prototype.removeKeyword=p.remove,b.prototype.validateKeyword=p.validate;var f=r(111);b.ValidationError=f.Validation,b.MissingRefError=f.MissingRef,b.$dataMetaSchema=l;var d="http://json-schema.org/draft-07/schema",m=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],g=["/properties"];function b(e){if(!(this instanceof b))return new b(e);e=this._opts=h.copy(e)||{},function(e){var t=e._opts.logger;if(!1===t)e.logger={log:E,warn:E,error:E};else{if(void 0===t&&(t=console),!("object"==typeof t&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");e.logger=t}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=c(e.format),this._cache=e.cache||new a,this._loadingSchemas={},this._compilations=[],this.RULES=u(),this._getId=function(e){switch(e.schemaId){case"auto":return k;case"id":return w;default:return _}}(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=s),this._metaOpts=function(e){for(var t=h.copy(e._opts),r=0;r<m.length;r++)delete t[m[r]];return t}(this),e.formats&&function(e){for(var t in e._opts.formats){var r=e._opts.formats[t];e.addFormat(t,r)}}(this),e.keywords&&function(e){for(var t in e._opts.keywords){var r=e._opts.keywords[t];e.addKeyword(t,r)}}(this),function(e){var t;e._opts.$data&&(t=r(492),e.addMetaSchema(t,t.$id,!0));if(!1===e._opts.meta)return;var n=r(256);e._opts.$data&&(n=l(n,g));e.addMetaSchema(n,d,!0),e._refs["http://json-schema.org/schema"]=d}(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),function(e){var t=e._opts.schemas;if(!t)return;if(Array.isArray(t))e.addSchema(t);else for(var r in t)e.addSchema(t[r],r)}(this)}function y(e,t){return t=i.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function v(e,t,r){for(var n in t){var i=t[n];i.meta||r&&!r.test(n)||(e._cache.del(i.cacheKey),delete t[n])}}function w(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function _(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function k(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function x(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function E(){}},function(e,t,r){"use strict";var n=r(109),i=r(49),a=r(111),o=r(250),s=r(251),c=i.ucs2length,u=r(110),l=a.Validation;function h(e,t,r){var n=f.call(this,e,t,r);return n>=0?{index:n,compiling:!0}:(n=this._compilations.length,this._compilations[n]={schema:e,root:t,baseId:r},{index:n,compiling:!1})}function p(e,t,r){var n=f.call(this,e,t,r);n>=0&&this._compilations.splice(n,1)}function f(e,t,r){for(var n=0;n<this._compilations.length;n++){var i=this._compilations[n];if(i.schema==e&&i.root==t&&i.baseId==r)return n}return-1}function d(e,t){return"var pattern"+e+" = new RegExp("+i.toQuotedString(t[e])+");"}function m(e){return"var default"+e+" = defaults["+e+"];"}function g(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function b(e){return"var customRule"+e+" = customRules["+e+"];"}function y(e,t){if(!e.length)return"";for(var r="",n=0;n<e.length;n++)r+=t(n,e);return r}e.exports=function e(t,r,f,v){var w=this,_=this._opts,k=[void 0],x={},E=[],A={},S=[],j={},T=[];r=r||{schema:t,refVal:k,refs:x};var C=h.call(this,t,r,v),B=this._compilations[C.index];if(C.compiling)return B.callValidate=function e(){var t=B.validate,r=t.apply(this,arguments);return e.errors=t.errors,r};var O=this._formats,R=this.RULES;try{var I=D(t,r,f,v);B.validate=I;var P=B.callValidate;return P&&(P.schema=I.schema,P.errors=null,P.refs=I.refs,P.refVal=I.refVal,P.root=I.root,P.$async=I.$async,_.sourceCode&&(P.source=I.source)),I}finally{p.call(this,t,r,v)}function D(t,o,h,p){var f=!o||o&&o.schema==t;if(o.schema!=r.schema)return e.call(w,t,o,h,p);var v,A=!0===t.$async,j=s({isTop:!0,schema:t,isRoot:f,baseId:p,root:o,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:a.MissingRef,RULES:R,validate:s,util:i,resolve:n,resolveRef:M,usePattern:N,useDefault:z,useCustomRule:U,opts:_,formats:O,logger:w.logger,self:w});j=y(k,g)+y(E,d)+y(S,m)+y(T,b)+j,_.processCode&&(j=_.processCode(j,t));try{v=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",j)(w,R,O,r,k,S,T,u,c,l),k[0]=v}catch(e){throw w.logger.error("Error compiling schema, function code:",j),e}return v.schema=t,v.errors=null,v.refs=x,v.refVal=k,v.root=f?v:o,A&&(v.$async=!0),!0===_.sourceCode&&(v.source={code:j,patterns:E,defaults:S}),v}function M(t,i,a){i=n.url(t,i);var o,s,c=x[i];if(void 0!==c)return L(o=k[c],s="refVal["+c+"]");if(!a&&r.refs){var u=r.refs[i];if(void 0!==u)return L(o=r.refVal[u],s=F(i,o))}s=F(i);var l=n.call(w,D,r,i);if(void 0===l){var h=f&&f[i];h&&(l=n.inlineRef(h,_.inlineRefs)?h:e.call(w,h,r,f,t))}if(void 0!==l)return function(e,t){var r=x[e];k[r]=t}(i,l),L(l,s);!function(e){delete x[e]}(i)}function F(e,t){var r=k.length;return k[r]=t,x[e]=r,"refVal"+r}function L(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function N(e){var t=A[e];return void 0===t&&(t=A[e]=E.length,E[t]=e),"pattern"+t}function z(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return i.toQuotedString(e);case"object":if(null===e)return"null";var t=o(e),r=j[t];return void 0===r&&(r=j[t]=S.length,S[r]=e),"default"+r}}function U(e,t,r,n){if(!1!==w._opts.validateSchema){var i=e.definition.dependencies;if(i&&!i.every((function(e){return Object.prototype.hasOwnProperty.call(r,e)})))throw new Error("parent schema must have all required keywords: "+i.join(","));var a=e.definition.validateSchema;if(a)if(!a(t)){var o="keyword schema is invalid: "+w.errorsText(a.errors);if("log"!=w._opts.validateSchema)throw new Error(o);w.logger.error(o)}}var s,c=e.definition.compile,u=e.definition.inline,l=e.definition.macro;if(c)s=c.call(w,t,r,n);else if(l)s=l.call(w,t,r,n),!1!==_.validateSchema&&w.validateSchema(s,!0);else if(u)s=u.call(w,n,e.keyword,t,r);else if(!(s=e.definition.validate))return;if(void 0===s)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var h=T.length;return T[h]=s,{code:"customRule"+h,validate:s}}}},function(e,t,r){
291
291
  /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
292
- !function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i<n;++i)t[i]=t[i].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function i(e){return e.toUpperCase()}function a(e){var n=t("[0-9]","[A-Fa-f]"),i=r(r("%[EFef]"+n+"%"+n+n+"%"+n+n)+"|"+r("%[89A-Fa-f]"+n+"%"+n+n)+"|"+r("%"+n+n)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",o=t("[\\:\\/\\?\\#\\[\\]\\@]",a),s=e?"[\\uE000-\\uF8FF]":"[]",c=t("[A-Za-z]","[0-9]","[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),u=r("[A-Za-z]"+t("[A-Za-z]","[0-9]","[\\+\\-\\.]")+"*"),l=r(r(i+"|"+t(c,a,"[\\:]"))+"*"),h=(r(r("25[0-5]")+"|"+r("2[0-4][0-9]")+"|"+r("1[0-9][0-9]")+"|"+r("[1-9][0-9]")+"|[0-9]"),r(r("25[0-5]")+"|"+r("2[0-4][0-9]")+"|"+r("1[0-9][0-9]")+"|"+r("0?[1-9][0-9]")+"|0?0?[0-9]")),p=r(h+"\\."+h+"\\."+h+"\\."+h),f=r(n+"{1,4}"),d=r(r(f+"\\:"+f)+"|"+p),m=r(r(f+"\\:")+"{6}"+d),g=r("\\:\\:"+r(f+"\\:")+"{5}"+d),b=r(r(f)+"?\\:\\:"+r(f+"\\:")+"{4}"+d),y=r(r(r(f+"\\:")+"{0,1}"+f)+"?\\:\\:"+r(f+"\\:")+"{3}"+d),v=r(r(r(f+"\\:")+"{0,2}"+f)+"?\\:\\:"+r(f+"\\:")+"{2}"+d),w=r(r(r(f+"\\:")+"{0,3}"+f)+"?\\:\\:"+f+"\\:"+d),_=r(r(r(f+"\\:")+"{0,4}"+f)+"?\\:\\:"+d),k=r(r(r(f+"\\:")+"{0,5}"+f)+"?\\:\\:"+f),x=r(r(r(f+"\\:")+"{0,6}"+f)+"?\\:\\:"),E=r([m,g,b,y,v,w,_,k,x].join("|")),A=r(r(c+"|"+i)+"+"),S=(r(E+"\\%25"+A),r(E+r("\\%25|\\%(?!"+n+"{2})")+A)),j=r("[vV]"+n+"+\\."+t(c,a,"[\\:]")+"+"),T=r("\\["+r(S+"|"+E+"|"+j)+"\\]"),C=r(r(i+"|"+t(c,a))+"*"),B=r(T+"|"+p+"(?!"+C+")|"+C),O=r("[0-9]*"),R=r(r(l+"@")+"?"+B+r("\\:"+O)+"?"),I=r(i+"|"+t(c,a,"[\\:\\@]")),P=r(I+"*"),D=r(I+"+"),M=r(r(i+"|"+t(c,a,"[\\@]"))+"+"),F=r(r("\\/"+P)+"*"),L=r("\\/"+r(D+F)+"?"),N=r(M+F),z=r(D+F),U="(?!"+I+")",q=(r(F+"|"+L+"|"+N+"|"+z+"|"+U),r(r(I+"|"+t("[\\/\\?]",s))+"*")),H=r(r(I+"|[\\/\\?]")+"*"),G=r(r("\\/\\/"+R+F)+"|"+L+"|"+z+"|"+U),V=r(u+"\\:"+G+r("\\?"+q)+"?"+r("\\#"+H)+"?"),W=r(r("\\/\\/"+R+F)+"|"+L+"|"+N+"|"+U),K=r(W+r("\\?"+q)+"?"+r("\\#"+H)+"?");return r(V+"|"+K),r(u+"\\:"+G+r("\\?"+q)+"?"),r(r("\\/\\/("+r("("+l+")@")+"?("+B+")"+r("\\:("+O+")")+"?)")+"?("+F+"|"+L+"|"+z+"|"+U+")"),r("\\?("+q+")"),r("\\#("+H+")"),r(r("\\/\\/("+r("("+l+")@")+"?("+B+")"+r("\\:("+O+")")+"?)")+"?("+F+"|"+L+"|"+N+"|"+U+")"),r("\\?("+q+")"),r("\\#("+H+")"),r(r("\\/\\/("+r("("+l+")@")+"?("+B+")"+r("\\:("+O+")")+"?)")+"?("+F+"|"+L+"|"+z+"|"+U+")"),r("\\?("+q+")"),r("\\#("+H+")"),r("("+l+")@"),r("\\:("+O+")"),{NOT_SCHEME:new RegExp(t("[^]","[A-Za-z]","[0-9]","[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",c,a),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",c,a),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",c,a),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",c,a),"g"),NOT_QUERY:new RegExp(t("[^\\%]",c,a,"[\\:\\@\\/\\?]",s),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",c,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",c,a),"g"),UNRESERVED:new RegExp(c,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",c,o),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+p+")$"),IPV6ADDRESS:new RegExp("^\\[?("+E+")"+r(r("\\%25|\\%(?!"+n+"{2})")+"("+A+")")+"?\\]?$")}}var o=a(!1),s=a(!0),c=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=2147483647,l=/^xn--/,h=/[^\0-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,m=String.fromCharCode;function g(e){throw new RangeError(f[e])}function b(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);var i=function(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}((e=e.replace(p,".")).split("."),t).join(".");return n+i}function y(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var a=e.charCodeAt(r++);56320==(64512&a)?t.push(((1023&i)<<10)+(1023&a)+65536):(t.push(i),r--)}else t.push(i)}return t}var v=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},w=function(e,t,r){var n=0;for(e=r?d(e/700):e>>1,e+=d(e/t);e>455;n+=36)e=d(e/35);return d(n+36*e/(e+38))},_=function(e){var t,r=[],n=e.length,i=0,a=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var c=0;c<s;++c)e.charCodeAt(c)>=128&&g("not-basic"),r.push(e.charCodeAt(c));for(var l=s>0?s+1:0;l<n;){for(var h=i,p=1,f=36;;f+=36){l>=n&&g("invalid-input");var m=(t=e.charCodeAt(l++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(m>=36||m>d((u-i)/p))&&g("overflow"),i+=m*p;var b=f<=o?1:f>=o+26?26:f-o;if(m<b)break;var y=36-b;p>d(u/y)&&g("overflow"),p*=y}var v=r.length+1;o=w(i-h,v,0==h),d(i/v)>u-a&&g("overflow"),a+=d(i/v),i%=v,r.splice(i++,0,a)}return String.fromCodePoint.apply(String,r)},k=function(e){var t=[],r=(e=y(e)).length,n=128,i=0,a=72,o=!0,s=!1,c=void 0;try{for(var l,h=e[Symbol.iterator]();!(o=(l=h.next()).done);o=!0){var p=l.value;p<128&&t.push(m(p))}}catch(e){s=!0,c=e}finally{try{!o&&h.return&&h.return()}finally{if(s)throw c}}var f=t.length,b=f;for(f&&t.push("-");b<r;){var _=u,k=!0,x=!1,E=void 0;try{for(var A,S=e[Symbol.iterator]();!(k=(A=S.next()).done);k=!0){var j=A.value;j>=n&&j<_&&(_=j)}}catch(e){x=!0,E=e}finally{try{!k&&S.return&&S.return()}finally{if(x)throw E}}var T=b+1;_-n>d((u-i)/T)&&g("overflow"),i+=(_-n)*T,n=_;var C=!0,B=!1,O=void 0;try{for(var R,I=e[Symbol.iterator]();!(C=(R=I.next()).done);C=!0){var P=R.value;if(P<n&&++i>u&&g("overflow"),P==n){for(var D=i,M=36;;M+=36){var F=M<=a?1:M>=a+26?26:M-a;if(D<F)break;var L=D-F,N=36-F;t.push(m(v(F+L%N,0))),D=d(L/N)}t.push(m(v(D,0))),a=w(i,T,b==f),i=0,++b}}}catch(e){B=!0,O=e}finally{try{!C&&I.return&&I.return()}finally{if(B)throw O}}++i,++n}return t.join("")},x=function(e){return b(e,(function(e){return h.test(e)?"xn--"+k(e):e}))},E=function(e){return b(e,(function(e){return l.test(e)?_(e.slice(4).toLowerCase()):e}))},A={};function S(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function j(e){for(var t="",r=0,n=e.length;r<n;){var i=parseInt(e.substr(r+1,2),16);if(i<128)t+=String.fromCharCode(i),r+=3;else if(i>=194&&i<224){if(n-r>=6){var a=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&a)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var o=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function T(e,t){function r(e){var r=j(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,S).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,S).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,S).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,S).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,S).replace(t.PCT_ENCODED,i)),e}function C(e){return e.replace(/^0*(.*)/,"$1")||"0"}function B(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=c(r,2)[1];return n?n.split(".").map(C).join("."):e}function O(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=c(r,3),i=n[1],a=n[2];if(i){for(var o=i.toLowerCase().split("::").reverse(),s=c(o,2),u=s[0],l=s[1],h=l?l.split(":").map(C):[],p=u.split(":").map(C),f=t.IPV4ADDRESS.test(p[p.length-1]),d=f?7:8,m=p.length-d,g=Array(d),b=0;b<d;++b)g[b]=h[b]||p[m+b]||"";f&&(g[d-1]=B(g[d-1],t));var y=g.reduce((function(e,t,r){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===r?n.length++:e.push({index:r,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],v=void 0;if(y&&y.length>1){var w=g.slice(0,y.index),_=g.slice(y.index+y.length);v=w.join(":")+"::"+_.join(":")}else v=g.join(":");return a&&(v+="%"+a),v}return e}var R=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,I=void 0==="".match(/(){0}/)[1];function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?s:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(R);if(i){I?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=O(B(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var a=A[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||a&&a.unicodeSupport)T(r,n);else{if(r.host&&(t.domainHost||a&&a.domainHost))try{r.host=x(r.host.replace(n.PCT_ENCODED,j).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}T(r,o)}a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function D(e,t){var r=!1!==t.iri?s:o,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(O(B(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var M=/^\.\.?\//,F=/^\/\.(\/|$)/,L=/^\/\.\.(\/|$)/,N=/^\/?(?:.|\n)*?(?=\/|$)/;function z(e){for(var t=[];e.length;)if(e.match(M))e=e.replace(M,"");else if(e.match(F))e=e.replace(F,"/");else if(e.match(L))e=e.replace(L,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(N);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function U(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:o,n=[],i=A[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?E(e.host):x(e.host.replace(r.PCT_ENCODED,j).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}T(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=D(e,t);if(void 0!==a&&("suffix"!==t.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||i&&i.absolutePath||(c=z(c)),void 0===a&&(c=c.replace(/^\/\//,"/%2F")),n.push(c)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function q(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],i={};return n||(e=P(U(e,r),r),t=P(U(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=z(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=z(t.path||""),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=z(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=z(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function H(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:o.PCT_ENCODED,j)}var G={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},V={scheme:"https",domainHost:G.domainHost,parse:G.parse,serialize:G.serialize};function W(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var K={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=W(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(W(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),n=c(r,2),i=n[0],a=n[1];e.path=i&&"/"!==i?i:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},J={scheme:"wss",domainHost:K.domainHost,parse:K.parse,serialize:K.serialize},Q={},Y="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",X="[0-9A-Fa-f]",Z=r(r("%[EFef]"+X+"%"+X+X+"%"+X+X)+"|"+r("%[89A-Fa-f]"+X+"%"+X+X)+"|"+r("%"+X+X)),$=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),ee=new RegExp(Y,"g"),te=new RegExp(Z,"g"),re=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',$),"g"),ne=new RegExp(t("[^]",Y,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ie=ne;function ae(e){var t=j(e);return t.match(ee)?t:e}var oe={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,a={},o=r.query.split("&"),s=0,c=o.length;s<c;++s){var u=o[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),h=0,p=l.length;h<p;++h)n.push(l[h]);break;case"subject":r.subject=H(u[1],t);break;case"body":r.body=H(u[1],t);break;default:i=!0,a[H(u[0],t)]=H(u[1],t)}}i&&(r.headers=a)}r.query=void 0;for(var f=0,d=n.length;f<d;++f){var m=n[f].split("@");if(m[0]=H(m[0]),t.unicodeSupport)m[1]=H(m[1],t).toLowerCase();else try{m[1]=x(H(m[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[f]=m.join("@")}return r},serialize:function(e,t){var r,n=e,a=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(a){for(var o=0,s=a.length;o<s;++o){var c=String(a[o]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(te,ae).replace(te,i).replace(re,S),h=c.slice(u+1);try{h=t.iri?E(h):x(H(h,t).toLowerCase())}catch(e){n.error=n.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}a[o]=l+"@"+h}n.path=a.join(",")}var p=e.headers=e.headers||{};e.subject&&(p.subject=e.subject),e.body&&(p.body=e.body);var f=[];for(var d in p)p[d]!==Q[d]&&f.push(d.replace(te,ae).replace(te,i).replace(ne,S)+"="+p[d].replace(te,ae).replace(te,i).replace(ie,S));return f.length&&(n.query=f.join("&")),n}},se=/^([^\:]+)\:(.*)/,ce={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(se),n=e;if(r){var i=t.scheme||n.scheme||"urn",a=r[1].toLowerCase(),o=r[2],s=i+":"+(t.nid||a),c=A[s];n.nid=a,n.nss=o,n.path=void 0,c&&(n=c.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,i=r+":"+(t.nid||n),a=A[i];a&&(e=a.serialize(e,t));var o=e,s=e.nss;return o.path=(n||t.nid)+":"+s,o}},ue=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,le={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ue)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};A[G.scheme]=G,A[V.scheme]=V,A[K.scheme]=K,A[J.scheme]=J,A[oe.scheme]=oe,A[ce.scheme]=ce,A[le.scheme]=le,e.SCHEMES=A,e.pctEncChar=S,e.pctDecChars=j,e.parse=P,e.removeDotSegments=z,e.serialize=U,e.resolveComponents=q,e.resolve=function(e,t,r){var n=function(e,t){var r=e;if(t)for(var n in t)r[n]=t[n];return r}({scheme:"null"},r);return U(q(P(e,n),P(t,n),n,!0),n)},e.normalize=function(e,t){return"string"==typeof e?e=U(P(e,t),t):"object"===n(e)&&(e=P(U(e,t),t)),e},e.equal=function(e,t,r){return"string"==typeof e?e=U(P(e,r),r):"object"===n(e)&&(e=U(e,r)),"string"==typeof t?t=U(P(t,r),r):"object"===n(t)&&(t=U(t,r)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?s.ESCAPE:o.ESCAPE,S)},e.unescapeComponent=H,Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,r){"use strict";e.exports=function(e){for(var t,r=0,n=e.length,i=0;i<n;)r++,(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<n&&56320==(64512&(t=e.charCodeAt(i)))&&i++;return r}},function(e,t,r){"use strict";var n=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),function e(t,r,i,a,o,s,c,u,l,h){if(a&&"object"==typeof a&&!Array.isArray(a)){for(var p in r(a,o,s,c,u,l,h),a){var f=a[p];if(Array.isArray(f)){if(p in n.arrayKeywords)for(var d=0;d<f.length;d++)e(t,r,i,f[d],o+"/"+p+"/"+d,s,o,p,a,d)}else if(p in n.propsKeywords){if(f&&"object"==typeof f)for(var m in f)e(t,r,i,f[m],o+"/"+p+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),s,o,p,a,m)}else(p in n.keywords||t.allKeys&&!(p in n.skipKeywords))&&e(t,r,i,f,o+"/"+p,s,o,p,a)}i(a,o,s,c,u,l,h)}}(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},function(e,t,r){"use strict";var n=e.exports=function(){this._cache={}};n.prototype.put=function(e,t){this._cache[e]=t},n.prototype.get=function(e){return this._cache[e]},n.prototype.del=function(e){delete this._cache[e]},n.prototype.clear=function(){this._cache={}}},function(e,t,r){"use strict";var n=r(49),i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,a=[0,31,28,31,30,31,30,31,31,30,31,30,31],o=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,s=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,c=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,u=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,l=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,p=/^(?:\/(?:[^~/]|~0|~1)*)*$/,f=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",n.copy(m[e])}function g(e){var t=e.match(i);if(!t)return!1;var r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(2==n&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:a[n])}function b(e,t){var r=e.match(o);if(!r)return!1;var n=r[1],i=r[2],a=r[3],s=r[5];return(n<=23&&i<=59&&a<=59||23==n&&59==i&&60==a)&&(!t||s)}e.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:l,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:_,uuid:h,"json-pointer":p,"json-pointer-uri-fragment":f,"relative-json-pointer":d},m.full={date:g,time:b,"date-time":function(e){var t=e.split(y);return 2==t.length&&g(t[0])&&b(t[1],!0)},uri:function(e){return v.test(e)&&c.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:l,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:_,uuid:h,"json-pointer":p,"json-pointer-uri-fragment":f,"relative-json-pointer":d};var y=/t|\s/i;var v=/\/|:/;var w=/[^\\]\\Z/;function _(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},function(e,t,r){"use strict";var n=r(467),i=r(49).toHash;e.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=i(t),e.types=i(["number","integer","string","array","object","boolean","null"]),e.forEach((function(r){r.rules=r.rules.map((function(r){var i;if("object"==typeof r){var a=Object.keys(r)[0];i=r[a],r=a,i.forEach((function(r){t.push(r),e.all[r]=!0}))}return t.push(r),e.all[r]={keyword:r,code:n[r],implements:i}})),e.all.$comment={keyword:"$comment",code:n.$comment},r.type&&(e.types[r.type]=r)})),e.keywords=i(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},function(e,t,r){"use strict";e.exports={$ref:r(468),allOf:r(469),anyOf:r(470),$comment:r(471),const:r(472),contains:r(473),dependencies:r(474),enum:r(475),format:r(476),if:r(477),items:r(478),maximum:r(252),minimum:r(252),maxItems:r(253),minItems:r(253),maxLength:r(254),minLength:r(254),maxProperties:r(255),minProperties:r(255),multipleOf:r(479),not:r(480),oneOf:r(481),pattern:r(482),properties:r(483),propertyNames:r(484),required:r(485),uniqueItems:r(486),validate:r(251)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n,i,a=" ",o=e.level,s=e.dataLevel,c=e.schema[t],u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,h="data"+(s||""),p="valid"+o;if("#"==c||"#/"==c)e.isRoot?(n=e.async,i="validate"):(n=!0===e.root.schema.$async,i="root.refVal[0]");else{var f=e.resolveRef(e.baseId,c,e.isRoot);if(void 0===f){var d=e.MissingRefError.message(e.baseId,c);if("fail"==e.opts.missingRefs){e.logger.error(d),(y=y||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(c)+"' } ",!1!==e.opts.messages&&(a+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(c)+"' "),e.opts.verbose&&(a+=" , schema: "+e.util.toQuotedString(c)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var m=a;a=y.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(a+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,c,d);e.logger.warn(d),l&&(a+=" if (true) { ")}}else if(f.inline){var g=e.util.copy(e);g.level++;var b="valid"+g.level;g.schema=f.schema,g.schemaPath="",g.errSchemaPath=c,a+=" "+e.validate(g).replace(/validate\.schema/g,f.code)+" ",l&&(a+=" if ("+b+") { ")}else n=!0===f.$async||e.async&&!1!==f.$async,i=f.code}if(i){var y;(y=y||[]).push(a),a="",e.opts.passContext?a+=" "+i+".call(this, ":a+=" "+i+"( ",a+=" "+h+", (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var v=a+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData) ";if(a=y.pop(),n){if(!e.async)throw new Error("async schema referenced by sync schema");l&&(a+=" var "+p+"; "),a+=" try { await "+v+"; ",l&&(a+=" "+p+" = true; "),a+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",l&&(a+=" "+p+" = false; "),a+=" } ",l&&(a+=" if ("+p+") { ")}else a+=" if (!"+v+") { if (vErrors === null) vErrors = "+i+".errors; else vErrors = vErrors.concat("+i+".errors); errors = vErrors.length; } ",l&&(a+=" else { ")}return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var l="valid"+c.level,h=c.baseId,p=!0,f=i;if(f)for(var d,m=-1,g=f.length-1;m<g;)d=f[m+=1],(e.opts.strictKeywords?"object"==typeof d&&Object.keys(d).length>0||!1===d:e.util.schemaHasRules(d,e.RULES.all))&&(p=!1,c.schema=d,c.schemaPath=a+"["+m+"]",c.errSchemaPath=o+"/"+m,n+=" "+e.validate(c)+" ",c.baseId=h,s&&(n+=" if ("+l+") { ",u+="}"));return s&&(n+=p?" if (true) { ":" "+u.slice(0,-1)+" "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p="errs__"+i,f=e.util.copy(e),d="";f.level++;var m="valid"+f.level;if(o.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0||!1===t:e.util.schemaHasRules(t,e.RULES.all)}))){var g=f.baseId;n+=" var "+p+" = errors; var "+h+" = false; ";var b=e.compositeRule;e.compositeRule=f.compositeRule=!0;var y=o;if(y)for(var v,w=-1,_=y.length-1;w<_;)v=y[w+=1],f.schema=v,f.schemaPath=s+"["+w+"]",f.errSchemaPath=c+"/"+w,n+=" "+e.validate(f)+" ",f.baseId=g,n+=" "+h+" = "+h+" || "+m+"; if (!"+h+") { ",d+="}";e.compositeRule=f.compositeRule=b,n+=" "+d+" if (!"+h+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else u&&(n+=" if (true) { ");return n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.schema[t],a=e.errSchemaPath+"/"+t,o=(e.opts.allErrors,e.util.toQuotedString(i));return!0===e.opts.$comment?n+=" console.log("+o+");":"function"==typeof e.opts.$comment&&(n+=" self._opts.$comment("+o+", "+e.util.toQuotedString(a)+", validate.root.schema);"),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p=e.opts.$data&&o&&o.$data;p&&(n+=" var schema"+i+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; "),p||(n+=" var schema"+i+" = validate.schema"+s+";"),n+="var "+h+" = equal("+l+", schema"+i+"); if (!"+h+") { ";var f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValue: schema"+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to constant' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var d=n;return n=f.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",u&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p="errs__"+i,f=e.util.copy(e);f.level++;var d="valid"+f.level,m="i"+i,g=f.dataLevel=e.dataLevel+1,b="data"+g,y=e.baseId,v=e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all);if(n+="var "+p+" = errors;var "+h+";",v){var w=e.compositeRule;e.compositeRule=f.compositeRule=!0,f.schema=o,f.schemaPath=s,f.errSchemaPath=c,n+=" var "+d+" = false; for (var "+m+" = 0; "+m+" < "+l+".length; "+m+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var _=l+"["+m+"]";f.dataPathArr[g]=m;var k=e.validate(f);f.baseId=y,e.util.varOccurences(k,b)<2?n+=" "+e.util.varReplace(k,b,_)+" ":n+=" var "+b+" = "+_+"; "+k+" ",n+=" if ("+d+") break; } ",e.compositeRule=f.compositeRule=w,n+=" if (!"+d+") {"}else n+=" if ("+l+".length == 0) {";var x=x||[];x.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should contain a valid item' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var E=n;return n=x.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { ",v&&(n+=" errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } "),e.opts.allErrors&&(n+=" } "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="errs__"+i,p=e.util.copy(e),f="";p.level++;var d="valid"+p.level,m={},g={},b=e.opts.ownProperties;for(_ in o)if("__proto__"!=_){var y=o[_],v=Array.isArray(y)?g:m;v[_]=y}n+="var "+h+" = errors;";var w=e.errorPath;for(var _ in n+="var missing"+i+";",g)if((v=g[_]).length){if(n+=" if ( "+l+e.util.getProperty(_)+" !== undefined ",b&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(_)+"') "),u){n+=" && ( ";var k=v;if(k)for(var x=-1,E=k.length-1;x<E;){B=k[x+=1],x&&(n+=" || "),n+=" ( ( "+(P=l+(I=e.util.getProperty(B)))+" === undefined ",b&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(B)+"') "),n+=") && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?B:I)+") ) "}n+=")) { ";var A="missing"+i,S="' + "+A+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,A,!0):w+" + "+A);var j=j||[];j.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(_)+"', missingProperty: '"+S+"', depsCount: "+v.length+", deps: '"+e.util.escapeQuotes(1==v.length?v[0]:v.join(", "))+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should have ",1==v.length?n+="property "+e.util.escapeQuotes(v[0]):n+="properties "+e.util.escapeQuotes(v.join(", ")),n+=" when property "+e.util.escapeQuotes(_)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var T=n;n=j.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+T+"]); ":n+=" validate.errors = ["+T+"]; return false; ":n+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{n+=" ) { ";var C=v;if(C)for(var B,O=-1,R=C.length-1;O<R;){B=C[O+=1];var I=e.util.getProperty(B),P=(S=e.util.escapeQuotes(B),l+I);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(w,B,e.opts.jsonPointers)),n+=" if ( "+P+" === undefined ",b&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(B)+"') "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(_)+"', missingProperty: '"+S+"', depsCount: "+v.length+", deps: '"+e.util.escapeQuotes(1==v.length?v[0]:v.join(", "))+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should have ",1==v.length?n+="property "+e.util.escapeQuotes(v[0]):n+="properties "+e.util.escapeQuotes(v.join(", ")),n+=" when property "+e.util.escapeQuotes(_)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}n+=" } ",u&&(f+="}",n+=" else { ")}e.errorPath=w;var D=p.baseId;for(var _ in m){y=m[_];(e.opts.strictKeywords?"object"==typeof y&&Object.keys(y).length>0||!1===y:e.util.schemaHasRules(y,e.RULES.all))&&(n+=" "+d+" = true; if ( "+l+e.util.getProperty(_)+" !== undefined ",b&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(_)+"') "),n+=") { ",p.schema=y,p.schemaPath=s+e.util.getProperty(_),p.errSchemaPath=c+"/"+e.util.escapeFragment(_),n+=" "+e.validate(p)+" ",p.baseId=D,n+=" } ",u&&(n+=" if ("+d+") { ",f+="}"))}return u&&(n+=" "+f+" if ("+h+" == errors) {"),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p=e.opts.$data&&o&&o.$data;p&&(n+=" var schema"+i+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ");var f="i"+i,d="schema"+i;p||(n+=" var "+d+" = validate.schema"+s+";"),n+="var "+h+";",p&&(n+=" if (schema"+i+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+i+")) "+h+" = false; else {"),n+=h+" = false;for (var "+f+"=0; "+f+"<"+d+".length; "+f+"++) if (equal("+l+", "+d+"["+f+"])) { "+h+" = true; break; }",p&&(n+=" } "),n+=" if (!"+h+") { ";var m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValues: schema"+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",u&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||"");if(!1===e.opts.format)return u&&(n+=" if (true) { "),n;var h,p=e.opts.$data&&o&&o.$data;p?(n+=" var schema"+i+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ",h="schema"+i):h=o;var f=e.opts.unknownFormats,d=Array.isArray(f);if(p){n+=" var "+(m="format"+i)+" = formats["+h+"]; var "+(g="isObject"+i)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(b="formatType"+i)+" = "+g+" && "+m+".type || 'string'; if ("+g+") { ",e.async&&(n+=" var async"+i+" = "+m+".async; "),n+=" "+m+" = "+m+".validate; } if ( ",p&&(n+=" ("+h+" !== undefined && typeof "+h+" != 'string') || "),n+=" (","ignore"!=f&&(n+=" ("+h+" && !"+m+" ",d&&(n+=" && self._opts.unknownFormats.indexOf("+h+") == -1 "),n+=") || "),n+=" ("+m+" && "+b+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?n+=" (async"+i+" ? await "+m+"("+l+") : "+m+"("+l+")) ":n+=" "+m+"("+l+") ",n+=" : "+m+".test("+l+"))))) {"}else{var m;if(!(m=e.formats[o])){if("ignore"==f)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(n+=" if (true) { "),n;if(d&&f.indexOf(o)>=0)return u&&(n+=" if (true) { "),n;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var g,b=(g="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(g){var y=!0===m.async;m=m.validate}if(b!=r)return u&&(n+=" if (true) { "),n;if(y){if(!e.async)throw new Error("async format in sync schema");n+=" if (!(await "+(v="formats"+e.util.getProperty(o)+".validate")+"("+l+"))) { "}else{n+=" if (! ";var v="formats"+e.util.getProperty(o);g&&(v+=".validate"),n+="function"==typeof m?" "+v+"("+l+") ":" "+v+".test("+l+") ",n+=") { "}}var w=w||[];w.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",n+=p?""+h:""+e.util.toQuotedString(o),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match format \"",n+=p?"' + "+h+" + '":""+e.util.escapeQuotes(o),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=p?"validate.schema"+s:""+e.util.toQuotedString(o),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var _=n;return n=w.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+_+"]); ":n+=" validate.errors = ["+_+"]; return false; ":n+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",u&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p="errs__"+i,f=e.util.copy(e);f.level++;var d="valid"+f.level,m=e.schema.then,g=e.schema.else,b=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0||!1===m:e.util.schemaHasRules(m,e.RULES.all)),y=void 0!==g&&(e.opts.strictKeywords?"object"==typeof g&&Object.keys(g).length>0||!1===g:e.util.schemaHasRules(g,e.RULES.all)),v=f.baseId;if(b||y){var w;f.createErrors=!1,f.schema=o,f.schemaPath=s,f.errSchemaPath=c,n+=" var "+p+" = errors; var "+h+" = true; ";var _=e.compositeRule;e.compositeRule=f.compositeRule=!0,n+=" "+e.validate(f)+" ",f.baseId=v,f.createErrors=!0,n+=" errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.compositeRule=f.compositeRule=_,b?(n+=" if ("+d+") { ",f.schema=e.schema.then,f.schemaPath=e.schemaPath+".then",f.errSchemaPath=e.errSchemaPath+"/then",n+=" "+e.validate(f)+" ",f.baseId=v,n+=" "+h+" = "+d+"; ",b&&y?n+=" var "+(w="ifClause"+i)+" = 'then'; ":w="'then'",n+=" } ",y&&(n+=" else { ")):n+=" if (!"+d+") { ",y&&(f.schema=e.schema.else,f.schemaPath=e.schemaPath+".else",f.errSchemaPath=e.errSchemaPath+"/else",n+=" "+e.validate(f)+" ",f.baseId=v,n+=" "+h+" = "+d+"; ",b&&y?n+=" var "+(w="ifClause"+i)+" = 'else'; ":w="'else'",n+=" } "),n+=" if (!"+h+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } ",u&&(n+=" else { ")}else u&&(n+=" if (true) { ");return n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p="errs__"+i,f=e.util.copy(e),d="";f.level++;var m="valid"+f.level,g="i"+i,b=f.dataLevel=e.dataLevel+1,y="data"+b,v=e.baseId;if(n+="var "+p+" = errors;var "+h+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){n+=" "+h+" = "+l+".length <= "+o.length+"; ";var _=c;c=e.errSchemaPath+"/additionalItems",n+=" if (!"+h+") { ";var k=k||[];k.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var x=n;n=k.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+x+"]); ":n+=" validate.errors = ["+x+"]; return false; ":n+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c=_,u&&(d+="}",n+=" else { ")}var E=o;if(E)for(var A,S=-1,j=E.length-1;S<j;)if(A=E[S+=1],e.opts.strictKeywords?"object"==typeof A&&Object.keys(A).length>0||!1===A:e.util.schemaHasRules(A,e.RULES.all)){n+=" "+m+" = true; if ("+l+".length > "+S+") { ";var T=l+"["+S+"]";f.schema=A,f.schemaPath=s+"["+S+"]",f.errSchemaPath=c+"/"+S,f.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0),f.dataPathArr[b]=S;var C=e.validate(f);f.baseId=v,e.util.varOccurences(C,y)<2?n+=" "+e.util.varReplace(C,y,T)+" ":n+=" var "+y+" = "+T+"; "+C+" ",n+=" } ",u&&(n+=" if ("+m+") { ",d+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0||!1===w:e.util.schemaHasRules(w,e.RULES.all))){f.schema=w,f.schemaPath=e.schemaPath+".additionalItems",f.errSchemaPath=e.errSchemaPath+"/additionalItems",n+=" "+m+" = true; if ("+l+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+l+".length; "+g+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);T=l+"["+g+"]";f.dataPathArr[b]=g;C=e.validate(f);f.baseId=v,e.util.varOccurences(C,y)<2?n+=" "+e.util.varReplace(C,y,T)+" ":n+=" var "+y+" = "+T+"; "+C+" ",u&&(n+=" if (!"+m+") break; "),n+=" } } ",u&&(n+=" if ("+m+") { ",d+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){f.schema=o,f.schemaPath=s,f.errSchemaPath=c,n+=" for (var "+g+" = 0; "+g+" < "+l+".length; "+g+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);T=l+"["+g+"]";f.dataPathArr[b]=g;C=e.validate(f);f.baseId=v,e.util.varOccurences(C,y)<2?n+=" "+e.util.varReplace(C,y,T)+" ":n+=" var "+y+" = "+T+"; "+C+" ",u&&(n+=" if (!"+m+") break; "),n+=" }"}return u&&(n+=" "+d+" if ("+p+" == errors) {"),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n,i=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,h="data"+(o||""),p=e.opts.$data&&s&&s.$data;if(p?(i+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",n="schema"+a):n=s,!p&&"number"!=typeof s)throw new Error(t+" must be number");i+="var division"+a+";if (",p&&(i+=" "+n+" !== undefined && ( typeof "+n+" != 'number' || "),i+=" (division"+a+" = "+h+" / "+n+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+a+" !== parseInt(division"+a+") ",i+=" ) ",p&&(i+=" ) "),i+=" ) { ";var f=f||[];f.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+n+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be multiple of ",i+=p?"' + "+n:n+"'"),e.opts.verbose&&(i+=" , schema: ",i+=p?"validate.schema"+c:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var d=i;return i=f.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+d+"]); ":i+=" validate.errors = ["+d+"]; return false; ":i+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="errs__"+i,p=e.util.copy(e);p.level++;var f="valid"+p.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){p.schema=o,p.schemaPath=s,p.errSchemaPath=c,n+=" var "+h+" = errors; ";var d,m=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.createErrors=!1,p.opts.allErrors&&(d=p.opts.allErrors,p.opts.allErrors=!1),n+=" "+e.validate(p)+" ",p.createErrors=!0,d&&(p.opts.allErrors=d),e.compositeRule=p.compositeRule=m,n+=" if ("+f+") { ";var g=g||[];g.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var b=n;n=g.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else n+=" var err = ",!1!==e.createErrors?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(n+=" if (false) { ");return n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p="errs__"+i,f=e.util.copy(e),d="";f.level++;var m="valid"+f.level,g=f.baseId,b="prevValid"+i,y="passingSchemas"+i;n+="var "+p+" = errors , "+b+" = false , "+h+" = false , "+y+" = null; ";var v=e.compositeRule;e.compositeRule=f.compositeRule=!0;var w=o;if(w)for(var _,k=-1,x=w.length-1;k<x;)_=w[k+=1],(e.opts.strictKeywords?"object"==typeof _&&Object.keys(_).length>0||!1===_:e.util.schemaHasRules(_,e.RULES.all))?(f.schema=_,f.schemaPath=s+"["+k+"]",f.errSchemaPath=c+"/"+k,n+=" "+e.validate(f)+" ",f.baseId=g):n+=" var "+m+" = true; ",k&&(n+=" if ("+m+" && "+b+") { "+h+" = false; "+y+" = ["+y+", "+k+"]; } else { ",d+="}"),n+=" if ("+m+") { "+h+" = "+b+" = true; "+y+" = "+k+"; }";return e.compositeRule=f.compositeRule=v,n+=d+"if (!"+h+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(n+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+="} else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; }",e.opts.allErrors&&(n+=" } "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n,i=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,h="data"+(o||""),p=e.opts.$data&&s&&s.$data;p?(i+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",n="schema"+a):n=s,i+="if ( ",p&&(i+=" ("+n+" !== undefined && typeof "+n+" != 'string') || "),i+=" !"+(p?"(new RegExp("+n+"))":e.usePattern(s))+".test("+h+") ) { ";var f=f||[];f.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",i+=p?""+n:""+e.util.toQuotedString(s),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match pattern \"",i+=p?"' + "+n+" + '":""+e.util.escapeQuotes(s),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=p?"validate.schema"+c:""+e.util.toQuotedString(s),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var d=i;return i=f.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+d+"]); ":i+=" validate.errors = ["+d+"]; return false; ":i+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="errs__"+i,p=e.util.copy(e),f="";p.level++;var d="valid"+p.level,m="key"+i,g="idx"+i,b=p.dataLevel=e.dataLevel+1,y="data"+b,v="dataProperties"+i,w=Object.keys(o||{}).filter(I),_=e.schema.patternProperties||{},k=Object.keys(_).filter(I),x=e.schema.additionalProperties,E=w.length||k.length,A=!1===x,S="object"==typeof x&&Object.keys(x).length,j=e.opts.removeAdditional,T=A||S||j,C=e.opts.ownProperties,B=e.baseId,O=e.schema.required;if(O&&(!e.opts.$data||!O.$data)&&O.length<e.opts.loopRequired)var R=e.util.toHash(O);function I(e){return"__proto__"!==e}if(n+="var "+h+" = errors;var "+d+" = true;",C&&(n+=" var "+v+" = undefined;"),T){if(n+=C?" "+v+" = "+v+" || Object.keys("+l+"); for (var "+g+"=0; "+g+"<"+v+".length; "+g+"++) { var "+m+" = "+v+"["+g+"]; ":" for (var "+m+" in "+l+") { ",E){if(n+=" var isAdditional"+i+" = !(false ",w.length)if(w.length>8)n+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var P=w;if(P)for(var D=-1,M=P.length-1;D<M;)Q=P[D+=1],n+=" || "+m+" == "+e.util.toQuotedString(Q)+" "}if(k.length){var F=k;if(F)for(var L=-1,N=F.length-1;L<N;)ae=F[L+=1],n+=" || "+e.usePattern(ae)+".test("+m+") "}n+=" ); if (isAdditional"+i+") { "}if("all"==j)n+=" delete "+l+"["+m+"]; ";else{var z=e.errorPath,U="' + "+m+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers)),A)if(j)n+=" delete "+l+"["+m+"]; ";else{n+=" "+d+" = false; ";var q=c;c=e.errSchemaPath+"/additionalProperties",(re=re||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { additionalProperty: '"+U+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is an invalid additional property":n+="should NOT have additional properties",n+="' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var H=n;n=re.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+H+"]); ":n+=" validate.errors = ["+H+"]; return false; ":n+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=q,u&&(n+=" break; ")}else if(S)if("failing"==j){n+=" var "+h+" = errors; ";var G=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=x,p.schemaPath=e.schemaPath+".additionalProperties",p.errSchemaPath=e.errSchemaPath+"/additionalProperties",p.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var V=l+"["+m+"]";p.dataPathArr[b]=m;var W=e.validate(p);p.baseId=B,e.util.varOccurences(W,y)<2?n+=" "+e.util.varReplace(W,y,V)+" ":n+=" var "+y+" = "+V+"; "+W+" ",n+=" if (!"+d+") { errors = "+h+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+l+"["+m+"]; } ",e.compositeRule=p.compositeRule=G}else{p.schema=x,p.schemaPath=e.schemaPath+".additionalProperties",p.errSchemaPath=e.errSchemaPath+"/additionalProperties",p.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);V=l+"["+m+"]";p.dataPathArr[b]=m;W=e.validate(p);p.baseId=B,e.util.varOccurences(W,y)<2?n+=" "+e.util.varReplace(W,y,V)+" ":n+=" var "+y+" = "+V+"; "+W+" ",u&&(n+=" if (!"+d+") break; ")}e.errorPath=z}E&&(n+=" } "),n+=" } ",u&&(n+=" if ("+d+") { ",f+="}")}var K=e.opts.useDefaults&&!e.compositeRule;if(w.length){var J=w;if(J)for(var Q,Y=-1,X=J.length-1;Y<X;){var Z=o[Q=J[Y+=1]];if(e.opts.strictKeywords?"object"==typeof Z&&Object.keys(Z).length>0||!1===Z:e.util.schemaHasRules(Z,e.RULES.all)){var $=e.util.getProperty(Q),ee=(V=l+$,K&&void 0!==Z.default);p.schema=Z,p.schemaPath=s+$,p.errSchemaPath=c+"/"+e.util.escapeFragment(Q),p.errorPath=e.util.getPath(e.errorPath,Q,e.opts.jsonPointers),p.dataPathArr[b]=e.util.toQuotedString(Q);W=e.validate(p);if(p.baseId=B,e.util.varOccurences(W,y)<2){W=e.util.varReplace(W,y,V);var te=V}else{te=y;n+=" var "+y+" = "+V+"; "}if(ee)n+=" "+W+" ";else{if(R&&R[Q]){n+=" if ( "+te+" === undefined ",C&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(Q)+"') "),n+=") { "+d+" = false; ";z=e.errorPath,q=c;var re,ne=e.util.escapeQuotes(Q);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(z,Q,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(re=re||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+ne+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+ne+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";H=n;n=re.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+H+"]); ":n+=" validate.errors = ["+H+"]; return false; ":n+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=q,e.errorPath=z,n+=" } else { "}else u?(n+=" if ( "+te+" === undefined ",C&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(Q)+"') "),n+=") { "+d+" = true; } else { "):(n+=" if ("+te+" !== undefined ",C&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(Q)+"') "),n+=" ) { ");n+=" "+W+" } "}}u&&(n+=" if ("+d+") { ",f+="}")}}if(k.length){var ie=k;if(ie)for(var ae,oe=-1,se=ie.length-1;oe<se;){Z=_[ae=ie[oe+=1]];if(e.opts.strictKeywords?"object"==typeof Z&&Object.keys(Z).length>0||!1===Z:e.util.schemaHasRules(Z,e.RULES.all)){p.schema=Z,p.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ae),p.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ae),n+=C?" "+v+" = "+v+" || Object.keys("+l+"); for (var "+g+"=0; "+g+"<"+v+".length; "+g+"++) { var "+m+" = "+v+"["+g+"]; ":" for (var "+m+" in "+l+") { ",n+=" if ("+e.usePattern(ae)+".test("+m+")) { ",p.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);V=l+"["+m+"]";p.dataPathArr[b]=m;W=e.validate(p);p.baseId=B,e.util.varOccurences(W,y)<2?n+=" "+e.util.varReplace(W,y,V)+" ":n+=" var "+y+" = "+V+"; "+W+" ",u&&(n+=" if (!"+d+") break; "),n+=" } ",u&&(n+=" else "+d+" = true; "),n+=" } ",u&&(n+=" if ("+d+") { ",f+="}")}}}return u&&(n+=" "+f+" if ("+h+" == errors) {"),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="errs__"+i,p=e.util.copy(e);p.level++;var f="valid"+p.level;if(n+="var "+h+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){p.schema=o,p.schemaPath=s,p.errSchemaPath=c;var d="key"+i,m="idx"+i,g="i"+i,b="' + "+d+" + '",y="data"+(p.dataLevel=e.dataLevel+1),v="dataProperties"+i,w=e.opts.ownProperties,_=e.baseId;w&&(n+=" var "+v+" = undefined; "),n+=w?" "+v+" = "+v+" || Object.keys("+l+"); for (var "+m+"=0; "+m+"<"+v+".length; "+m+"++) { var "+d+" = "+v+"["+m+"]; ":" for (var "+d+" in "+l+") { ",n+=" var startErrs"+i+" = errors; ";var k=d,x=e.compositeRule;e.compositeRule=p.compositeRule=!0;var E=e.validate(p);p.baseId=_,e.util.varOccurences(E,y)<2?n+=" "+e.util.varReplace(E,y,k)+" ":n+=" var "+y+" = "+k+"; "+E+" ",e.compositeRule=p.compositeRule=x,n+=" if (!"+f+") { for (var "+g+"=startErrs"+i+"; "+g+"<errors; "+g+"++) { vErrors["+g+"].propertyName = "+d+"; } var err = ",!1!==e.createErrors?(n+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { propertyName: '"+b+"' } ",!1!==e.opts.messages&&(n+=" , message: 'property name \\'"+b+"\\' is invalid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),u&&(n+=" break; "),n+=" } }"}return u&&(n+=" if ("+h+" == errors) {"),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p=e.opts.$data&&o&&o.$data;p&&(n+=" var schema"+i+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ");var f="schema"+i;if(!p)if(o.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var d=[],m=o;if(m)for(var g,b=-1,y=m.length-1;b<y;){g=m[b+=1];var v=e.schema.properties[g];v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0||!1===v:e.util.schemaHasRules(v,e.RULES.all))||(d[d.length]=g)}}else d=o;if(p||d.length){var w=e.errorPath,_=p||d.length>=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(n+=" var missing"+i+"; ",_){p||(n+=" var "+f+" = validate.schema"+s+"; ");var x="' + "+(C="schema"+i+"["+(S="i"+i)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,C,e.opts.jsonPointers)),n+=" var "+h+" = true; ",p&&(n+=" if (schema"+i+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+i+")) "+h+" = false; else {"),n+=" for (var "+S+" = 0; "+S+" < "+f+".length; "+S+"++) { "+h+" = "+l+"["+f+"["+S+"]] !== undefined ",k&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", "+f+"["+S+"]) "),n+="; if (!"+h+") break; } ",p&&(n+=" } "),n+=" if (!"+h+") { ",(T=T||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+x+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var E=n;n=T.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else{n+=" if ( ";var A=d;if(A)for(var S=-1,j=A.length-1;S<j;){O=A[S+=1],S&&(n+=" || "),n+=" ( ( "+(D=l+(P=e.util.getProperty(O)))+" === undefined ",k&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(O)+"') "),n+=") && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?O:P)+") ) "}n+=") { ";var T;x="' + "+(C="missing"+i)+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,C,!0):w+" + "+C),(T=T||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+x+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";E=n;n=T.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else if(_){p||(n+=" var "+f+" = validate.schema"+s+"; ");var C;x="' + "+(C="schema"+i+"["+(S="i"+i)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,C,e.opts.jsonPointers)),p&&(n+=" if ("+f+" && !Array.isArray("+f+")) { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+x+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+f+" !== undefined) { "),n+=" for (var "+S+" = 0; "+S+" < "+f+".length; "+S+"++) { if ("+l+"["+f+"["+S+"]] === undefined ",k&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", "+f+"["+S+"]) "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+x+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",p&&(n+=" } ")}else{var B=d;if(B)for(var O,R=-1,I=B.length-1;R<I;){O=B[R+=1];var P=e.util.getProperty(O),D=(x=e.util.escapeQuotes(O),l+P);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(w,O,e.opts.jsonPointers)),n+=" if ( "+D+" === undefined ",k&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(O)+"') "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+x+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=w}else u&&(n+=" if (true) {");return n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n,i=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,h="data"+(o||""),p="valid"+a,f=e.opts.$data&&s&&s.$data;if(f?(i+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",n="schema"+a):n=s,(s||f)&&!1!==e.opts.uniqueItems){f&&(i+=" var "+p+"; if ("+n+" === false || "+n+" === undefined) "+p+" = true; else if (typeof "+n+" != 'boolean') "+p+" = false; else { "),i+=" var i = "+h+".length , "+p+" = true , j; if (i > 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(d.indexOf("object")>=0||d.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+p+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ";var g="checkDataType"+(m?"s":"");i+=" if ("+e.util[g](d,"item",e.opts.strictNumbers,!0)+") continue; ",m&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+p+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",f&&(i+=" } "),i+=" if (!"+p+") { ";var b=b||[];b.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+c:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var y=i;i=b.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { ")}else l&&(i+=" if (true) { ");return i}},function(e,t,r){"use strict";var n=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,t){for(var r=0;r<t.length;r++){e=JSON.parse(JSON.stringify(e));var i,a=t[r].split("/"),o=e;for(i=1;i<a.length;i++)o=o[a[i]];for(i=0;i<n.length;i++){var s=n[i],c=o[s];c&&(o[s]={anyOf:[c,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e}},function(e,t,r){"use strict";var n=r(111).MissingRef;e.exports=function e(t,r,i){var a=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof r&&(i=r,r=void 0);var o=s(t).then((function(){var e=a._addSchema(t,void 0,r);return e.validate||function e(t){try{return a._compile(t)}catch(e){if(e instanceof n)return i(e);throw e}function i(n){var i=n.missingSchema;if(u(i))throw new Error("Schema "+i+" is loaded but "+n.missingRef+" cannot be resolved");var o=a._loadingSchemas[i];return o||(o=a._loadingSchemas[i]=a._opts.loadSchema(i)).then(c,c),o.then((function(e){if(!u(i))return s(e).then((function(){u(i)||a.addSchema(e,i,void 0,r)}))})).then((function(){return e(t)}));function c(){delete a._loadingSchemas[i]}function u(e){return a._refs[e]||a._schemas[e]}}}(e)}));i&&o.then((function(e){i(null,e)}),i);return o;function s(t){var r=t.$schema;return r&&!a.getSchema(r)?e.call(a,{$ref:r},!0):Promise.resolve()}}},function(e,t,r){"use strict";var n=/^[a-z_$][a-z0-9_$-]*$/i,i=r(490),a=r(491);e.exports={add:function(e,t){var r=this.RULES;if(r.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!n.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(t){this.validateKeyword(t,!0);var a=t.type;if(Array.isArray(a))for(var o=0;o<a.length;o++)c(e,a[o],t);else c(e,a,t);var s=t.metaSchema;s&&(t.$data&&this._opts.$data&&(s={anyOf:[s,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),t.validateSchema=this.compile(s,!0))}function c(e,t,n){for(var a,o=0;o<r.length;o++){var s=r[o];if(s.type==t){a=s;break}}a||(a={type:t,rules:[]},r.push(a));var c={keyword:e,definition:n,custom:!0,code:i,implements:n.implements};a.rules.push(c),r.custom[e]=c}return r.keywords[e]=r.all[e]=!0,this},get:function(e){var t=this.RULES.custom[e];return t?t.definition:this.RULES.keywords[e]||!1},remove:function(e){var t=this.RULES;delete t.keywords[e],delete t.all[e],delete t.custom[e];for(var r=0;r<t.length;r++)for(var n=t[r].rules,i=0;i<n.length;i++)if(n[i].keyword==e){n.splice(i,1);break}return this},validate:function e(t,r){e.errors=null;var n=this._validateKeyword=this._validateKeyword||this.compile(a,!0);if(n(t))return!0;if(e.errors=n.errors,r)throw new Error("custom keyword definition is invalid: "+this.errorsText(n.errors));return!1}}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n,i,a=" ",o=e.level,s=e.dataLevel,c=e.schema[t],u=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(s||""),f="valid"+o,d="errs__"+o,m=e.opts.$data&&c&&c.$data;m?(a+=" var schema"+o+" = "+e.util.getData(c.$data,s,e.dataPathArr)+"; ",i="schema"+o):i=c;var g,b,y,v,w,_="definition"+o,k=this.definition,x="";if(m&&k.$data){w="keywordValidate"+o;var E=k.validateSchema;a+=" var "+_+" = RULES.custom['"+t+"'].definition; var "+w+" = "+_+".validate;"}else{if(!(v=e.useCustomRule(this,c,e.schema,e)))return;i="validate.schema"+u,w=v.code,g=k.compile,b=k.inline,y=k.macro}var A=w+".errors",S="i"+o,j="ruleErr"+o,T=k.async;if(T&&!e.async)throw new Error("async keyword in sync schema");if(b||y||(a+=A+" = null;"),a+="var "+d+" = errors;var "+f+";",m&&k.$data&&(x+="}",a+=" if ("+i+" === undefined) { "+f+" = true; } else { ",E&&(x+="}",a+=" "+f+" = "+_+".validateSchema("+i+"); if ("+f+") { ")),b)k.statements?a+=" "+v.validate+" ":a+=" "+f+" = "+v.validate+"; ";else if(y){var C=e.util.copy(e);x="";C.level++;var B="valid"+C.level;C.schema=v.validate,C.schemaPath="";var O=e.compositeRule;e.compositeRule=C.compositeRule=!0;var R=e.validate(C).replace(/validate\.schema/g,w);e.compositeRule=C.compositeRule=O,a+=" "+R}else{(M=M||[]).push(a),a="",a+=" "+w+".call( ",e.opts.passContext?a+="this":a+="self",g||!1===k.schema?a+=" , "+p+" ":a+=" , "+i+" , "+p+" , validate.schema"+e.schemaPath+" ",a+=" , (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var I=s?"data"+(s-1||""):"parentData",P=s?e.dataPathArr[s]:"parentDataProperty",D=a+=" , "+I+" , "+P+" , rootData ) ";a=M.pop(),!1===k.errors?(a+=" "+f+" = ",T&&(a+="await "),a+=D+"; "):a+=T?" var "+(A="customErrors"+o)+" = null; try { "+f+" = await "+D+"; } catch (e) { "+f+" = false; if (e instanceof ValidationError) "+A+" = e.errors; else throw e; } ":" "+A+" = null; "+f+" = "+D+"; "}if(k.modifying&&(a+=" if ("+I+") "+p+" = "+I+"["+P+"];"),a+=""+x,k.valid)h&&(a+=" if (true) { ");else{var M;a+=" if ( ",void 0===k.valid?(a+=" !",a+=y?""+B:""+f):a+=" "+!k.valid+" ",a+=") { ",n=this.keyword,(M=M||[]).push(a),a="",(M=M||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(n||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(a+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),a+=" } "):a+=" {} ";var F=a;a=M.pop(),!e.compositeRule&&h?e.async?a+=" throw new ValidationError(["+F+"]); ":a+=" validate.errors = ["+F+"]; return false; ":a+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var L=a;a=M.pop(),b?k.errors?"full"!=k.errors&&(a+=" for (var "+S+"="+d+"; "+S+"<errors; "+S+"++) { var "+j+" = vErrors["+S+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+j+".schemaPath === undefined) { "+j+'.schemaPath = "'+l+'"; } ',e.opts.verbose&&(a+=" "+j+".schema = "+i+"; "+j+".data = "+p+"; "),a+=" } "):!1===k.errors?a+=" "+L+" ":(a+=" if ("+d+" == errors) { "+L+" } else { for (var "+S+"="+d+"; "+S+"<errors; "+S+"++) { var "+j+" = vErrors["+S+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+j+".schemaPath === undefined) { "+j+'.schemaPath = "'+l+'"; } ',e.opts.verbose&&(a+=" "+j+".schema = "+i+"; "+j+".data = "+p+"; "),a+=" } } "):y?(a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: '"+(n||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(a+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; ")):!1===k.errors?a+=" "+L+" ":(a+=" if (Array.isArray("+A+")) { if (vErrors === null) vErrors = "+A+"; else vErrors = vErrors.concat("+A+"); errors = vErrors.length; for (var "+S+"="+d+"; "+S+"<errors; "+S+"++) { var "+j+" = vErrors["+S+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; "+j+'.schemaPath = "'+l+'"; ',e.opts.verbose&&(a+=" "+j+".schema = "+i+"; "+j+".data = "+p+"; "),a+=" } } else { "+L+" } "),a+=" } ",h&&(a+=" else { ")}return a}},function(e,t,r){"use strict";var n=r(256);e.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:n.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:n.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},function(e,t){function r(e){this.name="HARError",this.message="validation failed",this.errors=e,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error("validation failed").stack}r.prototype=Error.prototype,e.exports=r},function(e,t,r){"use strict";e.exports={afterRequest:r(495),beforeRequest:r(496),browser:r(497),cache:r(498),content:r(499),cookie:r(500),creator:r(501),entry:r(502),har:r(503),header:r(504),log:r(505),page:r(506),pageTimings:r(507),postData:r(508),query:r(509),request:r(510),response:r(511),timings:r(512)}},function(e){e.exports=JSON.parse('{"$id":"afterRequest.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["lastAccess","eTag","hitCount"],"properties":{"expires":{"type":"string","pattern":"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?"},"lastAccess":{"type":"string","pattern":"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?"},"eTag":{"type":"string"},"hitCount":{"type":"integer"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"beforeRequest.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["lastAccess","eTag","hitCount"],"properties":{"expires":{"type":"string","pattern":"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?"},"lastAccess":{"type":"string","pattern":"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?"},"eTag":{"type":"string"},"hitCount":{"type":"integer"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"browser.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","version"],"properties":{"name":{"type":"string"},"version":{"type":"string"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"cache.json#","$schema":"http://json-schema.org/draft-06/schema#","properties":{"beforeRequest":{"oneOf":[{"type":"null"},{"$ref":"beforeRequest.json#"}]},"afterRequest":{"oneOf":[{"type":"null"},{"$ref":"afterRequest.json#"}]},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"content.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["size","mimeType"],"properties":{"size":{"type":"integer"},"compression":{"type":"integer"},"mimeType":{"type":"string"},"text":{"type":"string"},"encoding":{"type":"string"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"cookie.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"path":{"type":"string"},"domain":{"type":"string"},"expires":{"type":["string","null"],"format":"date-time"},"httpOnly":{"type":"boolean"},"secure":{"type":"boolean"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"creator.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","version"],"properties":{"name":{"type":"string"},"version":{"type":"string"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"entry.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["startedDateTime","time","request","response","cache","timings"],"properties":{"pageref":{"type":"string"},"startedDateTime":{"type":"string","format":"date-time","pattern":"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))"},"time":{"type":"number","min":0},"request":{"$ref":"request.json#"},"response":{"$ref":"response.json#"},"cache":{"$ref":"cache.json#"},"timings":{"$ref":"timings.json#"},"serverIPAddress":{"type":"string","oneOf":[{"format":"ipv4"},{"format":"ipv6"}]},"connection":{"type":"string"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"har.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["log"],"properties":{"log":{"$ref":"log.json#"}}}')},function(e){e.exports=JSON.parse('{"$id":"header.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"log.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["version","creator","entries"],"properties":{"version":{"type":"string"},"creator":{"$ref":"creator.json#"},"browser":{"$ref":"browser.json#"},"pages":{"type":"array","items":{"$ref":"page.json#"}},"entries":{"type":"array","items":{"$ref":"entry.json#"}},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"page.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["startedDateTime","id","title","pageTimings"],"properties":{"startedDateTime":{"type":"string","format":"date-time","pattern":"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))"},"id":{"type":"string","unique":true},"title":{"type":"string"},"pageTimings":{"$ref":"pageTimings.json#"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"pageTimings.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","properties":{"onContentLoad":{"type":"number","min":-1},"onLoad":{"type":"number","min":-1},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"postData.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["mimeType"],"properties":{"mimeType":{"type":"string"},"text":{"type":"string"},"params":{"type":"array","required":["name"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"fileName":{"type":"string"},"contentType":{"type":"string"},"comment":{"type":"string"}}},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"query.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"request.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["method","url","httpVersion","cookies","headers","queryString","headersSize","bodySize"],"properties":{"method":{"type":"string"},"url":{"type":"string","format":"uri"},"httpVersion":{"type":"string"},"cookies":{"type":"array","items":{"$ref":"cookie.json#"}},"headers":{"type":"array","items":{"$ref":"header.json#"}},"queryString":{"type":"array","items":{"$ref":"query.json#"}},"postData":{"$ref":"postData.json#"},"headersSize":{"type":"integer"},"bodySize":{"type":"integer"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"response.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["status","statusText","httpVersion","cookies","headers","content","redirectURL","headersSize","bodySize"],"properties":{"status":{"type":"integer"},"statusText":{"type":"string"},"httpVersion":{"type":"string"},"cookies":{"type":"array","items":{"$ref":"cookie.json#"}},"headers":{"type":"array","items":{"$ref":"header.json#"}},"content":{"$ref":"content.json#"},"redirectURL":{"type":"string"},"headersSize":{"type":"integer"},"bodySize":{"type":"integer"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"timings.json#","$schema":"http://json-schema.org/draft-06/schema#","required":["send","wait","receive"],"properties":{"dns":{"type":"number","min":-1},"connect":{"type":"number","min":-1},"blocked":{"type":"number","min":-1},"send":{"type":"number","min":-1},"wait":{"type":"number","min":-1},"receive":{"type":"number","min":-1},"ssl":{"type":"number","min":-1},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-06/schema#","$id":"http://json-schema.org/draft-06/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"examples":{"type":"array","items":{}},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":{},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":{}}')},function(e,t,r){"use strict";var n=r(108),i=r(112),a=r(99),o=a.md5,s=a.toBase64;function c(e){this.request=e,this.hasAuth=!1,this.sentAuth=!1,this.bearerToken=null,this.user=null,this.pass=null}c.prototype.basic=function(e,t,r){if(("string"!=typeof e||void 0!==t&&"string"!=typeof t)&&this.request.emit("error",new Error("auth() received invalid user or password")),this.user=e,this.pass=t,this.hasAuth=!0,r||void 0===r){var n="Basic "+s(e+":"+(t||""));return this.sentAuth=!0,n}},c.prototype.bearer=function(e,t){if(this.bearerToken=e,this.hasAuth=!0,t||void 0===t){"function"==typeof e&&(e=e());var r="Bearer "+(e||"");return this.sentAuth=!0,r}},c.prototype.digest=function(e,t,r){for(var n={},a=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;;){var s=a.exec(r);if(!s)break;n[s[1]]=s[2]||s[3]}var c=/(^|,)\s*auth\s*($|,)/.test(n.qop)&&"auth",u=c&&"00000001",l=c&&i().replace(/-/g,""),h=function(e,t,r,n,i,a){var s=o(t+":"+r+":"+n);return e&&"md5-sess"===e.toLowerCase()?o(s+":"+i+":"+a):s}(n.algorithm,this.user,n.realm,this.pass,n.nonce,l),p=o(e+":"+t),f=o(c?h+":"+n.nonce+":"+u+":"+l+":"+c+":"+p:h+":"+n.nonce+":"+p),d={username:this.user,realm:n.realm,nonce:n.nonce,uri:t,qop:c,response:f,nc:u,cnonce:l,algorithm:n.algorithm,opaque:n.opaque};for(var m in r=[],d)d[m]&&("qop"===m||"nc"===m||"algorithm"===m?r.push(m+"="+d[m]):r.push(m+'="'+d[m]+'"'));return r="Digest "+r.join(", "),this.sentAuth=!0,r},c.prototype.onRequest=function(e,t,r,n){var i,a=this.request;void 0===n&&void 0===e?this.request.emit("error",new Error("no auth mechanism defined")):i=void 0!==n?this.bearer(n,r):this.basic(e,t,r),i&&a.setHeader("authorization",i)},c.prototype.onResponse=function(e){var t=this.request;if(!this.hasAuth||this.sentAuth)return null;var r=n(e.headers).get("www-authenticate"),i=r&&r.split(" ")[0].toLowerCase();switch(t.debug("reauth",i),i){case"basic":return this.basic(this.user,this.pass,!0);case"bearer":return this.bearer(this.bearerToken,!0);case"digest":return this.digest(t.method,t.path,r)}},t.Auth=c},function(e,t,r){var n=r(11);e.exports=function(){return n.randomBytes(16)}},function(e,t){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){var n=t||0,i=r;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}},function(e,t,r){"use strict";var n=r(30),i=r(246),a=r(108),o=r(112),s=r(518),c=r(11),u=r(23).Buffer;function l(e){this.request=e,this.params=null}l.prototype.buildParams=function(e,t,r,n,i,a){var c={};for(var u in e)c["oauth_"+u]=e[u];c.oauth_version||(c.oauth_version="1.0"),c.oauth_timestamp||(c.oauth_timestamp=Math.floor(Date.now()/1e3).toString()),c.oauth_nonce||(c.oauth_nonce=o().replace(/-/g,"")),c.oauth_signature_method||(c.oauth_signature_method="HMAC-SHA1");var l=c.oauth_consumer_secret||c.oauth_private_key;delete c.oauth_consumer_secret,delete c.oauth_private_key;var h=c.oauth_token_secret;delete c.oauth_token_secret;var p=c.oauth_realm;delete c.oauth_realm,delete c.oauth_transport_method;var f=t.protocol+"//"+t.host+t.pathname,d=a.parse([].concat(n,i,a.stringify(c)).join("&"));return c.oauth_signature=s.sign(c.oauth_signature_method,r,f,d,l,h),p&&(c.realm=p),c},l.prototype.buildBodyHash=function(e,t){["HMAC-SHA1","RSA-SHA1"].indexOf(e.signature_method||"HMAC-SHA1")<0&&this.request.emit("error",new Error("oauth: "+e.signature_method+" signature_method not supported with body_hash signing."));var r=c.createHash("sha1");r.update(t||"");var n=r.digest("hex");return u.from(n,"hex").toString("base64")},l.prototype.concatParams=function(e,t,r){r=r||"";var n=Object.keys(e).filter((function(e){return"realm"!==e&&"oauth_signature"!==e})).sort();return e.realm&&n.splice(0,0,"realm"),n.push("oauth_signature"),n.map((function(t){return t+"="+r+s.rfc3986(e[t])+r})).join(t)},l.prototype.onRequest=function(e){this.params=e;var t,r,o=this.request.uri||{},s=this.request.method||"",c=a(this.request.headers),u=this.request.body||"",l=this.request.qsLib||i,h=c.get("content-type")||"",p="application/x-www-form-urlencoded",f=e.transport_method||"header";h.slice(0,p.length)===p&&(h=p,t=u),o.query&&(r=o.query),"body"!==f||"POST"===s&&h===p||this.request.emit("error",new Error("oauth: transport_method of body requires POST and content-type "+p)),t||"boolean"!=typeof e.body_hash||(e.body_hash=this.buildBodyHash(e,this.request.body.toString()));var d=this.buildParams(e,o,s,r,t,l);switch(f){case"header":this.request.setHeader("Authorization","OAuth "+this.concatParams(d,",",'"'));break;case"query":var m=this.request.uri.href+=(r?"&":"?")+this.concatParams(d,"&");this.request.uri=n.parse(m),this.request.path=this.request.uri.path;break;case"body":this.request.body=(t?t+"&":"")+this.concatParams(d,"&");break;default:this.request.emit("error",new Error("oauth: transport_method invalid"))}},t.OAuth=l},function(e,t,r){var n=r(11);function i(e,t,r){return n.createHmac(r,e).update(t).digest("base64")}function a(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function o(e,t){return e>t?1:e<t?-1:0}function s(e,t,r){var n=function(e){var t,r,n=[];for(t in e)if(r=e[t],Array.isArray(r))for(var i=0;i<r.length;i++)n.push([t,r[i]]);else if("object"==typeof r)for(var a in r)n.push([t+"["+a+"]",r[a]]);else n.push([t,r]);return n}(r).map((function(e){return[a(e[0]),a(e[1]||"")]})).sort((function(e,t){return o(e[0],t[0])||o(e[1],t[1])})).map((function(e){return e.join("=")})).join("&");return[a(e?e.toUpperCase():"GET"),a(t),a(n)].join("&")}function c(e,t,r,n,o){var c=s(e,t,r);return i([n||"",o||""].map(a).join("&"),c,"sha1")}function u(e,t,r,n,o){var c=s(e,t,r);return i([n||"",o||""].map(a).join("&"),c,"sha256")}function l(e,t,r,i,a){return function(e,t){return n.createSign("RSA-SHA1").update(t).sign(e,"base64")}(i||"",s(e,t,r))}function h(e,t){return[e||"",t||""].map(a).join("&")}t.hmacsign=c,t.hmacsign256=u,t.rsasign=l,t.plaintext=h,t.sign=function(e,t,r,n,i,a){var o,s=1;switch(e){case"RSA-SHA1":o=l;break;case"HMAC-SHA1":o=c;break;case"HMAC-SHA256":o=u;break;case"PLAINTEXT":o=h,s=4;break;default:throw new Error("Signature method not supported: "+e)}return o.apply(null,[].slice.call(arguments,s))},t.rfc3986=a,t.generateBase=s},function(e,t,r){"use strict";var n=r(11);t.calculateMac=function(e,t){var r="hawk.1.header\n"+t.ts+"\n"+t.nonce+"\n"+(t.method||"").toUpperCase()+"\n"+t.resource+"\n"+t.host.toLowerCase()+"\n"+t.port+"\n"+(t.hash||"")+"\n";return t.ext&&(r+=t.ext.replace("\\","\\\\").replace("\n","\\n")),r+="\n",t.app&&(r=r+t.app+"\n"+(t.dlg||"")+"\n"),n.createHmac(e.algorithm,e.key).update(r).digest("base64")},t.header=function(e,r,i){var a=i.timestamp||Math.floor((Date.now()+(i.localtimeOffsetMsec||0))/1e3),o=i.credentials;if(!(o&&o.id&&o.key&&o.algorithm))return"";if(-1===["sha1","sha256"].indexOf(o.algorithm))return"";var s,c,u,l,h,p,f={ts:a,nonce:i.nonce||(s=6,c=6*(s+1),n.randomBytes(Math.ceil(c/8)).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"").slice(0,s)),method:r,resource:e.pathname+(e.search||""),host:e.hostname,port:e.port||("http:"===e.protocol?80:443),hash:i.hash,ext:i.ext,app:i.app,dlg:i.dlg};f.hash||!i.payload&&""!==i.payload||(f.hash=(u=i.payload,l=o.algorithm,h=i.contentType,(p=n.createHash(l)).update("hawk.1.payload\n"),p.update((h?h.split(";")[0].trim().toLowerCase():"")+"\n"),p.update(u||""),p.update("\n"),p.digest("base64")));var d=t.calculateMac(o,f),m=null!==f.ext&&void 0!==f.ext&&""!==f.ext,g='Hawk id="'+o.id+'", ts="'+f.ts+'", nonce="'+f.nonce+(f.hash?'", hash="'+f.hash:"")+(m?'", ext="'+f.ext.replace(/\\/g,"\\\\").replace(/"/g,'\\"'):"")+'", mac="'+d+'"';return f.app&&(g=g+', app="'+f.app+(f.dlg?'", dlg="'+f.dlg:"")+'"'),g}},function(e,t,r){"use strict";var n=r(112),i=r(238),a=r(245),o=r(23).Buffer;function s(e){this.request=e,this.boundary=n(),this.chunked=!1,this.body=null}s.prototype.isChunked=function(e){var t=this,r=!1,n=e.data||e;return n.forEach||t.request.emit("error",new Error("Argument error, options.multipart.")),void 0!==e.chunked&&(r=e.chunked),"chunked"===t.request.getHeader("transfer-encoding")&&(r=!0),r||n.forEach((function(e){void 0===e.body&&t.request.emit("error",new Error("Body attribute missing in multipart.")),a(e.body)&&(r=!0)})),r},s.prototype.setHeaders=function(e){e&&!this.request.hasHeader("transfer-encoding")&&this.request.setHeader("transfer-encoding","chunked");var t=this.request.getHeader("content-type");t&&-1!==t.indexOf("multipart")?-1!==t.indexOf("boundary")?this.boundary=t.replace(/.*boundary=([^\s;]+).*/,"$1"):this.request.setHeader("content-type",t+"; boundary="+this.boundary):this.request.setHeader("content-type","multipart/related; boundary="+this.boundary)},s.prototype.build=function(e,t){var r=this,n=t?new i:[];function a(e){return"number"==typeof e&&(e=e.toString()),t?n.append(e):n.push(o.from(e))}return r.request.preambleCRLF&&a("\r\n"),e.forEach((function(e){var t="--"+r.boundary+"\r\n";Object.keys(e).forEach((function(r){"body"!==r&&(t+=r+": "+e[r]+"\r\n")})),a(t+="\r\n"),a(e.body),a("\r\n")})),a("--"+r.boundary+"--"),r.request.postambleCRLF&&a("\r\n"),n},s.prototype.onRequest=function(e){var t=this.isChunked(e),r=e.data||e;this.setHeaders(t),this.chunked=t,this.body=this.build(r,t)},t.Multipart=s},function(e,t,r){"use strict";var n=r(30),i=/^https?:/;function a(e){this.request=e,this.followRedirect=!0,this.followRedirects=!0,this.followAllRedirects=!1,this.followOriginalHttpMethod=!1,this.allowRedirect=function(){return!0},this.maxRedirects=10,this.redirects=[],this.redirectsFollowed=0,this.removeRefererHeader=!1}a.prototype.onRequest=function(e){void 0!==e.maxRedirects&&(this.maxRedirects=e.maxRedirects),"function"==typeof e.followRedirect&&(this.allowRedirect=e.followRedirect),void 0!==e.followRedirect&&(this.followRedirects=!!e.followRedirect),void 0!==e.followAllRedirects&&(this.followAllRedirects=e.followAllRedirects),(this.followRedirects||this.followAllRedirects)&&(this.redirects=this.redirects||[]),void 0!==e.removeRefererHeader&&(this.removeRefererHeader=e.removeRefererHeader),void 0!==e.followOriginalHttpMethod&&(this.followOriginalHttpMethod=e.followOriginalHttpMethod)},a.prototype.redirectTo=function(e){var t=this.request,r=null;if(e.statusCode>=300&&e.statusCode<400&&e.caseless.has("location")){var n=e.caseless.get("location");if(t.debug("redirect",n),this.followAllRedirects)r=n;else if(this.followRedirects)switch(t.method){case"PATCH":case"PUT":case"POST":case"DELETE":break;default:r=n}}else if(401===e.statusCode){var i=t._auth.onResponse(e);i&&(t.setHeader("authorization",i),r=t.uri)}return r},a.prototype.onResponse=function(e){var t=this.request,r=this.redirectTo(e);if(!r||!this.allowRedirect.call(t,e))return!1;if(t.debug("redirect to",r),e.resume&&e.resume(),this.redirectsFollowed>=this.maxRedirects)return t.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+t.uri.href)),!1;this.redirectsFollowed+=1,i.test(r)||(r=n.resolve(t.uri.href,r));var a=t.uri;return t.uri=n.parse(r),t.uri.protocol!==a.protocol&&delete t.agent,this.redirects.push({statusCode:e.statusCode,redirectUri:r}),this.followAllRedirects&&"HEAD"!==t.method&&401!==e.statusCode&&307!==e.statusCode&&(t.method=this.followOriginalHttpMethod?t.method:"GET"),delete t.src,delete t.req,delete t._started,401!==e.statusCode&&307!==e.statusCode&&(delete t.body,delete t._form,t.headers&&(t.removeHeader("host"),t.removeHeader("content-type"),t.removeHeader("content-length"),t.uri.hostname!==t.originalHost.split(":")[0]&&t.removeHeader("authorization"))),this.removeRefererHeader||t.setHeader("referer",a.href),t.emit("redirect"),t.init(),!0},t.Redirect=a},function(e,t,r){"use strict";var n=r(30),i=r(523),a=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],o=["proxy-authorization"];function s(e){this.request=e,this.proxyHeaderWhiteList=a,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}s.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},s.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=n.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,a,s,c,u=this.proxyHeaderExclusiveList.concat(o),l=this.proxyHeaderWhiteList.concat(u),h=function(e,t){var r=t.reduce((function(e,t){return e[t.toLowerCase()]=!0,e}),{});return Object.keys(e).filter((function(e){return r[e.toLowerCase()]})).reduce((function(t,r){return t[r]=e[r],t}),{})}(t.headers,l);h.host=(r=t.uri,a=r.port,s=r.protocol,c=r.hostname+":",c+=a||("https:"===s?"443":"80")),u.forEach(t.removeHeader,t);var p=function(e){var t=function(e,t){return["https:"===e.protocol?"https":"http","https:"===t.protocol?"Https":"Http"].join("Over")}(e.uri,e.proxy);return i[t]}(t),f=function(e,t){var r=e.proxy;return{proxy:{host:r.hostname,port:+r.port,proxyAuth:r.auth,headers:t},headers:e.headers,ca:e.ca,cert:e.cert,key:e.key,passphrase:e.passphrase,pfx:e.pfx,ciphers:e.ciphers,rejectUnauthorized:e.rejectUnauthorized,secureOptions:e.secureOptions,secureProtocol:e.secureProtocol}}(t,h);return t.agent=p(f),!0},s.defaultProxyHeaderWhiteList=a,s.defaultProxyHeaderExclusiveList=o,t.Tunnel=s},function(e,t,r){"use strict";r(98);var n,i=r(237),a=r(39),o=r(50),s=r(20),c=r(22),u=r(1),l=r(23).Buffer;function h(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||a.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",(function(e,r,n){for(var i=0,a=t.requests.length;i<a;++i){var o=t.requests[i];if(o.host===r&&o.port===n)return t.requests.splice(i,1),void o.request.onSocket(e)}e.destroy(),t.removeSocket(e)}))}function p(e,t){var r=this;h.prototype.createSocket.call(r,e,(function(n){var a=i.connect(0,f({},r.options,{servername:e.host,socket:n}));r.sockets[r.sockets.indexOf(n)]=a,t(a)}))}function f(e){for(var t=1,r=arguments.length;t<r;++t){var n=arguments[t];if("object"==typeof n)for(var i=Object.keys(n),a=0,o=i.length;a<o;++a){var s=i[a];void 0!==n[s]&&(e[s]=n[s])}}return e}t.httpOverHttp=function(e){var t=new h(e);return t.request=a.request,t},t.httpsOverHttp=function(e){var t=new h(e);return t.request=a.request,t.createSocket=p,t.defaultPort=443,t},t.httpOverHttps=function(e){var t=new h(e);return t.request=o.request,t},t.httpsOverHttps=function(e){var t=new h(e);return t.request=o.request,t.createSocket=p,t.defaultPort=443,t},u.inherits(h,s.EventEmitter),h.prototype.addRequest=function(e,t){var r=this;"string"==typeof t&&(t={host:t,port:arguments[2],path:arguments[3]}),r.sockets.length>=this.maxSockets?r.requests.push({host:t.host,port:t.port,request:e}):r.createConnection({host:t.host,port:t.port,request:e})},h.prototype.createConnection=function(e){var t=this;t.createSocket(e,(function(r){function n(){t.emit("free",r,e.host,e.port)}function i(e){t.removeSocket(r),r.removeListener("free",n),r.removeListener("close",i),r.removeListener("agentRemove",i)}r.on("free",n),r.on("close",i),r.on("agentRemove",i),e.request.onSocket(r)}))},h.prototype.createSocket=function(e,t){var r=this,i={};r.sockets.push(i);var a=f({},r.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1});a.proxyAuth&&(a.headers=a.headers||{},a.headers["Proxy-Authorization"]="Basic "+l.from(a.proxyAuth).toString("base64")),n("making CONNECT request");var o=r.request(a);function s(a,s,u){if(o.removeAllListeners(),s.removeAllListeners(),200===a.statusCode)c.equal(u.length,0),n("tunneling connection has established"),r.sockets[r.sockets.indexOf(i)]=s,t(s);else{n("tunneling socket could not be established, statusCode=%d",a.statusCode);var l=new Error("tunneling socket could not be established, statusCode="+a.statusCode);l.code="ECONNRESET",e.request.emit("error",l),r.removeSocket(i)}}o.useChunkedEncodingByDefault=!1,o.once("response",(function(e){e.upgrade=!0})),o.once("upgrade",(function(e,t,r){process.nextTick((function(){s(e,t,r)}))})),o.once("connect",s),o.once("error",(function(t){o.removeAllListeners(),n("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var a=new Error("tunneling socket could not be established, cause="+t.message);a.code="ECONNRESET",e.request.emit("error",a),r.removeSocket(i)})),o.end()},h.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},n=process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},t.debug=n},function(e,t){(function(){var t,r,n,i,a,o;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(e.exports=function(){return(t()-a)/1e6},r=process.hrtime,i=(t=function(){var e;return 1e9*(e=r())[0]+e[1]})(),o=1e9*process.uptime(),a=i-o):Date.now?(e.exports=function(){return Date.now()-n},n=Date.now()):(e.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(this)},function(e,t,r){var n=r(526);var i=/^(\w+\/)+/;function a(e){var t=(e=e.toLowerCase()).match(i);return t&&(t=t[1])?e.replace(i,t):e}e.exports=function(e){return{mimeType:a((t=e,t.substring(5,t.indexOf(";")))),data:n(e)};var t}},function(e,t){e.exports=function(e){if(!/^data\:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');var t=(e=e.replace(/\r?\n/g,"")).indexOf(",");if(-1===t||t<=4)throw new TypeError("malformed data: URI");for(var r=e.substring(5,t).split(";"),n=!1,i="US-ASCII",a=0;a<r.length;a++)"base64"==r[a]?n=!0:0==r[a].indexOf("charset=")&&(i=r[a].substring(8));var o=unescape(e.substring(t+1)),s=new Buffer(o,n?"base64":"ascii");return s.type=r[0]||"text/plain",s.charset=i,s}},function(e,t,r){"use strict";r.r(t),r.d(t,"I3SConverter",(function(){return $h})),r.d(t,"NodePages",(function(){return yl})),r.d(t,"Tiles3DConverter",(function(){return Rf})),r.d(t,"DepsInstaller",(function(){return Pf}));var n={};r.r(n),r.d(n,"filename",(function(){return Be})),r.d(n,"dirname",(function(){return Oe})),r.d(n,"join",(function(){return Re}));var i={};r.r(i),r.d(i,"readdir",(function(){return Me})),r.d(i,"stat",(function(){return Fe})),r.d(i,"readFile",(function(){return Le})),r.d(i,"readFileSync",(function(){return Ne})),r.d(i,"writeFile",(function(){return ze})),r.d(i,"writeFileSync",(function(){return Ue})),r.d(i,"open",(function(){return qe})),r.d(i,"close",(function(){return He})),r.d(i,"read",(function(){return Ge})),r.d(i,"fstat",(function(){return Ve})),r.d(i,"isSupported",(function(){return We})),r.d(i,"_readToArrayBuffer",(function(){return Ke}));var a={};r.r(a),r.d(a,"name",(function(){return Dc})),r.d(a,"preprocess",(function(){return Mc})),r.d(a,"decode",(function(){return Fc}));var o={};r.r(o),r.d(o,"name",(function(){return qc})),r.d(o,"preprocess",(function(){return Hc}));var s={};r.r(s),r.d(s,"name",(function(){return Gc})),r.d(s,"preprocess",(function(){return Vc}));var c={};r.r(c),r.d(c,"name",(function(){return Kc})),r.d(c,"preprocess",(function(){return Jc})),r.d(c,"decode",(function(){return Qc})),r.d(c,"encode",(function(){return Yc}));var u={};r.r(u),r.d(u,"name",(function(){return eu})),r.d(u,"decode",(function(){return tu})),r.d(u,"encode",(function(){return ru}));var l={};r.r(l),r.d(l,"name",(function(){return nu})),r.d(l,"decode",(function(){return iu})),r.d(l,"encode",(function(){return au}));var h={};r.r(h),r.d(h,"name",(function(){return ou})),r.d(h,"decode",(function(){return su})),r.d(h,"encode",(function(){return cu}));var p=r(0);const f=e=>"boolean"==typeof e,d=e=>"function"==typeof e,m=e=>null!==e&&"object"==typeof e,g=e=>m(e)&&e.constructor==={}.constructor,b=e=>e&&"function"==typeof e[Symbol.iterator],y=e=>e&&"function"==typeof e[Symbol.asyncIterator],v=e=>"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json,w=e=>"undefined"!=typeof Blob&&e instanceof Blob,_=e=>(e=>"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||m(e)&&d(e.tee)&&d(e.cancel)&&d(e.getReader))(e)||(e=>m(e)&&d(e.read)&&d(e.pipe)&&f(e.readable))(e);function k(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function x(e){var t;if(!e)return!1;Array.isArray(e)&&(e=e[0]);return Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions)}function E(e){var t,r;let n;return k(e,"null loader"),k(x(e),"invalid loader"),Array.isArray(e)&&(n=e[1],e=e[0],e={...e,options:{...e.options,...n}}),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(r=e)&&void 0!==r&&r.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}let A="";const S={};function j(e){for(const t in S)if(e.startsWith(t)){const r=S[t];e=e.replace(t,r)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(A).concat(e)),e}const T=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,C=/^([-\w.]+\/[-\w.+]+)/;function B(e){const t=C.exec(e);return t?t[1]:e}function O(e){const t=T.exec(e);return t?t[1]:""}const R=/\?.*/;function I(e){if(v(e)){const t=P(e.url||"");return{url:t,type:B(e.headers.get("content-type")||"")||O(t)}}return w(e)?{url:P(e.name||""),type:e.type||""}:"string"==typeof e?{url:P(e),type:O(e)}:{url:"",type:""}}function P(e){return e.replace(R,"")}async function D(e){if(v(e))return e;const t={},r=function(e){return v(e)?e.headers["content-length"]||-1:w(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}(e);r>=0&&(t["content-length"]=String(r));const{url:n,type:i}=I(e);i&&(t["content-type"]=i);const a=await async function(e){if("string"==typeof e)return"data:,".concat(e.slice(0,5));if(e instanceof Blob){const t=e.slice(0,5);return await new Promise(e=>{const r=new FileReader;r.onload=t=>{var r;return e(null==t||null===(r=t.target)||void 0===r?void 0:r.result)},r.readAsDataURL(t)})}if(e instanceof ArrayBuffer){const t=function(e){let t="";const r=new Uint8Array(e);for(let e=0;e<r.byteLength;e++)t+=String.fromCharCode(r[e]);return btoa(t)}(e.slice(0,5));return"data:base64,".concat(t)}return null}(e);a&&(t["x-first-bytes"]=a),"string"==typeof e&&(e=(new TextEncoder).encode(e));const o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function M(e){if(!e.ok){const t=await async function(e){let t="Failed to fetch resource ".concat(e.url," (").concat(e.status,"): ");try{const r=e.headers.get("Content-Type");let n=e.statusText;r.includes("application/json")&&(n+=" ".concat(await e.text())),t+=n,t=t.length>60?"".concat(t.slice(60),"..."):t}catch(e){}return t}(e);throw new Error(t)}}async function F(e,t){if("string"==typeof e){e=j(e);let r=t;return null!=t&&t.fetch&&"function"!=typeof(null==t?void 0:t.fetch)&&(r=t.fetch),await fetch(e,r)}return await D(e)}const L=new(r(535).a)({id:"loaders.gl"});class N{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const z={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Object(p.a)(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},U={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function q(){globalThis.loaders=globalThis.loaders||{};const{loaders:e}=globalThis;return e._state=e._state||{},e._state}const H=()=>{const e=q();return e.globalOptions=e.globalOptions||{...z},e.globalOptions};function G(e,t,r,n){return r=r||[],function(e,t){W(e,null,z,U,t);for(const r of t){const n=e&&e[r.id]||{},i=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};W(n,r.id,i,a,t)}}(e,r=Array.isArray(r)?r:[r]),J(t,e,n)}function V(e,t){const r=H(),n=e||r;return"function"==typeof n.fetch?n.fetch:m(n.fetch)?e=>F(e,n):null!=t&&t.fetch?null==t?void 0:t.fetch:F}function W(e,t,r,n,i){const a=t||"Top level",o=t?"".concat(t,"."):"";for(const s in e){const c=!t&&m(e[s]),u="baseUri"===s&&!t,l="workerUrl"===s&&t;if(!(s in r)&&!u&&!l)if(s in n)L.warn("".concat(a," loader option '").concat(o).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!c){const e=K(s,i);L.warn("".concat(a," loader option '").concat(o).concat(s,"' not recognized. ").concat(e))()}}}function K(e,t){const r=e.toLowerCase();let n="";for(const i of t)for(const t in i.options){if(e===t)return"Did you mean '".concat(i.id,".").concat(t,"'?");const a=t.toLowerCase();(r.startsWith(a)||a.startsWith(r))&&(n=n||"Did you mean '".concat(i.id,".").concat(t,"'?"))}return n}function J(e,t,r){const n={...e.options||{}};return function(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}(n,r),null===n.log&&(n.log=new N),Q(n,H()),Q(n,t),n}function Q(e,t){for(const r in t)if(r in t){const n=t[r];g(n)&&g(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function Y(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}const X={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Z=X.global||X.self||X.window||{},$="object"!=typeof process||"[object process]"!==String(process)||process.browser,ee="function"==typeof importScripts,te="undefined"!=typeof window&&void 0!==window.orientation,re="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),ne=(re&&parseFloat(re[1]),new Map);function ie(e){Y(e.source&&!e.url||!e.source&&e.url);let t=ne.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return ae((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),ne.set(e.url,t)),e.source&&(t=ae(e.source),ne.set(e.source,t))),Y(t),t}function ae(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function oe(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}const se=()=>{};class ce{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Object(p.a)(this,"name",void 0),Object(p.a)(this,"source",void 0),Object(p.a)(this,"url",void 0),Object(p.a)(this,"terminated",!1),Object(p.a)(this,"worker",void 0),Object(p.a)(this,"onMessage",void 0),Object(p.a)(this,"onError",void 0),Object(p.a)(this,"_loadableURL","");const{name:t,source:r,url:n}=e;Y(r||n),this.name=t,this.source=r,this.url=n,this.onMessage=se,this.onError=e=>console.log(e),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=se,this.onError=se,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||function e(t,r=!0,n){const i=n||new Set;if(t){if(oe(t))i.add(t);else if(oe(t.buffer))i.add(t.buffer);else if(ArrayBuffer.isView(t));else if(r&&"object"==typeof t)for(const n in t)e(t[n],r,i)}else;return void 0===n?Array.from(i):[]}(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}_createBrowserWorker(){this._loadableURL=ie({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=e=>{e.data?this.onMessage(e.data):this.onError(new Error("No data received"))},e.onerror=e=>{this.onError(this._getErrorFromErrorEvent(e)),this.terminated=!0},e.onmessageerror=e=>console.error(e),e}}class ue{constructor(e,t){Object(p.a)(this,"name",void 0),Object(p.a)(this,"workerThread",void 0),Object(p.a)(this,"isRunning",void 0),Object(p.a)(this,"result",void 0),Object(p.a)(this,"_resolve",void 0),Object(p.a)(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((e,t)=>{this._resolve=e,this._reject=t})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Y(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Y(this.isRunning),this.isRunning=!1,this._reject(e)}}class le{constructor(e){Object(p.a)(this,"name","unnamed"),Object(p.a)(this,"source",void 0),Object(p.a)(this,"url",void 0),Object(p.a)(this,"maxConcurrency",1),Object(p.a)(this,"maxMobileConcurrency",1),Object(p.a)(this,"onDebug",()=>{}),Object(p.a)(this,"reuseWorkers",!0),Object(p.a)(this,"props",{}),Object(p.a)(this,"jobQueue",[]),Object(p.a)(this,"idleQueue",[]),Object(p.a)(this,"count",0),Object(p.a)(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}async startJob(e,t=((e,t,r)=>e.done(r)),r=((e,t)=>e.error(t))){const n=new Promise(n=>(this.jobQueue.push({name:e,onMessage:t,onError:r,onStart:n}),this));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const r=new ue(t.name,e);e.onMessage=e=>t.onMessage(r,e.type,e.payload),e.onError=e=>t.onError(r,e),t.onStart(r);try{await r.result}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new ce({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return te?this.maxMobileConcurrency:this.maxConcurrency}}const he={maxConcurrency:3,maxMobileConcurrency:1,onDebug:()=>{},reuseWorkers:!0};class pe{static isSupported(){return ce.isSupported()}static getWorkerFarm(e={}){return pe._workerFarm=pe._workerFarm||new pe({}),pe._workerFarm.setProps(e),pe._workerFarm}constructor(e){Object(p.a)(this,"props",void 0),Object(p.a)(this,"workerPools",new Map),this.props={...he},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props={...this.props,...e};for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:r,url:n}=e;let i=this.workerPools.get(t);return i||(i=new le({name:t,source:r,url:n}),i.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,i)),i}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}Object(p.a)(pe,"_workerFarm",void 0);async function fe(e,t,r,n,i){const a=e.id,o=function(e,t={}){const r=t[e.id]||{},n="".concat(e.id,"-worker.js");let i=r.workerUrl;if(i||"compression"!==e.id||(i=t.workerUrl),"test"===t._workerType&&(i="modules/".concat(e.module,"/dist/").concat(n)),!i){let t=e.version;"latest"===t&&(t="latest");const r=t?"@".concat(t):"";i="https://unpkg.com/@loaders.gl/".concat(e.module).concat(r,"/dist/").concat(n)}return Y(i),i}(e,r),s=pe.getWorkerFarm(r).getWorkerPool({name:a,url:o});r=JSON.parse(JSON.stringify(r));const c=await s.startJob("process-on-worker",de.bind(null,i));c.postMessage("process",{input:t,options:r});const u=await c.result;return await u.result}async function de(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":const{id:i,input:a,options:o}=n;try{const r=await e(a,o);t.postMessage("done",{id:i,result:r})}catch(e){const r=e instanceof Error?e.message:"unknown error";t.postMessage("error",{id:i,error:r})}break;default:console.warn("parse-with-worker unknown message ".concat(r))}}function me(e){if(ArrayBuffer.isView(e)&&(e=e.buffer),"undefined"!=typeof Buffer&&e instanceof ArrayBuffer){const t=new Buffer(e.byteLength),r=new Uint8Array(e);for(let e=0;e<t.length;++e)t[e]=r[e];return t}return k(!1)}function ge(e){return e&&"object"==typeof e&&e.isBuffer}function be(e){return me?me(e):e}function ye(e){if(ge(e))return function(e){if(ge(e)){return new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer}return e}(e);if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("string"==typeof e){const t=e;return(new TextEncoder).encode(t).buffer}if(e&&"object"==typeof e&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function ve(...e){const t=e.map(e=>e instanceof ArrayBuffer?new Uint8Array(e):e),r=t.reduce((e,t)=>e+t.byteLength,0),n=new Uint8Array(r);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n.buffer}function we(...e){const t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');const n=new r(t.reduce((e,t)=>e+t.length,0));let i=0;for(const e of t)n.set(e,i),i+=e.length;return n}function _e(e,t,r){const n=void 0!==r?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}async function ke(e){const t=[];for await(const r of e)t.push(r);return ve(...t)}const xe=262144;"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof global&&global,"undefined"!=typeof document&&document;const Ee=Boolean("object"!=typeof process||"[object process]"!==String(process)||process.browser),Ae="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);Ae&&parseFloat(Ae[1]);function Se(e,t){return Ee?async function*(e,t){const r=e.getReader();let n;try{for(;;){const e=n||r.read();null!=t&&t._streamReadAhead&&(n=r.read());const{done:i,value:a}=await e;if(i)return;yield ye(a)}}catch(e){r.releaseLock()}}(e,t):async function*(e,t){for await(const t of e)yield ye(t)}(e)}function je(e,t){if("string"==typeof e)return function*(e,t){const r=(null==t?void 0:t.chunkSize)||262144;let n=0;const i=new TextEncoder;for(;n<e.length;){const t=Math.min(e.length-n,r),a=e.slice(n,n+t);n+=t,yield i.encode(a)}}(e,t);if(e instanceof ArrayBuffer)return function*(e,t={}){const{chunkSize:r=xe}=t;let n=0;for(;n<e.byteLength;){const t=Math.min(e.byteLength-n,r),i=new ArrayBuffer(t),a=new Uint8Array(e,n,t);new Uint8Array(i).set(a),n+=t,yield i}}(e,t);if(w(e))return async function*(e,t){const r=(null==t?void 0:t.chunkSize)||1048576;let n=0;for(;n<e.size;){const t=n+r,i=await e.slice(n,t).arrayBuffer();n=t,yield i}}(e,t);if(_(e))return Se(e,t);if(v(e)){return Se(e.body,t)}throw new Error("makeIterator")}const Te="Cannot convert supplied data type";async function Ce(e,t,r){const n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if("string"==typeof e||n)return function(e,t,r){if(t.text&&"string"==typeof e)return e;var n;if((n=e)&&"object"==typeof n&&n.isBuffer&&(e=e.buffer),e instanceof ArrayBuffer){const r=e;if(t.text&&!t.binary){return new TextDecoder("utf8").decode(r)}return r}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary){return new TextDecoder("utf8").decode(e)}let r=e.buffer;const n=e.byteLength||e.length;return 0===e.byteOffset&&n===r.byteLength||(r=r.slice(e.byteOffset,e.byteOffset+n)),r}throw new Error(Te)}(e,t);if(w(e)&&(e=await D(e)),v(e)){const r=e;return await M(r),t.binary?await r.arrayBuffer():await r.text()}if(_(e)&&(e=je(e,r)),b(e)||y(e))return ke(e);throw new Error(Te)}function Be(e){const t=e&&e.lastIndexOf("/");return t>=0?e.substr(t+1):""}function Oe(e){const t=e&&e.lastIndexOf("/");return t>=0?e.substr(0,t):""}function Re(...e){return(e=e.map((t,r)=>(r&&(t=t.replace(new RegExp("^".concat("/")),"")),r!==e.length-1&&(t=t.replace(new RegExp("".concat("/","$")),"")),t))).join("/")}var Ie=r(3),Pe=r.n(Ie);const De=r(1).promisify;let Me,Fe,Le,Ne,ze,Ue,qe,He,Ge,Ve,We=Boolean(Pe.a);try{Me=De(Pe.a.readdir),Fe=De(Pe.a.stat),Le=De(Pe.a.readFile),Ne=Pe.a.readFileSync,ze=De(Pe.a.writeFile),Ue=Pe.a.writeFileSync,qe=De(Pe.a.open),He=De(Pe.a.close),Ge=De(Pe.a.read),Ve=De(Pe.a.fstat),We=Boolean(Pe.a)}catch{}async function Ke(e,t,r){const n=Buffer.alloc(r),{bytesRead:i}=await Ge(e,n,0,r,t);if(i!==r)throw new Error("fs.read failed");return function(e){if(Buffer.isBuffer(e)){return new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer}return e}(n)}function Je(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const t="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}const Qe="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source";Je();class Ye{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(p.a)(this,"storage",void 0),Object(p.a)(this,"id",void 0),Object(p.a)(this,"config",{}),this.storage=function(e){try{const t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}(r),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function Xe(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600;const i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));const a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}let Ze;function $e(e){return"string"==typeof e?Ze[e.toUpperCase()]||Ze.WHITE:e}function et(e,t){if(!e)throw new Error(t||"Assertion failed")}!function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(Ze||(Ze={}));const tt={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},rt=(globalThis,tt.window||tt.self||tt.global),nt=tt.process||{};console;function it(){let e;var t,r;if(Je&&"performance"in rt)e=null==rt||null===(t=rt.performance)||void 0===t||null===(r=t.now)||void 0===r?void 0:r.call(t);else if("hrtime"in nt){var n;const t=null==nt||null===(n=nt.hrtime)||void 0===n?void 0:n.call(nt);e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}const at={debug:Je&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},ot={enabled:!0,level:0};function st(){}const ct={},ut={once:!0};class lt{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};Object(p.a)(this,"id",void 0),Object(p.a)(this,"VERSION",Qe),Object(p.a)(this,"_startTs",it()),Object(p.a)(this,"_deltaTs",it()),Object(p.a)(this,"_storage",void 0),Object(p.a)(this,"userData",{}),Object(p.a)(this,"LOG_THROTTLE_TIMEOUT",0),this.id=e,this._storage=new Ye("__probe-".concat(this.id,"__"),ot),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r);for(const r of n)"function"==typeof e[r]&&(t.find(e=>r===e)||(e[r]=e[r].bind(e)))}(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((it()-this._startTs).toPrecision(10))}getDelta(){return Number((it()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}setLevel(e){return this._storage.updateConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.updateConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){et(e,t)}warn(e){return this._getLogFunction(0,e,at.warn,arguments,ut)}error(e){return this._getLogFunction(0,e,at.error,arguments)}deprecated(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}probe(e,t){return this._getLogFunction(e,t,at.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,at.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return this._getLogFunction(e,t,at.debug||at.info,arguments,ut)}table(e,t,r){return t?this._getLogFunction(e,t,console.table||st,r&&[r],{tag:ft(t)}):st}image(e){let{logLevel:t,priority:n,image:i,message:a="",scale:o=1}=e;return this._shouldLog(t||n)?Je?function(e){let{image:t,message:r="",scale:n=1}=e;if("string"==typeof t){const e=new Image;return e.onload=()=>{const t=Xe(e,r,n);console.log(...t)},e.src=t,st}const i=t.nodeName||"";if("img"===i.toLowerCase())return console.log(...Xe(t,r,n)),st;if("canvas"===i.toLowerCase()){const e=new Image;return e.onload=()=>console.log(...Xe(e,r,n)),e.src=t.toDataURL(),st}return st}({image:i,message:a,scale:o}):function(e){let{image:t,message:n="",scale:i=1}=e,a=null;try{a=r(!function(){var e=new Error("Cannot find module 'asciify-image'");throw e.code="MODULE_NOT_FOUND",e}())}catch(e){}if(a)return()=>a(t,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then(e=>console.log(e));return st}({image:i,message:a,scale:o}):st}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||st)}group(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const n=pt({logLevel:e,message:t,opts:r}),{collapsed:i}=r;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||st)}withGroup(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=ht(e)}_getLogFunction(e,t,r,n,i){if(this._shouldLog(e)){i=pt({logLevel:e,message:t,args:n,opts:i}),et(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=it();const a=i.tag||i.message;if(i.once){if(ct[a])return st;ct[a]=it()}return t=function(e,t,r){if("string"==typeof t){const o=r.time?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}(function(e){let t;return t=e<10?"".concat(e.toFixed(2),"ms"):e<100?"".concat(e.toFixed(1),"ms"):e<1e3?"".concat(e.toFixed(0),"ms"):"".concat((e/1e3).toFixed(2),"s"),t}(r.total)):"";t=r.time?"".concat(e,": ").concat(o," ").concat(t):"".concat(e,": ").concat(t),n=t,i=r.color,a=r.background,Je||"string"!=typeof n||(i&&(i=$e(i),n="[".concat(i,"m").concat(n,"")),a&&(i=$e(a),n="[".concat(a+10,"m").concat(n,""))),t=n}var n,i,a;return t}(this.id,i.message,i),r.bind(console,t,...i.args)}return st}}function ht(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return et(Number.isFinite(t)&&t>=0),t}function pt(e){const{logLevel:t,message:r}=e;e.logLevel=ht(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());const i=typeof e.message;return et("string"===i||"object"===i),Object.assign(e,{args:n},e.opts)}function ft(e){for(const t in e)for(const r in e[t])return r||"untitled";return"empty"}Object(p.a)(lt,"VERSION",Qe);const dt=new lt({id:"loaders.gl"}),mt=()=>{const e=q();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};const gt=/\.([^.]+)$/;function bt(e,t=[],r,n){if(!yt(e))return null;if(t&&!Array.isArray(t))return E(t);let i=[];t&&(i=i.concat(t)),null!=r&&r.ignoreRegisteredLoaders||i.push(...mt()),function(e){for(const t of e)E(t)}(i);const a=function(e,t,r,n){const{url:i,type:a}=I(e),o=i||(null==n?void 0:n.url);let s=null,c="";null!=r&&r.mimeType&&(s=wt(t,null==r?void 0:r.mimeType),c="match forced by supplied MIME type ".concat(null==r?void 0:r.mimeType));var u;s=s||function(e,t){const r=t&&gt.exec(t),n=r&&r[1];return n?function(e,t){t=t.toLowerCase();for(const r of e)for(const e of r.extensions)if(e.toLowerCase()===t)return r;return null}(e,n):null}(t,o),c=c||(s?"matched url ".concat(o):""),s=s||wt(t,a),c=c||(s?"matched MIME type ".concat(a):""),s=s||function(e,t){if(!t)return null;for(const r of e)if("string"==typeof t){if(_t(t,r))return r}else if(ArrayBuffer.isView(t)){if(kt(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer){if(kt(t,0,r))return r}return null}(t,e),c=c||(s?"matched initial data ".concat(xt(e)):""),s=s||wt(t,null==r?void 0:r.fallbackMimeType),c=c||(s?"matched fallback MIME type ".concat(a):""),c&&dt.log(1,"selectLoader selected ".concat(null===(u=s)||void 0===u?void 0:u.name,": ").concat(c,"."));return s}(e,i,r,n);if(!(a||null!=r&&r.nothrow))throw new Error(vt(e));return a}function yt(e){return!(e instanceof Response&&204===e.status)}function vt(e){const{url:t,type:r}=I(e);let i="No valid loader found (";i+=t?"".concat(n.filename(t),", "):"no url provided, ",i+="MIME type: ".concat(r?'"'.concat(r,'"'):"not provided",", ");const a=e?xt(e):"";return i+=a?' first bytes: "'.concat(a,'"'):"first bytes: not available",i+=")",i}function wt(e,t){for(const r of e){if(r.mimeTypes&&r.mimeTypes.includes(t))return r;if(t==="application/x.".concat(r.id))return r}return null}function _t(e,t){if(t.testText)return t.testText(e);return(Array.isArray(t.tests)?t.tests:[t.tests]).some(t=>e.startsWith(t))}function kt(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(n=>function(e,t,r,n){if(n instanceof ArrayBuffer)return function(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;const n=new Uint8Array(e),i=new Uint8Array(t);for(let e=0;e<n.length;++e)if(n[e]!==i[e])return!1;return!0}(n,e,n.byteLength);switch(typeof n){case"function":return n(e,r);case"string":const i=Et(e,t,n.length);return n===i;default:return!1}}(e,t,r,n))}function xt(e,t=5){if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return Et(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){return Et(e,0,t)}return""}function Et(e,t,r){if(e.byteLength<t+r)return"";const n=new DataView(e);let i="";for(let e=0;e<r;e++)i+=String.fromCharCode(n.getUint8(t+e));return i}async function At(e,t,r,n){Y(!n||"object"==typeof n),!t||Array.isArray(t)||x(t)||(n=void 0,r=t,t=void 0),e=await e,r=r||{};const{url:i}=I(e),a=function(e,t){if(!t&&e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){const e=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...e]:e}return r&&r.length?r:null}(t,n),o=await async function(e,t=[],r,n){if(!yt(e))return null;let i=bt(e,t,{...r,nothrow:!0},n);if(i)return i;if(w(e)&&(i=bt(e=await e.slice(0,10).arrayBuffer(),t,r,n)),!(i||null!=r&&r.nothrow))throw new Error(vt(e));return i}(e,a,r);return o?(n=function(e,t,r=null){if(r)return r;const n={fetch:V(t,e),...e};return Array.isArray(n.loaders)||(n.loaders=null),n}({url:i,parse:At,loaders:a},r=G(r,o,a,i),n),await async function(e,t,r,n){if(function(e,t="3.1.7"){Y(e,"no worker provided");const r=e.version}(e),t=await Ce(t,e,r),e.parseTextSync&&"string"==typeof t)return r.dataType="text",e.parseTextSync(t,r,n,e);if(function(e,t){return!!pe.isSupported()&&(e.worker&&(null==t?void 0:t.worker))}(e,r))return await fe(e,t,r,0,At);if(e.parseText&&"string"==typeof t)return await e.parseText(t,r,n,e);if(e.parse)return await e.parse(t,r,n,e);throw Y(!e.parseSync),new Error("".concat(e.id," loader - no parser found and worker is disabled"))}(o,e,r,n)):null}async function St(e,t,r,n){Array.isArray(t)||x(t)||(void 0,r=t,t=void 0);const i=V(r);let a=e;return"string"==typeof e&&(a=await i(e)),w(e)&&(a=await i(e)),await At(a,t,r)}async function jt(e,t,r){if(t.encode)return await t.encode(e,r);if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeText)return(new TextEncoder).encode(await t.encodeText(e,r));if(t.encodeInBatches){const n=function(e,t,r){if(t.encodeInBatches){const n=function(e){return[{table:e,start:0,end:e.length}]}(e);return t.encodeInBatches(n,r)}throw new Error("Writer could not encode data in batches")}(e,t,r),i=[];for await(const e of n)i.push(e);return ve(...i)}if(!Ee&&t.encodeURLtoURL){const n=Ct("input");await async function(e,t,r){e=j(e),Ee||await i.writeFile(e,be(t),{flag:"w"}),k(!1)}(n,e);const a=Ct("output"),o=await async function(e,t,r,n){if(e=j(e),t=j(t),Ee||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,n)}(n,a,t,r);return(await F(o)).arrayBuffer()}throw new Error("Writer could not encode data")}function Tt(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);throw new Error("Writer could not synchronously encode data")}function Ct(e){return"/tmp/".concat(e)}function Bt(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}const Ot=1/Math.PI*180,Rt=1/180*Math.PI,It={};function Pt(e,{precision:t=It.precision||4}={}){return e=function(e){return Math.round(e/It.EPSILON)*It.EPSILON}(e),"".concat(parseFloat(e.toPrecision(t)))}function Dt(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Mt(e,t,r){if(Dt(e)){r=r||((n=e).clone?n.clone():new Array(n.length));for(let n=0;n<r.length&&n<e.length;++n)r[n]=t(e[n],n,r);return r}var n;return t(e)}function Ft(e){return function(e,t){return Mt(e,e=>e*Rt,t)}(e)}function Lt(e){return Nt(e)}function Nt(e,t){return Mt(e,e=>e*Ot,t)}function zt(e,t,r){return Mt(e,e=>Math.max(t,Math.min(r,e)))}function Ut(e,t,r){const n=It.EPSILON;r&&(It.EPSILON=r);try{if(e===t)return!0;if(Dt(e)&&Dt(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!Ut(e[r],t[r]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):!(!Number.isFinite(e)||!Number.isFinite(t))&&Math.abs(e-t)<=It.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{It.EPSILON=n}}function qt(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function Ht(e,t,r=""){if(It.debug&&!function(e,t){if(e.length!==t)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}It.EPSILON=1e-12,It.debug=!1,It.precision=4,It.printTypes=!1,It.printDegrees=!1,It.printRowMajor=!0;const Gt={};function Vt(e,t){Gt[e]||(Gt[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}class Wt extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array)){get ELEMENTS(){return Bt(!1),0}clone(){return(new this.constructor).copy(this)}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}fromArray(e,t=0){for(let r=0;r<this.ELEMENTS;++r)this[r]=e[r+t];return this.check()}to(e){return e===this?this:Dt(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toArray(e=[],t=0){for(let r=0;r<this.ELEMENTS;++r)e[t+r]=this[r];return e}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(It)}formatString(e){let t="";for(let r=0;r<this.ELEMENTS;++r)t+=(r>0?", ":"")+Pt(this[r],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!Ut(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,r){void 0===r&&(r=t,t=e,e=this);for(let n=0;n<this.ELEMENTS;++n){const i=e[n];this[n]=i+r*(t[n]-i)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e[r]),t[r]);return this.check()}add(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]+=t[e];return this.check()}subtract(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]-=t[e];return this.check()}scale(e){if(Array.isArray(e))return this.multiply(e);for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}sub(e){return this.subtract(e)}setScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}addScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}divideScalar(e){return this.scale(1/e)}clampScalar(e,t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e),t);return this.check()}multiplyByScalar(e){return this.scale(e)}get elements(){return this}check(){if(It.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}}class Kt extends Wt{get ELEMENTS(){return Bt(!1),0}get RANK(){return Bt(!1),0}toString(){let e="[";if(It.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let r=0;r<this.RANK;++r)e+=" ".concat(this[r*this.RANK+t])}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=" ".concat(this[t])}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,r){return this[t*this.RANK+e]=qt(r),this}getColumn(e,t=new Array(this.RANK).fill(-0)){const r=e*this.RANK;for(let e=0;e<this.RANK;++e)t[e]=this[r+e];return t}setColumn(e,t){const r=e*this.RANK;for(let e=0;e<this.RANK;++e)this[r+e]=t[e];return this}}function Jt(e,t,r){const n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}function Qt(e,t,r){const n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}function Yt(e,t,r){const n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*a,e[1]=r[1]*n+r[4]*i+r[7]*a,e[2]=r[2]*n+r[5]*i+r[8]*a,e[3]=t[3],e}var Xt=1e-6,Zt="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function $t(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],u=t[6],l=t[7],h=t[8],p=t[9],f=t[10],d=t[11],m=t[12],g=t[13],b=t[14],y=t[15],v=r[0],w=r[1],_=r[2],k=r[3];return e[0]=v*n+w*s+_*h+k*m,e[1]=v*i+w*c+_*p+k*g,e[2]=v*a+w*u+_*f+k*b,e[3]=v*o+w*l+_*d+k*y,v=r[4],w=r[5],_=r[6],k=r[7],e[4]=v*n+w*s+_*h+k*m,e[5]=v*i+w*c+_*p+k*g,e[6]=v*a+w*u+_*f+k*b,e[7]=v*o+w*l+_*d+k*y,v=r[8],w=r[9],_=r[10],k=r[11],e[8]=v*n+w*s+_*h+k*m,e[9]=v*i+w*c+_*p+k*g,e[10]=v*a+w*u+_*f+k*b,e[11]=v*o+w*l+_*d+k*y,v=r[12],w=r[13],_=r[14],k=r[15],e[12]=v*n+w*s+_*h+k*m,e[13]=v*i+w*c+_*p+k*g,e[14]=v*a+w*u+_*f+k*b,e[15]=v*o+w*l+_*d+k*y,e}function er(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function tr(e,t){var r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],c=t[8],u=t[9],l=t[10];return e[0]=Math.hypot(r,n,i),e[1]=Math.hypot(a,o,s),e[2]=Math.hypot(c,u,l),e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function rr(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function nr(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var ir,ar;ir=new Zt(2),Zt!=Float32Array&&(ir[0]=0,ir[1]=0),ar=ir;function or(){var e=new Zt(3);return Zt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function sr(e){var t=e[0],r=e[1],n=e[2];return Math.hypot(t,r,n)}function cr(e,t,r){var n=new Zt(3);return n[0]=e,n[1]=t,n[2]=r,n}function ur(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function lr(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],c=r[2];return e[0]=i*c-a*s,e[1]=a*o-n*c,e[2]=n*s-i*o,e}function hr(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}function pr(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}function fr(e,t,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],c=t[1],u=t[2],l=i*u-a*c,h=a*s-n*u,p=n*c-i*s,f=i*p-a*h,d=a*l-n*p,m=n*h-i*l,g=2*o;return l*=g,h*=g,p*=g,f*=2,d*=2,m*=2,e[0]=s+l+f,e[1]=c+h+d,e[2]=u+p+m,e}var dr=sr;!function(){var e=or()}();function mr(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.hypot(t,r,n,i)}function gr(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}!function(){var e=function(){var e=new Zt(4);return Zt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}()}();const br=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),yr=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),vr=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),wr={};class _r extends Kt{static get IDENTITY(){return wr.IDENTITY=wr.IDENTITY||Object.freeze(new _r(br)),wr.IDENTITY}static get ZERO(){return wr.ZERO=wr.ZERO||Object.freeze(new _r(yr)),wr.ZERO}get INDICES(){return vr}get ELEMENTS(){return 16}get RANK(){return 4}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,r,n,i,a,o,s,c,u,l,h,p,f,d,m){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=c,this[9]=u,this[10]=l,this[11]=h,this[12]=p,this[13]=f,this[14]=d,this[15]=m,this.check()}setRowMajor(e,t,r,n,i,a,o,s,c,u,l,h,p,f,d,m){return this[0]=e,this[1]=i,this[2]=c,this[3]=p,this[4]=t,this[5]=a,this[6]=u,this[7]=f,this[8]=r,this[9]=o,this[10]=l,this[11]=d,this[12]=n,this[13]=s,this[14]=h,this[15]=m,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(br)}fromQuaternion(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,c=i+i,u=r*o,l=n*o,h=n*s,p=i*o,f=i*s,d=i*c,m=a*o,g=a*s,b=a*c;e[0]=1-h-d,e[1]=l+b,e[2]=p-g,e[3]=0,e[4]=l-b,e[5]=1-u-d,e[6]=f+m,e[7]=0,e[8]=p+g,e[9]=f-m,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(this,e),this.check()}frustum({left:e,right:t,bottom:r,top:n,near:i,far:a}){return a===1/0?_r._computeInfinitePerspectiveOffCenter(this,e,t,r,n,i):function(e,t,r,n,i,a,o){var s=1/(r-t),c=1/(i-n),u=1/(a-o);e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*c,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*c,e[10]=(o+a)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*u,e[15]=0}(this,e,t,r,n,i,a),this.check()}static _computeInfinitePerspectiveOffCenter(e,t,r,n,i,a){const o=2*a/(r-t),s=2*a/(i-n),c=(r+t)/(r-t),u=(i+n)/(i-n),l=-2*a;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=c,e[9]=u,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=l,e[15]=0,e}lookAt(e,t,r){return 1===arguments.length&&({eye:e,center:t,up:r}=e),function(e,t,r,n){var i,a,o,s,c,u,l,h,p,f,d=t[0],m=t[1],g=t[2],b=n[0],y=n[1],v=n[2],w=r[0],_=r[1],k=r[2];Math.abs(d-w)<Xt&&Math.abs(m-_)<Xt&&Math.abs(g-k)<Xt?function(e){e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(e):(l=d-w,h=m-_,p=g-k,i=y*(p*=f=1/Math.hypot(l,h,p))-v*(h*=f),a=v*(l*=f)-b*p,o=b*h-y*l,(f=Math.hypot(i,a,o))?(i*=f=1/f,a*=f,o*=f):(i=0,a=0,o=0),s=h*o-p*a,c=p*i-l*o,u=l*a-h*i,(f=Math.hypot(s,c,u))?(s*=f=1/f,c*=f,u*=f):(s=0,c=0,u=0),e[0]=i,e[1]=s,e[2]=l,e[3]=0,e[4]=a,e[5]=c,e[6]=h,e[7]=0,e[8]=o,e[9]=u,e[10]=p,e[11]=0,e[12]=-(i*d+a*m+o*g),e[13]=-(s*d+c*m+u*g),e[14]=-(l*d+h*m+p*g),e[15]=1)}(this,e,t=t||[0,0,0],r=r||[0,1,0]),this.check()}ortho({left:e,right:t,bottom:r,top:n,near:i=.1,far:a=500}){return function(e,t,r,n,i,a,o){var s=1/(t-r),c=1/(n-i),u=1/(a-o);e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*c,e[14]=(o+a)*u,e[15]=1}(this,e,t,r,n,i,a),this.check()}orthographic({fovy:e=45*Math.PI/180,aspect:t=1,focalDistance:r=1,near:n=.1,far:i=500}){if(e>2*Math.PI)throw Error("radians");const a=e/2,o=r*Math.tan(a),s=o*t;return(new _r).ortho({left:-s,right:s,bottom:-o,top:o,near:n,far:i})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:r=1,near:n=.1,far:i=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return function(e,t,r,n,i){var a,o=1/Math.tan(t/2);e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n)}(this,e,r,n,i),this.check()}determinant(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],u=e[8],l=e[9],h=e[10],p=e[11],f=e[12],d=e[13],m=e[14],g=e[15],(t*o-r*a)*(h*g-p*m)-(t*s-n*a)*(l*g-p*d)+(t*c-i*a)*(l*m-h*d)+(r*s-n*o)*(u*g-p*f)-(r*c-i*o)*(u*m-h*f)+(n*c-i*s)*(u*d-l*f);var e,t,r,n,i,a,o,s,c,u,l,h,p,f,d,m,g}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const r=this.getScale(t||[-0,-0,-0]),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=0,e[4]=this[4]*n,e[5]=this[5]*i,e[6]=this[6]*a,e[7]=0,e[8]=this[8]*n,e[9]=this[9]*i,e[10]=this[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const r=this.getScale(t||[-0,-0,-0]),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=this[4]*n,e[4]=this[5]*i,e[5]=this[6]*a,e[6]=this[8]*n,e[7]=this[9]*i,e[8]=this[10]*a,e}transpose(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}invert(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],u=t[7],l=t[8],h=t[9],p=t[10],f=t[11],d=t[12],m=t[13],g=t[14],b=t[15],y=r*s-n*o,v=r*c-i*o,w=r*u-a*o,_=n*c-i*s,k=n*u-a*s,x=i*u-a*c,E=l*m-h*d,A=l*g-p*d,S=l*b-f*d,j=h*g-p*m,T=h*b-f*m,C=p*b-f*g,B=y*C-v*T+w*j+_*S-k*A+x*E;B&&(B=1/B,e[0]=(s*C-c*T+u*j)*B,e[1]=(i*T-n*C-a*j)*B,e[2]=(m*x-g*k+b*_)*B,e[3]=(p*k-h*x-f*_)*B,e[4]=(c*S-o*C-u*A)*B,e[5]=(r*C-i*S+a*A)*B,e[6]=(g*w-d*x-b*v)*B,e[7]=(l*x-p*w+f*v)*B,e[8]=(o*T-s*S+u*E)*B,e[9]=(n*S-r*T-a*E)*B,e[10]=(d*k-m*w+b*y)*B,e[11]=(h*w-l*k-f*y)*B,e[12]=(s*A-o*j-c*E)*B,e[13]=(r*j-n*A+i*E)*B,e[14]=(m*v-d*_-g*y)*B,e[15]=(l*_-h*v+p*y)*B)}(this,this),this.check()}multiplyLeft(e){return $t(this,e,this),this.check()}multiplyRight(e){return $t(this,this,e),this.check()}rotateX(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],c=t[7],u=t[8],l=t[9],h=t[10],p=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+u*n,e[5]=o*i+l*n,e[6]=s*i+h*n,e[7]=c*i+p*n,e[8]=u*i-a*n,e[9]=l*i-o*n,e[10]=h*i-s*n,e[11]=p*i-c*n}(this,this,e),this.check()}rotateY(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],c=t[3],u=t[8],l=t[9],h=t[10],p=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-u*n,e[1]=o*i-l*n,e[2]=s*i-h*n,e[3]=c*i-p*n,e[8]=a*n+u*i,e[9]=o*n+l*i,e[10]=s*n+h*i,e[11]=c*n+p*i}(this,this,e),this.check()}rotateZ(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],c=t[3],u=t[4],l=t[5],h=t[6],p=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+u*n,e[1]=o*i+l*n,e[2]=s*i+h*n,e[3]=c*i+p*n,e[4]=u*i-a*n,e[5]=l*i-o*n,e[6]=h*i-s*n,e[7]=p*i-c*n}(this,this,e),this.check()}rotateXYZ([e,t,r]){return this.rotateX(e).rotateY(t).rotateZ(r)}rotateAxis(e,t){return function(e,t,r,n){var i,a,o,s,c,u,l,h,p,f,d,m,g,b,y,v,w,_,k,x,E,A,S,j,T=n[0],C=n[1],B=n[2],O=Math.hypot(T,C,B);O<Xt||(T*=O=1/O,C*=O,B*=O,i=Math.sin(r),o=1-(a=Math.cos(r)),s=t[0],c=t[1],u=t[2],l=t[3],h=t[4],p=t[5],f=t[6],d=t[7],m=t[8],g=t[9],b=t[10],y=t[11],v=T*T*o+a,w=C*T*o+B*i,_=B*T*o-C*i,k=T*C*o-B*i,x=C*C*o+a,E=B*C*o+T*i,A=T*B*o+C*i,S=C*B*o-T*i,j=B*B*o+a,e[0]=s*v+h*w+m*_,e[1]=c*v+p*w+g*_,e[2]=u*v+f*w+b*_,e[3]=l*v+d*w+y*_,e[4]=s*k+h*x+m*E,e[5]=c*k+p*x+g*E,e[6]=u*k+f*x+b*E,e[7]=l*k+d*x+y*E,e[8]=s*A+h*S+m*j,e[9]=c*A+p*S+g*j,e[10]=u*A+f*S+b*j,e[11]=l*A+d*S+y*j,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,this,e,t),this.check()}scale(e){return Array.isArray(e)?er(this,this,e):er(this,this,[e,e,e]),this.check()}translate(e){return function(e,t,r){var n,i,a,o,s,c,u,l,h,p,f,d,m=r[0],g=r[1],b=r[2];t===e?(e[12]=t[0]*m+t[4]*g+t[8]*b+t[12],e[13]=t[1]*m+t[5]*g+t[9]*b+t[13],e[14]=t[2]*m+t[6]*g+t[10]*b+t[14],e[15]=t[3]*m+t[7]*g+t[11]*b+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],u=t[6],l=t[7],h=t[8],p=t[9],f=t[10],d=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=c,e[6]=u,e[7]=l,e[8]=h,e[9]=p,e[10]=f,e[11]=d,e[12]=n*m+s*g+h*b+t[12],e[13]=i*m+c*g+p*b+t[13],e[14]=a*m+u*g+f*b+t[14],e[15]=o*m+l*g+d*b+t[15])}(this,this,e),this.check()}transform(e,t){return 4===e.length?(Ht(t=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){const{length:r}=e;switch(r){case 2:t=nr(t||[-0,-0],e,this);break;case 3:t=hr(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ht(t,e.length),t}transformAsVector(e,t){switch(e.length){case 2:t=Jt(t||[-0,-0],e,this);break;case 3:t=Qt(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ht(t,e.length),t}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,r){return this.identity().translate([e,t,r])}transformPoint(e,t){return Vt("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}transformVector(e,t){return Vt("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}transformDirection(e,t){return Vt("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}class kr extends Wt{get ELEMENTS(){return Bt(!1),0}copy(e){return Bt(!1),this}get x(){return this[0]}set x(e){this[0]=qt(e)}get y(){return this[1]}set y(e){this[1]=qt(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let t=0;for(let r=0;r<this.ELEMENTS;++r){const n=this[r]-e[r];t+=n*n}return qt(t)}dot(e){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*e[r];return qt(t)}normalize(){const e=this.magnitude();if(0!==e)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}multiply(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t[e];return this.check()}divide(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t[e];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Bt(e>=0&&e<this.ELEMENTS,"index is out of range"),qt(this[e])}setComponent(e,t){return Bt(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}addVectors(e,t){return this.copy(e).add(t)}subVectors(e,t){return this.copy(e).subtract(t)}multiplyVectors(e,t){return this.copy(e).multiply(t)}addScaledVector(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}const xr=[0,0,0],Er={};class Ar extends kr{static get ZERO(){return Er.ZERO=Er.ZERO||Object.freeze(new Ar(0,0,0,0))}constructor(e=0,t=0,r=0){super(-0,-0,-0),1===arguments.length&&Dt(e)?this.copy(e):(It.debug&&(qt(e),qt(t),qt(r)),this[0]=e,this[1]=t,this[2]=r)}set(e,t,r){return this[0]=e,this[1]=t,this[2]=r,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return It.debug&&(qt(e.x),qt(e.y),qt(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=qt(e)}angle(e){return r=e,n=(t=this)[0],i=t[1],a=t[2],o=r[0],s=r[1],c=r[2],u=Math.sqrt(n*n+i*i+a*a)*Math.sqrt(o*o+s*s+c*c),l=u&&ur(t,r)/u,Math.acos(Math.min(Math.max(l,-1),1));var t,r,n,i,a,o,s,c,u,l}cross(e){return lr(this,this,e),this.check()}rotateX({radians:e,origin:t=xr}){return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,t,e),this.check()}rotateY({radians:e,origin:t=xr}){return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,t,e),this.check()}rotateZ({radians:e,origin:t=xr}){return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,t,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return hr(this,this,e),this.check()}transformAsVector(e){return Qt(this,this,e),this.check()}transformByMatrix3(e){return pr(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,r){const n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2]}(this,this,e),this.check()}transformByQuaternion(e){return fr(this,this,e),this.check()}}var Sr=.1,jr=1e-12,Tr=1e-15,Cr=1e-20;Math.PI,Math.PI,Math.PI,Math.PI;Math.max(6378137,6378137,6356752.314245179);const Br=e=>e,Or=new Ar;function Rr(e,t,r=Br){return Dt(e)?(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]):"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z),t}function Ir(e,t,r=Br){return Dt(t)?(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]):"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]),t}const Pr=new Ar,Dr=new Ar,Mr=new Ar;const Fr=new Ar,Lr={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Nr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},zr={east:new Ar,north:new Ar,up:new Ar,west:new Ar,south:new Ar,down:new Ar},Ur=new Ar,qr=new Ar,Hr=new Ar;function Gr(e,t,r,n,i,a){const o=Lr[t]&&Lr[t][r];let s,c,u;Bt(o&&(!n||n===o));const l=Fr.copy(i);if(Ut(l.x,0,1e-14)&&Ut(l.y,0,1e-14)){const e=Math.sign(l.z);s=Ur.fromArray(Nr[t]),"east"!==t&&"west"!==t&&s.scale(e),c=qr.fromArray(Nr[r]),"east"!==r&&"west"!==r&&c.scale(e),u=Hr.fromArray(Nr[n]),"east"!==n&&"west"!==n&&u.scale(e)}else{const{up:i,east:a,north:o}=zr;a.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,i),o.copy(i).cross(a);const{down:h,west:p,south:f}=zr;h.copy(i).scale(-1),p.copy(a).scale(-1),f.copy(o).scale(-1),s=zr[t],c=zr[r],u=zr[n]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=c.x,a[5]=c.y,a[6]=c.z,a[7]=0,a[8]=u.x,a[9]=u.y,a[10]=u.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}const Vr=new Ar,Wr=new Ar,Kr=new Ar,Jr=new Ar,Qr=new Ar,Yr=new Ar;let Xr;class Zr{static get WGS84(){return Xr=Xr||new Zr(6378137,6378137,6356752.314245179),Xr}constructor(e=0,t=0,r=0){Bt(e>=0),Bt(t>=0),Bt(r>=0),this.radii=new Ar(e,t,r),this.radiiSquared=new Ar(e*e,t*t,r*r),this.radiiToTheFourth=new Ar(e*e*e*e,t*t*t*t,r*r*r*r),this.oneOverRadii=new Ar(0===e?0:1/e,0===t?0:1/t,0===r?0:1/r),this.oneOverRadiiSquared=new Ar(0===e?0:1/(e*e),0===t?0:1/(t*t),0===r?0:1/(r*r)),this.minimumRadius=Math.min(e,t,r),this.maximumRadius=Math.max(e,t,r),this.centerToleranceSquared=Sr,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,t=[0,0,0]){const r=Wr,n=Kr,[,,i]=e;this.geodeticSurfaceNormalCartographic(e,r),n.copy(this.radiiSquared).scale(r);const a=Math.sqrt(r.dot(n));return n.scale(1/a),r.scale(i),n.add(r),n.to(t)}cartesianToCartographic(e,t=[0,0,0]){Yr.from(e);const r=this.scaleToGeodeticSurface(Yr,Jr);if(!r)return;const n=this.geodeticSurfaceNormal(r,Wr),i=Qr;i.copy(Yr).subtract(r);const a=Math.atan2(n.y,n.x),o=Math.asin(n.z),s=Math.sign(ur(i,Yr))*sr(i);return Ir([a,o,s],t,It._cartographicRadians?Br:Lt)}eastNorthUpToFixedFrame(e,t=new _r){return Gr(this,"east","north","up",e,t)}localFrameToFixedFrame(e,t,r,n,i=new _r){return Gr(this,e,t,r,n,i)}geocentricSurfaceNormal(e,t=[0,0,0]){return Vr.from(e).normalize().to(t)}geodeticSurfaceNormalCartographic(e,t=[0,0,0]){const r=function(e,t=Or){return Rr(e,t,It._cartographicRadians?Br:Ft)}(e),n=r[0],i=r[1],a=Math.cos(i);return Vr.set(a*Math.cos(n),a*Math.sin(n),Math.sin(i)).normalize(),Vr.to(t)}geodeticSurfaceNormal(e,t=[0,0,0]){return Vr.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(e,t){return function(e,t,r=new Ar){const{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:a}=t;Pr.from(e);const o=e.x,s=e.y,c=e.z,u=n.x,l=n.y,h=n.z,p=o*o*u*u,f=s*s*l*l,d=c*c*h*h,m=p+f+d,g=Math.sqrt(1/m);if(!Number.isFinite(g))return;const b=Dr;if(b.copy(e).scale(g),m<a)return b.to(r);const y=i.x,v=i.y,w=i.z,_=Mr;_.set(b.x*y*2,b.y*v*2,b.z*w*2);let k,x,E,A,S=(1-g)*e.len()/(.5*_.len()),j=0;do{S-=j,k=1/(1+S*y),x=1/(1+S*v),E=1/(1+S*w);const e=k*k,t=x*x,r=E*E;A=p*e+f*t+d*r-1;j=A/(-2*(p*(e*k)*y+f*(t*x)*v+d*(r*E)*w))}while(Math.abs(A)>jr);return Pr.scale([k,x,E]).to(r)}(e,this,t)}scaleToGeocentricSurface(e,t=[0,0,0]){Jr.from(e);const r=Jr.x,n=Jr.y,i=Jr.z,a=this.oneOverRadiiSquared,o=1/Math.sqrt(r*r*a.x+n*n*a.y+i*i*a.z);return Jr.multiplyScalar(o).to(t)}transformPositionToScaledSpace(e,t=[0,0,0]){return Jr.from(e).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(e,t=[0,0,0]){return Jr.from(e).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(e,t=0,r=[0,0,0]){Bt(Ut(this.radii.x,this.radii.y,Tr)),Bt(this.radii.z>0),Jr.from(e);const n=Jr.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-t))return Jr.set(0,0,n).to(r)}}function $r(){let e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const t=process.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}class en{constructor(e,t){Object(p.a)(this,"name",void 0),Object(p.a)(this,"type",void 0),Object(p.a)(this,"sampleSize",1),Object(p.a)(this,"time",void 0),Object(p.a)(this,"count",void 0),Object(p.a)(this,"samples",void 0),Object(p.a)(this,"lastTiming",void 0),Object(p.a)(this,"lastSampleTime",void 0),Object(p.a)(this,"lastSampleCount",void 0),Object(p.a)(this,"_count",0),Object(p.a)(this,"_time",0),Object(p.a)(this,"_samples",0),Object(p.a)(this,"_startTime",0),Object(p.a)(this,"_timerPending",!1),this.name=e,this.type=t,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=$r(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime($r()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class tn{constructor(e){Object(p.a)(this,"id",void 0),Object(p.a)(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(e=>this._getOrCreate(e))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:r}=e;return this.stats[t]||(this.stats[t]=e instanceof en?e:new en(t,r)),this.stats[t]}}function rn(){let e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const t=process.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}class nn{constructor(e,t){Object(p.a)(this,"name",void 0),Object(p.a)(this,"type",void 0),Object(p.a)(this,"sampleSize",1),Object(p.a)(this,"time",void 0),Object(p.a)(this,"count",void 0),Object(p.a)(this,"samples",void 0),Object(p.a)(this,"lastTiming",void 0),Object(p.a)(this,"lastSampleTime",void 0),Object(p.a)(this,"lastSampleCount",void 0),Object(p.a)(this,"_count",0),Object(p.a)(this,"_time",0),Object(p.a)(this,"_samples",0),Object(p.a)(this,"_startTime",0),Object(p.a)(this,"_timerPending",!1),this.name=e,this.type=t,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=rn(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(rn()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class an{constructor(e){Object(p.a)(this,"id",void 0),Object(p.a)(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(e=>this._getOrCreate(e))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:r}=e;return this.stats[t]||(this.stats[t]=e instanceof nn?e:new nn(t,r)),this.stats[t]}}const on={id:"request-scheduler",throttleRequests:!0,maxRequests:6};class sn{constructor(e={}){Object(p.a)(this,"props",void 0),Object(p.a)(this,"stats",void 0),Object(p.a)(this,"activeRequestCount",0),Object(p.a)(this,"requestQueue",[]),Object(p.a)(this,"requestMap",new Map),Object(p.a)(this,"deferredUpdate",null),this.props={...on,...e},this.stats=new an({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}scheduleRequest(e,t=(()=>0)){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(e))return this.requestMap.get(e);const r={handle:e,priority:0,getPriority:t},n=new Promise(e=>(r.resolve=e,r));return this.requestQueue.push(r),this.requestMap.set(e,n),this._issueNewRequests(),n}_issueRequest(e){const{handle:t,resolve:r}=e;let n=!1;const i=()=>{n||(n=!0,this.requestMap.delete(t),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,r?r({done:i}):Promise.resolve({done:i})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout(()=>this._issueNewRequestsAsync(),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;const e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==e){this._updateAllRequests();for(let t=0;t<e;++t){const e=this.requestQueue.shift();e&&this._issueRequest(e)}}}_updateAllRequests(){const e=this.requestQueue;for(let t=0;t<e.length;++t){const r=e[t];this._updateRequest(r)||(e.splice(t,1),this.requestMap.delete(r.handle),t--)}e.sort((e,t)=>e.priority-t.priority)}_updateRequest(e){return e.priority=e.getPriority(e.handle),!(e.priority<0)||(e.resolve(null),!1)}}class cn{constructor(e,t,r){Object(p.a)(this,"item",void 0),Object(p.a)(this,"previous",void 0),Object(p.a)(this,"next",void 0),this.item=e,this.previous=t,this.next=r}}class un{constructor(){Object(p.a)(this,"head",null),Object(p.a)(this,"tail",null),Object(p.a)(this,"_length",0)}get length(){return this._length}add(e){const t=new cn(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t}remove(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}splice(e,t){e!==t&&(this.remove(t),this._insert(e,t))}_insert(e,t){const r=e.next;e.next=t,this.tail===e?this.tail=t:r.previous=t,t.next=r,t.previous=e,++this._length}}function ln(e){return null!=e}class hn{constructor(){Object(p.a)(this,"_list",void 0),Object(p.a)(this,"_sentinel",void 0),Object(p.a)(this,"_trimTiles",void 0),this._list=new un,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(e){const t=e._cacheNode;ln(t)&&this._list.splice(this._sentinel,t)}add(e,t,r){ln(t._cacheNode)||(t._cacheNode=this._list.add(t),r&&r(e,t))}unloadTile(e,t,r){const n=t._cacheNode;ln(n)&&(this._list.remove(n),t._cacheNode=void 0,r&&r(e,t))}unloadTiles(e,t){const r=this._trimTiles;this._trimTiles=!1;const n=this._list,i=1024*e.maximumMemoryUsage*1024,a=this._sentinel;let o=n.head;for(;o!==a&&(e.gpuMemoryUsageInBytes>i||r);){const r=o.item;o=o.next,this.unloadTile(e,r,t)}}trim(){this._trimTiles=!0}}const pn=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});new Ar,new Ar;const fn=new Ar,dn=new Ar;class mn{constructor(e=[0,0,0],t=0){this.radius=-0,this.center=new Ar,this.fromCenterRadius(e,t)}fromCenterRadius(e,t){return this.center.from(e),this.radius=t,this}fromCornerPoints(e,t){return t=fn.from(t),this.center=(new Ar).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new mn(this.center,this.radius)}union(e){const t=this.center,r=this.radius,n=e.center,i=e.radius,a=fn.copy(n).subtract(t),o=a.magnitude();if(r>=o+i)return this.clone();if(i>=o+r)return e.clone();const s=.5*(r+o+i);return dn.copy(a).scale((-r+s)/o).add(t),this.center.copy(dn),this.radius=s,this}expand(e){const t=(e=fn.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=tr(fn,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){return(e=fn.from(e)).subtract(this.center).lengthSquared()-this.radius*this.radius}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}intersectPlane(e){const t=this.center,r=this.radius,n=e.normal.dot(t)+e.distance;return n<-r?pn.OUTSIDE:n<r?pn.INTERSECTING:pn.INSIDE}}function gn(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],u=t[6],l=t[7],h=t[8],p=r[0],f=r[1],d=r[2],m=r[3],g=r[4],b=r[5],y=r[6],v=r[7],w=r[8];return e[0]=p*n+f*o+d*u,e[1]=p*i+f*s+d*l,e[2]=p*a+f*c+d*h,e[3]=m*n+g*o+b*u,e[4]=m*i+g*s+b*l,e[5]=m*a+g*c+b*h,e[6]=y*n+v*o+w*u,e[7]=y*i+v*s+w*l,e[8]=y*a+v*c+w*h,e}function bn(e,t,r){var n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}const yn=Object.freeze([1,0,0,0,1,0,0,0,1]),vn=Object.freeze([0,0,0,0,0,0,0,0,0]),wn=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),_n={};class kn extends Kt{static get IDENTITY(){return _n.IDENTITY=_n.IDENTITY||Object.freeze(new kn(yn)),_n.IDENTITY}static get ZERO(){return _n.ZERO=_n.ZERO||Object.freeze(new kn(vn)),_n.ZERO}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return wn}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}set(e,t,r,n,i,a,o,s,c){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=c,this.check()}setRowMajor(e,t,r,n,i,a,o,s,c){return this[0]=e,this[1]=n,this[2]=o,this[3]=t,this[4]=i,this[5]=s,this[6]=r,this[7]=a,this[8]=c,this.check()}determinant(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],u=e[8],t*(u*a-o*c)+r*(-u*i+o*s)+n*(c*i-a*s);var e,t,r,n,i,a,o,s,c,u}identity(){return this.copy(yn)}fromQuaternion(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,c=i+i,u=r*o,l=n*o,h=n*s,p=i*o,f=i*s,d=i*c,m=a*o,g=a*s,b=a*c;e[0]=1-h-d,e[3]=l-b,e[6]=p+g,e[1]=l+b,e[4]=1-u-d,e[7]=f-m,e[2]=p-g,e[5]=f+m,e[8]=1-u-h}(this,e),this.check()}transpose(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8]}(this,this),this.check()}invert(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],u=t[7],l=t[8],h=l*o-s*u,p=-l*a+s*c,f=u*a-o*c,d=r*h+n*p+i*f;d&&(d=1/d,e[0]=h*d,e[1]=(-l*n+i*u)*d,e[2]=(s*n-i*o)*d,e[3]=p*d,e[4]=(l*r-i*c)*d,e[5]=(-s*r+i*a)*d,e[6]=f*d,e[7]=(-u*r+n*c)*d,e[8]=(o*r-n*a)*d)}(this,this),this.check()}multiplyLeft(e){return gn(this,e,this),this.check()}multiplyRight(e){return gn(this,this,e),this.check()}rotate(e){return function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],u=t[6],l=t[7],h=t[8],p=Math.sin(r),f=Math.cos(r);e[0]=f*n+p*o,e[1]=f*i+p*s,e[2]=f*a+p*c,e[3]=f*o-p*n,e[4]=f*s-p*i,e[5]=f*c-p*a,e[6]=u,e[7]=l,e[8]=h}(this,this,e),this.check()}scale(e){return Array.isArray(e)?bn(this,this,e):bn(this,this,[e,e,e]),this.check()}translate(e){return function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],u=t[6],l=t[7],h=t[8],p=r[0],f=r[1];e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=c,e[6]=p*n+f*o+u,e[7]=p*i+f*s+l,e[8]=p*a+f*c+h}(this,this,e),this.check()}transform(e,t){switch(e.length){case 2:t=rr(t||[-0,-0],e,this);break;case 3:t=pr(t||[-0,-0,-0],e,this);break;case 4:t=Yt(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ht(t,e.length),t}transformVector(e,t){return Vt("Matrix3.transformVector"),this.transform(e,t)}transformVector2(e,t){return Vt("Matrix3.transformVector"),this.transform(e,t)}transformVector3(e,t){return Vt("Matrix3.transformVector"),this.transform(e,t)}}function xn(){var e=new Zt(4);return Zt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function En(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function An(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],c=r[1],u=r[2],l=r[3];return e[0]=n*l+o*s+i*u-a*c,e[1]=i*l+o*c+a*s-n*u,e[2]=a*l+o*u+n*c-i*s,e[3]=o*l-n*s-i*c-a*u,e}function Sn(e,t,r,n){var i,a,o,s,c,u=t[0],l=t[1],h=t[2],p=t[3],f=r[0],d=r[1],m=r[2],g=r[3];return(a=u*f+l*d+h*m+p*g)<0&&(a=-a,f=-f,d=-d,m=-m,g=-g),1-a>Xt?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,c=Math.sin(n*i)/o):(s=1-n,c=n),e[0]=s*u+c*f,e[1]=s*l+c*d,e[2]=s*h+c*m,e[3]=s*p+c*g,e}function jn(e,t){var r,n=t[0]+t[4]+t[8];if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(t[3*i+i]-t[3*a+a]-t[3*o+o]+1),e[i]=.5*r,r=.5/r,e[3]=(t[3*a+o]-t[3*o+a])*r,e[a]=(t[3*a+i]+t[3*i+a])*r,e[o]=(t[3*o+i]+t[3*i+o])*r}return e}var Tn,Cn,Bn,On,Rn,In,Pn=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},Dn=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},Mn=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},Fn=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e},Ln=mr,Nn=gr,zn=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e},Un=(Tn=or(),Cn=cr(1,0,0),Bn=cr(0,1,0),function(e,t,r){var n=ur(t,r);return n<-.999999?(lr(Tn,Cn,t),dr(Tn)<1e-6&&lr(Tn,Bn,t),function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a}(Tn,Tn),En(e,Tn,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(lr(Tn,t,r),e[0]=Tn[0],e[1]=Tn[1],e[2]=Tn[2],e[3]=1+n,zn(e,e))});On=xn(),Rn=xn(),In=function(){var e=new Zt(9);return Zt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}();const qn=[0,0,0,1];class Hn extends Wt{constructor(e=0,t=0,r=0,n=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,r,n)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}fromMatrix3(e){return jn(this,e),this.check()}identity(){return function(e){e[0]=0,e[1]=0,e[2]=0,e[3]=1}(this),this.check()}fromAxisRotation(e,t){return En(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=qt(e)}get y(){return this[1]}set y(e){this[1]=qt(e)}get z(){return this[2]}set z(e){this[2]=qt(e)}get w(){return this[3]}set w(e){this[3]=qt(e)}len(){return Ln(this)}lengthSquared(){return Nn(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return Mn(this,e)}rotationTo(e,t){return Un(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return Pn(this,this,e),this.check()}calculateW(){return function(e,t){var r=t[0],n=t[1],i=t[2];e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i))}(this,this),this.check()}conjugate(){return function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this,this),this.check()}invert(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s}(this,this),this.check()}lerp(e,t,r){return Fn(this,e,t,r),this.check()}multiplyRight(e,t){return Bt(!t),An(this,this,e),this.check()}multiplyLeft(e,t){return Bt(!t),An(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),c=Math.cos(r);e[0]=n*c+o*s,e[1]=i*c+a*s,e[2]=a*c-i*s,e[3]=o*c-n*s}(this,this,e),this.check()}rotateY(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),c=Math.cos(r);e[0]=n*c-a*s,e[1]=i*c+o*s,e[2]=a*c+n*s,e[3]=o*c-i*s}(this,this,e),this.check()}rotateZ(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),c=Math.cos(r);e[0]=n*c+i*s,e[1]=i*c-n*s,e[2]=a*c+o*s,e[3]=o*c-a*s}(this,this,e),this.check()}scale(e){return Dn(this,this,e),this.check()}slerp(e,t,r){switch(arguments.length){case 1:({start:e=qn,target:t,ratio:r}=arguments[0]);break;case 2:[t,r]=arguments,e=this}return Sn(this,e,t,r),this.check()}transformVector4(e,t=e){return function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],c=r[2],u=r[3],l=u*n+s*a-c*i,h=u*i+c*n-o*a,p=u*a+o*i-s*n,f=-o*n-s*i-c*a;e[0]=l*u+f*-o+h*-c-p*-s,e[1]=h*u+f*-s+p*-o-l*-c,e[2]=p*u+f*-c+l*-s-h*-o,e[3]=t[3]}(t,e,this),Ht(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}}const Gn=new Ar,Vn=new Ar,Wn=new Ar,Kn=new Ar,Jn=new Ar,Qn=new Ar,Yn=new Ar,Xn=0,Zn=1,$n=2,ei=3,ti=4,ri=5,ni=6,ii=7,ai=8;class oi{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new Ar).from(e),this.halfAxes=new kn(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new Ar(e).len(),new Ar(t).len(),new Ar(r).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new Ar(e).normalize(),i=new Ar(t).normalize(),a=new Ar(r).normalize();return(new Hn).fromMatrix3(new kn([...n,...i,...a]))}fromCenterHalfSizeQuaternion(e,t,r){const n=new Hn(r),i=(new kn).fromQuaternion(n);return i[0]=i[0]*t[0],i[1]=i[1]*t[0],i[2]=i[2]*t[0],i[3]=i[3]*t[1],i[4]=i[4]*t[1],i[5]=i[5]*t[1],i[6]=i[6]*t[2],i[7]=i[7]*t[2],i[8]=i[8]*t[2],this.center=(new Ar).from(e),this.halfAxes=i,this}clone(){return new oi(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new mn){const t=this.halfAxes,r=t.getColumn(0,Wn),n=t.getColumn(1,Kn),i=t.getColumn(2,Jn),a=Gn.copy(r).add(n).add(i);return e.center.copy(this.center),e.radius=a.magnitude(),e}intersectPlane(e){const t=this.center,r=e.normal,n=this.halfAxes,i=r.x,a=r.y,o=r.z,s=Math.abs(i*n[Xn]+a*n[Zn]+o*n[$n])+Math.abs(i*n[ei]+a*n[ti]+o*n[ri])+Math.abs(i*n[ni]+a*n[ii]+o*n[ai]),c=r.dot(t)+e.distance;return c<=-s?pn.OUTSIDE:c>=s?pn.INSIDE:pn.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=Vn.from(e).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,Wn),i=r.getColumn(1,Kn),a=r.getColumn(2,Jn),o=n.magnitude(),s=i.magnitude(),c=a.magnitude();n.normalize(),i.normalize(),a.normalize();let u,l=0;return u=Math.abs(t.dot(n))-o,u>0&&(l+=u*u),u=Math.abs(t.dot(i))-s,u>0&&(l+=u*u),u=Math.abs(t.dot(a))-c,u>0&&(l+=u*u),l}computePlaneDistances(e,t,r=[-0,-0]){let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const a=this.center,o=this.halfAxes,s=o.getColumn(0,Wn),c=o.getColumn(1,Kn),u=o.getColumn(2,Jn),l=Qn.copy(s).add(c).add(u).add(a),h=Yn.copy(l).subtract(e);let p=t.dot(h);return n=Math.min(p,n),i=Math.max(p,i),l.copy(a).add(s).add(c).subtract(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),l.copy(a).add(s).subtract(c).add(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),l.copy(a).add(s).subtract(c).subtract(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),a.copy(l).subtract(s).add(c).add(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),a.copy(l).subtract(s).add(c).subtract(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),a.copy(l).subtract(s).subtract(c).add(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),a.copy(l).subtract(s).subtract(c).subtract(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),r[0]=n,r[1]=i,r}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,Wn);t.transformAsPoint(e);const r=this.halfAxes.getColumn(1,Kn);r.transformAsPoint(e);const n=this.halfAxes.getColumn(2,Jn);return n.transformAsPoint(e),this.halfAxes=new kn([...t,...r,...n]),this}getTransform(){throw new Error("not implemented")}}const si=new Ar,ci=new Ar;class ui{constructor(e=[0,0,1],t=0){this.normal=new Ar,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Bt(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=si.from(e),this.normal.from(t).normalize();const r=-this.normal.dot(e);return this.distance=r,this}fromCoefficients(e,t,r,n){return this.normal.set(e,t,r),Bt(Ut(this.normal.len(),1)),this.distance=n,this}clone(e){return new ui(this.normal,this.distance)}equals(e){return Ut(this.distance,e.distance)&&Ut(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=ci.copy(this.normal).transformAsVector(e).normalize(),r=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(r,t)}projectPointOntoPlane(e,t=[0,0,0]){e=si.from(e);const r=this.getPointDistance(e),n=ci.copy(this.normal).scale(r);return e.subtract(n).to(t)}}const li=[new Ar([1,0,0]),new Ar([0,1,0]),new Ar([0,0,1])],hi=new Ar,pi=new Ar;new ui(new Ar(1,0,0),0);class fi{static get MASK_OUTSIDE(){return 4294967295}static get MASK_INSIDE(){return 0}static get MASK_INDETERMINATE(){return 2147483647}constructor(e=[]){this.planes=e,Bt(this.planes.every(e=>e instanceof ui))}fromBoundingSphere(e){this.planes.length=2*li.length;const t=e.center,r=e.radius;let n=0;for(const e of li){let i=this.planes[n],a=this.planes[n+1];i||(i=this.planes[n]=new ui),a||(a=this.planes[n+1]=new ui);const o=hi.copy(e).scale(-r).add(t);e.dot(o);i.fromPointNormal(o,e);const s=hi.copy(e).scale(r).add(t),c=pi.copy(e).negate();c.dot(s);a.fromPointNormal(s,c),n+=2}return this}computeVisibility(e){Bt(e);let t=pn.INSIDE;for(const r of this.planes){switch(e.intersectPlane(r)){case pn.OUTSIDE:return pn.OUTSIDE;case pn.INTERSECTING:t=pn.INTERSECTING}}return t}computeVisibilityWithPlaneMask(e,t){if(Bt(e,"boundingVolume is required."),Bt(Number.isFinite(t),"parentPlaneMask is required."),t===fi.MASK_OUTSIDE||t===fi.MASK_INSIDE)return t;let r=fi.MASK_INSIDE;const n=this.planes;for(let i=0;i<this.planes.length;++i){const a=i<31?1<<i:0;if(i<31&&0==(t&a))continue;const o=n[i],s=e.intersectPlane(o);if(s===pn.OUTSIDE)return fi.MASK_OUTSIDE;s===pn.INTERSECTING&&(r|=a)}return r}}new Ar,new Ar,new Ar,new Ar,new Ar;const di=new Ar,mi=new Ar,gi=new Ar,bi=new Ar,yi=new Ar,vi=new Ar,wi=new Ar,_i=new Ar,ki=new Ar,xi=new Ar,Ei=new Ar,Ai=new Ar;Math.PI;const Si=new kn,ji=new kn,Ti=new kn,Ci=new kn,Bi=new kn;function Oi(e,t={}){const r=Cr;let n=0,i=0;const a=ji,o=Ti;a.identity(),o.copy(e);const s=r*function(e){let t=0;for(let r=0;r<9;++r){const n=e[r];t+=n*n}return Math.sqrt(t)}(o);for(;i<10&&Pi(o)>s;)Di(o,Ci),Bi.copy(Ci).transpose(),o.multiplyRight(Ci),o.multiplyLeft(Bi),a.multiplyRight(Ci),++n>2&&(++i,n=0);return t.unitary=a.toTarget(t.unitary),t.diagonal=o.toTarget(t.diagonal),t}const Ri=[1,0,0],Ii=[2,2,1];function Pi(e){let t=0;for(let r=0;r<3;++r){const n=e[Si.getElementIndex(Ii[r],Ri[r])];t+=2*n*n}return Math.sqrt(t)}function Di(e,t){const r=Tr;let n=0,i=1;for(let t=0;t<3;++t){const r=Math.abs(e[Si.getElementIndex(Ii[t],Ri[t])]);r>n&&(i=t,n=r)}const a=Ri[i],o=Ii[i];let s=1,c=0;if(Math.abs(e[Si.getElementIndex(o,a)])>r){const t=(e[Si.getElementIndex(o,o)]-e[Si.getElementIndex(a,a)])/2/e[Si.getElementIndex(o,a)];let r;r=t<0?-1/(-t+Math.sqrt(1+t*t)):1/(t+Math.sqrt(1+t*t)),s=1/Math.sqrt(1+r*r),c=r*s}return kn.IDENTITY.to(t),t[Si.getElementIndex(a,a)]=t[Si.getElementIndex(o,o)]=s,t[Si.getElementIndex(o,a)]=c,t[Si.getElementIndex(a,o)]=-c,t}const Mi=new Ar,Fi=new Ar,Li=new Ar,Ni=new Ar,zi=new Ar,Ui=new kn,qi={diagonal:new kn,unitary:new kn};const Hi=new Ar,Gi=new Ar,Vi=new fi([new ui,new ui,new ui,new ui,new ui,new ui]);function Wi(e,t){const{cameraDirection:r,cameraUp:n,height:i}=e,{metersPerUnit:a}=e.distanceScales,o=e.unprojectPosition(e.center),s=Zr.WGS84.cartographicToCartesian(o,new Ar),c=Zr.WGS84.eastNorthUpToFixedFrame(s),u=e.unprojectPosition(e.cameraPosition),l=Zr.WGS84.cartographicToCartesian(u,new Ar),h=new Ar(c.transformAsVector(new Ar(r).scale(a))).normalize(),p=new Ar(c.transformAsVector(new Ar(n).scale(a))).normalize();return function(e,t){const r=e.getFrustumPlanes();let n=0;for(const i in r){const a=r[i],o=a.normal.dot(e.center);Gi.copy(a.normal).scale(a.distance-o).add(e.center);const s=e.unprojectPosition(Gi),c=Zr.WGS84.cartographicToCartesian(s,new Ar);Vi.planes[n++].fromPointNormal(c,Hi.copy(t).subtract(c))}}(e,s),{camera:{position:l,direction:h,up:p},viewport:e,height:i,cullingVolume:Vi,frameNumber:t,sseDenominator:1.15}}const Ki=new Ar;function Ji(e,t){if(e instanceof oi){const{halfAxes:r}=e,n=function(e){e.getColumn(0,Ki);const t=e.getColumn(1),r=e.getColumn(2),n=Ki.add(t).add(r);return n.len()}(r);return Math.log2(6356752.314245179/(n+t[2]))}if(e instanceof mn){const{radius:r}=e;return Math.log2(6356752.314245179/(r+t[2]))}if(e.width&&e.height){const{width:t,height:r}=e;return(Math.log2(6378137/t)+Math.log2(6378137/r))/2}return 1}const Qi=0,Yi=1,Xi=3,Zi=4,$i=5,ea=1,ta=2,ra="empty",na="scenegraph",ia="pointcloud",aa="mesh",oa="I3S",sa="TILES3D",ca="geometricError",ua=1;function la(e){return null!=e}const ha=new Ar,pa=new Ar,fa=new Ar;function da(e,t,r){if(k(e,"3D Tile: boundingVolume must be defined"),e.box)return function(e,t,r){const n=new Ar(e[0],e[1],e[2]);t.transform(n,n);let i=[];if(10===e.length){const t=e.slice(3,6),r=new Hn;r.fromArray(e,6);const n=new Ar([1,0,0]),a=new Ar([0,1,0]),o=new Ar([0,0,1]);n.transformByQuaternion(r),n.scale(t[0]),a.transformByQuaternion(r),a.scale(t[1]),o.transformByQuaternion(r),o.scale(t[2]),i=[...n.toArray(),...a.toArray(),...o.toArray()]}else i=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];const a=t.transformAsVector(i.slice(0,3)),o=t.transformAsVector(i.slice(3,6)),s=t.transformAsVector(i.slice(6,9)),c=new kn([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);if(la(r))return r.center=n,r.halfAxes=c,r;return new oi(n,c)}(e.box,t,r);if(e.region){const[t,r,n,i,a,o]=e.region,s=Zr.WGS84.cartographicToCartesian([Nt(t),Nt(i),a],pa),c=Zr.WGS84.cartographicToCartesian([Nt(n),Nt(r),o],fa),u=(new Ar).addVectors(s,c).multiplyScalar(.5),l=(new Ar).subVectors(s,c).len()/2;return ma([u[0],u[1],u[2],l],new _r)}if(e.sphere)return ma(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function ma(e,t,r){const n=new Ar(e[0],e[1],e[2]);t.transform(n,n);const i=t.getScale(ha),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return la(r)?(r.center=n,r.radius=o,r):new mn(n,o)}new Ar,new Ar,new _r,new Ar,new Ar,new Ar;function ga(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){const r=e.dynamicScreenSpaceErrorComputedDensity,n=e.dynamicScreenSpaceErrorFactor;return function(e,t){const r=e*t;return 1-Math.exp(-r*r)}(t,r)*n}return 0}function ba(e,t){const r=t.viewport,n=r.constructor,{longitude:i,latitude:a,height:o,width:s,bearing:c,zoom:u}=r,l=new n({longitude:i,latitude:a,height:o,width:s,bearing:c,zoom:u,pitch:0}),h=e.header.mbs[1],p=e.header.mbs[0],f=e.header.mbs[2],d=e.header.mbs[3],m=[...e.boundingVolume.center],g=l.unprojectPosition(l.cameraPosition),b=Zr.WGS84.cartographicToCartesian(g,new Ar),y=new Ar(b).subtract(m).normalize(),v=new _r;Zr.WGS84.eastNorthUpToFixedFrame(m,v);const w=new _r(v).invert(),_=new Ar(b).transform(w),k=Math.sqrt(_[0]*_[0]+_[1]*_[1]),x=k*k/_[2],E=new Ar([_[0],_[1],x]).transform(v),A=new Ar(E).subtract(m).normalize(),S=y.cross(A).normalize().scale(d),j=new Ar(m).add(S),T=Zr.WGS84.cartesianToCartographic(j),C=l.project([p,h,f]),B=l.project(T);return new Ar(C).subtract(B).magnitude()}class ya{constructor(e=0){Object(p.a)(this,"_map",new Map),Object(p.a)(this,"_array",void 0),Object(p.a)(this,"_length",void 0),this._array=new Array(e),this._length=e}get length(){return this._length}set length(e){this._length=e,e>this._array.length&&(this._array.length=e)}get values(){return this._array}get(e){return k(e<this._array.length),this._array[e]}set(e,t){k(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}delete(e){const t=this._map.get(e);t>=0&&(this._array.splice(t,1),this._map.delete(e),this.length--)}peek(){return this._array[this._length-1]}push(e){if(!this._map.has(e)){const t=this.length++;this._array[t]=e,this._map.set(e,t)}}pop(){const e=this._array[--this.length];return this._map.delete(e),e}reserve(e){k(e>=0),e>this._array.length&&(this._array.length=e)}resize(e){k(e>=0),this.length=e}trim(e){null==e&&(e=this.length),this._array.length=e}reset(){this._array=[],this._map=new Map,this._length=0}find(e){return this._map.has(e)}}const va={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class wa{constructor(e){Object(p.a)(this,"options",void 0),Object(p.a)(this,"root",void 0),Object(p.a)(this,"requestedTiles",void 0),Object(p.a)(this,"selectedTiles",void 0),Object(p.a)(this,"emptyTiles",void 0),Object(p.a)(this,"_traversalStack",void 0),Object(p.a)(this,"_emptyTraversalStack",void 0),Object(p.a)(this,"_frameNumber",void 0),this.options={...va,...e},this._traversalStack=new ya,this._emptyTraversalStack=new ya,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}traverse(e,t,r){this.root=e,this.options={...this.options,...r},this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(e,t){const r=this._traversalStack;for(e._selectionDepth=1,r.push(e);r.length>0;){const e=r.pop();let n=!1;this.canTraverse(e,t)&&(this.updateChildTiles(e,t),n=this.updateAndPushChildren(e,t,r,e.hasRenderContent?e._selectionDepth+1:e._selectionDepth));const i=e.parent,a=Boolean(!i||i._shouldRefine),o=!n;e.hasRenderContent?e.refine===ea?(this.loadTile(e,t),this.selectTile(e,t)):e.refine===ta&&(this.loadTile(e,t),o&&this.selectTile(e,t)):(this.emptyTiles[e.id]=e,this.loadTile(e,t),o&&this.selectTile(e,t)),this.touchTile(e,t),e._shouldRefine=n&&a}this.options.onTraversalEnd(t)}updateChildTiles(e,t){const r=e.children;for(const e of r)this.updateTile(e,t);return!0}updateAndPushChildren(e,t,r,n){const{loadSiblings:i,skipLevelOfDetail:a}=this.options,o=e.children;o.sort(this.compareDistanceToCamera.bind(this));const s=e.refine===ta&&e.hasRenderContent&&!a;let c=!1,u=!0;for(const e of o)if(e._selectionDepth=n,e.isVisibleAndInRequestVolume?(r.find(e)&&r.delete(e),r.push(e),c=!0):(s||i)&&(this.loadTile(e,t),this.touchTile(e,t)),s){let r;if(r=!!e._inRequestVolume&&(e.hasRenderContent?e.contentAvailable:this.executeEmptyTraversal(e,t)),u=u&&r,!u)return!1}return c||(u=!1),u}updateTile(e,t){this.updateTileVisibility(e,t)}selectTile(e,t){this.shouldSelectTile(e)&&(e._selectedFrame=t.frameNumber,this.selectedTiles[e.id]=e)}loadTile(e,t){this.shouldLoadTile(e)&&(e._requestedFrame=t.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}touchTile(e,t){e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber}canTraverse(e,t,r=!1,n=!1){return!!e.hasChildren&&(e.hasTilesetContent?!e.contentExpired:!(!n&&!e.isVisibleAndInRequestVolume)&&this.shouldRefine(e,t,r))}shouldLoadTile(e){return e.hasUnloadedContent||e.contentExpired}shouldSelectTile(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(e,t,r){let n=e._screenSpaceError;return r&&(n=e.getScreenSpaceError(t,!0)),n>this.options.maximumScreenSpaceError}updateTileVisibility(e,t){const r=[];if(this.options.viewportTraversersMap)for(const e in this.options.viewportTraversersMap){this.options.viewportTraversersMap[e]===t.viewport.id&&r.push(e)}else r.push(t.viewport.id);e.updateVisibility(t,r)}compareDistanceToCamera(e,t){return e._distanceToCamera-t._distanceToCamera}anyChildrenVisible(e,t){let r=!1;for(const n of e.children)n.updateVisibility(t),r=r||n.isVisibleAndInRequestVolume;return r}executeEmptyTraversal(e,t){let r=!0;const n=this._emptyTraversalStack;for(n.push(e);n.length>0&&r;){const e=n.pop();this.updateTile(e,t),e.isVisibleAndInRequestVolume||this.loadTile(e,t),this.touchTile(e,t);if(!e.hasRenderContent&&this.canTraverse(e,t,!1,!0)){const t=e.children;for(const e of t)n.find(e)&&n.delete(e),n.push(e)}else e.contentAvailable||(r=!1)}return r}}const _a=new Ar;class ka{constructor(e,t,r,n=""){Object(p.a)(this,"tileset",void 0),Object(p.a)(this,"header",void 0),Object(p.a)(this,"id",void 0),Object(p.a)(this,"url",void 0),Object(p.a)(this,"parent",void 0),Object(p.a)(this,"refine",void 0),Object(p.a)(this,"type",void 0),Object(p.a)(this,"contentUrl",void 0),Object(p.a)(this,"lodMetricType",void 0),Object(p.a)(this,"lodMetricValue",void 0),Object(p.a)(this,"boundingVolume",void 0),Object(p.a)(this,"content",void 0),Object(p.a)(this,"contentState",void 0),Object(p.a)(this,"gpuMemoryUsageInBytes",void 0),Object(p.a)(this,"children",void 0),Object(p.a)(this,"depth",void 0),Object(p.a)(this,"viewportIds",void 0),Object(p.a)(this,"transform",void 0),Object(p.a)(this,"extensions",void 0),Object(p.a)(this,"userData",void 0),Object(p.a)(this,"computedTransform",void 0),Object(p.a)(this,"hasEmptyContent",void 0),Object(p.a)(this,"hasTilesetContent",void 0),Object(p.a)(this,"traverser",void 0),Object(p.a)(this,"_cacheNode",void 0),Object(p.a)(this,"_frameNumber",void 0),Object(p.a)(this,"_lodJudge",void 0),Object(p.a)(this,"_expireDate",void 0),Object(p.a)(this,"_expiredContent",void 0),Object(p.a)(this,"_shouldRefine",void 0),Object(p.a)(this,"_distanceToCamera",void 0),Object(p.a)(this,"_centerZDepth",void 0),Object(p.a)(this,"_screenSpaceError",void 0),Object(p.a)(this,"_visibilityPlaneMask",void 0),Object(p.a)(this,"_visible",void 0),Object(p.a)(this,"_inRequestVolume",void 0),Object(p.a)(this,"_stackLength",void 0),Object(p.a)(this,"_selectionDepth",void 0),Object(p.a)(this,"_touchedFrame",void 0),Object(p.a)(this,"_visitedFrame",void 0),Object(p.a)(this,"_selectedFrame",void 0),Object(p.a)(this,"_requestedFrame",void 0),Object(p.a)(this,"_priority",void 0),Object(p.a)(this,"_contentBoundingVolume",void 0),Object(p.a)(this,"_viewerRequestVolume",void 0),Object(p.a)(this,"_initialTransform",void 0),this.header=t,this.tileset=e,this.id=n||t.id,this.url=t.url,this.parent=r,this.refine=this._getRefine(t.refine),this.type=t.type,this.contentUrl=t.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=Qi,this.gpuMemoryUsageInBytes=0,this.children=[],this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.depth=0,this.viewportIds=[],this.userData={},this.extensions=null,this._priority=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._screenSpaceError=0,this._cacheNode=null,this._frameNumber=null,this._cacheNode=null,this.traverser=new wa({}),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._initialTransform=new _r,this.transform=new _r,this._initializeLodMetric(t),this._initializeTransforms(t),this._initializeBoundingVolumes(t),this._initializeContent(t),this._initializeRenderingState(t),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,Object.seal(this)}destroy(){this.header=null}isDestroyed(){return null===this.header}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===Xi||this.hasEmptyContent}get contentAvailable(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===Qi}get contentExpired(){return this.contentState===Zi}get contentFailed(){return this.contentState===$i}getScreenSpaceError(e,t){switch(this.tileset.type){case oa:return ba(this,e);case sa:return function(e,t,r){const n=e.tileset,i=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,a=r?i:e.lodMetricValue;if(0===a)return 0;const o=Math.max(e._distanceToCamera,1e-7),{height:s,sseDenominator:c}=t,{viewDistanceScale:u}=n.options;let l=a*s*(u||1)/(o*c);return l-=ga(n,o),l}(this,e,t);default:throw new Error("Unsupported tileset type")}}_getPriority(){const e=this.tileset._traverser,{skipLevelOfDetail:t}=e.options,r=this.refine===ea||t;if(r&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Qi)return-1;const n=this.parent,i=n&&(!r||0===this._screenSpaceError||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,a=e.root?e.root._screenSpaceError:0;return Math.max(a-i,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=Yi;const e=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!e)return this.contentState=Qi,!1;try{const t=this.tileset.getTileUrl(this.contentUrl),r=this.tileset.loader,n={...this.tileset.loadOptions,[r.id]:{...this.tileset.loadOptions[r.id],isTileset:"json"===this.type,...this._getLoaderSpecificOptions(r.id)}};return this.content=await St(t,r,n),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Xi,this._onContentLoaded(),!0}catch(e){throw this.contentState=$i,e}finally{e.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=Qi,!0}updateVisibility(e,t){if(this._frameNumber===e.frameNumber)return;const r=this.parent,n=r?r._visibilityPlaneMask:fi.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){const e=r?r.computedTransform:this.tileset.modelMatrix;this._updateTransform(e)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,n),this._visible=this._visibilityPlaneMask!==fi.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=t}visibility(e,t){const{cullingVolume:r}=e,{boundingVolume:n}=this;return r.computeVisibilityWithPlaneMask(n,t)}contentVisibility(){return!0}distanceToTile(e){const t=this.boundingVolume;return Math.sqrt(Math.max(t.distanceSquaredTo(e.camera.position),0))}cameraSpaceZDepth({camera:e}){const t=this.boundingVolume;return _a.subVectors(t.center,e.position),e.direction.dot(_a)}insideViewerRequestVolume(e){const t=this._viewerRequestVolume;return!t||t.distanceSquaredTo(e.camera.position)<=0}updateExpiration(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){const e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=Zi,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(e){"lodMetricType"in e?this.lodMetricType=e.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in e?this.lodMetricValue=e.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(e){this.transform=e.transform?new _r(e.transform):new _r;const t=this.parent,r=this.tileset,n=t&&t.computedTransform?t.computedTransform.clone():r.modelMatrix.clone();this.computedTransform=new _r(n).multiplyRight(this.transform);const i=t&&t._initialTransform?t._initialTransform.clone():new _r;this._initialTransform=new _r(i).multiplyRight(this.transform)}_initializeBoundingVolumes(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}_initializeContent(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Qi,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=fi.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(e){return e||this.parent&&this.parent.refine||ta}_isTileset(){return-1!==this.contentUrl.indexOf(".json")}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()&&(this.hasTilesetContent=!0)}_updateBoundingVolume(e){this.boundingVolume=da(e.boundingVolume,this.computedTransform,this.boundingVolume);const t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=da(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=da(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(e=new _r){const t=e.clone().multiplyRight(this.transform);!t.equals(this.computedTransform)&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(e){switch(e){case"i3s":return{...this.tileset.options.i3s,tile:this.header,tileset:this.tileset.tileset,isTileHeader:!1};case"3d-tiles":case"cesium-ion":default:return{assetGltfUpAxis:(t=this.tileset.tileset).asset&&t.asset.gltfUpAxis||"Y"}}var t}}class xa extends wa{compareDistanceToCamera(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}updateTileVisibility(e,t){if(super.updateTileVisibility(e,t),!e.isVisibleAndInRequestVolume)return;const r=e.children.length>0;if(e.hasTilesetContent&&r){const r=e.children[0];return this.updateTileVisibility(r,t),void(e._visible=r._visible)}if(this.meetsScreenSpaceErrorEarly(e,t))return void(e._visible=!1);const n=e.refine===ta,i=e._optimChildrenWithinParent===ua;n&&i&&r&&!this.anyChildrenVisible(e,t)&&(e._visible=!1)}meetsScreenSpaceErrorEarly(e,t){const{parent:r}=e;return!(!r||r.hasTilesetContent||r.refine!==ea)&&!this.shouldRefine(e,t,!0)}}const Ea="REQUESTED",Aa="COMPLETED",Sa="ERROR";class ja{constructor(){Object(p.a)(this,"_statusMap",void 0),this._statusMap={}}add(e,t,r,n){this._statusMap[t]||(this._statusMap[t]={request:e,callback:r,key:t,frameState:n,status:Ea},e().then(e=>{this._statusMap[t].status=Aa,this._statusMap[t].callback(e,n)}).catch(e=>{this._statusMap[t].status=Sa,r(e)}))}update(e,t){this._statusMap[e]&&(this._statusMap[e].frameState=t)}find(e){return this._statusMap[e]}}class Ta extends wa{constructor(e){super(e),Object(p.a)(this,"_tileManager",void 0),this._tileManager=new ja}shouldRefine(e,t){return e._lodJudge=function(e,t){if(0===e.lodMetricValue||isNaN(e.lodMetricValue))return"DIG";const r=2*ba(e,t);return r<2?"OUT":!e.header.children||r<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}(e,t),"DIG"===e._lodJudge}updateChildTiles(e,t){const r=e.header.children||[],n=e.children,i=e.tileset;for(const a of r){const r="".concat(a.id,"-").concat(t.viewport.id),o=n&&n.find(e=>e.id===r);if(o)o&&this.updateTile(o,t);else{let n=()=>this._loadTile(a.id,i);this._tileManager.find(r)?this._tileManager.update(r,t):(i.tileset.nodePages&&(n=()=>i.tileset.nodePagesTile.formTileFromNodePages(a.id)),this._tileManager.add(n,r,t=>this._onTileLoad(t,e,r),t))}}return!1}async _loadTile(e,t){const{loader:r}=t,n=t.getTileUrl("".concat(t.url,"/nodes/").concat(e)),i={...t.loadOptions,i3s:{...t.loadOptions.i3s,isTileHeader:!0,loadContent:!1}};return await St(n,r,i)}_onTileLoad(e,t,r){const n=new ka(t.tileset,e,t,r);t.children.push(n);const i=this._tileManager.find(n.id).frameState;this.updateTile(n,i),this._frameNumber===i.frameNumber&&this.executeTraversal(n,i)}}const Ca={description:"",ellipsoid:Zr.WGS84,modelMatrix:new _r,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:e=>e,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}};class Ba{constructor(e,t){Object(p.a)(this,"options",void 0),Object(p.a)(this,"loadOptions",void 0),Object(p.a)(this,"type",void 0),Object(p.a)(this,"tileset",void 0),Object(p.a)(this,"loader",void 0),Object(p.a)(this,"url",void 0),Object(p.a)(this,"basePath",void 0),Object(p.a)(this,"modelMatrix",void 0),Object(p.a)(this,"ellipsoid",void 0),Object(p.a)(this,"lodMetricType",void 0),Object(p.a)(this,"lodMetricValue",void 0),Object(p.a)(this,"refine",void 0),Object(p.a)(this,"root",void 0),Object(p.a)(this,"roots",void 0),Object(p.a)(this,"asset",void 0),Object(p.a)(this,"description",void 0),Object(p.a)(this,"properties",void 0),Object(p.a)(this,"extras",void 0),Object(p.a)(this,"attributions",void 0),Object(p.a)(this,"credits",void 0),Object(p.a)(this,"stats",void 0),Object(p.a)(this,"traverseCounter",void 0),Object(p.a)(this,"geometricError",void 0),Object(p.a)(this,"selectedTiles",void 0),Object(p.a)(this,"cartographicCenter",void 0),Object(p.a)(this,"cartesianCenter",void 0),Object(p.a)(this,"zoom",void 0),Object(p.a)(this,"boundingVolume",void 0),Object(p.a)(this,"gpuMemoryUsageInBytes",void 0),Object(p.a)(this,"dynamicScreenSpaceErrorComputedDensity",void 0),Object(p.a)(this,"_traverser",void 0),Object(p.a)(this,"_cache",void 0),Object(p.a)(this,"_requestScheduler",void 0),Object(p.a)(this,"_frameNumber",void 0),Object(p.a)(this,"_queryParamsString",void 0),Object(p.a)(this,"_queryParams",void 0),Object(p.a)(this,"_extensionsUsed",void 0),Object(p.a)(this,"_tiles",void 0),Object(p.a)(this,"_pendingCount",void 0),Object(p.a)(this,"lastUpdatedVieports",void 0),Object(p.a)(this,"_requestedTiles",void 0),Object(p.a)(this,"_emptyTiles",void 0),Object(p.a)(this,"frameStateData",void 0),Object(p.a)(this,"maximumMemoryUsage",void 0),k(e),this.options={...Ca,...t},this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||n.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new hn,this._requestScheduler=new sn({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new tn({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this._initializeTileSet(e)}destroy(){this._destroy()}isLoaded(){return 0===this._pendingCount&&0!==this._frameNumber}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return this._queryParamsString||(this._queryParamsString=function(e){const t=[];for(const r of Object.keys(e))t.push("".concat(r,"=").concat(e[r]));switch(t.length){case 0:return"";case 1:return"?".concat(t[0]);default:return"?".concat(t.join("&"))}}(this._queryParams)),this._queryParamsString}setProps(e){this.options={...this.options,...e}}setOptions(e){this.options={...this.options,...e}}getTileUrl(e){return e.startsWith("data:")?e:"".concat(e).concat(this.queryParams)}hasExtension(e){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(e)>-1)}update(e){if("loadTiles"in this.options&&!this.options.loadTiles)return;if(this.traverseCounter>0)return;!e&&this.lastUpdatedVieports?e=this.lastUpdatedVieports:this.lastUpdatedVieports=e,e instanceof Array||(e=[e]),this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;const t=[];for(const r of e){const e=r.id;this._needTraverse(e)?t.push(e):this.traverseCounter--}for(const r of e){const e=r.id;if(this.roots[e]||(this.roots[e]=this._initializeTileHeaders(this.tileset,null)),!t.includes(e))continue;const n=Wi(r,this._frameNumber);this._traverser.traverse(this.roots[e],n,this.options)}}_needTraverse(e){let t=e;return this.options.viewportTraversersMap&&(t=this.options.viewportTraversersMap[e]),t===e}_onTraversalEnd(e){const t=e.viewport.id;this.frameStateData[t]||(this.frameStateData[t]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});const r=this.frameStateData[t],n=Object.values(this._traverser.selectedTiles);r.selectedTiles=n,r._requestedTiles=Object.values(this._traverser.requestedTiles),r._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(const e in this.frameStateData){const t=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(t.selectedTiles),this._requestedTiles=this._requestedTiles.concat(t._requestedTiles),this._emptyTiles=this._emptyTiles.concat(t._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(const e of this.selectedTiles)this._tiles[e.id]=e;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(e,t){if(e.length!==t.length)return!0;const r=new Set(e.map(e=>e.id)),n=new Set(t.map(e=>e.id));let i=e.filter(e=>!n.has(e.id)).length>0;return i=i||t.filter(e=>!r.has(e.id)).length>0,i}_loadTiles(){for(const e of this._requestedTiles)e.contentUnloaded&&this._loadTile(e)}_unloadTiles(){this._cache.unloadTiles(this,(e,t)=>e._unloadTile(t))}_updateStats(){let e=0,t=0;for(const r of this.selectedTiles)r.contentAvailable&&r.content&&(e++,r.content.pointCount&&(t+=r.content.pointCount));this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=e,this.stats.get("Points").count=t}_initializeTileSet(e){this.root=this._initializeTileHeaders(e,null),this.type===sa&&this._initializeCesiumTileset(e),this.type===oa&&this._initializeI3STileset(),this._calculateViewProps()}_calculateViewProps(){const e=this.root;k(e);const{center:t}=e.boundingVolume;if(!t)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new Ar,void(this.zoom=1);this.cartographicCenter=Zr.WGS84.cartesianToCartographic(t,new Ar),this.cartesianCenter=t,this.zoom=Ji(e.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get("Tiles In Tileset(s)"),this.stats.get("Tiles Loading"),this.stats.get("Tiles In Memory"),this.stats.get("Tiles In View"),this.stats.get("Tiles To Render"),this.stats.get("Tiles Loaded"),this.stats.get("Tiles Unloaded"),this.stats.get("Failed Tile Loads"),this.stats.get("Points","memory"),this.stats.get("Tile Memory Use","memory")}_initializeTileHeaders(e,t){const r=new ka(this,e.root,t);if(t&&(t.children.push(r),r.depth=t.depth+1),this.type===sa){const e=[];for(e.push(r);e.length>0;){const t=e.pop();this.stats.get("Tiles In Tileset(s)").incrementCount();const r=t.header.children||[];for(const n of r){const r=new ka(this,n,t);t.children.push(r),r.depth=t.depth+1,e.push(r)}}}return r}_initializeTraverser(){let e;switch(this.type){case sa:e=xa;break;case oa:e=Ta;break;default:e=wa}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(e){this._destroySubtree(e)}async _loadTile(e){let t;try{this._onStartTileLoading(),t=await e.loadContent()}catch(t){this._onTileLoadError(e,t)}finally{this._onEndTileLoading(),this._onTileLoad(e,t)}}_onTileLoadError(e,t){this.stats.get("Failed Tile Loads").incrementCount();const r=t.message||t.toString(),n=e.url;console.error("A 3D tile failed to load: ".concat(e.url," ").concat(r)),this.options.onTileError(e,r,n)}_onTileLoad(e,t){t&&(e&&e.content&&function(e,t){k(e),k(t);const{rtcCenter:r,gltfUpAxis:n}=t,{computedTransform:i,boundingVolume:{center:a}}=e;let o=new _r(i);switch(r&&o.translate(r),n){case"Z":break;case"Y":const e=(new _r).rotateX(Math.PI/2);o=o.multiplyRight(e);break;case"X":const t=(new _r).rotateY(-Math.PI/2);o=o.multiplyRight(t)}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);const s=new Ar(a);t.cartesianModelMatrix=o,t.cartesianOrigin=s;const c=Zr.WGS84.cartesianToCartographic(s,new Ar),u=Zr.WGS84.eastNorthUpToFixedFrame(s).invert();t.cartographicModelMatrix=u.multiplyRight(o),t.cartographicOrigin=c,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}(e,e.content),this._addTileToCache(e),this.options.onTileLoad(e))}_onStartTileLoading(){this._pendingCount++,this.stats.get("Tiles Loading").incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get("Tiles Loading").decrementCount()}_addTileToCache(e){this._cache.add(this,e,t=>t._updateCacheStats(e))}_updateCacheStats(e){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=e.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}_unloadTile(e){this.gpuMemoryUsageInBytes-=e.content&&e.content.byteLength||0,this.stats.get("Tiles In Memory").decrementCount(),this.stats.get("Tiles Unloaded").incrementCount(),this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}_destroy(){const e=[];for(this.root&&e.push(this.root);e.length>0;){const t=e.pop();for(const r of t.children)e.push(r);this._destroyTile(t)}this.root=null}_destroySubtree(e){const t=e,r=[];for(r.push(t);r.length>0;){e=r.pop();for(const t of e.children)r.push(t);e!==t&&this._destroyTile(e)}t.children=[]}_destroyTile(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}_initializeCesiumTileset(e){if(this.asset=e.asset,!this.asset)throw new Error("Tileset must have an asset property.");if("0.0"!==this.asset.version&&"1.0"!==this.asset.version)throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed,this.extras=e.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}const Oa={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Ra=(Object.keys(Oa),{BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]});function Ia(e,t,r){k(e instanceof ArrayBuffer);const n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}const Pa={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:"3.1.7",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"==typeof WebAssembly?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};class Da{constructor(e,t){Object(p.a)(this,"fields",void 0),Object(p.a)(this,"metadata",void 0),function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}(Array.isArray(e)),function(e){const t={};for(const r of e)t[r.name]&&console.warn("Schema: duplicated field name",r.name,r),t[r.name]=!0}(e),this.fields=e,this.metadata=t||new Map}compareTo(e){if(this.metadata!==e.metadata)return!1;if(this.fields.length!==e.fields.length)return!1;for(let t=0;t<this.fields.length;++t)if(!this.fields[t].compareTo(e.fields[t]))return!1;return!0}select(...e){const t=Object.create(null);for(const r of e)t[r]=!0;const r=this.fields.filter(e=>t[e.name]);return new Da(r,this.metadata)}selectAt(...e){const t=e.map(e=>this.fields[e]).filter(Boolean);return new Da(t,this.metadata)}assign(e){let t,r=this.metadata;if(e instanceof Da){const n=e;t=n.fields,r=Ma(Ma(new Map,this.metadata),n.metadata)}else t=e;const n=Object.create(null);for(const e of this.fields)n[e.name]=e;for(const e of t)n[e.name]=e;const i=Object.values(n);return new Da(i,r)}}function Ma(e,t){return new Map([...e||new Map,...t||new Map])}class Fa{constructor(e,t,r=!1,n=new Map){Object(p.a)(this,"name",void 0),Object(p.a)(this,"type",void 0),Object(p.a)(this,"nullable",void 0),Object(p.a)(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=r,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new Fa(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}let La,Na,za,Ua,qa,Ha,Ga,Va,Wa;!function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"}(La||(La={}));class Ka{static isNull(e){return e&&e.typeId===La.Null}static isInt(e){return e&&e.typeId===La.Int}static isFloat(e){return e&&e.typeId===La.Float}static isBinary(e){return e&&e.typeId===La.Binary}static isUtf8(e){return e&&e.typeId===La.Utf8}static isBool(e){return e&&e.typeId===La.Bool}static isDecimal(e){return e&&e.typeId===La.Decimal}static isDate(e){return e&&e.typeId===La.Date}static isTime(e){return e&&e.typeId===La.Time}static isTimestamp(e){return e&&e.typeId===La.Timestamp}static isInterval(e){return e&&e.typeId===La.Interval}static isList(e){return e&&e.typeId===La.List}static isStruct(e){return e&&e.typeId===La.Struct}static isUnion(e){return e&&e.typeId===La.Union}static isFixedSizeBinary(e){return e&&e.typeId===La.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===La.FixedSizeList}static isMap(e){return e&&e.typeId===La.Map}static isDictionary(e){return e&&e.typeId===La.Dictionary}get typeId(){return La.NONE}compareTo(e){return this===e}}Symbol.toStringTag;Symbol.toStringTag;Na=Symbol.toStringTag;class Ja extends Ka{constructor(e,t){super(),Object(p.a)(this,"isSigned",void 0),Object(p.a)(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return La.Int}get[Na](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class Qa extends Ja{constructor(){super(!0,8)}}class Ya extends Ja{constructor(){super(!0,16)}}class Xa extends Ja{constructor(){super(!0,32)}}class Za extends Ja{constructor(){super(!1,8)}}class $a extends Ja{constructor(){super(!1,16)}}class eo extends Ja{constructor(){super(!1,32)}}const to=32,ro=64;za=Symbol.toStringTag;class no extends Ka{constructor(e){super(),Object(p.a)(this,"precision",void 0),this.precision=e}get typeId(){return La.Float}get[za](){return"Float"}toString(){return"Float".concat(this.precision)}}class io extends no{constructor(){super(to)}}class ao extends no{constructor(){super(ro)}}Symbol.toStringTag;Symbol.toStringTag;Ua=Symbol.toStringTag;qa=Symbol.toStringTag;Ha=Symbol.toStringTag;Ga=Symbol.toStringTag;Va=Symbol.toStringTag;class oo extends Ka{constructor(e,t){super(),Object(p.a)(this,"listSize",void 0),Object(p.a)(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return La.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Va](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}Wa=Symbol.toStringTag;function so(e,t,r){const n=function(e){switch(e.constructor){case Int8Array:return new Qa;case Uint8Array:return new Za;case Int16Array:return new Ya;case Uint16Array:return new $a;case Int32Array:return new Xa;case Uint32Array:return new eo;case Float32Array:return new io;case Float64Array:return new ao;default:throw new Error("array type not supported")}}(t.value),i=r||function(e){const t=new Map;"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10));"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10));"normalized"in e&&t.set("normalized",e.normalized.toString());return t}(t);return new Fa(e,new oo(t.size,new Fa("value",n)),!1,i)}function co(e,t,r){return so(e,t,r?uo(r.metadata):void 0)}function uo(e){const t=new Map;for(const r in e)t.set("".concat(r,".string"),JSON.stringify(e[r]));return t}const lo={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},ho={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class po{constructor(e){Object(p.a)(this,"draco",void 0),Object(p.a)(this,"decoder",void 0),Object(p.a)(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const r=new this.draco.DecoderBuffer;r.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const n=this.decoder.GetEncodedGeometryType(r),i=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let e;switch(n){case this.draco.TRIANGULAR_MESH:e=this.decoder.DecodeBufferToMesh(r,i);break;case this.draco.POINT_CLOUD:e=this.decoder.DecodeBufferToPointCloud(r,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!e.ok()||!i.ptr){const t="DRACO decompression failed: ".concat(e.error_msg());throw new Error(t)}const a=this._getDracoLoaderData(i,n,t),o=this._getMeshData(i,a,t),s=function(e){let t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0;const s=e.POSITION?e.POSITION.value:[],c=s&&s.length;for(let e=0;e<c;e+=3){const c=s[e],u=s[e+1],l=s[e+2];t=c<t?c:t,r=u<r?u:r,n=l<n?l:n,i=c>i?c:i,a=u>a?u:a,o=l>o?l:o}return[[t,r,n],[i,a,o]]}(o.attributes),c=function(e,t,r){const n=uo(t.metadata),i=[],a=function(e){const t={};for(const r in e){const n=e[r];t[n.name||"undefined"]=n}return t}(t.attributes);for(const t in e){const r=co(t,e[t],a[t]);i.push(r)}if(r){const e=co("indices",r);i.push(e)}return new Da(i,n)}(o.attributes,a,o.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:s},...o,schema:c}}finally{this.draco.destroy(r),i&&this.draco.destroy(i)}}_getDracoLoaderData(e,t,r){const n=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,r);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:n,attributes:i}}_getDracoAttributes(e,t){const r={};for(let n=0;n<e.num_attributes();n++){const i=this.decoder.GetAttribute(e,n),a=this._getAttributeMetadata(e,n);r[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:n,metadata:a};const o=this._getQuantizationTransform(i,t);o&&(r[i.unique_id()].quantization_transform=o);const s=this._getOctahedronTransform(i,t);s&&(r[i.unique_id()].octahedron_transform=s)}return r}_getMeshData(e,t,r){const n=this._getMeshAttributes(t,e,r);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(e,t,r){const n={};for(const i of Object.values(e.attributes)){const e=this._deduceAttributeName(i,r);i.name=e;const{value:a,size:o}=this._getAttributeValues(t,i);n[e]={value:a,size:o,byteOffset:i.byte_offset,byteStride:i.byte_stride,normalized:i.normalized}}return n}_getTriangleListIndices(e){const t=3*e.num_faces(),r=4*t,n=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(e,r,n),new Uint32Array(this.draco.HEAPF32.buffer,n,t).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(e){const t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),function(e){const t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}(t)}finally{this.draco.destroy(t)}}_getAttributeValues(e,t){const r=ho[t.data_type],n=t.num_components,i=e.num_points()*n,a=i*r.BYTES_PER_ELEMENT,o=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}(this.draco,r);let s;const c=this.draco._malloc(a);try{const n=this.decoder.GetAttribute(e,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,n,o,a,c),s=new r(this.draco.HEAPF32.buffer,c,i).slice()}finally{this.draco._free(c)}return{value:s,size:n}}_deduceAttributeName(e,t){const r=e.unique_id;for(const[e,n]of Object.entries(t.extraAttributes||{}))if(n===r)return e;const n=e.attribute_type;for(const e in lo){if(this.draco[e]===n)return lo[e]}const i=t.attributeNameEntry||"name";return e.metadata[i]?e.metadata[i].string:"CUSTOM_ATTRIBUTE_".concat(r)}_getTopLevelMetadata(e){const t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}_getAttributeMetadata(e,t){const r=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(r)}_getDracoMetadata(e){if(!e||!e.ptr)return{};const t={},r=this.metadataQuerier.NumEntries(e);for(let n=0;n<r;n++){const r=this.metadataQuerier.GetEntryName(e,n);t[r]=this._getDracoMetadataField(e,r)}return t}_getDracoMetadataField(e,t){const r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,r);const n=function(e){const t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}(r);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:n}}finally{this.draco.destroy(r)}}_disableAttributeTransforms(e){const{quantizedAttributes:t=[],octahedronAttributes:r=[]}=e,n=[...t,...r];for(const e of n)this.decoder.SkipAttributeTransform(this.draco[e])}_getQuantizationTransform(e,t){const{quantizedAttributes:r=[]}=t,n=e.attribute_type();if(r.map(e=>this.decoder[e]).includes(n)){const t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits(),range:t.range(),min_values:new Float32Array([1,2,3]).map(e=>t.min_value(e))}}finally{this.draco.destroy(t)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:r=[]}=t,n=e.attribute_type();if(r.map(e=>this.decoder[e]).includes(n)){const t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits()}}finally{this.draco.destroy(t)}}return null}}var fo=r(51);const mo={};async function go(e,t=null,r={}){return t&&(e=function(e,t,r){if(e.startsWith("http"))return e;const n=r.modules||{};if(n[e])return n[e];if(!$)return"modules/".concat(t,"/dist/libs/").concat(e);if(r.CDN)return Y(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(t,"@").concat("3.1.7","/dist/libs/").concat(e);if(ee)return"../src/libs/".concat(e);return"modules/".concat(t,"/src/libs/").concat(e)}(e,t,r)),mo[e]=mo[e]||async function(e){if(e.endsWith("wasm")){const t=await fetch(e);return await t.arrayBuffer()}if(!$)try{return fo&&fo.requireFromFile&&await fo.requireFromFile(e)}catch{return null}if(ee)return importScripts(e);const t=await fetch(e);return function(e,t){if(!$)return fo.requireFromString&&fo.requireFromString(e,t);if(ee)return eval.call(Z,e),null;const r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch(t){r.text=e}return document.body.appendChild(r),null}(await t.text(),e)}(e),await mo[e]}const bo="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),yo="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),vo="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.wasm"),wo="https://raw.githubusercontent.com/google/draco/".concat("1.4.1","/javascript/draco_encoder.js");let _o,ko;async function xo(e){const t=e.modules||{};return _o=t.draco3d?_o||t.draco3d.createDecoderModule({}).then(e=>({draco:e})):_o||async function(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await go(bo,"draco",e);break;case"wasm":default:[t,r]=await Promise.all([await go(yo,"draco",e),await go(vo,"draco",e)])}return t=t||globalThis.DracoDecoderModule,await function(e,t){const r={};t&&(r.wasmBinary=t);return new Promise(t=>{e({...r,onModuleLoaded:e=>t({draco:e})})})}(t,r)}(e),await _o}async function Eo(e){const t=e.modules||{};return ko=t.draco3d?ko||t.draco3d.createEncoderModule({}).then(e=>({draco:e})):ko||async function(e){let t=await go(wo,"draco",e);return t=t||globalThis.DracoEncoderModule,new Promise(e=>{t({onModuleLoaded:t=>e({draco:t})})})}(e),await ko}const Ao={...Pa,parse:async function(e,t){const{draco:r}=await xo(t),n=new po(r);try{return n.parseSync(e,null==t?void 0:t.draco)}finally{n.destroy()}}};const So={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},jo={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,...So},To={[So.DOUBLE]:Float64Array,[So.FLOAT]:Float32Array,[So.UNSIGNED_SHORT]:Uint16Array,[So.UNSIGNED_INT]:Uint32Array,[So.UNSIGNED_BYTE]:Uint8Array,[So.BYTE]:Int8Array,[So.SHORT]:Int16Array,[So.INT]:Int32Array},Co={DOUBLE:So.DOUBLE,FLOAT:So.FLOAT,UNSIGNED_SHORT:So.UNSIGNED_SHORT,UNSIGNED_INT:So.UNSIGNED_INT,UNSIGNED_BYTE:So.UNSIGNED_BYTE,BYTE:So.BYTE,SHORT:So.SHORT,INT:So.INT};class Bo{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(const t in To){if(To[t]===e)return t}throw new Error("Failed to convert GL type")}static fromName(e){const t=Co[e];if(!t)throw new Error("Failed to convert GL type");return t}static getArrayType(e){switch(e){case So.UNSIGNED_SHORT_5_6_5:case So.UNSIGNED_SHORT_4_4_4_4:case So.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const t=To[e];if(!t)throw new Error("Failed to convert GL type");return t}}static getByteSize(e){return Bo.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return Boolean(Bo.getArrayType(e))}static createTypedArray(e,t,r=0,n){void 0===n&&(n=(t.byteLength-r)/Bo.getByteSize(e));return new(Bo.getArrayType(e))(t,r,n)}}class Oo{constructor(e,t){Object(p.a)(this,"json",void 0),Object(p.a)(this,"buffer",void 0),Object(p.a)(this,"featuresLength",0),Object(p.a)(this,"_cachedTypedArrays",{}),this.json=e,this.buffer=t}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return Boolean(this.json[e])}getGlobalProperty(e,t=jo.UNSIGNED_INT,r=1){const n=this.json[e];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(e,t,r,1,n.byteOffset):n}getPropertyArray(e,t,r){const n=this.json[e];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(t=Bo.fromName(n.componentType)),this._getTypedArrayFromBinary(e,t,r,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(e,t,n)}getProperty(e,t,r,n,i){const a=this.json[e];if(!a)return a;const o=this.getPropertyArray(e,t,r);if(1===r)return o[n];for(let e=0;e<r;++e)i[e]=o[r*n+e];return i}_getTypedArrayFromBinary(e,t,r,n,i){const a=this._cachedTypedArrays;let o=a[e];return o||(o=Bo.createTypedArray(t,this.buffer.buffer,this.buffer.byteOffset+i,n*r),a[e]=o),o}_getTypedArrayFromArray(e,t,r){const n=this._cachedTypedArrays;let i=n[e];return i||(i=Bo.createTypedArray(t,r),n[e]=i),i}}const Ro={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Io={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},Po={SCALAR:(e,t,r)=>{t[r]=e},VEC2:(e,t,r)=>{t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:(e,t,r)=>{t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:(e,t,r)=>{t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:(e,t,r)=>{t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};const Do=e=>void 0!==e;function Mo(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy");const i=t.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?function(e,t){let r,n,i;const a=e.instancesLength,o=e.classes;let s,c=e.classIds,u=e.parentCounts,l=e.parentIds,h=a;Do(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,a));if(Do(u))for(Do(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,a)),s=new Uint16Array(a),h=0,r=0;r<a;++r)s[r]=h,h+=u[r];Do(l)&&Do(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,i=getBinaryAccessor(l),l=i.createArrayBufferView(t.buffer,t.byteOffset+l.byteOffset,h));const p=o.length;for(r=0;r<p;++r){const e=o[r].length,n=o[r].instances,i=getBinaryProperties(e,n,t);o[r].instances=combine(i,n)}const f=new Array(p).fill(0),d=new Uint16Array(a);for(r=0;r<a;++r)n=c[r],d[r]=f[n],++f[n];const m={classes:o,classIds:c,classIndexes:d,parentCounts:u,parentIndexes:s,parentIds:l};return function(e){const t=e.classIds.length;for(let r=0;r<t;++r)Lo(e,r,stack)}(m),m}(n,r):null}function Fo(e,t,r){if(!e)return;const n=e.parentCounts;return e.parentIds?r(e,t):n>0?function(e,t,r){const n=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=n.length,c=scratchVisited;c.length=Math.max(c.length,s);const u=++marker,l=scratchStack;l.length=0,l.push(t);for(;l.length>0;){if(t=l.pop(),c[t]===u)continue;c[t]=u;const n=r(e,t);if(Do(n))return n;const s=i[t],h=o[t];for(let e=0;e<s;++e){const r=a[h+e];r!==t&&l.push(r)}}return null}(e,t,r):function(e,t,r){let n=!0;for(;n;){const i=r(e,t);if(Do(i))return i;const a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}(e,t,r)}function Lo(e,t,r){const n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,o=e.classIds.length;if(!Do(i))return;assert(t<o,"Parent index ".concat(t," exceeds the total number of instances: ").concat(o)),assert(-1===r.indexOf(t),"Circular dependency detected in the batch table hierarchy."),r.push(t);const s=Do(n)?n[t]:1,c=Do(n)?a[t]:t;for(let n=0;n<s;++n){const a=i[c+n];a!==t&&Lo(e,a,r)}r.pop(t)}function No(e){return null!=e}const zo=(e,t)=>e,Uo={HIERARCHY:!0,extensions:!0,extras:!0};class qo{constructor(e,t,r,n={}){var i;Object(p.a)(this,"json",void 0),Object(p.a)(this,"binary",void 0),Object(p.a)(this,"featureCount",void 0),Object(p.a)(this,"_extensions",void 0),Object(p.a)(this,"_properties",void 0),Object(p.a)(this,"_binaryProperties",void 0),Object(p.a)(this,"_hierarchy",void 0),k(r>=0),this.json=e||{},this.binary=t,this.featureCount=r,this._extensions=(null===(i=this.json)||void 0===i?void 0:i.extensions)||{},this._properties={};for(const e in this.json)Uo[e]||(this._properties[e]=this.json[e]);this._binaryProperties=this._initializeBinaryProperties(),n["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Mo(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,t){if(this._checkBatchId(e),k("string"==typeof t,t),this._hierarchy){return No(Fo(this._hierarchy,e,(e,r)=>{const n=e.classIds[r];return e.classes[n].name===t}))}return!1}isExactClass(e,t){return k("string"==typeof t,t),this.getExactClassName(e)===t}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){const t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}hasProperty(e,t){return this._checkBatchId(e),k("string"==typeof t,t),No(this._properties[t])||this._hasPropertyInHierarchy(e,t)}getPropertyNames(e,t){this._checkBatchId(e),(t=No(t)?t:[]).length=0;const r=Object.keys(this._properties);return t.push(...r),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}getProperty(e,t){if(this._checkBatchId(e),k("string"==typeof t,t),this._binaryProperties){const r=this._binaryProperties[t];if(No(r))return this._getBinaryProperty(r,e)}const r=this._properties[t];if(No(r))return zo(r[e]);if(this._hierarchy){const r=this._getHierarchyProperty(e,t);if(No(r))return r}}setProperty(e,t,r){const n=this.featureCount;if(this._checkBatchId(e),k("string"==typeof t,t),this._binaryProperties){const n=this._binaryProperties[t];if(n)return void this._setBinaryProperty(n,e,r)}if(this._hierarchy&&this._setHierarchyProperty(this,e,t,r))return;let i=this._properties[t];No(i)||(this._properties[t]=new Array(n),i=this._properties[t]),i[e]=zo(r)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,t){return e.unpack(e.typedArray,t)}_setBinaryProperty(e,t,r){e.pack(r,e.typedArray,t)}_initializeBinaryProperties(){let e=null;for(const t in this._properties){const r=this._properties[t],n=this._initializeBinaryProperty(t,r);n&&(e=e||{},e[t]=n)}return e}_initializeBinaryProperty(e,t){if("byteOffset"in t){const r=t;k(this.binary,"Property ".concat(e," requires a batch table binary.")),k(r.type,"Property ".concat(e," requires a type."));const n=function(e,t,r,n){const{componentType:i}=e;k(e.componentType);const a="string"==typeof i?Bo.fromName(i):i,o=Ro[e.type],s=Io[e.type],c=Po[e.type];return r+=e.byteOffset,{values:Bo.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:c}}(r,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}_hasPropertyInHierarchy(e,t){if(!this._hierarchy)return!1;const r=Fo(this._hierarchy,e,(e,r)=>{const n=e.classIds[r];return No(e.classes[n].instances[t])});return No(r)}_getPropertyNamesInHierarchy(e,t){Fo(this._hierarchy,e,(e,r)=>{const n=e.classIds[r],i=e.classes[n].instances;for(const e in i)i.hasOwnProperty(e)&&-1===t.indexOf(e)&&t.push(e)})}_getHierarchyProperty(e,t){return Fo(this._hierarchy,e,(e,r)=>{const n=e.classIds[r],i=e.classes[n],a=e.classIndexes[r],o=i.instances[t];return No(o)?No(o.typedArray)?this._getBinaryProperty(o,a):zo(o[a]):null})}_setHierarchyProperty(e,t,r,n){const i=Fo(this._hierarchy,t,(e,i)=>{const a=e.classIds[i],o=e.classes[a],s=e.classIndexes[i],c=o.instances[r];return!!No(c)&&(k(i===t,'Inherited property "'.concat(r,'" is read-only.')),No(c.typedArray)?this._setBinaryProperty(c,s,n):c[s]=zo(n),!0)});return No(i)}}function Ho(e,t,r=0){const n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=4,e.version=n.getUint32(r,!0),r+=4,e.byteLength=n.getUint32(r,!0),r+=4,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return r}function Go(e,t,r){const n=new DataView(t);let i;e.header=e.header||{};let a=n.getUint32(r,!0);r+=4;let o=n.getUint32(r,!0);r+=4;let s=n.getUint32(r,!0);r+=4;let c=n.getUint32(r,!0);return r+=4,s>=570425344?(r-=8,i=a,s=o,c=0,a=0,o=0,console.warn("b3dm tile in legacy format.")):c>=570425344&&(r-=4,i=s,s=a,c=o,a=0,o=0,console.warn("b3dm tile in legacy format.")),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=c,e.header.batchLength=i,r}function Vo(e,t,r,n){return r=function(e,t,r,n){const{featureTableJsonByteLength:i,featureTableBinaryByteLength:a,batchLength:o}=e.header;if(e.featureTableJson={BATCH_LENGTH:o||0},i>0){const n=Ia(t,r,i);e.featureTableJson=JSON.parse(n)}return r+=i,e.featureTableBinary=new Uint8Array(t,r,a),r+=a}(e,t,r),r=function(e,t,r,n){const{batchTableJsonByteLength:i,batchTableBinaryByteLength:a}=e.header;if(i>0){const n=Ia(t,r,i);e.batchTableJson=JSON.parse(n),r+=i,a>0&&(e.batchTableBinary=new Uint8Array(t,r,a),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=a)}return r}(e,t,r)}function Wo(e,t=[0,0,0]){const r=e>>11&31,n=e>>5&63,i=31&e;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}function Ko(e,t,r){if(!(t||e&&e.batchIds&&r))return null;const{batchIds:n,isRGB565:i,pointCount:a}=e;if(n&&r){const e=new Uint8ClampedArray(3*a);for(let t=0;t<a;t++){const i=n[t],a=r.getProperty(i,"dimensions").map(e=>255*e);e[3*t]=a[0],e[3*t+1]=a[1],e[3*t+2]=a[2]}return{type:jo.UNSIGNED_BYTE,value:e,size:3,normalized:!0}}if(i){const e=new Uint8ClampedArray(3*a);for(let r=0;r<a;r++){const n=Wo(t[r]);e[3*r]=n[0],e[3*r+1]=n[1],e[3*r+2]=n[2]}return{type:jo.UNSIGNED_BYTE,value:e,size:3,normalized:!0}}return t&&t.length===3*a?{type:jo.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:jo.UNSIGNED_BYTE,value:t,size:4,normalized:!0}}class Jo extends kr{constructor(e=0,t=0){super(2),Dt(e)&&1===arguments.length?this.copy(e):(It.debug&&(qt(e),qt(t)),this[0]=e,this[1]=t)}set(e,t){return this[0]=e,this[1]=t,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this.check()}fromObject(e){return It.debug&&(qt(e.x),qt(e.y)),this[0]=e.x,this[1]=e.y,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return nr(this,this,e),this.check()}transformAsVector(e){return Jt(this,this,e),this.check()}transformByMatrix3(e){return rr(this,this,e),this.check()}transformByMatrix2x3(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5]}(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i}(this,this,e),this.check()}}function Qo(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}new Jo,new Ar,new Jo,new Jo,new Uint8Array(1);function Yo(e,t=255){return zt(e,0,t)/t*2-1}function Xo(e){return e<0?-1:1}function Zo(e,t,r,n){if(Qo(n),e<0||e>r||t<0||t>r)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(r));if(n.x=Yo(e,r),n.y=Yo(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){const e=n.x;n.x=(1-Math.abs(n.y))*Xo(e),n.y=(1-Math.abs(e))*Xo(n.y)}return n.normalize()}function $o(e,t,r){return Zo(e,t,255,r)}const es=new Ar;function ts(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,function(e,t){const r=new Ar,n=new Float32Array(3*e.pointCount);for(let i=0;i<e.pointCount;i++)r.set(t[3*i],t[3*i+1],t[3*i+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,3*i);return n}(e,t)):{type:jo.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}async function rs(e,t,r,n,i){r=Vo(e,t,r=Go(e,t,r=Ho(e,t,r))),function(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}(e);const{featureTable:a,batchTable:o}=function(e){const t=new Oo(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",jo.FLOAT,3);const n=function(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",jo.UNSIGNED_SHORT,1),e.batchIds)){const n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:i,batchTableBinary:a}=e;r=new qo(i,a,n)}return r}(e,t);return{featureTable:t,batchTable:n}}(e);return await async function(e,t,r,n,i){let a,o,s;const c=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];c&&(s=c.properties);const u=t.getExtension("3DTILES_draco_point_compression");if(u){o=u.properties;const t=u.byteOffset,r=u.byteLength;if(!o||!Number.isFinite(t)||!r)throw new Error("Draco properties, byteOffset, and byteLength must be defined");a=e.featureTableBinary.slice(t,t+r),e.hasPositions=Number.isFinite(o.POSITION),e.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),e.hasNormals=Number.isFinite(o.NORMAL),e.hasBatchIds=Number.isFinite(o.BATCH_ID),e.isTranslucent=Number.isFinite(o.RGBA)}if(!a)return!0;const l={buffer:a,properties:{...o,...s},featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await async function(e,t,r,n){const{parse:i}=n,a={...r,draco:{...r.draco,extraAttributes:t.batchTableProperties||{}}};delete a["3d-tiles"];const o=await i(t.buffer,Ao,a),s=o.attributes.POSITION&&o.attributes.POSITION.value,c=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,u=o.attributes.NORMAL&&o.attributes.NORMAL.value,l=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,h=s&&o.attributes.POSITION.value.quantization,p=u&&o.attributes.NORMAL.value.quantization;if(h){const t=o.POSITION.data.quantization,r=t.range;e.quantizedVolumeScale=new Ar(r,r,r),e.quantizedVolumeOffset=new Ar(t.minValues),e.quantizedRange=(1<<t.quantizationBits)-1,e.isQuantizedDraco=!0}p&&(e.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);const f={};if(t.batchTableProperties)for(const e of Object.keys(t.batchTableProperties))o.attributes[e]&&o.attributes[e].value&&(f[e.toLowerCase()]=o.attributes[e].value);e.attributes={positions:s,colors:Ko(e,c,void 0),normals:u,batchIds:l,...f}}(e,l,n,i)}(e,a,0,n,i),function(e,t,r){if(!e.attributes.positions)if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",jo.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){const n=t.getPropertyArray("POSITION_QUANTIZED",jo.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=65535,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",jo.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",jo.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=ts(e,n,r)}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(e,a,n),function(e,t,r){if(!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",jo.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",jo.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",jo.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=Ko(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",jo.UNSIGNED_BYTE,4))}(e,a,o),function(e,t){if(!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",jo.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",jo.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=function(e,t){if(!t)return null;if(e.isOctEncoded16P){const r=new Float32Array(3*e.pointsLength);for(let n=0;n<e.pointsLength;n++)$o(t[2*n],t[2*n+1],es),es.toArray(r,3*n);return{type:jo.FLOAT,size:2,value:r}}return{type:jo.FLOAT,size:2,value:t}}(e,r)}}(e,a),r}const ns="https://unpkg.com/@loaders.gl/textures@".concat("3.1.7","/dist/libs/basis_encoder.wasm"),is="https://unpkg.com/@loaders.gl/textures@".concat("3.1.7","/dist/libs/basis_encoder.js");let as,os;async function ss(e){const t=e.modules||{};return t.basis?t.basis:(as=as||async function(e){let t=null,r=null;return[t,r]=await Promise.all([await go("basis_transcoder.js","textures",e),await go("basis_transcoder.wasm","textures",e)]),t=t||globalThis.BASIS,await function(e,t){const r={};t&&(r.wasmBinary=t);return new Promise(t=>{e(r).then(e=>{const{BasisFile:r,initializeBasis:n}=e;n(),t({BasisFile:r})})})}(t,r)}(e),await as)}async function cs(e){const t=e.modules||{};return t.basisEncoder?t.basisEncoder:(os=os||async function(e){let t=null,r=null;return[t,r]=await Promise.all([await go(is,"textures",e),await go(ns,"textures",e)]),t=t||globalThis.BASIS,await function(e,t){const r={};t&&(r.wasmBinary=t);return new Promise(t=>{e(r).then(e=>{const{BasisFile:r,KTX2File:n,initializeBasis:i,BasisEncoder:a}=e;i(),t({BasisFile:r,KTX2File:n,BasisEncoder:a})})})}(t,r)}(e),await os)}const us={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919},ls=["","WEBKIT_","MOZ_"],hs={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let ps=null;function fs(e){if(!ps){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,ps=new Set;for(const t of ls)for(const r in hs)if(e&&e.getExtension("".concat(t).concat(r))){const e=hs[r];ps.add(e)}}return ps}new Uint8Array([0]);const ds=[171,75,84,88,32,50,48,187,13,10,26,10];var ms,gs,bs,ys,vs,ws,_s,ks,xs;(xs=ms||(ms={}))[xs.NONE=0]="NONE",xs[xs.BASISLZ=1]="BASISLZ",xs[xs.ZSTD=2]="ZSTD",xs[xs.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(gs||(gs={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(bs||(bs={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(ys||(ys={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(vs||(vs={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(ws||(ws={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(_s||(_s={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(ks||(ks={}));class Es{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=ms.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:gs.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:bs.UNSPECIFIED,colorPrimaries:ys.SRGB,transferFunction:ys.SRGB,flags:ws.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}}class As{constructor(e,t,r,n){this._dataView=new DataView(e.buffer,e.byteOffset+t,r),this._littleEndian=n,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const r=this._offset;let n=0;for(;this._dataView.getUint8(this._offset)!==t&&n<e;)n++,this._offset++;return n<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+r,n)}}function Ss(e){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(e):Buffer.from(e).toString("utf8")}function js(e,t){const r=new Array(t.mipMapLevels);let n=t.width,i=t.height,a=0;for(let o=0;o<t.mipMapLevels;++o){const s=Cs(t,n,i,e,o),c=Ts(e,o,a,s);r[o]={compressed:!0,format:t.internalFormat,data:c,width:n,height:i,levelSize:s},n=Math.max(1,n>>1),i=Math.max(1,i>>1),a+=s}return r}function Ts(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function Cs(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}const Bs={131:us.COMPRESSED_RGB_S3TC_DXT1_EXT,132:us.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:us.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:us.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:us.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:us.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:us.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:us.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:us.COMPRESSED_RED_RGTC1_EXT,140:us.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:us.COMPRESSED_RED_GREEN_RGTC2_EXT,142:us.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:us.COMPRESSED_RGB8_ETC2,148:us.COMPRESSED_SRGB8_ETC2,149:us.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:us.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:us.COMPRESSED_RGBA8_ETC2_EAC,152:us.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:us.COMPRESSED_R11_EAC,154:us.COMPRESSED_SIGNED_R11_EAC,155:us.COMPRESSED_RG11_EAC,156:us.COMPRESSED_SIGNED_RG11_EAC,157:us.COMPRESSED_RGBA_ASTC_4x4_KHR,158:us.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:us.COMPRESSED_RGBA_ASTC_5x4_KHR,160:us.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:us.COMPRESSED_RGBA_ASTC_5x5_KHR,162:us.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:us.COMPRESSED_RGBA_ASTC_6x5_KHR,164:us.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:us.COMPRESSED_RGBA_ASTC_6x6_KHR,166:us.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:us.COMPRESSED_RGBA_ASTC_8x5_KHR,168:us.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:us.COMPRESSED_RGBA_ASTC_8x6_KHR,170:us.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:us.COMPRESSED_RGBA_ASTC_8x8_KHR,172:us.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:us.COMPRESSED_RGBA_ASTC_10x5_KHR,174:us.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:us.COMPRESSED_RGBA_ASTC_10x6_KHR,176:us.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:us.COMPRESSED_RGBA_ASTC_10x8_KHR,178:us.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:us.COMPRESSED_RGBA_ASTC_10x10_KHR,180:us.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:us.COMPRESSED_RGBA_ASTC_12x10_KHR,182:us.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:us.COMPRESSED_RGBA_ASTC_12x12_KHR,184:us.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:us.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:us.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:us.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:us.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:us.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:us.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:us.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:us.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:us.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:us.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:us.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:us.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:us.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:us.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:us.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:us.COMPRESSED_RGBA_ASTC_12x12_KHR};const Os=[171,75,84,88,32,50,48,187,13,10,26,10];function Rs(e){const t=new Uint8Array(e);return!(t.byteLength<Os.length||t[0]!==Os[0]||t[1]!==Os[1]||t[2]!==Os[2]||t[3]!==Os[3]||t[4]!==Os[4]||t[5]!==Os[5]||t[6]!==Os[6]||t[7]!==Os[7]||t[8]!==Os[8]||t[9]!==Os[9]||t[10]!==Os[10]||t[11]!==Os[11])}function Is(e){const t=function(e){const t=new Uint8Array(e.buffer,e.byteOffset,ds.length);if(t[0]!==ds[0]||t[1]!==ds[1]||t[2]!==ds[2]||t[3]!==ds[3]||t[4]!==ds[4]||t[5]!==ds[5]||t[6]!==ds[6]||t[7]!==ds[7]||t[8]!==ds[8]||t[9]!==ds[9]||t[10]!==ds[10]||t[11]!==ds[11])throw new Error("Missing KTX 2.0 identifier.");const r=new Es,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new As(e,ds.length,n,!0);r.vkFormat=i._nextUint32(),r.typeSize=i._nextUint32(),r.pixelWidth=i._nextUint32(),r.pixelHeight=i._nextUint32(),r.pixelDepth=i._nextUint32(),r.layerCount=i._nextUint32(),r.faceCount=i._nextUint32();const a=i._nextUint32();r.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),s=i._nextUint32(),c=i._nextUint32(),u=i._nextUint32(),l=i._nextUint64(),h=i._nextUint64(),p=new As(e,ds.length+n,3*a*8,!0);for(let t=0;t<a;t++)r.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+p._nextUint64(),p._nextUint64()),uncompressedByteLength:p._nextUint64()});const f=new As(e,o,s,!0),d={vendorId:f._skip(4)._nextUint16(),descriptorType:f._nextUint16(),versionNumber:f._nextUint16(),descriptorBlockSize:f._nextUint16(),colorModel:f._nextUint8(),colorPrimaries:f._nextUint8(),transferFunction:f._nextUint8(),flags:f._nextUint8(),texelBlockDimension:{x:f._nextUint8()+1,y:f._nextUint8()+1,z:f._nextUint8()+1,w:f._nextUint8()+1},bytesPlane:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],samples:[]},m=(d.descriptorBlockSize/4-6)/4;for(let e=0;e<m;e++)d.samples[e]={bitOffset:f._nextUint16(),bitLength:f._nextUint8(),channelID:f._nextUint8(),samplePosition:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],sampleLower:f._nextUint32(),sampleUpper:f._nextUint32()};r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(d);const g=new As(e,c,u,!0);for(;g._offset<u;){const e=g._nextUint32(),t=g._scan(e),n=Ss(t),i=g._scan(e-t.byteLength);r.keyValue[n]=n.match(/^ktx/i)?Ss(i):i,e%4&&g._skip(4-e%4)}if(h<=0)return r;const b=new As(e,l,h,!0),y=b._nextUint16(),v=b._nextUint16(),w=b._nextUint32(),_=b._nextUint32(),k=b._nextUint32(),x=b._nextUint32(),E=[];for(let e=0;e<a;e++)E.push({imageFlags:b._nextUint32(),rgbSliceByteOffset:b._nextUint32(),rgbSliceByteLength:b._nextUint32(),alphaSliceByteOffset:b._nextUint32(),alphaSliceByteLength:b._nextUint32()});const A=l+b._offset,S=A+w,j=S+_,T=j+k,C=new Uint8Array(e.buffer,e.byteOffset+A,w),B=new Uint8Array(e.buffer,e.byteOffset+S,_),O=new Uint8Array(e.buffer,e.byteOffset+j,k),R=new Uint8Array(e.buffer,e.byteOffset+T,x);return r.globalData={endpointCount:y,selectorCount:v,imageDescs:E,endpointsData:C,selectorsData:B,tablesData:O,extendedData:R},r}(new Uint8Array(e)),r=Math.max(1,t.levels.length),n=t.pixelWidth,i=t.pixelHeight,a=(o=t.vkFormat,Bs[o]);var o;return js(t.levels,{mipMapLevels:r,width:n,height:i,sizeFunction:e=>e.uncompressedByteLength,internalFormat:a})}const Ps={etc1:{basisFormat:0,compressed:!0,format:us.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:us.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:us.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:us.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:us.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:us.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function Ds(e,t){if("auto"===t.basis.containerFormat){if(Rs(e)){return Ls((await cs(t)).KTX2File,e,t)}const{BasisFile:r}=await ss(t);return Ms(r,e,t)}switch(t.basis.module){case"encoder":const r=await cs(t);switch(t.basis.containerFormat){case"ktx2":return Ls(r.KTX2File,e,t);case"basis":default:return Ms(r.BasisFile,e,t)}case"transcoder":default:const{BasisFile:n}=await ss(t);return Ms(n,e,t)}}function Ms(e,t,r){const n=new e(new Uint8Array(t));try{if(!n.startTranscoding())return null;const e=n.getNumImages(),t=[];for(let i=0;i<e;i++){const e=n.getNumLevels(i),a=[];for(let t=0;t<e;t++)a.push(Fs(n,i,t,r));t.push(a)}return t}finally{n.close(),n.delete()}}function Fs(e,t,r,n){const i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:c,basisFormat:u}=zs(n,o),l=e.getImageTranscodedSizeInBytes(t,r,u),h=new Uint8Array(l);return e.transcodeImage(h,t,r,u,0,0)?{width:i,height:a,data:h,compressed:s,hasAlpha:o,format:c}:null}function Ls(e,t,r){const n=new e(new Uint8Array(t));try{if(!n.startTranscoding())return null;const e=n.getLevels(),t=[];for(let i=0;i<e;i++){t.push(Ns(n,i,r));break}return t}finally{n.close(),n.delete()}}function Ns(e,t,r){const{alphaFlag:n,height:i,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:c}=zs(r,n),u=e.getImageTranscodedSizeInBytes(t,0,0,c),l=new Uint8Array(u);return e.transcodeImage(l,t,0,0,c,0,-1,-1)?{width:a,height:i,data:l,compressed:o,alphaFlag:n,format:s}:null}function zs(e,t){let r=e&&e.basis&&e.basis.format;return"auto"===r&&(r=Us()),"object"==typeof r&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),Ps[r]}function Us(){const e=fs();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}const qs={name:"Basis",id:"basis",module:"textures",version:"3.1.7",worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},Hs={...qs,parse:Ds},{_parseImageNode:Gs}=globalThis,Vs="undefined"!=typeof Image,Ws="undefined"!=typeof ImageBitmap,Ks=Boolean(Gs),Js=!!Ee||Ks;function Qs(e){const t=Xs(e);if(!t)throw new Error("Not an image");return t}function Ys(e){switch(Qs(e)){case"data":return e;case"image":case"imagebitmap":const t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function Xs(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"==typeof e&&e.data&&e.width&&e.height?"data":null}const Zs=/^data:image\/svg\+xml/,$s=/\.svg((\?|#).*)?$/;function ec(e){return e&&(Zs.test(e)||$s.test(e))}function tc(e,t){if(ec(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function rc(e,t,r){const n=function(e,t){if(ec(t)){let t=(new TextDecoder).decode(e);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(t=unescape(encodeURIComponent(t)))}catch(e){throw new Error(e.message)}return"data:image/svg+xml;base64,".concat(btoa(t))}return tc(e,t)}(e,r),i=self.URL||self.webkitURL,a="string"!=typeof n&&i.createObjectURL(n);try{return await async function(e,t){const r=new Image;if(r.src=e,t.image&&t.image.decode&&r.decode)return await r.decode(),r;return await new Promise((t,n)=>{try{r.onload=()=>t(r),r.onerror=t=>n(new Error("Could not load image ".concat(e,": ").concat(t)))}catch(e){n(e)}})}(a||n,t)}finally{a&&i.revokeObjectURL(a)}}const nc={};let ic=!0;async function ac(e,t,r){let n;if(ec(r)){n=await rc(e,t,r)}else n=tc(e,r);const i=t&&t.imagebitmap;return await async function(e,t=null){!function(e){for(const t in e||nc)return!1;return!0}(t)&&ic||(t=null);if(t)try{return await createImageBitmap(e,t)}catch(e){console.warn(e),ic=!1}return await createImageBitmap(e)}(n,i)}function oc(e){const t=sc(e);return function(e){const t=sc(e);if(!(t.byteLength>=24&&2303741511===t.getUint32(0,!1)))return null;return{mimeType:"image/png",width:t.getUint32(16,!1),height:t.getUint32(20,!1)}}(t)||function(e){const t=sc(e);if(!(t.byteLength>=3&&65496===t.getUint16(0,!1)&&255===t.getUint8(2)))return null;const{tableMarkers:r,sofMarkers:n}=function(){const e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);const t=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:t}}();let i=2;for(;i+9<t.byteLength;){const e=t.getUint16(i,!1);if(n.has(e))return{mimeType:"image/jpeg",height:t.getUint16(i+5,!1),width:t.getUint16(i+7,!1)};if(!r.has(e))return null;i+=2,i+=t.getUint16(i,!1)}return null}(t)||function(e){const t=sc(e);if(!(t.byteLength>=10&&1195984440===t.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:t.getUint16(6,!0),height:t.getUint16(8,!0)}}(t)||function(e){const t=sc(e);if(!(t.byteLength>=14&&16973===t.getUint16(0,!1)&&t.getUint32(2,!0)===t.byteLength))return null;return{mimeType:"image/bmp",width:t.getUint32(18,!0),height:t.getUint32(22,!0)}}(t)}function sc(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}const cc={id:"image",module:"images",name:"Images",version:"3.1.7",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(e,t,r){const n=((t=t||{}).image||{}).type||"auto",{url:i}=r||{};let a;switch(function(e){switch(e){case"auto":case"data":return function(){if(Ws)return"imagebitmap";if(Vs)return"image";if(Js)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return Ws||Vs||Js;case"imagebitmap":return Ws;case"image":return Vs;case"data":return Js;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}(n)){case"imagebitmap":a=await ac(e,t,i);break;case"image":a=await rc(e,t,i);break;case"data":a=await async function(e,t){const{mimeType:r}=oc(e)||{},n=globalThis._parseImageNode;return k(n),await n(e,r)}(e);break;default:k(!1)}return"data"===n&&(a=Ys(a)),a},tests:[e=>Boolean(oc(new DataView(e)))],options:{image:{type:"auto",decode:!0}}};function uc(e,t,r){if(e.byteLength<=t+r)return"";const n=new DataView(e);let i="";for(let e=0;e<r;e++)i+=String.fromCharCode(n.getUint8(t+e));return i}function lc(e){try{return JSON.parse(e)}catch(t){throw new Error('Failed to parse JSON from data starting with "'.concat(function(e,t=5){if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return uc(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){return uc(e,0,t)}return""}(e),'"'))}}function hc(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function pc(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;const r=t.baseUri||t.uri;if(!r)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return r.substr(0,r.lastIndexOf("/")+1)+e}function fc(e,t,r){const n=e.bufferViews[r];hc(n);const i=t[n.buffer];hc(i);const a=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,a,n.byteLength)}function dc(e,t){return k(e>=0),k(t>0),e+(t-1)&~(t-1)}function mc(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{const t=e.byteOffset,r=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,t,r)}return t.set(n,r),r+dc(n.byteLength,4)}const gc=["SCALAR","VEC2","VEC3","VEC4"],bc=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],yc=new Map(bc),vc={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},wc={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},_c={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function kc(e){return gc[e-1]||gc[0]}function xc(e){const t=yc.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Ec(e,t){const r=_c[e.componentType],n=vc[e.type],i=wc[e.componentType],a=e.count*n,o=e.count*n*i;return hc(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}const Ac={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class Sc{constructor(e){Object(p.a)(this,"gltf",void 0),Object(p.a)(this,"sourceBuffers",void 0),Object(p.a)(this,"byteLength",void 0),this.gltf=e||{json:{...Ac},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){const t=this.getUsedExtensions().find(t=>t===e),r=this.json.extensions||{};return t?r[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(t=>t===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const r=this.json[e]&&this.json[e][t];if(!r)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return r}getTypedArrayForBufferView(e){const t=(e=this.getBufferView(e)).buffer,r=this.gltf.buffers[t];hc(r);const n=(e.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:n,length:i}=Ec(e,t);return new n(r,t.byteOffset+e.byteOffset,i)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=t.byteOffset||0;return new Uint8Array(r,n,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,r){return e.extensions=e.extensions||{},e.extensions[t]=r,this.registerUsedExtension(t),this}setObjectExtension(e,t,r){(e.extensions||{})[t]=r}removeObjectExtension(e,t){const r=e.extensions||{},n=r[t];return delete r[t],n}addExtension(e,t={}){return hc(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return hc(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:r}=e;this.json.nodes=this.json.nodes||[];const n={mesh:t};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:r,material:n,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(r){const e=this._addIndices(r);a.primitives[0].indices=e}return Number.isFinite(n)&&(a.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}addImage(e,t){const r=oc(e),n=t||(null==r?void 0:r.mimeType),i={bufferView:this.addBufferView(e),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(e){const t=e.byteLength;hc(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const r={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=dc(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}addAccessor(e,t){const r={bufferView:e,type:kc(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const r=this.addBufferView(e);let n={min:t.min,max:t.max};n.min&&n.max||(n=this._getAccessorMinMax(e,t.size));const i={size:t.size,componentType:xc(e),count:Math.round(e.length/t.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(i,t))}addTexture(e){const{imageIndex:t}=e,r={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(r),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const r=this.byteLength,n=new ArrayBuffer(r),i=new Uint8Array(n);let a=0;for(const e of this.sourceBuffers||[])a=mc(e,i,a);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=r:this.json.buffers=[{byteLength:r}],this.gltf.binary=n,this.sourceBuffers=[n]}_removeStringFromArray(e,t){let r=!0;for(;r;){const n=e.indexOf(t);n>-1?e.splice(n,1):r=!1}}_addAttributes(e={}){const t={};for(const r in e){const n=e[r],i=this._getGltfAttributeName(r),a=this.addBinaryBuffer(n.value,n);t[i]=a}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const r={min:null,max:null};if(e.length<t)return r;r.min=[],r.max=[];const n=e.subarray(0,t);for(const e of n)r.min.push(e),r.max.push(e);for(let n=t;n<e.length;n+=t)for(let i=0;i<t;i++)r.min[0+i]=Math.min(r.min[0+i],e[n+i]),r.max[0+i]=Math.max(r.max[0+i],e[n+i]);return r}}const jc="object"!=typeof WebAssembly,Tc=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Cc=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Bc={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Oc={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};let Rc;async function Ic(){return Rc||(Rc=async function(){let e="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(Tc)&&(e="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",console.log("Warning: meshopt_decoder is using experimental SIMD support"));const t=await WebAssembly.instantiate(function(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);t[r]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?Cc[t[n]]:64*(t[n]-60)+t[++n];return t.buffer.slice(0,r)}(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}()),Rc}function Pc(e,t,r,n,i,a,o){const s=e.exports.sbrk,c=n+3&-4,u=s(c*i),l=s(a.length),h=new Uint8Array(e.exports.memory.buffer);h.set(a,l);const p=t(u,n,i,l,a.length);if(0===p&&o&&o(u,c,i),r.set(h.subarray(u,u+n*i)),s(u-s(0)),0!==p)throw new Error("Malformed buffer data: ".concat(p))}const Dc="EXT_meshopt_compression";function Mc(e){if(new Sc(e).getRequiredExtensions().includes("EXT_meshopt_compression")&&!jc)throw new Error("gltf: Required extension ".concat("EXT_meshopt_compression"," not supported by browser"))}async function Fc(e,t){var r;const n=new Sc(e);if(null==t||null===(r=t.gltf)||void 0===r||!r.decompressMeshes)return;const i=[];for(const t of e.json.bufferViews||[])i.push(Lc(n,t));await Promise.all(i),n.removeExtension("EXT_meshopt_compression")}async function Lc(e,t){const r=e.getObjectExtension(t,"EXT_meshopt_compression");if(r){const e=t.buffer,{byteOffset:n=0,byteLength:i=0,byteStride:a,count:o,mode:s,filter:c="NONE"}=r,u=new Uint8Array(e,n,i),l=new ArrayBuffer(o*a);return await async function(e,t,r,n,i,a="NONE"){const o=await Ic();Pc(o,o.exports[Oc[i]],e,t,r,n,o.exports[Bc[a||"NONE"]])}(new Uint8Array(l),o,a,u,s,c),l}return null}const Nc=["image/png","image/jpeg","image/gif"],zc={};function Uc(e){return void 0===zc[e]&&(zc[e]=function(e){switch(e){case"image/webp":return function(){if(!Ee)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch{return!1}}();case"image/svg":return Ee;default:if(!Ee){const{_parseImageNode:t}=globalThis;return Boolean(t)&&Nc.includes(e)}return!0}}(e)),zc[e]}const qc="EXT_texture_webp";function Hc(e,t){const r=new Sc(e);if(!Uc("image/webp")){if(r.getRequiredExtensions().includes("EXT_texture_webp"))throw new Error("gltf: Required extension ".concat("EXT_texture_webp"," not supported by browser"));return}const{json:n}=r;for(const e of n.textures||[]){const t=r.getObjectExtension(e,"EXT_texture_webp");t&&(e.source=t.source),r.removeObjectExtension(e,"EXT_texture_webp")}r.removeExtension("EXT_texture_webp")}const Gc="KHR_texture_basisu";function Vc(e,t){const r=new Sc(e),{json:n}=r;for(const e of n.textures||[]){const t=r.getObjectExtension(e,"KHR_texture_basisu");t&&(e.source=t.source),r.removeObjectExtension(e,"KHR_texture_basisu")}r.removeExtension("KHR_texture_basisu")}function Wc(e){const{buffer:t,size:r,count:n}=function(e){let t=e,r=1,n=0;e&&e.value&&(t=e.value,r=e.size||1);t&&(ArrayBuffer.isView(t)||(t=function(e,t,r=!1){if(!e)return null;if(Array.isArray(e))return new t(e);if(r&&!(e instanceof t))return new t(e);return e}(t,Float32Array)),n=t.length/r);return{buffer:t,size:r,count:n}}(e);return{value:t,size:r,byteOffset:0,count:n,type:kc(r),componentType:xc(t)}}const Kc="KHR_draco_mesh_compression";function Jc(e,t,r){const n=new Sc(e);for(const e of $c(n))n.getObjectExtension(e,"KHR_draco_mesh_compression")}async function Qc(e,t,r){var n;if(null==t||null===(n=t.gltf)||void 0===n||!n.decompressMeshes)return;const i=new Sc(e),a=[];for(const e of $c(i))i.getObjectExtension(e,"KHR_draco_mesh_compression")&&a.push(Xc(i,e,t,r));await Promise.all(a),i.removeExtension("KHR_draco_mesh_compression")}function Yc(e,t={}){const r=new Sc(e);for(const e of r.json.meshes||[])Zc(e,t),r.addRequiredExtension("KHR_draco_mesh_compression")}async function Xc(e,t,r,n){const i=e.getObjectExtension(t,"KHR_draco_mesh_compression");if(!i)return;const a=e.getTypedArrayForBufferView(i.bufferView),o=_e(a.buffer,a.byteOffset),{parse:s}=n,c={...r};delete c["3d-tiles"];const u=await s(o,Ao,c,n),l=function(e){const t={};for(const r in e){const n=e[r];if("indices"!==r){const e=Wc(n);t[r]=e}}return t}(u.attributes);for(const[r,n]of Object.entries(l))if(r in t.attributes){const i=t.attributes[r],a=e.getAccessor(i);null!=a&&a.min&&null!=a&&a.max&&(n.min=a.min,n.max=a.max)}t.attributes=l,u.indices&&(t.indices=Wc(u.indices)),function(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(t)}function Zc(e,t,r=4,n,i){var a;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const o=n.DracoWriter.encodeSync({attributes:e}),s=null==i||null===(a=i.parseSync)||void 0===a?void 0:a.call(i,{attributes:e}),c=n._addFauxAttributes(s.attributes);return{primitives:[{attributes:c,mode:r,extensions:{KHR_draco_mesh_compression:{bufferView:n.addBufferView(o),attributes:c}}}]}}function*$c(e){for(const t of e.json.meshes||[])for(const e of t.primitives)yield e}const eu="KHR_lights_punctual";async function tu(e){const t=new Sc(e),{json:r}=t,n=t.getExtension("KHR_lights_punctual");n&&(t.json.lights=n.lights,t.removeExtension("KHR_lights_punctual"));for(const e of r.nodes||[]){const r=t.getObjectExtension(e,"KHR_lights_punctual");r&&(e.light=r.light),t.removeObjectExtension(e,"KHR_lights_punctual")}}async function ru(e){const t=new Sc(e),{json:r}=t;if(r.lights){const e=t.addExtension("KHR_lights_punctual");hc(!e.lights),e.lights=r.lights,delete r.lights}if(t.json.lights){for(const e of t.json.lights){const r=e.node;t.addObjectExtension(r,"KHR_lights_punctual",e)}delete t.json.lights}}const nu="KHR_materials_unlit";async function iu(e){const t=new Sc(e),{json:r}=t;t.removeExtension("KHR_materials_unlit");for(const e of r.materials||[]){e.extensions&&e.extensions.KHR_materials_unlit&&(e.unlit=!0),t.removeObjectExtension(e,"KHR_materials_unlit")}}function au(e){const t=new Sc(e),{json:r}=t;if(t.materials)for(const e of r.materials||[])e.unlit&&(delete e.unlit,t.addObjectExtension(e,"KHR_materials_unlit",{}),t.addExtension("KHR_materials_unlit"))}const ou="KHR_techniques_webgl";async function su(e){const t=new Sc(e),{json:r}=t,n=t.getExtension("KHR_techniques_webgl");if(n){const e=function(e,t){const{programs:r=[],shaders:n=[],techniques:i=[]}=e,a=new TextDecoder;return n.forEach(e=>{if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=a.decode(t.getTypedArrayForBufferView(e.bufferView))}),r.forEach(e=>{e.fragmentShader=n[e.fragmentShader],e.vertexShader=n[e.vertexShader]}),i.forEach(e=>{e.program=r[e.program]}),i}(n,t);for(const n of r.materials||[]){const r=t.getObjectExtension(n,"KHR_techniques_webgl");r&&(n.technique=Object.assign({},r,e[r.technique]),n.technique.values=uu(n.technique,t)),t.removeObjectExtension(n,"KHR_techniques_webgl")}t.removeExtension("KHR_techniques_webgl")}}async function cu(e,t){}function uu(e,t){const r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(t=>{e.uniforms[t].value&&!(t in r)&&(r[t]=e.uniforms[t].value)}),Object.keys(r).forEach(e=>{"object"==typeof r[e]&&void 0!==r[e].index&&(r[e].texture=t.getTexture(r[e].index))}),r}const lu=[a,o,s,c,u,l,h];function hu(e,t){var r;const n=(null==t||null===(r=t.gltf)||void 0===r?void 0:r.excludeExtensions)||{};return!(e in n&&!n[e])}const pu={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},fu={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class du{constructor(){Object(p.a)(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Object(p.a)(this,"json",void 0)}normalize(e,t){this.json=e.json;const r=e.json;switch(r.asset&&r.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(r.asset.version))}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(r),this._convertTopLevelObjectsToArrays(r),function(e){const t=new Sc(e),{json:r}=t;for(const e of r.images||[]){const r=t.getObjectExtension(e,"KHR_binary_glTF");r&&Object.assign(e,r),t.removeObjectExtension(e,"KHR_binary_glTF")}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension("KHR_binary_glTF")}(e),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in pu)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const r=e[t];if(r&&!Array.isArray(r)){e[t]=[];for(const n in r){const i=r[n];i.id=i.id||n;const a=e[t].length;e[t].push(i),this.idToIndexMap[t][n]=a}}}_convertObjectIdsToArrayIndices(e){for(const t in pu)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:e,indices:r,material:n}=t;for(const t in e)e[t]=this._convertIdToIndex(e[t],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),n&&(t.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(e=>this._convertIdToIndex(e,"node"))),e.meshes&&(e.meshes=e.meshes.map(e=>this._convertIdToIndex(e,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(e=>this._convertIdToIndex(e,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);for(const r of e[t])for(const e in r){const t=r[e],n=this._convertIdToIndex(t,e);r[e]=n}}_convertIdToIndex(e,t){const r=fu[t];if(r in this.idToIndexMap){const n=this.idToIndexMap[r][e];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return n}return e}_updateObjects(e){for(const e of this.json.buffers)delete e.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const r=t.values&&t.values.tex,n=e.textures.findIndex(e=>e.id===r);-1!==n&&(t.pbrMetallicRoughness.baseColorTexture={index:n})}}}const mu={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},gu={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},bu=10240,yu=10241,vu=10242,wu=10243,_u=10497,ku={magFilter:bu,minFilter:yu,wrapS:vu,wrapT:wu},xu={[bu]:9729,[yu]:9986,[vu]:_u,[wu]:_u};class Eu{constructor(){Object(p.a)(this,"baseUri",""),Object(p.a)(this,"json",{}),Object(p.a)(this,"buffers",[]),Object(p.a)(this,"images",[])}postProcess(e,t={}){const{json:r,buffers:n=[],images:i=[],baseUri:a=""}=e;return hc(r),this.baseUri=a,this.json=r,this.buffers=n,this.images=i,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((e,t)=>this._resolveBufferView(e,t))),e.images&&(e.images=e.images.map((e,t)=>this._resolveImage(e,t))),e.samplers&&(e.samplers=e.samplers.map((e,t)=>this._resolveSampler(e,t))),e.textures&&(e.textures=e.textures.map((e,t)=>this._resolveTexture(e,t))),e.accessors&&(e.accessors=e.accessors.map((e,t)=>this._resolveAccessor(e,t))),e.materials&&(e.materials=e.materials.map((e,t)=>this._resolveMaterial(e,t))),e.meshes&&(e.meshes=e.meshes.map((e,t)=>this._resolveMesh(e,t))),e.nodes&&(e.nodes=e.nodes.map((e,t)=>this._resolveNode(e,t))),e.skins&&(e.skins=e.skins.map((e,t)=>this._resolveSkin(e,t))),e.scenes&&(e.scenes=e.scenes.map((e,t)=>this._resolveScene(e,t))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const r=this.json[e]&&this.json[e][t];return r||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),r}_resolveScene(e,t){return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map(e=>this.getNode(e)),e}_resolveNode(e,t){return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map(e=>this.getNode(e))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((e,t)=>{const r=this.getMesh(t);return e.id=r.id,e.primitives=e.primitives.concat(r.primitives),e},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map(e=>{const t=(e={...e}).attributes;e.attributes={};for(const r in t)e.attributes[r]=this.getAccessor(t[r]);return void 0!==e.indices&&(e.indices=this.getAccessor(e.indices)),void 0!==e.material&&(e.material=this.getMaterial(e.material)),e})),e}_resolveMaterial(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture={...e.normalTexture},e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture={...e.occlustionTexture},e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture={...e.emmisiveTexture},e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness={...e.pbrMetallicRoughness};const t=e.pbrMetallicRoughness;t.baseColorTexture&&(t.baseColorTexture={...t.baseColorTexture},t.baseColorTexture.texture=this.getTexture(t.baseColorTexture.index)),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture={...t.metallicRoughnessTexture},t.metallicRoughnessTexture.texture=this.getTexture(t.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){var r,n;if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(r=e.componentType,gu[r]),e.components=(n=e.type,mu[n]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const t=e.bufferView.buffer,{ArrayType:r,byteLength:n}=Ec(e,e.bufferView),i=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+t.byteOffset;let a=t.arrayBuffer.slice(i,i+n);e.bufferView.byteStride&&(a=this._getValueFromInterleavedBuffer(t,i,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new r(a)}return e}_getValueFromInterleavedBuffer(e,t,r,n,i){const a=new Uint8Array(i*n);for(let o=0;o<i;o++){const i=t+o*r;a.set(new Uint8Array(e.arrayBuffer.slice(i,i+n)),o*n)}return a.buffer}_resolveTexture(e,t){return e.id=e.id||"texture-".concat(t),e.sampler="sampler"in e?this.getSampler(e.sampler):xu,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||"sampler-".concat(t),e.parameters={};for(const t in e){const r=this._enumSamplerParameter(t);void 0!==r&&(e.parameters[r]=e[t])}return e}_enumSamplerParameter(e){return ku[e]}_resolveImage(e,t){e.id=e.id||"image-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const r=this.images[t];return r&&(e.image=r),e}_resolveBufferView(e,t){const r=e.buffer,n={id:"bufferView-".concat(t),...e,buffer:this.buffers[r]},i=this.buffers[r].arrayBuffer;let a=this.buffers[r].byteOffset||0;return"byteOffset"in e&&(a+=e.byteOffset),n.data=new Uint8Array(i,a,e.byteLength),n}_resolveCamera(e,t){return e.id=e.id||"camera-".concat(t),e.perspective,e.orthographic,e}}const Au=1735152710;function Su(e,t=0,r={}){const n=new DataView(e),{magic:i=Au}=r,a=n.getUint32(t,!1);return a===i||a===Au}function ju(e,t,r=0,n={}){const i=new DataView(t),a=function(e,t=0){return"".concat(String.fromCharCode(e.getUint8(t+0))).concat(String.fromCharCode(e.getUint8(t+1))).concat(String.fromCharCode(e.getUint8(t+2))).concat(String.fromCharCode(e.getUint8(t+3)))}(i,r+0),o=i.getUint32(r+4,!0),s=i.getUint32(r+8,!0);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=12,e.version){case 1:return function(e,t,r){k(e.header.byteLength>20);const n=t.getUint32(r+0,!0),i=t.getUint32(r+4,!0);return r+=8,k(0===i),Tu(e,t,r,n),r+=n,r+=Cu(e,t,r,e.header.byteLength)}(e,i,r);case 2:return function(e,t,r,n){return k(e.header.byteLength>20),function(e,t,r,n){for(;r+8<=e.header.byteLength;){const i=t.getUint32(r+0,!0),a=t.getUint32(r+4,!0);switch(r+=8,a){case 1313821514:Tu(e,t,r,i);break;case 5130562:Cu(e,t,r,i);break;case 0:n.strict||Tu(e,t,r,i);break;case 1:n.strict||Cu(e,t,r,i)}r+=dc(i,4)}}(e,t,r,n),r+e.header.byteLength}(e,i,r,{});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}function Tu(e,t,r,n){const i=new Uint8Array(t.buffer,r,n),a=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(a),dc(n,4)}function Cu(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),dc(n,4)}async function Bu(e,t,r=0,n,i){var a,o,s,c;!function(e,t,r,n){n.uri&&(e.baseUri=n.uri);if(t instanceof ArrayBuffer&&!Su(t,r,n)){const e=new TextDecoder;t=e.decode(t)}if("string"==typeof t)e.json=lc(t);else if(t instanceof ArrayBuffer){const i={};r=ju(i,t,r,n.glb),hc("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),e._glb=i,e.json=i.json}else hc(!1,"GLTF: must be ArrayBuffer or string");const i=e.json.buffers||[];if(e.buffers=new Array(i.length).fill(null),e._glb&&e._glb.header.hasBinChunk){const{binChunks:t}=e._glb;e.buffers[0]={arrayBuffer:t[0].arrayBuffer,byteOffset:t[0].byteOffset,byteLength:t[0].byteLength}}const a=e.json.images||[];e.images=new Array(a.length).fill({})}(e,t,r,n),function(e,t={}){(new du).normalize(e,t)}(e,{normalize:null==n||null===(a=n.gltf)||void 0===a?void 0:a.normalize}),function(e,t={},r){const n=lu.filter(e=>hu(e.name,t));for(const a of n){var i;null===(i=a.preprocess)||void 0===i||i.call(a,e,t,r)}}(e,n,i);const u=[];if(null!=n&&null!==(o=n.gltf)&&void 0!==o&&o.loadBuffers&&e.json.buffers&&await async function(e,t,r){const n=e.json.buffers||[];for(let o=0;o<n.length;++o){const s=n[o];if(s.uri){var i,a;const{fetch:n}=r;hc(n);const c=pc(s.uri,t),u=await(null==r||null===(i=r.fetch)||void 0===i?void 0:i.call(r,c)),l=await(null==u||null===(a=u.arrayBuffer)||void 0===a?void 0:a.call(u));e.buffers[o]={arrayBuffer:l,byteOffset:0,byteLength:l.byteLength},delete s.uri}}}(e,n,i),null!=n&&null!==(s=n.gltf)&&void 0!==s&&s.loadImages){const t=async function(e,t,r){const n=function(e){const t=new Set,r=e.json.textures||[];for(const e of r)void 0!==e.source&&t.add(e.source);return Array.from(t).sort()}(e),i=e.json.images||[],a=[];for(const o of n)a.push(Ou(e,i[o],o,t,r));return await Promise.all(a)}(e,n,i);u.push(t)}const l=async function(e,t={},r){const n=lu.filter(e=>hu(e.name,t));for(const a of n){var i;await(null===(i=a.decode)||void 0===i?void 0:i.call(a,e,t,r))}}(e,n,i);return u.push(l),await Promise.all(u),null!=n&&null!==(c=n.gltf)&&void 0!==c&&c.postProcess?function(e,t){return(new Eu).postProcess(e,t)}(e,n):e}async function Ou(e,t,r,n,i){const{fetch:a,parse:o}=i;let s;if(t.uri){const e=pc(t.uri,n),r=await a(e);s=await r.arrayBuffer()}if(Number.isFinite(t.bufferView)){const r=fc(e.json,e.buffers,t.bufferView);s=_e(r.buffer,r.byteOffset,r.byteLength)}hc(s,"glTF image has no data");let c=await o(s,[cc,Hs],{mimeType:t.mimeType,basis:n.basis||{format:Us()}},i);c&&c[0]&&(c={compressed:!0,mipmaps:!1,width:c[0].width,height:c[0].height,data:c}),e.images=e.images||[],e.images[r]=c}const Ru={name:"glTF",id:"gltf",module:"gltf",version:"3.1.7",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(e,t={},r){(t={...Ru.options,...t}).gltf={...Ru.options.gltf,...t.gltf};const{byteOffset:n=0}=t;return await Bu({},e,n,t,r)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};const Iu=0,Pu=1;function Du(e,t,r,n){e.rotateYtoZ=!0;const i=e.byteOffset+e.byteLength-r;if(0===i)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=_e(t,r,i),e.gltfByteOffset=0,e.gltfByteLength=i,r%4==0||console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.byteOffset+e.byteLength}async function Mu(e,t,r,n){const i=r["3d-tiles"]||{};if(function(e,t,r){switch(t){case Iu:const t=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),r=(new TextDecoder).decode(t);e.gltfUrl=r.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case Pu:break;default:throw new Error("b3dm: Illegal glTF format field")}}(e,t),i.loadGLTF){const{parse:t,fetch:i}=n;e.gltfUrl&&(e.gltfArrayBuffer=await i(e.gltfUrl,r),e.gltfByteOffset=0),e.gltfArrayBuffer&&(e.gltf=await t(e.gltfArrayBuffer,Ru,r,n),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength)}}async function Fu(e,t,r,n,i){var a;r=function(e,t,r,n,i){r=Ho(e,t,r),r=Go(e,t,r),r=Vo(e,t,r),r=Du(e,t,r,n);const a=new Oo(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",jo.FLOAT,3),r}(e,t,r,n),await Mu(e,Pu,n,i);const o=null==e||null===(a=e.gltf)||void 0===a?void 0:a.extensions;return o&&o.CESIUM_RTC&&(e.rtcCenter=o.CESIUM_RTC.center),r}async function Lu(e,t,r,n,i){return r=function(e,t,r,n,i){if(r=Ho(e,t,r),1!==e.version)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));r=Go(e,t,r);const a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r=Vo(e,t,r+=4),r=Du(e,t,r,n),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const o=new Oo(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",jo.FLOAT,3);new qo(e.batchTableJson,e.batchTableBinary,s);return function(e,t,r,n){const i=[new Array(n),e._batchTable][0],a=new Ar,o=new Ar,s=new Ar,c=new Ar,u=new kn,l=new Hn,h=new Ar,p={},f=new _r,d=[],m=[],g=new Ar,b=new Ar;for(let r=0;r<n;r++){let n;if(t.hasProperty("POSITION"))n=t.getProperty("POSITION",jo.FLOAT,3,r,a);else if(t.hasProperty("POSITION_QUANTIZED")){n=t.getProperty("POSITION_QUANTIZED",jo.UNSIGNED_SHORT,3,r,a);const e=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",jo.FLOAT,3,g);if(!e)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const i=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",jo.FLOAT,3,b);if(!i)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const o=65535;for(let t=0;t<3;t++)n[t]=n[t]/o*i[t]+e[t]}if(!n)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(n),p.translation=a,e.normalUp=t.getProperty("NORMAL_UP",jo.FLOAT,3,r,d),e.normalRight=t.getProperty("NORMAL_RIGHT",jo.FLOAT,3,r,m);const y=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",jo.UNSIGNED_SHORT,2,d),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",jo.UNSIGNED_SHORT,2,m),e.octNormalUp){if(!e.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}e.eastNorthUp?(Zr.WGS84.eastNorthUpToFixedFrame(a,f),f.getRotationMatrix3(u)):u.identity()}y&&(c.copy(o).cross(s).normalize(),u.setColumn(0,o),u.setColumn(1,s),u.setColumn(2,c)),l.fromMatrix3(u),p.rotation=l,h.set(1,1,1);const v=t.getProperty("SCALE",jo.FLOAT,1,r);Number.isFinite(v)&&h.multiplyByScalar(v);const w=t.getProperty("SCALE_NON_UNIFORM",jo.FLOAT,3,r,d);w&&h.scale(w),p.scale=h;let _=t.getProperty("BATCH_ID",jo.UNSIGNED_SHORT,1,r);void 0===_&&(_=r);const k=(new _r).fromQuaternion(p.rotation);f.identity(),f.translate(p.translation),f.multiplyRight(k),f.scale(p.scale);const x=f.clone();i[r]={modelMatrix:x,batchId:_}}e.instances=i}(e,o,0,s),r}(e,t,r,n),await Mu(e,e.gltfFormat,n,i),r}async function Nu(e,t=0,r,n,i={}){switch(i.byteOffset=t,i.type=function(e,t=0){const r=new DataView(e);return"".concat(String.fromCharCode(r.getUint8(t+0))).concat(String.fromCharCode(r.getUint8(t+1))).concat(String.fromCharCode(r.getUint8(t+2))).concat(String.fromCharCode(r.getUint8(t+3)))}(e,t),i.type){case Oa.COMPOSITE:return await async function(e,t,r,n,i,a){r=Ho(e,t,r);const o=new DataView(t);for(e.tilesLength=o.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&e.byteLength-r>12;){const o={};e.tiles.push(o),r=await a(t,r,n,i,o)}return r}(i,e,t,r,n,Nu);case Oa.BATCHED_3D_MODEL:return await Fu(i,e,t,r,n);case Oa.GLTF:return await async function(e,t,r,n){e.rotateYtoZ=!0,e.gltfUpAxis=r["3d-tiles"]&&r["3d-tiles"].assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y";const{parse:i}=n;e.gltf=await i(t,Ru,r,n)}(i,e,r,n);case Oa.INSTANCED_3D_MODEL:return await Lu(i,e,t,r,n);case Oa.POINT_CLOUD:return await rs(i,e,t,r,n);default:throw new Error("3DTileLoader: unknown type ".concat(i.type))}}async function zu(e,t,r){const n=e[t].bufferView,i=e.bufferViews[n],a=e.buffers[i.buffer];if(a.uri){const e=await F(a.uri),t=await e.arrayBuffer();return new Uint8Array(t,i.byteOffset,i.byteLength)}return new Uint8Array(r,i.byteOffset,i.byteLength)}function Uu(e){const t=new DataView(e);return t.getUint32(0,!0)+2**32*t.getUint32(4,!0)}const qu={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:"3.1.7",extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:async function(e){if(1952609651!==new Uint32Array(e.slice(0,4))[0])throw new Error("Wrong subtree file magic number");if(1!==new Uint32Array(e.slice(4,8))[0])throw new Error("Wrong subtree file verson, must be 1");const t=Uu(e.slice(8,16)),r=new Uint8Array(e,24,t),n=new TextDecoder("utf8").decode(r),i=JSON.parse(n),a=Uu(e.slice(16,24));let o=new ArrayBuffer(0);return a&&(o=e.slice(24+t)),"bufferView"in i.tileAvailability&&(i.tileAvailability.explicitBitstream=await zu(i,"tileAvailability",o)),"bufferView"in i.contentAvailability&&(i.contentAvailability.explicitBitstream=await zu(i,"contentAvailability",o)),"bufferView"in i.childSubtreeAvailability&&(i.childSubtreeAvailability.explicitBitstream=await zu(i,"childSubtreeAvailability",o)),i},options:{}},Hu={QUADTREE:4,OCTREE:8};function Gu(e,t){return"constant"in e?Boolean(e.constant):!!e.explicitBitstream&&function(e,t){const r=Math.floor(e/8),n=e%8;return 1==(t[r]>>n&1)}(t,e.explicitBitstream)}function Vu(e,t,r,n){const{basePath:i,refine:a,getRefine:o,lodMetricType:s,getTileType:c,rootLodMetricValue:u,rootBoundingVolume:l}=n,h=e.contentUrl&&e.contentUrl.replace("".concat(i,"/"),""),p=u/2**t,f=function(e,t,r){if(t.region){const{childTileX:n,childTileY:i,childTileZ:a}=r,[o,s,c,u,l,h]=t.region,p=2**e,f=(c-o)/p,d=(u-s)/p,m=(h-l)/p,[g,b]=[o+f*n,o+f*(n+1)],[y,v]=[s+d*i,s+d*(i+1)],[w,_]=[l+m*a,l+m*(a+1)];return{region:[g,y,b,v,w,_]}}return console.warn("Unsupported bounding volume type: ",t),null}(t,l,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:h},id:e.contentUrl,refine:o(a),type:c(e),lodMetricType:s,lodMetricValue:p,boundingVolume:f}}function Wu(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function Ku(e,t,r,n,i){const a=function(e){const t={};for(const r in e)t["{".concat(r,"}")]=e[r];return t}({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,e=>a[e])}function Ju(e){if(!e.contentUrl)return ra;const t=e.contentUrl.split(".").pop();switch(t){case"pnts":return ia;case"i3dm":case"b3dm":case"glb":case"gltf":return na;default:return t}}function Qu(e){switch(e){case"REPLACE":case"replace":return ta;case"ADD":case"add":return ea;default:return e}}function Yu(e,t){if(!e)return null;if(e.content){const r=e.content.uri||e.content.url;e.contentUrl="".concat(t.basePath,"/").concat(r)}return e.id=e.contentUrl,e.lodMetricType=ca,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=Ju(e),e.refine=Qu(e.refine),e}async function Xu(e){if(!e.root)return null;const t=e.basePath,r=e.root.extensions["3DTILES_implicit_tiling"],{subdivisionScheme:n,maximumLevel:i,subtreeLevels:a,subtrees:{uri:o}}=r,s=Ku(o,0,0,0,0),c="".concat(t,"/").concat(s),u=await St(c,qu),l="".concat(t,"/").concat(e.root.content.uri),h=e.root.refine,p=e.root.geometricError,f=e.root.boundingVolume,d={contentUrlTemplate:l,subtreesUriTemplate:o,subdivisionScheme:n,subtreeLevels:a,maximumLevel:i,refine:h,basePath:t,lodMetricType:ca,rootLodMetricValue:p,rootBoundingVolume:f,getTileType:Ju,getRefine:Qu};return await async function(e,t,r){if(!e)return null;e.lodMetricType=ca,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform;const{children:n,contentUrl:i}=await async function e(t,r,n={mortonIndex:0,x:0,y:0,z:0},i=0,a=0,o={level:0,mortonIndex:0,x:0,y:0,z:0}){const{subdivisionScheme:s,subtreeLevels:c,maximumLevel:u,contentUrlTemplate:l,subtreesUriTemplate:h,basePath:p}=r,f={children:[],lodMetricValue:0,contentUrl:""},d=Hu[s],m=1&i,g=i>>1&1,b=i>>2&1,y=(d**a-1)/(d-1);let v=Wu(n.mortonIndex,i),w=y+v,_=Wu(n.x,m),k=Wu(n.y,g),x=Wu(n.z,b),E=!1;a+1>c&&(E=Gu(t.childSubtreeAvailability,v));const A=Wu(o.x,_),S=Wu(o.y,k),j=Wu(o.z,x),T=a+o.level;if(E){const e=Ku("".concat(p,"/").concat(h),T,A,S,j);t=await St(e,qu),o.mortonIndex=v,o.x=_,o.y=k,o.z=x,o.level=a,v=0,w=0,_=0,k=0,x=0,a=0}if(!Gu(t.tileAvailability,w)||a>u)return f;Gu(t.contentAvailability,w)&&(f.contentUrl=Ku(l,T,A,S,j));const C=a+1,B={mortonIndex:v,x:_,y:k,z:x};for(let n=0;n<d;n++){const i=await e(t,r,B,n,C,o);if(i.contentUrl||i.children.length){const e=Vu(i,T+1,{childTileX:_,childTileY:k,childTileZ:x},r);f.children.push(e)}}return f}(t,r);i&&(e.contentUrl=i,e.content={uri:i.replace("".concat(r.basePath,"/"),"")});return e.refine=Qu(e.refine),e.type=Ju(e),e.children=n,e.id=e.contentUrl,e}(e.root,u,d)}const Zu={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.1.7",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(e,t,r){const i=t["3d-tiles"]||{};let a;a="auto"===i.isTileset?r.url&&-1!==r.url.indexOf(".json"):i.isTileset;e=a?await async function(e,t,r){var i;const a=JSON.parse((new TextDecoder).decode(e));return a.loader=t.loader||Zu,a.url=r.url,a.basePath=function(e){return n.dirname(e.url)}(a),a.root=function(e){var t,r;return(null==e||null===(t=e.extensionsRequired)||void 0===t?void 0:t.includes("3DTILES_implicit_tiling"))&&(null==e||null===(r=e.extensionsUsed)||void 0===r?void 0:r.includes("3DTILES_implicit_tiling"))}(a)?await Xu(a):function(e){const t=e.basePath,r=Yu(e.root,e),n=[];for(n.push(r);n.length>0;){const e=(n.pop()||{}).children||[];for(const r of e)Yu(r,{basePath:t}),n.push(r)}return r}(a),a.type=sa,a.lodMetricType=ca,a.lodMetricValue=(null===(i=a.root)||void 0===i?void 0:i.lodMetricValue)||0,a}(e,t,r):await async function(e,t,r){const n={content:{featureIds:null}};return await Nu(e,0,t,r,n.content),n.content}(e,t,r);return e},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function $u(e,t){if(!t){const r=await async function(e){k(e);const t={Authorization:"Bearer ".concat(e)},r=await F("https://api.cesium.com/v1/assets",{fetch:{headers:t}});if(!r.ok)throw new Error(r.statusText);return await r.json()}(e);for(const e of r.items)"3DTILES"===e.type&&(t=e.id)}const r=await async function(e,t){k(e,t);const r={Authorization:"Bearer ".concat(e)},n="".concat("https://api.cesium.com/v1/assets","/").concat(t);let i=await F("".concat(n),{fetch:{headers:r}});if(!i.ok)throw new Error(i.statusText);let a=await i.json();if(i=await F("".concat(n,"/endpoint"),{fetch:{headers:r}}),!i.ok)throw new Error(i.statusText);const o=await i.json();return a={...a,...o},a}(e,t),{type:n,url:i}=r;return k("3DTILES"===n&&i),r.headers={Authorization:"Bearer ".concat(r.accessToken)},r}const el={...Zu,id:"cesium-ion",name:"Cesium Ion",preload:async function(e,t={}){t=t["cesium-ion"]||{};const{accessToken:r}=t;let n=t.assetId;if(!Number.isFinite(n)){const t=e.match(/\/([0-9]+)\/tileset.json/);n=t&&t[1]}return $u(r,n)},parse:async(e,t,r)=>((t={...t})["3d-tiles"]=t["cesium-ion"],t.loader=el,Zu.parse(e,t,r)),options:{"cesium-ion":{...Zu.options["3d-tiles"],accessToken:null}}};var tl=r(2),rl=r(11),nl=r.n(rl);const il=new Uint8Array(256);let al=il.length;function ol(){return al>il.length-16&&(nl.a.randomFillSync(il),al=0),il.slice(al,al+=16)}var sl=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;var cl=function(e){return"string"==typeof e&&sl.test(e)};const ul=[];for(let e=0;e<256;++e)ul.push((e+256).toString(16).substr(1));var ll=function(e,t=0){const r=(ul[e[t+0]]+ul[e[t+1]]+ul[e[t+2]]+ul[e[t+3]]+"-"+ul[e[t+4]]+ul[e[t+5]]+"-"+ul[e[t+6]]+ul[e[t+7]]+"-"+ul[e[t+8]]+ul[e[t+9]]+"-"+ul[e[t+10]]+ul[e[t+11]]+ul[e[t+12]]+ul[e[t+13]]+ul[e[t+14]]+ul[e[t+15]]).toLowerCase();if(!cl(r))throw TypeError("Stringified UUID is invalid");return r};var hl=function(e,t,r){const n=(e=e||{}).random||(e.rng||ol)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return ll(n)},pl=r(25),fl=r.n(pl),dl=r(8),ml=r.n(dl),gl=r(80),bl=r.n(gl);class yl{constructor(e,t){Object(p.a)(this,"nodesPerPage",void 0),Object(p.a)(this,"nodesCounter",void 0),Object(p.a)(this,"writeFile",void 0),Object(p.a)(this,"nodePages",void 0),this.nodesPerPage=t,this.nodesCounter=0,this.nodePages=[{}],this.nodePages[0].nodes=[],this.writeFile=e}useWriteFunction(e){this.writeFile=e}getNodeById(e){const t=Math.floor(e/this.nodesPerPage),r=e%this.nodesPerPage;return this.nodePages[t].nodes[r]}updateMaterialByNodeId(e,t){const r=this.getNodeById(e);r.mesh&&(r.mesh.material={definition:t,resource:r.index})}updateVertexCountByNodeId(e,t){const r=this.getNodeById(e);r.mesh&&(r.mesh.geometry.vertexCount=t)}updateNodeAttributeByNodeId(e){const t=this.getNodeById(e);t.mesh&&(t.mesh.attribute.resource=t.index)}updateFeatureCountByNodeId(e,t){const r=this.getNodeById(e);r.mesh&&(r.mesh.geometry.featureCount=t)}updateTexelCountHintByNodeId(e,t){const r=this.getNodeById(e);r.mesh&&r.mesh.material&&(r.mesh.material.texelCountHint=t)}addChildRelation(e,t){var r;if(null==e)return;null===(r=this.getNodeById(e).children)||void 0===r||r.push(t)}updateResourceInMesh(e){e.mesh&&(e.mesh.geometry.resource=e.index)}push(e,t){let r=this.nodePages[this.nodePages.length-1];return r.nodes.length===this.nodesPerPage&&(r={nodes:[]},this.nodePages.push(r)),e.index=this.nodesCounter++,r.nodes.push(e),this.addChildRelation(t,e.index),this.updateResourceInMesh(e),e.index}async save(e,t,r=!1){const n=[];if(r){for(const[r,i]of this.nodePages.entries()){const a=JSON.stringify(i),o=Object(tl.join)(e,"nodepages");n.push(this.writeFile(o,a,"".concat(r.toString(),".json"))),t["nodePages/".concat(r.toString(),".json.gz")]="".concat(o,".json.gz")}const r=ml()({nodeCount:this.nodesCounter},{folderPattern:{path:"folderPattern",default:"BASIC"},archiveCompressionType:{path:"archiveCompressionType",default:"STORE"},resourceCompressionType:{path:"resourceCompressionType",default:"GZIP"},I3SVersion:{path:"I3SVersion",default:"1.8"},nodeCount:{path:"nodeCount"}}),i=!1;t["metadata.json"]=await this.writeFile(e,JSON.stringify(r),"metadata.json",i)}else for(const[t,r]of this.nodePages.entries()){const i=JSON.stringify(r),a=Object(tl.join)(e,"nodepages",t.toString());n.push(this.writeFile(a,i))}await Promise.all(n)}}var vl=r(15),wl=(r(257),r(82)),_l=r.n(wl);const kl={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log("Started ".concat(e.props.command))}};class xl{constructor({id:e="browser-driver"}={}){Object(p.a)(this,"id",void 0),Object(p.a)(this,"props",{...kl}),Object(p.a)(this,"childProcess",null),Object(p.a)(this,"port",0),Object(p.a)(this,"successTimer",void 0),this.id=e}async start(e){e={...kl,...e},this.props=e;const t=[...e.arguments];return this.port=Number(e.port),e.portArg&&(e.autoPort&&(this.port=await function(e=3e3){return new Promise(t=>{_l.a.exec("lsof -i -P -n | grep LISTEN",(r,n)=>{if(r)return void t(e);const i=[],a=/:(\d+) \(LISTEN\)/;n.split("\n").forEach(e=>{const t=a.exec(e);t&&i.push(Number(t[1]))});let o=e;for(;i.includes(o);)o++;t(o)})})}(e.port)),t.push(e.portArg,String(this.port))),await new Promise((r,n)=>{try{this._setTimeout(()=>{e.onSuccess&&e.onSuccess(this),r({})}),console.log("Spawning ".concat(e.command," ").concat(e.arguments.join(" ")));const i=wl.spawn(e.command,t,e.spawn);this.childProcess=i,i.stdout.on("data",e=>{console.log(e.toString())}),i.stderr.on("data",e=>{console.log('Child process wrote to stderr: "'.concat(e,'".')),this._clearTimeout(),n(new Error(e))}),i.on("error",e=>{console.log("Child process errored with ".concat(e)),this._clearTimeout(),n(e)}),i.on("close",e=>{console.log("Child process exited with ".concat(e)),this.childProcess=null,this._clearTimeout(),r({})})}catch(e){n(e)}})}async stop(){this.childProcess&&(this.childProcess.kill(),this.childProcess=null)}async exit(e=0){try{await this.stop(),process.exit(e)}catch(e){console.error(e.message||e),process.exit(1)}}_setTimeout(e){Number(this.props.wait)>0&&(this.successTimer=setTimeout(e,this.props.wait))}_clearTimeout(){this.successTimer&&clearTimeout(this.successTimer)}}var El=r(81),Al=r.n(El);const Sl="function"==typeof atob?atob:"function"==typeof Buffer?function(e){return Buffer.from(e,"base64").toString("binary")}:Cl,jl=Sl("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACsEZ2V0WAAsBHNldEEALQRzZXRCAC4Ec2V0QwAvBHNldEQAMARzZXRYADEKzA0xWwEBf0EAJAggAEEGdCEBAkADQCMIIAFGDQEjACQEIwEkBSMCJAYjAyQHEAIjBCMAaiQAIwUjAWokASMGIwJqJAIjByMDaiQDIwhBwABqJAgMAAsLIwgjGmokGgsTACMIIxpqJAkQAxAEEAkQDhATC6IBAEEAIwlqKAIAJApBBCMJaigCACQLQQgjCWooAgAkDEEMIwlqKAIAJA1BECMJaigCACQOQRQjCWooAgAkD0EYIwlqKAIAJBBBHCMJaigCACQRQSAjCWooAgAkEkEkIwlqKAIAJBNBKCMJaigCACQUQSwjCWooAgAkFUEwIwlqKAIAJBZBNCMJaigCACQXQTgjCWooAgAkGEE8IwlqKAIAJBkLCgAQBRAGEAcQCAsuAEH4yKq7fSMKahAYQdbunsZ+IwtqEBtB2+GBoQIjDGoQGkHunfeNfCMNahAZCy0AQa+f8Kt/Iw5qEBhBqoyfvAQjD2oQG0GTjMHBeiMQahAaQYGqmmojEWoQGQssAEHYsYLMBiMSahAYQa/vk9p4IxNqEBtBsbd9IxRqEBpBvq/zyngjFWoQGQstAEGiosDcBiMWahAYQZPj4WwjF2oQG0GOh+WzeiMYahAaQaGQ0M0EIxlqEBkLCgAQChALEAwQDQsuAEHiyviwfyMLahAcQcDmgoJ8IxBqEB9B0bT5sgIjFWoQHkGqj9vNfiMKahAdCy0AQd2gvLF9Iw9qEBxB06iQEiMUahAfQYHNh8V9IxlqEB5ByPfPvn4jDmoQHQsuAEHmm4ePAiMTahAcQdaP3Jl8IxhqEB9Bh5vUpn8jDWoQHkHtqeiqBCMSahAdCy0AQYXSj896IxdqEBxB+Me+ZyMMahAfQdmFvLsGIxFqEB5Bipmp6XgjFmoQHQsKABAPEBAQERASCysAQcLyaCMPahAgQYHtx7t4IxJqECNBosL17AYjFWoQIkGM8JRvIxhqECELLgBBxNT7pXojC2oQIEGpn/veBCMOahAjQeCW7bV/IxFqECJB8Pj+9XsjFGoQIQstAEHG/e3EAiMXahAgQfrPhNV+IwpqECNBheG8p30jDWoQIkGFuqAkIxBqECELLgBBuaDTzn0jE2oQIEHls+62fiMWahAjQfj5if0BIxlqECJB5ayxpXwjDGoQIQsKABAUEBUQFhAXCy0AQcTEpKF/IwpqECRBl/+rmQQjEWoQJ0Gnx9DceiMYahAmQbnAzmQjD2oQJQstAEHDs+2qBiMWahAkQZKZs/h4Iw1qECdB/ei/fyMUahAmQdG7kax4IwtqECULLQBBz/yh/QYjEmoQJEHgzbNxIxlqECdBlIaFmHojEGoQJkGho6DwBCMXahAlCy4AQYL9zbp/Iw5qECRBteTr6XsjFWoQJ0G7pd/WAiMMahAmQZGnm9x+IxNqECULKAEBf0F/IwFzIwNxIwEjAnFyIwBqIABqIgFBB3QgAUEZdnIjAWokAAsoAQF/QX8jAnMjAHEjAiMDcXIjAWogAGoiAUEWdCABQQp2ciMCaiQBCygBAX9BfyMDcyMBcSMDIwBxciMCaiAAaiIBQRF0IAFBD3ZyIwNqJAILKAEBf0F/IwBzIwJxIwAjAXFyIwNqIABqIgFBDHQgAUEUdnIjAGokAwsoAQF/IwJBfyMDc3EjASMDcXIjAGogAGoiAUEFdCABQRt2ciMBaiQACygBAX8jA0F/IwBzcSMCIwBxciMBaiAAaiIBQRR0IAFBDHZyIwJqJAELKAEBfyMAQX8jAXNxIwMjAXFyIwJqIABqIgFBDnQgAUESdnIjA2okAgsoAQF/IwFBfyMCc3EjACMCcXIjA2ogAGoiAUEJdCABQRd2ciMAaiQDCyIBAX8jASMCcyMDcyMAaiAAaiIBQQR0IAFBHHZyIwFqJAALIgEBfyMCIwNzIwBzIwFqIABqIgFBF3QgAUEJdnIjAmokAQsiAQF/IwMjAHMjAXMjAmogAGoiAUEQdCABQRB2ciMDaiQCCyIBAX8jACMBcyMCcyMDaiAAaiIBQQt0IAFBFXZyIwBqJAMLJQEBf0F/IwNzIwFyIwJzIwBqIABqIgFBBnQgAUEadnIjAWokAAslAQF/QX8jAHMjAnIjA3MjAWogAGoiAUEVdCABQQt2ciMCaiQBCyUBAX9BfyMBcyMDciMAcyMCaiAAaiIBQQ90IAFBEXZyIwNqJAILJQEBf0F/IwJzIwByIwFzIwNqIABqIgFBCnQgAUEWdnIjAGokAwsEACMACwQAIwELBAAjAgsEACMDCwQAIxoLBgAgACQACwYAIAAkAQsGACAAJAILBgAgACQDCwYAIAAkGgsA6gQEbmFtZQGSAzIAA2xvZwEFbG9vcHMCBGxvb3ADBXByaW1lBAVsb29wQQUGbG9vcEExBgZsb29wQTIHBmxvb3BBMwgGbG9vcEE0CQVsb29wQgoGbG9vcEIxCwZsb29wQjIMBmxvb3BCMw0GbG9vcEI0DgVsb29wQw8GbG9vcEMxEAZsb29wQzIRBmxvb3BDMxIGbG9vcEM0EwVsb29wRBQGbG9vcEQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),Tl=!(!WebAssembly||Sl===Cl)&&function(e){var t,r,n,i=-1;t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);for(;t>i++;)n[i]=e.charCodeAt(i);return n}(jl).buffer;Math.floor(1048576.00032768);function Cl(e){return e}Tl||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");r(113);async function Bl(){"win32"===process.platform?await Rl(...arguments):await Ol(...arguments)}async function Ol(e,t,r=0,n="."){const i=Fl(t),a=["-".concat(r),"-r",i,n],o=new xl;await o.start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function Rl(e,t,r=0,n=Object(tl.join)(".","*"),i){"@"===n[0]&&(n="*".concat(n.substr(1)));const a=Fl(t),o=["a","-tzip","-mx=".concat(r),a,n],s=new xl;await s.start({command:i,arguments:o,spawn:{cwd:"".concat(e)},wait:0})}async function Il(e,t,r="index.json"){await Ie.promises.mkdir(e,{recursive:!0});const n=Object(tl.join)(e,r);try{await Ie.promises.writeFile(n,t)}catch(e){throw e}return console.log("".concat(n," saved.")),n}async function Pl(e,t,r="index.json",n=!0){const i=await Il(e,t,r);if(n){const e=await function(e){const t="".concat(e,".gz"),r=Object(vl.createGzip)(),n=Object(Ie.createReadStream)(e),i=Object(Ie.createWriteStream)(t);return new Promise((e,a)=>{n.on("end",()=>{console.log("".concat(t," compressed and saved.")),e(t)}),n.on("error",e=>{console.log("".concat(t,": compression error!")),a(e)}),n.pipe(r).pipe(i)})}(i);return await Ml(i),e}return i}function Dl(e){return Ie.promises.rmdir(e,{recursive:!0})}function Ml(e){return Ie.promises.unlink(e)}function Fl(e){return Object(tl.isAbsolute)(e)?e:Object(tl.join)(process.cwd(),e)}function Ll(e){let t=e[0];const r=Math.floor(t/3600);t-=3600*r;const n=Math.floor(t/60);t-=60*n;const i=Math.floor(t),a=e[1]/1e6;let o="";return r&&(o+="".concat(r,"h ")),n&&(o+="".concat(n,"m ")),i&&(o+="".concat(i,"s")),o||(o+="".concat(a,"ms")),o}async function Nl(e){const{slpk:t,outputPath:r,tilesetName:n}=e,i=Fl(r);try{if(t){const e=Object(tl.join)(i,"".concat(n,".slpk"));return(await Ie.promises.stat(e)).size}const e=Object(tl.join)(i,n);return await async function e(t){let r=0;const n=await Ie.promises.readdir(t);for(const i of n){const n=await Ie.promises.stat(Object(tl.join)(t,i));n.isDirectory()?r+=await e(Object(tl.join)(t,i)):r+=n.size}return r}(e)}catch(e){return console.log("Calculate file sizes error: ",e),null}}const zl={};class Ul extends kr{static get ZERO(){return zl.ZERO=zl.ZERO||Object.freeze(new Ul(0,0,0,0))}constructor(e=0,t=0,r=0,n=0){super(-0,-0,-0,-0),Dt(e)&&1===arguments.length?this.copy(e):(It.debug&&(qt(e),qt(t),qt(r),qt(n)),this[0]=e,this[1]=t,this[2]=r,this[3]=n)}set(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return It.debug&&(qt(e.x),qt(e.y),qt(e.z),qt(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=qt(e)}get w(){return this[3]}set w(e){this[3]=qt(e)}transform(e){return hr(this,this,e),this.check()}transformByMatrix3(e){return Yt(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,r){const n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e[3]=t[3]}(this,this,e),this.check()}transformByQuaternion(e){return fr(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}}const ql={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"},Hl=()=>{};class Gl{constructor(e){Object(p.a)(this,"draco",void 0),Object(p.a)(this,"dracoEncoder",void 0),Object(p.a)(this,"dracoMeshBuilder",void 0),Object(p.a)(this,"dracoMetadataBuilder",void 0),Object(p.a)(this,"log",void 0),this.draco=e,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.dracoMetadataBuilder=new this.draco.MetadataBuilder}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.destroyEncodedObject(this.dracoMetadataBuilder),this.dracoMeshBuilder=null,this.dracoEncoder=null,this.draco=null}destroyEncodedObject(e){e&&this.draco.destroy(e)}encodeSync(e,t={}){return this.log=Hl,this._setOptions(t),t.pointcloud?this._encodePointCloud(e,t):this._encodeMesh(e,t)}_getAttributesFromMesh(e){const t={...e,...e.attributes};return e.indices&&(t.indices=e.indices),t}_encodePointCloud(e,t){const r=new this.draco.PointCloud;t.metadata&&this._addGeometryMetadata(r,t.metadata);const n=this._getAttributesFromMesh(e);this._createDracoPointCloud(r,n,t);const i=new this.draco.DracoInt8Array;try{const e=this.dracoEncoder.EncodePointCloudToDracoBuffer(r,!1,i);if(!(e>0))throw new Error("Draco encoding failed.");return this.log("DRACO encoded ".concat(r.num_points()," points\n with ").concat(r.num_attributes()," attributes into ").concat(e," bytes")),Vl(i)}finally{this.destroyEncodedObject(i),this.destroyEncodedObject(r)}}_encodeMesh(e,t){const r=new this.draco.Mesh;t.metadata&&this._addGeometryMetadata(r,t.metadata);const n=this._getAttributesFromMesh(e);this._createDracoMesh(r,n,t);const i=new this.draco.DracoInt8Array;try{const e=this.dracoEncoder.EncodeMeshToDracoBuffer(r,i);if(e<=0)throw new Error("Draco encoding failed.");return this.log("DRACO encoded ".concat(r.num_points()," points\n with ").concat(r.num_attributes()," attributes into ").concat(e," bytes")),Vl(i)}finally{this.destroyEncodedObject(i),this.destroyEncodedObject(r)}}_setOptions(e){if("speed"in e&&this.dracoEncoder.SetSpeedOptions(...e.speed),"method"in e){const t=this.draco[e.method||"MESH_SEQUENTIAL_ENCODING"];this.dracoEncoder.SetEncodingMethod(t)}if("quantization"in e)for(const t in e.quantization){const r=e.quantization[t],n=this.draco[t];this.dracoEncoder.SetAttributeQuantization(n,r)}}_createDracoMesh(e,t,r){const n=r.attributesMetadata||{};try{const r=this._getPositionAttribute(t);if(!r)throw new Error("positions");const i=r.length/3;for(let r in t){const a=t[r];r=ql[r]||r;const o=this._addAttributeToMesh(e,r,a,i);-1!==o&&this._addAttributeMetadata(e,o,{name:r,...n[r]||{}})}}catch(t){throw this.destroyEncodedObject(e),t}return e}_createDracoPointCloud(e,t,r){const n=r.attributesMetadata||{};try{const r=this._getPositionAttribute(t);if(!r)throw new Error("positions");const i=r.length/3;for(let r in t){const a=t[r];r=ql[r]||r;const o=this._addAttributeToMesh(e,r,a,i);-1!==o&&this._addAttributeMetadata(e,o,{name:r,...n[r]||{}})}}catch(t){throw this.destroyEncodedObject(e),t}return e}_addAttributeToMesh(e,t,r,n){if(!ArrayBuffer.isView(r))return-1;const i=this._getDracoAttributeType(t),a=r.length/n;if("indices"===i){const n=r.length/3;return this.log("Adding attribute ".concat(t,", size ").concat(n)),this.dracoMeshBuilder.AddFacesToMesh(e,n,r),-1}this.log("Adding attribute ".concat(t,", size ").concat(a));const o=this.dracoMeshBuilder,{buffer:s}=r;switch(r.constructor){case Int8Array:return o.AddInt8Attribute(e,i,n,a,new Int8Array(s));case Int16Array:return o.AddInt16Attribute(e,i,n,a,new Int16Array(s));case Int32Array:return o.AddInt32Attribute(e,i,n,a,new Int32Array(s));case Uint8Array:case Uint8ClampedArray:return o.AddUInt8Attribute(e,i,n,a,new Uint8Array(s));case Uint16Array:return o.AddUInt16Attribute(e,i,n,a,new Uint16Array(s));case Uint32Array:return o.AddUInt32Attribute(e,i,n,a,new Uint32Array(s));case Float32Array:default:return o.AddFloatAttribute(e,i,n,a,new Float32Array(s))}}_getDracoAttributeType(e){switch(e.toLowerCase()){case"indices":return"indices";case"position":case"positions":case"vertices":return this.draco.POSITION;case"normal":case"normals":return this.draco.NORMAL;case"color":case"colors":return this.draco.COLOR;case"texcoord":case"texcoords":return this.draco.TEX_COORD;default:return this.draco.GENERIC}}_getPositionAttribute(e){for(const t in e){const r=e[t];if(this._getDracoAttributeType(t)===this.draco.POSITION)return r}return null}_addGeometryMetadata(e,t){const r=new this.draco.Metadata;this._populateDracoMetadata(r,t),this.dracoMeshBuilder.AddMetadata(e,r)}_addAttributeMetadata(e,t,r){const n=new this.draco.Metadata;this._populateDracoMetadata(n,r),this.dracoMeshBuilder.SetMetadataForAttribute(e,t,n)}_populateDracoMetadata(e,t){for(const[n,i]of(r=t).entries&&!r.hasOwnProperty("entries")?r.entries():Object.entries(r))switch(typeof i){case"number":Math.trunc(i)===i?this.dracoMetadataBuilder.AddIntEntry(e,n,i):this.dracoMetadataBuilder.AddDoubleEntry(e,n,i);break;case"object":i instanceof Int32Array&&this.dracoMetadataBuilder.AddIntEntryArray(e,n,i,i.length);break;case"string":default:this.dracoMetadataBuilder.AddStringEntry(e,n,i)}var r}}function Vl(e){const t=e.size(),r=new ArrayBuffer(t),n=new Int8Array(r);for(let r=0;r<t;++r)n[r]=e.GetValue(r);return r}const Wl={name:"DRACO",id:"draco",module:"draco",version:"3.1.7",extensions:["drc"],encode:async function(e,t={}){const{draco:r}=await Eo(t),n=new Gl(r);try{return n.encodeSync(e,t.draco)}finally{n.destroy()}},options:{draco:{pointcloud:!1,attributeNameEntry:"name"}}};function Kl(e){const{positions:t,normals:r,texCoords:n,colors:i,featureIndices:a,triangleCount:o}=e;if(!a.length)return{faceRange:new Uint32Array([0,o-1]),featureIds:[0],featureCount:1,positions:t,normals:r,texCoords:n,colors:i};const s=function(e){let t=1,r=1,n=e[0];const i=[],a=[],o=[n];i[0]=0,a[0]=n;for(let s=1;s<e.length;s++)n!==e[s]&&(i[t]=s/3-1,i[t+1]=s/3,a[r]=e[s],o.includes(e[s])||o.push(e[s]),t+=2,r+=1),n=e[s];i[t]=e.length/3-1;const s=new Uint32Array(i),c=o.length;return{faceRange:s,featureCount:c,featureIds:a}}(a);return function(e,t){const r=e[0],n=[r.featureId||0];let i=new Float32Array(r.positions),a=new Float32Array(r.normals),o=new Uint8Array(r.colors),s=new Float32Array(r.texCoords);const c=[0];let u=0,l=0;for(let t=1;t<e.length;t++){const r=e[t];n.push(r.featureId||0),i=we(i,r.positions),a=we(a,r.normals),o=we(o,r.colors),s=we(s,r.texCoords);const h=e[u];c.push(h.positions.length/9-1+l),c.push(h.positions.length/9+l),l+=h.positions.length/9,u+=1}c.push(i.length/9-1);return{faceRange:new Uint32Array(c),featureIds:n,positions:i,normals:a,colors:o,texCoords:s,featureCount:t}}(function(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r],i=t.find(e=>e.featureId===n.featureId);i?(i.positions=we(i.positions,n.positions),i.normals=we(i.normals,n.normals),i.colors=we(i.colors,n.colors),i.texCoords=we(i.texCoords,n.texCoords)):t.push(n)}return t}(function(e){const{featureIds:t,positions:r,normals:n,colors:i,texCoords:a,faceRange:o=new Uint32Array(0)}=e,s=[];let c=new Float32Array(r),u=new Float32Array(n),l=new Uint8Array(i),h=new Float32Array(a),p=0;for(let e=0;e<t.length;e++){const r=o[e+p],n=o[e+p+1],i=Jl("positions",r,n),a=Jl("normals",r,n),f=Jl("colors",r,n),d=Jl("texCoords",r,n);s.push({featureId:t[e],positions:c.slice(0,i),normals:u.slice(0,a),colors:l.slice(0,f),texCoords:h.slice(0,d)}),c=c.slice(i),u=u.slice(a),l=l.slice(f),h=h.slice(d),p+=1}return s.sort((e,t)=>e.featureId-t.featureId)}({...s,...e})),s.featureCount)}function Jl(e,t,r){const n=r-t+1,i=3*n;switch(e){case"positions":case"normals":return 9*n;case"colors":return 4*i;case"texCoords":return 2*i;default:return 0}}function Ql(e,t){let r,n,i;const a=e.boundingVolume,o=Zr.WGS84.cartesianToCartographic(a.center,new Ar);return o[2]=o[2]-t.getHeight(o[1],o[0]),a instanceof oi?(n=a.halfSize,r=new Ar(n[0],n[1],n[2]).len(),i=a.quaternion):(r=e.boundingVolume.radius,n=[r,r,r],i=(new Hn).fromMatrix3(new kn([n[0],0,0,0,n[1],0,0,0,n[2]])).normalize()),{mbs:[o[0],o[1],o[2],r],obb:{center:[o[0],o[1],o[2]],halfSize:n,quaternion:i}}}function Yl(e,t){const r=function(e){const t=[];for(let r=0;r<e.length;r+=3){const n=new Ar([e[r],e[r+1],e[r+2]]);t.push(n)}return t}(e),n=function(e,t=new oi){if(!e||0===e.length)return t.halfAxes=new kn([0,0,0,0,0,0,0,0,0]),t.center=new Ar,t;const r=e.length,n=new Ar(0,0,0);for(const t of e)n.add(t);const i=1/r;n.multiplyByScalar(i);let a=0,o=0,s=0,c=0,u=0,l=0;for(const t of e){const e=Mi.copy(t).subtract(n);a+=e.x*e.x,o+=e.x*e.y,s+=e.x*e.z,c+=e.y*e.y,u+=e.y*e.z,l+=e.z*e.z}a*=i,o*=i,s*=i,c*=i,u*=i,l*=i;const h=Ui;h[0]=a,h[1]=o,h[2]=s,h[3]=o,h[4]=c,h[5]=u,h[6]=s,h[7]=u,h[8]=l;const{unitary:p}=Oi(h,qi),f=t.halfAxes.copy(p);let d=f.getColumn(0,Li),m=f.getColumn(1,Ni),g=f.getColumn(2,zi),b=-Number.MAX_VALUE,y=-Number.MAX_VALUE,v=-Number.MAX_VALUE,w=Number.MAX_VALUE,_=Number.MAX_VALUE,k=Number.MAX_VALUE;for(const t of e)b=Math.max(t.dot(d),b),y=Math.max(t.dot(m),y),v=Math.max(t.dot(g),v),w=Math.min(t.dot(d),w),_=Math.min(t.dot(m),_),k=Math.min(t.dot(g),k);d=d.multiplyByScalar(.5*(w+b)),m=m.multiplyByScalar(.5*(_+y)),g=g.multiplyByScalar(.5*(k+v)),t.center.copy(d).add(m).add(g);const x=Fi.set(b-w,y-_,v-k).multiplyByScalar(.5),E=new kn([x[0],0,0,0,x[1],0,0,0,x[2]]);return t.halfAxes.multiplyRight(E),t}(r),i=function(e,t=new mn){if(!e||0===e.length)return t.fromCenterRadius([0,0,0],0);const r=wi.copy(e[0]),n=di.copy(r),i=mi.copy(r),a=gi.copy(r),o=bi.copy(r),s=yi.copy(r),c=vi.copy(r);for(const t of e){r.copy(t);const e=r.x,u=r.y,l=r.z;e<n.x&&r.copy(n),e>o.x&&r.copy(o),u<i.y&&r.copy(i),u>s.y&&r.copy(s),l<a.z&&r.copy(a),l>c.z&&r.copy(c)}const u=_i.copy(o).subtract(n).magnitudeSquared(),l=_i.copy(s).subtract(i).magnitudeSquared(),h=_i.copy(c).subtract(a).magnitudeSquared();let p=n,f=o,d=u;l>d&&(d=l,p=i,f=s),h>d&&(d=h,p=a,f=c);const m=ki;m.x=.5*(p.x+f.x),m.y=.5*(p.y+f.y),m.z=.5*(p.z+f.z);let g=_i.copy(f).subtract(m).magnitudeSquared(),b=Math.sqrt(g);const y=xi;y.x=n.x,y.y=i.y,y.z=a.z;const v=Ei;v.x=o.x,v.y=s.y,v.z=c.z;const w=Ai.copy(y).add(v).multiplyByScalar(.5);let _=0;for(const t of e){r.copy(t);const e=_i.copy(r).subtract(w).magnitude();e>_&&(_=e);const n=_i.copy(r).subtract(m).magnitudeSquared();if(n>g){const e=Math.sqrt(n);b=.5*(b+e),g=b*b;const t=e-b;m.x=(b*m.x+t*r.x)/e,m.y=(b*m.y+t*r.y)/e,m.z=(b*m.z+t*r.z)/e}}return b<_?(m.to(t.center),t.radius=b):(w.to(t.center),t.radius=_),t}(r);let a=Zr.WGS84.cartesianToCartographic(i.center,new Ar),o=Zr.WGS84.cartesianToCartographic(n.center,new Ar);return a[2]=a[2]-t.getHeight(a[1],a[0]),o[2]=o[2]-t.getHeight(o[1],o[0]),{mbs:[a[0],a[1],a[2],i.radius],obb:{center:o,halfSize:n.halfSize,quaternion:n.quaternion}}}function Xl(e){const t=e[3],r=new Ar(e[0],e[1],e[2]),n=new kn([t,0,0,0,t,0,0,0,t]);return new oi(r,n)}const Zl=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"];let $l=new Ar;async function eh(e,t,r,n,i,a,o){const s=a,c=function(e){const t=[],r=e.gltf.materials||[];for(const e of r)t.push(hh(e));return t}(e),u=function(e,t){var r;const n=new Map;for(const t of e.gltf.materials||[{id:"default"}])n.set(t.id,{positions:new Float32Array(0),normals:new Float32Array(0),texCoords:new Float32Array(0),colors:new Uint8Array(0),featureIndices:[],boundingVolumes:null});rh((e.gltf.scene||(null===(r=e.gltf.scenes)||void 0===r?void 0:r[0])||e.gltf).nodes,e,n,t);for(const e of n.keys()){const t=n.get(e);0!==t.positions.length?t.featureIndices=t.featureIndices.reduce((e,t)=>e.concat(t)):n.delete(e)}return n}(e,s);a&&function(e,t){for(const r of e.values()){const e=Yl(r.positions,t);r.boundingVolumes=e;const n=e.obb.center;for(let e=0;e<r.positions.length;e+=3){const i=r.positions.subarray(e,e+3);Zr.WGS84.cartesianToCartographic(Array.from(i),$l),$l[2]=$l[2]-t.getHeight($l[1],$l[0]),$l=$l.subtract(n),r.positions.set($l,e)}}}(u,o),u.has("default")&&c.push({material:{alphaMode:"opaque",pbrMetallicRoughness:{}}});const l=[];let h=t,{materials:p=[]}=e.gltf;null!=p&&p.length||p.push({id:"default"});for(let t=0;t<p.length;t++){const a=p[t];if(!u.has(a.id))continue;const o=u.get(a.id),{material:s,texture:f}=c[t];l.push(await th({convertedAttributes:o,material:s,texture:f,tileContent:e,nodeId:h,featuresHashArray:r,attributeStorageInfo:n,draco:i})),h++}return l.length?l:null}async function th({convertedAttributes:e,material:t,texture:r,tileContent:n,nodeId:i,featuresHashArray:a,attributeStorageInfo:o,draco:s}){const c=e.boundingVolumes,u=e.positions.length/3,l=u/3,{faceRange:h,featureIds:p,positions:f,normals:d,colors:m,texCoords:g,featureCount:b}=Kl({triangleCount:l,...e});n.batchTableJson&&function(e,t,r,n){const i=function(e,t,r){const n={};for(let i=0;i<e.length;i++){const a=e[i],o=gh(i,t,r);n[a.toString()]=o}return n}(e,n,r);bh(t,i),bh(e,i)}(p,e.featureIndices,a,n.batchTableJson);const y=new Uint32Array(2),v=function(e){const t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}(p);y.set([u,b],0);const w=new Uint8Array(ve(y.buffer,f.buffer,d.buffer,r?g.buffer:new ArrayBuffer(0),m.buffer,v.buffer,h.buffer)),_=s?await async function(e,t,r){const{positions:n,normals:i,texCoords:a,colors:o,featureIds:s,faceRange:c}=r,u=new Uint32Array(e);for(let e=0;e<u.length;e++)u.set([e],e);const l=function(e,t){const r=new Uint32Array(e.length);let n=0,i=0;for(let e=1;e<t.length;e+=2){const a=3*(t[e]+1);r.fill(n,i,a),n++,i=a+1}return r}(new Uint32Array(t.featureIndices.length?t.featureIndices:e),c),h={positions:n,normals:i,colors:o,"feature-index":l};a.length&&(h.texCoords=a);const p={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(s)}};return new Uint8Array(await jt({attributes:h,indices:u},Wl,{draco:{method:"MESH_SEQUENTIAL_ENCODING",attributesMetadata:p}}))}(u,e,{positions:f,normals:d,texCoords:r?g:new Float32Array(0),colors:m,featureIds:p,faceRange:h}):null,k=function(e,t,r){const n=[];if(e){const i={OBJECTID:t,...e};for(const e in i){const t=yh(e,r);let a=null;switch(t){case"Oid32":case"Int32":a=vh(i[e]);break;case"Float64":a=wh(i[e]);break;case"string":a=_h(i[e]);break;default:a=_h(i[e])}n.push(a)}}return n}(n.batchTableJson,p,o);return{geometry:w,compressedGeometry:_,texture:r,sharedResources:ph(n,i),meshMaterial:t,vertexCount:u,attributes:k,featureCount:b,boundingVolumes:c}}function rh(e,t,r,n,i=new _r([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){if(e)for(const a of e)nh(a,t,r,n,i)}function nh(e,t,r,n,i=new _r([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){const a=function(e,t){let r=t;const{matrix:n,rotation:i,scale:a,translation:o}=e;return n&&(r=t.multiplyRight(n)),i&&(r=r.rotateXYZ(i)),a&&(r=r.scale(a)),o&&(r=r.translate(o)),r}(e,i),o=e.mesh;o&&function(e,t,r,n=!1,i=new _r([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){for(const a of e.primitives){let e=null;a.material?e=r.get(a.material.id):r.has("default")&&(e=r.get("default")),k(null!==e,"Primitive - material mapping failed");const o=a.attributes;e.positions=we(e.positions,ih({vertices:o.POSITION.value,cartographicOrigin:t.cartographicOrigin,cartesianModelMatrix:t.cartesianModelMatrix,nodeMatrix:i,indices:a.indices.value,attributeSpecificTransformation:ah,useCartesianPositions:n})),e.normals=we(e.normals,ih({vertices:o.NORMAL&&o.NORMAL.value,cartographicOrigin:t.cartographicOrigin,cartesianModelMatrix:t.cartesianModelMatrix,nodeMatrix:i,indices:a.indices.value,attributeSpecificTransformation:oh,useCartesianPositions:!1})),e.texCoords=we(e.texCoords,sh(o.TEXCOORD_0&&o.TEXCOORD_0.value,a.indices.value)),e.colors=we(e.colors,ch(o.COLOR_0,a.indices.value)),e.featureIndices.push(uh(lh(o),a.indices.value))}}(o,t,r,n,a),rh(e.children,t,r,n,a)}function ih(e){const{vertices:t,indices:r,attributeSpecificTransformation:n}=e,i=new Float32Array(3*r.length);if(!t)return i;for(let a=0;a<r.length;a++){const o=3*r[a],s=t.subarray(o,o+3);let c=new Ar(Array.from(s));c=n(c,e),i[3*a]=c.x,i[3*a+1]=c.y,i[3*a+2]=c.z}return i}function ah(e,t){const{cartesianModelMatrix:r,cartographicOrigin:n,nodeMatrix:i,useCartesianPositions:a}=t;return i&&(e=e.transform(i)),e=e.transform(r),a?e:(Zr.WGS84.cartesianToCartographic([e[0],e[1],e[2]],e),e=e.subtract(n))}function oh(e,t){const{cartesianModelMatrix:r,nodeMatrix:n}=t;return n&&(e=e.transformAsVector(n)),e=e.transformAsVector(r)}function sh(e,t){const r=new Float32Array(2*t.length);if(!e)return r.fill(1),r;for(let n=0;n<t.length;n++){const i=2*t[n],a=e.subarray(i,i+2);r[2*n]=a[0],r[2*n+1]=a[1]}return r}function ch(e,t){const r=(null==e?void 0:e.components)||4,n=new Uint8Array(t.length*r);if(!e)return n.fill(255),n;const i=e.value;for(let e=0;e<t.length;e++){const a=t[e]*r,o=i.subarray(a,a+r),s=new Uint8Array(r);for(let e=0;e<o.length;e++)s[e]=255*o[e];n.set(s,e*r)}return n}function uh(e,t){if(!e.length||!t.length)return[];const r=[];for(let n=0;n<t.length;n++){const i=t[n];r.push(e[i])}return r}function lh(e){let t=[];for(let r=0;r<Zl.length;r++){const n=Zl[r];if(e[n]&&e[n].value){t=e[n].value;break}}return t}function hh(e){var t,r,n;const i={doubleSided:e.doubleSided,emissiveFactor:e.emissiveFactor.map(e=>Math.round(255*e)),alphaMode:(e.alphaMode||"OPAQUE").toLowerCase(),pbrMetallicRoughness:{roughnessFactor:(null==e||null===(t=e.pbrMetallicRoughness)||void 0===t?void 0:t.roughnessFactor)||1,metallicFactor:(null==e||null===(r=e.pbrMetallicRoughness)||void 0===r?void 0:r.metallicFactor)||1}};let a;if(null!=e&&null!==(n=e.pbrMetallicRoughness)&&void 0!==n&&n.baseColorTexture?(a=e.pbrMetallicRoughness.baseColorTexture.texture.source,i.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(a=e.emissiveTexture.texture.source,i.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}),!a){var o;const t=null==e||null===(o=e.pbrMetallicRoughness)||void 0===o?void 0:o.baseColorFactor;i.pbrMetallicRoughness.baseColorFactor=t&&t.map(e=>Math.round(255*e))||void 0}return{material:i,texture:a}}function ph(e,t){const r=e.gltf.materials,n={};if(!r||!r.length)return n;n.materialDefinitionInfos=[];for(const e of r){const{materialDefinitionInfo:r,textureDefinitionInfo:i}=fh(e,t);n.materialDefinitionInfos.push(r),i&&(n.textureDefinitionInfos=n.textureDefinitionInfos||[],n.textureDefinitionInfos.push(i))}return n}function fh(e,t){var r;const n=(null==e||null===(r=e.pbrMetallicRoughness)||void 0===r?void 0:r.baseColorTexture)||e.emissiveTexture;let i=null;n&&(i=function(e,t){return{encoding:[e.source.mimeType],images:[{id:mh(e,t),size:e.source.image.width,length:[e.source.image.data.length]}]}}(n.texture,t));const{baseColorFactor:a,metallicFactor:o}=(null==e?void 0:e.pbrMetallicRoughness)||{};let s=a;return a&&0!==a[3]||!e.emissiveFactor||(s=e.emissiveFactor,s[3]=s[3]||1),{materialDefinitionInfo:dh(s,o),textureDefinitionInfo:i}}function dh(e,t=1){const r=new Ul(0,0,0,1),n=new Ul(1,1,1,1),i=new Ul(.04/255,.04/255,.04/255,0),a=new Ul(e),o=n.subtract(i).multiply(a),s=o.lerp(o,r,t);i[3]=1;const c=i.lerp(i,a,t);return{diffuse:s.toArray(),specular:c.toArray()}}function mh(e,t){const{width:r,height:n}=e.source.image,i=t+1,a=32-i.toString(2).length,o="0".repeat(a).concat(i.toString(2));return BigInt("0b".concat((268435456+(r-1<<12)+(n-1<<0)).toString(2)).concat(o)).toString()}function gh(e,t,r){const n=function(e,t){let r="";for(const n in e)r+=e[n][t];return r}(t,e),i=bl()(n);return r.includes(i)?r.indexOf(i):r.push(i)-1}function bh(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function yh(e,t){return t.find(t=>t.name===e).attributeValues.valueType}function vh(e){const t=new Uint32Array([e.length]),r=new Uint32Array(e);return ve(t.buffer,r.buffer)}function wh(e){const t=new Uint32Array([e.length]),r=new Uint8Array(4),n=new Float64Array(e);return ve(t.buffer,r.buffer,n.buffer)}function _h(e){const t=new Uint32Array([e.length]);let r=0;const n=new Uint32Array(e.length),i=[];for(let t=0;t<e.length;t++){const a="".concat(String(e[t]),"\0"),o=Buffer.from(a),s=o.length;r+=s,n[t]=s,i.push(o)}const a=new Uint32Array([r]);return ve(t.buffer,a.buffer,n.buffer,...i)}function kh(e,t){const r=[],n=e.boundingVolume,i=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:2*t.mbs[3]*16/i},o={metricType:"maxScreenThresholdSQ",maxError:.25*Math.PI*a.maxError*a.maxError};return"OrientedBoundingBox"===n.constructor.name?(r.push(o),r.push(a)):(r.push(a),r.push(o)),r}function xh(e){let t=(e.header.lodSelection.maxScreenThreshold||{}).maxError;if(!t){const r=e.header.lodSelection.maxScreenThresholdSQ;r&&(t=Math.sqrt(r.maxError/(.25*Math.PI)))}return t||(t=16),2*e.header.mbs[3]*16/t}const Eh=[9,-18,-88,0,96,90,0,0,-60,-20,-9,18,8,0,-96,30,0,0,60,-20,9,-88,-18,90,96,0,-20,-60,0,0,186,-42,-42,-150,-96,-150,60,60,60,60,54,162,-78,30,-24,-90,-60,60,-60,60,-9,-32,18,30,24,0,20,-60,0,0,-9,8,18,30,-96,0,-20,60,0,0,54,-78,162,-90,-24,30,60,-60,60,-60,-54,78,78,90,144,90,-60,-60,-60,-60,9,-8,-18,-30,-24,0,20,60,0,0,-9,18,-32,0,24,30,0,0,-60,20,9,-18,-8,0,-24,-30,0,0,60,20],Ah=[0,0,-131,0,138,144,0,0,-102,-31,0,0,7,0,-138,42,0,0,102,-31,62,0,-31,0,0,-62,0,0,0,31,124,0,-62,0,0,-124,0,0,0,62,124,0,-62,0,0,-124,0,0,0,62,62,0,-31,0,0,-62,0,0,0,31,0,0,45,0,-183,-9,0,93,18,0,0,0,216,0,33,87,0,-93,12,-93,0,0,156,0,153,99,0,-93,-12,-93,0,0,-45,0,-3,9,0,93,-18,0,0,0,-55,0,48,42,0,0,-84,31,0,0,-7,0,-48,-42,0,0,84,31],Sh=[18,-36,-122,0,120,135,0,0,-84,-31,-18,36,-2,0,-120,51,0,0,84,-31,36,-165,-27,93,147,-9,0,-93,18,0,210,45,-111,-93,-57,-192,0,93,12,93,162,141,-75,-93,-129,-180,0,93,-12,93,-36,-21,27,93,39,9,0,-93,-18,0,0,0,62,0,0,31,0,0,0,-31,0,0,124,0,0,62,0,0,0,-62,0,0,124,0,0,62,0,0,0,-62,0,0,62,0,0,31,0,0,0,-31,-18,36,-64,0,66,51,0,0,-102,31,18,-36,2,0,-66,-51,0,0,102,31];class jh{constructor(e){this.options=e,this._v00=0,this._v01=0,this._v10=0,this._v11=0,this._t=[],this._ix=this.options._width,this._iy=this.options._height}getHeight(e,t){if(e=Math.abs(e)>90?NaN:e,isNaN(e)||isNaN(t))return NaN;const r=function(e,t){t=Math.abs(t);let r=Th(e,t);2*Math.abs(r)===t?r-=Th(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t);return r}(t,360);let n=(t=-180!==r?r:180)*this.options._rlonres,i=-e*this.options._rlatres,a=Math.floor(n),o=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(i));n-=a,i-=o,o+=(this.options._height-1)/2,a+=a<0?this.options._width:a>=this.options._width?-this.options._width:0;let s=0,c=0,u=0,l=0,h=new Array(10);if(a!==this._ix||o!==this._iy)if(this.options.cubic){const e=[this._rawval(a,o-1),this._rawval(a+1,o-1),this._rawval(a-1,o),this._rawval(a,o),this._rawval(a+1,o),this._rawval(a+2,o),this._rawval(a-1,o+1),this._rawval(a,o+1),this._rawval(a+1,o+1),this._rawval(a+2,o+1),this._rawval(a,o+2),this._rawval(a+1,o+2)];let t=Ah;0!==o&&(t=o===this.options._height-2?Sh:Eh);let r=372;0!==o&&(r=o===this.options._height-2?372:240);for(let n=0;n<10;++n){h[n]=0;for(let r=0;r<12;++r)h[n]+=e[r]*t[10*r+n];h[n]/=r}}else s=this._rawval(a,o),c=this._rawval(a+1,o),u=this._rawval(a,o+1),l=this._rawval(a+1,o+1);else this.options.cubic?h=this._t:(s=this._v00,c=this._v01,u=this._v10,l=this._v11);if(!this.options.cubic){const e=(1-i)*((1-n)*s+n*c)+i*((1-n)*u+n*l),t=this.options._offset+this.options._scale*e;return this._ix=a,this._iy=o,this._v00=s,this._v01=c,this._v10=u,this._v11=l,t}let p=h[0]+n*(h[1]+n*(h[3]+n*h[6]))+i*(h[2]+n*(h[4]+n*h[7])+i*(h[5]+n*h[8]+i*h[9]));return p=this.options._offset+this.options._scale*p,this._ix=a,this._iy=o,this._t=h,p}_rawval(e,t){e<0?e+=this.options._width:e>=this.options._width&&(e-=this.options._width),(t<0||t>=this.options._height)&&(t=t<0?-t:2*(this.options._height-1)-t,e+=(e<this.options._width/2?1:-1)*this.options._width/2);const r=this.options._datastart+2*(t*this.options._swidth+e);return this.options.data[r]<<8|this.options.data[r+1]}}function Th(e,t){return e-Math.floor(e/t)*t}function Ch(e,t){const r=function*(e){let t=0;do{const r=e.indexOf(10,t);if(-1!==r){const n=e.subarray(t,r);t=r+1,yield{offset:t,line:Bh(n)}}else{const r=e.subarray(t,e.length);t=e.length,yield{offset:t,line:Bh(r)}}}while(t<e.length);return{offset:t,line:""}}(e);let n=r.next();if(n.done||"P5"!==n.value.line)throw new Error("Geoid model file: File not in PGM format");let i=Number.MAX_VALUE,a=0,o=-1,s=-1,c="NONE",u="UNKNOWN",l=0,h=0,p=null,f=null;do{n=r.next();const e=n.value.line;if(e.length){if("#"!==e[0]){let t=e.split(" ");if(t=t.filter(e=>""!==e),l=parseInt(t[0],10),h=parseInt(t[1],10),!l||!h)throw new Error("Geoid model file: Error reading raster size");break}{const r=e.split(" "),n=r[0],l=r[1];if("#"!==n||!l)continue;const h=r.length>2?r.slice(2):[];if("Description"===l)c=h.join(" ");else if("DateTime"===l)u=h.join(" ");else if("Offset"===l){if(!r[2])throw new Error("Geoid model file: Error reading offset");i=parseInt(r[2],10)}else if("Scale"===l){if(!r[2])throw new Error("Geoid model file: Error reading scale");a=parseFloat(r[2])}else l===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(r[2]))&&(o=parseFloat(r[2])):l===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(r[2]))&&(s=parseFloat(r[2]))}}}while(!n.done);n=r.next();const d=parseInt(n.value.line,10);if(n.done)throw new Error("Geoid model file: Error reading maxval");if(65535!==d)throw new Error("Geoid model file: Incorrect value of maxval");if(p=n.value.offset,f=l,i===Number.MAX_VALUE)throw new Error("Geoid model file: Offset not set");if(0===a)throw new Error("Geoid model file: Scale not set");if(a<0)throw new Error("Geoid model file: Scale must be positive");if(h<2||l<2)throw new Error("Geoid model file: Raster size too small");if(1&l)throw new Error("Geoid model file: Raster width is odd");if(!(1&h))throw new Error("Geoid model file: Raster height is even");const m=l/360,g=(h-1)/180;return new jh({cubic:t.cubic,_width:l,_height:h,_rlonres:m,_rlatres:g,_offset:i,_scale:a,_swidth:f,_datastart:p,_maxerror:o,_rmserror:s,_description:c,_datetime:u,data:e})}function Bh(e){let t="";for(const r of e)t+=String.fromCharCode(r);return t}const Oh={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:"3.1.7",mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>Ch(new Uint8Array(e),t),extensions:["pgm"],options:{cubic:!1}},Rh={id:{path:"id",transform:e=>e.toUpperCase()},profile:{path:"profile",default:"meshpyramids"},version:{path:"version",default:"1.8"},resourcePattern:{path:"resourcePattern",default:["3dNodeIndexDocument","Attributes","SharedResource","Geometry"]},rootNode:{path:"rootNode",default:"./nodes/root"},extent:{path:"extent"},indexCRS:{path:"indexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},vertexCRS:{path:"vertexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},normalReferenceFrame:{path:"normalReferenceFrame",default:"east-north-up"},attributeEncoding:{path:"attributeEncoding",default:"application/octet-stream; version=1.6"},textureEncoding:{path:"textureEncoding",default:["image/jpeg","image/ktx2"]},lodType:{path:"lodType",default:"MeshPyramid"},lodModel:{path:"lodModel",default:"node-switching"},defaultGeometrySchema:{path:"defaultGeometrySchema",default:{geometryType:"triangles",header:[{property:"vertexCount",type:"UInt32"},{property:"featureCount",type:"UInt32"}],topology:"PerAttributeArray",ordering:["position","normal","uv0","color"],vertexAttributes:{position:{valueType:"Float32",valuesPerElement:3},normal:{valueType:"Float32",valuesPerElement:3},uv0:{valueType:"Float32",valuesPerElement:2},color:{valueType:"UInt8",valuesPerElement:4}},featureAttributeOrder:["id","faceRange"],featureAttributes:{id:{valueType:"UInt64",valuesPerElement:1},faceRange:{valueType:"UInt32",valuesPerElement:2}}}}},Ih=()=>({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"},mbs:{path:"mbs"},obb:{path:"obb"},lodSelection:{path:"lodSelection",default:[{metricType:"maxScreenThresholdSQ",maxError:196349.54374999998},{metricType:"maxScreenThreshold",maxError:999.9999999999999}]},children:{path:"children",default:null},neighbors:{path:"neighbors",default:null},parentNode:{path:"parentNode",transform:e=>ml()(e,{id:{path:"id"},href:{path:"href"},mbs:{path:"mbs"},obb:{path:"obb"}}),default:null},sharedResource:{path:"sharedResource",default:null},featureData:{path:"featureData",default:null},geometryData:{path:"geometryData",default:null},textureData:{path:"textureData",default:null},attributeData:{path:"attributeData",default:null}});function Ph(e,t,r){const n={};for(const[t,i]of e.entries())n["Mat".concat(r.nodePath).concat(t)]=ml()(i,{name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>ml()(r,{renderMode:{path:"renderMode",default:"solid"},shininess:{path:"shininess",default:1},reflectivity:{path:"reflectivity",default:0},ambient:{path:"ambient",default:[1,1,1,1]},diffuse:{path:"diffuse",default:[1,1,1,1]},specular:{path:"specular",default:[0,0,0,0]},useVertexColorAlpha:{path:"useVertexColorAlpha",default:!1},vertexRegions:{path:"vertexRegions",default:!1},vertexColors:{path:"vertexColors",default:!0}})}});return n}function Dh(e,t,r){if(!e)return null;const n={};for(const[t,i]of e.entries()){const e="".concat(r.nodePath).concat(t);i.imageIndex=e,n[e]=ml()(i,{encoding:{path:"encoding"},wrap:{path:"wrap",default:["none"]},atlas:{path:"atlas",default:!1},uvSet:{path:"uvSet",default:"uv0"},channels:{path:"channels",default:"rgb"},images:{path:"images",transform:(e,t,r)=>e.map(e=>ml()(e,{id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}))}})}return n}function Mh(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}const Fh={};function Lh(e="id"){Fh[e]=Fh[e]||1;const t=Fh[e]++;return"".concat(e,"-").concat(t)}const Nh={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};const zh=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Uh=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),qh=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),Hh=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),Gh={POSITION:{size:3,value:new Float32Array(Uh)},NORMAL:{size:3,value:new Float32Array(qh)},TEXCOORD_0:{size:2,value:new Float32Array(Hh)}};class Vh extends class{static get DRAW_MODE(){return Nh}constructor(e={}){const{id:t=Lh("geometry"),drawMode:r=Nh.TRIANGLES,attributes:n={},indices:i=null,vertexCount:a=null}=e;this.id=t,this.drawMode=0|r,this.attributes={},this.userData={},this._setAttributes(n,i),this.vertexCount=a||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return"Geometry ".concat(this.id," attribute ").concat(e)}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const t in e){let r=e[t];r=ArrayBuffer.isView(r)?{value:r}:r,Mh(ArrayBuffer.isView(r.value),"".concat(this._print(t),": must be typed array or object with value as typed array")),"POSITION"!==t&&"positions"!==t||r.size||(r.size=3),"indices"===t?(Mh(!this.indices),this.indices=r):this.attributes[t]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let r=1/0;for(const t in e){const n=e[t],{value:i,size:a,constant:o}=n;!o&&i&&a>=1&&(r=Math.min(r,i.length/a))}return Mh(Number.isFinite(r)),r}}{constructor(e={}){const{id:t=Lh("cube-geometry")}=e;super({...e,id:t,indices:{size:1,value:new Uint16Array(zh)},attributes:{...Gh,...e.attributes}})}}function Wh(e){var t,r;if(null==e||null===(t=e.parentNode)||void 0===t||!t.obb||null==e||null===(r=e.parentNode)||void 0===r||!r.mbs)return[];const n=[];return function(e,t){var r;const n=function(e){const{center:t,halfSize:r,quaternion:n}=e;return(new oi).fromCenterHalfSizeQuaternion(t,r,n)}(t.parentNode.obb),i=function(e){const t=new Vh,r=e.obb.halfSize,n=t.getAttributes(),i=new Float32Array(n.POSITION.value),a=Zr.WGS84.cartographicToCartesian(e.obb.center);let o=[];for(let t=0;t<i.length;t+=3){const n=new Ar(i[t]*=r[0],i[t+1]*=r[1],i[t+2]*=r[2]).transformByQuaternion(e.obb.quaternion).add(a);o=o.concat(n)}return o}(t);if(function(e,t){let r=!0;for(let n=0;n<t.length/3;n+=3){const i=[t[n],t[n+1],t[n+2]],a=Zr.WGS84.cartesianToCartographic(i);if(e.distanceTo(a)>0){r=!1;break}}return r}(n,i))return;const a="OBB of Tile (".concat(t.id,") doesn't fit into Parent (").concat(null===(r=t.parentNode)||void 0===r?void 0:r.id,") tile OBB");e.push(a)}(n,e),function(e,t){const r=Kh(t.mbs),n=Kh(t.parentNode.mbs);if(r.center.distanceTo(n.center)+r.radius>n.radius){var i;const r="MBS of Tile (".concat(t.id,") doesn't fit into Parent (").concat(null===(i=t.parentNode)||void 0===i?void 0:i.id,") tile MBS");e.push(r)}}(n,e),n}function Kh(e){return new mn([e[0],e[1],e[2]],e[3])}const Jh={name:"Basis Universal Supercompressed GPU Texture",id:"ktx2-basis-supercompressed-texture",module:"textures",version:"3.1.7",extensions:["ktx2"],options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1},encode:async function(e,t={}){const{useSRGB:r=!1,qualityLevel:n=10,encodeUASTC:i=!1,mipmaps:a=!1}=t,{BasisEncoder:o}=await cs(t),s=new o;try{const t=new Uint8Array(e.width*e.height*4);s.setCreateKTX2File(!0),s.setKTX2UASTCSupercompression(!0),s.setKTX2SRGBTransferFunc(!0),s.setSliceSourceImage(0,e.data,e.width,e.height,!1),s.setPerceptual(r),s.setMipSRGB(r),s.setQualityLevel(n),s.setUASTC(i),s.setMipGen(a);const o=s.encode(t);return t.subarray(0,o).buffer}catch(e){throw console.error("Basis Universal Supercompressed GPU Texture encoder Error: ",e),e}finally{s.delete()}}},{_encodeImageNode:Qh}=globalThis;let Yh=!0;const Xh={name:"Images",id:"image",module:"images",version:"3.1.7",extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:async function(e,t){return(t=t||{}).image=t.image||{},Qh?Qh(e,{type:t.image.mimeType}):async function(e,t){const{mimeType:r,jpegQuality:n}=t.image,{width:i,height:a}=function(e){return Ys(e)}(e),o=document.createElement("canvas");o.width=i,o.height=a,function(e,t,r=0,n=0){if(0===r&&0===n&&"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=t.getContext("bitmaprenderer");if(r)return r.transferFromImageBitmap(e),t}const i=t.getContext("2d");if(e.data){const r=new Uint8ClampedArray(e.data),n=new ImageData(r,e.width,e.height);return i.putImageData(n,0,0),t}i.drawImage(e,0,0)}(e,o);const s=await new Promise(e=>{if(n&&Yh)try{return void o.toBlob(e,r,n)}catch(e){Yh=!1}o.toBlob(e,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}(e,t)}},Zh=fl.a.env.IonToken||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlYWMxMzcyYy0zZjJkLTQwODctODNlNi01MDRkZmMzMjIxOWIiLCJpZCI6OTYyMCwic2NvcGVzIjpbImFzbCIsImFzciIsImdjIl0sImlhdCI6MTU2Mjg2NjI3M30.1FNiClUyk00YH_nWfSGpiQAjR5V2OvREDq1PJ5QMjWQ";class $h{constructor(){Object(p.a)(this,"nodePages",void 0),Object(p.a)(this,"fileMap",void 0),Object(p.a)(this,"options",void 0),Object(p.a)(this,"layers0Path",void 0),Object(p.a)(this,"materialMap",void 0),Object(p.a)(this,"materialDefinitions",void 0),Object(p.a)(this,"vertexCounter",void 0),Object(p.a)(this,"layers0",void 0),Object(p.a)(this,"featuresHashArray",void 0),Object(p.a)(this,"refinementCounter",void 0),Object(p.a)(this,"validate",void 0),Object(p.a)(this,"boundingVolumeWarnings",[]),Object(p.a)(this,"conversionStartTime",[0,0]),Object(p.a)(this,"refreshTokenTime",[0,0]),Object(p.a)(this,"sourceTileset",null),Object(p.a)(this,"geoidHeightModel",null),Object(p.a)(this,"Loader",Zu),Object(p.a)(this,"generateTextures",void 0),Object(p.a)(this,"generateBoundingVolumes",void 0),this.nodePages=new yl(Il,64),this.fileMap={},this.options={},this.layers0Path="",this.materialMap=new Map,this.materialDefinitions=[],this.vertexCounter=0,this.layers0=null,this.featuresHashArray=[],this.refinementCounter={tilesCount:0,tilesWithAddRefineCount:0},this.validate=!1,this.generateTextures=!1,this.generateBoundingVolumes=!1}async convert(e){this.conversionStartTime=fl.a.hrtime();const{tilesetName:t,slpk:r,egmFilePath:n,inputUrl:i,validate:a,outputPath:o,draco:s,sevenZipExe:c,maxDepth:u,token:l,generateTextures:h,generateBoundingVolumes:p}=e;this.options={maxDepth:u,slpk:r,sevenZipExe:c,egmFilePath:n,draco:s,token:l,inputUrl:i},this.validate=Boolean(a),this.Loader=-1!==i.indexOf("https://")?el:Zu,this.generateTextures=Boolean(h),this.generateBoundingVolumes=Boolean(p),console.log("Loading egm file..."),this.geoidHeightModel=await St(n,Oh),console.log("Loading egm file completed!"),r&&this.nodePages.useWriteFunction(Pl);const f=await this._fetchPreloadOptions(),d={loadOptions:{basis:{format:"rgba32"}}};f.headers&&(d.loadOptions.fetch={headers:f.headers}),Object.assign(d,f);const m=await St(i,this.Loader,d.loadOptions);return this.sourceTileset=new Ba(m,d),await this._createAndSaveTileset(o,t),await this._finishConversion({slpk:Boolean(r),outputPath:o,tilesetName:t}),m}async _createAndSaveTileset(e,t){const r=Object(tl.join)("".concat(e),"".concat(t));try{await Dl(r)}catch(e){}this.layers0Path=Object(tl.join)(r,"SceneServer","layers","0"),this._formLayers0(t),this.materialDefinitions=[],this.materialMap=new Map;const n=this.sourceTileset.root,i=Ql(n,this.geoidHeightModel),a=this.nodePages.push({index:0,lodThreshold:0,obb:i.obb,children:[]}),o=this.options.slpk,s=this._formRootNodeIndexDocument(i);await this._convertNodesTree(s,n,a,i),this.layers0.materialDefinitions=this.materialDefinitions,await this._writeLayers0(),async function(e,t,r){const n={serviceItemId:hl().replace(/-/gi,""),layerName:e,layers0:t},i=ml()(n,{serviceItemId:{path:"serviceItemId"},serviceName:{path:"layerName"},name:{path:"layerName"},currentVersion:{path:"currentVersion",default:10.7},serviceVersion:{path:"serviceVersion",default:"1.8"},supportedBindings:{path:"supportedBindings",default:["REST"]},layers:{path:"layers0",transform:e=>[e]}}),a=Object(tl.join)(r,"SceneServer");await Il(a,JSON.stringify(i))}(t,this.layers0,r),await this._writeNodeIndexDocument(s,"root",Object(tl.join)(this.layers0Path,"nodes","root")),await this.nodePages.save(this.layers0Path,this.fileMap,o),await this._createSlpk(r)}_formLayers0(e){const t=function(e){const t=null==e?void 0:e.cartesianCenter;if(!t)return null;const r=null==e?void 0:e.lodMetricValue,n=Zr.WGS84.cartesianToCartographic(new Ar(t[0]+r,t[1]+r,t[2]),new Ar),i=Zr.WGS84.cartesianToCartographic(new Ar(t[0]-r,t[1]-r,t[2]),new Ar),a=n[0]<i[0],o=n[1]<i[1];return[a?n[0]:i[0],o?n[1]:i[1],a?i[0]:n[0],o?i[1]:n[1]]}(this.sourceTileset),r={version:"{".concat(hl().toUpperCase(),"}"),id:0,name:e,href:"./layers/0",store:{id:"{".concat(hl().toUpperCase(),"}"),extent:t},nodePages:{nodesPerPage:64},compressGeometry:this.options.draco};this.layers0=ml()(r,{version:{path:"version",transform:e=>e.toUpperCase()},id:{path:"id",default:0},name:{path:"name"},href:{path:"href",default:"./layers/0"},layerType:{path:"layerType",default:"IntegratedMesh"},spatialReference:{path:"spatialReference",transform:e=>ml()(e,{wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}})},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>ml()(e,Rh)},heightModelInfo:{path:"heightModelInfo",transform:e=>ml()(e,{heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}})},nodePages:{path:"nodePages",transform:e=>ml()(e,{nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}})},materialDefinitions:{path:"materialDefinitions",default:[]},textureSetDefinitions:{path:"textureSetDefinitions",default:[]},geometryDefinitions:{path:"compressGeometry",transform:e=>{const t=[{geometryBuffers:[]},{geometryBuffers:[]}];return t[0].geometryBuffers.push({offset:8,position:{type:"Float32",component:3},normal:{type:"Float32",component:3},uv0:{type:"Float32",component:2},color:{type:"UInt8",component:4},featureId:{binding:"per-feature",type:"UInt64",component:1},faceRange:{binding:"per-feature",type:"UInt32",component:2}}),t[1].geometryBuffers.push({offset:8,position:{type:"Float32",component:3},normal:{type:"Float32",component:3},color:{type:"UInt8",component:4},featureId:{binding:"per-feature",type:"UInt64",component:1},faceRange:{binding:"per-feature",type:"UInt32",component:2}}),e&&(t[0].geometryBuffers.push({compressedAttributes:{encoding:"draco",attributes:["position","normal","uv0","color","feature-index"]}}),t[1].geometryBuffers.push({compressedAttributes:{encoding:"draco",attributes:["position","normal","color","feature-index"]}})),t},default:[{geometryBuffers:[{offset:8,position:{type:"Float32",component:3},normal:{type:"Float32",component:3},uv0:{type:"Float32",component:2},color:{type:"UInt8",component:4},featureId:{binding:"per-feature",type:"UInt64",component:1},faceRange:{binding:"per-feature",type:"UInt32",component:2}},{offset:8,position:{type:"Float32",component:3},normal:{type:"Float32",component:3},color:{type:"UInt8",component:4},featureId:{binding:"per-feature",type:"UInt64",component:1},faceRange:{binding:"per-feature",type:"UInt32",component:2}}]}]},attributeStorageInfo:{path:"attributeStorageInfo",default:[]},fields:{path:"fields",default:[]},popupInfo:{path:"popupInfo",default:null}})}_formRootNodeIndexDocument(e){const t={version:"{".concat(hl().toUpperCase(),"}"),id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}],...e,children:[]};return ml()(t,Ih())}async _convertNodesTree(e,t,r,n){if(await this.sourceTileset._loadTile(t),this.isContentSupported(t)){e.children=e.children||[],e.children.push({id:"1",href:"./1",...n});const[i]=await this._createNode(e,t,r,0),a=Object(tl.join)(this.layers0Path,"nodes",i.path);this.options.slpk?this.fileMap["nodes/1/3dNodeIndexDocument.json.gz"]=await Pl(a,JSON.stringify(i),"3dNodeIndexDocument.json"):await Il(a,JSON.stringify(i))}else await this._addChildrenWithNeighborsAndWriteFile({parentNode:e,sourceTiles:t.children,parentId:r,level:1});await t.unloadContent()}async _writeLayers0(){this.options.slpk?this.fileMap["3dSceneLayer.json.gz"]=await Pl(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json"):await Il(this.layers0Path,JSON.stringify(this.layers0))}async _writeNodeIndexDocument(e,t,r){this.options.slpk?this.fileMap["nodes/".concat(t,"/3dNodeIndexDocument.json.gz")]=await Pl(r,JSON.stringify(e),"3dNodeIndexDocument.json"):await Il(r,JSON.stringify(e))}async _createSlpk(e){if(this.options.slpk){const t=Object(tl.join)(e,"SceneServer","layers","0"),r="".concat(e,".slpk");await Bl(t,r,0,".",this.options.sevenZipExe);try{await Dl(e)}catch(e){}}}async _addChildrenWithNeighborsAndWriteFile(e){const t=[];await this._addChildren({...e,childNodes:t}),await this._addNeighborsAndWriteFile(e.parentNode,t)}async _addChildren(e){const{childNodes:t,sourceTiles:r,parentNode:n,parentId:i,level:a}=e;if(!(this.options.maxDepth&&a>this.options.maxDepth))for(const e of r){if("json"===e.type)await this.sourceTileset._loadTile(e),await this._addChildren({parentNode:n,sourceTiles:e.children,childNodes:t,parentId:i,level:a+1}),await e.unloadContent();else{const r=await this._createNode(n,e,i,a);n.children=n.children||[];for(const e of r)n.children.push({id:e.id,href:"../".concat(e.path),obb:e.obb,mbs:e.mbs}),t.push(e)}e.id&&console.log(e.id)}}async _addNeighborsAndWriteFile(e,t){for(const n of t){var r;const t=Object(tl.join)(this.layers0Path,"nodes",n.path),i=n.path;if(delete n.path,Number(null==e||null===(r=e.children)||void 0===r?void 0:r.length)<1e3)for(const t of e.children||[])n.id!==t.id&&n.neighbors&&n.neighbors.push({...t});else console.warn("Node ".concat(n.id,": neighbors attribute is omited because of large number of neigbors")),delete n.neighbors;await this._writeNodeIndexDocument(n,i,t),n.neighbors=[]}}async _createNode(e,t,r,n){var i;this.validate&&this._checkAddRefinementTypeForTile(t),await this._updateTilesetOptions(),await this.sourceTileset._loadTile(t);let a=Ql(t,this.geoidHeightModel);(null==t||null===(i=t.content)||void 0===i?void 0:i.batchTableJson)&&this._convertAttributeStorageInfo(t.content);const o=await this._convertResources(t),s=[],c=[],u={geometry:null,compressedGeometry:null,texture:null,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(const n of o||[u]){this.generateBoundingVolumes&&n.boundingVolumes&&(a=n.boundingVolumes);const i=kh(t,a),o=i.find(e=>"maxScreenThresholdSQ"===e.metricType)||{maxError:0},u=this._createNodeInNodePages(o,a,t,r,n),l=this._createNodeIndexDocument(e,a,i,u,n);u.mesh&&await this._writeResources(n,l.path),this.validate&&(this.boundingVolumeWarnings=Wh(l),this.boundingVolumeWarnings&&this.boundingVolumeWarnings.length&&console.warn("Bounding Volume Warnings: ",...this.boundingVolumeWarnings)),s.push(l),c.push(u)}return t.unloadContent(),await this._addChildrenWithNeighborsAndWriteFile({parentNode:s[0],sourceTiles:t.children,parentId:c[0].index,level:n+1}),s}_convertAttributeStorageInfo(e){var t,r;const n=e&&e.batchTableJson;!n||null!==(t=this.layers0)&&void 0!==t&&null!==(r=t.attributeStorageInfo)&&void 0!==r&&r.length||this._convertBatchTableInfoToNodeAttributes(n)}async _convertResources(e){var t;if(!this.isContentSupported(e))return null;return await eh(e.content,Number(this.nodePages.nodesCounter),this.featuresHashArray,null===(t=this.layers0)||void 0===t?void 0:t.attributeStorageInfo,this.options.draco,this.generateBoundingVolumes,this.geoidHeightModel)}_createNodeInNodePages(e,t,r,n,i){const{meshMaterial:a,texture:o,vertexCount:s,featureCount:c,geometry:u}=i,l={index:0,lodThreshold:e.maxError,obb:t.obb,children:[]};u&&this.isContentSupported(r)&&(l.mesh={geometry:{definition:o?0:1,resource:0},attribute:{resource:0},material:{definition:0}});const h=this.nodePages.push(l,n);if(a&&this.nodePages.updateMaterialByNodeId(h,this._findOrCreateMaterial(a)),o){const e=o.image.height*o.image.width;this.nodePages.updateTexelCountHintByNodeId(h,e)}return s&&(this.vertexCounter+=s,this.nodePages.updateVertexCountByNodeId(h,s)),this.nodePages.updateNodeAttributeByNodeId(h),c&&this.nodePages.updateFeatureCountByNodeId(h,c),l}_createNodeIndexDocument(e,t,r,n,i){const{texture:a,attributes:o}=i,s=n.index,c={version:e.version,id:s.toString(),path:s.toString(),level:e.level+1,...t,lodSelection:r,parentNode:{id:e.id,href:"../".concat(e.id),mbs:e.mbs,obb:e.obb},children:[],neighbors:[]},u=ml()(c,Ih());var l,h;if(n.mesh&&(u.geometryData=[{href:"./geometries/0"}],u.sharedResource={href:"./shared"},a&&(u.textureData=[{href:"./textures/0"},{href:"./textures/1"}]),o&&o.length&&null!==(l=this.layers0)&&void 0!==l&&null!==(h=l.attributeStorageInfo)&&void 0!==h&&h.length)){u.attributeData=[];for(let e=0;e<o.length;e++){const t=this.layers0.attributeStorageInfo[e].key;u.attributeData.push({href:"./attributes/".concat(t,"/0")})}}return u}async _writeResources(e,t){const{geometry:r,compressedGeometry:n,texture:i,sharedResources:a,attributes:o}=e,s=Object(tl.join)(this.layers0Path,"nodes",t),c=Object(tl.join)("nodes",t);await this._writeGeometries(r,n,s,c),await this._writeShared(a,s,c,t),await this._writeTexture(i,s,c),await this._writeAttributes(o,s,c)}async _writeGeometries(e,t,r,n){if(this.options.slpk){const t=Object(tl.join)(r,"geometries");this.fileMap["".concat(n,"/geometries/0.bin.gz")]=await Pl(t,e,"0.bin")}else{const t=Object(tl.join)(r,"geometries/0/");await Il(t,e,"index.bin")}if(this.options.draco)if(this.options.slpk){const e=Object(tl.join)(r,"geometries");this.fileMap["".concat(n,"/geometries/1.bin.gz")]=await Pl(e,t,"1.bin")}else{const e=Object(tl.join)(r,"geometries/1/");await Il(e,t,"index.bin")}}async _writeShared(e,t,r,n){e.nodePath=n;const i=ml()(e,{materialDefinitions:{path:"materialDefinitionInfos",transform:Ph},textureDefinitions:{path:"textureDefinitionInfos",transform:Dh}}),a=JSON.stringify(i);if(this.options.slpk){const e=Object(tl.join)(t,"shared");this.fileMap["".concat(r,"/shared/sharedResource.json.gz")]=await Pl(e,a,"sharedResource.json")}else{const e=Object(tl.join)(t,"shared/");await Il(e,a)}}async _writeTexture(e,t,r){if(e){const n=this._getFormatByMimeType(null==e?void 0:e.mimeType),i=[],a=e.bufferView.data;switch(n){case"jpg":case"png":if(i.push({name:"0",format:n}),await this.writeTextureFile(a,"0",n,t,r),this.generateTextures){i.push({name:"1",format:"ktx2"});const n=new Uint8Array(await jt(e.image,Jh));await this.writeTextureFile(n,"1","ktx2",t,r)}break;case"ktx2":if(i.push({name:"1",format:n}),await this.writeTextureFile(a,"1",n,t,r),this.generateTextures){i.push({name:"0",format:"jpg"});const n=new Uint8Array(await jt(e.image.data[0],Xh));await this.writeTextureFile(n,"0","jpg",t,r)}}this.layers0.textureSetDefinitions.length||this.layers0.textureSetDefinitions.push({formats:i})}}async writeTextureFile(e,t,r,n,i){if(this.options.slpk){const a=Object(tl.join)(n,"textures"),o=!1;this.fileMap["".concat(i,"/textures/").concat(t,".").concat(r)]=await Pl(a,e,"".concat(t,".").concat(r),o)}else{const i=Object(tl.join)(n,"textures/".concat(t,"/"));await Il(i,e,"index.".concat(r))}}async _writeAttributes(e,t,r){var n,i;if(e.length&&null!==(n=this.layers0)&&void 0!==n&&null!==(i=n.attributeStorageInfo)&&void 0!==i&&i.length)for(let n=0;n<e.length;n++){const i=this.layers0.attributeStorageInfo[n].key,a=new Uint8Array(e[n]);if(this.options.slpk){const e=Object(tl.join)(t,"attributes",i);this.fileMap["".concat(r,"/attributes/").concat(i,".bin.gz")]=await Pl(e,a,"0.bin")}else{const e=Object(tl.join)(t,"attributes/".concat(i,"/0"));await Il(e,a,"index.bin")}}}_getFormatByMimeType(e){switch(e){case"image/jpeg":return"jpg";case"image/png":return"png";case"image/ktx2":return"ktx2";default:return"jpg"}}_findOrCreateMaterial(e){const t=bl()(JSON.stringify(e));if(this.materialMap.has(t))return this.materialMap.get(t);const r=this.materialDefinitions.push(e)-1;return this.materialMap.set(t,r),r}_createdStorageAttribute(e,t,r){const n={key:"f_".concat(e),name:t,ordering:["attributeValues"],header:[{property:"count",valueType:"UInt32"}],attributeValues:{valueType:"Int32",valuesPerElement:1}};switch(r){case"OBJECTID":this._setupIdAttribute(n);break;case"string":this._setupStringAttribute(n);break;case"double":this._setupDoubleAttribute(n);break;case"Int32":break;default:this._setupStringAttribute(n)}return n}getAttributeType(e,t){return"OBJECTID"===e?"OBJECTID":"string"==typeof t?"string":"number"==typeof t?Number.isInteger(t)?"Int32":"double":"string"}_setupStringAttribute(e){e.ordering.unshift("attributeByteCounts"),e.header.push({property:"attributeValuesByteCount",valueType:"UInt32"}),e.attributeValues={valueType:"String",encoding:"UTF-8",valuesPerElement:1},e.attributeByteCounts={valueType:"UInt32",valuesPerElement:1}}_setupIdAttribute(e){e.attributeValues={valueType:"Oid32",valuesPerElement:1}}_setupDoubleAttribute(e){e.attributeValues={valueType:"Float64",valuesPerElement:1}}_createFieldAttribute(e,t){return{name:e,type:t,alias:e}}_convertBatchTableInfoToNodeAttributes(e){let t=0;const r={OBJECTID:[0],...e};for(const e in r){const n=r[e][0],i=this.getAttributeType(e,n),a=this._createdStorageAttribute(t,e,i),o=this._getFieldAttributeType(i),s=this._createFieldAttribute(e,o),c=this._createPopupInfo(r);this.layers0.attributeStorageInfo.push(a),this.layers0.fields.push(s),this.layers0.popupInfo=c,this.layers0.layerType="3DObject",t+=1}}_getFieldAttributeType(e){switch(e){case"OBJECTID":return"esriFieldTypeOID";case"string":return"esriFieldTypeString";case"Int32":return"esriFieldTypeInteger";case"double":return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}_createPopupInfo(e){const t=[],r=[];for(const r in e)t.push({fieldName:r,visible:!0,isEditable:!1,label:r});return r.push({fieldInfos:t,type:"fields"}),{title:"{OBJECTID}",mediaInfos:[],popupElements:r,fieldInfos:t,expressionInfos:[]}}async _finishConversion(e){const{tilesCount:t,tilesWithAddRefineCount:r}=this.refinementCounter,n=r?r/t*100:0,i=await Nl(e),a=Ll(fl.a.hrtime(this.conversionStartTime));console.log("------------------------------------------------"),console.log("Finishing conversion of ".concat("3DTILES")),console.log("Total conversion time: ".concat(a)),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",i," bytes"),console.log('Percentage of tiles with "ADD" refinement type:',n,"%"),console.log("------------------------------------------------")}async _fetchPreloadOptions(){if(!this.Loader.preload)return{};const e={"cesium-ion":{accessToken:this.options.token||Zh}},t=await this.Loader.preload(this.options.inputUrl,e);return this.refreshTokenTime=fl.a.hrtime(),{...e,...t}}async _updateTilesetOptions(){if(fl.a.hrtime(this.refreshTokenTime)[0]<1800)return;this.refreshTokenTime=fl.a.hrtime();const e=await this._fetchPreloadOptions();this.sourceTileset.options={...this.sourceTileset.options,...e},e.headers&&(this.sourceTileset.loadOptions.fetch={...this.sourceTileset.loadOptions.fetch,headers:e.headers},console.log("Authorization Bearer token has been updated"))}_checkAddRefinementTypeForTile(e){1===e.refine&&(this.refinementCounter.tilesWithAddRefineCount+=1,console.warn('This tile uses "ADD" type of refinement')),this.refinementCounter.tilesCount+=1}isContentSupported(e){var t;return["b3dm","glTF"].includes(null==e||null===(t=e.content)||void 0===t?void 0:t.type)}}const ep=542327876,tp=31,rp=0,np=1,ip=2,ap=3,op=4,sp=7,cp=20,up=21,lp=131072,hp=4,pp={DXT1:us.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:us.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:us.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":us.COMPRESSED_RGB_ATC_WEBGL,ATCA:us.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:us.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},fp={DXT1:mp,DXT3:gp,DXT5:gp,"ATC ":mp,ATCA:gp,ATCI:gp};function dp(e){const t=new Int32Array(e,0,tp),r=t[up];k(Boolean(t[cp]&hp),"DDS: Unsupported format, must contain a FourCC code");const n=(i=r,String.fromCharCode(255&i,i>>8&255,i>>16&255,i>>24&255));var i;const a=pp[n],o=fp[n];k(a&&o,"DDS: Unknown pixel format ".concat(r));let s=1;t[ip]&lp&&(s=Math.max(1,t[sp]));const c=t[op],u=t[ap],l=t[np]+4;return js(new Uint8Array(e,l),{mipMapLevels:s,width:c,height:u,sizeFunction:o,internalFormat:a})}function mp(e,t){return(e+3>>2)*(t+3>>2)*8}function gp(e,t){return(e+3>>2)*(t+3>>2)*16}const bp=55727696,yp=1347834371,vp=13,wp=52,_p=0,kp=2,xp=4,Ep=6,Ap=7,Sp=11,jp=12,Tp={0:[us.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[us.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[us.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[us.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[us.COMPRESSED_RGB_ETC1_WEBGL],7:[us.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[us.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[us.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[us.COMPRESSED_RGB8_ETC2],23:[us.COMPRESSED_RGBA8_ETC2_EAC],24:[us.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[us.COMPRESSED_R11_EAC],26:[us.COMPRESSED_RG11_EAC],27:[us.COMPRESSED_RGBA_ASTC_4X4_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[us.COMPRESSED_RGBA_ASTC_5X4_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[us.COMPRESSED_RGBA_ASTC_5X5_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[us.COMPRESSED_RGBA_ASTC_6X5_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[us.COMPRESSED_RGBA_ASTC_6X6_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[us.COMPRESSED_RGBA_ASTC_8X5_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[us.COMPRESSED_RGBA_ASTC_8X6_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[us.COMPRESSED_RGBA_ASTC_8X8_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[us.COMPRESSED_RGBA_ASTC_10X5_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[us.COMPRESSED_RGBA_ASTC_10X6_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[us.COMPRESSED_RGBA_ASTC_10X8_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[us.COMPRESSED_RGBA_ASTC_10X10_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[us.COMPRESSED_RGBA_ASTC_12X10_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[us.COMPRESSED_RGBA_ASTC_12X12_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},Cp={0:Bp,1:Bp,2:Op,3:Op,6:Rp,7:Rp,9:Ip,11:Ip,22:Rp,23:Ip,24:Rp,25:Rp,26:Ip,27:Ip,28:function(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16},29:function(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16},30:function(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16},31:function(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16},32:function(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16},33:function(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16},34:function(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16},35:function(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16},36:function(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16},37:function(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16},38:function(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16},39:function(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16},40:function(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}};function Bp(e,t){return(e=Math.max(e,16))*(t=Math.max(t,8))/4}function Op(e,t){return(e=Math.max(e,8))*(t=Math.max(t,8))/2}function Rp(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function Ip(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function Pp(e){if(Rs(e))return Is(e);if(function(e){return new Uint32Array(e,0,tp)[rp]===ep}(e))return dp(e);if(function(e){const t=new Uint32Array(e,0,vp)[_p];return t===bp||t===yp}(e))return function(e){const t=new Uint32Array(e,0,vp),r=t[kp],n=t[xp],i=Tp[r]||[],a=i.length>1&&n?i[1]:i[0],o=Cp[r],s=t[Sp],c=t[Ap],u=t[Ep],l=wp+t[jp];return js(new Uint8Array(e,l),{mipMapLevels:s,width:c,height:u,sizeFunction:o,internalFormat:a})}(e);throw new Error("Texture container format not recognized")}const Dp={name:"Texture Containers",id:"compressed-texture",module:"textures",version:"3.1.7",worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/",useBasis:!1}}},Mp={...Dp,parse:async(e,t)=>t["compressed-texture"].useBasis?(t.basis={format:{alpha:"BC3",noAlpha:"BC1"},...t.basis,containerFormat:"ktx2",module:"encoder"},await Ds(e,t)):Pp(e)};let Fp,Lp;function Np(e,t=null){return t?"".concat(e,"?token=").concat(t):e}!function(e){e.UInt8="UInt8",e.UInt16="UInt16",e.UInt32="UInt32",e.UInt64="UInt64",e.Int16="Int16",e.Int32="Int32",e.Int64="Int64",e.Float32="Float32",e.Float64="Float64"}(Fp||(Fp={})),function(e){e.vertexCount="vertexCount",e.featureCount="featureCount"}(Lp||(Lp={}));var zp=5121,Up=5125,qp=5126,Hp=5130;function Gp(e){switch(e){case Fp.UInt8:return Uint8Array;case Fp.UInt16:return Uint16Array;case Fp.UInt32:return Uint32Array;case Fp.Float32:return Float32Array;case Fp.UInt64:return Float64Array;default:throw new Error("parse i3s tile content: unknown type of data: ".concat(e))}}const Vp={UInt8:zp,UInt16:Up,Float32:qp,UInt32:Up,UInt64:Hp};function Wp(e){switch(e){case Fp.UInt8:return 1;case Fp.UInt16:case Fp.Int16:return 2;case Fp.UInt32:case Fp.Int32:case Fp.Float32:return 4;case Fp.UInt64:case Fp.Int64:case Fp.Float64:return 8;default:throw new Error("parse i3s tile content: unknown size of data: ".concat(e))}}let Kp;!function(e){e[e.DEFAULT=-1]="DEFAULT",e[e.LNGLAT=1]="LNGLAT",e[e.METER_OFFSETS=2]="METER_OFFSETS",e[e.LNGLAT_OFFSETS=3]="LNGLAT_OFFSETS",e[e.CARTESIAN=0]="CARTESIAN"}(Kp||(Kp={}));const Jp=new Ar([0,0,0]);async function Qp(e,t,r,n,i){if(t.content=t.content||{},t.content.featureIds=t.content.featureIds||null,t.content.attributes={},t.textureUrl){var a;const e=Np(t.textureUrl,null==n||null===(a=n.i3s)||void 0===a?void 0:a.token),r=function(e){switch(e){case"ktx-etc2":case"dds":return Mp;case"ktx2":return Hs;case"jpg":case"png":default:return cc}}(t.textureFormat),o=await fetch(e),s=await o.arrayBuffer();if(null!=n&&n.i3s.decodeTextures){if(r===cc){const e={...t.textureLoaderOptions,image:{type:"data"}};try{t.content.texture=await i.parse(s,e)}catch(n){t.content.texture=await At(s,r,e)}}else if(r===Mp||r===Hs){const e=await St(s,r,t.textureLoaderOptions);t.content.texture={compressed:!0,mipmaps:!1,width:e[0].width,height:e[0].height,data:e}}}else t.content.texture=s}return t.content.material=function(e,t){let r;e?r={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(r={pbrMetallicRoughness:{}},t?r.pbrMetallicRoughness.baseColorTexture={texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]);r.alphaCutoff=r.alphaCutoff||.25,r.alphaMode&&(r.alphaMode=r.alphaMode.toUpperCase());r.emissiveFactor&&(r.emissiveFactor=$p(r.emissiveFactor));r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=$p(r.pbrMetallicRoughness.baseColorFactor));t&&function(e,t){const r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:r}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:r}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:r}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:r})}(r,t);return r}(t.materialDefinition,t.content.texture),t.content.material&&(t.content.texture=null),await async function(e,t,r,n){var i;if(!t.content)return t;const a=t.content;let o,s,c,u=0,l=0;if(t.isDracoGeometry){var h;const t=await At(e,Ao,{draco:{attributeNameEntry:"i3s-attribute-type"}});s=t.header.vertexCount,c=null===(h=t.indices)||void 0===h?void 0:h.value;const{POSITION:r,NORMAL:n,COLOR_0:i,TEXCOORD_0:a,"feature-index":u,"uv-region":l}=t.attributes;o={position:r,normal:n,color:i,uv0:a,uvRegion:l,id:u},function(e,t){for(const r in t.loaderData.attributes){const n=t.loaderData.attributes[r];switch(n.name){case"POSITION":e.position.metadata=n.metadata;break;case"feature-index":e.id.metadata=n.metadata}}}(o,t);const p=function(e){var t,r;return null==e||null===(t=e.metadata)||void 0===t||null===(r=t["i3s-feature-ids"])||void 0===r?void 0:r.intArray}(u);p&&function(e,t){const r=e.id.value,n=new Float32Array(r.length);for(let e=0;e<r.length;e++)n[e]=t[r[e]];e.id.value=n}(o,p)}else{const{vertexAttributes:t,ordering:n,featureAttributes:i,featureAttributeOrder:a}=r.store.defaultGeometrySchema,c=function(e,t){let r=0,n=0,i=0;for(const{property:a,type:o}of e.store.defaultGeometrySchema.header){const e=Gp(o);switch(a){case Lp.vertexCount:n=new e(t,0,4)[0],r+=Wp(o);break;case Lp.featureCount:i=new e(t,4,4)[0],r+=Wp(o)}}return{vertexCount:n,featureCount:i,byteOffset:r}}(r,e);u=c.byteOffset,s=c.vertexCount,l=c.featureCount;const{attributes:h,byteOffset:p}=Xp(e,u,t,s,n),{attributes:f}=Xp(e,p,i,l,a);!function(e){const{id:t,faceRange:r}=e;if(!t||!r)return;const n=t.value,i=r.value,a=i[i.length-1]+1,o=new Uint32Array(3*a);let s=0,c=0;for(let e=1;e<i.length;e+=2){const t=Number(n[s]),r=i[e],a=i[e-1],u=c+3*(r-a+1);o.fill(t,c,u),s++,c=u}e.id.value=o}(f),o=function(e,t){return{...e,...t}}(h,f)}if(null!=n&&null!==(i=n.i3s)&&void 0!==i&&i.coordinateSystem&&n.i3s.coordinateSystem!==Kp.METER_OFFSETS)a.modelMatrix=function(e){var t,r;const n=e.metadata,i=(null==n||null===(t=n["i3s-scale_x"])||void 0===t?void 0:t.double)||1,a=(null==n||null===(r=n["i3s-scale_y"])||void 0===r?void 0:r.double)||1,o=new _r;return o[0]=i,o[5]=a,o}(o.position),a.coordinateSystem=Kp.LNGLAT_OFFSETS;else{const e=function(e,t){const r=t.mbs,n=e.value,i=e.metadata,a=new _r,o=new Ar(r[0],r[1],r[2]),s=new Ar;return Zr.WGS84.cartographicToCartesian(o,s),Zr.WGS84.eastNorthUpToFixedFrame(s,a),e.value=function(e,t={},r){const n=new Float64Array(e.length),i=t["i3s-scale_x"]&&t["i3s-scale_x"].double||1,a=t["i3s-scale_y"]&&t["i3s-scale_y"].double||1;for(let t=0;t<n.length;t+=3)n[t]=e[t]*i+r.x,n[t+1]=e[t+1]*a+r.y,n[t+2]=e[t+2]+r.z;for(let e=0;e<n.length;e+=3)Zr.WGS84.cartographicToCartesian(n.subarray(e,e+3),Jp),n[e]=Jp.x,n[e+1]=Jp.y,n[e+2]=Jp.z;return n}(n,i,o),a}(o.position,t);a.modelMatrix=e.invert(),a.coordinateSystem=Kp.METER_OFFSETS}a.attributes={positions:o.position,normals:o.normal,colors:Yp(o.color),texCoords:o.uv0,uvRegions:Yp(o.uvRegion)},a.indices=c||null,o.id&&o.id.value&&(t.content.featureIds=o.id.value);for(const e in a.attributes)a.attributes[e]||delete a.attributes[e];return a.vertexCount=s,a.byteLength=e.byteLength,t}(e,t,r,n)}function Yp(e){return e?(e.normalized=!0,e):e}function Xp(e,t,r,n,i){const a={};for(const o of i)if(r[o]){const{valueType:i,valuesPerElement:s}=r[o],c=n;if(t+c*s>e.byteLength)break;const u=e.slice(t);let l;if("UInt64"===i)l=Zp(u,c*s,Wp(i));else{l=new(Gp(i))(u,0,c*s)}switch(a[o]={value:l,type:Vp[i],size:s},o){case"color":a.color.normalized=!0}t+=c*s*Wp(i)}return{attributes:a,byteOffset:t}}function Zp(e,t,r){const n=[],i=new DataView(e);let a=0;for(let e=0;e<t;e++){const e=i.getUint32(a,!0)+2**32*i.getUint32(a+4,!0);n.push(e),a+=r}return new Uint32Array(n)}function $p(e){const t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}const ef={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:"3.1.7",mimeTypes:["application/octet-stream"],parse:async function(e,t,r){const{tile:n,tileset:i}=(null==t?void 0:t.i3s)||{};return await Qp(e,n,i,t,r),n.content},extensions:["bin"],options:{"i3s-content":{}}};async function tf(e){return JSON.parse((new TextDecoder).decode(e))}const rf={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:"3.1.7",mimeTypes:["application/json"],parse:async function(e){return e=tf(e)},extensions:["json"],options:{}};class nf{constructor(e,t){var r,n;Object(p.a)(this,"tileset",void 0),Object(p.a)(this,"nodePages",[]),Object(p.a)(this,"pendingNodePages",[]),Object(p.a)(this,"nodesPerPage",void 0),Object(p.a)(this,"options",void 0),Object(p.a)(this,"lodSelectionMetricType",void 0),Object(p.a)(this,"textureDefinitionsSelectedFormats",[]),Object(p.a)(this,"textureLoaderOptions",{}),this.tileset={...e},this.nodesPerPage=(null===(r=e.nodePages)||void 0===r?void 0:r.nodesPerPage)||64,this.lodSelectionMetricType=null===(n=e.nodePages)||void 0===n?void 0:n.lodSelectionMetricType,this.options=t,this.initSelectedFormatsForTextureDefinitions(e)}async getNodeById(e){const t=Math.floor(e/this.nodesPerPage);if(!this.nodePages[t]&&!this.pendingNodePages[t]){var r;const e=Np("".concat(this.tileset.url,"/nodepages/").concat(t),null===(r=this.options.i3s)||void 0===r?void 0:r.token);this.pendingNodePages[t]={status:"Pending",promise:St(e,rf,this.options)},this.nodePages[t]=await this.pendingNodePages[t].promise,this.pendingNodePages[t].status="Done"}"Pending"===this.pendingNodePages[t].status&&(this.nodePages[t]=await this.pendingNodePages[t].promise);const n=e%this.nodesPerPage;return this.nodePages[t].nodes[n]}async formTileFromNodePages(e){const t=await this.getNodeById(e),r=[];for(const e of t.children||[]){const t=await this.getNodeById(e);r.push({id:e.toString(),obb:t.obb})}let n,i,a,o="jpg",s=[],c=!1;if(t&&t.mesh){const{url:e,isDracoGeometry:r}=t.mesh.geometry&&this.getContentUrl(t.mesh.geometry)||{isDracoGeometry:!1};n=e,c=r;const{textureData:u,materialDefinition:l}=this.getInformationFromMaterial(t.mesh.material);a=l,o=u.format||o,u.name&&(i="".concat(this.tileset.url,"/nodes/").concat(t.mesh.material.resource,"/textures/").concat(u.name)),this.tileset.attributeStorageInfo&&(s=function(e,t){const r=[],{attributeStorageInfo:n,url:i}=e;for(let e=0;e<n.length;e++){const a=n[e].key;r.push("".concat(i,"/nodes/").concat(t,"/attributes/").concat(a,"/0"))}return r}(this.tileset,t.mesh.attribute.resource))}const u=this.getLodSelection(t);return af({id:e.toString(),lodSelection:u,obb:t.obb,contentUrl:n,textureUrl:i,attributeUrls:s,materialDefinition:a,textureFormat:o,textureLoaderOptions:this.textureLoaderOptions,children:r,isDracoGeometry:c})}getContentUrl(e){let t=null;const r=this.tileset.geometryDefinitions[e.definition];let n=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(n=r.geometryBuffers.findIndex(e=>e.compressedAttributes&&"draco"===e.compressedAttributes.encoding)),-1===n&&(n=r.geometryBuffers.findIndex(e=>!e.compressedAttributes)),-1!==n){const i=Boolean(r.geometryBuffers[n].compressedAttributes);t={url:"".concat(this.tileset.url,"/nodes/").concat(e.resource,"/geometries/").concat(n),isDracoGeometry:i}}return t}getLodSelection(e){const t=[];return"maxScreenThresholdSQ"===this.lodSelectionMetricType&&t.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(e.lodThreshold/(.25*Math.PI))}),t.push({metricType:this.lodSelectionMetricType,maxError:e.lodThreshold}),t}getInformationFromMaterial(e){const t={textureData:{name:null}};if(e){var r;const a=null===(r=this.tileset.materialDefinitions)||void 0===r?void 0:r[e.definition];if(a){var n,i;t.materialDefinition=a;const e=null==a||null===(n=a.pbrMetallicRoughness)||void 0===n||null===(i=n.baseColorTexture)||void 0===i?void 0:i.textureSetDefinitionId;"number"==typeof e&&(t.textureData=this.textureDefinitionsSelectedFormats[e]||t.textureData)}}return t}initSelectedFormatsForTextureDefinitions(e){this.textureDefinitionsSelectedFormats=[];const t=this.getSupportedTextureFormats(),r=e.textureSetDefinitions||[];for(const e of r){const r=e&&e.formats||[];let n=null;for(const e of t){const t=r.find(t=>t.format===e);if(t){n=t;break}}n&&"ktx2"===n.format&&(this.textureLoaderOptions.basis={format:Us(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(n)}}getSupportedTextureFormats(){const e=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){const t=fs();t.has("etc2")&&e.push("ktx-etc2"),t.has("dxt")&&e.push("dds"),e.push("ktx2")}return e.push("jpg"),e.push("png"),e}}function af(e){var t,r;const n={};let i=[0,0,0,1];if(e.mbs)i=e.mbs,n.sphere=[...Zr.WGS84.cartographicToCartesian(e.mbs.slice(0,3)),e.mbs[3]];else if(e.obb){n.box=[...Zr.WGS84.cartographicToCartesian(e.obb.center),...e.obb.halfSize,...e.obb.quaternion];const t=(new oi).fromCenterHalfSizeQuaternion(n.box.slice(0,3),e.obb.halfSize,e.obb.quaternion).getBoundingSphere();n.sphere=[...t.center,t.radius],i=[...e.obb.center,t.radius]}const a=null===(t=e.lodSelection)||void 0===t?void 0:t[0].metricType,o=null===(r=e.lodSelection)||void 0===r?void 0:r[0].maxError,s=e.transform,c=aa,u=ta;return{...e,mbs:i,boundingVolume:n,lodMetricType:a,lodMetricValue:o,transformMatrix:s,type:c,refine:u}}const of=/layers\/[0-9]+$/,sf=/nodes\/([0-9-]+|root)$/,cf={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:"3.1.7",mimeTypes:["application/octet-stream"],parse:async function(e,t,r){const n=r.url;t.i3s=t.i3s||{};if("504b0304"===function(e){if(e instanceof ArrayBuffer)return[...new Uint8Array(e,0,4)].map(e=>e.toString(16).padStart(2,"0")).join("");return null}(e))throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let i,a;i="auto"===t.i3s.isTileset?of.test(n):t.i3s.isTileset;a="auto"===t.isTileHeader?sf.test(n):t.i3s.isTileHeader;i?e=await async function(e,t,r){const n=JSON.parse((new TextDecoder).decode(e));return n.loader=cf,await async function(e,t,r){if(e.url=r.url,e.nodePages)e.nodePagesTile=new nf(e,t),e.root=await e.nodePagesTile.formTileFromNodePages(0);else{var n;const r=Np("".concat(e.url,"/nodes/root"),null===(n=t.i3s)||void 0===n?void 0:n.token);e.root=await St(r,e.loader,{...t,i3s:{...t.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}e.basePath=e.url,e.type=oa,e.lodMetricType=e.root.lodMetricType,e.lodMetricValue=e.root.lodMetricValue}(n,t,r),n}(e,t,r):a?(e=await async function(e,t,r){return function(e,t,r){const n=r.url||"";let i,a,o;return e.geometryData&&(i="".concat(n,"/").concat(e.geometryData[0].href)),e.textureData&&(a="".concat(n,"/").concat(e.textureData[0].href)),e.attributeData&&(o=function(e,t){const{attributeData:r=[]}=t,n=[];for(let t=0;t<r.length;t++){const i=r[t].href.replace("./","");n.push("".concat(e,"/").concat(i))}return n}(n,e)),af({...e,url:n,contentUrl:i,textureUrl:a,attributeUrls:o,isDracoGeometry:!1})}(e=JSON.parse((new TextDecoder).decode(e)),0,r)}(e,0,r),t.i3s.loadContent&&(t.i3s.tile=e,await St(e.contentUrl,cf,t))):e=await async function(e,t){return await At(e,ef,t)}(e,t);return e},extensions:["bin"],options:{i3s:{loadContent:!0,token:null,isTileset:"auto",isTileHeader:"auto",tile:null,tileset:null,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,coordinateSystem:Kp.METER_OFFSETS}}};async function uf(e,t){const{attributeName:r,attributeType:n}=t;return r?{[r]:n?lf(n,e):null}:{}}function lf(e,t){switch(e){case"String":return function(e){const t=[];try{const r=new DataView(e,0,4).getUint32(0,!0),n=new Uint32Array(e,8,r);let i=8+4*r;for(const r of n){const n=new TextDecoder("utf-8"),a=new Uint8Array(e,i,r);t.push(n.decode(a)),i+=r}}catch(e){console.error("Parse string attribute error: ",e.message)}return t}(t);case"Oid32":return hf(t);case"Float64":return function(e){return new Float64Array(e,8)}(t);case"Int16":return function(e){return new Int16Array(e,4)}(t);default:return hf(t)}}function hf(e){return new Uint32Array(e,4)}const pf={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:"3.1.7",mimeTypes:["application/binary"],parse:async function(e,t){return e=uf(e,t)},extensions:["bin"],options:{},binary:!0};function ff(e,t){const r=[e.center[0],e.center[1],e.center[2]+t.getHeight(e.center[1],e.center[0])],n=Zr.WGS84.cartographicToCartesian(r,new Ar),i=(new oi).fromCenterHalfSizeQuaternion(n,e.halfSize,e.quaternion);return[...i.center,...i.halfAxes.toArray()]}const df=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(e=>ml()(e,df()))}});function mf(e,t,r,n){const i=dc(r.byteLength,n),a=i-r.byteLength;if(e){const n=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),i=new Uint8Array(r);n.set(i);for(let n=0;n<a;++n)e.setUint8(t+r.byteLength+n,32)}return t+=i}function gf(e,t,r,n){return t=mf(e,t,(new TextEncoder).encode(r),n)}const bf=1179937895;function yf(e,t,r,n){return function(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}(e),function(e,t,r=0,n={}){const{magic:i=bf,version:a=2,json:o={},binary:s}=e,c=r;t&&(t.setUint32(r+0,i,!0),t.setUint32(r+4,a,!0),t.setUint32(r+8,0,!0));const u=r+8,l=r+=12;if(t&&(t.setUint32(r+0,0,!0),t.setUint32(r+4,1313821514,!0)),r=gf(t,r+=8,JSON.stringify(o),4),t){const e=r-l-8;t.setUint32(l+0,e,!0)}if(s){const e=r;if(t&&(t.setUint32(r+0,0,!0),t.setUint32(r+4,5130562,!0)),r=mf(t,r+=8,s,4),t){const n=r-e-8;t.setUint32(e+0,n,!0)}}if(t){const e=r-c;t.setUint32(u,e,!0)}return r}(e,t,r,n)}const vf={name:"glTF",id:"gltf",module:"gltf",version:"3.1.7",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,encodeSync:function(e,t={}){const{byteOffset:r=0}=t,n=yf(e,null,r,t),i=new ArrayBuffer(n),a=new DataView(i);return yf(e,a,r,t),i},options:{gltf:{}}};function wf(e,t,r){if(!t)return r+12;const{magic:n,version:i=1,byteLength:a=12}=e;return k(Array.isArray(n)&&Number.isFinite(i)&&Number.isFinite(a)),t.setUint8(r+0,n[0]),t.setUint8(r+1,n[1]),t.setUint8(r+2,n[2]),t.setUint8(r+3,n[3]),t.setUint32(r+4,i,!0),t.setUint32(r+8,a,!0),r+=12}function _f(e,t,r){e&&e.setUint32(t+8,r,!0)}function kf(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r.charCodeAt(i));return t+n}function xf(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r[i]);return t+n}const Ef={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function Af(e,t,r,n){const{featureTableJson:i=Ef}=e;let a=JSON.stringify(i);a=function(e,t){const r=e.length,n=Math.ceil(r/t)*t-r;let i="";for(let e=0;e<n;++e)i+=" ";return e+i}(a,4);const{featureTableJsonByteLength:o=a.length}=e,s=new ArrayBuffer(12),c=s.byteLength,u=r;return r+=wf(e={magic:Ra.POINT_CLOUD,...e},t,0),t&&(t.setUint32(r+0,o,!0),t.setUint32(r+4,c,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=kf(t,r,a,o),_f(t,u,(r+=xf(t,r,s,c))-u),r}function Sf(e,t,r,n){switch(k("string"==typeof e.type),e.type){case Oa.COMPOSITE:return function(e,t,r,n,i){const a=r;r+=wf(e={magic:Ra.COMPOSITE,tiles:[],...e},t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let a=0;a<e.tiles.length;++a)r+=i(e.tiles[a],t,r,n);return _f(t,a,r-a),r}(e,t,r,n,Sf);case Oa.POINT_CLOUD:return Af(e,t,r);case Oa.BATCHED_3D_MODEL:return function(e,t,r,n){const{featuresLength:i=0,batchTable:a}=e,o={BATCH_LENGTH:i},s=JSON.stringify(o),c=a?JSON.stringify(a):"",u=dc(s.length,8),l=c?dc(c.length,8):0,h=r;r=wf(e={magic:Ra.BATCHED_MODEL,...e},t,r),t&&(t.setUint32(12,u,!0),t.setUint32(16,0,!0),t.setUint32(20,l,!0),t.setUint32(24,0,!0)),r=gf(t,r+=16,s,8),a&&(r=gf(t,r,c,8));const p=e.gltfEncoded;return p&&(r=xf(t,r,p,p.byteLength)),_f(t,h,r-h),r}(e,t,r);case Oa.INSTANCED_3D_MODEL:return function(e,t,r,n){const{featuresLength:i=1,gltfFormat:a=1,gltfUri:o=""}=e,s=o.length,c={INSTANCES_LENGTH:i,POSITION:new Array(3*i).fill(0)},u=JSON.stringify(c),l=u.length,h=r;return r=wf(e={magic:Ra.INSTANCED_MODEL,...e},t,0),t&&(t.setUint32(12,l,!0),t.setUint32(16,0,!0),t.setUint32(20,0,!0),t.setUint32(24,0,!0),t.setUint32(28,a,!0)),r+=20,r+=kf(t,r,u,l),_f(t,h,(r+=kf(t,r,o,s))-h),r}(e,t,r);default:throw new Error("3D Tiles: unknown tile type")}}const jf={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:"3.1.7",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:function(e,t){return function(e,t){const r=Sf(e,null,0,t),n=new ArrayBuffer(r);return Sf(e,new DataView(n),0,t),n}(e,t)},binary:!0,options:{"3d-tiles":{}}};function Tf(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}const Cf=new _r([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),Bf=new Ar;class Of{constructor(){Object(p.a)(this,"rtcCenter",void 0),Object(p.a)(this,"i3sTile",void 0)}async convert(e,t=null){this.i3sTile=e;const r=await this.buildGltf(e);return Tt({gltfEncoded:new Uint8Array(r),type:"b3dm",featuresLength:this._getFeaturesLength(t),batchTable:t},jf)}async buildGltf(e){const{material:t,attributes:r,indices:n,cartesianOrigin:i,cartographicOrigin:a,modelMatrix:o}=e.content,s=new Sc,c=await this._addI3sTextureToGltf(e,s),u=this._convertI3sMaterialToGltfMaterial(t,c),l=s.addMaterial(u),h=r.positions,p=h.value;r.uvRegions&&r.texCoords&&(r.texCoords.value=function(e,t){const r=new Float32Array(e.length),n=function(e){const t=[];for(let r=0;r<e.length;r++)t[r]=e[r]/65535;return t}(t);for(let t=0;t<e.length;t+=2){const i=e.subarray(t,t+2),a=n.slice(2*t,2*t+4),o=Tf([i[0],i[1]]),s=[a[2]-a[0],a[3]-a[1]],c=[o[0]*s[0],o[1]*s[1]],u=[c[0]+a[0],c[1]+a[1]];r[t]=u[0],r[t+1]=u[1]}return r}(r.texCoords.value,r.uvRegions.value)),r.positions.value=this._normalizePositions(p,i,a,o),r.normals&&!this._checkNormals(r.normals.value)&&delete r.normals;const f=n||this._generateSynteticIndices(p.length/h.size),d=s.addMesh({attributes:r,indices:f,material:l}),m=this._generateTransformMatrix(i),g=s.addNode({meshIndex:d,matrix:m}),b=s.addScene({nodeIndices:[g]});s.setDefaultScene(b),s.createBinaryChunk();return Tt(s.gltf,vf)}async _addI3sTextureToGltf(e,t){const{content:{texture:r,material:n,attributes:i},header:{textureFormat:a}}=e;let o=null,s=r;if(!r&&n&&(s=n.pbrMetallicRoughness&&n.pbrMetallicRoughness.baseColorTexture&&n.pbrMetallicRoughness.baseColorTexture.texture.source.image),s){const e=this._deduceMimeTypeFromFormat(a),r=await jt(s,Xh),n=t.addImage(r,e);o=t.addTexture({imageIndex:n}),delete i.colors}return o}_normalizePositions(e,t,r,n){const i=new Float32Array(e.length);for(let a=0;a<e.length;a+=3){const o=e.subarray(a,a+3),s=new Ar(t);let c=new Ar(Array.from(o)).transform(n).add(r);Zr.WGS84.cartographicToCartesian(c,Bf),c=Bf.subtract(s),i.set(c,a)}return i}_generateTransformMatrix(e){return(new _r).translate(e).multiplyLeft(Cf)}_generateBatchId(e){const t=3*(e[e.length-1]+1),r=new Float32Array(t);let n=0,i=0;for(let t=0;t<e.length/2;t++){const t=3*e[n],a=3*(e[n+1]+1);r.fill(i,t,a),n+=2,i+=1}return r}_generateSynteticIndices(e){const t=new Uint32Array(e);for(let r=0;r<e;r++)t.set([r],r);return t}_deduceMimeTypeFromFormat(e){switch(e){case"jpg":return"image/jpeg";case"png":return"image/png";default:return console.warn("Unexpected texture format in I3S: ".concat(e)),"image/jpeg"}}_convertI3sMaterialToGltfMaterial(e,t){return e?(null!==t&&(e=this._setGltfTexture(e,t)),e):(e={alphaMode:"OPAQUE",doubleSided:!1,pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:1}},null!==t?e.pbrMetallicRoughness.baseColorTexture={index:t,texCoord:0}:e.pbrMetallicRoughness.baseColorFactor=[1,1,1,1],e)}_setGltfTexture(e,t){const r={...e,pbrMetallicRoughness:{...e.pbrMetallicRoughness}};return e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?r.pbrMetallicRoughness.baseColorTexture={index:t,texCoord:0}:e.emissiveTexture?r.emissiveTexture={index:t,texCoord:0}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?r.pbrMetallicRoughness.metallicRoughnessTexture={index:t,texCoord:0}:e.normalTexture?r.normalTexture={index:t,texCoord:0}:e.occlusionTexture&&(r.occlusionTexture={index:t,texCoord:0}),r}_getFeaturesLength(e){if(!e)return 0;const t=Object.keys(e)[0];return t?e[t].length:0}_checkNormals(e){return e.find(e=>e)}}class Rf{constructor(){Object(p.a)(this,"options",void 0),Object(p.a)(this,"tilesetPath",void 0),Object(p.a)(this,"vertexCounter",void 0),Object(p.a)(this,"conversionStartTime",void 0),Object(p.a)(this,"geoidHeightModel",void 0),Object(p.a)(this,"sourceTileset",void 0),Object(p.a)(this,"attributeStorageInfo",void 0),this.options={},this.tilesetPath="",this.vertexCounter=0,this.conversionStartTime=[0,0],this.geoidHeightModel=null,this.sourceTileset=null,this.attributeStorageInfo=null}async convert(e){const{inputUrl:t,outputPath:r,tilesetName:n,maxDepth:i,egmFilePath:a}=e;this.conversionStartTime=fl.a.hrtime(),this.options={maxDepth:i},console.log("Loading egm file..."),this.geoidHeightModel=await St(a,Oh),console.log("Loading egm file completed!");const o=await St(t,cf,{});this.sourceTileset=new Ba(o,{loadOptions:{i3s:{coordinateSystem:Kp.LNGLAT_OFFSETS}}});const s=this.sourceTileset.root;s.header.obb||(s.header.obb=Xl(s.header.mbs)),this.tilesetPath=Object(tl.join)("".concat(r),"".concat(n)),this.attributeStorageInfo=o.attributeStorageInfo;try{await Dl(this.tilesetPath)}catch(e){}const c={boundingVolume:{box:ff(s.header.obb,this.geoidHeightModel)},geometricError:xh(s),children:[]};await this._addChildren(s,c,1);const u=ml()({root:c},{asset:{path:"asset",transform:e=>ml()(e,{version:{path:"version",default:"1.0"}})},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>ml()(e,df())}});await Il(this.tilesetPath,JSON.stringify(u),"tileset.json"),this._finishConversion({slpk:!1,outputPath:r,tilesetName:n})}async _addChildren(e,t,r){if(!(this.options.maxDepth&&r>this.options.maxDepth))for(const n of e.header.children||[]){const i=await this._loadChildNode(e,n);if(e.children.push(i),i.contentUrl){await this.sourceTileset._loadTile(i),this.vertexCounter+=i.content.vertexCount;let e=null;this.attributeStorageInfo&&(e=await this._loadChildAttributes(i,this.attributeStorageInfo)),i.header.obb||(i.header.obb=Xl(i.header.mbs));const n={box:ff(i.header.obb,this.geoidHeightModel)},a={boundingVolume:n,geometricError:xh(i),children:[]},o=await(new Of).convert(i,e);a.content={uri:"".concat(i.id,".b3dm"),boundingVolume:n},await Il(this.tilesetPath,new Uint8Array(o),"".concat(i.id,".b3dm")),t.children.push(a),i.unloadContent(),await this._addChildren(i,a,r+1)}else await this._addChildren(i,t,r+1)}}async _loadChildNode(e,t){let r;if(this.sourceTileset.tileset.nodePages)console.log("Node conversion: ".concat(t.id)),r=await this.sourceTileset.tileset.nodePagesTile.formTileFromNodePages(t.id);else{const{loader:n}=this.sourceTileset,i=this._relativeUrlToFullUrl(e.url,t.href),a={i3s:{...this.sourceTileset.loadOptions,isTileHeader:!0,loadContent:!1}};console.log("Node conversion: ".concat(i)),r=await St(i,n,a)}return new ka(this.sourceTileset,r,e)}_relativeUrlToFullUrl(e,t){let r=e.split("/");const n=t.split("/");for(const e of n)switch(e){case".":continue;case"..":r=r.slice(0,-1);break;default:r.push(e)}return r.join("/")}async _loadChildAttributes(e,t){const r=[],{attributeUrls:n}=e.header;for(let e=0;e<n.length;e++){const i=n[e],a=t[e],o={attributeName:a.name,attributeType:this._getAttributeType(a)};r.push(St(i,pf,o))}const i=await Promise.all(r);return this._replaceNestedArrays(i),Object.assign({},...i)}_getAttributeType(e){return e.attributeValues?e.attributeValues.valueType:e.objectIds?"Oid32":""}_replaceNestedArrays(e){for(let t=0;t<e.length;t++){const r=e[t];for(const e in r)r[e]=Array.from(r[e])}}async _finishConversion(e){const t=await Nl(e),r=Ll(fl.a.hrtime(this.conversionStartTime));console.log("------------------------------------------------"),console.log("Finish conversion of ".concat("I3S")),console.log("Total conversion time: ".concat(r)),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",t," bytes"),console.log("------------------------------------------------")}}const If={id:"zip",module:"zip",name:"Zip Archive",version:"3.1.7",extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:async function(e,t={}){const r=[],n={};try{const i=new Al.a;return(await i.loadAsync(e,t)).forEach((e,a)=>{const o=a.name,s=async function(e,t,r={}){try{return await e.file(t).async(r.dataType||"arraybuffer")}catch(e){return r.log.error("Unable to read ".concat(t," from zip archive: ").concat(e)),e}}(i,o,t).then(t=>{n[e]=t});r.push(s)}),await Promise.all(r),n}catch(e){throw t.log.error("Unable to read zip archive: ".concat(e)),e}}};class Pf{async install(e=""){console.log('Installing "EGM2008-5" model...');const t=await St("https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",If,{});let r=process.cwd();e&&(r=Object(tl.join)(r,e)),await Il(r,new Uint8Array(t["geoids/egm2008-5.pgm"]),"egm2008-5.pgm"),console.log("All dependencies were installed succesfully.")}}},function(e,t,r){"use strict";r.r(t);var n=r(2),i=r(115);const a="object"!=typeof process||"[object process]"!==String(process)||process.browser,o={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global},s=o.global||o.self||o.window;function c(e,t,r){return t<=e&&e<=r}global["encoding-indexes"]={ibm866:[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160],"iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729],"iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729],"iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119],"iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null],"iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312],"iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217],"iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255],"iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255],"koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],"koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],macintosh:[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711],"windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null],"windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],"windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255],"windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746],"windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729],"windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255],"x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364]}||{};var u=Math.floor;function l(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function h(e){return 0<=e&&e<=127}var p=h;function f(e){this.tokens=[].slice.call(e),this.tokens.reverse()}f.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():-1},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.shift());else this.tokens.unshift(e)}};function d(e,t){if(e)throw TypeError("Decoder error");return t||65533}function m(e){throw TypeError("The code point "+e+" could not be encoded.")}function g(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(y,e)?y[e]:null}var b=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],y={};b.forEach((function(e){e.encodings.forEach((function(e){e.labels.forEach((function(t){y[t]=e}))}))}));var v,w,_={},k={};function x(e,t){return t&&t[e]||null}function E(e,t){var r=t.indexOf(e);return-1===r?null:r}function A(e){if(!("encoding-indexes"in global))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return global["encoding-indexes"][e]}function S(e,t){if(!(this instanceof S))throw TypeError("Called as a function. Did you forget 'new'?");e=void 0!==e?String(e):"utf-8",t=l(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=g(e);if(null===r||"replacement"===r.name)throw RangeError("Unknown encoding: "+e);if(!k[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");return this._encoding=r,Boolean(t.fatal)&&(this._error_mode="fatal"),Boolean(t.ignoreBOM)&&(this._ignoreBOM=!0),Object.defineProperty||(this.encoding=this._encoding.name.toLowerCase(),this.fatal="fatal"===this._error_mode,this.ignoreBOM=this._ignoreBOM),this}function j(e,t){if(!(this instanceof j))throw TypeError("Called as a function. Did you forget 'new'?");t=l(t),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(t.fatal)?"fatal":"replacement";if(Boolean(t.NONSTANDARD_allowLegacyEncoding)){var r=g(e=void 0!==e?String(e):"utf-8");if(null===r||"replacement"===r.name)throw RangeError("Unknown encoding: "+e);if(!_[r.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");this._encoding=r}else this._encoding=g("utf-8"),void 0!==e&&"console"in global&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=this._encoding.name.toLowerCase()),this}function T(e){var t=e.fatal,r=0,n=0,i=0,a=128,o=191;this.handler=function(e,s){if(-1===s&&0!==i)return i=0,d(t);if(-1===s)return-1;if(0===i){if(c(s,0,127))return s;if(c(s,194,223))i=1,r=31&s;else if(c(s,224,239))224===s&&(a=160),237===s&&(o=159),i=2,r=15&s;else{if(!c(s,240,244))return d(t);240===s&&(a=144),244===s&&(o=143),i=3,r=7&s}return null}if(!c(s,a,o))return r=i=n=0,a=128,o=191,e.prepend(s),d(t);if(a=128,o=191,r=r<<6|63&s,(n+=1)!==i)return null;var u=r;return r=i=n=0,u}}function C(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(p(t))return t;var r,n;c(t,128,2047)?(r=1,n=192):c(t,2048,65535)?(r=2,n=224):c(t,65536,1114111)&&(r=3,n=240);for(var i=[(t>>6*r)+n];r>0;){var a=t>>6*(r-1);i.push(128|63&a),r-=1}return i}}function B(e,t){var r=t.fatal;this.handler=function(t,n){if(-1===n)return-1;if(h(n))return n;var i=e[n-128];return null===i?d(r):i}}function O(e,t){t.fatal;this.handler=function(t,r){if(-1===r)return-1;if(p(r))return r;var n=E(r,e);return null===n&&m(r),n+128}}function R(e){var t=e.fatal,r=0,n=0,i=0;this.handler=function(e,a){if(-1===a&&0===r&&0===n&&0===i)return-1;var o;if(-1!==a||0===r&&0===n&&0===i||(r=0,n=0,i=0,d(t)),0!==i){o=null,c(a,48,57)&&(o=function(e){if(e>39419&&e<189e3||e>1237575)return null;if(7457===e)return 59335;var t,r=0,n=0,i=A("gb18030-ranges");for(t=0;t<i.length;++t){var a=i[t];if(!(a[0]<=e))break;r=a[0],n=a[1]}return n+e-r}(10*(126*(10*(r-129)+n-48)+i-129)+a-48));var s=[n,i,a];return r=0,n=0,i=0,null===o?(e.prepend(s),d(t)):o}if(0!==n)return c(a,129,254)?(i=a,null):(e.prepend([n,a]),r=0,n=0,d(t));if(0!==r){if(c(a,48,57))return n=a,null;var u=r,l=null;r=0;var p=a<127?64:65;return(c(a,64,126)||c(a,128,254))&&(l=190*(u-129)+(a-p)),null===(o=null===l?null:x(l,A("gb18030")))&&h(a)&&e.prepend(a),null===o?d(t):o}return h(a)?a:128===a?8364:c(a,129,254)?(r=a,null):d(t)}}function I(e,t){e.fatal;this.handler=function(e,r){if(-1===r)return-1;if(p(r))return r;if(58853===r)return m(r);if(t&&8364===r)return 128;var n=E(r,A("gb18030"));if(null!==n){var i=n%190;return[u(n/190)+129,i+(i<63?64:65)]}if(t)return m(r);n=function(e){if(59335===e)return 7457;var t,r=0,n=0,i=A("gb18030-ranges");for(t=0;t<i.length;++t){var a=i[t];if(!(a[1]<=e))break;r=a[1],n=a[0]}return n+e-r}(r);var a=u(n/10/126/10),o=u((n-=10*a*126*10)/10/126),s=u((n-=10*o*126)/10);return[a+129,o+48,s+129,n-10*s+48]}}function P(e){var t=e.fatal,r=0;this.handler=function(e,n){if(-1===n&&0!==r)return r=0,d(t);if(-1===n&&0===r)return-1;if(0!==r){var i=r,a=null;r=0;var o=n<127?64:98;switch((c(n,64,126)||c(n,161,254))&&(a=157*(i-129)+(n-o)),a){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var s=null===a?null:x(a,A("big5"));return null===s&&h(n)&&e.prepend(n),null===s?d(t):s}return h(n)?n:c(n,129,254)?(r=n,null):d(t)}}function D(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(p(t))return t;var r=function(e){var t=w=w||A("big5").map((function(e,t){return t<5024?null:e}));return 9552===e||9566===e||9569===e||9578===e||21313===e||21317===e?t.lastIndexOf(e):E(e,t)}(t);if(null===r)return m(t);var n=u(r/157)+129;if(n<161)return m(t);var i=r%157;return[n,i+(i<63?64:98)]}}function M(e){var t=e.fatal,r=!1,n=0;this.handler=function(e,i){if(-1===i&&0!==n)return n=0,d(t);if(-1===i&&0===n)return-1;if(142===n&&c(i,161,223))return n=0,65216+i;if(143===n&&c(i,161,254))return r=!0,n=i,null;if(0!==n){var a=n;n=0;var o=null;return c(a,161,254)&&c(i,161,254)&&(o=x(94*(a-161)+(i-161),A(r?"jis0212":"jis0208"))),r=!1,c(i,161,254)||e.prepend(i),null===o?d(t):o}return h(i)?i:142===i||143===i||c(i,161,254)?(n=i,null):d(t)}}function F(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(p(t))return t;if(165===t)return 92;if(8254===t)return 126;if(c(t,65377,65439))return[142,t-65377+161];8722===t&&(t=65293);var r=E(t,A("jis0208"));return null===r?m(t):[u(r/94)+161,r%94+161]}}function L(e){var t=e.fatal,r=0,n=1,i=2,a=3,o=4,s=5,u=6,l=r,h=r,p=0,f=!1;this.handler=function(e,m){switch(l){default:case r:return 27===m?(l=s,null):c(m,0,127)&&14!==m&&15!==m&&27!==m?(f=!1,m):-1===m?-1:(f=!1,d(t));case n:return 27===m?(l=s,null):92===m?(f=!1,165):126===m?(f=!1,8254):c(m,0,127)&&14!==m&&15!==m&&27!==m&&92!==m&&126!==m?(f=!1,m):-1===m?-1:(f=!1,d(t));case i:return 27===m?(l=s,null):c(m,33,95)?(f=!1,65344+m):-1===m?-1:(f=!1,d(t));case a:return 27===m?(l=s,null):c(m,33,126)?(f=!1,p=m,l=o,null):-1===m?-1:(f=!1,d(t));case o:if(27===m)return l=s,d(t);if(c(m,33,126)){l=a;var g=x(94*(p-33)+m-33,A("jis0208"));return null===g?d(t):g}return-1===m?(l=a,e.prepend(m),d(t)):(l=a,d(t));case s:return 36===m||40===m?(p=m,l=u,null):(e.prepend(m),f=!1,l=h,d(t));case u:var b=p;p=0;var y=null;if(40===b&&66===m&&(y=r),40===b&&74===m&&(y=n),40===b&&73===m&&(y=i),36!==b||64!==m&&66!==m||(y=a),null!==y){l=l=y;var v=f;return f=!0,v?d(t):null}return e.prepend([b,m]),f=!1,l=h,d(t)}}}function N(e){e.fatal;var t=0,r=1,n=2,i=t;this.handler=function(e,a){if(-1===a&&i!==t)return e.prepend(a),i=t,[27,40,66];if(-1===a&&i===t)return-1;if(!(i!==t&&i!==r||14!==a&&15!==a&&27!==a))return m(65533);if(i===t&&p(a))return a;if(i===r&&(p(a)&&92!==a&&126!==a||165==a||8254==a)){if(p(a))return a;if(165===a)return 92;if(8254===a)return 126}if(p(a)&&i!==t)return e.prepend(a),i=t,[27,40,66];if((165===a||8254===a)&&i!==r)return e.prepend(a),i=r,[27,40,74];8722===a&&(a=65293);var o=E(a,A("jis0208"));return null===o?m(a):i!==n?(e.prepend(a),i=n,[27,36,66]):[u(o/94)+33,o%94+33]}}function z(e){var t=e.fatal,r=0;this.handler=function(e,n){if(-1===n&&0!==r)return r=0,d(t);if(-1===n&&0===r)return-1;if(0!==r){var i=r,a=null;r=0;var o=n<127?64:65,s=i<160?129:193;if((c(n,64,126)||c(n,128,252))&&(a=188*(i-s)+n-o),c(a,8836,10715))return 48508+a;var u=null===a?null:x(a,A("jis0208"));return null===u&&h(n)&&e.prepend(n),null===u?d(t):u}return h(n)||128===n?n:c(n,161,223)?65216+n:c(n,129,159)||c(n,224,252)?(r=n,null):d(t)}}function U(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(p(t)||128===t)return t;if(165===t)return 92;if(8254===t)return 126;if(c(t,65377,65439))return t-65377+161;8722===t&&(t=65293);var r=function(e){return(v=v||A("jis0208").map((function(e,t){return c(t,8272,8835)?null:e}))).indexOf(e)}(t);if(null===r)return m(t);var n=u(r/188),i=r%188;return[n+(n<31?129:193),i+(i<63?64:65)]}}function q(e){var t=e.fatal,r=0;this.handler=function(e,n){if(-1===n&&0!==r)return r=0,d(t);if(-1===n&&0===r)return-1;if(0!==r){var i=r,a=null;r=0,c(n,65,254)&&(a=190*(i-129)+(n-65));var o=null===a?null:x(a,A("euc-kr"));return null===a&&h(n)&&e.prepend(n),null===o?d(t):o}return h(n)?n:c(n,129,254)?(r=n,null):d(t)}}function H(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(p(t))return t;var r=E(t,A("euc-kr"));return null===r?m(t):[u(r/190)+129,r%190+65]}}function G(e,t){var r=e>>8,n=255&e;return t?[r,n]:[n,r]}function V(e,t){var r=t.fatal,n=null,i=null;this.handler=function(t,a){if(-1===a&&(null!==n||null!==i))return d(r);if(-1===a&&null===n&&null===i)return-1;if(null===n)return n=a,null;var o;if(o=e?(n<<8)+a:(a<<8)+n,n=null,null!==i){var s=i;return i=null,c(o,56320,57343)?65536+1024*(s-55296)+(o-56320):(t.prepend(G(o,e)),d(r))}return c(o,55296,56319)?(i=o,null):c(o,56320,57343)?d(r):o}}function W(e,t){t.fatal;this.handler=function(t,r){if(-1===r)return-1;if(c(r,0,65535))return G(r,e);var n=G(55296+(r-65536>>10),e),i=G(56320+(r-65536&1023),e);return n.concat(i)}}function K(e){e.fatal;this.handler=function(e,t){return-1===t?-1:h(t)?t:63360+t-128}}function J(e){e.fatal;this.handler=function(e,t){return-1===t?-1:p(t)?t:c(t,63360,63487)?t-63360+128:m(t)}}Object.defineProperty&&(Object.defineProperty(S.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(S.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(S.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),S.prototype.decode=function(e,t){var r;r="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=l(t),this._do_not_flush||(this._decoder=k[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(t.stream);for(var n,i=new f(r),a=[];;){var o=i.read();if(-1===o)break;if(-1===(n=this._decoder.handler(i,o)))break;null!==n&&(Array.isArray(n)?a.push.apply(a,n):a.push(n))}if(!this._do_not_flush){do{if(-1===(n=this._decoder.handler(i,i.read())))break;null!==n&&(Array.isArray(n)?a.push.apply(a,n):a.push(n))}while(!i.endOfStream());this._decoder=null}return function(e){var t,r;return t=["UTF-8","UTF-16LE","UTF-16BE"],r=this._encoding.name,-1===t.indexOf(r)||this._ignoreBOM||this._BOMseen||(e.length>0&&65279===e[0]?(this._BOMseen=!0,e.shift()):e.length>0&&(this._BOMseen=!0)),function(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode(55296+(n>>10),56320+(1023&n)))}return t}(e)}.call(this,a)},Object.defineProperty&&Object.defineProperty(j.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),j.prototype.encode=function(e,t){e=void 0===e?"":String(e),t=l(t),this._do_not_flush||(this._encoder=_[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(t.stream);for(var r,n=new f(function(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var a=t.charCodeAt(n);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319)if(n===r-1)i.push(65533);else{var o=t.charCodeAt(n+1);if(56320<=o&&o<=57343){var s=1023&a,c=1023&o;i.push(65536+(s<<10)+c),n+=1}else i.push(65533)}n+=1}return i}(e)),i=[];;){var a=n.read();if(-1===a)break;if(-1===(r=this._encoder.handler(n,a)))break;Array.isArray(r)?i.push.apply(i,r):i.push(r)}if(!this._do_not_flush){for(;-1!==(r=this._encoder.handler(n,n.read()));)Array.isArray(r)?i.push.apply(i,r):i.push(r);this._encoder=null}return new Uint8Array(i)},_["UTF-8"]=function(e){return new C(e)},k["UTF-8"]=function(e){return new T(e)},"encoding-indexes"in global&&b.forEach((function(e){"Legacy single-byte encodings"===e.heading&&e.encodings.forEach((function(e){var t=e.name,r=A(t.toLowerCase());k[t]=function(e){return new B(r,e)},_[t]=function(e){return new O(r,e)}}))})),k.GBK=function(e){return new R(e)},_.GBK=function(e){return new I(e,!0)},_.gb18030=function(e){return new I(e)},k.gb18030=function(e){return new R(e)},_.Big5=function(e){return new D(e)},k.Big5=function(e){return new P(e)},_["EUC-JP"]=function(e){return new F(e)},k["EUC-JP"]=function(e){return new M(e)},_["ISO-2022-JP"]=function(e){return new N(e)},k["ISO-2022-JP"]=function(e){return new L(e)},_.Shift_JIS=function(e){return new U(e)},k.Shift_JIS=function(e){return new z(e)},_["EUC-KR"]=function(e){return new H(e)},k["EUC-KR"]=function(e){return new q(e)},_["UTF-16BE"]=function(e){return new W(!0,e)},k["UTF-16BE"]=function(e){return new V(!0,e)},_["UTF-16LE"]=function(e){return new W(!1,e)},k["UTF-16LE"]=function(e){return new V(!1,e)},_["x-user-defined"]=function(e){return new J(e)},k["x-user-defined"]=function(e){return new K(e)};function Q(e){return Buffer.from(e).toString("base64")}function Y(e){return Buffer.from(e,"base64").toString("ascii")}var X=r(0);let Z;Z=Symbol.iterator;class ${constructor(e){Object(X.a)(this,"map",void 0),this.map={},e instanceof $?e.forEach((e,t)=>this.append(t,e)):Array.isArray(e)?e.forEach(e=>this.append(e[0],e[1])):e&&Object.getOwnPropertyNames(e).forEach(t=>this.append(t,e[t]))}append(e,t){e=ee(e),t=te(t);const r=this.map[e];this.map[e]=r?"".concat(r,", ").concat(t):t}delete(e){delete this.map[ee(e)]}get(e){return e=ee(e),this.has(e)?this.map[e]:null}has(e){return this.map.hasOwnProperty(ee(e))}set(e,t){this.map[ee(e)]=te(t)}forEach(e,t=null){for(const r in this.map)this.map.hasOwnProperty(r)&&(t?e.call(t,this.map[r],r,this):e(this.map[r],r,this))}keys(){const e=[];return this.forEach((function(t,r){e.push(r)})),re(e)}values(){const e=[];return this.forEach((function(t){e.push(t)})),re(e)}entries(){const e=[];return this.forEach((function(t,r){e.push([r,t])})),re(e)}*[Z](){yield*this.entries()}}function ee(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function te(e){return"string"!=typeof e&&(e=String(e)),e}function re(e){const t={next(){const t=e.shift();return{done:void 0===t,value:t}}};return t[Symbol.iterator]=function(){return t},t}function ne(e,t){if(!e)throw new Error("@loaders.gl/polyfills assertion ".concat(t))}var ie=r(3),ae=r.n(ie),oe=r(39),se=r.n(oe),ce=r(50),ue=r.n(ce),le=r(15),he=r.n(le);function pe(e){if((t=e)&&t instanceof ArrayBuffer)return e;var t;if((e=>e&&e instanceof Buffer)(e)){return new Uint8Array(e).buffer}if(ArrayBuffer.isView(e))return e.buffer;if("string"==typeof e){const t=e;return(new TextEncoder).encode(t).buffer}if(e&&"object"==typeof e&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer(".concat(JSON.stringify(e,null,2).slice(10),")"))}async function fe(e,t){if(!function(e){return e.startsWith("http:")||e.startsWith("https:")}(e)){const t=e.split("?")[0];return await new Promise((e,r)=>{const n=ae.a.createReadStream(t,{encoding:null});n.once("readable",()=>e(n)),n.on("error",e=>r(e))})}return await new Promise((r,n)=>{const i=(e.startsWith("https:")?ue.a.request:se.a.request)(function(e,t){const r=(null==t?void 0:t.headers)||{},n={};for(const e of Object.keys(r))n[e.toLowerCase()]=r[e];n["accept-encoding"]=n["accept-encoding"]||"gzip,br,deflate";const i=new URL(e);return{hostname:i.hostname,path:i.pathname,method:"GET",...t,...null==t?void 0:t.fetch,headers:n}}(e,t),e=>r(e));i.on("error",e=>n(e)),i.end()})}async function de(e){const t=[];return await new Promise((r,n)=>{e.on("error",e=>n(e)),e.on("readable",()=>e.read()),e.on("data",e=>{"string"==typeof e&&n(new Error("Read stream not binary")),t.push(pe(e))}),e.on("end",()=>{const e=function(e){const t=e.map(e=>e instanceof ArrayBuffer?new Uint8Array(e):e),r=t.reduce((e,t)=>e+t.byteLength,0),n=new Uint8Array(r);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n.buffer}(t);r(e)})})}var me=r(5);const ge=e=>"function"==typeof e,be=e=>(e=>null!==e&&"object"==typeof e)(e)&&ge(e.read)&&ge(e.pipe)&&(e=>"boolean"==typeof e)(e.readable);class ye{constructor(e,t){Object(X.a)(this,"ok",void 0),Object(X.a)(this,"status",void 0),Object(X.a)(this,"statusText",void 0),Object(X.a)(this,"headers",void 0),Object(X.a)(this,"url",void 0),Object(X.a)(this,"bodyUsed",!1),Object(X.a)(this,"_body",void 0);const{headers:r,status:n=200,statusText:i="OK",url:a}=t||{};this.url=a,this.ok=200===n,this.status=n,this.statusText=i,this.headers=new $((null==t?void 0:t.headers)||{}),be(e)?this._body=function(e,t){switch(t.get("content-encoding")){case"br":return e.pipe(he.a.createBrotliDecompress());case"gzip":return e.pipe(he.a.createGunzip());case"deflate":return e.pipe(he.a.createDeflate());default:return e}}(e,r):this._body="string"==typeof e?me.Readable.from([(new TextEncoder).encode(e)]):me.Readable.from([e||new ArrayBuffer(0)])}get body(){return ne(!this.bodyUsed),ne(be(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){if(!be(this._body))return this._body||new ArrayBuffer(0);return await de(this._body)}async text(){const e=await this.arrayBuffer();return(new TextDecoder).decode(e)}async json(){const e=await this.text();return JSON.parse(e)}async blob(){if("undefined"==typeof Blob)throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}}const ve=e=>e.startsWith("data:");async function we(e,t){try{if(ve(e)){const{arrayBuffer:t,mimeType:r}=function(e){const t=e.indexOf(",");let r,n;return";base64"===e.slice(t-7,t)?(r=Buffer.from(e.slice(t+1),"base64"),n=e.slice(5,t-7).trim()):(r=Buffer.from(decodeURIComponent(e.slice(t+1))),n=e.slice(5,t).trim()),n?n.startsWith(";")&&(n="text/plain".concat(n)):n="text/plain;charset=US-ASCII",{arrayBuffer:pe(r),mimeType:n}}(e);return new ye(t,{headers:{"content-type":r},url:e})}const r={},n=e;e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip");const i=await fe(n,t),a=function(e,t,r={}){const n={};if(t&&t.headers){const e=t.headers;for(const t in e){const r=e[t];n[t.toLowerCase()]=String(r)}}if(!n["content-length"]){const t=function(e){if((e=>e.startsWith("http:")||e.startsWith("https:"))(e))return null;if(ve(e))return e.length-"data:".length;try{const t=e.split("?")[0];return ae.a.statSync(t).size}catch(e){}return null}(e);Number.isFinite(t)&&(n["content-length"]=t)}return Object.assign(n,r),new $(n)}(e,i,r),{status:o,statusText:s}=function(e){if(e.statusCode)return{status:e.statusCode,statusText:e.statusMessage||"NA"};return{status:200,statusText:"OK"}}(i),c=!t||t.followRedirect||void 0===t.followRedirect;if(o>=300&&o<400&&a.has("location")&&c){const r=function(e,t){if(t.startsWith("http"))return t;const r=new URL(e);return r.pathname=t,r.href}(e,a.get("location"));return await we(r,t)}return new ye(i,{headers:a,status:o,statusText:s,url:e})}catch(t){return new ye(null,{status:400,statusText:String(t),url:e})}}var _e=r(258),ke=r.n(_e),xe=r(64),Ee=r.n(xe);function Ae(e,t){const r=function(e,t){const r=t.type?t.type.replace("image/",""):"jpeg",n=Ee()(e.data,[e.width,e.height,4],[4,4*e.width,1],0);return ke()(n,r,t)}(e,t);return new Promise(e=>{const t=[];r.on("data",e=>t.push(e)),r.on("end",()=>{const r=Buffer.concat(t);e(function(e){if(Buffer.isBuffer(e)){return new Uint8Array(e).buffer}return e}(r))})})}var Se=r(259),je=r.n(Se),Te=r(1),Ce=r.n(Te);async function Be(e,t){ne(t,"MIMEType is required to parse image under Node.js");const r=Ce.a.promisify(je.a),n=e instanceof Buffer?e:Buffer.from(e),i=await r(n,t),a=[...i.shape],o=4===i.shape.length?i.shape.shift():1;return{shape:a,data:i.data,width:i.shape[0],height:i.shape[1],components:i.shape[2],layers:o}}var Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(e){return"Symbol("+e+")"};function Re(){}var Ie="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;function Pe(e){return"object"==typeof e&&null!==e||"function"==typeof e}var De=Re,Me=Promise,Fe=Promise.prototype.then,Le=Promise.resolve.bind(Me),Ne=Promise.reject.bind(Me);function ze(e){return new Me(e)}function Ue(e){return Le(e)}function qe(e){return Ne(e)}function He(e,t,r){return Fe.call(e,t,r)}function Ge(e,t,r){He(He(e,t,r),void 0,De)}function Ve(e,t){Ge(e,t)}function We(e,t){Ge(e,void 0,t)}function Ke(e,t,r){return He(e,t,r)}function Je(e){He(e,void 0,De)}var Qe=function(){var e=Ie&&Ie.queueMicrotask;if("function"==typeof e)return e;var t=Ue(void 0);return function(e){return He(t,e)}}();function Ye(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function Xe(e,t,r){try{return Ue(Ye(e,t,r))}catch(e){return qe(e)}}var Ze=function(){function e(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.push=function(e){var t=this._back,r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size},e.prototype.shift=function(){var e=this._front,t=e,r=this._cursor,n=r+1,i=e._elements,a=i[r];return 16384===n&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),i[r]=void 0,a},e.prototype.forEach=function(e){for(var t=this._cursor,r=this._front,n=r._elements;!(t===n.length&&void 0===r._next||t===n.length&&(t=0,0===(n=(r=r._next)._elements).length));)e(n[t]),++t},e.prototype.peek=function(){var e=this._front,t=this._cursor;return e._elements[t]},e}();function $e(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?nt(e):"closed"===t._state?function(e){nt(e),ot(e)}(e):it(e,t._storedError)}function et(e,t){return zn(e._ownerReadableStream,t)}function tt(e){"readable"===e._ownerReadableStream._state?at(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,t){it(e,t)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function rt(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function nt(e){e._closedPromise=ze((function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function it(e,t){nt(e),at(e,t)}function at(e,t){void 0!==e._closedPromise_reject&&(Je(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function ot(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var st=Oe("[[AbortSteps]]"),ct=Oe("[[ErrorSteps]]"),ut=Oe("[[CancelSteps]]"),lt=Oe("[[PullSteps]]"),ht=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},pt=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function ft(e,t){if(void 0!==e&&("object"!=typeof(r=e)&&"function"!=typeof r))throw new TypeError(t+" is not an object.");var r}function dt(e,t){if("function"!=typeof e)throw new TypeError(t+" is not a function.")}function mt(e,t){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError(t+" is not an object.")}function gt(e,t,r){if(void 0===e)throw new TypeError("Parameter "+t+" is required in '"+r+"'.")}function bt(e,t,r){if(void 0===e)throw new TypeError(t+" is required in '"+r+"'.")}function yt(e){return Number(e)}function vt(e){return 0===e?0:e}function wt(e,t){var r=Number.MAX_SAFE_INTEGER,n=Number(e);if(n=vt(n),!ht(n))throw new TypeError(t+" is not a finite number");if((n=function(e){return vt(pt(e))}(n))<0||n>r)throw new TypeError(t+" is outside the accepted range of 0 to "+r+", inclusive");return ht(n)&&0!==n?n:0}function _t(e,t){if(!Ln(e))throw new TypeError(t+" is not a ReadableStream.")}function kt(e){return new Ct(e)}function xt(e,t){e._reader._readRequests.push(t)}function Et(e,t,r){var n=e._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(t)}function At(e){return e._reader._readRequests.length}function St(e){var t=e._reader;return void 0!==t&&!!Bt(t)}var jt,Tt,Ct=function(){function e(e){if(gt(e,1,"ReadableStreamDefaultReader"),_t(e,"First parameter"),Nn(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");$e(this,e),this._readRequests=new Ze}return Object.defineProperty(e.prototype,"closed",{get:function(){return Bt(this)?this._closedPromise:qe(Rt("closed"))},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return void 0===e&&(e=void 0),Bt(this)?void 0===this._ownerReadableStream?qe(rt("cancel")):et(this,e):qe(Rt("cancel"))},e.prototype.read=function(){if(!Bt(this))return qe(Rt("read"));if(void 0===this._ownerReadableStream)return qe(rt("read from"));var e,t,r=ze((function(r,n){e=r,t=n}));return Ot(this,{_chunkSteps:function(t){return e({value:t,done:!1})},_closeSteps:function(){return e({value:void 0,done:!0})},_errorSteps:function(e){return t(e)}}),r},e.prototype.releaseLock=function(){if(!Bt(this))throw Rt("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");tt(this)}},e}();function Bt(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function Ot(e,t){var r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[lt](t)}function Rt(e){return new TypeError("ReadableStreamDefaultReader.prototype."+e+" can only be used on a ReadableStreamDefaultReader")}Object.defineProperties(Ct.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Ct.prototype,Oe.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof Oe.asyncIterator&&((jt={})[Oe.asyncIterator]=function(){return this},Tt=jt,Object.defineProperty(Tt,Oe.asyncIterator,{enumerable:!1}));var It=function(){function e(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}return e.prototype.next=function(){var e=this,t=function(){return e._nextSteps()};return this._ongoingPromise=this._ongoingPromise?Ke(this._ongoingPromise,t,t):t(),this._ongoingPromise},e.prototype.return=function(e){var t=this,r=function(){return t._returnSteps(e)};return this._ongoingPromise?Ke(this._ongoingPromise,r,r):r()},e.prototype._nextSteps=function(){var e=this;if(this._isFinished)return Promise.resolve({value:void 0,done:!0});var t,r,n=this._reader;if(void 0===n._ownerReadableStream)return qe(rt("iterate"));var i=ze((function(e,n){t=e,r=n}));return Ot(n,{_chunkSteps:function(r){e._ongoingPromise=void 0,Qe((function(){return t({value:r,done:!1})}))},_closeSteps:function(){e._ongoingPromise=void 0,e._isFinished=!0,tt(n),t({value:void 0,done:!0})},_errorSteps:function(t){e._ongoingPromise=void 0,e._isFinished=!0,tt(n),r(t)}}),i},e.prototype._returnSteps=function(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;var t=this._reader;if(void 0===t._ownerReadableStream)return qe(rt("finish iterating"));if(!this._preventCancel){var r=et(t,e);return tt(t),Ke(r,(function(){return{value:e,done:!0}}))}return tt(t),Ue({value:e,done:!0})},e}(),Pt={next:function(){return Dt(this)?this._asyncIteratorImpl.next():qe(Mt("next"))},return:function(e){return Dt(this)?this._asyncIteratorImpl.return(e):qe(Mt("return"))}};function Dt(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl")}function Mt(e){return new TypeError("ReadableStreamAsyncIterator."+e+" can only be used on a ReadableSteamAsyncIterator")}void 0!==Tt&&Object.setPrototypeOf(Pt,Tt);var Ft=Number.isNaN||function(e){return e!=e};function Lt(e){return!!function(e){if("number"!=typeof e)return!1;if(Ft(e))return!1;if(e<0)return!1;return!0}(e)&&e!==1/0}function Nt(e){var t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function zt(e,t,r){if(!Lt(r=Number(r)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function Ut(e){e._queue=new Ze,e._queueTotalSize=0}function qt(e){return e.slice()}var Ht=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"view",{get:function(){if(!Wt(this))throw cr("view");return this._view},enumerable:!1,configurable:!0}),e.prototype.respond=function(e){if(!Wt(this))throw cr("respond");if(gt(e,1,"respond"),e=wt(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(e,t){if(!Lt(t=Number(t)))throw new RangeError("bytesWritten must be a finite");rr(e,t)}(this._associatedReadableByteStreamController,e)},e.prototype.respondWithNewView=function(e){if(!Wt(this))throw cr("respondWithNewView");if(gt(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");!function(e,t){var r=e._pendingPullIntos.peek();if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==t.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=t.buffer,rr(e,t.byteLength)}(this._associatedReadableByteStreamController,e)},e}();Object.defineProperties(Ht.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Ht.prototype,Oe.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var Gt=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"byobRequest",{get:function(){if(!Vt(this))throw ur("byobRequest");if(null===this._byobRequest&&this._pendingPullIntos.length>0){var e=this._pendingPullIntos.peek(),t=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),r=Object.create(Ht.prototype);!function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}(r,this,t),this._byobRequest=r}return this._byobRequest},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!Vt(this))throw ur("desiredSize");return or(this)},enumerable:!1,configurable:!0}),e.prototype.close=function(){if(!Vt(this))throw ur("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError("The stream (in "+e+" state) is not in the readable state and cannot be closed");!function(e){var t=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==t._state)return;if(e._queueTotalSize>0)return void(e._closeRequested=!0);if(e._pendingPullIntos.length>0){if(e._pendingPullIntos.peek().bytesFilled>0){var r=new TypeError("Insufficient bytes to fill elements in the given buffer");throw ar(e,r),r}}ir(e),Un(t)}(this)},e.prototype.enqueue=function(e){if(!Vt(this))throw ur("enqueue");if(gt(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");var t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError("The stream (in "+t+" state) is not in the readable state and cannot be enqueued to");!function(e,t){var r=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==r._state)return;var n=t.buffer,i=t.byteOffset,a=t.byteLength,o=n;if(St(r))if(0===At(r))Yt(e,o,i,a);else{var s=new Uint8Array(o,i,a);Et(r,s,!1)}else pr(r)?(Yt(e,o,i,a),tr(e)):Yt(e,o,i,a);Kt(e)}(this,e)},e.prototype.error=function(e){if(void 0===e&&(e=void 0),!Vt(this))throw ur("error");ar(this,e)},e.prototype[ut]=function(e){this._pendingPullIntos.length>0&&(this._pendingPullIntos.peek().bytesFilled=0);Ut(this);var t=this._cancelAlgorithm(e);return ir(this),t},e.prototype[lt]=function(e){var t=this._controlledReadableByteStream;if(this._queueTotalSize>0){var r=this._queue.shift();this._queueTotalSize-=r.byteLength,$t(this);var n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);e._chunkSteps(n)}else{var i=this._autoAllocateChunkSize;if(void 0!==i){var a=void 0;try{a=new ArrayBuffer(i)}catch(t){return void e._errorSteps(t)}var o={buffer:a,byteOffset:0,byteLength:i,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(o)}xt(t,e),Kt(this)}},e}();function Vt(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function Wt(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function Kt(e){(function(e){var t=e._controlledReadableByteStream;if("readable"!==t._state)return!1;if(e._closeRequested)return!1;if(!e._started)return!1;if(St(t)&&At(t)>0)return!0;if(pr(t)&&hr(t)>0)return!0;if(or(e)>0)return!0;return!1})(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Ge(e._pullAlgorithm(),(function(){e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Kt(e))}),(function(t){ar(e,t)}))))}function Jt(e,t){var r=!1;"closed"===e._state&&(r=!0);var n=Qt(t);"default"===t.readerType?Et(e,n,r):function(e,t,r){var n=e._reader._readIntoRequests.shift();r?n._closeSteps(t):n._chunkSteps(t)}(e,n,r)}function Qt(e){var t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function Yt(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function Xt(e,t){var r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,i=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),a=t.bytesFilled+i,o=a-a%r,s=i,c=!1;o>n&&(s=o-t.bytesFilled,c=!0);for(var u,l,h,p,f,d=e._queue;s>0;){var m=d.peek(),g=Math.min(s,m.byteLength),b=t.byteOffset+t.bytesFilled;u=t.buffer,l=b,h=m.buffer,p=m.byteOffset,f=g,new Uint8Array(u).set(new Uint8Array(h,p,f),l),m.byteLength===g?d.shift():(m.byteOffset+=g,m.byteLength-=g),e._queueTotalSize-=g,Zt(e,g,t),s-=g}return c}function Zt(e,t,r){er(e),r.bytesFilled+=t}function $t(e){0===e._queueTotalSize&&e._closeRequested?(ir(e),Un(e._controlledReadableByteStream)):Kt(e)}function er(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function tr(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;var t=e._pendingPullIntos.peek();Xt(e,t)&&(nr(e),Jt(e._controlledReadableByteStream,t))}}function rr(e,t){var r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(e,t){t.buffer=t.buffer;var r=e._controlledReadableByteStream;if(pr(r))for(;hr(r)>0;){Jt(r,nr(e))}}(e,r)}else!function(e,t,r){if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range");if(Zt(e,t,r),!(r.bytesFilled<r.elementSize)){nr(e);var n=r.bytesFilled%r.elementSize;if(n>0){var i=r.byteOffset+r.bytesFilled,a=r.buffer.slice(i-n,i);Yt(e,a,0,a.byteLength)}r.buffer=r.buffer,r.bytesFilled-=n,Jt(e._controlledReadableByteStream,r),tr(e)}}(e,t,r);Kt(e)}function nr(e){var t=e._pendingPullIntos.shift();return er(e),t}function ir(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function ar(e,t){var r=e._controlledReadableByteStream;"readable"===r._state&&(!function(e){er(e),e._pendingPullIntos=new Ze}(e),Ut(e),ir(e),qn(r,t))}function or(e){var t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function sr(e,t,r){var n=Object.create(Gt.prototype),i=function(){},a=function(){return Ue(void 0)},o=function(){return Ue(void 0)};void 0!==t.start&&(i=function(){return t.start(n)}),void 0!==t.pull&&(a=function(){return t.pull(n)}),void 0!==t.cancel&&(o=function(e){return t.cancel(e)});var s=t.autoAllocateChunkSize;if(0===s)throw new TypeError("autoAllocateChunkSize must be greater than 0");!function(e,t,r,n,i,a,o){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,Ut(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=i,t._autoAllocateChunkSize=o,t._pendingPullIntos=new Ze,e._readableStreamController=t,Ge(Ue(r()),(function(){t._started=!0,Kt(t)}),(function(e){ar(t,e)}))}(e,n,i,a,o,r,s)}function cr(e){return new TypeError("ReadableStreamBYOBRequest.prototype."+e+" can only be used on a ReadableStreamBYOBRequest")}function ur(e){return new TypeError("ReadableByteStreamController.prototype."+e+" can only be used on a ReadableByteStreamController")}function lr(e,t){e._reader._readIntoRequests.push(t)}function hr(e){return e._reader._readIntoRequests.length}function pr(e){var t=e._reader;return void 0!==t&&!!dr(t)}Object.defineProperties(Gt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Gt.prototype,Oe.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var fr=function(){function e(e){if(gt(e,1,"ReadableStreamBYOBReader"),_t(e,"First parameter"),Nn(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Vt(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");$e(this,e),this._readIntoRequests=new Ze}return Object.defineProperty(e.prototype,"closed",{get:function(){return dr(this)?this._closedPromise:qe(mr("closed"))},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return void 0===e&&(e=void 0),dr(this)?void 0===this._ownerReadableStream?qe(rt("cancel")):et(this,e):qe(mr("cancel"))},e.prototype.read=function(e){if(!dr(this))return qe(mr("read"));if(!ArrayBuffer.isView(e))return qe(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return qe(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return qe(new TypeError("view's buffer must have non-zero byteLength"));if(void 0===this._ownerReadableStream)return qe(rt("read from"));var t,r,n=ze((function(e,n){t=e,r=n}));return function(e,t,r){var n=e._ownerReadableStream;n._disturbed=!0,"errored"===n._state?r._errorSteps(n._storedError):function(e,t,r){var n=e._controlledReadableByteStream,i=1;t.constructor!==DataView&&(i=t.constructor.BYTES_PER_ELEMENT);var a=t.constructor,o={buffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:i,viewConstructor:a,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(o),void lr(n,r);if("closed"!==n._state){if(e._queueTotalSize>0){if(Xt(e,o)){var s=Qt(o);return $t(e),void r._chunkSteps(s)}if(e._closeRequested){var c=new TypeError("Insufficient bytes to fill elements in the given buffer");return ar(e,c),void r._errorSteps(c)}}e._pendingPullIntos.push(o),lr(n,r),Kt(e)}else{var u=new a(o.buffer,o.byteOffset,0);r._closeSteps(u)}}(n._readableStreamController,t,r)}(this,e,{_chunkSteps:function(e){return t({value:e,done:!1})},_closeSteps:function(e){return t({value:e,done:!0})},_errorSteps:function(e){return r(e)}}),n},e.prototype.releaseLock=function(){if(!dr(this))throw mr("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");tt(this)}},e}();function dr(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function mr(e){return new TypeError("ReadableStreamBYOBReader.prototype."+e+" can only be used on a ReadableStreamBYOBReader")}function gr(e,t){var r=e.highWaterMark;if(void 0===r)return t;if(Ft(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function br(e){var t=e.size;return t||function(){return 1}}function yr(e,t){ft(e,t);var r=null==e?void 0:e.highWaterMark,n=null==e?void 0:e.size;return{highWaterMark:void 0===r?void 0:yt(r),size:void 0===n?void 0:vr(n,t+" has member 'size' that")}}function vr(e,t){return dt(e,t),function(t){return yt(e(t))}}function wr(e,t,r){return dt(e,r),function(r){return Xe(e,t,[r])}}function _r(e,t,r){return dt(e,r),function(){return Xe(e,t,[])}}function kr(e,t,r){return dt(e,r),function(r){return Ye(e,t,[r])}}function xr(e,t,r){return dt(e,r),function(r,n){return Xe(e,t,[r,n])}}function Er(e,t){if(!Tr(e))throw new TypeError(t+" is not a WritableStream.")}Object.defineProperties(fr.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(fr.prototype,Oe.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var Ar=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),void 0===e?e=null:mt(e,"First parameter");var r=yr(t,"Second parameter"),n=function(e,t){ft(e,t);var r=null==e?void 0:e.abort,n=null==e?void 0:e.close,i=null==e?void 0:e.start,a=null==e?void 0:e.type,o=null==e?void 0:e.write;return{abort:void 0===r?void 0:wr(r,e,t+" has member 'abort' that"),close:void 0===n?void 0:_r(n,e,t+" has member 'close' that"),start:void 0===i?void 0:kr(i,e,t+" has member 'start' that"),write:void 0===o?void 0:xr(o,e,t+" has member 'write' that"),type:a}}(e,"First parameter");if(jr(this),void 0!==n.type)throw new RangeError("Invalid type is specified");var i=br(r);!function(e,t,r,n){var i=Object.create(Wr.prototype),a=function(){},o=function(){return Ue(void 0)},s=function(){return Ue(void 0)},c=function(){return Ue(void 0)};void 0!==t.start&&(a=function(){return t.start(i)});void 0!==t.write&&(o=function(e){return t.write(e,i)});void 0!==t.close&&(s=function(){return t.close()});void 0!==t.abort&&(c=function(e){return t.abort(e)});Kr(e,i,a,o,s,c,r,n)}(this,n,gr(r,1),i)}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!Tr(this))throw en("locked");return Cr(this)},enumerable:!1,configurable:!0}),e.prototype.abort=function(e){return void 0===e&&(e=void 0),Tr(this)?Cr(this)?qe(new TypeError("Cannot abort a stream that already has a writer")):Br(this,e):qe(en("abort"))},e.prototype.close=function(){return Tr(this)?Cr(this)?qe(new TypeError("Cannot close a stream that already has a writer")):Dr(this)?qe(new TypeError("Cannot close an already-closing stream")):Or(this):qe(en("close"))},e.prototype.getWriter=function(){if(!Tr(this))throw en("getWriter");return Sr(this)},e}();function Sr(e){return new Lr(e)}function jr(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new Ze,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function Tr(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function Cr(e){return void 0!==e._writer}function Br(e,t){var r=e._state;if("closed"===r||"errored"===r)return Ue(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;var n=!1;"erroring"===r&&(n=!0,t=void 0);var i=ze((function(r,i){e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:i,_reason:t,_wasAlreadyErroring:n}}));return e._pendingAbortRequest._promise=i,n||Ir(e,t),i}function Or(e){var t=e._state;if("closed"===t||"errored"===t)return qe(new TypeError("The stream (in "+t+" state) is not in the writable state and cannot be closed"));var r,n=ze((function(t,r){var n={_resolve:t,_reject:r};e._closeRequest=n})),i=e._writer;return void 0!==i&&e._backpressure&&"writable"===t&&pn(i),zt(r=e._writableStreamController,Vr,0),Yr(r),n}function Rr(e,t){"writable"!==e._state?Pr(e):Ir(e,t)}function Ir(e,t){var r=e._writableStreamController;e._state="erroring",e._storedError=t;var n=e._writer;void 0!==n&&qr(n,t),!function(e){if(void 0===e._inFlightWriteRequest&&void 0===e._inFlightCloseRequest)return!1;return!0}(e)&&r._started&&Pr(e)}function Pr(e){e._state="errored",e._writableStreamController[ct]();var t=e._storedError;if(e._writeRequests.forEach((function(e){e._reject(t)})),e._writeRequests=new Ze,void 0!==e._pendingAbortRequest){var r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void Mr(e);Ge(e._writableStreamController[st](r._reason),(function(){r._resolve(),Mr(e)}),(function(t){r._reject(t),Mr(e)}))}else Mr(e)}function Dr(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function Mr(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var t=e._writer;void 0!==t&&on(t,e._storedError)}function Fr(e,t){var r=e._writer;void 0!==r&&t!==e._backpressure&&(t?function(e){cn(e)}(r):pn(r)),e._backpressure=t}Object.defineProperties(Ar.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Ar.prototype,Oe.toStringTag,{value:"WritableStream",configurable:!0});var Lr=function(){function e(e){if(gt(e,1,"WritableStreamDefaultWriter"),Er(e,"First parameter"),Cr(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;var t,r=e._state;if("writable"===r)!Dr(e)&&e._backpressure?cn(this):ln(this),nn(this);else if("erroring"===r)un(this,e._storedError),nn(this);else if("closed"===r)ln(this),nn(t=this),sn(t);else{var n=e._storedError;un(this,n),an(this,n)}}return Object.defineProperty(e.prototype,"closed",{get:function(){return Nr(this)?this._closedPromise:qe(tn("closed"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!Nr(this))throw tn("desiredSize");if(void 0===this._ownerWritableStream)throw rn("desiredSize");return function(e){var t=e._ownerWritableStream,r=t._state;if("errored"===r||"erroring"===r)return null;if("closed"===r)return 0;return Qr(t._writableStreamController)}(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return Nr(this)?this._readyPromise:qe(tn("ready"))},enumerable:!1,configurable:!0}),e.prototype.abort=function(e){return void 0===e&&(e=void 0),Nr(this)?void 0===this._ownerWritableStream?qe(rn("abort")):function(e,t){return Br(e._ownerWritableStream,t)}(this,e):qe(tn("abort"))},e.prototype.close=function(){if(!Nr(this))return qe(tn("close"));var e=this._ownerWritableStream;return void 0===e?qe(rn("close")):Dr(e)?qe(new TypeError("Cannot close an already-closing stream")):zr(this)},e.prototype.releaseLock=function(){if(!Nr(this))throw tn("releaseLock");void 0!==this._ownerWritableStream&&Hr(this)},e.prototype.write=function(e){return void 0===e&&(e=void 0),Nr(this)?void 0===this._ownerWritableStream?qe(rn("write to")):Gr(this,e):qe(tn("write"))},e}();function Nr(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function zr(e){return Or(e._ownerWritableStream)}function Ur(e,t){"pending"===e._closedPromiseState?on(e,t):function(e,t){an(e,t)}(e,t)}function qr(e,t){"pending"===e._readyPromiseState?hn(e,t):function(e,t){un(e,t)}(e,t)}function Hr(e){var t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");qr(e,r),Ur(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function Gr(e,t){var r=e._ownerWritableStream,n=r._writableStreamController,i=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return Xr(e,t),1}}(n,t);if(r!==e._ownerWritableStream)return qe(rn("write to"));var a=r._state;if("errored"===a)return qe(r._storedError);if(Dr(r)||"closed"===a)return qe(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===a)return qe(r._storedError);var o=function(e){return ze((function(t,r){var n={_resolve:t,_reject:r};e._writeRequests.push(n)}))}(r);return function(e,t,r){try{zt(e,t,r)}catch(t){return void Xr(e,t)}var n=e._controlledWritableStream;if(!Dr(n)&&"writable"===n._state){var i=Zr(e);Fr(n,i)}Yr(e)}(n,t,i),o}Object.defineProperties(Lr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Lr.prototype,Oe.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var Vr={},Wr=function(){function e(){throw new TypeError("Illegal constructor")}return e.prototype.error=function(e){if(void 0===e&&(e=void 0),!function(e){if(!Pe(e))return!1;if(!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream"))return!1;return!0}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&$r(this,e)},e.prototype[st]=function(e){var t=this._abortAlgorithm(e);return Jr(this),t},e.prototype[ct]=function(){Ut(this)},e}();function Kr(e,t,r,n,i,a,o,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,Ut(t),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=o,t._writeAlgorithm=n,t._closeAlgorithm=i,t._abortAlgorithm=a;var c=Zr(t);Fr(e,c),Ge(Ue(r()),(function(){t._started=!0,Yr(t)}),(function(r){t._started=!0,Rr(e,r)}))}function Jr(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Qr(e){return e._strategyHWM-e._queueTotalSize}function Yr(e){var t=e._controlledWritableStream;if(e._started&&void 0===t._inFlightWriteRequest)if("erroring"!==t._state){if(0!==e._queue.length){var r=e._queue.peek().value;r===Vr?function(e){var t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),Nt(e);var r=e._closeAlgorithm();Jr(e),Ge(r,(function(){!function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";var t=e._writer;void 0!==t&&sn(t)}(t)}),(function(e){!function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),Rr(e,t)}(t,e)}))}(e):function(e,t){var r=e._controlledWritableStream;(function(e){e._inFlightWriteRequest=e._writeRequests.shift()})(r),Ge(e._writeAlgorithm(t),(function(){!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);var t=r._state;if(Nt(e),!Dr(r)&&"writable"===t){var n=Zr(e);Fr(r,n)}Yr(e)}),(function(t){"writable"===r._state&&Jr(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,Rr(e,t)}(r,t)}))}(e,r)}}else Pr(t)}function Xr(e,t){"writable"===e._controlledWritableStream._state&&$r(e,t)}function Zr(e){return Qr(e)<=0}function $r(e,t){var r=e._controlledWritableStream;Jr(e),Ir(r,t)}function en(e){return new TypeError("WritableStream.prototype."+e+" can only be used on a WritableStream")}function tn(e){return new TypeError("WritableStreamDefaultWriter.prototype."+e+" can only be used on a WritableStreamDefaultWriter")}function rn(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function nn(e){e._closedPromise=ze((function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function an(e,t){nn(e),on(e,t)}function on(e,t){void 0!==e._closedPromise_reject&&(Je(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function sn(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function cn(e){e._readyPromise=ze((function(t,r){e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function un(e,t){cn(e),hn(e,t)}function ln(e){cn(e),pn(e)}function hn(e,t){void 0!==e._readyPromise_reject&&(Je(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function pn(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(Wr.prototype,{error:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Wr.prototype,Oe.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var fn="undefined"!=typeof DOMException?DOMException:void 0;var dn,mn=function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}(fn)?fn:((dn=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}).prototype=Object.create(Error.prototype),Object.defineProperty(dn.prototype,"constructor",{value:dn,writable:!0,configurable:!0}),dn);function gn(e,t,r,n,i,a){var o=kt(e),s=Sr(t);e._disturbed=!0;var c=!1,u=Ue(void 0);return ze((function(l,h){var p,f,d,m;if(void 0!==a){if(p=function(){var r=new mn("Aborted","AbortError"),a=[];n||a.push((function(){return"writable"===t._state?Br(t,r):Ue(void 0)})),i||a.push((function(){return"readable"===e._state?zn(e,r):Ue(void 0)})),v((function(){return Promise.all(a.map((function(e){return e()})))}),!0,r)},a.aborted)return void p();a.addEventListener("abort",p)}if(y(e,o._closedPromise,(function(e){n?w(!0,e):v((function(){return Br(t,e)}),!0,e)})),y(t,s._closedPromise,(function(t){i?w(!0,t):v((function(){return zn(e,t)}),!0,t)})),f=e,d=o._closedPromise,m=function(){r?w():v((function(){return function(e){var t=e._ownerWritableStream,r=t._state;return Dr(t)||"closed"===r?Ue(void 0):"errored"===r?qe(t._storedError):zr(e)}(s)}))},"closed"===f._state?m():Ve(d,m),Dr(t)||"closed"===t._state){var g=new TypeError("the destination writable stream closed before all data could be piped to it");i?w(!0,g):v((function(){return zn(e,g)}),!0,g)}function b(){var e=u;return He(u,(function(){return e!==u?b():void 0}))}function y(e,t,r){"errored"===e._state?r(e._storedError):We(t,r)}function v(e,r,n){function i(){Ge(e(),(function(){return _(r,n)}),(function(e){return _(!0,e)}))}c||(c=!0,"writable"!==t._state||Dr(t)?i():Ve(b(),i))}function w(e,r){c||(c=!0,"writable"!==t._state||Dr(t)?_(e,r):Ve(b(),(function(){return _(e,r)})))}function _(e,t){Hr(s),tt(o),void 0!==a&&a.removeEventListener("abort",p),e?h(t):l(void 0)}Je(ze((function(e,t){!function r(n){n?e():He(c?Ue(!0):He(s._readyPromise,(function(){return ze((function(e,t){Ot(o,{_chunkSteps:function(t){u=He(Gr(s,t),void 0,Re),e(!1)},_closeSteps:function(){return e(!0)},_errorSteps:t})}))})),r,t)}(!1)})))}))}var bn=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!yn(this))throw Tn("desiredSize");return An(this)},enumerable:!1,configurable:!0}),e.prototype.close=function(){if(!yn(this))throw Tn("close");if(!Sn(this))throw new TypeError("The stream is not in a state that permits close");kn(this)},e.prototype.enqueue=function(e){if(void 0===e&&(e=void 0),!yn(this))throw Tn("enqueue");if(!Sn(this))throw new TypeError("The stream is not in a state that permits enqueue");return xn(this,e)},e.prototype.error=function(e){if(void 0===e&&(e=void 0),!yn(this))throw Tn("error");En(this,e)},e.prototype[ut]=function(e){Ut(this);var t=this._cancelAlgorithm(e);return _n(this),t},e.prototype[lt]=function(e){var t=this._controlledReadableStream;if(this._queue.length>0){var r=Nt(this);this._closeRequested&&0===this._queue.length?(_n(this),Un(t)):vn(this),e._chunkSteps(r)}else xt(t,e),vn(this)},e}();function yn(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function vn(e){wn(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Ge(e._pullAlgorithm(),(function(){e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,vn(e))}),(function(t){En(e,t)}))))}function wn(e){var t=e._controlledReadableStream;return!!Sn(e)&&(!!e._started&&(!!(Nn(t)&&At(t)>0)||An(e)>0))}function _n(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function kn(e){if(Sn(e)){var t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(_n(e),Un(t))}}function xn(e,t){if(Sn(e)){var r=e._controlledReadableStream;if(Nn(r)&&At(r)>0)Et(r,t,!1);else{var n=void 0;try{n=e._strategySizeAlgorithm(t)}catch(t){throw En(e,t),t}try{zt(e,t,n)}catch(t){throw En(e,t),t}}vn(e)}}function En(e,t){var r=e._controlledReadableStream;"readable"===r._state&&(Ut(e),_n(e),qn(r,t))}function An(e){var t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function Sn(e){var t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function jn(e,t,r,n,i,a,o){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,Ut(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=o,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=i,e._readableStreamController=t,Ge(Ue(r()),(function(){t._started=!0,vn(t)}),(function(e){En(t,e)}))}function Tn(e){return new TypeError("ReadableStreamDefaultController.prototype."+e+" can only be used on a ReadableStreamDefaultController")}function Cn(e,t,r){return dt(e,r),function(r){return Xe(e,t,[r])}}function Bn(e,t,r){return dt(e,r),function(r){return Xe(e,t,[r])}}function On(e,t,r){return dt(e,r),function(r){return Ye(e,t,[r])}}function Rn(e,t){if("bytes"!==(e=""+e))throw new TypeError(t+" '"+e+"' is not a valid enumeration value for ReadableStreamType");return e}function In(e,t){if("byob"!==(e=""+e))throw new TypeError(t+" '"+e+"' is not a valid enumeration value for ReadableStreamReaderMode");return e}function Pn(e,t){ft(e,t);var r=null==e?void 0:e.preventAbort,n=null==e?void 0:e.preventCancel,i=null==e?void 0:e.preventClose,a=null==e?void 0:e.signal;return void 0!==a&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw new TypeError(t+" is not an AbortSignal.")}(a,t+" has member 'signal' that"),{preventAbort:Boolean(r),preventCancel:Boolean(n),preventClose:Boolean(i),signal:a}}Object.defineProperties(bn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(bn.prototype,Oe.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var Dn=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),void 0===e?e=null:mt(e,"First parameter");var r=yr(t,"Second parameter"),n=function(e,t){ft(e,t);var r=e,n=null==r?void 0:r.autoAllocateChunkSize,i=null==r?void 0:r.cancel,a=null==r?void 0:r.pull,o=null==r?void 0:r.start,s=null==r?void 0:r.type;return{autoAllocateChunkSize:void 0===n?void 0:wt(n,t+" has member 'autoAllocateChunkSize' that"),cancel:void 0===i?void 0:Cn(i,r,t+" has member 'cancel' that"),pull:void 0===a?void 0:Bn(a,r,t+" has member 'pull' that"),start:void 0===o?void 0:On(o,r,t+" has member 'start' that"),type:void 0===s?void 0:Rn(s,t+" has member 'type' that")}}(e,"First parameter");if(Fn(this),"bytes"===n.type){if(void 0!==r.size)throw new RangeError("The strategy for a byte stream cannot have a size function");sr(this,n,gr(r,0))}else{var i=br(r);!function(e,t,r,n){var i=Object.create(bn.prototype),a=function(){},o=function(){return Ue(void 0)},s=function(){return Ue(void 0)};void 0!==t.start&&(a=function(){return t.start(i)}),void 0!==t.pull&&(o=function(){return t.pull(i)}),void 0!==t.cancel&&(s=function(e){return t.cancel(e)}),jn(e,i,a,o,s,r,n)}(this,n,gr(r,1),i)}}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!Ln(this))throw Hn("locked");return Nn(this)},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return void 0===e&&(e=void 0),Ln(this)?Nn(this)?qe(new TypeError("Cannot cancel a stream that already has a reader")):zn(this,e):qe(Hn("cancel"))},e.prototype.getReader=function(e){if(void 0===e&&(e=void 0),!Ln(this))throw Hn("getReader");return void 0===function(e,t){ft(e,t);var r=null==e?void 0:e.mode;return{mode:void 0===r?void 0:In(r,t+" has member 'mode' that")}}(e,"First parameter").mode?kt(this):new fr(this)},e.prototype.pipeThrough=function(e,t){if(void 0===t&&(t={}),!Ln(this))throw Hn("pipeThrough");gt(e,1,"pipeThrough");var r=function(e,t){ft(e,t);var r=null==e?void 0:e.readable;bt(r,"readable","ReadableWritablePair"),_t(r,t+" has member 'readable' that");var n=null==e?void 0:e.writable;return bt(n,"writable","ReadableWritablePair"),Er(n,t+" has member 'writable' that"),{readable:r,writable:n}}(e,"First parameter"),n=Pn(t,"Second parameter");if(Nn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Cr(r.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Je(gn(this,r.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),r.readable},e.prototype.pipeTo=function(e,t){if(void 0===t&&(t={}),!Ln(this))return qe(Hn("pipeTo"));if(void 0===e)return qe("Parameter 1 is required in 'pipeTo'.");if(!Tr(e))return qe(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));var r;try{r=Pn(t,"Second parameter")}catch(e){return qe(e)}return Nn(this)?qe(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Cr(e)?qe(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):gn(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)},e.prototype.tee=function(){if(!Ln(this))throw Hn("tee");var e=function(e,t){var r,n,i,a,o,s=kt(e),c=!1,u=!1,l=!1,h=ze((function(e){o=e}));function p(){return c||(c=!0,Ot(s,{_chunkSteps:function(e){Qe((function(){c=!1;var t=e,r=e;u||xn(i._readableStreamController,t),l||xn(a._readableStreamController,r)}))},_closeSteps:function(){c=!1,u||kn(i._readableStreamController),l||kn(a._readableStreamController),u&&l||o(void 0)},_errorSteps:function(){c=!1}})),Ue(void 0)}function f(){}return i=Mn(f,p,(function(t){if(u=!0,r=t,l){var i=qt([r,n]),a=zn(e,i);o(a)}return h})),a=Mn(f,p,(function(t){if(l=!0,n=t,u){var i=qt([r,n]),a=zn(e,i);o(a)}return h})),We(s._closedPromise,(function(e){En(i._readableStreamController,e),En(a._readableStreamController,e),u&&l||o(void 0)})),[i,a]}(this);return qt(e)},e.prototype.values=function(e){if(void 0===e&&(e=void 0),!Ln(this))throw Hn("values");var t,r,n,i,a,o=function(e,t){ft(e,t);var r=null==e?void 0:e.preventCancel;return{preventCancel:Boolean(r)}}(e,"First parameter");return t=this,r=o.preventCancel,n=kt(t),i=new It(n,r),(a=Object.create(Pt))._asyncIteratorImpl=i,a},e}();function Mn(e,t,r,n,i){void 0===n&&(n=1),void 0===i&&(i=function(){return 1});var a=Object.create(Dn.prototype);return Fn(a),jn(a,Object.create(bn.prototype),e,t,r,n,i),a}function Fn(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function Ln(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function Nn(e){return void 0!==e._reader}function zn(e,t){return e._disturbed=!0,"closed"===e._state?Ue(void 0):"errored"===e._state?qe(e._storedError):(Un(e),Ke(e._readableStreamController[ut](t),Re))}function Un(e){e._state="closed";var t=e._reader;void 0!==t&&(ot(t),Bt(t)&&(t._readRequests.forEach((function(e){e._closeSteps()})),t._readRequests=new Ze))}function qn(e,t){e._state="errored",e._storedError=t;var r=e._reader;void 0!==r&&(at(r,t),Bt(r)?(r._readRequests.forEach((function(e){e._errorSteps(t)})),r._readRequests=new Ze):(r._readIntoRequests.forEach((function(e){e._errorSteps(t)})),r._readIntoRequests=new Ze))}function Hn(e){return new TypeError("ReadableStream.prototype."+e+" can only be used on a ReadableStream")}function Gn(e,t){ft(e,t);var r=null==e?void 0:e.highWaterMark;return bt(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:yt(r)}}Object.defineProperties(Dn.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Dn.prototype,Oe.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof Oe.asyncIterator&&Object.defineProperty(Dn.prototype,Oe.asyncIterator,{value:Dn.prototype.values,writable:!0,configurable:!0});var Vn=function(e){return e.byteLength},Wn=function(){function e(e){gt(e,1,"ByteLengthQueuingStrategy"),e=Gn(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}return Object.defineProperty(e.prototype,"highWaterMark",{get:function(){if(!Jn(this))throw Kn("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){if(!Jn(this))throw Kn("size");return Vn},enumerable:!1,configurable:!0}),e}();function Kn(e){return new TypeError("ByteLengthQueuingStrategy.prototype."+e+" can only be used on a ByteLengthQueuingStrategy")}function Jn(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")}Object.defineProperties(Wn.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Wn.prototype,Oe.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var Qn=function(){return 1},Yn=function(){function e(e){gt(e,1,"CountQueuingStrategy"),e=Gn(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}return Object.defineProperty(e.prototype,"highWaterMark",{get:function(){if(!Zn(this))throw Xn("highWaterMark");return this._countQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){if(!Zn(this))throw Xn("size");return Qn},enumerable:!1,configurable:!0}),e}();function Xn(e){return new TypeError("CountQueuingStrategy.prototype."+e+" can only be used on a CountQueuingStrategy")}function Zn(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")}function $n(e,t,r){return dt(e,r),function(r){return Xe(e,t,[r])}}function ei(e,t,r){return dt(e,r),function(r){return Ye(e,t,[r])}}function ti(e,t,r){return dt(e,r),function(r,n){return Xe(e,t,[r,n])}}Object.defineProperties(Yn.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Yn.prototype,Oe.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var ri=function(){function e(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={}),void 0===e&&(e=null);var n=yr(t,"Second parameter"),i=yr(r,"Third parameter"),a=function(e,t){ft(e,t);var r=null==e?void 0:e.flush,n=null==e?void 0:e.readableType,i=null==e?void 0:e.start,a=null==e?void 0:e.transform,o=null==e?void 0:e.writableType;return{flush:void 0===r?void 0:$n(r,e,t+" has member 'flush' that"),readableType:n,start:void 0===i?void 0:ei(i,e,t+" has member 'start' that"),transform:void 0===a?void 0:ti(a,e,t+" has member 'transform' that"),writableType:o}}(e,"First parameter");if(void 0!==a.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==a.writableType)throw new RangeError("Invalid writableType specified");var o,s=gr(i,0),c=br(i),u=gr(n,1),l=br(n);!function(e,t,r,n,i,a){function o(){return t}e._writable=function(e,t,r,n,i,a){void 0===i&&(i=1),void 0===a&&(a=function(){return 1});var o=Object.create(Ar.prototype);return jr(o),Kr(o,Object.create(Wr.prototype),e,t,r,n,i,a),o}(o,(function(t){return function(e,t){var r=e._transformStreamController;if(e._backpressure){return Ke(e._backpressureChangePromise,(function(){var n=e._writable;if("erroring"===n._state)throw n._storedError;return hi(r,t)}))}return hi(r,t)}(e,t)}),(function(){return function(e){var t=e._readable,r=e._transformStreamController,n=r._flushAlgorithm();return ui(r),Ke(n,(function(){if("errored"===t._state)throw t._storedError;kn(t._readableStreamController)}),(function(r){throw ii(e,r),t._storedError}))}(e)}),(function(t){return function(e,t){return ii(e,t),Ue(void 0)}(e,t)}),r,n),e._readable=Mn(o,(function(){return function(e){return oi(e,!1),e._backpressureChangePromise}(e)}),(function(t){return ai(e,t),Ue(void 0)}),i,a),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,oi(e,!0),e._transformStreamController=void 0}(this,ze((function(e){o=e})),u,l,s,c),function(e,t){var r=Object.create(si.prototype),n=function(e){try{return li(r,e),Ue(void 0)}catch(e){return qe(e)}},i=function(){return Ue(void 0)};void 0!==t.transform&&(n=function(e){return t.transform(e,r)});void 0!==t.flush&&(i=function(){return t.flush(r)});!function(e,t,r,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n}(e,r,n,i)}(this,a),void 0!==a.start?o(a.start(this._transformStreamController)):o(void 0)}return Object.defineProperty(e.prototype,"readable",{get:function(){if(!ni(this))throw fi("readable");return this._readable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"writable",{get:function(){if(!ni(this))throw fi("writable");return this._writable},enumerable:!1,configurable:!0}),e}();function ni(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function ii(e,t){En(e._readable._readableStreamController,t),ai(e,t)}function ai(e,t){ui(e._transformStreamController),Xr(e._writable._writableStreamController,t),e._backpressure&&oi(e,!1)}function oi(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=ze((function(t){e._backpressureChangePromise_resolve=t})),e._backpressure=t}Object.defineProperties(ri.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(ri.prototype,Oe.toStringTag,{value:"TransformStream",configurable:!0});var si=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!ci(this))throw pi("desiredSize");return An(this._controlledTransformStream._readable._readableStreamController)},enumerable:!1,configurable:!0}),e.prototype.enqueue=function(e){if(void 0===e&&(e=void 0),!ci(this))throw pi("enqueue");li(this,e)},e.prototype.error=function(e){if(void 0===e&&(e=void 0),!ci(this))throw pi("error");var t;t=e,ii(this._controlledTransformStream,t)},e.prototype.terminate=function(){if(!ci(this))throw pi("terminate");!function(e){var t=e._controlledTransformStream;kn(t._readable._readableStreamController);var r=new TypeError("TransformStream terminated");ai(t,r)}(this)},e}();function ci(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function ui(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function li(e,t){var r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!Sn(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{xn(n,t)}catch(e){throw ai(r,e),r._readable._storedError}(function(e){return!wn(e)})(n)!==r._backpressure&&oi(r,!0)}function hi(e,t){return Ke(e._transformAlgorithm(t),void 0,(function(t){throw ii(e._controlledTransformStream,t),t}))}function pi(e){return new TypeError("TransformStreamDefaultController.prototype."+e+" can only be used on a TransformStreamDefaultController")}function fi(e){return new TypeError("TransformStream.prototype."+e+" can only be used on a TransformStream")}Object.defineProperties(si.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(si.prototype,Oe.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var di={ReadableStream:Dn,ReadableStreamDefaultController:bn,ReadableByteStreamController:Gt,ReadableStreamBYOBRequest:Ht,ReadableStreamDefaultReader:Ct,ReadableStreamBYOBReader:fr,WritableStream:Ar,WritableStreamDefaultController:Wr,WritableStreamDefaultWriter:Lr,ByteLengthQueuingStrategy:Wn,CountQueuingStrategy:Yn,TransformStream:ri,TransformStreamDefaultController:si};if(void 0!==Ie)for(var mi in di)Object.prototype.hasOwnProperty.call(di,mi)&&Object.defineProperty(Ie,mi,{value:di[mi],writable:!0,configurable:!0});delete global.ReadableStream;let gi,bi,yi;gi=Symbol.asyncIterator;bi=Symbol.toStringTag;yi=Symbol.toStringTag;(!a||!("TextEncoder"in s))&&(s.TextEncoder=j);(!a||!("TextDecoder"in s))&&(s.TextDecoder=S),a||"atob"in s||!Q||(s.atob=Q),a||"btoa"in s||!Y||(s.btoa=Y),a||"Headers"in s||!$||(s.Headers=$),a||"Response"in s||!ye||(s.Response=ye),a||"fetch"in s||!we||(s.fetch=we),a||"DOMParser"in s||!i.DOMParser||(s.DOMParser=i.DOMParser),a||"_encodeImageNode"in s||!Ae||(s._encodeImageNode=Ae),a||"_parseImageNode"in s||!Be||(s._parseImageNode=Be),"allSettled"in Promise||(Promise.allSettled=function(e){const t=e.map(e=>e.then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e})));return Promise.all(t)});const{I3SConverter:vi,Tiles3DConverter:wi,DepsInstaller:_i}=r(527),ki={I3S:"I3S",_3DTILES:"3DTILES"};function xi(){console.log("cli: converter 3dTiles to I3S or I3S to 3dTiles..."),console.log('--install-dependencies [Run the script for installing dependencies. Run this options separate from others. Now "*.pgm" file installation is implemented]'),console.log("--max-depth [Maximal depth of hierarchical tiles tree traversal, default: infinite]"),console.log("--name [Tileset name]"),console.log('--output [Output folder, default: "data" folder]'),console.log("--slpk [Generate slpk (Scene Layer Packages) I3S output file]"),console.log("--tileset [tileset.json file (3DTiles) / http://..../SceneServer/layers/0 resource (I3S)]"),console.log("--input-type [tileset input type: I3S or 3DTILES]"),console.log('--7zExe [location of 7z.exe archiver to create slpk on Windows, default: "C:\\Program Files\\7-Zip\\7z.exe"]'),console.log('--egm [location of Earth Gravity Model *.pgm file to convert heights from ellipsoidal to gravity-related format. A model file can be loaded from GeographicLib https://geographiclib.sourceforge.io/html/geoid.html], default: "./deps/egm2008-5.zip"'),console.log("--token [Token for Cesium ION tilesets authentication]"),console.log("--no-draco [Disable draco compression for geometry]"),console.log("--generate-textures [Enable KTX2 textures generation if only one of (JPG, PNG) texture is provided or generate JPG texture if only KTX2 is provided]"),console.log("--generate-bounding-volumes [Will generate obb and mbs bounding volumes from geometry]"),console.log("--validate [Enable validation]"),process.exit(0)}let Ei;!async function(){const[,,...e]=process.argv;if(0===e.length&&xi(),Ei=function(e){const t={inputType:null,tileset:null,name:null,output:"data",sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:Object(n.join)(process.cwd(),"deps","egm2008-5.pgm"),token:null,draco:!0,installDependencies:!1,generateTextures:!1,generateBoundingVolumes:!1,validate:!1},r=e.length,i=t=>{if(t+1>=r)return null;const n=e[t+1];return 0===n.indexOf("--")?null:n};return e.forEach((e,r)=>{if(0===e.indexOf("--"))switch(e){case"--input-type":t.inputType=i(r);break;case"--tileset":t.tileset=i(r);break;case"--name":t.name=i(r);break;case"--output":t.output=i(r);break;case"--max-depth":t.maxDepth=i(r);break;case"--slpk":t.slpk=!0;break;case"--7zExe":t.sevenZipExe=i(r);break;case"--egm":t.egm=i(r);break;case"--token":t.token=i(r);break;case"--no-draco":t.draco=!1;break;case"--validate":t.validate=!0;break;case"--install-dependencies":t.installDependencies=!0;break;case"--generate-textures":t.generateTextures=!0;break;case"--generate-bounding-volumes":t.generateBoundingVolumes=!0;break;case"--help":xi();break;default:console.warn("Unknown option "+e),process.exit(0)}}),t}(e),Ei.installDependencies){(new _i).install("deps")}else!function(e){const t={name:()=>console.log("Missed: --name [Tileset name]"),tileset:()=>console.log("Missed: --tileset [tileset.json file]"),inputType:()=>console.log("Missed/Incorrect: --input-type [tileset input type: I3S or 3DTILES]")},r=[];for(const n in t){const i=e[n],a=Boolean(i)&&"inputType"===n&&!Object.values(ki).includes(i.toUpperCase());i&&!a||r.push(t[n])}r.length&&(r.forEach(e=>e()),process.exit(0))}(Ei),await async function(e){console.log("------------------------------------------------"),console.log("Starting conversion of "+e.inputType),console.log("------------------------------------------------");switch(e.inputType.toUpperCase()){case ki.I3S:(new wi).convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case ki._3DTILES:const t=new vi;await t.convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,slpk:e.slpk,sevenZipExe:e.sevenZipExe,egmFilePath:e.egm,token:e.token,draco:e.draco,generateTextures:e.generateTextures,generateBoundingVolumes:e.generateBoundingVolumes,validate:e.validate});break;default:xi()}}(Ei)}()},,,,,,,function(e,t,r){"use strict";function n(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const t="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}r.d(t,"a",(function(){return _}));const i="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",a=n();class o{constructor(e,t,r="sessionStorage"){this.storage=function(e){try{const t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}(r),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function s(e,t,r,n=600){const i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));const a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}const c={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function u(e){return"string"==typeof e?c[e.toUpperCase()]||c.WHITE:e}function l(e,t){if(!e)throw new Error(t||"Assertion failed")}const h={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},p=h.window||h.self||h.global,f=h.process||{};console;function d(){let e;if(a&&p.performance)e=p.performance.now();else if(f.hrtime){const t=f.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}const m={debug:a&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},g={enabled:!0,level:0};function b(){}const y={},v={once:!0};function w(e){for(const t in e)for(const r in e[t])return r||"untitled";return"empty"}class _{constructor({id:e}={id:""}){this.id=e,this.VERSION=i,this._startTs=d(),this._deltaTs=d(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new o("__probe-".concat(this.id,"__"),g),this.userData={},this.timeStamp("".concat(this.id," started")),function(e,t=["constructor"]){const r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r);for(const r of n)"function"==typeof e[r]&&(t.find(e=>r===e)||(e[r]=e[r].bind(e)))}(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((d()-this._startTs).toPrecision(10))}getDelta(){return Number((d()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.updateConfiguration({enabled:e}),this}setLevel(e){return this._storage.updateConfiguration({level:e}),this}assert(e,t){l(e,t)}warn(e){return this._getLogFunction(0,e,m.warn,arguments,v)}error(e){return this._getLogFunction(0,e,m.error,arguments)}deprecated(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}probe(e,t){return this._getLogFunction(e,t,m.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,m.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,m.debug||m.info,arguments,v)}table(e,t,r){return t?this._getLogFunction(e,t,console.table||b,r&&[r],{tag:w(t)}):b}image({logLevel:e,priority:t,image:n,message:i="",scale:o=1}){return this._shouldLog(e||t)?a?function({image:e,message:t="",scale:r=1}){if("string"==typeof e){const n=new Image;return n.onload=()=>{const e=s(n,t,r);console.log(...e)},n.src=e,b}const n=e.nodeName||"";if("img"===n.toLowerCase())return console.log(...s(e,t,r)),b;if("canvas"===n.toLowerCase()){const n=new Image;return n.onload=()=>console.log(...s(n,t,r)),n.src=e.toDataURL(),b}return b}({image:n,message:i,scale:o}):function({image:e,message:t="",scale:n=1}){let i=null;try{i=r(!function(){var e=new Error("Cannot find module 'asciify-image'");throw e.code="MODULE_NOT_FOUND",e}())}catch(e){}if(i)return()=>i(e,{fit:"box",width:"".concat(Math.round(80*n),"%")}).then(e=>console.log(e));return b}({image:n,message:i,scale:o}):b}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(e){return this._storage.config[e]}set(e,t){this._storage.updateConfiguration({[e]:t})}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||b)}group(e,t,r={collapsed:!1}){r=x({logLevel:e,message:t,opts:r});const{collapsed:n}=r;return r.method=(n?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(e,t,r={}){return this.group(e,t,Object.assign({},r,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||b)}withGroup(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=k(e)}_getLogFunction(e,t,r,n=[],i){if(this._shouldLog(e)){i=x({logLevel:e,message:t,args:n,opts:i}),l(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=d();const o=i.tag||i.message;if(i.once){if(y[o])return b;y[o]=d()}return t=function(e,t,r){if("string"==typeof t){const s=r.time?function(e,t=8){const r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}(function(e){let t;return t=e<10?"".concat(e.toFixed(2),"ms"):e<100?"".concat(e.toFixed(1),"ms"):e<1e3?"".concat(e.toFixed(0),"ms"):"".concat((e/1e3).toFixed(2),"s"),t}(r.total)):"";t=r.time?"".concat(e,": ").concat(s," ").concat(t):"".concat(e,": ").concat(t),n=t,i=r.color,o=r.background,a||"string"!=typeof n||(i&&(i=u(i),n="[".concat(i,"m").concat(n,"")),o&&(i=u(o),n="[".concat(o+10,"m").concat(n,""))),t=n}var n,i,o;return t}(this.id,i.message,i),r.bind(console,t,...i.args)}return b}}function k(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return l(Number.isFinite(t)&&t>=0),t}function x(e){const{logLevel:t,message:r}=e;e.logLevel=k(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(e.args=n,typeof t){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());const i=typeof e.message;return l("string"===i||"object"===i),Object.assign(e,e.opts)}_.VERSION=i}]);
292
+ !function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i<n;++i)t[i]=t[i].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function i(e){return e.toUpperCase()}function a(e){var n=t("[0-9]","[A-Fa-f]"),i=r(r("%[EFef]"+n+"%"+n+n+"%"+n+n)+"|"+r("%[89A-Fa-f]"+n+"%"+n+n)+"|"+r("%"+n+n)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",o=t("[\\:\\/\\?\\#\\[\\]\\@]",a),s=e?"[\\uE000-\\uF8FF]":"[]",c=t("[A-Za-z]","[0-9]","[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),u=r("[A-Za-z]"+t("[A-Za-z]","[0-9]","[\\+\\-\\.]")+"*"),l=r(r(i+"|"+t(c,a,"[\\:]"))+"*"),h=(r(r("25[0-5]")+"|"+r("2[0-4][0-9]")+"|"+r("1[0-9][0-9]")+"|"+r("[1-9][0-9]")+"|[0-9]"),r(r("25[0-5]")+"|"+r("2[0-4][0-9]")+"|"+r("1[0-9][0-9]")+"|"+r("0?[1-9][0-9]")+"|0?0?[0-9]")),p=r(h+"\\."+h+"\\."+h+"\\."+h),f=r(n+"{1,4}"),d=r(r(f+"\\:"+f)+"|"+p),m=r(r(f+"\\:")+"{6}"+d),g=r("\\:\\:"+r(f+"\\:")+"{5}"+d),b=r(r(f)+"?\\:\\:"+r(f+"\\:")+"{4}"+d),y=r(r(r(f+"\\:")+"{0,1}"+f)+"?\\:\\:"+r(f+"\\:")+"{3}"+d),v=r(r(r(f+"\\:")+"{0,2}"+f)+"?\\:\\:"+r(f+"\\:")+"{2}"+d),w=r(r(r(f+"\\:")+"{0,3}"+f)+"?\\:\\:"+f+"\\:"+d),_=r(r(r(f+"\\:")+"{0,4}"+f)+"?\\:\\:"+d),k=r(r(r(f+"\\:")+"{0,5}"+f)+"?\\:\\:"+f),x=r(r(r(f+"\\:")+"{0,6}"+f)+"?\\:\\:"),E=r([m,g,b,y,v,w,_,k,x].join("|")),A=r(r(c+"|"+i)+"+"),S=(r(E+"\\%25"+A),r(E+r("\\%25|\\%(?!"+n+"{2})")+A)),j=r("[vV]"+n+"+\\."+t(c,a,"[\\:]")+"+"),T=r("\\["+r(S+"|"+E+"|"+j)+"\\]"),C=r(r(i+"|"+t(c,a))+"*"),B=r(T+"|"+p+"(?!"+C+")|"+C),O=r("[0-9]*"),R=r(r(l+"@")+"?"+B+r("\\:"+O)+"?"),I=r(i+"|"+t(c,a,"[\\:\\@]")),P=r(I+"*"),D=r(I+"+"),M=r(r(i+"|"+t(c,a,"[\\@]"))+"+"),F=r(r("\\/"+P)+"*"),L=r("\\/"+r(D+F)+"?"),N=r(M+F),z=r(D+F),U="(?!"+I+")",q=(r(F+"|"+L+"|"+N+"|"+z+"|"+U),r(r(I+"|"+t("[\\/\\?]",s))+"*")),H=r(r(I+"|[\\/\\?]")+"*"),G=r(r("\\/\\/"+R+F)+"|"+L+"|"+z+"|"+U),V=r(u+"\\:"+G+r("\\?"+q)+"?"+r("\\#"+H)+"?"),W=r(r("\\/\\/"+R+F)+"|"+L+"|"+N+"|"+U),K=r(W+r("\\?"+q)+"?"+r("\\#"+H)+"?");return r(V+"|"+K),r(u+"\\:"+G+r("\\?"+q)+"?"),r(r("\\/\\/("+r("("+l+")@")+"?("+B+")"+r("\\:("+O+")")+"?)")+"?("+F+"|"+L+"|"+z+"|"+U+")"),r("\\?("+q+")"),r("\\#("+H+")"),r(r("\\/\\/("+r("("+l+")@")+"?("+B+")"+r("\\:("+O+")")+"?)")+"?("+F+"|"+L+"|"+N+"|"+U+")"),r("\\?("+q+")"),r("\\#("+H+")"),r(r("\\/\\/("+r("("+l+")@")+"?("+B+")"+r("\\:("+O+")")+"?)")+"?("+F+"|"+L+"|"+z+"|"+U+")"),r("\\?("+q+")"),r("\\#("+H+")"),r("("+l+")@"),r("\\:("+O+")"),{NOT_SCHEME:new RegExp(t("[^]","[A-Za-z]","[0-9]","[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",c,a),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",c,a),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",c,a),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",c,a),"g"),NOT_QUERY:new RegExp(t("[^\\%]",c,a,"[\\:\\@\\/\\?]",s),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",c,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",c,a),"g"),UNRESERVED:new RegExp(c,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",c,o),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+p+")$"),IPV6ADDRESS:new RegExp("^\\[?("+E+")"+r(r("\\%25|\\%(?!"+n+"{2})")+"("+A+")")+"?\\]?$")}}var o=a(!1),s=a(!0),c=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=2147483647,l=/^xn--/,h=/[^\0-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,m=String.fromCharCode;function g(e){throw new RangeError(f[e])}function b(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);var i=function(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}((e=e.replace(p,".")).split("."),t).join(".");return n+i}function y(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var a=e.charCodeAt(r++);56320==(64512&a)?t.push(((1023&i)<<10)+(1023&a)+65536):(t.push(i),r--)}else t.push(i)}return t}var v=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},w=function(e,t,r){var n=0;for(e=r?d(e/700):e>>1,e+=d(e/t);e>455;n+=36)e=d(e/35);return d(n+36*e/(e+38))},_=function(e){var t,r=[],n=e.length,i=0,a=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var c=0;c<s;++c)e.charCodeAt(c)>=128&&g("not-basic"),r.push(e.charCodeAt(c));for(var l=s>0?s+1:0;l<n;){for(var h=i,p=1,f=36;;f+=36){l>=n&&g("invalid-input");var m=(t=e.charCodeAt(l++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(m>=36||m>d((u-i)/p))&&g("overflow"),i+=m*p;var b=f<=o?1:f>=o+26?26:f-o;if(m<b)break;var y=36-b;p>d(u/y)&&g("overflow"),p*=y}var v=r.length+1;o=w(i-h,v,0==h),d(i/v)>u-a&&g("overflow"),a+=d(i/v),i%=v,r.splice(i++,0,a)}return String.fromCodePoint.apply(String,r)},k=function(e){var t=[],r=(e=y(e)).length,n=128,i=0,a=72,o=!0,s=!1,c=void 0;try{for(var l,h=e[Symbol.iterator]();!(o=(l=h.next()).done);o=!0){var p=l.value;p<128&&t.push(m(p))}}catch(e){s=!0,c=e}finally{try{!o&&h.return&&h.return()}finally{if(s)throw c}}var f=t.length,b=f;for(f&&t.push("-");b<r;){var _=u,k=!0,x=!1,E=void 0;try{for(var A,S=e[Symbol.iterator]();!(k=(A=S.next()).done);k=!0){var j=A.value;j>=n&&j<_&&(_=j)}}catch(e){x=!0,E=e}finally{try{!k&&S.return&&S.return()}finally{if(x)throw E}}var T=b+1;_-n>d((u-i)/T)&&g("overflow"),i+=(_-n)*T,n=_;var C=!0,B=!1,O=void 0;try{for(var R,I=e[Symbol.iterator]();!(C=(R=I.next()).done);C=!0){var P=R.value;if(P<n&&++i>u&&g("overflow"),P==n){for(var D=i,M=36;;M+=36){var F=M<=a?1:M>=a+26?26:M-a;if(D<F)break;var L=D-F,N=36-F;t.push(m(v(F+L%N,0))),D=d(L/N)}t.push(m(v(D,0))),a=w(i,T,b==f),i=0,++b}}}catch(e){B=!0,O=e}finally{try{!C&&I.return&&I.return()}finally{if(B)throw O}}++i,++n}return t.join("")},x=function(e){return b(e,(function(e){return h.test(e)?"xn--"+k(e):e}))},E=function(e){return b(e,(function(e){return l.test(e)?_(e.slice(4).toLowerCase()):e}))},A={};function S(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function j(e){for(var t="",r=0,n=e.length;r<n;){var i=parseInt(e.substr(r+1,2),16);if(i<128)t+=String.fromCharCode(i),r+=3;else if(i>=194&&i<224){if(n-r>=6){var a=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&a)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var o=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function T(e,t){function r(e){var r=j(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,S).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,S).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,S).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,S).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,S).replace(t.PCT_ENCODED,i)),e}function C(e){return e.replace(/^0*(.*)/,"$1")||"0"}function B(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=c(r,2)[1];return n?n.split(".").map(C).join("."):e}function O(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=c(r,3),i=n[1],a=n[2];if(i){for(var o=i.toLowerCase().split("::").reverse(),s=c(o,2),u=s[0],l=s[1],h=l?l.split(":").map(C):[],p=u.split(":").map(C),f=t.IPV4ADDRESS.test(p[p.length-1]),d=f?7:8,m=p.length-d,g=Array(d),b=0;b<d;++b)g[b]=h[b]||p[m+b]||"";f&&(g[d-1]=B(g[d-1],t));var y=g.reduce((function(e,t,r){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===r?n.length++:e.push({index:r,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],v=void 0;if(y&&y.length>1){var w=g.slice(0,y.index),_=g.slice(y.index+y.length);v=w.join(":")+"::"+_.join(":")}else v=g.join(":");return a&&(v+="%"+a),v}return e}var R=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,I=void 0==="".match(/(){0}/)[1];function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?s:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(R);if(i){I?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=O(B(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var a=A[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||a&&a.unicodeSupport)T(r,n);else{if(r.host&&(t.domainHost||a&&a.domainHost))try{r.host=x(r.host.replace(n.PCT_ENCODED,j).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}T(r,o)}a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function D(e,t){var r=!1!==t.iri?s:o,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(O(B(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var M=/^\.\.?\//,F=/^\/\.(\/|$)/,L=/^\/\.\.(\/|$)/,N=/^\/?(?:.|\n)*?(?=\/|$)/;function z(e){for(var t=[];e.length;)if(e.match(M))e=e.replace(M,"");else if(e.match(F))e=e.replace(F,"/");else if(e.match(L))e=e.replace(L,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(N);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function U(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:o,n=[],i=A[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?E(e.host):x(e.host.replace(r.PCT_ENCODED,j).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}T(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=D(e,t);if(void 0!==a&&("suffix"!==t.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||i&&i.absolutePath||(c=z(c)),void 0===a&&(c=c.replace(/^\/\//,"/%2F")),n.push(c)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function q(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],i={};return n||(e=P(U(e,r),r),t=P(U(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=z(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=z(t.path||""),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=z(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=z(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function H(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:o.PCT_ENCODED,j)}var G={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},V={scheme:"https",domainHost:G.domainHost,parse:G.parse,serialize:G.serialize};function W(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var K={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=W(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(W(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),n=c(r,2),i=n[0],a=n[1];e.path=i&&"/"!==i?i:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},J={scheme:"wss",domainHost:K.domainHost,parse:K.parse,serialize:K.serialize},Q={},Y="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",X="[0-9A-Fa-f]",Z=r(r("%[EFef]"+X+"%"+X+X+"%"+X+X)+"|"+r("%[89A-Fa-f]"+X+"%"+X+X)+"|"+r("%"+X+X)),$=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),ee=new RegExp(Y,"g"),te=new RegExp(Z,"g"),re=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',$),"g"),ne=new RegExp(t("[^]",Y,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ie=ne;function ae(e){var t=j(e);return t.match(ee)?t:e}var oe={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,a={},o=r.query.split("&"),s=0,c=o.length;s<c;++s){var u=o[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),h=0,p=l.length;h<p;++h)n.push(l[h]);break;case"subject":r.subject=H(u[1],t);break;case"body":r.body=H(u[1],t);break;default:i=!0,a[H(u[0],t)]=H(u[1],t)}}i&&(r.headers=a)}r.query=void 0;for(var f=0,d=n.length;f<d;++f){var m=n[f].split("@");if(m[0]=H(m[0]),t.unicodeSupport)m[1]=H(m[1],t).toLowerCase();else try{m[1]=x(H(m[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[f]=m.join("@")}return r},serialize:function(e,t){var r,n=e,a=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(a){for(var o=0,s=a.length;o<s;++o){var c=String(a[o]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(te,ae).replace(te,i).replace(re,S),h=c.slice(u+1);try{h=t.iri?E(h):x(H(h,t).toLowerCase())}catch(e){n.error=n.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}a[o]=l+"@"+h}n.path=a.join(",")}var p=e.headers=e.headers||{};e.subject&&(p.subject=e.subject),e.body&&(p.body=e.body);var f=[];for(var d in p)p[d]!==Q[d]&&f.push(d.replace(te,ae).replace(te,i).replace(ne,S)+"="+p[d].replace(te,ae).replace(te,i).replace(ie,S));return f.length&&(n.query=f.join("&")),n}},se=/^([^\:]+)\:(.*)/,ce={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(se),n=e;if(r){var i=t.scheme||n.scheme||"urn",a=r[1].toLowerCase(),o=r[2],s=i+":"+(t.nid||a),c=A[s];n.nid=a,n.nss=o,n.path=void 0,c&&(n=c.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,i=r+":"+(t.nid||n),a=A[i];a&&(e=a.serialize(e,t));var o=e,s=e.nss;return o.path=(n||t.nid)+":"+s,o}},ue=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,le={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ue)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};A[G.scheme]=G,A[V.scheme]=V,A[K.scheme]=K,A[J.scheme]=J,A[oe.scheme]=oe,A[ce.scheme]=ce,A[le.scheme]=le,e.SCHEMES=A,e.pctEncChar=S,e.pctDecChars=j,e.parse=P,e.removeDotSegments=z,e.serialize=U,e.resolveComponents=q,e.resolve=function(e,t,r){var n=function(e,t){var r=e;if(t)for(var n in t)r[n]=t[n];return r}({scheme:"null"},r);return U(q(P(e,n),P(t,n),n,!0),n)},e.normalize=function(e,t){return"string"==typeof e?e=U(P(e,t),t):"object"===n(e)&&(e=P(U(e,t),t)),e},e.equal=function(e,t,r){return"string"==typeof e?e=U(P(e,r),r):"object"===n(e)&&(e=U(e,r)),"string"==typeof t?t=U(P(t,r),r):"object"===n(t)&&(t=U(t,r)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?s.ESCAPE:o.ESCAPE,S)},e.unescapeComponent=H,Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,r){"use strict";e.exports=function(e){for(var t,r=0,n=e.length,i=0;i<n;)r++,(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<n&&56320==(64512&(t=e.charCodeAt(i)))&&i++;return r}},function(e,t,r){"use strict";var n=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),function e(t,r,i,a,o,s,c,u,l,h){if(a&&"object"==typeof a&&!Array.isArray(a)){for(var p in r(a,o,s,c,u,l,h),a){var f=a[p];if(Array.isArray(f)){if(p in n.arrayKeywords)for(var d=0;d<f.length;d++)e(t,r,i,f[d],o+"/"+p+"/"+d,s,o,p,a,d)}else if(p in n.propsKeywords){if(f&&"object"==typeof f)for(var m in f)e(t,r,i,f[m],o+"/"+p+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),s,o,p,a,m)}else(p in n.keywords||t.allKeys&&!(p in n.skipKeywords))&&e(t,r,i,f,o+"/"+p,s,o,p,a)}i(a,o,s,c,u,l,h)}}(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},function(e,t,r){"use strict";var n=e.exports=function(){this._cache={}};n.prototype.put=function(e,t){this._cache[e]=t},n.prototype.get=function(e){return this._cache[e]},n.prototype.del=function(e){delete this._cache[e]},n.prototype.clear=function(){this._cache={}}},function(e,t,r){"use strict";var n=r(49),i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,a=[0,31,28,31,30,31,30,31,31,30,31,30,31],o=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,s=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,c=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,u=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,l=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,p=/^(?:\/(?:[^~/]|~0|~1)*)*$/,f=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",n.copy(m[e])}function g(e){var t=e.match(i);if(!t)return!1;var r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(2==n&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:a[n])}function b(e,t){var r=e.match(o);if(!r)return!1;var n=r[1],i=r[2],a=r[3],s=r[5];return(n<=23&&i<=59&&a<=59||23==n&&59==i&&60==a)&&(!t||s)}e.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:l,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:_,uuid:h,"json-pointer":p,"json-pointer-uri-fragment":f,"relative-json-pointer":d},m.full={date:g,time:b,"date-time":function(e){var t=e.split(y);return 2==t.length&&g(t[0])&&b(t[1],!0)},uri:function(e){return v.test(e)&&c.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:l,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:_,uuid:h,"json-pointer":p,"json-pointer-uri-fragment":f,"relative-json-pointer":d};var y=/t|\s/i;var v=/\/|:/;var w=/[^\\]\\Z/;function _(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},function(e,t,r){"use strict";var n=r(467),i=r(49).toHash;e.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=i(t),e.types=i(["number","integer","string","array","object","boolean","null"]),e.forEach((function(r){r.rules=r.rules.map((function(r){var i;if("object"==typeof r){var a=Object.keys(r)[0];i=r[a],r=a,i.forEach((function(r){t.push(r),e.all[r]=!0}))}return t.push(r),e.all[r]={keyword:r,code:n[r],implements:i}})),e.all.$comment={keyword:"$comment",code:n.$comment},r.type&&(e.types[r.type]=r)})),e.keywords=i(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},function(e,t,r){"use strict";e.exports={$ref:r(468),allOf:r(469),anyOf:r(470),$comment:r(471),const:r(472),contains:r(473),dependencies:r(474),enum:r(475),format:r(476),if:r(477),items:r(478),maximum:r(252),minimum:r(252),maxItems:r(253),minItems:r(253),maxLength:r(254),minLength:r(254),maxProperties:r(255),minProperties:r(255),multipleOf:r(479),not:r(480),oneOf:r(481),pattern:r(482),properties:r(483),propertyNames:r(484),required:r(485),uniqueItems:r(486),validate:r(251)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n,i,a=" ",o=e.level,s=e.dataLevel,c=e.schema[t],u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,h="data"+(s||""),p="valid"+o;if("#"==c||"#/"==c)e.isRoot?(n=e.async,i="validate"):(n=!0===e.root.schema.$async,i="root.refVal[0]");else{var f=e.resolveRef(e.baseId,c,e.isRoot);if(void 0===f){var d=e.MissingRefError.message(e.baseId,c);if("fail"==e.opts.missingRefs){e.logger.error(d),(y=y||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(c)+"' } ",!1!==e.opts.messages&&(a+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(c)+"' "),e.opts.verbose&&(a+=" , schema: "+e.util.toQuotedString(c)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var m=a;a=y.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(a+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,c,d);e.logger.warn(d),l&&(a+=" if (true) { ")}}else if(f.inline){var g=e.util.copy(e);g.level++;var b="valid"+g.level;g.schema=f.schema,g.schemaPath="",g.errSchemaPath=c,a+=" "+e.validate(g).replace(/validate\.schema/g,f.code)+" ",l&&(a+=" if ("+b+") { ")}else n=!0===f.$async||e.async&&!1!==f.$async,i=f.code}if(i){var y;(y=y||[]).push(a),a="",e.opts.passContext?a+=" "+i+".call(this, ":a+=" "+i+"( ",a+=" "+h+", (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var v=a+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData) ";if(a=y.pop(),n){if(!e.async)throw new Error("async schema referenced by sync schema");l&&(a+=" var "+p+"; "),a+=" try { await "+v+"; ",l&&(a+=" "+p+" = true; "),a+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",l&&(a+=" "+p+" = false; "),a+=" } ",l&&(a+=" if ("+p+") { ")}else a+=" if (!"+v+") { if (vErrors === null) vErrors = "+i+".errors; else vErrors = vErrors.concat("+i+".errors); errors = vErrors.length; } ",l&&(a+=" else { ")}return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var l="valid"+c.level,h=c.baseId,p=!0,f=i;if(f)for(var d,m=-1,g=f.length-1;m<g;)d=f[m+=1],(e.opts.strictKeywords?"object"==typeof d&&Object.keys(d).length>0||!1===d:e.util.schemaHasRules(d,e.RULES.all))&&(p=!1,c.schema=d,c.schemaPath=a+"["+m+"]",c.errSchemaPath=o+"/"+m,n+=" "+e.validate(c)+" ",c.baseId=h,s&&(n+=" if ("+l+") { ",u+="}"));return s&&(n+=p?" if (true) { ":" "+u.slice(0,-1)+" "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p="errs__"+i,f=e.util.copy(e),d="";f.level++;var m="valid"+f.level;if(o.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0||!1===t:e.util.schemaHasRules(t,e.RULES.all)}))){var g=f.baseId;n+=" var "+p+" = errors; var "+h+" = false; ";var b=e.compositeRule;e.compositeRule=f.compositeRule=!0;var y=o;if(y)for(var v,w=-1,_=y.length-1;w<_;)v=y[w+=1],f.schema=v,f.schemaPath=s+"["+w+"]",f.errSchemaPath=c+"/"+w,n+=" "+e.validate(f)+" ",f.baseId=g,n+=" "+h+" = "+h+" || "+m+"; if (!"+h+") { ",d+="}";e.compositeRule=f.compositeRule=b,n+=" "+d+" if (!"+h+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else u&&(n+=" if (true) { ");return n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.schema[t],a=e.errSchemaPath+"/"+t,o=(e.opts.allErrors,e.util.toQuotedString(i));return!0===e.opts.$comment?n+=" console.log("+o+");":"function"==typeof e.opts.$comment&&(n+=" self._opts.$comment("+o+", "+e.util.toQuotedString(a)+", validate.root.schema);"),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p=e.opts.$data&&o&&o.$data;p&&(n+=" var schema"+i+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; "),p||(n+=" var schema"+i+" = validate.schema"+s+";"),n+="var "+h+" = equal("+l+", schema"+i+"); if (!"+h+") { ";var f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValue: schema"+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to constant' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var d=n;return n=f.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",u&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p="errs__"+i,f=e.util.copy(e);f.level++;var d="valid"+f.level,m="i"+i,g=f.dataLevel=e.dataLevel+1,b="data"+g,y=e.baseId,v=e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all);if(n+="var "+p+" = errors;var "+h+";",v){var w=e.compositeRule;e.compositeRule=f.compositeRule=!0,f.schema=o,f.schemaPath=s,f.errSchemaPath=c,n+=" var "+d+" = false; for (var "+m+" = 0; "+m+" < "+l+".length; "+m+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var _=l+"["+m+"]";f.dataPathArr[g]=m;var k=e.validate(f);f.baseId=y,e.util.varOccurences(k,b)<2?n+=" "+e.util.varReplace(k,b,_)+" ":n+=" var "+b+" = "+_+"; "+k+" ",n+=" if ("+d+") break; } ",e.compositeRule=f.compositeRule=w,n+=" if (!"+d+") {"}else n+=" if ("+l+".length == 0) {";var x=x||[];x.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should contain a valid item' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var E=n;return n=x.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { ",v&&(n+=" errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } "),e.opts.allErrors&&(n+=" } "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="errs__"+i,p=e.util.copy(e),f="";p.level++;var d="valid"+p.level,m={},g={},b=e.opts.ownProperties;for(_ in o)if("__proto__"!=_){var y=o[_],v=Array.isArray(y)?g:m;v[_]=y}n+="var "+h+" = errors;";var w=e.errorPath;for(var _ in n+="var missing"+i+";",g)if((v=g[_]).length){if(n+=" if ( "+l+e.util.getProperty(_)+" !== undefined ",b&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(_)+"') "),u){n+=" && ( ";var k=v;if(k)for(var x=-1,E=k.length-1;x<E;){B=k[x+=1],x&&(n+=" || "),n+=" ( ( "+(P=l+(I=e.util.getProperty(B)))+" === undefined ",b&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(B)+"') "),n+=") && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?B:I)+") ) "}n+=")) { ";var A="missing"+i,S="' + "+A+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,A,!0):w+" + "+A);var j=j||[];j.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(_)+"', missingProperty: '"+S+"', depsCount: "+v.length+", deps: '"+e.util.escapeQuotes(1==v.length?v[0]:v.join(", "))+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should have ",1==v.length?n+="property "+e.util.escapeQuotes(v[0]):n+="properties "+e.util.escapeQuotes(v.join(", ")),n+=" when property "+e.util.escapeQuotes(_)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var T=n;n=j.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+T+"]); ":n+=" validate.errors = ["+T+"]; return false; ":n+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{n+=" ) { ";var C=v;if(C)for(var B,O=-1,R=C.length-1;O<R;){B=C[O+=1];var I=e.util.getProperty(B),P=(S=e.util.escapeQuotes(B),l+I);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(w,B,e.opts.jsonPointers)),n+=" if ( "+P+" === undefined ",b&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(B)+"') "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(_)+"', missingProperty: '"+S+"', depsCount: "+v.length+", deps: '"+e.util.escapeQuotes(1==v.length?v[0]:v.join(", "))+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should have ",1==v.length?n+="property "+e.util.escapeQuotes(v[0]):n+="properties "+e.util.escapeQuotes(v.join(", ")),n+=" when property "+e.util.escapeQuotes(_)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}n+=" } ",u&&(f+="}",n+=" else { ")}e.errorPath=w;var D=p.baseId;for(var _ in m){y=m[_];(e.opts.strictKeywords?"object"==typeof y&&Object.keys(y).length>0||!1===y:e.util.schemaHasRules(y,e.RULES.all))&&(n+=" "+d+" = true; if ( "+l+e.util.getProperty(_)+" !== undefined ",b&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(_)+"') "),n+=") { ",p.schema=y,p.schemaPath=s+e.util.getProperty(_),p.errSchemaPath=c+"/"+e.util.escapeFragment(_),n+=" "+e.validate(p)+" ",p.baseId=D,n+=" } ",u&&(n+=" if ("+d+") { ",f+="}"))}return u&&(n+=" "+f+" if ("+h+" == errors) {"),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p=e.opts.$data&&o&&o.$data;p&&(n+=" var schema"+i+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ");var f="i"+i,d="schema"+i;p||(n+=" var "+d+" = validate.schema"+s+";"),n+="var "+h+";",p&&(n+=" if (schema"+i+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+i+")) "+h+" = false; else {"),n+=h+" = false;for (var "+f+"=0; "+f+"<"+d+".length; "+f+"++) if (equal("+l+", "+d+"["+f+"])) { "+h+" = true; break; }",p&&(n+=" } "),n+=" if (!"+h+") { ";var m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValues: schema"+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",u&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||"");if(!1===e.opts.format)return u&&(n+=" if (true) { "),n;var h,p=e.opts.$data&&o&&o.$data;p?(n+=" var schema"+i+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ",h="schema"+i):h=o;var f=e.opts.unknownFormats,d=Array.isArray(f);if(p){n+=" var "+(m="format"+i)+" = formats["+h+"]; var "+(g="isObject"+i)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(b="formatType"+i)+" = "+g+" && "+m+".type || 'string'; if ("+g+") { ",e.async&&(n+=" var async"+i+" = "+m+".async; "),n+=" "+m+" = "+m+".validate; } if ( ",p&&(n+=" ("+h+" !== undefined && typeof "+h+" != 'string') || "),n+=" (","ignore"!=f&&(n+=" ("+h+" && !"+m+" ",d&&(n+=" && self._opts.unknownFormats.indexOf("+h+") == -1 "),n+=") || "),n+=" ("+m+" && "+b+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?n+=" (async"+i+" ? await "+m+"("+l+") : "+m+"("+l+")) ":n+=" "+m+"("+l+") ",n+=" : "+m+".test("+l+"))))) {"}else{var m;if(!(m=e.formats[o])){if("ignore"==f)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(n+=" if (true) { "),n;if(d&&f.indexOf(o)>=0)return u&&(n+=" if (true) { "),n;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var g,b=(g="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(g){var y=!0===m.async;m=m.validate}if(b!=r)return u&&(n+=" if (true) { "),n;if(y){if(!e.async)throw new Error("async format in sync schema");n+=" if (!(await "+(v="formats"+e.util.getProperty(o)+".validate")+"("+l+"))) { "}else{n+=" if (! ";var v="formats"+e.util.getProperty(o);g&&(v+=".validate"),n+="function"==typeof m?" "+v+"("+l+") ":" "+v+".test("+l+") ",n+=") { "}}var w=w||[];w.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",n+=p?""+h:""+e.util.toQuotedString(o),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match format \"",n+=p?"' + "+h+" + '":""+e.util.escapeQuotes(o),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=p?"validate.schema"+s:""+e.util.toQuotedString(o),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var _=n;return n=w.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+_+"]); ":n+=" validate.errors = ["+_+"]; return false; ":n+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",u&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p="errs__"+i,f=e.util.copy(e);f.level++;var d="valid"+f.level,m=e.schema.then,g=e.schema.else,b=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0||!1===m:e.util.schemaHasRules(m,e.RULES.all)),y=void 0!==g&&(e.opts.strictKeywords?"object"==typeof g&&Object.keys(g).length>0||!1===g:e.util.schemaHasRules(g,e.RULES.all)),v=f.baseId;if(b||y){var w;f.createErrors=!1,f.schema=o,f.schemaPath=s,f.errSchemaPath=c,n+=" var "+p+" = errors; var "+h+" = true; ";var _=e.compositeRule;e.compositeRule=f.compositeRule=!0,n+=" "+e.validate(f)+" ",f.baseId=v,f.createErrors=!0,n+=" errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.compositeRule=f.compositeRule=_,b?(n+=" if ("+d+") { ",f.schema=e.schema.then,f.schemaPath=e.schemaPath+".then",f.errSchemaPath=e.errSchemaPath+"/then",n+=" "+e.validate(f)+" ",f.baseId=v,n+=" "+h+" = "+d+"; ",b&&y?n+=" var "+(w="ifClause"+i)+" = 'then'; ":w="'then'",n+=" } ",y&&(n+=" else { ")):n+=" if (!"+d+") { ",y&&(f.schema=e.schema.else,f.schemaPath=e.schemaPath+".else",f.errSchemaPath=e.errSchemaPath+"/else",n+=" "+e.validate(f)+" ",f.baseId=v,n+=" "+h+" = "+d+"; ",b&&y?n+=" var "+(w="ifClause"+i)+" = 'else'; ":w="'else'",n+=" } "),n+=" if (!"+h+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } ",u&&(n+=" else { ")}else u&&(n+=" if (true) { ");return n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p="errs__"+i,f=e.util.copy(e),d="";f.level++;var m="valid"+f.level,g="i"+i,b=f.dataLevel=e.dataLevel+1,y="data"+b,v=e.baseId;if(n+="var "+p+" = errors;var "+h+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){n+=" "+h+" = "+l+".length <= "+o.length+"; ";var _=c;c=e.errSchemaPath+"/additionalItems",n+=" if (!"+h+") { ";var k=k||[];k.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var x=n;n=k.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+x+"]); ":n+=" validate.errors = ["+x+"]; return false; ":n+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c=_,u&&(d+="}",n+=" else { ")}var E=o;if(E)for(var A,S=-1,j=E.length-1;S<j;)if(A=E[S+=1],e.opts.strictKeywords?"object"==typeof A&&Object.keys(A).length>0||!1===A:e.util.schemaHasRules(A,e.RULES.all)){n+=" "+m+" = true; if ("+l+".length > "+S+") { ";var T=l+"["+S+"]";f.schema=A,f.schemaPath=s+"["+S+"]",f.errSchemaPath=c+"/"+S,f.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0),f.dataPathArr[b]=S;var C=e.validate(f);f.baseId=v,e.util.varOccurences(C,y)<2?n+=" "+e.util.varReplace(C,y,T)+" ":n+=" var "+y+" = "+T+"; "+C+" ",n+=" } ",u&&(n+=" if ("+m+") { ",d+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0||!1===w:e.util.schemaHasRules(w,e.RULES.all))){f.schema=w,f.schemaPath=e.schemaPath+".additionalItems",f.errSchemaPath=e.errSchemaPath+"/additionalItems",n+=" "+m+" = true; if ("+l+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+l+".length; "+g+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);T=l+"["+g+"]";f.dataPathArr[b]=g;C=e.validate(f);f.baseId=v,e.util.varOccurences(C,y)<2?n+=" "+e.util.varReplace(C,y,T)+" ":n+=" var "+y+" = "+T+"; "+C+" ",u&&(n+=" if (!"+m+") break; "),n+=" } } ",u&&(n+=" if ("+m+") { ",d+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){f.schema=o,f.schemaPath=s,f.errSchemaPath=c,n+=" for (var "+g+" = 0; "+g+" < "+l+".length; "+g+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);T=l+"["+g+"]";f.dataPathArr[b]=g;C=e.validate(f);f.baseId=v,e.util.varOccurences(C,y)<2?n+=" "+e.util.varReplace(C,y,T)+" ":n+=" var "+y+" = "+T+"; "+C+" ",u&&(n+=" if (!"+m+") break; "),n+=" }"}return u&&(n+=" "+d+" if ("+p+" == errors) {"),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n,i=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,h="data"+(o||""),p=e.opts.$data&&s&&s.$data;if(p?(i+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",n="schema"+a):n=s,!p&&"number"!=typeof s)throw new Error(t+" must be number");i+="var division"+a+";if (",p&&(i+=" "+n+" !== undefined && ( typeof "+n+" != 'number' || "),i+=" (division"+a+" = "+h+" / "+n+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+a+" !== parseInt(division"+a+") ",i+=" ) ",p&&(i+=" ) "),i+=" ) { ";var f=f||[];f.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+n+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be multiple of ",i+=p?"' + "+n:n+"'"),e.opts.verbose&&(i+=" , schema: ",i+=p?"validate.schema"+c:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var d=i;return i=f.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+d+"]); ":i+=" validate.errors = ["+d+"]; return false; ":i+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="errs__"+i,p=e.util.copy(e);p.level++;var f="valid"+p.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){p.schema=o,p.schemaPath=s,p.errSchemaPath=c,n+=" var "+h+" = errors; ";var d,m=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.createErrors=!1,p.opts.allErrors&&(d=p.opts.allErrors,p.opts.allErrors=!1),n+=" "+e.validate(p)+" ",p.createErrors=!0,d&&(p.opts.allErrors=d),e.compositeRule=p.compositeRule=m,n+=" if ("+f+") { ";var g=g||[];g.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var b=n;n=g.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else n+=" var err = ",!1!==e.createErrors?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(n+=" if (false) { ");return n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p="errs__"+i,f=e.util.copy(e),d="";f.level++;var m="valid"+f.level,g=f.baseId,b="prevValid"+i,y="passingSchemas"+i;n+="var "+p+" = errors , "+b+" = false , "+h+" = false , "+y+" = null; ";var v=e.compositeRule;e.compositeRule=f.compositeRule=!0;var w=o;if(w)for(var _,k=-1,x=w.length-1;k<x;)_=w[k+=1],(e.opts.strictKeywords?"object"==typeof _&&Object.keys(_).length>0||!1===_:e.util.schemaHasRules(_,e.RULES.all))?(f.schema=_,f.schemaPath=s+"["+k+"]",f.errSchemaPath=c+"/"+k,n+=" "+e.validate(f)+" ",f.baseId=g):n+=" var "+m+" = true; ",k&&(n+=" if ("+m+" && "+b+") { "+h+" = false; "+y+" = ["+y+", "+k+"]; } else { ",d+="}"),n+=" if ("+m+") { "+h+" = "+b+" = true; "+y+" = "+k+"; }";return e.compositeRule=f.compositeRule=v,n+=d+"if (!"+h+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(n+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+="} else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; }",e.opts.allErrors&&(n+=" } "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n,i=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,h="data"+(o||""),p=e.opts.$data&&s&&s.$data;p?(i+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",n="schema"+a):n=s,i+="if ( ",p&&(i+=" ("+n+" !== undefined && typeof "+n+" != 'string') || "),i+=" !"+(p?"(new RegExp("+n+"))":e.usePattern(s))+".test("+h+") ) { ";var f=f||[];f.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",i+=p?""+n:""+e.util.toQuotedString(s),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match pattern \"",i+=p?"' + "+n+" + '":""+e.util.escapeQuotes(s),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=p?"validate.schema"+c:""+e.util.toQuotedString(s),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var d=i;return i=f.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+d+"]); ":i+=" validate.errors = ["+d+"]; return false; ":i+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="errs__"+i,p=e.util.copy(e),f="";p.level++;var d="valid"+p.level,m="key"+i,g="idx"+i,b=p.dataLevel=e.dataLevel+1,y="data"+b,v="dataProperties"+i,w=Object.keys(o||{}).filter(I),_=e.schema.patternProperties||{},k=Object.keys(_).filter(I),x=e.schema.additionalProperties,E=w.length||k.length,A=!1===x,S="object"==typeof x&&Object.keys(x).length,j=e.opts.removeAdditional,T=A||S||j,C=e.opts.ownProperties,B=e.baseId,O=e.schema.required;if(O&&(!e.opts.$data||!O.$data)&&O.length<e.opts.loopRequired)var R=e.util.toHash(O);function I(e){return"__proto__"!==e}if(n+="var "+h+" = errors;var "+d+" = true;",C&&(n+=" var "+v+" = undefined;"),T){if(n+=C?" "+v+" = "+v+" || Object.keys("+l+"); for (var "+g+"=0; "+g+"<"+v+".length; "+g+"++) { var "+m+" = "+v+"["+g+"]; ":" for (var "+m+" in "+l+") { ",E){if(n+=" var isAdditional"+i+" = !(false ",w.length)if(w.length>8)n+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var P=w;if(P)for(var D=-1,M=P.length-1;D<M;)Q=P[D+=1],n+=" || "+m+" == "+e.util.toQuotedString(Q)+" "}if(k.length){var F=k;if(F)for(var L=-1,N=F.length-1;L<N;)ae=F[L+=1],n+=" || "+e.usePattern(ae)+".test("+m+") "}n+=" ); if (isAdditional"+i+") { "}if("all"==j)n+=" delete "+l+"["+m+"]; ";else{var z=e.errorPath,U="' + "+m+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers)),A)if(j)n+=" delete "+l+"["+m+"]; ";else{n+=" "+d+" = false; ";var q=c;c=e.errSchemaPath+"/additionalProperties",(re=re||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { additionalProperty: '"+U+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is an invalid additional property":n+="should NOT have additional properties",n+="' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var H=n;n=re.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+H+"]); ":n+=" validate.errors = ["+H+"]; return false; ":n+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=q,u&&(n+=" break; ")}else if(S)if("failing"==j){n+=" var "+h+" = errors; ";var G=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=x,p.schemaPath=e.schemaPath+".additionalProperties",p.errSchemaPath=e.errSchemaPath+"/additionalProperties",p.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var V=l+"["+m+"]";p.dataPathArr[b]=m;var W=e.validate(p);p.baseId=B,e.util.varOccurences(W,y)<2?n+=" "+e.util.varReplace(W,y,V)+" ":n+=" var "+y+" = "+V+"; "+W+" ",n+=" if (!"+d+") { errors = "+h+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+l+"["+m+"]; } ",e.compositeRule=p.compositeRule=G}else{p.schema=x,p.schemaPath=e.schemaPath+".additionalProperties",p.errSchemaPath=e.errSchemaPath+"/additionalProperties",p.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);V=l+"["+m+"]";p.dataPathArr[b]=m;W=e.validate(p);p.baseId=B,e.util.varOccurences(W,y)<2?n+=" "+e.util.varReplace(W,y,V)+" ":n+=" var "+y+" = "+V+"; "+W+" ",u&&(n+=" if (!"+d+") break; ")}e.errorPath=z}E&&(n+=" } "),n+=" } ",u&&(n+=" if ("+d+") { ",f+="}")}var K=e.opts.useDefaults&&!e.compositeRule;if(w.length){var J=w;if(J)for(var Q,Y=-1,X=J.length-1;Y<X;){var Z=o[Q=J[Y+=1]];if(e.opts.strictKeywords?"object"==typeof Z&&Object.keys(Z).length>0||!1===Z:e.util.schemaHasRules(Z,e.RULES.all)){var $=e.util.getProperty(Q),ee=(V=l+$,K&&void 0!==Z.default);p.schema=Z,p.schemaPath=s+$,p.errSchemaPath=c+"/"+e.util.escapeFragment(Q),p.errorPath=e.util.getPath(e.errorPath,Q,e.opts.jsonPointers),p.dataPathArr[b]=e.util.toQuotedString(Q);W=e.validate(p);if(p.baseId=B,e.util.varOccurences(W,y)<2){W=e.util.varReplace(W,y,V);var te=V}else{te=y;n+=" var "+y+" = "+V+"; "}if(ee)n+=" "+W+" ";else{if(R&&R[Q]){n+=" if ( "+te+" === undefined ",C&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(Q)+"') "),n+=") { "+d+" = false; ";z=e.errorPath,q=c;var re,ne=e.util.escapeQuotes(Q);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(z,Q,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(re=re||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+ne+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+ne+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";H=n;n=re.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+H+"]); ":n+=" validate.errors = ["+H+"]; return false; ":n+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=q,e.errorPath=z,n+=" } else { "}else u?(n+=" if ( "+te+" === undefined ",C&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(Q)+"') "),n+=") { "+d+" = true; } else { "):(n+=" if ("+te+" !== undefined ",C&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(Q)+"') "),n+=" ) { ");n+=" "+W+" } "}}u&&(n+=" if ("+d+") { ",f+="}")}}if(k.length){var ie=k;if(ie)for(var ae,oe=-1,se=ie.length-1;oe<se;){Z=_[ae=ie[oe+=1]];if(e.opts.strictKeywords?"object"==typeof Z&&Object.keys(Z).length>0||!1===Z:e.util.schemaHasRules(Z,e.RULES.all)){p.schema=Z,p.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ae),p.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ae),n+=C?" "+v+" = "+v+" || Object.keys("+l+"); for (var "+g+"=0; "+g+"<"+v+".length; "+g+"++) { var "+m+" = "+v+"["+g+"]; ":" for (var "+m+" in "+l+") { ",n+=" if ("+e.usePattern(ae)+".test("+m+")) { ",p.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);V=l+"["+m+"]";p.dataPathArr[b]=m;W=e.validate(p);p.baseId=B,e.util.varOccurences(W,y)<2?n+=" "+e.util.varReplace(W,y,V)+" ":n+=" var "+y+" = "+V+"; "+W+" ",u&&(n+=" if (!"+d+") break; "),n+=" } ",u&&(n+=" else "+d+" = true; "),n+=" } ",u&&(n+=" if ("+d+") { ",f+="}")}}}return u&&(n+=" "+f+" if ("+h+" == errors) {"),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="errs__"+i,p=e.util.copy(e);p.level++;var f="valid"+p.level;if(n+="var "+h+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){p.schema=o,p.schemaPath=s,p.errSchemaPath=c;var d="key"+i,m="idx"+i,g="i"+i,b="' + "+d+" + '",y="data"+(p.dataLevel=e.dataLevel+1),v="dataProperties"+i,w=e.opts.ownProperties,_=e.baseId;w&&(n+=" var "+v+" = undefined; "),n+=w?" "+v+" = "+v+" || Object.keys("+l+"); for (var "+m+"=0; "+m+"<"+v+".length; "+m+"++) { var "+d+" = "+v+"["+m+"]; ":" for (var "+d+" in "+l+") { ",n+=" var startErrs"+i+" = errors; ";var k=d,x=e.compositeRule;e.compositeRule=p.compositeRule=!0;var E=e.validate(p);p.baseId=_,e.util.varOccurences(E,y)<2?n+=" "+e.util.varReplace(E,y,k)+" ":n+=" var "+y+" = "+k+"; "+E+" ",e.compositeRule=p.compositeRule=x,n+=" if (!"+f+") { for (var "+g+"=startErrs"+i+"; "+g+"<errors; "+g+"++) { vErrors["+g+"].propertyName = "+d+"; } var err = ",!1!==e.createErrors?(n+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { propertyName: '"+b+"' } ",!1!==e.opts.messages&&(n+=" , message: 'property name \\'"+b+"\\' is invalid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),u&&(n+=" break; "),n+=" } }"}return u&&(n+=" if ("+h+" == errors) {"),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=" ",i=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(a||""),h="valid"+i,p=e.opts.$data&&o&&o.$data;p&&(n+=" var schema"+i+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ");var f="schema"+i;if(!p)if(o.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var d=[],m=o;if(m)for(var g,b=-1,y=m.length-1;b<y;){g=m[b+=1];var v=e.schema.properties[g];v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0||!1===v:e.util.schemaHasRules(v,e.RULES.all))||(d[d.length]=g)}}else d=o;if(p||d.length){var w=e.errorPath,_=p||d.length>=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(n+=" var missing"+i+"; ",_){p||(n+=" var "+f+" = validate.schema"+s+"; ");var x="' + "+(C="schema"+i+"["+(S="i"+i)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,C,e.opts.jsonPointers)),n+=" var "+h+" = true; ",p&&(n+=" if (schema"+i+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+i+")) "+h+" = false; else {"),n+=" for (var "+S+" = 0; "+S+" < "+f+".length; "+S+"++) { "+h+" = "+l+"["+f+"["+S+"]] !== undefined ",k&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", "+f+"["+S+"]) "),n+="; if (!"+h+") break; } ",p&&(n+=" } "),n+=" if (!"+h+") { ",(T=T||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+x+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var E=n;n=T.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else{n+=" if ( ";var A=d;if(A)for(var S=-1,j=A.length-1;S<j;){O=A[S+=1],S&&(n+=" || "),n+=" ( ( "+(D=l+(P=e.util.getProperty(O)))+" === undefined ",k&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(O)+"') "),n+=") && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?O:P)+") ) "}n+=") { ";var T;x="' + "+(C="missing"+i)+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,C,!0):w+" + "+C),(T=T||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+x+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";E=n;n=T.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else if(_){p||(n+=" var "+f+" = validate.schema"+s+"; ");var C;x="' + "+(C="schema"+i+"["+(S="i"+i)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,C,e.opts.jsonPointers)),p&&(n+=" if ("+f+" && !Array.isArray("+f+")) { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+x+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+f+" !== undefined) { "),n+=" for (var "+S+" = 0; "+S+" < "+f+".length; "+S+"++) { if ("+l+"["+f+"["+S+"]] === undefined ",k&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", "+f+"["+S+"]) "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+x+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",p&&(n+=" } ")}else{var B=d;if(B)for(var O,R=-1,I=B.length-1;R<I;){O=B[R+=1];var P=e.util.getProperty(O),D=(x=e.util.escapeQuotes(O),l+P);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(w,O,e.opts.jsonPointers)),n+=" if ( "+D+" === undefined ",k&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(O)+"') "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+x+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=w}else u&&(n+=" if (true) {");return n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n,i=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,h="data"+(o||""),p="valid"+a,f=e.opts.$data&&s&&s.$data;if(f?(i+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",n="schema"+a):n=s,(s||f)&&!1!==e.opts.uniqueItems){f&&(i+=" var "+p+"; if ("+n+" === false || "+n+" === undefined) "+p+" = true; else if (typeof "+n+" != 'boolean') "+p+" = false; else { "),i+=" var i = "+h+".length , "+p+" = true , j; if (i > 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(d.indexOf("object")>=0||d.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+p+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ";var g="checkDataType"+(m?"s":"");i+=" if ("+e.util[g](d,"item",e.opts.strictNumbers,!0)+") continue; ",m&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+p+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",f&&(i+=" } "),i+=" if (!"+p+") { ";var b=b||[];b.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+c:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var y=i;i=b.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { ")}else l&&(i+=" if (true) { ");return i}},function(e,t,r){"use strict";var n=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,t){for(var r=0;r<t.length;r++){e=JSON.parse(JSON.stringify(e));var i,a=t[r].split("/"),o=e;for(i=1;i<a.length;i++)o=o[a[i]];for(i=0;i<n.length;i++){var s=n[i],c=o[s];c&&(o[s]={anyOf:[c,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e}},function(e,t,r){"use strict";var n=r(111).MissingRef;e.exports=function e(t,r,i){var a=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof r&&(i=r,r=void 0);var o=s(t).then((function(){var e=a._addSchema(t,void 0,r);return e.validate||function e(t){try{return a._compile(t)}catch(e){if(e instanceof n)return i(e);throw e}function i(n){var i=n.missingSchema;if(u(i))throw new Error("Schema "+i+" is loaded but "+n.missingRef+" cannot be resolved");var o=a._loadingSchemas[i];return o||(o=a._loadingSchemas[i]=a._opts.loadSchema(i)).then(c,c),o.then((function(e){if(!u(i))return s(e).then((function(){u(i)||a.addSchema(e,i,void 0,r)}))})).then((function(){return e(t)}));function c(){delete a._loadingSchemas[i]}function u(e){return a._refs[e]||a._schemas[e]}}}(e)}));i&&o.then((function(e){i(null,e)}),i);return o;function s(t){var r=t.$schema;return r&&!a.getSchema(r)?e.call(a,{$ref:r},!0):Promise.resolve()}}},function(e,t,r){"use strict";var n=/^[a-z_$][a-z0-9_$-]*$/i,i=r(490),a=r(491);e.exports={add:function(e,t){var r=this.RULES;if(r.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!n.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(t){this.validateKeyword(t,!0);var a=t.type;if(Array.isArray(a))for(var o=0;o<a.length;o++)c(e,a[o],t);else c(e,a,t);var s=t.metaSchema;s&&(t.$data&&this._opts.$data&&(s={anyOf:[s,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),t.validateSchema=this.compile(s,!0))}function c(e,t,n){for(var a,o=0;o<r.length;o++){var s=r[o];if(s.type==t){a=s;break}}a||(a={type:t,rules:[]},r.push(a));var c={keyword:e,definition:n,custom:!0,code:i,implements:n.implements};a.rules.push(c),r.custom[e]=c}return r.keywords[e]=r.all[e]=!0,this},get:function(e){var t=this.RULES.custom[e];return t?t.definition:this.RULES.keywords[e]||!1},remove:function(e){var t=this.RULES;delete t.keywords[e],delete t.all[e],delete t.custom[e];for(var r=0;r<t.length;r++)for(var n=t[r].rules,i=0;i<n.length;i++)if(n[i].keyword==e){n.splice(i,1);break}return this},validate:function e(t,r){e.errors=null;var n=this._validateKeyword=this._validateKeyword||this.compile(a,!0);if(n(t))return!0;if(e.errors=n.errors,r)throw new Error("custom keyword definition is invalid: "+this.errorsText(n.errors));return!1}}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n,i,a=" ",o=e.level,s=e.dataLevel,c=e.schema[t],u=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(s||""),f="valid"+o,d="errs__"+o,m=e.opts.$data&&c&&c.$data;m?(a+=" var schema"+o+" = "+e.util.getData(c.$data,s,e.dataPathArr)+"; ",i="schema"+o):i=c;var g,b,y,v,w,_="definition"+o,k=this.definition,x="";if(m&&k.$data){w="keywordValidate"+o;var E=k.validateSchema;a+=" var "+_+" = RULES.custom['"+t+"'].definition; var "+w+" = "+_+".validate;"}else{if(!(v=e.useCustomRule(this,c,e.schema,e)))return;i="validate.schema"+u,w=v.code,g=k.compile,b=k.inline,y=k.macro}var A=w+".errors",S="i"+o,j="ruleErr"+o,T=k.async;if(T&&!e.async)throw new Error("async keyword in sync schema");if(b||y||(a+=A+" = null;"),a+="var "+d+" = errors;var "+f+";",m&&k.$data&&(x+="}",a+=" if ("+i+" === undefined) { "+f+" = true; } else { ",E&&(x+="}",a+=" "+f+" = "+_+".validateSchema("+i+"); if ("+f+") { ")),b)k.statements?a+=" "+v.validate+" ":a+=" "+f+" = "+v.validate+"; ";else if(y){var C=e.util.copy(e);x="";C.level++;var B="valid"+C.level;C.schema=v.validate,C.schemaPath="";var O=e.compositeRule;e.compositeRule=C.compositeRule=!0;var R=e.validate(C).replace(/validate\.schema/g,w);e.compositeRule=C.compositeRule=O,a+=" "+R}else{(M=M||[]).push(a),a="",a+=" "+w+".call( ",e.opts.passContext?a+="this":a+="self",g||!1===k.schema?a+=" , "+p+" ":a+=" , "+i+" , "+p+" , validate.schema"+e.schemaPath+" ",a+=" , (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var I=s?"data"+(s-1||""):"parentData",P=s?e.dataPathArr[s]:"parentDataProperty",D=a+=" , "+I+" , "+P+" , rootData ) ";a=M.pop(),!1===k.errors?(a+=" "+f+" = ",T&&(a+="await "),a+=D+"; "):a+=T?" var "+(A="customErrors"+o)+" = null; try { "+f+" = await "+D+"; } catch (e) { "+f+" = false; if (e instanceof ValidationError) "+A+" = e.errors; else throw e; } ":" "+A+" = null; "+f+" = "+D+"; "}if(k.modifying&&(a+=" if ("+I+") "+p+" = "+I+"["+P+"];"),a+=""+x,k.valid)h&&(a+=" if (true) { ");else{var M;a+=" if ( ",void 0===k.valid?(a+=" !",a+=y?""+B:""+f):a+=" "+!k.valid+" ",a+=") { ",n=this.keyword,(M=M||[]).push(a),a="",(M=M||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(n||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(a+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),a+=" } "):a+=" {} ";var F=a;a=M.pop(),!e.compositeRule&&h?e.async?a+=" throw new ValidationError(["+F+"]); ":a+=" validate.errors = ["+F+"]; return false; ":a+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var L=a;a=M.pop(),b?k.errors?"full"!=k.errors&&(a+=" for (var "+S+"="+d+"; "+S+"<errors; "+S+"++) { var "+j+" = vErrors["+S+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+j+".schemaPath === undefined) { "+j+'.schemaPath = "'+l+'"; } ',e.opts.verbose&&(a+=" "+j+".schema = "+i+"; "+j+".data = "+p+"; "),a+=" } "):!1===k.errors?a+=" "+L+" ":(a+=" if ("+d+" == errors) { "+L+" } else { for (var "+S+"="+d+"; "+S+"<errors; "+S+"++) { var "+j+" = vErrors["+S+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+j+".schemaPath === undefined) { "+j+'.schemaPath = "'+l+'"; } ',e.opts.verbose&&(a+=" "+j+".schema = "+i+"; "+j+".data = "+p+"; "),a+=" } } "):y?(a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: '"+(n||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(a+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; ")):!1===k.errors?a+=" "+L+" ":(a+=" if (Array.isArray("+A+")) { if (vErrors === null) vErrors = "+A+"; else vErrors = vErrors.concat("+A+"); errors = vErrors.length; for (var "+S+"="+d+"; "+S+"<errors; "+S+"++) { var "+j+" = vErrors["+S+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; "+j+'.schemaPath = "'+l+'"; ',e.opts.verbose&&(a+=" "+j+".schema = "+i+"; "+j+".data = "+p+"; "),a+=" } } else { "+L+" } "),a+=" } ",h&&(a+=" else { ")}return a}},function(e,t,r){"use strict";var n=r(256);e.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:n.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:n.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},function(e,t){function r(e){this.name="HARError",this.message="validation failed",this.errors=e,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error("validation failed").stack}r.prototype=Error.prototype,e.exports=r},function(e,t,r){"use strict";e.exports={afterRequest:r(495),beforeRequest:r(496),browser:r(497),cache:r(498),content:r(499),cookie:r(500),creator:r(501),entry:r(502),har:r(503),header:r(504),log:r(505),page:r(506),pageTimings:r(507),postData:r(508),query:r(509),request:r(510),response:r(511),timings:r(512)}},function(e){e.exports=JSON.parse('{"$id":"afterRequest.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["lastAccess","eTag","hitCount"],"properties":{"expires":{"type":"string","pattern":"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?"},"lastAccess":{"type":"string","pattern":"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?"},"eTag":{"type":"string"},"hitCount":{"type":"integer"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"beforeRequest.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["lastAccess","eTag","hitCount"],"properties":{"expires":{"type":"string","pattern":"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?"},"lastAccess":{"type":"string","pattern":"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?"},"eTag":{"type":"string"},"hitCount":{"type":"integer"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"browser.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","version"],"properties":{"name":{"type":"string"},"version":{"type":"string"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"cache.json#","$schema":"http://json-schema.org/draft-06/schema#","properties":{"beforeRequest":{"oneOf":[{"type":"null"},{"$ref":"beforeRequest.json#"}]},"afterRequest":{"oneOf":[{"type":"null"},{"$ref":"afterRequest.json#"}]},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"content.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["size","mimeType"],"properties":{"size":{"type":"integer"},"compression":{"type":"integer"},"mimeType":{"type":"string"},"text":{"type":"string"},"encoding":{"type":"string"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"cookie.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"path":{"type":"string"},"domain":{"type":"string"},"expires":{"type":["string","null"],"format":"date-time"},"httpOnly":{"type":"boolean"},"secure":{"type":"boolean"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"creator.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","version"],"properties":{"name":{"type":"string"},"version":{"type":"string"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"entry.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["startedDateTime","time","request","response","cache","timings"],"properties":{"pageref":{"type":"string"},"startedDateTime":{"type":"string","format":"date-time","pattern":"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))"},"time":{"type":"number","min":0},"request":{"$ref":"request.json#"},"response":{"$ref":"response.json#"},"cache":{"$ref":"cache.json#"},"timings":{"$ref":"timings.json#"},"serverIPAddress":{"type":"string","oneOf":[{"format":"ipv4"},{"format":"ipv6"}]},"connection":{"type":"string"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"har.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["log"],"properties":{"log":{"$ref":"log.json#"}}}')},function(e){e.exports=JSON.parse('{"$id":"header.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"log.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["version","creator","entries"],"properties":{"version":{"type":"string"},"creator":{"$ref":"creator.json#"},"browser":{"$ref":"browser.json#"},"pages":{"type":"array","items":{"$ref":"page.json#"}},"entries":{"type":"array","items":{"$ref":"entry.json#"}},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"page.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["startedDateTime","id","title","pageTimings"],"properties":{"startedDateTime":{"type":"string","format":"date-time","pattern":"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))"},"id":{"type":"string","unique":true},"title":{"type":"string"},"pageTimings":{"$ref":"pageTimings.json#"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"pageTimings.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","properties":{"onContentLoad":{"type":"number","min":-1},"onLoad":{"type":"number","min":-1},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"postData.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["mimeType"],"properties":{"mimeType":{"type":"string"},"text":{"type":"string"},"params":{"type":"array","required":["name"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"fileName":{"type":"string"},"contentType":{"type":"string"},"comment":{"type":"string"}}},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"query.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"request.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["method","url","httpVersion","cookies","headers","queryString","headersSize","bodySize"],"properties":{"method":{"type":"string"},"url":{"type":"string","format":"uri"},"httpVersion":{"type":"string"},"cookies":{"type":"array","items":{"$ref":"cookie.json#"}},"headers":{"type":"array","items":{"$ref":"header.json#"}},"queryString":{"type":"array","items":{"$ref":"query.json#"}},"postData":{"$ref":"postData.json#"},"headersSize":{"type":"integer"},"bodySize":{"type":"integer"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"response.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["status","statusText","httpVersion","cookies","headers","content","redirectURL","headersSize","bodySize"],"properties":{"status":{"type":"integer"},"statusText":{"type":"string"},"httpVersion":{"type":"string"},"cookies":{"type":"array","items":{"$ref":"cookie.json#"}},"headers":{"type":"array","items":{"$ref":"header.json#"}},"content":{"$ref":"content.json#"},"redirectURL":{"type":"string"},"headersSize":{"type":"integer"},"bodySize":{"type":"integer"},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$id":"timings.json#","$schema":"http://json-schema.org/draft-06/schema#","required":["send","wait","receive"],"properties":{"dns":{"type":"number","min":-1},"connect":{"type":"number","min":-1},"blocked":{"type":"number","min":-1},"send":{"type":"number","min":-1},"wait":{"type":"number","min":-1},"receive":{"type":"number","min":-1},"ssl":{"type":"number","min":-1},"comment":{"type":"string"}}}')},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-06/schema#","$id":"http://json-schema.org/draft-06/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"examples":{"type":"array","items":{}},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":{},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":{}}')},function(e,t,r){"use strict";var n=r(108),i=r(112),a=r(99),o=a.md5,s=a.toBase64;function c(e){this.request=e,this.hasAuth=!1,this.sentAuth=!1,this.bearerToken=null,this.user=null,this.pass=null}c.prototype.basic=function(e,t,r){if(("string"!=typeof e||void 0!==t&&"string"!=typeof t)&&this.request.emit("error",new Error("auth() received invalid user or password")),this.user=e,this.pass=t,this.hasAuth=!0,r||void 0===r){var n="Basic "+s(e+":"+(t||""));return this.sentAuth=!0,n}},c.prototype.bearer=function(e,t){if(this.bearerToken=e,this.hasAuth=!0,t||void 0===t){"function"==typeof e&&(e=e());var r="Bearer "+(e||"");return this.sentAuth=!0,r}},c.prototype.digest=function(e,t,r){for(var n={},a=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;;){var s=a.exec(r);if(!s)break;n[s[1]]=s[2]||s[3]}var c=/(^|,)\s*auth\s*($|,)/.test(n.qop)&&"auth",u=c&&"00000001",l=c&&i().replace(/-/g,""),h=function(e,t,r,n,i,a){var s=o(t+":"+r+":"+n);return e&&"md5-sess"===e.toLowerCase()?o(s+":"+i+":"+a):s}(n.algorithm,this.user,n.realm,this.pass,n.nonce,l),p=o(e+":"+t),f=o(c?h+":"+n.nonce+":"+u+":"+l+":"+c+":"+p:h+":"+n.nonce+":"+p),d={username:this.user,realm:n.realm,nonce:n.nonce,uri:t,qop:c,response:f,nc:u,cnonce:l,algorithm:n.algorithm,opaque:n.opaque};for(var m in r=[],d)d[m]&&("qop"===m||"nc"===m||"algorithm"===m?r.push(m+"="+d[m]):r.push(m+'="'+d[m]+'"'));return r="Digest "+r.join(", "),this.sentAuth=!0,r},c.prototype.onRequest=function(e,t,r,n){var i,a=this.request;void 0===n&&void 0===e?this.request.emit("error",new Error("no auth mechanism defined")):i=void 0!==n?this.bearer(n,r):this.basic(e,t,r),i&&a.setHeader("authorization",i)},c.prototype.onResponse=function(e){var t=this.request;if(!this.hasAuth||this.sentAuth)return null;var r=n(e.headers).get("www-authenticate"),i=r&&r.split(" ")[0].toLowerCase();switch(t.debug("reauth",i),i){case"basic":return this.basic(this.user,this.pass,!0);case"bearer":return this.bearer(this.bearerToken,!0);case"digest":return this.digest(t.method,t.path,r)}},t.Auth=c},function(e,t,r){var n=r(11);e.exports=function(){return n.randomBytes(16)}},function(e,t){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){var n=t||0,i=r;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}},function(e,t,r){"use strict";var n=r(30),i=r(246),a=r(108),o=r(112),s=r(518),c=r(11),u=r(23).Buffer;function l(e){this.request=e,this.params=null}l.prototype.buildParams=function(e,t,r,n,i,a){var c={};for(var u in e)c["oauth_"+u]=e[u];c.oauth_version||(c.oauth_version="1.0"),c.oauth_timestamp||(c.oauth_timestamp=Math.floor(Date.now()/1e3).toString()),c.oauth_nonce||(c.oauth_nonce=o().replace(/-/g,"")),c.oauth_signature_method||(c.oauth_signature_method="HMAC-SHA1");var l=c.oauth_consumer_secret||c.oauth_private_key;delete c.oauth_consumer_secret,delete c.oauth_private_key;var h=c.oauth_token_secret;delete c.oauth_token_secret;var p=c.oauth_realm;delete c.oauth_realm,delete c.oauth_transport_method;var f=t.protocol+"//"+t.host+t.pathname,d=a.parse([].concat(n,i,a.stringify(c)).join("&"));return c.oauth_signature=s.sign(c.oauth_signature_method,r,f,d,l,h),p&&(c.realm=p),c},l.prototype.buildBodyHash=function(e,t){["HMAC-SHA1","RSA-SHA1"].indexOf(e.signature_method||"HMAC-SHA1")<0&&this.request.emit("error",new Error("oauth: "+e.signature_method+" signature_method not supported with body_hash signing."));var r=c.createHash("sha1");r.update(t||"");var n=r.digest("hex");return u.from(n,"hex").toString("base64")},l.prototype.concatParams=function(e,t,r){r=r||"";var n=Object.keys(e).filter((function(e){return"realm"!==e&&"oauth_signature"!==e})).sort();return e.realm&&n.splice(0,0,"realm"),n.push("oauth_signature"),n.map((function(t){return t+"="+r+s.rfc3986(e[t])+r})).join(t)},l.prototype.onRequest=function(e){this.params=e;var t,r,o=this.request.uri||{},s=this.request.method||"",c=a(this.request.headers),u=this.request.body||"",l=this.request.qsLib||i,h=c.get("content-type")||"",p="application/x-www-form-urlencoded",f=e.transport_method||"header";h.slice(0,p.length)===p&&(h=p,t=u),o.query&&(r=o.query),"body"!==f||"POST"===s&&h===p||this.request.emit("error",new Error("oauth: transport_method of body requires POST and content-type "+p)),t||"boolean"!=typeof e.body_hash||(e.body_hash=this.buildBodyHash(e,this.request.body.toString()));var d=this.buildParams(e,o,s,r,t,l);switch(f){case"header":this.request.setHeader("Authorization","OAuth "+this.concatParams(d,",",'"'));break;case"query":var m=this.request.uri.href+=(r?"&":"?")+this.concatParams(d,"&");this.request.uri=n.parse(m),this.request.path=this.request.uri.path;break;case"body":this.request.body=(t?t+"&":"")+this.concatParams(d,"&");break;default:this.request.emit("error",new Error("oauth: transport_method invalid"))}},t.OAuth=l},function(e,t,r){var n=r(11);function i(e,t,r){return n.createHmac(r,e).update(t).digest("base64")}function a(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function o(e,t){return e>t?1:e<t?-1:0}function s(e,t,r){var n=function(e){var t,r,n=[];for(t in e)if(r=e[t],Array.isArray(r))for(var i=0;i<r.length;i++)n.push([t,r[i]]);else if("object"==typeof r)for(var a in r)n.push([t+"["+a+"]",r[a]]);else n.push([t,r]);return n}(r).map((function(e){return[a(e[0]),a(e[1]||"")]})).sort((function(e,t){return o(e[0],t[0])||o(e[1],t[1])})).map((function(e){return e.join("=")})).join("&");return[a(e?e.toUpperCase():"GET"),a(t),a(n)].join("&")}function c(e,t,r,n,o){var c=s(e,t,r);return i([n||"",o||""].map(a).join("&"),c,"sha1")}function u(e,t,r,n,o){var c=s(e,t,r);return i([n||"",o||""].map(a).join("&"),c,"sha256")}function l(e,t,r,i,a){return function(e,t){return n.createSign("RSA-SHA1").update(t).sign(e,"base64")}(i||"",s(e,t,r))}function h(e,t){return[e||"",t||""].map(a).join("&")}t.hmacsign=c,t.hmacsign256=u,t.rsasign=l,t.plaintext=h,t.sign=function(e,t,r,n,i,a){var o,s=1;switch(e){case"RSA-SHA1":o=l;break;case"HMAC-SHA1":o=c;break;case"HMAC-SHA256":o=u;break;case"PLAINTEXT":o=h,s=4;break;default:throw new Error("Signature method not supported: "+e)}return o.apply(null,[].slice.call(arguments,s))},t.rfc3986=a,t.generateBase=s},function(e,t,r){"use strict";var n=r(11);t.calculateMac=function(e,t){var r="hawk.1.header\n"+t.ts+"\n"+t.nonce+"\n"+(t.method||"").toUpperCase()+"\n"+t.resource+"\n"+t.host.toLowerCase()+"\n"+t.port+"\n"+(t.hash||"")+"\n";return t.ext&&(r+=t.ext.replace("\\","\\\\").replace("\n","\\n")),r+="\n",t.app&&(r=r+t.app+"\n"+(t.dlg||"")+"\n"),n.createHmac(e.algorithm,e.key).update(r).digest("base64")},t.header=function(e,r,i){var a=i.timestamp||Math.floor((Date.now()+(i.localtimeOffsetMsec||0))/1e3),o=i.credentials;if(!(o&&o.id&&o.key&&o.algorithm))return"";if(-1===["sha1","sha256"].indexOf(o.algorithm))return"";var s,c,u,l,h,p,f={ts:a,nonce:i.nonce||(s=6,c=6*(s+1),n.randomBytes(Math.ceil(c/8)).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"").slice(0,s)),method:r,resource:e.pathname+(e.search||""),host:e.hostname,port:e.port||("http:"===e.protocol?80:443),hash:i.hash,ext:i.ext,app:i.app,dlg:i.dlg};f.hash||!i.payload&&""!==i.payload||(f.hash=(u=i.payload,l=o.algorithm,h=i.contentType,(p=n.createHash(l)).update("hawk.1.payload\n"),p.update((h?h.split(";")[0].trim().toLowerCase():"")+"\n"),p.update(u||""),p.update("\n"),p.digest("base64")));var d=t.calculateMac(o,f),m=null!==f.ext&&void 0!==f.ext&&""!==f.ext,g='Hawk id="'+o.id+'", ts="'+f.ts+'", nonce="'+f.nonce+(f.hash?'", hash="'+f.hash:"")+(m?'", ext="'+f.ext.replace(/\\/g,"\\\\").replace(/"/g,'\\"'):"")+'", mac="'+d+'"';return f.app&&(g=g+', app="'+f.app+(f.dlg?'", dlg="'+f.dlg:"")+'"'),g}},function(e,t,r){"use strict";var n=r(112),i=r(238),a=r(245),o=r(23).Buffer;function s(e){this.request=e,this.boundary=n(),this.chunked=!1,this.body=null}s.prototype.isChunked=function(e){var t=this,r=!1,n=e.data||e;return n.forEach||t.request.emit("error",new Error("Argument error, options.multipart.")),void 0!==e.chunked&&(r=e.chunked),"chunked"===t.request.getHeader("transfer-encoding")&&(r=!0),r||n.forEach((function(e){void 0===e.body&&t.request.emit("error",new Error("Body attribute missing in multipart.")),a(e.body)&&(r=!0)})),r},s.prototype.setHeaders=function(e){e&&!this.request.hasHeader("transfer-encoding")&&this.request.setHeader("transfer-encoding","chunked");var t=this.request.getHeader("content-type");t&&-1!==t.indexOf("multipart")?-1!==t.indexOf("boundary")?this.boundary=t.replace(/.*boundary=([^\s;]+).*/,"$1"):this.request.setHeader("content-type",t+"; boundary="+this.boundary):this.request.setHeader("content-type","multipart/related; boundary="+this.boundary)},s.prototype.build=function(e,t){var r=this,n=t?new i:[];function a(e){return"number"==typeof e&&(e=e.toString()),t?n.append(e):n.push(o.from(e))}return r.request.preambleCRLF&&a("\r\n"),e.forEach((function(e){var t="--"+r.boundary+"\r\n";Object.keys(e).forEach((function(r){"body"!==r&&(t+=r+": "+e[r]+"\r\n")})),a(t+="\r\n"),a(e.body),a("\r\n")})),a("--"+r.boundary+"--"),r.request.postambleCRLF&&a("\r\n"),n},s.prototype.onRequest=function(e){var t=this.isChunked(e),r=e.data||e;this.setHeaders(t),this.chunked=t,this.body=this.build(r,t)},t.Multipart=s},function(e,t,r){"use strict";var n=r(30),i=/^https?:/;function a(e){this.request=e,this.followRedirect=!0,this.followRedirects=!0,this.followAllRedirects=!1,this.followOriginalHttpMethod=!1,this.allowRedirect=function(){return!0},this.maxRedirects=10,this.redirects=[],this.redirectsFollowed=0,this.removeRefererHeader=!1}a.prototype.onRequest=function(e){void 0!==e.maxRedirects&&(this.maxRedirects=e.maxRedirects),"function"==typeof e.followRedirect&&(this.allowRedirect=e.followRedirect),void 0!==e.followRedirect&&(this.followRedirects=!!e.followRedirect),void 0!==e.followAllRedirects&&(this.followAllRedirects=e.followAllRedirects),(this.followRedirects||this.followAllRedirects)&&(this.redirects=this.redirects||[]),void 0!==e.removeRefererHeader&&(this.removeRefererHeader=e.removeRefererHeader),void 0!==e.followOriginalHttpMethod&&(this.followOriginalHttpMethod=e.followOriginalHttpMethod)},a.prototype.redirectTo=function(e){var t=this.request,r=null;if(e.statusCode>=300&&e.statusCode<400&&e.caseless.has("location")){var n=e.caseless.get("location");if(t.debug("redirect",n),this.followAllRedirects)r=n;else if(this.followRedirects)switch(t.method){case"PATCH":case"PUT":case"POST":case"DELETE":break;default:r=n}}else if(401===e.statusCode){var i=t._auth.onResponse(e);i&&(t.setHeader("authorization",i),r=t.uri)}return r},a.prototype.onResponse=function(e){var t=this.request,r=this.redirectTo(e);if(!r||!this.allowRedirect.call(t,e))return!1;if(t.debug("redirect to",r),e.resume&&e.resume(),this.redirectsFollowed>=this.maxRedirects)return t.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+t.uri.href)),!1;this.redirectsFollowed+=1,i.test(r)||(r=n.resolve(t.uri.href,r));var a=t.uri;return t.uri=n.parse(r),t.uri.protocol!==a.protocol&&delete t.agent,this.redirects.push({statusCode:e.statusCode,redirectUri:r}),this.followAllRedirects&&"HEAD"!==t.method&&401!==e.statusCode&&307!==e.statusCode&&(t.method=this.followOriginalHttpMethod?t.method:"GET"),delete t.src,delete t.req,delete t._started,401!==e.statusCode&&307!==e.statusCode&&(delete t.body,delete t._form,t.headers&&(t.removeHeader("host"),t.removeHeader("content-type"),t.removeHeader("content-length"),t.uri.hostname!==t.originalHost.split(":")[0]&&t.removeHeader("authorization"))),this.removeRefererHeader||t.setHeader("referer",a.href),t.emit("redirect"),t.init(),!0},t.Redirect=a},function(e,t,r){"use strict";var n=r(30),i=r(523),a=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],o=["proxy-authorization"];function s(e){this.request=e,this.proxyHeaderWhiteList=a,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}s.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},s.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=n.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,a,s,c,u=this.proxyHeaderExclusiveList.concat(o),l=this.proxyHeaderWhiteList.concat(u),h=function(e,t){var r=t.reduce((function(e,t){return e[t.toLowerCase()]=!0,e}),{});return Object.keys(e).filter((function(e){return r[e.toLowerCase()]})).reduce((function(t,r){return t[r]=e[r],t}),{})}(t.headers,l);h.host=(r=t.uri,a=r.port,s=r.protocol,c=r.hostname+":",c+=a||("https:"===s?"443":"80")),u.forEach(t.removeHeader,t);var p=function(e){var t=function(e,t){return["https:"===e.protocol?"https":"http","https:"===t.protocol?"Https":"Http"].join("Over")}(e.uri,e.proxy);return i[t]}(t),f=function(e,t){var r=e.proxy;return{proxy:{host:r.hostname,port:+r.port,proxyAuth:r.auth,headers:t},headers:e.headers,ca:e.ca,cert:e.cert,key:e.key,passphrase:e.passphrase,pfx:e.pfx,ciphers:e.ciphers,rejectUnauthorized:e.rejectUnauthorized,secureOptions:e.secureOptions,secureProtocol:e.secureProtocol}}(t,h);return t.agent=p(f),!0},s.defaultProxyHeaderWhiteList=a,s.defaultProxyHeaderExclusiveList=o,t.Tunnel=s},function(e,t,r){"use strict";r(98);var n,i=r(237),a=r(39),o=r(50),s=r(20),c=r(22),u=r(1),l=r(23).Buffer;function h(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||a.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",(function(e,r,n){for(var i=0,a=t.requests.length;i<a;++i){var o=t.requests[i];if(o.host===r&&o.port===n)return t.requests.splice(i,1),void o.request.onSocket(e)}e.destroy(),t.removeSocket(e)}))}function p(e,t){var r=this;h.prototype.createSocket.call(r,e,(function(n){var a=i.connect(0,f({},r.options,{servername:e.host,socket:n}));r.sockets[r.sockets.indexOf(n)]=a,t(a)}))}function f(e){for(var t=1,r=arguments.length;t<r;++t){var n=arguments[t];if("object"==typeof n)for(var i=Object.keys(n),a=0,o=i.length;a<o;++a){var s=i[a];void 0!==n[s]&&(e[s]=n[s])}}return e}t.httpOverHttp=function(e){var t=new h(e);return t.request=a.request,t},t.httpsOverHttp=function(e){var t=new h(e);return t.request=a.request,t.createSocket=p,t.defaultPort=443,t},t.httpOverHttps=function(e){var t=new h(e);return t.request=o.request,t},t.httpsOverHttps=function(e){var t=new h(e);return t.request=o.request,t.createSocket=p,t.defaultPort=443,t},u.inherits(h,s.EventEmitter),h.prototype.addRequest=function(e,t){var r=this;"string"==typeof t&&(t={host:t,port:arguments[2],path:arguments[3]}),r.sockets.length>=this.maxSockets?r.requests.push({host:t.host,port:t.port,request:e}):r.createConnection({host:t.host,port:t.port,request:e})},h.prototype.createConnection=function(e){var t=this;t.createSocket(e,(function(r){function n(){t.emit("free",r,e.host,e.port)}function i(e){t.removeSocket(r),r.removeListener("free",n),r.removeListener("close",i),r.removeListener("agentRemove",i)}r.on("free",n),r.on("close",i),r.on("agentRemove",i),e.request.onSocket(r)}))},h.prototype.createSocket=function(e,t){var r=this,i={};r.sockets.push(i);var a=f({},r.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1});a.proxyAuth&&(a.headers=a.headers||{},a.headers["Proxy-Authorization"]="Basic "+l.from(a.proxyAuth).toString("base64")),n("making CONNECT request");var o=r.request(a);function s(a,s,u){if(o.removeAllListeners(),s.removeAllListeners(),200===a.statusCode)c.equal(u.length,0),n("tunneling connection has established"),r.sockets[r.sockets.indexOf(i)]=s,t(s);else{n("tunneling socket could not be established, statusCode=%d",a.statusCode);var l=new Error("tunneling socket could not be established, statusCode="+a.statusCode);l.code="ECONNRESET",e.request.emit("error",l),r.removeSocket(i)}}o.useChunkedEncodingByDefault=!1,o.once("response",(function(e){e.upgrade=!0})),o.once("upgrade",(function(e,t,r){process.nextTick((function(){s(e,t,r)}))})),o.once("connect",s),o.once("error",(function(t){o.removeAllListeners(),n("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var a=new Error("tunneling socket could not be established, cause="+t.message);a.code="ECONNRESET",e.request.emit("error",a),r.removeSocket(i)})),o.end()},h.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},n=process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},t.debug=n},function(e,t){(function(){var t,r,n,i,a,o;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(e.exports=function(){return(t()-a)/1e6},r=process.hrtime,i=(t=function(){var e;return 1e9*(e=r())[0]+e[1]})(),o=1e9*process.uptime(),a=i-o):Date.now?(e.exports=function(){return Date.now()-n},n=Date.now()):(e.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(this)},function(e,t,r){var n=r(526);var i=/^(\w+\/)+/;function a(e){var t=(e=e.toLowerCase()).match(i);return t&&(t=t[1])?e.replace(i,t):e}e.exports=function(e){return{mimeType:a((t=e,t.substring(5,t.indexOf(";")))),data:n(e)};var t}},function(e,t){e.exports=function(e){if(!/^data\:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');var t=(e=e.replace(/\r?\n/g,"")).indexOf(",");if(-1===t||t<=4)throw new TypeError("malformed data: URI");for(var r=e.substring(5,t).split(";"),n=!1,i="US-ASCII",a=0;a<r.length;a++)"base64"==r[a]?n=!0:0==r[a].indexOf("charset=")&&(i=r[a].substring(8));var o=unescape(e.substring(t+1)),s=new Buffer(o,n?"base64":"ascii");return s.type=r[0]||"text/plain",s.charset=i,s}},function(e,t,r){"use strict";r.r(t),r.d(t,"I3SConverter",(function(){return $h})),r.d(t,"NodePages",(function(){return yl})),r.d(t,"Tiles3DConverter",(function(){return Rf})),r.d(t,"DepsInstaller",(function(){return Pf}));var n={};r.r(n),r.d(n,"filename",(function(){return Be})),r.d(n,"dirname",(function(){return Oe})),r.d(n,"join",(function(){return Re}));var i={};r.r(i),r.d(i,"readdir",(function(){return Me})),r.d(i,"stat",(function(){return Fe})),r.d(i,"readFile",(function(){return Le})),r.d(i,"readFileSync",(function(){return Ne})),r.d(i,"writeFile",(function(){return ze})),r.d(i,"writeFileSync",(function(){return Ue})),r.d(i,"open",(function(){return qe})),r.d(i,"close",(function(){return He})),r.d(i,"read",(function(){return Ge})),r.d(i,"fstat",(function(){return Ve})),r.d(i,"isSupported",(function(){return We})),r.d(i,"_readToArrayBuffer",(function(){return Ke}));var a={};r.r(a),r.d(a,"name",(function(){return Dc})),r.d(a,"preprocess",(function(){return Mc})),r.d(a,"decode",(function(){return Fc}));var o={};r.r(o),r.d(o,"name",(function(){return qc})),r.d(o,"preprocess",(function(){return Hc}));var s={};r.r(s),r.d(s,"name",(function(){return Gc})),r.d(s,"preprocess",(function(){return Vc}));var c={};r.r(c),r.d(c,"name",(function(){return Kc})),r.d(c,"preprocess",(function(){return Jc})),r.d(c,"decode",(function(){return Qc})),r.d(c,"encode",(function(){return Yc}));var u={};r.r(u),r.d(u,"name",(function(){return eu})),r.d(u,"decode",(function(){return tu})),r.d(u,"encode",(function(){return ru}));var l={};r.r(l),r.d(l,"name",(function(){return nu})),r.d(l,"decode",(function(){return iu})),r.d(l,"encode",(function(){return au}));var h={};r.r(h),r.d(h,"name",(function(){return ou})),r.d(h,"decode",(function(){return su})),r.d(h,"encode",(function(){return cu}));var p=r(0);const f=e=>"boolean"==typeof e,d=e=>"function"==typeof e,m=e=>null!==e&&"object"==typeof e,g=e=>m(e)&&e.constructor==={}.constructor,b=e=>e&&"function"==typeof e[Symbol.iterator],y=e=>e&&"function"==typeof e[Symbol.asyncIterator],v=e=>"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json,w=e=>"undefined"!=typeof Blob&&e instanceof Blob,_=e=>(e=>"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||m(e)&&d(e.tee)&&d(e.cancel)&&d(e.getReader))(e)||(e=>m(e)&&d(e.read)&&d(e.pipe)&&f(e.readable))(e);function k(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function x(e){var t;if(!e)return!1;Array.isArray(e)&&(e=e[0]);return Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions)}function E(e){var t,r;let n;return k(e,"null loader"),k(x(e),"invalid loader"),Array.isArray(e)&&(n=e[1],e=e[0],e={...e,options:{...e.options,...n}}),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(r=e)&&void 0!==r&&r.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}let A="";const S={};function j(e){for(const t in S)if(e.startsWith(t)){const r=S[t];e=e.replace(t,r)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(A).concat(e)),e}const T=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,C=/^([-\w.]+\/[-\w.+]+)/;function B(e){const t=C.exec(e);return t?t[1]:e}function O(e){const t=T.exec(e);return t?t[1]:""}const R=/\?.*/;function I(e){if(v(e)){const t=P(e.url||"");return{url:t,type:B(e.headers.get("content-type")||"")||O(t)}}return w(e)?{url:P(e.name||""),type:e.type||""}:"string"==typeof e?{url:P(e),type:O(e)}:{url:"",type:""}}function P(e){return e.replace(R,"")}async function D(e){if(v(e))return e;const t={},r=function(e){return v(e)?e.headers["content-length"]||-1:w(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}(e);r>=0&&(t["content-length"]=String(r));const{url:n,type:i}=I(e);i&&(t["content-type"]=i);const a=await async function(e){if("string"==typeof e)return"data:,".concat(e.slice(0,5));if(e instanceof Blob){const t=e.slice(0,5);return await new Promise(e=>{const r=new FileReader;r.onload=t=>{var r;return e(null==t||null===(r=t.target)||void 0===r?void 0:r.result)},r.readAsDataURL(t)})}if(e instanceof ArrayBuffer){const t=function(e){let t="";const r=new Uint8Array(e);for(let e=0;e<r.byteLength;e++)t+=String.fromCharCode(r[e]);return btoa(t)}(e.slice(0,5));return"data:base64,".concat(t)}return null}(e);a&&(t["x-first-bytes"]=a),"string"==typeof e&&(e=(new TextEncoder).encode(e));const o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function M(e){if(!e.ok){const t=await async function(e){let t="Failed to fetch resource ".concat(e.url," (").concat(e.status,"): ");try{const r=e.headers.get("Content-Type");let n=e.statusText;r.includes("application/json")&&(n+=" ".concat(await e.text())),t+=n,t=t.length>60?"".concat(t.slice(60),"..."):t}catch(e){}return t}(e);throw new Error(t)}}async function F(e,t){if("string"==typeof e){e=j(e);let r=t;return null!=t&&t.fetch&&"function"!=typeof(null==t?void 0:t.fetch)&&(r=t.fetch),await fetch(e,r)}return await D(e)}const L=new(r(535).a)({id:"loaders.gl"});class N{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const z={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Object(p.a)(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},U={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function q(){globalThis.loaders=globalThis.loaders||{};const{loaders:e}=globalThis;return e._state=e._state||{},e._state}const H=()=>{const e=q();return e.globalOptions=e.globalOptions||{...z},e.globalOptions};function G(e,t,r,n){return r=r||[],function(e,t){W(e,null,z,U,t);for(const r of t){const n=e&&e[r.id]||{},i=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};W(n,r.id,i,a,t)}}(e,r=Array.isArray(r)?r:[r]),J(t,e,n)}function V(e,t){const r=H(),n=e||r;return"function"==typeof n.fetch?n.fetch:m(n.fetch)?e=>F(e,n):null!=t&&t.fetch?null==t?void 0:t.fetch:F}function W(e,t,r,n,i){const a=t||"Top level",o=t?"".concat(t,"."):"";for(const s in e){const c=!t&&m(e[s]),u="baseUri"===s&&!t,l="workerUrl"===s&&t;if(!(s in r)&&!u&&!l)if(s in n)L.warn("".concat(a," loader option '").concat(o).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!c){const e=K(s,i);L.warn("".concat(a," loader option '").concat(o).concat(s,"' not recognized. ").concat(e))()}}}function K(e,t){const r=e.toLowerCase();let n="";for(const i of t)for(const t in i.options){if(e===t)return"Did you mean '".concat(i.id,".").concat(t,"'?");const a=t.toLowerCase();(r.startsWith(a)||a.startsWith(r))&&(n=n||"Did you mean '".concat(i.id,".").concat(t,"'?"))}return n}function J(e,t,r){const n={...e.options||{}};return function(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}(n,r),null===n.log&&(n.log=new N),Q(n,H()),Q(n,t),n}function Q(e,t){for(const r in t)if(r in t){const n=t[r];g(n)&&g(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function Y(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}const X={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Z=X.global||X.self||X.window||{},$="object"!=typeof process||"[object process]"!==String(process)||process.browser,ee="function"==typeof importScripts,te="undefined"!=typeof window&&void 0!==window.orientation,re="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),ne=(re&&parseFloat(re[1]),new Map);function ie(e){Y(e.source&&!e.url||!e.source&&e.url);let t=ne.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return ae((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),ne.set(e.url,t)),e.source&&(t=ae(e.source),ne.set(e.source,t))),Y(t),t}function ae(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function oe(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}const se=()=>{};class ce{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Object(p.a)(this,"name",void 0),Object(p.a)(this,"source",void 0),Object(p.a)(this,"url",void 0),Object(p.a)(this,"terminated",!1),Object(p.a)(this,"worker",void 0),Object(p.a)(this,"onMessage",void 0),Object(p.a)(this,"onError",void 0),Object(p.a)(this,"_loadableURL","");const{name:t,source:r,url:n}=e;Y(r||n),this.name=t,this.source=r,this.url=n,this.onMessage=se,this.onError=e=>console.log(e),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=se,this.onError=se,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||function e(t,r=!0,n){const i=n||new Set;if(t){if(oe(t))i.add(t);else if(oe(t.buffer))i.add(t.buffer);else if(ArrayBuffer.isView(t));else if(r&&"object"==typeof t)for(const n in t)e(t[n],r,i)}else;return void 0===n?Array.from(i):[]}(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}_createBrowserWorker(){this._loadableURL=ie({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=e=>{e.data?this.onMessage(e.data):this.onError(new Error("No data received"))},e.onerror=e=>{this.onError(this._getErrorFromErrorEvent(e)),this.terminated=!0},e.onmessageerror=e=>console.error(e),e}}class ue{constructor(e,t){Object(p.a)(this,"name",void 0),Object(p.a)(this,"workerThread",void 0),Object(p.a)(this,"isRunning",void 0),Object(p.a)(this,"result",void 0),Object(p.a)(this,"_resolve",void 0),Object(p.a)(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((e,t)=>{this._resolve=e,this._reject=t})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Y(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Y(this.isRunning),this.isRunning=!1,this._reject(e)}}class le{constructor(e){Object(p.a)(this,"name","unnamed"),Object(p.a)(this,"source",void 0),Object(p.a)(this,"url",void 0),Object(p.a)(this,"maxConcurrency",1),Object(p.a)(this,"maxMobileConcurrency",1),Object(p.a)(this,"onDebug",()=>{}),Object(p.a)(this,"reuseWorkers",!0),Object(p.a)(this,"props",{}),Object(p.a)(this,"jobQueue",[]),Object(p.a)(this,"idleQueue",[]),Object(p.a)(this,"count",0),Object(p.a)(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}async startJob(e,t=((e,t,r)=>e.done(r)),r=((e,t)=>e.error(t))){const n=new Promise(n=>(this.jobQueue.push({name:e,onMessage:t,onError:r,onStart:n}),this));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const r=new ue(t.name,e);e.onMessage=e=>t.onMessage(r,e.type,e.payload),e.onError=e=>t.onError(r,e),t.onStart(r);try{await r.result}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new ce({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return te?this.maxMobileConcurrency:this.maxConcurrency}}const he={maxConcurrency:3,maxMobileConcurrency:1,onDebug:()=>{},reuseWorkers:!0};class pe{static isSupported(){return ce.isSupported()}static getWorkerFarm(e={}){return pe._workerFarm=pe._workerFarm||new pe({}),pe._workerFarm.setProps(e),pe._workerFarm}constructor(e){Object(p.a)(this,"props",void 0),Object(p.a)(this,"workerPools",new Map),this.props={...he},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props={...this.props,...e};for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:r,url:n}=e;let i=this.workerPools.get(t);return i||(i=new le({name:t,source:r,url:n}),i.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,i)),i}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}Object(p.a)(pe,"_workerFarm",void 0);async function fe(e,t,r,n,i){const a=e.id,o=function(e,t={}){const r=t[e.id]||{},n="".concat(e.id,"-worker.js");let i=r.workerUrl;if(i||"compression"!==e.id||(i=t.workerUrl),"test"===t._workerType&&(i="modules/".concat(e.module,"/dist/").concat(n)),!i){let t=e.version;"latest"===t&&(t="latest");const r=t?"@".concat(t):"";i="https://unpkg.com/@loaders.gl/".concat(e.module).concat(r,"/dist/").concat(n)}return Y(i),i}(e,r),s=pe.getWorkerFarm(r).getWorkerPool({name:a,url:o});r=JSON.parse(JSON.stringify(r));const c=await s.startJob("process-on-worker",de.bind(null,i));c.postMessage("process",{input:t,options:r});const u=await c.result;return await u.result}async function de(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":const{id:i,input:a,options:o}=n;try{const r=await e(a,o);t.postMessage("done",{id:i,result:r})}catch(e){const r=e instanceof Error?e.message:"unknown error";t.postMessage("error",{id:i,error:r})}break;default:console.warn("parse-with-worker unknown message ".concat(r))}}function me(e){if(ArrayBuffer.isView(e)&&(e=e.buffer),"undefined"!=typeof Buffer&&e instanceof ArrayBuffer){const t=new Buffer(e.byteLength),r=new Uint8Array(e);for(let e=0;e<t.length;++e)t[e]=r[e];return t}return k(!1)}function ge(e){return e&&"object"==typeof e&&e.isBuffer}function be(e){return me?me(e):e}function ye(e){if(ge(e))return function(e){if(ge(e)){return new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer}return e}(e);if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("string"==typeof e){const t=e;return(new TextEncoder).encode(t).buffer}if(e&&"object"==typeof e&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function ve(...e){const t=e.map(e=>e instanceof ArrayBuffer?new Uint8Array(e):e),r=t.reduce((e,t)=>e+t.byteLength,0),n=new Uint8Array(r);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n.buffer}function we(...e){const t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');const n=new r(t.reduce((e,t)=>e+t.length,0));let i=0;for(const e of t)n.set(e,i),i+=e.length;return n}function _e(e,t,r){const n=void 0!==r?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}async function ke(e){const t=[];for await(const r of e)t.push(r);return ve(...t)}const xe=262144;"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof global&&global,"undefined"!=typeof document&&document;const Ee=Boolean("object"!=typeof process||"[object process]"!==String(process)||process.browser),Ae="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);Ae&&parseFloat(Ae[1]);function Se(e,t){return Ee?async function*(e,t){const r=e.getReader();let n;try{for(;;){const e=n||r.read();null!=t&&t._streamReadAhead&&(n=r.read());const{done:i,value:a}=await e;if(i)return;yield ye(a)}}catch(e){r.releaseLock()}}(e,t):async function*(e,t){for await(const t of e)yield ye(t)}(e)}function je(e,t){if("string"==typeof e)return function*(e,t){const r=(null==t?void 0:t.chunkSize)||262144;let n=0;const i=new TextEncoder;for(;n<e.length;){const t=Math.min(e.length-n,r),a=e.slice(n,n+t);n+=t,yield i.encode(a)}}(e,t);if(e instanceof ArrayBuffer)return function*(e,t={}){const{chunkSize:r=xe}=t;let n=0;for(;n<e.byteLength;){const t=Math.min(e.byteLength-n,r),i=new ArrayBuffer(t),a=new Uint8Array(e,n,t);new Uint8Array(i).set(a),n+=t,yield i}}(e,t);if(w(e))return async function*(e,t){const r=(null==t?void 0:t.chunkSize)||1048576;let n=0;for(;n<e.size;){const t=n+r,i=await e.slice(n,t).arrayBuffer();n=t,yield i}}(e,t);if(_(e))return Se(e,t);if(v(e)){return Se(e.body,t)}throw new Error("makeIterator")}const Te="Cannot convert supplied data type";async function Ce(e,t,r){const n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if("string"==typeof e||n)return function(e,t,r){if(t.text&&"string"==typeof e)return e;var n;if((n=e)&&"object"==typeof n&&n.isBuffer&&(e=e.buffer),e instanceof ArrayBuffer){const r=e;if(t.text&&!t.binary){return new TextDecoder("utf8").decode(r)}return r}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary){return new TextDecoder("utf8").decode(e)}let r=e.buffer;const n=e.byteLength||e.length;return 0===e.byteOffset&&n===r.byteLength||(r=r.slice(e.byteOffset,e.byteOffset+n)),r}throw new Error(Te)}(e,t);if(w(e)&&(e=await D(e)),v(e)){const r=e;return await M(r),t.binary?await r.arrayBuffer():await r.text()}if(_(e)&&(e=je(e,r)),b(e)||y(e))return ke(e);throw new Error(Te)}function Be(e){const t=e&&e.lastIndexOf("/");return t>=0?e.substr(t+1):""}function Oe(e){const t=e&&e.lastIndexOf("/");return t>=0?e.substr(0,t):""}function Re(...e){return(e=e.map((t,r)=>(r&&(t=t.replace(new RegExp("^".concat("/")),"")),r!==e.length-1&&(t=t.replace(new RegExp("".concat("/","$")),"")),t))).join("/")}var Ie=r(3),Pe=r.n(Ie);const De=r(1).promisify;let Me,Fe,Le,Ne,ze,Ue,qe,He,Ge,Ve,We=Boolean(Pe.a);try{Me=De(Pe.a.readdir),Fe=De(Pe.a.stat),Le=De(Pe.a.readFile),Ne=Pe.a.readFileSync,ze=De(Pe.a.writeFile),Ue=Pe.a.writeFileSync,qe=De(Pe.a.open),He=De(Pe.a.close),Ge=De(Pe.a.read),Ve=De(Pe.a.fstat),We=Boolean(Pe.a)}catch{}async function Ke(e,t,r){const n=Buffer.alloc(r),{bytesRead:i}=await Ge(e,n,0,r,t);if(i!==r)throw new Error("fs.read failed");return function(e){if(Buffer.isBuffer(e)){return new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer}return e}(n)}function Je(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const t="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}const Qe="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source";Je();class Ye{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(p.a)(this,"storage",void 0),Object(p.a)(this,"id",void 0),Object(p.a)(this,"config",{}),this.storage=function(e){try{const t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}(r),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function Xe(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600;const i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));const a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}let Ze;function $e(e){return"string"==typeof e?Ze[e.toUpperCase()]||Ze.WHITE:e}function et(e,t){if(!e)throw new Error(t||"Assertion failed")}!function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(Ze||(Ze={}));const tt={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},rt=(globalThis,tt.window||tt.self||tt.global),nt=tt.process||{};console;function it(){let e;var t,r;if(Je&&"performance"in rt)e=null==rt||null===(t=rt.performance)||void 0===t||null===(r=t.now)||void 0===r?void 0:r.call(t);else if("hrtime"in nt){var n;const t=null==nt||null===(n=nt.hrtime)||void 0===n?void 0:n.call(nt);e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}const at={debug:Je&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},ot={enabled:!0,level:0};function st(){}const ct={},ut={once:!0};class lt{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};Object(p.a)(this,"id",void 0),Object(p.a)(this,"VERSION",Qe),Object(p.a)(this,"_startTs",it()),Object(p.a)(this,"_deltaTs",it()),Object(p.a)(this,"_storage",void 0),Object(p.a)(this,"userData",{}),Object(p.a)(this,"LOG_THROTTLE_TIMEOUT",0),this.id=e,this._storage=new Ye("__probe-".concat(this.id,"__"),ot),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r);for(const r of n)"function"==typeof e[r]&&(t.find(e=>r===e)||(e[r]=e[r].bind(e)))}(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((it()-this._startTs).toPrecision(10))}getDelta(){return Number((it()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}setLevel(e){return this._storage.updateConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.updateConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){et(e,t)}warn(e){return this._getLogFunction(0,e,at.warn,arguments,ut)}error(e){return this._getLogFunction(0,e,at.error,arguments)}deprecated(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}probe(e,t){return this._getLogFunction(e,t,at.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,at.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return this._getLogFunction(e,t,at.debug||at.info,arguments,ut)}table(e,t,r){return t?this._getLogFunction(e,t,console.table||st,r&&[r],{tag:ft(t)}):st}image(e){let{logLevel:t,priority:n,image:i,message:a="",scale:o=1}=e;return this._shouldLog(t||n)?Je?function(e){let{image:t,message:r="",scale:n=1}=e;if("string"==typeof t){const e=new Image;return e.onload=()=>{const t=Xe(e,r,n);console.log(...t)},e.src=t,st}const i=t.nodeName||"";if("img"===i.toLowerCase())return console.log(...Xe(t,r,n)),st;if("canvas"===i.toLowerCase()){const e=new Image;return e.onload=()=>console.log(...Xe(e,r,n)),e.src=t.toDataURL(),st}return st}({image:i,message:a,scale:o}):function(e){let{image:t,message:n="",scale:i=1}=e,a=null;try{a=r(!function(){var e=new Error("Cannot find module 'asciify-image'");throw e.code="MODULE_NOT_FOUND",e}())}catch(e){}if(a)return()=>a(t,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then(e=>console.log(e));return st}({image:i,message:a,scale:o}):st}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||st)}group(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const n=pt({logLevel:e,message:t,opts:r}),{collapsed:i}=r;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||st)}withGroup(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=ht(e)}_getLogFunction(e,t,r,n,i){if(this._shouldLog(e)){i=pt({logLevel:e,message:t,args:n,opts:i}),et(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=it();const a=i.tag||i.message;if(i.once){if(ct[a])return st;ct[a]=it()}return t=function(e,t,r){if("string"==typeof t){const o=r.time?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}(function(e){let t;return t=e<10?"".concat(e.toFixed(2),"ms"):e<100?"".concat(e.toFixed(1),"ms"):e<1e3?"".concat(e.toFixed(0),"ms"):"".concat((e/1e3).toFixed(2),"s"),t}(r.total)):"";t=r.time?"".concat(e,": ").concat(o," ").concat(t):"".concat(e,": ").concat(t),n=t,i=r.color,a=r.background,Je||"string"!=typeof n||(i&&(i=$e(i),n="[".concat(i,"m").concat(n,"")),a&&(i=$e(a),n="[".concat(a+10,"m").concat(n,""))),t=n}var n,i,a;return t}(this.id,i.message,i),r.bind(console,t,...i.args)}return st}}function ht(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return et(Number.isFinite(t)&&t>=0),t}function pt(e){const{logLevel:t,message:r}=e;e.logLevel=ht(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());const i=typeof e.message;return et("string"===i||"object"===i),Object.assign(e,{args:n},e.opts)}function ft(e){for(const t in e)for(const r in e[t])return r||"untitled";return"empty"}Object(p.a)(lt,"VERSION",Qe);const dt=new lt({id:"loaders.gl"}),mt=()=>{const e=q();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};const gt=/\.([^.]+)$/;function bt(e,t=[],r,n){if(!yt(e))return null;if(t&&!Array.isArray(t))return E(t);let i=[];t&&(i=i.concat(t)),null!=r&&r.ignoreRegisteredLoaders||i.push(...mt()),function(e){for(const t of e)E(t)}(i);const a=function(e,t,r,n){const{url:i,type:a}=I(e),o=i||(null==n?void 0:n.url);let s=null,c="";null!=r&&r.mimeType&&(s=wt(t,null==r?void 0:r.mimeType),c="match forced by supplied MIME type ".concat(null==r?void 0:r.mimeType));var u;s=s||function(e,t){const r=t&&gt.exec(t),n=r&&r[1];return n?function(e,t){t=t.toLowerCase();for(const r of e)for(const e of r.extensions)if(e.toLowerCase()===t)return r;return null}(e,n):null}(t,o),c=c||(s?"matched url ".concat(o):""),s=s||wt(t,a),c=c||(s?"matched MIME type ".concat(a):""),s=s||function(e,t){if(!t)return null;for(const r of e)if("string"==typeof t){if(_t(t,r))return r}else if(ArrayBuffer.isView(t)){if(kt(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer){if(kt(t,0,r))return r}return null}(t,e),c=c||(s?"matched initial data ".concat(xt(e)):""),s=s||wt(t,null==r?void 0:r.fallbackMimeType),c=c||(s?"matched fallback MIME type ".concat(a):""),c&&dt.log(1,"selectLoader selected ".concat(null===(u=s)||void 0===u?void 0:u.name,": ").concat(c,"."));return s}(e,i,r,n);if(!(a||null!=r&&r.nothrow))throw new Error(vt(e));return a}function yt(e){return!(e instanceof Response&&204===e.status)}function vt(e){const{url:t,type:r}=I(e);let i="No valid loader found (";i+=t?"".concat(n.filename(t),", "):"no url provided, ",i+="MIME type: ".concat(r?'"'.concat(r,'"'):"not provided",", ");const a=e?xt(e):"";return i+=a?' first bytes: "'.concat(a,'"'):"first bytes: not available",i+=")",i}function wt(e,t){for(const r of e){if(r.mimeTypes&&r.mimeTypes.includes(t))return r;if(t==="application/x.".concat(r.id))return r}return null}function _t(e,t){if(t.testText)return t.testText(e);return(Array.isArray(t.tests)?t.tests:[t.tests]).some(t=>e.startsWith(t))}function kt(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(n=>function(e,t,r,n){if(n instanceof ArrayBuffer)return function(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;const n=new Uint8Array(e),i=new Uint8Array(t);for(let e=0;e<n.length;++e)if(n[e]!==i[e])return!1;return!0}(n,e,n.byteLength);switch(typeof n){case"function":return n(e,r);case"string":const i=Et(e,t,n.length);return n===i;default:return!1}}(e,t,r,n))}function xt(e,t=5){if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return Et(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){return Et(e,0,t)}return""}function Et(e,t,r){if(e.byteLength<t+r)return"";const n=new DataView(e);let i="";for(let e=0;e<r;e++)i+=String.fromCharCode(n.getUint8(t+e));return i}async function At(e,t,r,n){Y(!n||"object"==typeof n),!t||Array.isArray(t)||x(t)||(n=void 0,r=t,t=void 0),e=await e,r=r||{};const{url:i}=I(e),a=function(e,t){if(!t&&e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){const e=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...e]:e}return r&&r.length?r:null}(t,n),o=await async function(e,t=[],r,n){if(!yt(e))return null;let i=bt(e,t,{...r,nothrow:!0},n);if(i)return i;if(w(e)&&(i=bt(e=await e.slice(0,10).arrayBuffer(),t,r,n)),!(i||null!=r&&r.nothrow))throw new Error(vt(e));return i}(e,a,r);return o?(n=function(e,t,r=null){if(r)return r;const n={fetch:V(t,e),...e};return Array.isArray(n.loaders)||(n.loaders=null),n}({url:i,parse:At,loaders:a},r=G(r,o,a,i),n),await async function(e,t,r,n){if(function(e,t="3.1.8"){Y(e,"no worker provided");const r=e.version}(e),t=await Ce(t,e,r),e.parseTextSync&&"string"==typeof t)return r.dataType="text",e.parseTextSync(t,r,n,e);if(function(e,t){return!!pe.isSupported()&&(e.worker&&(null==t?void 0:t.worker))}(e,r))return await fe(e,t,r,0,At);if(e.parseText&&"string"==typeof t)return await e.parseText(t,r,n,e);if(e.parse)return await e.parse(t,r,n,e);throw Y(!e.parseSync),new Error("".concat(e.id," loader - no parser found and worker is disabled"))}(o,e,r,n)):null}async function St(e,t,r,n){Array.isArray(t)||x(t)||(void 0,r=t,t=void 0);const i=V(r);let a=e;return"string"==typeof e&&(a=await i(e)),w(e)&&(a=await i(e)),await At(a,t,r)}async function jt(e,t,r){if(t.encode)return await t.encode(e,r);if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeText)return(new TextEncoder).encode(await t.encodeText(e,r));if(t.encodeInBatches){const n=function(e,t,r){if(t.encodeInBatches){const n=function(e){return[{table:e,start:0,end:e.length}]}(e);return t.encodeInBatches(n,r)}throw new Error("Writer could not encode data in batches")}(e,t,r),i=[];for await(const e of n)i.push(e);return ve(...i)}if(!Ee&&t.encodeURLtoURL){const n=Ct("input");await async function(e,t,r){e=j(e),Ee||await i.writeFile(e,be(t),{flag:"w"}),k(!1)}(n,e);const a=Ct("output"),o=await async function(e,t,r,n){if(e=j(e),t=j(t),Ee||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,n)}(n,a,t,r);return(await F(o)).arrayBuffer()}throw new Error("Writer could not encode data")}function Tt(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);throw new Error("Writer could not synchronously encode data")}function Ct(e){return"/tmp/".concat(e)}function Bt(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}const Ot=1/Math.PI*180,Rt=1/180*Math.PI,It={};function Pt(e,{precision:t=It.precision||4}={}){return e=function(e){return Math.round(e/It.EPSILON)*It.EPSILON}(e),"".concat(parseFloat(e.toPrecision(t)))}function Dt(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Mt(e,t,r){if(Dt(e)){r=r||((n=e).clone?n.clone():new Array(n.length));for(let n=0;n<r.length&&n<e.length;++n)r[n]=t(e[n],n,r);return r}var n;return t(e)}function Ft(e){return function(e,t){return Mt(e,e=>e*Rt,t)}(e)}function Lt(e){return Nt(e)}function Nt(e,t){return Mt(e,e=>e*Ot,t)}function zt(e,t,r){return Mt(e,e=>Math.max(t,Math.min(r,e)))}function Ut(e,t,r){const n=It.EPSILON;r&&(It.EPSILON=r);try{if(e===t)return!0;if(Dt(e)&&Dt(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!Ut(e[r],t[r]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):!(!Number.isFinite(e)||!Number.isFinite(t))&&Math.abs(e-t)<=It.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{It.EPSILON=n}}function qt(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function Ht(e,t,r=""){if(It.debug&&!function(e,t){if(e.length!==t)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}It.EPSILON=1e-12,It.debug=!1,It.precision=4,It.printTypes=!1,It.printDegrees=!1,It.printRowMajor=!0;const Gt={};function Vt(e,t){Gt[e]||(Gt[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}class Wt extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array)){get ELEMENTS(){return Bt(!1),0}clone(){return(new this.constructor).copy(this)}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}fromArray(e,t=0){for(let r=0;r<this.ELEMENTS;++r)this[r]=e[r+t];return this.check()}to(e){return e===this?this:Dt(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toArray(e=[],t=0){for(let r=0;r<this.ELEMENTS;++r)e[t+r]=this[r];return e}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(It)}formatString(e){let t="";for(let r=0;r<this.ELEMENTS;++r)t+=(r>0?", ":"")+Pt(this[r],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!Ut(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,r){void 0===r&&(r=t,t=e,e=this);for(let n=0;n<this.ELEMENTS;++n){const i=e[n];this[n]=i+r*(t[n]-i)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e[r]),t[r]);return this.check()}add(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]+=t[e];return this.check()}subtract(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]-=t[e];return this.check()}scale(e){if(Array.isArray(e))return this.multiply(e);for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}sub(e){return this.subtract(e)}setScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}addScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}divideScalar(e){return this.scale(1/e)}clampScalar(e,t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e),t);return this.check()}multiplyByScalar(e){return this.scale(e)}get elements(){return this}check(){if(It.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}}class Kt extends Wt{get ELEMENTS(){return Bt(!1),0}get RANK(){return Bt(!1),0}toString(){let e="[";if(It.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let r=0;r<this.RANK;++r)e+=" ".concat(this[r*this.RANK+t])}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=" ".concat(this[t])}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,r){return this[t*this.RANK+e]=qt(r),this}getColumn(e,t=new Array(this.RANK).fill(-0)){const r=e*this.RANK;for(let e=0;e<this.RANK;++e)t[e]=this[r+e];return t}setColumn(e,t){const r=e*this.RANK;for(let e=0;e<this.RANK;++e)this[r+e]=t[e];return this}}function Jt(e,t,r){const n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}function Qt(e,t,r){const n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}function Yt(e,t,r){const n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*a,e[1]=r[1]*n+r[4]*i+r[7]*a,e[2]=r[2]*n+r[5]*i+r[8]*a,e[3]=t[3],e}var Xt=1e-6,Zt="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function $t(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],u=t[6],l=t[7],h=t[8],p=t[9],f=t[10],d=t[11],m=t[12],g=t[13],b=t[14],y=t[15],v=r[0],w=r[1],_=r[2],k=r[3];return e[0]=v*n+w*s+_*h+k*m,e[1]=v*i+w*c+_*p+k*g,e[2]=v*a+w*u+_*f+k*b,e[3]=v*o+w*l+_*d+k*y,v=r[4],w=r[5],_=r[6],k=r[7],e[4]=v*n+w*s+_*h+k*m,e[5]=v*i+w*c+_*p+k*g,e[6]=v*a+w*u+_*f+k*b,e[7]=v*o+w*l+_*d+k*y,v=r[8],w=r[9],_=r[10],k=r[11],e[8]=v*n+w*s+_*h+k*m,e[9]=v*i+w*c+_*p+k*g,e[10]=v*a+w*u+_*f+k*b,e[11]=v*o+w*l+_*d+k*y,v=r[12],w=r[13],_=r[14],k=r[15],e[12]=v*n+w*s+_*h+k*m,e[13]=v*i+w*c+_*p+k*g,e[14]=v*a+w*u+_*f+k*b,e[15]=v*o+w*l+_*d+k*y,e}function er(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function tr(e,t){var r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],c=t[8],u=t[9],l=t[10];return e[0]=Math.hypot(r,n,i),e[1]=Math.hypot(a,o,s),e[2]=Math.hypot(c,u,l),e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function rr(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function nr(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var ir,ar;ir=new Zt(2),Zt!=Float32Array&&(ir[0]=0,ir[1]=0),ar=ir;function or(){var e=new Zt(3);return Zt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function sr(e){var t=e[0],r=e[1],n=e[2];return Math.hypot(t,r,n)}function cr(e,t,r){var n=new Zt(3);return n[0]=e,n[1]=t,n[2]=r,n}function ur(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function lr(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],c=r[2];return e[0]=i*c-a*s,e[1]=a*o-n*c,e[2]=n*s-i*o,e}function hr(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}function pr(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}function fr(e,t,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],c=t[1],u=t[2],l=i*u-a*c,h=a*s-n*u,p=n*c-i*s,f=i*p-a*h,d=a*l-n*p,m=n*h-i*l,g=2*o;return l*=g,h*=g,p*=g,f*=2,d*=2,m*=2,e[0]=s+l+f,e[1]=c+h+d,e[2]=u+p+m,e}var dr=sr;!function(){var e=or()}();function mr(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.hypot(t,r,n,i)}function gr(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}!function(){var e=function(){var e=new Zt(4);return Zt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}()}();const br=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),yr=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),vr=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),wr={};class _r extends Kt{static get IDENTITY(){return wr.IDENTITY=wr.IDENTITY||Object.freeze(new _r(br)),wr.IDENTITY}static get ZERO(){return wr.ZERO=wr.ZERO||Object.freeze(new _r(yr)),wr.ZERO}get INDICES(){return vr}get ELEMENTS(){return 16}get RANK(){return 4}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,r,n,i,a,o,s,c,u,l,h,p,f,d,m){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=c,this[9]=u,this[10]=l,this[11]=h,this[12]=p,this[13]=f,this[14]=d,this[15]=m,this.check()}setRowMajor(e,t,r,n,i,a,o,s,c,u,l,h,p,f,d,m){return this[0]=e,this[1]=i,this[2]=c,this[3]=p,this[4]=t,this[5]=a,this[6]=u,this[7]=f,this[8]=r,this[9]=o,this[10]=l,this[11]=d,this[12]=n,this[13]=s,this[14]=h,this[15]=m,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(br)}fromQuaternion(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,c=i+i,u=r*o,l=n*o,h=n*s,p=i*o,f=i*s,d=i*c,m=a*o,g=a*s,b=a*c;e[0]=1-h-d,e[1]=l+b,e[2]=p-g,e[3]=0,e[4]=l-b,e[5]=1-u-d,e[6]=f+m,e[7]=0,e[8]=p+g,e[9]=f-m,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(this,e),this.check()}frustum({left:e,right:t,bottom:r,top:n,near:i,far:a}){return a===1/0?_r._computeInfinitePerspectiveOffCenter(this,e,t,r,n,i):function(e,t,r,n,i,a,o){var s=1/(r-t),c=1/(i-n),u=1/(a-o);e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*c,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*c,e[10]=(o+a)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*u,e[15]=0}(this,e,t,r,n,i,a),this.check()}static _computeInfinitePerspectiveOffCenter(e,t,r,n,i,a){const o=2*a/(r-t),s=2*a/(i-n),c=(r+t)/(r-t),u=(i+n)/(i-n),l=-2*a;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=c,e[9]=u,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=l,e[15]=0,e}lookAt(e,t,r){return 1===arguments.length&&({eye:e,center:t,up:r}=e),function(e,t,r,n){var i,a,o,s,c,u,l,h,p,f,d=t[0],m=t[1],g=t[2],b=n[0],y=n[1],v=n[2],w=r[0],_=r[1],k=r[2];Math.abs(d-w)<Xt&&Math.abs(m-_)<Xt&&Math.abs(g-k)<Xt?function(e){e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(e):(l=d-w,h=m-_,p=g-k,i=y*(p*=f=1/Math.hypot(l,h,p))-v*(h*=f),a=v*(l*=f)-b*p,o=b*h-y*l,(f=Math.hypot(i,a,o))?(i*=f=1/f,a*=f,o*=f):(i=0,a=0,o=0),s=h*o-p*a,c=p*i-l*o,u=l*a-h*i,(f=Math.hypot(s,c,u))?(s*=f=1/f,c*=f,u*=f):(s=0,c=0,u=0),e[0]=i,e[1]=s,e[2]=l,e[3]=0,e[4]=a,e[5]=c,e[6]=h,e[7]=0,e[8]=o,e[9]=u,e[10]=p,e[11]=0,e[12]=-(i*d+a*m+o*g),e[13]=-(s*d+c*m+u*g),e[14]=-(l*d+h*m+p*g),e[15]=1)}(this,e,t=t||[0,0,0],r=r||[0,1,0]),this.check()}ortho({left:e,right:t,bottom:r,top:n,near:i=.1,far:a=500}){return function(e,t,r,n,i,a,o){var s=1/(t-r),c=1/(n-i),u=1/(a-o);e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*c,e[14]=(o+a)*u,e[15]=1}(this,e,t,r,n,i,a),this.check()}orthographic({fovy:e=45*Math.PI/180,aspect:t=1,focalDistance:r=1,near:n=.1,far:i=500}){if(e>2*Math.PI)throw Error("radians");const a=e/2,o=r*Math.tan(a),s=o*t;return(new _r).ortho({left:-s,right:s,bottom:-o,top:o,near:n,far:i})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:r=1,near:n=.1,far:i=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return function(e,t,r,n,i){var a,o=1/Math.tan(t/2);e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n)}(this,e,r,n,i),this.check()}determinant(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],u=e[8],l=e[9],h=e[10],p=e[11],f=e[12],d=e[13],m=e[14],g=e[15],(t*o-r*a)*(h*g-p*m)-(t*s-n*a)*(l*g-p*d)+(t*c-i*a)*(l*m-h*d)+(r*s-n*o)*(u*g-p*f)-(r*c-i*o)*(u*m-h*f)+(n*c-i*s)*(u*d-l*f);var e,t,r,n,i,a,o,s,c,u,l,h,p,f,d,m,g}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const r=this.getScale(t||[-0,-0,-0]),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=0,e[4]=this[4]*n,e[5]=this[5]*i,e[6]=this[6]*a,e[7]=0,e[8]=this[8]*n,e[9]=this[9]*i,e[10]=this[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const r=this.getScale(t||[-0,-0,-0]),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=this[4]*n,e[4]=this[5]*i,e[5]=this[6]*a,e[6]=this[8]*n,e[7]=this[9]*i,e[8]=this[10]*a,e}transpose(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}invert(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],u=t[7],l=t[8],h=t[9],p=t[10],f=t[11],d=t[12],m=t[13],g=t[14],b=t[15],y=r*s-n*o,v=r*c-i*o,w=r*u-a*o,_=n*c-i*s,k=n*u-a*s,x=i*u-a*c,E=l*m-h*d,A=l*g-p*d,S=l*b-f*d,j=h*g-p*m,T=h*b-f*m,C=p*b-f*g,B=y*C-v*T+w*j+_*S-k*A+x*E;B&&(B=1/B,e[0]=(s*C-c*T+u*j)*B,e[1]=(i*T-n*C-a*j)*B,e[2]=(m*x-g*k+b*_)*B,e[3]=(p*k-h*x-f*_)*B,e[4]=(c*S-o*C-u*A)*B,e[5]=(r*C-i*S+a*A)*B,e[6]=(g*w-d*x-b*v)*B,e[7]=(l*x-p*w+f*v)*B,e[8]=(o*T-s*S+u*E)*B,e[9]=(n*S-r*T-a*E)*B,e[10]=(d*k-m*w+b*y)*B,e[11]=(h*w-l*k-f*y)*B,e[12]=(s*A-o*j-c*E)*B,e[13]=(r*j-n*A+i*E)*B,e[14]=(m*v-d*_-g*y)*B,e[15]=(l*_-h*v+p*y)*B)}(this,this),this.check()}multiplyLeft(e){return $t(this,e,this),this.check()}multiplyRight(e){return $t(this,this,e),this.check()}rotateX(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],c=t[7],u=t[8],l=t[9],h=t[10],p=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+u*n,e[5]=o*i+l*n,e[6]=s*i+h*n,e[7]=c*i+p*n,e[8]=u*i-a*n,e[9]=l*i-o*n,e[10]=h*i-s*n,e[11]=p*i-c*n}(this,this,e),this.check()}rotateY(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],c=t[3],u=t[8],l=t[9],h=t[10],p=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-u*n,e[1]=o*i-l*n,e[2]=s*i-h*n,e[3]=c*i-p*n,e[8]=a*n+u*i,e[9]=o*n+l*i,e[10]=s*n+h*i,e[11]=c*n+p*i}(this,this,e),this.check()}rotateZ(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],c=t[3],u=t[4],l=t[5],h=t[6],p=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+u*n,e[1]=o*i+l*n,e[2]=s*i+h*n,e[3]=c*i+p*n,e[4]=u*i-a*n,e[5]=l*i-o*n,e[6]=h*i-s*n,e[7]=p*i-c*n}(this,this,e),this.check()}rotateXYZ([e,t,r]){return this.rotateX(e).rotateY(t).rotateZ(r)}rotateAxis(e,t){return function(e,t,r,n){var i,a,o,s,c,u,l,h,p,f,d,m,g,b,y,v,w,_,k,x,E,A,S,j,T=n[0],C=n[1],B=n[2],O=Math.hypot(T,C,B);O<Xt||(T*=O=1/O,C*=O,B*=O,i=Math.sin(r),o=1-(a=Math.cos(r)),s=t[0],c=t[1],u=t[2],l=t[3],h=t[4],p=t[5],f=t[6],d=t[7],m=t[8],g=t[9],b=t[10],y=t[11],v=T*T*o+a,w=C*T*o+B*i,_=B*T*o-C*i,k=T*C*o-B*i,x=C*C*o+a,E=B*C*o+T*i,A=T*B*o+C*i,S=C*B*o-T*i,j=B*B*o+a,e[0]=s*v+h*w+m*_,e[1]=c*v+p*w+g*_,e[2]=u*v+f*w+b*_,e[3]=l*v+d*w+y*_,e[4]=s*k+h*x+m*E,e[5]=c*k+p*x+g*E,e[6]=u*k+f*x+b*E,e[7]=l*k+d*x+y*E,e[8]=s*A+h*S+m*j,e[9]=c*A+p*S+g*j,e[10]=u*A+f*S+b*j,e[11]=l*A+d*S+y*j,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,this,e,t),this.check()}scale(e){return Array.isArray(e)?er(this,this,e):er(this,this,[e,e,e]),this.check()}translate(e){return function(e,t,r){var n,i,a,o,s,c,u,l,h,p,f,d,m=r[0],g=r[1],b=r[2];t===e?(e[12]=t[0]*m+t[4]*g+t[8]*b+t[12],e[13]=t[1]*m+t[5]*g+t[9]*b+t[13],e[14]=t[2]*m+t[6]*g+t[10]*b+t[14],e[15]=t[3]*m+t[7]*g+t[11]*b+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],u=t[6],l=t[7],h=t[8],p=t[9],f=t[10],d=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=c,e[6]=u,e[7]=l,e[8]=h,e[9]=p,e[10]=f,e[11]=d,e[12]=n*m+s*g+h*b+t[12],e[13]=i*m+c*g+p*b+t[13],e[14]=a*m+u*g+f*b+t[14],e[15]=o*m+l*g+d*b+t[15])}(this,this,e),this.check()}transform(e,t){return 4===e.length?(Ht(t=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){const{length:r}=e;switch(r){case 2:t=nr(t||[-0,-0],e,this);break;case 3:t=hr(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ht(t,e.length),t}transformAsVector(e,t){switch(e.length){case 2:t=Jt(t||[-0,-0],e,this);break;case 3:t=Qt(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ht(t,e.length),t}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,r){return this.identity().translate([e,t,r])}transformPoint(e,t){return Vt("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}transformVector(e,t){return Vt("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}transformDirection(e,t){return Vt("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}class kr extends Wt{get ELEMENTS(){return Bt(!1),0}copy(e){return Bt(!1),this}get x(){return this[0]}set x(e){this[0]=qt(e)}get y(){return this[1]}set y(e){this[1]=qt(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let t=0;for(let r=0;r<this.ELEMENTS;++r){const n=this[r]-e[r];t+=n*n}return qt(t)}dot(e){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*e[r];return qt(t)}normalize(){const e=this.magnitude();if(0!==e)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}multiply(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t[e];return this.check()}divide(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t[e];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Bt(e>=0&&e<this.ELEMENTS,"index is out of range"),qt(this[e])}setComponent(e,t){return Bt(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}addVectors(e,t){return this.copy(e).add(t)}subVectors(e,t){return this.copy(e).subtract(t)}multiplyVectors(e,t){return this.copy(e).multiply(t)}addScaledVector(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}const xr=[0,0,0],Er={};class Ar extends kr{static get ZERO(){return Er.ZERO=Er.ZERO||Object.freeze(new Ar(0,0,0,0))}constructor(e=0,t=0,r=0){super(-0,-0,-0),1===arguments.length&&Dt(e)?this.copy(e):(It.debug&&(qt(e),qt(t),qt(r)),this[0]=e,this[1]=t,this[2]=r)}set(e,t,r){return this[0]=e,this[1]=t,this[2]=r,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return It.debug&&(qt(e.x),qt(e.y),qt(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=qt(e)}angle(e){return r=e,n=(t=this)[0],i=t[1],a=t[2],o=r[0],s=r[1],c=r[2],u=Math.sqrt(n*n+i*i+a*a)*Math.sqrt(o*o+s*s+c*c),l=u&&ur(t,r)/u,Math.acos(Math.min(Math.max(l,-1),1));var t,r,n,i,a,o,s,c,u,l}cross(e){return lr(this,this,e),this.check()}rotateX({radians:e,origin:t=xr}){return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,t,e),this.check()}rotateY({radians:e,origin:t=xr}){return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,t,e),this.check()}rotateZ({radians:e,origin:t=xr}){return function(e,t,r,n){var i=[],a=[];i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2]}(this,this,t,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return hr(this,this,e),this.check()}transformAsVector(e){return Qt(this,this,e),this.check()}transformByMatrix3(e){return pr(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,r){const n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2]}(this,this,e),this.check()}transformByQuaternion(e){return fr(this,this,e),this.check()}}var Sr=.1,jr=1e-12,Tr=1e-15,Cr=1e-20;Math.PI,Math.PI,Math.PI,Math.PI;Math.max(6378137,6378137,6356752.314245179);const Br=e=>e,Or=new Ar;function Rr(e,t,r=Br){return Dt(e)?(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]):"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z),t}function Ir(e,t,r=Br){return Dt(t)?(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]):"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]),t}const Pr=new Ar,Dr=new Ar,Mr=new Ar;const Fr=new Ar,Lr={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Nr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},zr={east:new Ar,north:new Ar,up:new Ar,west:new Ar,south:new Ar,down:new Ar},Ur=new Ar,qr=new Ar,Hr=new Ar;function Gr(e,t,r,n,i,a){const o=Lr[t]&&Lr[t][r];let s,c,u;Bt(o&&(!n||n===o));const l=Fr.copy(i);if(Ut(l.x,0,1e-14)&&Ut(l.y,0,1e-14)){const e=Math.sign(l.z);s=Ur.fromArray(Nr[t]),"east"!==t&&"west"!==t&&s.scale(e),c=qr.fromArray(Nr[r]),"east"!==r&&"west"!==r&&c.scale(e),u=Hr.fromArray(Nr[n]),"east"!==n&&"west"!==n&&u.scale(e)}else{const{up:i,east:a,north:o}=zr;a.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,i),o.copy(i).cross(a);const{down:h,west:p,south:f}=zr;h.copy(i).scale(-1),p.copy(a).scale(-1),f.copy(o).scale(-1),s=zr[t],c=zr[r],u=zr[n]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=c.x,a[5]=c.y,a[6]=c.z,a[7]=0,a[8]=u.x,a[9]=u.y,a[10]=u.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}const Vr=new Ar,Wr=new Ar,Kr=new Ar,Jr=new Ar,Qr=new Ar,Yr=new Ar;let Xr;class Zr{static get WGS84(){return Xr=Xr||new Zr(6378137,6378137,6356752.314245179),Xr}constructor(e=0,t=0,r=0){Bt(e>=0),Bt(t>=0),Bt(r>=0),this.radii=new Ar(e,t,r),this.radiiSquared=new Ar(e*e,t*t,r*r),this.radiiToTheFourth=new Ar(e*e*e*e,t*t*t*t,r*r*r*r),this.oneOverRadii=new Ar(0===e?0:1/e,0===t?0:1/t,0===r?0:1/r),this.oneOverRadiiSquared=new Ar(0===e?0:1/(e*e),0===t?0:1/(t*t),0===r?0:1/(r*r)),this.minimumRadius=Math.min(e,t,r),this.maximumRadius=Math.max(e,t,r),this.centerToleranceSquared=Sr,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,t=[0,0,0]){const r=Wr,n=Kr,[,,i]=e;this.geodeticSurfaceNormalCartographic(e,r),n.copy(this.radiiSquared).scale(r);const a=Math.sqrt(r.dot(n));return n.scale(1/a),r.scale(i),n.add(r),n.to(t)}cartesianToCartographic(e,t=[0,0,0]){Yr.from(e);const r=this.scaleToGeodeticSurface(Yr,Jr);if(!r)return;const n=this.geodeticSurfaceNormal(r,Wr),i=Qr;i.copy(Yr).subtract(r);const a=Math.atan2(n.y,n.x),o=Math.asin(n.z),s=Math.sign(ur(i,Yr))*sr(i);return Ir([a,o,s],t,It._cartographicRadians?Br:Lt)}eastNorthUpToFixedFrame(e,t=new _r){return Gr(this,"east","north","up",e,t)}localFrameToFixedFrame(e,t,r,n,i=new _r){return Gr(this,e,t,r,n,i)}geocentricSurfaceNormal(e,t=[0,0,0]){return Vr.from(e).normalize().to(t)}geodeticSurfaceNormalCartographic(e,t=[0,0,0]){const r=function(e,t=Or){return Rr(e,t,It._cartographicRadians?Br:Ft)}(e),n=r[0],i=r[1],a=Math.cos(i);return Vr.set(a*Math.cos(n),a*Math.sin(n),Math.sin(i)).normalize(),Vr.to(t)}geodeticSurfaceNormal(e,t=[0,0,0]){return Vr.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(e,t){return function(e,t,r=new Ar){const{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:a}=t;Pr.from(e);const o=e.x,s=e.y,c=e.z,u=n.x,l=n.y,h=n.z,p=o*o*u*u,f=s*s*l*l,d=c*c*h*h,m=p+f+d,g=Math.sqrt(1/m);if(!Number.isFinite(g))return;const b=Dr;if(b.copy(e).scale(g),m<a)return b.to(r);const y=i.x,v=i.y,w=i.z,_=Mr;_.set(b.x*y*2,b.y*v*2,b.z*w*2);let k,x,E,A,S=(1-g)*e.len()/(.5*_.len()),j=0;do{S-=j,k=1/(1+S*y),x=1/(1+S*v),E=1/(1+S*w);const e=k*k,t=x*x,r=E*E;A=p*e+f*t+d*r-1;j=A/(-2*(p*(e*k)*y+f*(t*x)*v+d*(r*E)*w))}while(Math.abs(A)>jr);return Pr.scale([k,x,E]).to(r)}(e,this,t)}scaleToGeocentricSurface(e,t=[0,0,0]){Jr.from(e);const r=Jr.x,n=Jr.y,i=Jr.z,a=this.oneOverRadiiSquared,o=1/Math.sqrt(r*r*a.x+n*n*a.y+i*i*a.z);return Jr.multiplyScalar(o).to(t)}transformPositionToScaledSpace(e,t=[0,0,0]){return Jr.from(e).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(e,t=[0,0,0]){return Jr.from(e).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(e,t=0,r=[0,0,0]){Bt(Ut(this.radii.x,this.radii.y,Tr)),Bt(this.radii.z>0),Jr.from(e);const n=Jr.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-t))return Jr.set(0,0,n).to(r)}}function $r(){let e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const t=process.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}class en{constructor(e,t){Object(p.a)(this,"name",void 0),Object(p.a)(this,"type",void 0),Object(p.a)(this,"sampleSize",1),Object(p.a)(this,"time",void 0),Object(p.a)(this,"count",void 0),Object(p.a)(this,"samples",void 0),Object(p.a)(this,"lastTiming",void 0),Object(p.a)(this,"lastSampleTime",void 0),Object(p.a)(this,"lastSampleCount",void 0),Object(p.a)(this,"_count",0),Object(p.a)(this,"_time",0),Object(p.a)(this,"_samples",0),Object(p.a)(this,"_startTime",0),Object(p.a)(this,"_timerPending",!1),this.name=e,this.type=t,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=$r(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime($r()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class tn{constructor(e){Object(p.a)(this,"id",void 0),Object(p.a)(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(e=>this._getOrCreate(e))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:r}=e;return this.stats[t]||(this.stats[t]=e instanceof en?e:new en(t,r)),this.stats[t]}}function rn(){let e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const t=process.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}class nn{constructor(e,t){Object(p.a)(this,"name",void 0),Object(p.a)(this,"type",void 0),Object(p.a)(this,"sampleSize",1),Object(p.a)(this,"time",void 0),Object(p.a)(this,"count",void 0),Object(p.a)(this,"samples",void 0),Object(p.a)(this,"lastTiming",void 0),Object(p.a)(this,"lastSampleTime",void 0),Object(p.a)(this,"lastSampleCount",void 0),Object(p.a)(this,"_count",0),Object(p.a)(this,"_time",0),Object(p.a)(this,"_samples",0),Object(p.a)(this,"_startTime",0),Object(p.a)(this,"_timerPending",!1),this.name=e,this.type=t,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=rn(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(rn()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class an{constructor(e){Object(p.a)(this,"id",void 0),Object(p.a)(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(e=>this._getOrCreate(e))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:r}=e;return this.stats[t]||(this.stats[t]=e instanceof nn?e:new nn(t,r)),this.stats[t]}}const on={id:"request-scheduler",throttleRequests:!0,maxRequests:6};class sn{constructor(e={}){Object(p.a)(this,"props",void 0),Object(p.a)(this,"stats",void 0),Object(p.a)(this,"activeRequestCount",0),Object(p.a)(this,"requestQueue",[]),Object(p.a)(this,"requestMap",new Map),Object(p.a)(this,"deferredUpdate",null),this.props={...on,...e},this.stats=new an({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}scheduleRequest(e,t=(()=>0)){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(e))return this.requestMap.get(e);const r={handle:e,priority:0,getPriority:t},n=new Promise(e=>(r.resolve=e,r));return this.requestQueue.push(r),this.requestMap.set(e,n),this._issueNewRequests(),n}_issueRequest(e){const{handle:t,resolve:r}=e;let n=!1;const i=()=>{n||(n=!0,this.requestMap.delete(t),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,r?r({done:i}):Promise.resolve({done:i})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout(()=>this._issueNewRequestsAsync(),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;const e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==e){this._updateAllRequests();for(let t=0;t<e;++t){const e=this.requestQueue.shift();e&&this._issueRequest(e)}}}_updateAllRequests(){const e=this.requestQueue;for(let t=0;t<e.length;++t){const r=e[t];this._updateRequest(r)||(e.splice(t,1),this.requestMap.delete(r.handle),t--)}e.sort((e,t)=>e.priority-t.priority)}_updateRequest(e){return e.priority=e.getPriority(e.handle),!(e.priority<0)||(e.resolve(null),!1)}}class cn{constructor(e,t,r){Object(p.a)(this,"item",void 0),Object(p.a)(this,"previous",void 0),Object(p.a)(this,"next",void 0),this.item=e,this.previous=t,this.next=r}}class un{constructor(){Object(p.a)(this,"head",null),Object(p.a)(this,"tail",null),Object(p.a)(this,"_length",0)}get length(){return this._length}add(e){const t=new cn(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t}remove(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}splice(e,t){e!==t&&(this.remove(t),this._insert(e,t))}_insert(e,t){const r=e.next;e.next=t,this.tail===e?this.tail=t:r.previous=t,t.next=r,t.previous=e,++this._length}}function ln(e){return null!=e}class hn{constructor(){Object(p.a)(this,"_list",void 0),Object(p.a)(this,"_sentinel",void 0),Object(p.a)(this,"_trimTiles",void 0),this._list=new un,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(e){const t=e._cacheNode;ln(t)&&this._list.splice(this._sentinel,t)}add(e,t,r){ln(t._cacheNode)||(t._cacheNode=this._list.add(t),r&&r(e,t))}unloadTile(e,t,r){const n=t._cacheNode;ln(n)&&(this._list.remove(n),t._cacheNode=void 0,r&&r(e,t))}unloadTiles(e,t){const r=this._trimTiles;this._trimTiles=!1;const n=this._list,i=1024*e.maximumMemoryUsage*1024,a=this._sentinel;let o=n.head;for(;o!==a&&(e.gpuMemoryUsageInBytes>i||r);){const r=o.item;o=o.next,this.unloadTile(e,r,t)}}trim(){this._trimTiles=!0}}const pn=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});new Ar,new Ar;const fn=new Ar,dn=new Ar;class mn{constructor(e=[0,0,0],t=0){this.radius=-0,this.center=new Ar,this.fromCenterRadius(e,t)}fromCenterRadius(e,t){return this.center.from(e),this.radius=t,this}fromCornerPoints(e,t){return t=fn.from(t),this.center=(new Ar).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new mn(this.center,this.radius)}union(e){const t=this.center,r=this.radius,n=e.center,i=e.radius,a=fn.copy(n).subtract(t),o=a.magnitude();if(r>=o+i)return this.clone();if(i>=o+r)return e.clone();const s=.5*(r+o+i);return dn.copy(a).scale((-r+s)/o).add(t),this.center.copy(dn),this.radius=s,this}expand(e){const t=(e=fn.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=tr(fn,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){return(e=fn.from(e)).subtract(this.center).lengthSquared()-this.radius*this.radius}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}intersectPlane(e){const t=this.center,r=this.radius,n=e.normal.dot(t)+e.distance;return n<-r?pn.OUTSIDE:n<r?pn.INTERSECTING:pn.INSIDE}}function gn(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],u=t[6],l=t[7],h=t[8],p=r[0],f=r[1],d=r[2],m=r[3],g=r[4],b=r[5],y=r[6],v=r[7],w=r[8];return e[0]=p*n+f*o+d*u,e[1]=p*i+f*s+d*l,e[2]=p*a+f*c+d*h,e[3]=m*n+g*o+b*u,e[4]=m*i+g*s+b*l,e[5]=m*a+g*c+b*h,e[6]=y*n+v*o+w*u,e[7]=y*i+v*s+w*l,e[8]=y*a+v*c+w*h,e}function bn(e,t,r){var n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}const yn=Object.freeze([1,0,0,0,1,0,0,0,1]),vn=Object.freeze([0,0,0,0,0,0,0,0,0]),wn=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),_n={};class kn extends Kt{static get IDENTITY(){return _n.IDENTITY=_n.IDENTITY||Object.freeze(new kn(yn)),_n.IDENTITY}static get ZERO(){return _n.ZERO=_n.ZERO||Object.freeze(new kn(vn)),_n.ZERO}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return wn}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}set(e,t,r,n,i,a,o,s,c){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=c,this.check()}setRowMajor(e,t,r,n,i,a,o,s,c){return this[0]=e,this[1]=n,this[2]=o,this[3]=t,this[4]=i,this[5]=s,this[6]=r,this[7]=a,this[8]=c,this.check()}determinant(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],u=e[8],t*(u*a-o*c)+r*(-u*i+o*s)+n*(c*i-a*s);var e,t,r,n,i,a,o,s,c,u}identity(){return this.copy(yn)}fromQuaternion(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,c=i+i,u=r*o,l=n*o,h=n*s,p=i*o,f=i*s,d=i*c,m=a*o,g=a*s,b=a*c;e[0]=1-h-d,e[3]=l-b,e[6]=p+g,e[1]=l+b,e[4]=1-u-d,e[7]=f-m,e[2]=p-g,e[5]=f+m,e[8]=1-u-h}(this,e),this.check()}transpose(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8]}(this,this),this.check()}invert(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],u=t[7],l=t[8],h=l*o-s*u,p=-l*a+s*c,f=u*a-o*c,d=r*h+n*p+i*f;d&&(d=1/d,e[0]=h*d,e[1]=(-l*n+i*u)*d,e[2]=(s*n-i*o)*d,e[3]=p*d,e[4]=(l*r-i*c)*d,e[5]=(-s*r+i*a)*d,e[6]=f*d,e[7]=(-u*r+n*c)*d,e[8]=(o*r-n*a)*d)}(this,this),this.check()}multiplyLeft(e){return gn(this,e,this),this.check()}multiplyRight(e){return gn(this,this,e),this.check()}rotate(e){return function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],u=t[6],l=t[7],h=t[8],p=Math.sin(r),f=Math.cos(r);e[0]=f*n+p*o,e[1]=f*i+p*s,e[2]=f*a+p*c,e[3]=f*o-p*n,e[4]=f*s-p*i,e[5]=f*c-p*a,e[6]=u,e[7]=l,e[8]=h}(this,this,e),this.check()}scale(e){return Array.isArray(e)?bn(this,this,e):bn(this,this,[e,e,e]),this.check()}translate(e){return function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],u=t[6],l=t[7],h=t[8],p=r[0],f=r[1];e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=c,e[6]=p*n+f*o+u,e[7]=p*i+f*s+l,e[8]=p*a+f*c+h}(this,this,e),this.check()}transform(e,t){switch(e.length){case 2:t=rr(t||[-0,-0],e,this);break;case 3:t=pr(t||[-0,-0,-0],e,this);break;case 4:t=Yt(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ht(t,e.length),t}transformVector(e,t){return Vt("Matrix3.transformVector"),this.transform(e,t)}transformVector2(e,t){return Vt("Matrix3.transformVector"),this.transform(e,t)}transformVector3(e,t){return Vt("Matrix3.transformVector"),this.transform(e,t)}}function xn(){var e=new Zt(4);return Zt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function En(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function An(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],c=r[1],u=r[2],l=r[3];return e[0]=n*l+o*s+i*u-a*c,e[1]=i*l+o*c+a*s-n*u,e[2]=a*l+o*u+n*c-i*s,e[3]=o*l-n*s-i*c-a*u,e}function Sn(e,t,r,n){var i,a,o,s,c,u=t[0],l=t[1],h=t[2],p=t[3],f=r[0],d=r[1],m=r[2],g=r[3];return(a=u*f+l*d+h*m+p*g)<0&&(a=-a,f=-f,d=-d,m=-m,g=-g),1-a>Xt?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,c=Math.sin(n*i)/o):(s=1-n,c=n),e[0]=s*u+c*f,e[1]=s*l+c*d,e[2]=s*h+c*m,e[3]=s*p+c*g,e}function jn(e,t){var r,n=t[0]+t[4]+t[8];if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(t[3*i+i]-t[3*a+a]-t[3*o+o]+1),e[i]=.5*r,r=.5/r,e[3]=(t[3*a+o]-t[3*o+a])*r,e[a]=(t[3*a+i]+t[3*i+a])*r,e[o]=(t[3*o+i]+t[3*i+o])*r}return e}var Tn,Cn,Bn,On,Rn,In,Pn=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},Dn=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},Mn=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},Fn=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e},Ln=mr,Nn=gr,zn=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e},Un=(Tn=or(),Cn=cr(1,0,0),Bn=cr(0,1,0),function(e,t,r){var n=ur(t,r);return n<-.999999?(lr(Tn,Cn,t),dr(Tn)<1e-6&&lr(Tn,Bn,t),function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a}(Tn,Tn),En(e,Tn,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(lr(Tn,t,r),e[0]=Tn[0],e[1]=Tn[1],e[2]=Tn[2],e[3]=1+n,zn(e,e))});On=xn(),Rn=xn(),In=function(){var e=new Zt(9);return Zt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}();const qn=[0,0,0,1];class Hn extends Wt{constructor(e=0,t=0,r=0,n=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,r,n)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}fromMatrix3(e){return jn(this,e),this.check()}identity(){return function(e){e[0]=0,e[1]=0,e[2]=0,e[3]=1}(this),this.check()}fromAxisRotation(e,t){return En(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=qt(e)}get y(){return this[1]}set y(e){this[1]=qt(e)}get z(){return this[2]}set z(e){this[2]=qt(e)}get w(){return this[3]}set w(e){this[3]=qt(e)}len(){return Ln(this)}lengthSquared(){return Nn(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return Mn(this,e)}rotationTo(e,t){return Un(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return Pn(this,this,e),this.check()}calculateW(){return function(e,t){var r=t[0],n=t[1],i=t[2];e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i))}(this,this),this.check()}conjugate(){return function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this,this),this.check()}invert(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s}(this,this),this.check()}lerp(e,t,r){return Fn(this,e,t,r),this.check()}multiplyRight(e,t){return Bt(!t),An(this,this,e),this.check()}multiplyLeft(e,t){return Bt(!t),An(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),c=Math.cos(r);e[0]=n*c+o*s,e[1]=i*c+a*s,e[2]=a*c-i*s,e[3]=o*c-n*s}(this,this,e),this.check()}rotateY(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),c=Math.cos(r);e[0]=n*c-a*s,e[1]=i*c+o*s,e[2]=a*c+n*s,e[3]=o*c-i*s}(this,this,e),this.check()}rotateZ(e){return function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),c=Math.cos(r);e[0]=n*c+i*s,e[1]=i*c-n*s,e[2]=a*c+o*s,e[3]=o*c-a*s}(this,this,e),this.check()}scale(e){return Dn(this,this,e),this.check()}slerp(e,t,r){switch(arguments.length){case 1:({start:e=qn,target:t,ratio:r}=arguments[0]);break;case 2:[t,r]=arguments,e=this}return Sn(this,e,t,r),this.check()}transformVector4(e,t=e){return function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],c=r[2],u=r[3],l=u*n+s*a-c*i,h=u*i+c*n-o*a,p=u*a+o*i-s*n,f=-o*n-s*i-c*a;e[0]=l*u+f*-o+h*-c-p*-s,e[1]=h*u+f*-s+p*-o-l*-c,e[2]=p*u+f*-c+l*-s-h*-o,e[3]=t[3]}(t,e,this),Ht(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}}const Gn=new Ar,Vn=new Ar,Wn=new Ar,Kn=new Ar,Jn=new Ar,Qn=new Ar,Yn=new Ar,Xn=0,Zn=1,$n=2,ei=3,ti=4,ri=5,ni=6,ii=7,ai=8;class oi{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new Ar).from(e),this.halfAxes=new kn(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new Ar(e).len(),new Ar(t).len(),new Ar(r).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new Ar(e).normalize(),i=new Ar(t).normalize(),a=new Ar(r).normalize();return(new Hn).fromMatrix3(new kn([...n,...i,...a]))}fromCenterHalfSizeQuaternion(e,t,r){const n=new Hn(r),i=(new kn).fromQuaternion(n);return i[0]=i[0]*t[0],i[1]=i[1]*t[0],i[2]=i[2]*t[0],i[3]=i[3]*t[1],i[4]=i[4]*t[1],i[5]=i[5]*t[1],i[6]=i[6]*t[2],i[7]=i[7]*t[2],i[8]=i[8]*t[2],this.center=(new Ar).from(e),this.halfAxes=i,this}clone(){return new oi(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new mn){const t=this.halfAxes,r=t.getColumn(0,Wn),n=t.getColumn(1,Kn),i=t.getColumn(2,Jn),a=Gn.copy(r).add(n).add(i);return e.center.copy(this.center),e.radius=a.magnitude(),e}intersectPlane(e){const t=this.center,r=e.normal,n=this.halfAxes,i=r.x,a=r.y,o=r.z,s=Math.abs(i*n[Xn]+a*n[Zn]+o*n[$n])+Math.abs(i*n[ei]+a*n[ti]+o*n[ri])+Math.abs(i*n[ni]+a*n[ii]+o*n[ai]),c=r.dot(t)+e.distance;return c<=-s?pn.OUTSIDE:c>=s?pn.INSIDE:pn.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=Vn.from(e).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,Wn),i=r.getColumn(1,Kn),a=r.getColumn(2,Jn),o=n.magnitude(),s=i.magnitude(),c=a.magnitude();n.normalize(),i.normalize(),a.normalize();let u,l=0;return u=Math.abs(t.dot(n))-o,u>0&&(l+=u*u),u=Math.abs(t.dot(i))-s,u>0&&(l+=u*u),u=Math.abs(t.dot(a))-c,u>0&&(l+=u*u),l}computePlaneDistances(e,t,r=[-0,-0]){let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const a=this.center,o=this.halfAxes,s=o.getColumn(0,Wn),c=o.getColumn(1,Kn),u=o.getColumn(2,Jn),l=Qn.copy(s).add(c).add(u).add(a),h=Yn.copy(l).subtract(e);let p=t.dot(h);return n=Math.min(p,n),i=Math.max(p,i),l.copy(a).add(s).add(c).subtract(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),l.copy(a).add(s).subtract(c).add(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),l.copy(a).add(s).subtract(c).subtract(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),a.copy(l).subtract(s).add(c).add(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),a.copy(l).subtract(s).add(c).subtract(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),a.copy(l).subtract(s).subtract(c).add(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),a.copy(l).subtract(s).subtract(c).subtract(u),h.copy(l).subtract(e),p=t.dot(h),n=Math.min(p,n),i=Math.max(p,i),r[0]=n,r[1]=i,r}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,Wn);t.transformAsPoint(e);const r=this.halfAxes.getColumn(1,Kn);r.transformAsPoint(e);const n=this.halfAxes.getColumn(2,Jn);return n.transformAsPoint(e),this.halfAxes=new kn([...t,...r,...n]),this}getTransform(){throw new Error("not implemented")}}const si=new Ar,ci=new Ar;class ui{constructor(e=[0,0,1],t=0){this.normal=new Ar,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Bt(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=si.from(e),this.normal.from(t).normalize();const r=-this.normal.dot(e);return this.distance=r,this}fromCoefficients(e,t,r,n){return this.normal.set(e,t,r),Bt(Ut(this.normal.len(),1)),this.distance=n,this}clone(e){return new ui(this.normal,this.distance)}equals(e){return Ut(this.distance,e.distance)&&Ut(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=ci.copy(this.normal).transformAsVector(e).normalize(),r=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(r,t)}projectPointOntoPlane(e,t=[0,0,0]){e=si.from(e);const r=this.getPointDistance(e),n=ci.copy(this.normal).scale(r);return e.subtract(n).to(t)}}const li=[new Ar([1,0,0]),new Ar([0,1,0]),new Ar([0,0,1])],hi=new Ar,pi=new Ar;new ui(new Ar(1,0,0),0);class fi{static get MASK_OUTSIDE(){return 4294967295}static get MASK_INSIDE(){return 0}static get MASK_INDETERMINATE(){return 2147483647}constructor(e=[]){this.planes=e,Bt(this.planes.every(e=>e instanceof ui))}fromBoundingSphere(e){this.planes.length=2*li.length;const t=e.center,r=e.radius;let n=0;for(const e of li){let i=this.planes[n],a=this.planes[n+1];i||(i=this.planes[n]=new ui),a||(a=this.planes[n+1]=new ui);const o=hi.copy(e).scale(-r).add(t);e.dot(o);i.fromPointNormal(o,e);const s=hi.copy(e).scale(r).add(t),c=pi.copy(e).negate();c.dot(s);a.fromPointNormal(s,c),n+=2}return this}computeVisibility(e){Bt(e);let t=pn.INSIDE;for(const r of this.planes){switch(e.intersectPlane(r)){case pn.OUTSIDE:return pn.OUTSIDE;case pn.INTERSECTING:t=pn.INTERSECTING}}return t}computeVisibilityWithPlaneMask(e,t){if(Bt(e,"boundingVolume is required."),Bt(Number.isFinite(t),"parentPlaneMask is required."),t===fi.MASK_OUTSIDE||t===fi.MASK_INSIDE)return t;let r=fi.MASK_INSIDE;const n=this.planes;for(let i=0;i<this.planes.length;++i){const a=i<31?1<<i:0;if(i<31&&0==(t&a))continue;const o=n[i],s=e.intersectPlane(o);if(s===pn.OUTSIDE)return fi.MASK_OUTSIDE;s===pn.INTERSECTING&&(r|=a)}return r}}new Ar,new Ar,new Ar,new Ar,new Ar;const di=new Ar,mi=new Ar,gi=new Ar,bi=new Ar,yi=new Ar,vi=new Ar,wi=new Ar,_i=new Ar,ki=new Ar,xi=new Ar,Ei=new Ar,Ai=new Ar;Math.PI;const Si=new kn,ji=new kn,Ti=new kn,Ci=new kn,Bi=new kn;function Oi(e,t={}){const r=Cr;let n=0,i=0;const a=ji,o=Ti;a.identity(),o.copy(e);const s=r*function(e){let t=0;for(let r=0;r<9;++r){const n=e[r];t+=n*n}return Math.sqrt(t)}(o);for(;i<10&&Pi(o)>s;)Di(o,Ci),Bi.copy(Ci).transpose(),o.multiplyRight(Ci),o.multiplyLeft(Bi),a.multiplyRight(Ci),++n>2&&(++i,n=0);return t.unitary=a.toTarget(t.unitary),t.diagonal=o.toTarget(t.diagonal),t}const Ri=[1,0,0],Ii=[2,2,1];function Pi(e){let t=0;for(let r=0;r<3;++r){const n=e[Si.getElementIndex(Ii[r],Ri[r])];t+=2*n*n}return Math.sqrt(t)}function Di(e,t){const r=Tr;let n=0,i=1;for(let t=0;t<3;++t){const r=Math.abs(e[Si.getElementIndex(Ii[t],Ri[t])]);r>n&&(i=t,n=r)}const a=Ri[i],o=Ii[i];let s=1,c=0;if(Math.abs(e[Si.getElementIndex(o,a)])>r){const t=(e[Si.getElementIndex(o,o)]-e[Si.getElementIndex(a,a)])/2/e[Si.getElementIndex(o,a)];let r;r=t<0?-1/(-t+Math.sqrt(1+t*t)):1/(t+Math.sqrt(1+t*t)),s=1/Math.sqrt(1+r*r),c=r*s}return kn.IDENTITY.to(t),t[Si.getElementIndex(a,a)]=t[Si.getElementIndex(o,o)]=s,t[Si.getElementIndex(o,a)]=c,t[Si.getElementIndex(a,o)]=-c,t}const Mi=new Ar,Fi=new Ar,Li=new Ar,Ni=new Ar,zi=new Ar,Ui=new kn,qi={diagonal:new kn,unitary:new kn};const Hi=new Ar,Gi=new Ar,Vi=new fi([new ui,new ui,new ui,new ui,new ui,new ui]);function Wi(e,t){const{cameraDirection:r,cameraUp:n,height:i}=e,{metersPerUnit:a}=e.distanceScales,o=e.unprojectPosition(e.center),s=Zr.WGS84.cartographicToCartesian(o,new Ar),c=Zr.WGS84.eastNorthUpToFixedFrame(s),u=e.unprojectPosition(e.cameraPosition),l=Zr.WGS84.cartographicToCartesian(u,new Ar),h=new Ar(c.transformAsVector(new Ar(r).scale(a))).normalize(),p=new Ar(c.transformAsVector(new Ar(n).scale(a))).normalize();return function(e,t){const r=e.getFrustumPlanes();let n=0;for(const i in r){const a=r[i],o=a.normal.dot(e.center);Gi.copy(a.normal).scale(a.distance-o).add(e.center);const s=e.unprojectPosition(Gi),c=Zr.WGS84.cartographicToCartesian(s,new Ar);Vi.planes[n++].fromPointNormal(c,Hi.copy(t).subtract(c))}}(e,s),{camera:{position:l,direction:h,up:p},viewport:e,height:i,cullingVolume:Vi,frameNumber:t,sseDenominator:1.15}}const Ki=new Ar;function Ji(e,t){if(e instanceof oi){const{halfAxes:r}=e,n=function(e){e.getColumn(0,Ki);const t=e.getColumn(1),r=e.getColumn(2),n=Ki.add(t).add(r);return n.len()}(r);return Math.log2(6356752.314245179/(n+t[2]))}if(e instanceof mn){const{radius:r}=e;return Math.log2(6356752.314245179/(r+t[2]))}if(e.width&&e.height){const{width:t,height:r}=e;return(Math.log2(6378137/t)+Math.log2(6378137/r))/2}return 1}const Qi=0,Yi=1,Xi=3,Zi=4,$i=5,ea=1,ta=2,ra="empty",na="scenegraph",ia="pointcloud",aa="mesh",oa="I3S",sa="TILES3D",ca="geometricError",ua=1;function la(e){return null!=e}const ha=new Ar,pa=new Ar,fa=new Ar;function da(e,t,r){if(k(e,"3D Tile: boundingVolume must be defined"),e.box)return function(e,t,r){const n=new Ar(e[0],e[1],e[2]);t.transform(n,n);let i=[];if(10===e.length){const t=e.slice(3,6),r=new Hn;r.fromArray(e,6);const n=new Ar([1,0,0]),a=new Ar([0,1,0]),o=new Ar([0,0,1]);n.transformByQuaternion(r),n.scale(t[0]),a.transformByQuaternion(r),a.scale(t[1]),o.transformByQuaternion(r),o.scale(t[2]),i=[...n.toArray(),...a.toArray(),...o.toArray()]}else i=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];const a=t.transformAsVector(i.slice(0,3)),o=t.transformAsVector(i.slice(3,6)),s=t.transformAsVector(i.slice(6,9)),c=new kn([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);if(la(r))return r.center=n,r.halfAxes=c,r;return new oi(n,c)}(e.box,t,r);if(e.region){const[t,r,n,i,a,o]=e.region,s=Zr.WGS84.cartographicToCartesian([Nt(t),Nt(i),a],pa),c=Zr.WGS84.cartographicToCartesian([Nt(n),Nt(r),o],fa),u=(new Ar).addVectors(s,c).multiplyScalar(.5),l=(new Ar).subVectors(s,c).len()/2;return ma([u[0],u[1],u[2],l],new _r)}if(e.sphere)return ma(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function ma(e,t,r){const n=new Ar(e[0],e[1],e[2]);t.transform(n,n);const i=t.getScale(ha),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return la(r)?(r.center=n,r.radius=o,r):new mn(n,o)}new Ar,new Ar,new _r,new Ar,new Ar,new Ar;function ga(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){const r=e.dynamicScreenSpaceErrorComputedDensity,n=e.dynamicScreenSpaceErrorFactor;return function(e,t){const r=e*t;return 1-Math.exp(-r*r)}(t,r)*n}return 0}function ba(e,t){const r=t.viewport,n=r.constructor,{longitude:i,latitude:a,height:o,width:s,bearing:c,zoom:u}=r,l=new n({longitude:i,latitude:a,height:o,width:s,bearing:c,zoom:u,pitch:0}),h=e.header.mbs[1],p=e.header.mbs[0],f=e.header.mbs[2],d=e.header.mbs[3],m=[...e.boundingVolume.center],g=l.unprojectPosition(l.cameraPosition),b=Zr.WGS84.cartographicToCartesian(g,new Ar),y=new Ar(b).subtract(m).normalize(),v=new _r;Zr.WGS84.eastNorthUpToFixedFrame(m,v);const w=new _r(v).invert(),_=new Ar(b).transform(w),k=Math.sqrt(_[0]*_[0]+_[1]*_[1]),x=k*k/_[2],E=new Ar([_[0],_[1],x]).transform(v),A=new Ar(E).subtract(m).normalize(),S=y.cross(A).normalize().scale(d),j=new Ar(m).add(S),T=Zr.WGS84.cartesianToCartographic(j),C=l.project([p,h,f]),B=l.project(T);return new Ar(C).subtract(B).magnitude()}class ya{constructor(e=0){Object(p.a)(this,"_map",new Map),Object(p.a)(this,"_array",void 0),Object(p.a)(this,"_length",void 0),this._array=new Array(e),this._length=e}get length(){return this._length}set length(e){this._length=e,e>this._array.length&&(this._array.length=e)}get values(){return this._array}get(e){return k(e<this._array.length),this._array[e]}set(e,t){k(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}delete(e){const t=this._map.get(e);t>=0&&(this._array.splice(t,1),this._map.delete(e),this.length--)}peek(){return this._array[this._length-1]}push(e){if(!this._map.has(e)){const t=this.length++;this._array[t]=e,this._map.set(e,t)}}pop(){const e=this._array[--this.length];return this._map.delete(e),e}reserve(e){k(e>=0),e>this._array.length&&(this._array.length=e)}resize(e){k(e>=0),this.length=e}trim(e){null==e&&(e=this.length),this._array.length=e}reset(){this._array=[],this._map=new Map,this._length=0}find(e){return this._map.has(e)}}const va={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class wa{constructor(e){Object(p.a)(this,"options",void 0),Object(p.a)(this,"root",void 0),Object(p.a)(this,"requestedTiles",void 0),Object(p.a)(this,"selectedTiles",void 0),Object(p.a)(this,"emptyTiles",void 0),Object(p.a)(this,"_traversalStack",void 0),Object(p.a)(this,"_emptyTraversalStack",void 0),Object(p.a)(this,"_frameNumber",void 0),this.options={...va,...e},this._traversalStack=new ya,this._emptyTraversalStack=new ya,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}traverse(e,t,r){this.root=e,this.options={...this.options,...r},this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(e,t){const r=this._traversalStack;for(e._selectionDepth=1,r.push(e);r.length>0;){const e=r.pop();let n=!1;this.canTraverse(e,t)&&(this.updateChildTiles(e,t),n=this.updateAndPushChildren(e,t,r,e.hasRenderContent?e._selectionDepth+1:e._selectionDepth));const i=e.parent,a=Boolean(!i||i._shouldRefine),o=!n;e.hasRenderContent?e.refine===ea?(this.loadTile(e,t),this.selectTile(e,t)):e.refine===ta&&(this.loadTile(e,t),o&&this.selectTile(e,t)):(this.emptyTiles[e.id]=e,this.loadTile(e,t),o&&this.selectTile(e,t)),this.touchTile(e,t),e._shouldRefine=n&&a}this.options.onTraversalEnd(t)}updateChildTiles(e,t){const r=e.children;for(const e of r)this.updateTile(e,t);return!0}updateAndPushChildren(e,t,r,n){const{loadSiblings:i,skipLevelOfDetail:a}=this.options,o=e.children;o.sort(this.compareDistanceToCamera.bind(this));const s=e.refine===ta&&e.hasRenderContent&&!a;let c=!1,u=!0;for(const e of o)if(e._selectionDepth=n,e.isVisibleAndInRequestVolume?(r.find(e)&&r.delete(e),r.push(e),c=!0):(s||i)&&(this.loadTile(e,t),this.touchTile(e,t)),s){let r;if(r=!!e._inRequestVolume&&(e.hasRenderContent?e.contentAvailable:this.executeEmptyTraversal(e,t)),u=u&&r,!u)return!1}return c||(u=!1),u}updateTile(e,t){this.updateTileVisibility(e,t)}selectTile(e,t){this.shouldSelectTile(e)&&(e._selectedFrame=t.frameNumber,this.selectedTiles[e.id]=e)}loadTile(e,t){this.shouldLoadTile(e)&&(e._requestedFrame=t.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}touchTile(e,t){e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber}canTraverse(e,t,r=!1,n=!1){return!!e.hasChildren&&(e.hasTilesetContent?!e.contentExpired:!(!n&&!e.isVisibleAndInRequestVolume)&&this.shouldRefine(e,t,r))}shouldLoadTile(e){return e.hasUnloadedContent||e.contentExpired}shouldSelectTile(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(e,t,r){let n=e._screenSpaceError;return r&&(n=e.getScreenSpaceError(t,!0)),n>this.options.maximumScreenSpaceError}updateTileVisibility(e,t){const r=[];if(this.options.viewportTraversersMap)for(const e in this.options.viewportTraversersMap){this.options.viewportTraversersMap[e]===t.viewport.id&&r.push(e)}else r.push(t.viewport.id);e.updateVisibility(t,r)}compareDistanceToCamera(e,t){return e._distanceToCamera-t._distanceToCamera}anyChildrenVisible(e,t){let r=!1;for(const n of e.children)n.updateVisibility(t),r=r||n.isVisibleAndInRequestVolume;return r}executeEmptyTraversal(e,t){let r=!0;const n=this._emptyTraversalStack;for(n.push(e);n.length>0&&r;){const e=n.pop();this.updateTile(e,t),e.isVisibleAndInRequestVolume||this.loadTile(e,t),this.touchTile(e,t);if(!e.hasRenderContent&&this.canTraverse(e,t,!1,!0)){const t=e.children;for(const e of t)n.find(e)&&n.delete(e),n.push(e)}else e.contentAvailable||(r=!1)}return r}}const _a=new Ar;class ka{constructor(e,t,r,n=""){Object(p.a)(this,"tileset",void 0),Object(p.a)(this,"header",void 0),Object(p.a)(this,"id",void 0),Object(p.a)(this,"url",void 0),Object(p.a)(this,"parent",void 0),Object(p.a)(this,"refine",void 0),Object(p.a)(this,"type",void 0),Object(p.a)(this,"contentUrl",void 0),Object(p.a)(this,"lodMetricType",void 0),Object(p.a)(this,"lodMetricValue",void 0),Object(p.a)(this,"boundingVolume",void 0),Object(p.a)(this,"content",void 0),Object(p.a)(this,"contentState",void 0),Object(p.a)(this,"gpuMemoryUsageInBytes",void 0),Object(p.a)(this,"children",void 0),Object(p.a)(this,"depth",void 0),Object(p.a)(this,"viewportIds",void 0),Object(p.a)(this,"transform",void 0),Object(p.a)(this,"extensions",void 0),Object(p.a)(this,"userData",void 0),Object(p.a)(this,"computedTransform",void 0),Object(p.a)(this,"hasEmptyContent",void 0),Object(p.a)(this,"hasTilesetContent",void 0),Object(p.a)(this,"traverser",void 0),Object(p.a)(this,"_cacheNode",void 0),Object(p.a)(this,"_frameNumber",void 0),Object(p.a)(this,"_lodJudge",void 0),Object(p.a)(this,"_expireDate",void 0),Object(p.a)(this,"_expiredContent",void 0),Object(p.a)(this,"_shouldRefine",void 0),Object(p.a)(this,"_distanceToCamera",void 0),Object(p.a)(this,"_centerZDepth",void 0),Object(p.a)(this,"_screenSpaceError",void 0),Object(p.a)(this,"_visibilityPlaneMask",void 0),Object(p.a)(this,"_visible",void 0),Object(p.a)(this,"_inRequestVolume",void 0),Object(p.a)(this,"_stackLength",void 0),Object(p.a)(this,"_selectionDepth",void 0),Object(p.a)(this,"_touchedFrame",void 0),Object(p.a)(this,"_visitedFrame",void 0),Object(p.a)(this,"_selectedFrame",void 0),Object(p.a)(this,"_requestedFrame",void 0),Object(p.a)(this,"_priority",void 0),Object(p.a)(this,"_contentBoundingVolume",void 0),Object(p.a)(this,"_viewerRequestVolume",void 0),Object(p.a)(this,"_initialTransform",void 0),this.header=t,this.tileset=e,this.id=n||t.id,this.url=t.url,this.parent=r,this.refine=this._getRefine(t.refine),this.type=t.type,this.contentUrl=t.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=Qi,this.gpuMemoryUsageInBytes=0,this.children=[],this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.depth=0,this.viewportIds=[],this.userData={},this.extensions=null,this._priority=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._screenSpaceError=0,this._cacheNode=null,this._frameNumber=null,this._cacheNode=null,this.traverser=new wa({}),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._initialTransform=new _r,this.transform=new _r,this._initializeLodMetric(t),this._initializeTransforms(t),this._initializeBoundingVolumes(t),this._initializeContent(t),this._initializeRenderingState(t),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,Object.seal(this)}destroy(){this.header=null}isDestroyed(){return null===this.header}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===Xi||this.hasEmptyContent}get contentAvailable(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===Qi}get contentExpired(){return this.contentState===Zi}get contentFailed(){return this.contentState===$i}getScreenSpaceError(e,t){switch(this.tileset.type){case oa:return ba(this,e);case sa:return function(e,t,r){const n=e.tileset,i=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,a=r?i:e.lodMetricValue;if(0===a)return 0;const o=Math.max(e._distanceToCamera,1e-7),{height:s,sseDenominator:c}=t,{viewDistanceScale:u}=n.options;let l=a*s*(u||1)/(o*c);return l-=ga(n,o),l}(this,e,t);default:throw new Error("Unsupported tileset type")}}_getPriority(){const e=this.tileset._traverser,{skipLevelOfDetail:t}=e.options,r=this.refine===ea||t;if(r&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Qi)return-1;const n=this.parent,i=n&&(!r||0===this._screenSpaceError||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,a=e.root?e.root._screenSpaceError:0;return Math.max(a-i,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=Yi;const e=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!e)return this.contentState=Qi,!1;try{const t=this.tileset.getTileUrl(this.contentUrl),r=this.tileset.loader,n={...this.tileset.loadOptions,[r.id]:{...this.tileset.loadOptions[r.id],isTileset:"json"===this.type,...this._getLoaderSpecificOptions(r.id)}};return this.content=await St(t,r,n),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Xi,this._onContentLoaded(),!0}catch(e){throw this.contentState=$i,e}finally{e.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=Qi,!0}updateVisibility(e,t){if(this._frameNumber===e.frameNumber)return;const r=this.parent,n=r?r._visibilityPlaneMask:fi.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){const e=r?r.computedTransform:this.tileset.modelMatrix;this._updateTransform(e)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,n),this._visible=this._visibilityPlaneMask!==fi.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=t}visibility(e,t){const{cullingVolume:r}=e,{boundingVolume:n}=this;return r.computeVisibilityWithPlaneMask(n,t)}contentVisibility(){return!0}distanceToTile(e){const t=this.boundingVolume;return Math.sqrt(Math.max(t.distanceSquaredTo(e.camera.position),0))}cameraSpaceZDepth({camera:e}){const t=this.boundingVolume;return _a.subVectors(t.center,e.position),e.direction.dot(_a)}insideViewerRequestVolume(e){const t=this._viewerRequestVolume;return!t||t.distanceSquaredTo(e.camera.position)<=0}updateExpiration(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){const e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=Zi,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(e){"lodMetricType"in e?this.lodMetricType=e.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in e?this.lodMetricValue=e.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(e){this.transform=e.transform?new _r(e.transform):new _r;const t=this.parent,r=this.tileset,n=t&&t.computedTransform?t.computedTransform.clone():r.modelMatrix.clone();this.computedTransform=new _r(n).multiplyRight(this.transform);const i=t&&t._initialTransform?t._initialTransform.clone():new _r;this._initialTransform=new _r(i).multiplyRight(this.transform)}_initializeBoundingVolumes(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}_initializeContent(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Qi,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=fi.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(e){return e||this.parent&&this.parent.refine||ta}_isTileset(){return-1!==this.contentUrl.indexOf(".json")}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()&&(this.hasTilesetContent=!0)}_updateBoundingVolume(e){this.boundingVolume=da(e.boundingVolume,this.computedTransform,this.boundingVolume);const t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=da(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=da(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(e=new _r){const t=e.clone().multiplyRight(this.transform);!t.equals(this.computedTransform)&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(e){switch(e){case"i3s":return{...this.tileset.options.i3s,tile:this.header,tileset:this.tileset.tileset,isTileHeader:!1};case"3d-tiles":case"cesium-ion":default:return{assetGltfUpAxis:(t=this.tileset.tileset).asset&&t.asset.gltfUpAxis||"Y"}}var t}}class xa extends wa{compareDistanceToCamera(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}updateTileVisibility(e,t){if(super.updateTileVisibility(e,t),!e.isVisibleAndInRequestVolume)return;const r=e.children.length>0;if(e.hasTilesetContent&&r){const r=e.children[0];return this.updateTileVisibility(r,t),void(e._visible=r._visible)}if(this.meetsScreenSpaceErrorEarly(e,t))return void(e._visible=!1);const n=e.refine===ta,i=e._optimChildrenWithinParent===ua;n&&i&&r&&!this.anyChildrenVisible(e,t)&&(e._visible=!1)}meetsScreenSpaceErrorEarly(e,t){const{parent:r}=e;return!(!r||r.hasTilesetContent||r.refine!==ea)&&!this.shouldRefine(e,t,!0)}}const Ea="REQUESTED",Aa="COMPLETED",Sa="ERROR";class ja{constructor(){Object(p.a)(this,"_statusMap",void 0),this._statusMap={}}add(e,t,r,n){this._statusMap[t]||(this._statusMap[t]={request:e,callback:r,key:t,frameState:n,status:Ea},e().then(e=>{this._statusMap[t].status=Aa,this._statusMap[t].callback(e,n)}).catch(e=>{this._statusMap[t].status=Sa,r(e)}))}update(e,t){this._statusMap[e]&&(this._statusMap[e].frameState=t)}find(e){return this._statusMap[e]}}class Ta extends wa{constructor(e){super(e),Object(p.a)(this,"_tileManager",void 0),this._tileManager=new ja}shouldRefine(e,t){return e._lodJudge=function(e,t){if(0===e.lodMetricValue||isNaN(e.lodMetricValue))return"DIG";const r=2*ba(e,t);return r<2?"OUT":!e.header.children||r<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}(e,t),"DIG"===e._lodJudge}updateChildTiles(e,t){const r=e.header.children||[],n=e.children,i=e.tileset;for(const a of r){const r="".concat(a.id,"-").concat(t.viewport.id),o=n&&n.find(e=>e.id===r);if(o)o&&this.updateTile(o,t);else{let n=()=>this._loadTile(a.id,i);this._tileManager.find(r)?this._tileManager.update(r,t):(i.tileset.nodePages&&(n=()=>i.tileset.nodePagesTile.formTileFromNodePages(a.id)),this._tileManager.add(n,r,t=>this._onTileLoad(t,e,r),t))}}return!1}async _loadTile(e,t){const{loader:r}=t,n=t.getTileUrl("".concat(t.url,"/nodes/").concat(e)),i={...t.loadOptions,i3s:{...t.loadOptions.i3s,isTileHeader:!0,loadContent:!1}};return await St(n,r,i)}_onTileLoad(e,t,r){const n=new ka(t.tileset,e,t,r);t.children.push(n);const i=this._tileManager.find(n.id).frameState;this.updateTile(n,i),this._frameNumber===i.frameNumber&&this.executeTraversal(n,i)}}const Ca={description:"",ellipsoid:Zr.WGS84,modelMatrix:new _r,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:e=>e,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}};class Ba{constructor(e,t){Object(p.a)(this,"options",void 0),Object(p.a)(this,"loadOptions",void 0),Object(p.a)(this,"type",void 0),Object(p.a)(this,"tileset",void 0),Object(p.a)(this,"loader",void 0),Object(p.a)(this,"url",void 0),Object(p.a)(this,"basePath",void 0),Object(p.a)(this,"modelMatrix",void 0),Object(p.a)(this,"ellipsoid",void 0),Object(p.a)(this,"lodMetricType",void 0),Object(p.a)(this,"lodMetricValue",void 0),Object(p.a)(this,"refine",void 0),Object(p.a)(this,"root",void 0),Object(p.a)(this,"roots",void 0),Object(p.a)(this,"asset",void 0),Object(p.a)(this,"description",void 0),Object(p.a)(this,"properties",void 0),Object(p.a)(this,"extras",void 0),Object(p.a)(this,"attributions",void 0),Object(p.a)(this,"credits",void 0),Object(p.a)(this,"stats",void 0),Object(p.a)(this,"traverseCounter",void 0),Object(p.a)(this,"geometricError",void 0),Object(p.a)(this,"selectedTiles",void 0),Object(p.a)(this,"cartographicCenter",void 0),Object(p.a)(this,"cartesianCenter",void 0),Object(p.a)(this,"zoom",void 0),Object(p.a)(this,"boundingVolume",void 0),Object(p.a)(this,"gpuMemoryUsageInBytes",void 0),Object(p.a)(this,"dynamicScreenSpaceErrorComputedDensity",void 0),Object(p.a)(this,"_traverser",void 0),Object(p.a)(this,"_cache",void 0),Object(p.a)(this,"_requestScheduler",void 0),Object(p.a)(this,"_frameNumber",void 0),Object(p.a)(this,"_queryParamsString",void 0),Object(p.a)(this,"_queryParams",void 0),Object(p.a)(this,"_extensionsUsed",void 0),Object(p.a)(this,"_tiles",void 0),Object(p.a)(this,"_pendingCount",void 0),Object(p.a)(this,"lastUpdatedVieports",void 0),Object(p.a)(this,"_requestedTiles",void 0),Object(p.a)(this,"_emptyTiles",void 0),Object(p.a)(this,"frameStateData",void 0),Object(p.a)(this,"maximumMemoryUsage",void 0),k(e),this.options={...Ca,...t},this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||n.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new hn,this._requestScheduler=new sn({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new tn({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this._initializeTileSet(e)}destroy(){this._destroy()}isLoaded(){return 0===this._pendingCount&&0!==this._frameNumber}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return this._queryParamsString||(this._queryParamsString=function(e){const t=[];for(const r of Object.keys(e))t.push("".concat(r,"=").concat(e[r]));switch(t.length){case 0:return"";case 1:return"?".concat(t[0]);default:return"?".concat(t.join("&"))}}(this._queryParams)),this._queryParamsString}setProps(e){this.options={...this.options,...e}}setOptions(e){this.options={...this.options,...e}}getTileUrl(e){return e.startsWith("data:")?e:"".concat(e).concat(this.queryParams)}hasExtension(e){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(e)>-1)}update(e){if("loadTiles"in this.options&&!this.options.loadTiles)return;if(this.traverseCounter>0)return;!e&&this.lastUpdatedVieports?e=this.lastUpdatedVieports:this.lastUpdatedVieports=e,e instanceof Array||(e=[e]),this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;const t=[];for(const r of e){const e=r.id;this._needTraverse(e)?t.push(e):this.traverseCounter--}for(const r of e){const e=r.id;if(this.roots[e]||(this.roots[e]=this._initializeTileHeaders(this.tileset,null)),!t.includes(e))continue;const n=Wi(r,this._frameNumber);this._traverser.traverse(this.roots[e],n,this.options)}}_needTraverse(e){let t=e;return this.options.viewportTraversersMap&&(t=this.options.viewportTraversersMap[e]),t===e}_onTraversalEnd(e){const t=e.viewport.id;this.frameStateData[t]||(this.frameStateData[t]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});const r=this.frameStateData[t],n=Object.values(this._traverser.selectedTiles);r.selectedTiles=n,r._requestedTiles=Object.values(this._traverser.requestedTiles),r._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(const e in this.frameStateData){const t=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(t.selectedTiles),this._requestedTiles=this._requestedTiles.concat(t._requestedTiles),this._emptyTiles=this._emptyTiles.concat(t._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(const e of this.selectedTiles)this._tiles[e.id]=e;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(e,t){if(e.length!==t.length)return!0;const r=new Set(e.map(e=>e.id)),n=new Set(t.map(e=>e.id));let i=e.filter(e=>!n.has(e.id)).length>0;return i=i||t.filter(e=>!r.has(e.id)).length>0,i}_loadTiles(){for(const e of this._requestedTiles)e.contentUnloaded&&this._loadTile(e)}_unloadTiles(){this._cache.unloadTiles(this,(e,t)=>e._unloadTile(t))}_updateStats(){let e=0,t=0;for(const r of this.selectedTiles)r.contentAvailable&&r.content&&(e++,r.content.pointCount&&(t+=r.content.pointCount));this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=e,this.stats.get("Points").count=t}_initializeTileSet(e){this.root=this._initializeTileHeaders(e,null),this.type===sa&&this._initializeCesiumTileset(e),this.type===oa&&this._initializeI3STileset(),this._calculateViewProps()}_calculateViewProps(){const e=this.root;k(e);const{center:t}=e.boundingVolume;if(!t)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new Ar,void(this.zoom=1);this.cartographicCenter=Zr.WGS84.cartesianToCartographic(t,new Ar),this.cartesianCenter=t,this.zoom=Ji(e.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get("Tiles In Tileset(s)"),this.stats.get("Tiles Loading"),this.stats.get("Tiles In Memory"),this.stats.get("Tiles In View"),this.stats.get("Tiles To Render"),this.stats.get("Tiles Loaded"),this.stats.get("Tiles Unloaded"),this.stats.get("Failed Tile Loads"),this.stats.get("Points","memory"),this.stats.get("Tile Memory Use","memory")}_initializeTileHeaders(e,t){const r=new ka(this,e.root,t);if(t&&(t.children.push(r),r.depth=t.depth+1),this.type===sa){const e=[];for(e.push(r);e.length>0;){const t=e.pop();this.stats.get("Tiles In Tileset(s)").incrementCount();const r=t.header.children||[];for(const n of r){const r=new ka(this,n,t);t.children.push(r),r.depth=t.depth+1,e.push(r)}}}return r}_initializeTraverser(){let e;switch(this.type){case sa:e=xa;break;case oa:e=Ta;break;default:e=wa}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(e){this._destroySubtree(e)}async _loadTile(e){let t;try{this._onStartTileLoading(),t=await e.loadContent()}catch(t){this._onTileLoadError(e,t)}finally{this._onEndTileLoading(),this._onTileLoad(e,t)}}_onTileLoadError(e,t){this.stats.get("Failed Tile Loads").incrementCount();const r=t.message||t.toString(),n=e.url;console.error("A 3D tile failed to load: ".concat(e.url," ").concat(r)),this.options.onTileError(e,r,n)}_onTileLoad(e,t){t&&(e&&e.content&&function(e,t){k(e),k(t);const{rtcCenter:r,gltfUpAxis:n}=t,{computedTransform:i,boundingVolume:{center:a}}=e;let o=new _r(i);switch(r&&o.translate(r),n){case"Z":break;case"Y":const e=(new _r).rotateX(Math.PI/2);o=o.multiplyRight(e);break;case"X":const t=(new _r).rotateY(-Math.PI/2);o=o.multiplyRight(t)}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);const s=new Ar(a);t.cartesianModelMatrix=o,t.cartesianOrigin=s;const c=Zr.WGS84.cartesianToCartographic(s,new Ar),u=Zr.WGS84.eastNorthUpToFixedFrame(s).invert();t.cartographicModelMatrix=u.multiplyRight(o),t.cartographicOrigin=c,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}(e,e.content),this._addTileToCache(e),this.options.onTileLoad(e))}_onStartTileLoading(){this._pendingCount++,this.stats.get("Tiles Loading").incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get("Tiles Loading").decrementCount()}_addTileToCache(e){this._cache.add(this,e,t=>t._updateCacheStats(e))}_updateCacheStats(e){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=e.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}_unloadTile(e){this.gpuMemoryUsageInBytes-=e.content&&e.content.byteLength||0,this.stats.get("Tiles In Memory").decrementCount(),this.stats.get("Tiles Unloaded").incrementCount(),this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}_destroy(){const e=[];for(this.root&&e.push(this.root);e.length>0;){const t=e.pop();for(const r of t.children)e.push(r);this._destroyTile(t)}this.root=null}_destroySubtree(e){const t=e,r=[];for(r.push(t);r.length>0;){e=r.pop();for(const t of e.children)r.push(t);e!==t&&this._destroyTile(e)}t.children=[]}_destroyTile(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}_initializeCesiumTileset(e){if(this.asset=e.asset,!this.asset)throw new Error("Tileset must have an asset property.");if("0.0"!==this.asset.version&&"1.0"!==this.asset.version)throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed,this.extras=e.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}const Oa={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Ra=(Object.keys(Oa),{BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]});function Ia(e,t,r){k(e instanceof ArrayBuffer);const n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}const Pa={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:"3.1.8",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"==typeof WebAssembly?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};class Da{constructor(e,t){Object(p.a)(this,"fields",void 0),Object(p.a)(this,"metadata",void 0),function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}(Array.isArray(e)),function(e){const t={};for(const r of e)t[r.name]&&console.warn("Schema: duplicated field name",r.name,r),t[r.name]=!0}(e),this.fields=e,this.metadata=t||new Map}compareTo(e){if(this.metadata!==e.metadata)return!1;if(this.fields.length!==e.fields.length)return!1;for(let t=0;t<this.fields.length;++t)if(!this.fields[t].compareTo(e.fields[t]))return!1;return!0}select(...e){const t=Object.create(null);for(const r of e)t[r]=!0;const r=this.fields.filter(e=>t[e.name]);return new Da(r,this.metadata)}selectAt(...e){const t=e.map(e=>this.fields[e]).filter(Boolean);return new Da(t,this.metadata)}assign(e){let t,r=this.metadata;if(e instanceof Da){const n=e;t=n.fields,r=Ma(Ma(new Map,this.metadata),n.metadata)}else t=e;const n=Object.create(null);for(const e of this.fields)n[e.name]=e;for(const e of t)n[e.name]=e;const i=Object.values(n);return new Da(i,r)}}function Ma(e,t){return new Map([...e||new Map,...t||new Map])}class Fa{constructor(e,t,r=!1,n=new Map){Object(p.a)(this,"name",void 0),Object(p.a)(this,"type",void 0),Object(p.a)(this,"nullable",void 0),Object(p.a)(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=r,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new Fa(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}let La,Na,za,Ua,qa,Ha,Ga,Va,Wa;!function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"}(La||(La={}));class Ka{static isNull(e){return e&&e.typeId===La.Null}static isInt(e){return e&&e.typeId===La.Int}static isFloat(e){return e&&e.typeId===La.Float}static isBinary(e){return e&&e.typeId===La.Binary}static isUtf8(e){return e&&e.typeId===La.Utf8}static isBool(e){return e&&e.typeId===La.Bool}static isDecimal(e){return e&&e.typeId===La.Decimal}static isDate(e){return e&&e.typeId===La.Date}static isTime(e){return e&&e.typeId===La.Time}static isTimestamp(e){return e&&e.typeId===La.Timestamp}static isInterval(e){return e&&e.typeId===La.Interval}static isList(e){return e&&e.typeId===La.List}static isStruct(e){return e&&e.typeId===La.Struct}static isUnion(e){return e&&e.typeId===La.Union}static isFixedSizeBinary(e){return e&&e.typeId===La.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===La.FixedSizeList}static isMap(e){return e&&e.typeId===La.Map}static isDictionary(e){return e&&e.typeId===La.Dictionary}get typeId(){return La.NONE}compareTo(e){return this===e}}Symbol.toStringTag;Symbol.toStringTag;Na=Symbol.toStringTag;class Ja extends Ka{constructor(e,t){super(),Object(p.a)(this,"isSigned",void 0),Object(p.a)(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return La.Int}get[Na](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class Qa extends Ja{constructor(){super(!0,8)}}class Ya extends Ja{constructor(){super(!0,16)}}class Xa extends Ja{constructor(){super(!0,32)}}class Za extends Ja{constructor(){super(!1,8)}}class $a extends Ja{constructor(){super(!1,16)}}class eo extends Ja{constructor(){super(!1,32)}}const to=32,ro=64;za=Symbol.toStringTag;class no extends Ka{constructor(e){super(),Object(p.a)(this,"precision",void 0),this.precision=e}get typeId(){return La.Float}get[za](){return"Float"}toString(){return"Float".concat(this.precision)}}class io extends no{constructor(){super(to)}}class ao extends no{constructor(){super(ro)}}Symbol.toStringTag;Symbol.toStringTag;Ua=Symbol.toStringTag;qa=Symbol.toStringTag;Ha=Symbol.toStringTag;Ga=Symbol.toStringTag;Va=Symbol.toStringTag;class oo extends Ka{constructor(e,t){super(),Object(p.a)(this,"listSize",void 0),Object(p.a)(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return La.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Va](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}Wa=Symbol.toStringTag;function so(e,t,r){const n=function(e){switch(e.constructor){case Int8Array:return new Qa;case Uint8Array:return new Za;case Int16Array:return new Ya;case Uint16Array:return new $a;case Int32Array:return new Xa;case Uint32Array:return new eo;case Float32Array:return new io;case Float64Array:return new ao;default:throw new Error("array type not supported")}}(t.value),i=r||function(e){const t=new Map;"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10));"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10));"normalized"in e&&t.set("normalized",e.normalized.toString());return t}(t);return new Fa(e,new oo(t.size,new Fa("value",n)),!1,i)}function co(e,t,r){return so(e,t,r?uo(r.metadata):void 0)}function uo(e){const t=new Map;for(const r in e)t.set("".concat(r,".string"),JSON.stringify(e[r]));return t}const lo={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},ho={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class po{constructor(e){Object(p.a)(this,"draco",void 0),Object(p.a)(this,"decoder",void 0),Object(p.a)(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const r=new this.draco.DecoderBuffer;r.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const n=this.decoder.GetEncodedGeometryType(r),i=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let e;switch(n){case this.draco.TRIANGULAR_MESH:e=this.decoder.DecodeBufferToMesh(r,i);break;case this.draco.POINT_CLOUD:e=this.decoder.DecodeBufferToPointCloud(r,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!e.ok()||!i.ptr){const t="DRACO decompression failed: ".concat(e.error_msg());throw new Error(t)}const a=this._getDracoLoaderData(i,n,t),o=this._getMeshData(i,a,t),s=function(e){let t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0;const s=e.POSITION?e.POSITION.value:[],c=s&&s.length;for(let e=0;e<c;e+=3){const c=s[e],u=s[e+1],l=s[e+2];t=c<t?c:t,r=u<r?u:r,n=l<n?l:n,i=c>i?c:i,a=u>a?u:a,o=l>o?l:o}return[[t,r,n],[i,a,o]]}(o.attributes),c=function(e,t,r){const n=uo(t.metadata),i=[],a=function(e){const t={};for(const r in e){const n=e[r];t[n.name||"undefined"]=n}return t}(t.attributes);for(const t in e){const r=co(t,e[t],a[t]);i.push(r)}if(r){const e=co("indices",r);i.push(e)}return new Da(i,n)}(o.attributes,a,o.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:s},...o,schema:c}}finally{this.draco.destroy(r),i&&this.draco.destroy(i)}}_getDracoLoaderData(e,t,r){const n=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,r);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:n,attributes:i}}_getDracoAttributes(e,t){const r={};for(let n=0;n<e.num_attributes();n++){const i=this.decoder.GetAttribute(e,n),a=this._getAttributeMetadata(e,n);r[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:n,metadata:a};const o=this._getQuantizationTransform(i,t);o&&(r[i.unique_id()].quantization_transform=o);const s=this._getOctahedronTransform(i,t);s&&(r[i.unique_id()].octahedron_transform=s)}return r}_getMeshData(e,t,r){const n=this._getMeshAttributes(t,e,r);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(e,t,r){const n={};for(const i of Object.values(e.attributes)){const e=this._deduceAttributeName(i,r);i.name=e;const{value:a,size:o}=this._getAttributeValues(t,i);n[e]={value:a,size:o,byteOffset:i.byte_offset,byteStride:i.byte_stride,normalized:i.normalized}}return n}_getTriangleListIndices(e){const t=3*e.num_faces(),r=4*t,n=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(e,r,n),new Uint32Array(this.draco.HEAPF32.buffer,n,t).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(e){const t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),function(e){const t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}(t)}finally{this.draco.destroy(t)}}_getAttributeValues(e,t){const r=ho[t.data_type],n=t.num_components,i=e.num_points()*n,a=i*r.BYTES_PER_ELEMENT,o=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}(this.draco,r);let s;const c=this.draco._malloc(a);try{const n=this.decoder.GetAttribute(e,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,n,o,a,c),s=new r(this.draco.HEAPF32.buffer,c,i).slice()}finally{this.draco._free(c)}return{value:s,size:n}}_deduceAttributeName(e,t){const r=e.unique_id;for(const[e,n]of Object.entries(t.extraAttributes||{}))if(n===r)return e;const n=e.attribute_type;for(const e in lo){if(this.draco[e]===n)return lo[e]}const i=t.attributeNameEntry||"name";return e.metadata[i]?e.metadata[i].string:"CUSTOM_ATTRIBUTE_".concat(r)}_getTopLevelMetadata(e){const t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}_getAttributeMetadata(e,t){const r=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(r)}_getDracoMetadata(e){if(!e||!e.ptr)return{};const t={},r=this.metadataQuerier.NumEntries(e);for(let n=0;n<r;n++){const r=this.metadataQuerier.GetEntryName(e,n);t[r]=this._getDracoMetadataField(e,r)}return t}_getDracoMetadataField(e,t){const r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,r);const n=function(e){const t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}(r);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:n}}finally{this.draco.destroy(r)}}_disableAttributeTransforms(e){const{quantizedAttributes:t=[],octahedronAttributes:r=[]}=e,n=[...t,...r];for(const e of n)this.decoder.SkipAttributeTransform(this.draco[e])}_getQuantizationTransform(e,t){const{quantizedAttributes:r=[]}=t,n=e.attribute_type();if(r.map(e=>this.decoder[e]).includes(n)){const t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits(),range:t.range(),min_values:new Float32Array([1,2,3]).map(e=>t.min_value(e))}}finally{this.draco.destroy(t)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:r=[]}=t,n=e.attribute_type();if(r.map(e=>this.decoder[e]).includes(n)){const t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits()}}finally{this.draco.destroy(t)}}return null}}var fo=r(51);const mo={};async function go(e,t=null,r={}){return t&&(e=function(e,t,r){if(e.startsWith("http"))return e;const n=r.modules||{};if(n[e])return n[e];if(!$)return"modules/".concat(t,"/dist/libs/").concat(e);if(r.CDN)return Y(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(t,"@").concat("3.1.8","/dist/libs/").concat(e);if(ee)return"../src/libs/".concat(e);return"modules/".concat(t,"/src/libs/").concat(e)}(e,t,r)),mo[e]=mo[e]||async function(e){if(e.endsWith("wasm")){const t=await fetch(e);return await t.arrayBuffer()}if(!$)try{return fo&&fo.requireFromFile&&await fo.requireFromFile(e)}catch{return null}if(ee)return importScripts(e);const t=await fetch(e);return function(e,t){if(!$)return fo.requireFromString&&fo.requireFromString(e,t);if(ee)return eval.call(Z,e),null;const r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch(t){r.text=e}return document.body.appendChild(r),null}(await t.text(),e)}(e),await mo[e]}const bo="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),yo="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),vo="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.wasm"),wo="https://raw.githubusercontent.com/google/draco/".concat("1.4.1","/javascript/draco_encoder.js");let _o,ko;async function xo(e){const t=e.modules||{};return _o=t.draco3d?_o||t.draco3d.createDecoderModule({}).then(e=>({draco:e})):_o||async function(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await go(bo,"draco",e);break;case"wasm":default:[t,r]=await Promise.all([await go(yo,"draco",e),await go(vo,"draco",e)])}return t=t||globalThis.DracoDecoderModule,await function(e,t){const r={};t&&(r.wasmBinary=t);return new Promise(t=>{e({...r,onModuleLoaded:e=>t({draco:e})})})}(t,r)}(e),await _o}async function Eo(e){const t=e.modules||{};return ko=t.draco3d?ko||t.draco3d.createEncoderModule({}).then(e=>({draco:e})):ko||async function(e){let t=await go(wo,"draco",e);return t=t||globalThis.DracoEncoderModule,new Promise(e=>{t({onModuleLoaded:t=>e({draco:t})})})}(e),await ko}const Ao={...Pa,parse:async function(e,t){const{draco:r}=await xo(t),n=new po(r);try{return n.parseSync(e,null==t?void 0:t.draco)}finally{n.destroy()}}};const So={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},jo={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,...So},To={[So.DOUBLE]:Float64Array,[So.FLOAT]:Float32Array,[So.UNSIGNED_SHORT]:Uint16Array,[So.UNSIGNED_INT]:Uint32Array,[So.UNSIGNED_BYTE]:Uint8Array,[So.BYTE]:Int8Array,[So.SHORT]:Int16Array,[So.INT]:Int32Array},Co={DOUBLE:So.DOUBLE,FLOAT:So.FLOAT,UNSIGNED_SHORT:So.UNSIGNED_SHORT,UNSIGNED_INT:So.UNSIGNED_INT,UNSIGNED_BYTE:So.UNSIGNED_BYTE,BYTE:So.BYTE,SHORT:So.SHORT,INT:So.INT};class Bo{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(const t in To){if(To[t]===e)return t}throw new Error("Failed to convert GL type")}static fromName(e){const t=Co[e];if(!t)throw new Error("Failed to convert GL type");return t}static getArrayType(e){switch(e){case So.UNSIGNED_SHORT_5_6_5:case So.UNSIGNED_SHORT_4_4_4_4:case So.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const t=To[e];if(!t)throw new Error("Failed to convert GL type");return t}}static getByteSize(e){return Bo.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return Boolean(Bo.getArrayType(e))}static createTypedArray(e,t,r=0,n){void 0===n&&(n=(t.byteLength-r)/Bo.getByteSize(e));return new(Bo.getArrayType(e))(t,r,n)}}class Oo{constructor(e,t){Object(p.a)(this,"json",void 0),Object(p.a)(this,"buffer",void 0),Object(p.a)(this,"featuresLength",0),Object(p.a)(this,"_cachedTypedArrays",{}),this.json=e,this.buffer=t}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return Boolean(this.json[e])}getGlobalProperty(e,t=jo.UNSIGNED_INT,r=1){const n=this.json[e];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(e,t,r,1,n.byteOffset):n}getPropertyArray(e,t,r){const n=this.json[e];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(t=Bo.fromName(n.componentType)),this._getTypedArrayFromBinary(e,t,r,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(e,t,n)}getProperty(e,t,r,n,i){const a=this.json[e];if(!a)return a;const o=this.getPropertyArray(e,t,r);if(1===r)return o[n];for(let e=0;e<r;++e)i[e]=o[r*n+e];return i}_getTypedArrayFromBinary(e,t,r,n,i){const a=this._cachedTypedArrays;let o=a[e];return o||(o=Bo.createTypedArray(t,this.buffer.buffer,this.buffer.byteOffset+i,n*r),a[e]=o),o}_getTypedArrayFromArray(e,t,r){const n=this._cachedTypedArrays;let i=n[e];return i||(i=Bo.createTypedArray(t,r),n[e]=i),i}}const Ro={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Io={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},Po={SCALAR:(e,t,r)=>{t[r]=e},VEC2:(e,t,r)=>{t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:(e,t,r)=>{t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:(e,t,r)=>{t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:(e,t,r)=>{t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};const Do=e=>void 0!==e;function Mo(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy");const i=t.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?function(e,t){let r,n,i;const a=e.instancesLength,o=e.classes;let s,c=e.classIds,u=e.parentCounts,l=e.parentIds,h=a;Do(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,a));if(Do(u))for(Do(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,a)),s=new Uint16Array(a),h=0,r=0;r<a;++r)s[r]=h,h+=u[r];Do(l)&&Do(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,i=getBinaryAccessor(l),l=i.createArrayBufferView(t.buffer,t.byteOffset+l.byteOffset,h));const p=o.length;for(r=0;r<p;++r){const e=o[r].length,n=o[r].instances,i=getBinaryProperties(e,n,t);o[r].instances=combine(i,n)}const f=new Array(p).fill(0),d=new Uint16Array(a);for(r=0;r<a;++r)n=c[r],d[r]=f[n],++f[n];const m={classes:o,classIds:c,classIndexes:d,parentCounts:u,parentIndexes:s,parentIds:l};return function(e){const t=e.classIds.length;for(let r=0;r<t;++r)Lo(e,r,stack)}(m),m}(n,r):null}function Fo(e,t,r){if(!e)return;const n=e.parentCounts;return e.parentIds?r(e,t):n>0?function(e,t,r){const n=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=n.length,c=scratchVisited;c.length=Math.max(c.length,s);const u=++marker,l=scratchStack;l.length=0,l.push(t);for(;l.length>0;){if(t=l.pop(),c[t]===u)continue;c[t]=u;const n=r(e,t);if(Do(n))return n;const s=i[t],h=o[t];for(let e=0;e<s;++e){const r=a[h+e];r!==t&&l.push(r)}}return null}(e,t,r):function(e,t,r){let n=!0;for(;n;){const i=r(e,t);if(Do(i))return i;const a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}(e,t,r)}function Lo(e,t,r){const n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,o=e.classIds.length;if(!Do(i))return;assert(t<o,"Parent index ".concat(t," exceeds the total number of instances: ").concat(o)),assert(-1===r.indexOf(t),"Circular dependency detected in the batch table hierarchy."),r.push(t);const s=Do(n)?n[t]:1,c=Do(n)?a[t]:t;for(let n=0;n<s;++n){const a=i[c+n];a!==t&&Lo(e,a,r)}r.pop(t)}function No(e){return null!=e}const zo=(e,t)=>e,Uo={HIERARCHY:!0,extensions:!0,extras:!0};class qo{constructor(e,t,r,n={}){var i;Object(p.a)(this,"json",void 0),Object(p.a)(this,"binary",void 0),Object(p.a)(this,"featureCount",void 0),Object(p.a)(this,"_extensions",void 0),Object(p.a)(this,"_properties",void 0),Object(p.a)(this,"_binaryProperties",void 0),Object(p.a)(this,"_hierarchy",void 0),k(r>=0),this.json=e||{},this.binary=t,this.featureCount=r,this._extensions=(null===(i=this.json)||void 0===i?void 0:i.extensions)||{},this._properties={};for(const e in this.json)Uo[e]||(this._properties[e]=this.json[e]);this._binaryProperties=this._initializeBinaryProperties(),n["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Mo(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,t){if(this._checkBatchId(e),k("string"==typeof t,t),this._hierarchy){return No(Fo(this._hierarchy,e,(e,r)=>{const n=e.classIds[r];return e.classes[n].name===t}))}return!1}isExactClass(e,t){return k("string"==typeof t,t),this.getExactClassName(e)===t}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){const t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}hasProperty(e,t){return this._checkBatchId(e),k("string"==typeof t,t),No(this._properties[t])||this._hasPropertyInHierarchy(e,t)}getPropertyNames(e,t){this._checkBatchId(e),(t=No(t)?t:[]).length=0;const r=Object.keys(this._properties);return t.push(...r),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}getProperty(e,t){if(this._checkBatchId(e),k("string"==typeof t,t),this._binaryProperties){const r=this._binaryProperties[t];if(No(r))return this._getBinaryProperty(r,e)}const r=this._properties[t];if(No(r))return zo(r[e]);if(this._hierarchy){const r=this._getHierarchyProperty(e,t);if(No(r))return r}}setProperty(e,t,r){const n=this.featureCount;if(this._checkBatchId(e),k("string"==typeof t,t),this._binaryProperties){const n=this._binaryProperties[t];if(n)return void this._setBinaryProperty(n,e,r)}if(this._hierarchy&&this._setHierarchyProperty(this,e,t,r))return;let i=this._properties[t];No(i)||(this._properties[t]=new Array(n),i=this._properties[t]),i[e]=zo(r)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,t){return e.unpack(e.typedArray,t)}_setBinaryProperty(e,t,r){e.pack(r,e.typedArray,t)}_initializeBinaryProperties(){let e=null;for(const t in this._properties){const r=this._properties[t],n=this._initializeBinaryProperty(t,r);n&&(e=e||{},e[t]=n)}return e}_initializeBinaryProperty(e,t){if("byteOffset"in t){const r=t;k(this.binary,"Property ".concat(e," requires a batch table binary.")),k(r.type,"Property ".concat(e," requires a type."));const n=function(e,t,r,n){const{componentType:i}=e;k(e.componentType);const a="string"==typeof i?Bo.fromName(i):i,o=Ro[e.type],s=Io[e.type],c=Po[e.type];return r+=e.byteOffset,{values:Bo.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:c}}(r,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}_hasPropertyInHierarchy(e,t){if(!this._hierarchy)return!1;const r=Fo(this._hierarchy,e,(e,r)=>{const n=e.classIds[r];return No(e.classes[n].instances[t])});return No(r)}_getPropertyNamesInHierarchy(e,t){Fo(this._hierarchy,e,(e,r)=>{const n=e.classIds[r],i=e.classes[n].instances;for(const e in i)i.hasOwnProperty(e)&&-1===t.indexOf(e)&&t.push(e)})}_getHierarchyProperty(e,t){return Fo(this._hierarchy,e,(e,r)=>{const n=e.classIds[r],i=e.classes[n],a=e.classIndexes[r],o=i.instances[t];return No(o)?No(o.typedArray)?this._getBinaryProperty(o,a):zo(o[a]):null})}_setHierarchyProperty(e,t,r,n){const i=Fo(this._hierarchy,t,(e,i)=>{const a=e.classIds[i],o=e.classes[a],s=e.classIndexes[i],c=o.instances[r];return!!No(c)&&(k(i===t,'Inherited property "'.concat(r,'" is read-only.')),No(c.typedArray)?this._setBinaryProperty(c,s,n):c[s]=zo(n),!0)});return No(i)}}function Ho(e,t,r=0){const n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=4,e.version=n.getUint32(r,!0),r+=4,e.byteLength=n.getUint32(r,!0),r+=4,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return r}function Go(e,t,r){const n=new DataView(t);let i;e.header=e.header||{};let a=n.getUint32(r,!0);r+=4;let o=n.getUint32(r,!0);r+=4;let s=n.getUint32(r,!0);r+=4;let c=n.getUint32(r,!0);return r+=4,s>=570425344?(r-=8,i=a,s=o,c=0,a=0,o=0,console.warn("b3dm tile in legacy format.")):c>=570425344&&(r-=4,i=s,s=a,c=o,a=0,o=0,console.warn("b3dm tile in legacy format.")),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=c,e.header.batchLength=i,r}function Vo(e,t,r,n){return r=function(e,t,r,n){const{featureTableJsonByteLength:i,featureTableBinaryByteLength:a,batchLength:o}=e.header;if(e.featureTableJson={BATCH_LENGTH:o||0},i>0){const n=Ia(t,r,i);e.featureTableJson=JSON.parse(n)}return r+=i,e.featureTableBinary=new Uint8Array(t,r,a),r+=a}(e,t,r),r=function(e,t,r,n){const{batchTableJsonByteLength:i,batchTableBinaryByteLength:a}=e.header;if(i>0){const n=Ia(t,r,i);e.batchTableJson=JSON.parse(n),r+=i,a>0&&(e.batchTableBinary=new Uint8Array(t,r,a),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=a)}return r}(e,t,r)}function Wo(e,t=[0,0,0]){const r=e>>11&31,n=e>>5&63,i=31&e;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}function Ko(e,t,r){if(!(t||e&&e.batchIds&&r))return null;const{batchIds:n,isRGB565:i,pointCount:a}=e;if(n&&r){const e=new Uint8ClampedArray(3*a);for(let t=0;t<a;t++){const i=n[t],a=r.getProperty(i,"dimensions").map(e=>255*e);e[3*t]=a[0],e[3*t+1]=a[1],e[3*t+2]=a[2]}return{type:jo.UNSIGNED_BYTE,value:e,size:3,normalized:!0}}if(i){const e=new Uint8ClampedArray(3*a);for(let r=0;r<a;r++){const n=Wo(t[r]);e[3*r]=n[0],e[3*r+1]=n[1],e[3*r+2]=n[2]}return{type:jo.UNSIGNED_BYTE,value:e,size:3,normalized:!0}}return t&&t.length===3*a?{type:jo.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:jo.UNSIGNED_BYTE,value:t,size:4,normalized:!0}}class Jo extends kr{constructor(e=0,t=0){super(2),Dt(e)&&1===arguments.length?this.copy(e):(It.debug&&(qt(e),qt(t)),this[0]=e,this[1]=t)}set(e,t){return this[0]=e,this[1]=t,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this.check()}fromObject(e){return It.debug&&(qt(e.x),qt(e.y)),this[0]=e.x,this[1]=e.y,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return nr(this,this,e),this.check()}transformAsVector(e){return Jt(this,this,e),this.check()}transformByMatrix3(e){return rr(this,this,e),this.check()}transformByMatrix2x3(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5]}(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i}(this,this,e),this.check()}}function Qo(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}new Jo,new Ar,new Jo,new Jo,new Uint8Array(1);function Yo(e,t=255){return zt(e,0,t)/t*2-1}function Xo(e){return e<0?-1:1}function Zo(e,t,r,n){if(Qo(n),e<0||e>r||t<0||t>r)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(r));if(n.x=Yo(e,r),n.y=Yo(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){const e=n.x;n.x=(1-Math.abs(n.y))*Xo(e),n.y=(1-Math.abs(e))*Xo(n.y)}return n.normalize()}function $o(e,t,r){return Zo(e,t,255,r)}const es=new Ar;function ts(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,function(e,t){const r=new Ar,n=new Float32Array(3*e.pointCount);for(let i=0;i<e.pointCount;i++)r.set(t[3*i],t[3*i+1],t[3*i+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,3*i);return n}(e,t)):{type:jo.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}async function rs(e,t,r,n,i){r=Vo(e,t,r=Go(e,t,r=Ho(e,t,r))),function(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}(e);const{featureTable:a,batchTable:o}=function(e){const t=new Oo(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",jo.FLOAT,3);const n=function(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",jo.UNSIGNED_SHORT,1),e.batchIds)){const n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:i,batchTableBinary:a}=e;r=new qo(i,a,n)}return r}(e,t);return{featureTable:t,batchTable:n}}(e);return await async function(e,t,r,n,i){let a,o,s;const c=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];c&&(s=c.properties);const u=t.getExtension("3DTILES_draco_point_compression");if(u){o=u.properties;const t=u.byteOffset,r=u.byteLength;if(!o||!Number.isFinite(t)||!r)throw new Error("Draco properties, byteOffset, and byteLength must be defined");a=e.featureTableBinary.slice(t,t+r),e.hasPositions=Number.isFinite(o.POSITION),e.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),e.hasNormals=Number.isFinite(o.NORMAL),e.hasBatchIds=Number.isFinite(o.BATCH_ID),e.isTranslucent=Number.isFinite(o.RGBA)}if(!a)return!0;const l={buffer:a,properties:{...o,...s},featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await async function(e,t,r,n){const{parse:i}=n,a={...r,draco:{...r.draco,extraAttributes:t.batchTableProperties||{}}};delete a["3d-tiles"];const o=await i(t.buffer,Ao,a),s=o.attributes.POSITION&&o.attributes.POSITION.value,c=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,u=o.attributes.NORMAL&&o.attributes.NORMAL.value,l=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,h=s&&o.attributes.POSITION.value.quantization,p=u&&o.attributes.NORMAL.value.quantization;if(h){const t=o.POSITION.data.quantization,r=t.range;e.quantizedVolumeScale=new Ar(r,r,r),e.quantizedVolumeOffset=new Ar(t.minValues),e.quantizedRange=(1<<t.quantizationBits)-1,e.isQuantizedDraco=!0}p&&(e.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);const f={};if(t.batchTableProperties)for(const e of Object.keys(t.batchTableProperties))o.attributes[e]&&o.attributes[e].value&&(f[e.toLowerCase()]=o.attributes[e].value);e.attributes={positions:s,colors:Ko(e,c,void 0),normals:u,batchIds:l,...f}}(e,l,n,i)}(e,a,0,n,i),function(e,t,r){if(!e.attributes.positions)if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",jo.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){const n=t.getPropertyArray("POSITION_QUANTIZED",jo.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=65535,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",jo.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",jo.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=ts(e,n,r)}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(e,a,n),function(e,t,r){if(!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",jo.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",jo.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",jo.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=Ko(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",jo.UNSIGNED_BYTE,4))}(e,a,o),function(e,t){if(!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",jo.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",jo.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=function(e,t){if(!t)return null;if(e.isOctEncoded16P){const r=new Float32Array(3*e.pointsLength);for(let n=0;n<e.pointsLength;n++)$o(t[2*n],t[2*n+1],es),es.toArray(r,3*n);return{type:jo.FLOAT,size:2,value:r}}return{type:jo.FLOAT,size:2,value:t}}(e,r)}}(e,a),r}const ns="https://unpkg.com/@loaders.gl/textures@".concat("3.1.8","/dist/libs/basis_encoder.wasm"),is="https://unpkg.com/@loaders.gl/textures@".concat("3.1.8","/dist/libs/basis_encoder.js");let as,os;async function ss(e){const t=e.modules||{};return t.basis?t.basis:(as=as||async function(e){let t=null,r=null;return[t,r]=await Promise.all([await go("basis_transcoder.js","textures",e),await go("basis_transcoder.wasm","textures",e)]),t=t||globalThis.BASIS,await function(e,t){const r={};t&&(r.wasmBinary=t);return new Promise(t=>{e(r).then(e=>{const{BasisFile:r,initializeBasis:n}=e;n(),t({BasisFile:r})})})}(t,r)}(e),await as)}async function cs(e){const t=e.modules||{};return t.basisEncoder?t.basisEncoder:(os=os||async function(e){let t=null,r=null;return[t,r]=await Promise.all([await go(is,"textures",e),await go(ns,"textures",e)]),t=t||globalThis.BASIS,await function(e,t){const r={};t&&(r.wasmBinary=t);return new Promise(t=>{e(r).then(e=>{const{BasisFile:r,KTX2File:n,initializeBasis:i,BasisEncoder:a}=e;i(),t({BasisFile:r,KTX2File:n,BasisEncoder:a})})})}(t,r)}(e),await os)}const us={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919},ls=["","WEBKIT_","MOZ_"],hs={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let ps=null;function fs(e){if(!ps){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,ps=new Set;for(const t of ls)for(const r in hs)if(e&&e.getExtension("".concat(t).concat(r))){const e=hs[r];ps.add(e)}}return ps}new Uint8Array([0]);const ds=[171,75,84,88,32,50,48,187,13,10,26,10];var ms,gs,bs,ys,vs,ws,_s,ks,xs;(xs=ms||(ms={}))[xs.NONE=0]="NONE",xs[xs.BASISLZ=1]="BASISLZ",xs[xs.ZSTD=2]="ZSTD",xs[xs.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(gs||(gs={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(bs||(bs={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(ys||(ys={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(vs||(vs={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(ws||(ws={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(_s||(_s={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(ks||(ks={}));class Es{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=ms.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:gs.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:bs.UNSPECIFIED,colorPrimaries:ys.SRGB,transferFunction:ys.SRGB,flags:ws.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}}class As{constructor(e,t,r,n){this._dataView=new DataView(e.buffer,e.byteOffset+t,r),this._littleEndian=n,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const r=this._offset;let n=0;for(;this._dataView.getUint8(this._offset)!==t&&n<e;)n++,this._offset++;return n<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+r,n)}}function Ss(e){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(e):Buffer.from(e).toString("utf8")}function js(e,t){const r=new Array(t.mipMapLevels);let n=t.width,i=t.height,a=0;for(let o=0;o<t.mipMapLevels;++o){const s=Cs(t,n,i,e,o),c=Ts(e,o,a,s);r[o]={compressed:!0,format:t.internalFormat,data:c,width:n,height:i,levelSize:s},n=Math.max(1,n>>1),i=Math.max(1,i>>1),a+=s}return r}function Ts(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function Cs(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}const Bs={131:us.COMPRESSED_RGB_S3TC_DXT1_EXT,132:us.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:us.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:us.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:us.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:us.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:us.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:us.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:us.COMPRESSED_RED_RGTC1_EXT,140:us.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:us.COMPRESSED_RED_GREEN_RGTC2_EXT,142:us.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:us.COMPRESSED_RGB8_ETC2,148:us.COMPRESSED_SRGB8_ETC2,149:us.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:us.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:us.COMPRESSED_RGBA8_ETC2_EAC,152:us.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:us.COMPRESSED_R11_EAC,154:us.COMPRESSED_SIGNED_R11_EAC,155:us.COMPRESSED_RG11_EAC,156:us.COMPRESSED_SIGNED_RG11_EAC,157:us.COMPRESSED_RGBA_ASTC_4x4_KHR,158:us.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:us.COMPRESSED_RGBA_ASTC_5x4_KHR,160:us.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:us.COMPRESSED_RGBA_ASTC_5x5_KHR,162:us.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:us.COMPRESSED_RGBA_ASTC_6x5_KHR,164:us.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:us.COMPRESSED_RGBA_ASTC_6x6_KHR,166:us.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:us.COMPRESSED_RGBA_ASTC_8x5_KHR,168:us.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:us.COMPRESSED_RGBA_ASTC_8x6_KHR,170:us.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:us.COMPRESSED_RGBA_ASTC_8x8_KHR,172:us.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:us.COMPRESSED_RGBA_ASTC_10x5_KHR,174:us.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:us.COMPRESSED_RGBA_ASTC_10x6_KHR,176:us.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:us.COMPRESSED_RGBA_ASTC_10x8_KHR,178:us.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:us.COMPRESSED_RGBA_ASTC_10x10_KHR,180:us.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:us.COMPRESSED_RGBA_ASTC_12x10_KHR,182:us.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:us.COMPRESSED_RGBA_ASTC_12x12_KHR,184:us.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:us.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:us.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:us.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:us.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:us.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:us.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:us.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:us.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:us.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:us.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:us.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:us.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:us.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:us.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:us.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:us.COMPRESSED_RGBA_ASTC_12x12_KHR};const Os=[171,75,84,88,32,50,48,187,13,10,26,10];function Rs(e){const t=new Uint8Array(e);return!(t.byteLength<Os.length||t[0]!==Os[0]||t[1]!==Os[1]||t[2]!==Os[2]||t[3]!==Os[3]||t[4]!==Os[4]||t[5]!==Os[5]||t[6]!==Os[6]||t[7]!==Os[7]||t[8]!==Os[8]||t[9]!==Os[9]||t[10]!==Os[10]||t[11]!==Os[11])}function Is(e){const t=function(e){const t=new Uint8Array(e.buffer,e.byteOffset,ds.length);if(t[0]!==ds[0]||t[1]!==ds[1]||t[2]!==ds[2]||t[3]!==ds[3]||t[4]!==ds[4]||t[5]!==ds[5]||t[6]!==ds[6]||t[7]!==ds[7]||t[8]!==ds[8]||t[9]!==ds[9]||t[10]!==ds[10]||t[11]!==ds[11])throw new Error("Missing KTX 2.0 identifier.");const r=new Es,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new As(e,ds.length,n,!0);r.vkFormat=i._nextUint32(),r.typeSize=i._nextUint32(),r.pixelWidth=i._nextUint32(),r.pixelHeight=i._nextUint32(),r.pixelDepth=i._nextUint32(),r.layerCount=i._nextUint32(),r.faceCount=i._nextUint32();const a=i._nextUint32();r.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),s=i._nextUint32(),c=i._nextUint32(),u=i._nextUint32(),l=i._nextUint64(),h=i._nextUint64(),p=new As(e,ds.length+n,3*a*8,!0);for(let t=0;t<a;t++)r.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+p._nextUint64(),p._nextUint64()),uncompressedByteLength:p._nextUint64()});const f=new As(e,o,s,!0),d={vendorId:f._skip(4)._nextUint16(),descriptorType:f._nextUint16(),versionNumber:f._nextUint16(),descriptorBlockSize:f._nextUint16(),colorModel:f._nextUint8(),colorPrimaries:f._nextUint8(),transferFunction:f._nextUint8(),flags:f._nextUint8(),texelBlockDimension:{x:f._nextUint8()+1,y:f._nextUint8()+1,z:f._nextUint8()+1,w:f._nextUint8()+1},bytesPlane:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],samples:[]},m=(d.descriptorBlockSize/4-6)/4;for(let e=0;e<m;e++)d.samples[e]={bitOffset:f._nextUint16(),bitLength:f._nextUint8(),channelID:f._nextUint8(),samplePosition:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],sampleLower:f._nextUint32(),sampleUpper:f._nextUint32()};r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(d);const g=new As(e,c,u,!0);for(;g._offset<u;){const e=g._nextUint32(),t=g._scan(e),n=Ss(t),i=g._scan(e-t.byteLength);r.keyValue[n]=n.match(/^ktx/i)?Ss(i):i,e%4&&g._skip(4-e%4)}if(h<=0)return r;const b=new As(e,l,h,!0),y=b._nextUint16(),v=b._nextUint16(),w=b._nextUint32(),_=b._nextUint32(),k=b._nextUint32(),x=b._nextUint32(),E=[];for(let e=0;e<a;e++)E.push({imageFlags:b._nextUint32(),rgbSliceByteOffset:b._nextUint32(),rgbSliceByteLength:b._nextUint32(),alphaSliceByteOffset:b._nextUint32(),alphaSliceByteLength:b._nextUint32()});const A=l+b._offset,S=A+w,j=S+_,T=j+k,C=new Uint8Array(e.buffer,e.byteOffset+A,w),B=new Uint8Array(e.buffer,e.byteOffset+S,_),O=new Uint8Array(e.buffer,e.byteOffset+j,k),R=new Uint8Array(e.buffer,e.byteOffset+T,x);return r.globalData={endpointCount:y,selectorCount:v,imageDescs:E,endpointsData:C,selectorsData:B,tablesData:O,extendedData:R},r}(new Uint8Array(e)),r=Math.max(1,t.levels.length),n=t.pixelWidth,i=t.pixelHeight,a=(o=t.vkFormat,Bs[o]);var o;return js(t.levels,{mipMapLevels:r,width:n,height:i,sizeFunction:e=>e.uncompressedByteLength,internalFormat:a})}const Ps={etc1:{basisFormat:0,compressed:!0,format:us.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:us.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:us.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:us.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:us.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:us.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function Ds(e,t){if("auto"===t.basis.containerFormat){if(Rs(e)){return Ls((await cs(t)).KTX2File,e,t)}const{BasisFile:r}=await ss(t);return Ms(r,e,t)}switch(t.basis.module){case"encoder":const r=await cs(t);switch(t.basis.containerFormat){case"ktx2":return Ls(r.KTX2File,e,t);case"basis":default:return Ms(r.BasisFile,e,t)}case"transcoder":default:const{BasisFile:n}=await ss(t);return Ms(n,e,t)}}function Ms(e,t,r){const n=new e(new Uint8Array(t));try{if(!n.startTranscoding())return null;const e=n.getNumImages(),t=[];for(let i=0;i<e;i++){const e=n.getNumLevels(i),a=[];for(let t=0;t<e;t++)a.push(Fs(n,i,t,r));t.push(a)}return t}finally{n.close(),n.delete()}}function Fs(e,t,r,n){const i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:c,basisFormat:u}=zs(n,o),l=e.getImageTranscodedSizeInBytes(t,r,u),h=new Uint8Array(l);return e.transcodeImage(h,t,r,u,0,0)?{width:i,height:a,data:h,compressed:s,hasAlpha:o,format:c}:null}function Ls(e,t,r){const n=new e(new Uint8Array(t));try{if(!n.startTranscoding())return null;const e=n.getLevels(),t=[];for(let i=0;i<e;i++){t.push(Ns(n,i,r));break}return t}finally{n.close(),n.delete()}}function Ns(e,t,r){const{alphaFlag:n,height:i,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:c}=zs(r,n),u=e.getImageTranscodedSizeInBytes(t,0,0,c),l=new Uint8Array(u);return e.transcodeImage(l,t,0,0,c,0,-1,-1)?{width:a,height:i,data:l,compressed:o,alphaFlag:n,format:s}:null}function zs(e,t){let r=e&&e.basis&&e.basis.format;return"auto"===r&&(r=Us()),"object"==typeof r&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),Ps[r]}function Us(){const e=fs();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}const qs={name:"Basis",id:"basis",module:"textures",version:"3.1.8",worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},Hs={...qs,parse:Ds},{_parseImageNode:Gs}=globalThis,Vs="undefined"!=typeof Image,Ws="undefined"!=typeof ImageBitmap,Ks=Boolean(Gs),Js=!!Ee||Ks;function Qs(e){const t=Xs(e);if(!t)throw new Error("Not an image");return t}function Ys(e){switch(Qs(e)){case"data":return e;case"image":case"imagebitmap":const t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function Xs(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"==typeof e&&e.data&&e.width&&e.height?"data":null}const Zs=/^data:image\/svg\+xml/,$s=/\.svg((\?|#).*)?$/;function ec(e){return e&&(Zs.test(e)||$s.test(e))}function tc(e,t){if(ec(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function rc(e,t,r){const n=function(e,t){if(ec(t)){let t=(new TextDecoder).decode(e);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(t=unescape(encodeURIComponent(t)))}catch(e){throw new Error(e.message)}return"data:image/svg+xml;base64,".concat(btoa(t))}return tc(e,t)}(e,r),i=self.URL||self.webkitURL,a="string"!=typeof n&&i.createObjectURL(n);try{return await async function(e,t){const r=new Image;if(r.src=e,t.image&&t.image.decode&&r.decode)return await r.decode(),r;return await new Promise((t,n)=>{try{r.onload=()=>t(r),r.onerror=t=>n(new Error("Could not load image ".concat(e,": ").concat(t)))}catch(e){n(e)}})}(a||n,t)}finally{a&&i.revokeObjectURL(a)}}const nc={};let ic=!0;async function ac(e,t,r){let n;if(ec(r)){n=await rc(e,t,r)}else n=tc(e,r);const i=t&&t.imagebitmap;return await async function(e,t=null){!function(e){for(const t in e||nc)return!1;return!0}(t)&&ic||(t=null);if(t)try{return await createImageBitmap(e,t)}catch(e){console.warn(e),ic=!1}return await createImageBitmap(e)}(n,i)}function oc(e){const t=sc(e);return function(e){const t=sc(e);if(!(t.byteLength>=24&&2303741511===t.getUint32(0,!1)))return null;return{mimeType:"image/png",width:t.getUint32(16,!1),height:t.getUint32(20,!1)}}(t)||function(e){const t=sc(e);if(!(t.byteLength>=3&&65496===t.getUint16(0,!1)&&255===t.getUint8(2)))return null;const{tableMarkers:r,sofMarkers:n}=function(){const e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);const t=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:t}}();let i=2;for(;i+9<t.byteLength;){const e=t.getUint16(i,!1);if(n.has(e))return{mimeType:"image/jpeg",height:t.getUint16(i+5,!1),width:t.getUint16(i+7,!1)};if(!r.has(e))return null;i+=2,i+=t.getUint16(i,!1)}return null}(t)||function(e){const t=sc(e);if(!(t.byteLength>=10&&1195984440===t.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:t.getUint16(6,!0),height:t.getUint16(8,!0)}}(t)||function(e){const t=sc(e);if(!(t.byteLength>=14&&16973===t.getUint16(0,!1)&&t.getUint32(2,!0)===t.byteLength))return null;return{mimeType:"image/bmp",width:t.getUint32(18,!0),height:t.getUint32(22,!0)}}(t)}function sc(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}const cc={id:"image",module:"images",name:"Images",version:"3.1.8",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(e,t,r){const n=((t=t||{}).image||{}).type||"auto",{url:i}=r||{};let a;switch(function(e){switch(e){case"auto":case"data":return function(){if(Ws)return"imagebitmap";if(Vs)return"image";if(Js)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return Ws||Vs||Js;case"imagebitmap":return Ws;case"image":return Vs;case"data":return Js;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}(n)){case"imagebitmap":a=await ac(e,t,i);break;case"image":a=await rc(e,t,i);break;case"data":a=await async function(e,t){const{mimeType:r}=oc(e)||{},n=globalThis._parseImageNode;return k(n),await n(e,r)}(e);break;default:k(!1)}return"data"===n&&(a=Ys(a)),a},tests:[e=>Boolean(oc(new DataView(e)))],options:{image:{type:"auto",decode:!0}}};function uc(e,t,r){if(e.byteLength<=t+r)return"";const n=new DataView(e);let i="";for(let e=0;e<r;e++)i+=String.fromCharCode(n.getUint8(t+e));return i}function lc(e){try{return JSON.parse(e)}catch(t){throw new Error('Failed to parse JSON from data starting with "'.concat(function(e,t=5){if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return uc(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){return uc(e,0,t)}return""}(e),'"'))}}function hc(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function pc(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;const r=t.baseUri||t.uri;if(!r)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return r.substr(0,r.lastIndexOf("/")+1)+e}function fc(e,t,r){const n=e.bufferViews[r];hc(n);const i=t[n.buffer];hc(i);const a=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,a,n.byteLength)}function dc(e,t){return k(e>=0),k(t>0),e+(t-1)&~(t-1)}function mc(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{const t=e.byteOffset,r=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,t,r)}return t.set(n,r),r+dc(n.byteLength,4)}const gc=["SCALAR","VEC2","VEC3","VEC4"],bc=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],yc=new Map(bc),vc={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},wc={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},_c={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function kc(e){return gc[e-1]||gc[0]}function xc(e){const t=yc.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Ec(e,t){const r=_c[e.componentType],n=vc[e.type],i=wc[e.componentType],a=e.count*n,o=e.count*n*i;return hc(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}const Ac={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class Sc{constructor(e){Object(p.a)(this,"gltf",void 0),Object(p.a)(this,"sourceBuffers",void 0),Object(p.a)(this,"byteLength",void 0),this.gltf=e||{json:{...Ac},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){const t=this.getUsedExtensions().find(t=>t===e),r=this.json.extensions||{};return t?r[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(t=>t===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const r=this.json[e]&&this.json[e][t];if(!r)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return r}getTypedArrayForBufferView(e){const t=(e=this.getBufferView(e)).buffer,r=this.gltf.buffers[t];hc(r);const n=(e.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:n,length:i}=Ec(e,t);return new n(r,t.byteOffset+e.byteOffset,i)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=t.byteOffset||0;return new Uint8Array(r,n,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,r){return e.extensions=e.extensions||{},e.extensions[t]=r,this.registerUsedExtension(t),this}setObjectExtension(e,t,r){(e.extensions||{})[t]=r}removeObjectExtension(e,t){const r=e.extensions||{},n=r[t];return delete r[t],n}addExtension(e,t={}){return hc(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return hc(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:r}=e;this.json.nodes=this.json.nodes||[];const n={mesh:t};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:r,material:n,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(r){const e=this._addIndices(r);a.primitives[0].indices=e}return Number.isFinite(n)&&(a.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}addImage(e,t){const r=oc(e),n=t||(null==r?void 0:r.mimeType),i={bufferView:this.addBufferView(e),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(e){const t=e.byteLength;hc(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const r={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=dc(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}addAccessor(e,t){const r={bufferView:e,type:kc(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const r=this.addBufferView(e);let n={min:t.min,max:t.max};n.min&&n.max||(n=this._getAccessorMinMax(e,t.size));const i={size:t.size,componentType:xc(e),count:Math.round(e.length/t.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(i,t))}addTexture(e){const{imageIndex:t}=e,r={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(r),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const r=this.byteLength,n=new ArrayBuffer(r),i=new Uint8Array(n);let a=0;for(const e of this.sourceBuffers||[])a=mc(e,i,a);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=r:this.json.buffers=[{byteLength:r}],this.gltf.binary=n,this.sourceBuffers=[n]}_removeStringFromArray(e,t){let r=!0;for(;r;){const n=e.indexOf(t);n>-1?e.splice(n,1):r=!1}}_addAttributes(e={}){const t={};for(const r in e){const n=e[r],i=this._getGltfAttributeName(r),a=this.addBinaryBuffer(n.value,n);t[i]=a}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const r={min:null,max:null};if(e.length<t)return r;r.min=[],r.max=[];const n=e.subarray(0,t);for(const e of n)r.min.push(e),r.max.push(e);for(let n=t;n<e.length;n+=t)for(let i=0;i<t;i++)r.min[0+i]=Math.min(r.min[0+i],e[n+i]),r.max[0+i]=Math.max(r.max[0+i],e[n+i]);return r}}const jc="object"!=typeof WebAssembly,Tc=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Cc=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Bc={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Oc={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};let Rc;async function Ic(){return Rc||(Rc=async function(){let e="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(Tc)&&(e="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",console.log("Warning: meshopt_decoder is using experimental SIMD support"));const t=await WebAssembly.instantiate(function(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);t[r]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?Cc[t[n]]:64*(t[n]-60)+t[++n];return t.buffer.slice(0,r)}(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}()),Rc}function Pc(e,t,r,n,i,a,o){const s=e.exports.sbrk,c=n+3&-4,u=s(c*i),l=s(a.length),h=new Uint8Array(e.exports.memory.buffer);h.set(a,l);const p=t(u,n,i,l,a.length);if(0===p&&o&&o(u,c,i),r.set(h.subarray(u,u+n*i)),s(u-s(0)),0!==p)throw new Error("Malformed buffer data: ".concat(p))}const Dc="EXT_meshopt_compression";function Mc(e){if(new Sc(e).getRequiredExtensions().includes("EXT_meshopt_compression")&&!jc)throw new Error("gltf: Required extension ".concat("EXT_meshopt_compression"," not supported by browser"))}async function Fc(e,t){var r;const n=new Sc(e);if(null==t||null===(r=t.gltf)||void 0===r||!r.decompressMeshes)return;const i=[];for(const t of e.json.bufferViews||[])i.push(Lc(n,t));await Promise.all(i),n.removeExtension("EXT_meshopt_compression")}async function Lc(e,t){const r=e.getObjectExtension(t,"EXT_meshopt_compression");if(r){const e=t.buffer,{byteOffset:n=0,byteLength:i=0,byteStride:a,count:o,mode:s,filter:c="NONE"}=r,u=new Uint8Array(e,n,i),l=new ArrayBuffer(o*a);return await async function(e,t,r,n,i,a="NONE"){const o=await Ic();Pc(o,o.exports[Oc[i]],e,t,r,n,o.exports[Bc[a||"NONE"]])}(new Uint8Array(l),o,a,u,s,c),l}return null}const Nc=["image/png","image/jpeg","image/gif"],zc={};function Uc(e){return void 0===zc[e]&&(zc[e]=function(e){switch(e){case"image/webp":return function(){if(!Ee)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch{return!1}}();case"image/svg":return Ee;default:if(!Ee){const{_parseImageNode:t}=globalThis;return Boolean(t)&&Nc.includes(e)}return!0}}(e)),zc[e]}const qc="EXT_texture_webp";function Hc(e,t){const r=new Sc(e);if(!Uc("image/webp")){if(r.getRequiredExtensions().includes("EXT_texture_webp"))throw new Error("gltf: Required extension ".concat("EXT_texture_webp"," not supported by browser"));return}const{json:n}=r;for(const e of n.textures||[]){const t=r.getObjectExtension(e,"EXT_texture_webp");t&&(e.source=t.source),r.removeObjectExtension(e,"EXT_texture_webp")}r.removeExtension("EXT_texture_webp")}const Gc="KHR_texture_basisu";function Vc(e,t){const r=new Sc(e),{json:n}=r;for(const e of n.textures||[]){const t=r.getObjectExtension(e,"KHR_texture_basisu");t&&(e.source=t.source),r.removeObjectExtension(e,"KHR_texture_basisu")}r.removeExtension("KHR_texture_basisu")}function Wc(e){const{buffer:t,size:r,count:n}=function(e){let t=e,r=1,n=0;e&&e.value&&(t=e.value,r=e.size||1);t&&(ArrayBuffer.isView(t)||(t=function(e,t,r=!1){if(!e)return null;if(Array.isArray(e))return new t(e);if(r&&!(e instanceof t))return new t(e);return e}(t,Float32Array)),n=t.length/r);return{buffer:t,size:r,count:n}}(e);return{value:t,size:r,byteOffset:0,count:n,type:kc(r),componentType:xc(t)}}const Kc="KHR_draco_mesh_compression";function Jc(e,t,r){const n=new Sc(e);for(const e of $c(n))n.getObjectExtension(e,"KHR_draco_mesh_compression")}async function Qc(e,t,r){var n;if(null==t||null===(n=t.gltf)||void 0===n||!n.decompressMeshes)return;const i=new Sc(e),a=[];for(const e of $c(i))i.getObjectExtension(e,"KHR_draco_mesh_compression")&&a.push(Xc(i,e,t,r));await Promise.all(a),i.removeExtension("KHR_draco_mesh_compression")}function Yc(e,t={}){const r=new Sc(e);for(const e of r.json.meshes||[])Zc(e,t),r.addRequiredExtension("KHR_draco_mesh_compression")}async function Xc(e,t,r,n){const i=e.getObjectExtension(t,"KHR_draco_mesh_compression");if(!i)return;const a=e.getTypedArrayForBufferView(i.bufferView),o=_e(a.buffer,a.byteOffset),{parse:s}=n,c={...r};delete c["3d-tiles"];const u=await s(o,Ao,c,n),l=function(e){const t={};for(const r in e){const n=e[r];if("indices"!==r){const e=Wc(n);t[r]=e}}return t}(u.attributes);for(const[r,n]of Object.entries(l))if(r in t.attributes){const i=t.attributes[r],a=e.getAccessor(i);null!=a&&a.min&&null!=a&&a.max&&(n.min=a.min,n.max=a.max)}t.attributes=l,u.indices&&(t.indices=Wc(u.indices)),function(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(t)}function Zc(e,t,r=4,n,i){var a;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const o=n.DracoWriter.encodeSync({attributes:e}),s=null==i||null===(a=i.parseSync)||void 0===a?void 0:a.call(i,{attributes:e}),c=n._addFauxAttributes(s.attributes);return{primitives:[{attributes:c,mode:r,extensions:{KHR_draco_mesh_compression:{bufferView:n.addBufferView(o),attributes:c}}}]}}function*$c(e){for(const t of e.json.meshes||[])for(const e of t.primitives)yield e}const eu="KHR_lights_punctual";async function tu(e){const t=new Sc(e),{json:r}=t,n=t.getExtension("KHR_lights_punctual");n&&(t.json.lights=n.lights,t.removeExtension("KHR_lights_punctual"));for(const e of r.nodes||[]){const r=t.getObjectExtension(e,"KHR_lights_punctual");r&&(e.light=r.light),t.removeObjectExtension(e,"KHR_lights_punctual")}}async function ru(e){const t=new Sc(e),{json:r}=t;if(r.lights){const e=t.addExtension("KHR_lights_punctual");hc(!e.lights),e.lights=r.lights,delete r.lights}if(t.json.lights){for(const e of t.json.lights){const r=e.node;t.addObjectExtension(r,"KHR_lights_punctual",e)}delete t.json.lights}}const nu="KHR_materials_unlit";async function iu(e){const t=new Sc(e),{json:r}=t;t.removeExtension("KHR_materials_unlit");for(const e of r.materials||[]){e.extensions&&e.extensions.KHR_materials_unlit&&(e.unlit=!0),t.removeObjectExtension(e,"KHR_materials_unlit")}}function au(e){const t=new Sc(e),{json:r}=t;if(t.materials)for(const e of r.materials||[])e.unlit&&(delete e.unlit,t.addObjectExtension(e,"KHR_materials_unlit",{}),t.addExtension("KHR_materials_unlit"))}const ou="KHR_techniques_webgl";async function su(e){const t=new Sc(e),{json:r}=t,n=t.getExtension("KHR_techniques_webgl");if(n){const e=function(e,t){const{programs:r=[],shaders:n=[],techniques:i=[]}=e,a=new TextDecoder;return n.forEach(e=>{if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=a.decode(t.getTypedArrayForBufferView(e.bufferView))}),r.forEach(e=>{e.fragmentShader=n[e.fragmentShader],e.vertexShader=n[e.vertexShader]}),i.forEach(e=>{e.program=r[e.program]}),i}(n,t);for(const n of r.materials||[]){const r=t.getObjectExtension(n,"KHR_techniques_webgl");r&&(n.technique=Object.assign({},r,e[r.technique]),n.technique.values=uu(n.technique,t)),t.removeObjectExtension(n,"KHR_techniques_webgl")}t.removeExtension("KHR_techniques_webgl")}}async function cu(e,t){}function uu(e,t){const r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(t=>{e.uniforms[t].value&&!(t in r)&&(r[t]=e.uniforms[t].value)}),Object.keys(r).forEach(e=>{"object"==typeof r[e]&&void 0!==r[e].index&&(r[e].texture=t.getTexture(r[e].index))}),r}const lu=[a,o,s,c,u,l,h];function hu(e,t){var r;const n=(null==t||null===(r=t.gltf)||void 0===r?void 0:r.excludeExtensions)||{};return!(e in n&&!n[e])}const pu={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},fu={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class du{constructor(){Object(p.a)(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Object(p.a)(this,"json",void 0)}normalize(e,t){this.json=e.json;const r=e.json;switch(r.asset&&r.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(r.asset.version))}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(r),this._convertTopLevelObjectsToArrays(r),function(e){const t=new Sc(e),{json:r}=t;for(const e of r.images||[]){const r=t.getObjectExtension(e,"KHR_binary_glTF");r&&Object.assign(e,r),t.removeObjectExtension(e,"KHR_binary_glTF")}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension("KHR_binary_glTF")}(e),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in pu)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const r=e[t];if(r&&!Array.isArray(r)){e[t]=[];for(const n in r){const i=r[n];i.id=i.id||n;const a=e[t].length;e[t].push(i),this.idToIndexMap[t][n]=a}}}_convertObjectIdsToArrayIndices(e){for(const t in pu)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:e,indices:r,material:n}=t;for(const t in e)e[t]=this._convertIdToIndex(e[t],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),n&&(t.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(e=>this._convertIdToIndex(e,"node"))),e.meshes&&(e.meshes=e.meshes.map(e=>this._convertIdToIndex(e,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(e=>this._convertIdToIndex(e,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);for(const r of e[t])for(const e in r){const t=r[e],n=this._convertIdToIndex(t,e);r[e]=n}}_convertIdToIndex(e,t){const r=fu[t];if(r in this.idToIndexMap){const n=this.idToIndexMap[r][e];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return n}return e}_updateObjects(e){for(const e of this.json.buffers)delete e.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const r=t.values&&t.values.tex,n=e.textures.findIndex(e=>e.id===r);-1!==n&&(t.pbrMetallicRoughness.baseColorTexture={index:n})}}}const mu={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},gu={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},bu=10240,yu=10241,vu=10242,wu=10243,_u=10497,ku={magFilter:bu,minFilter:yu,wrapS:vu,wrapT:wu},xu={[bu]:9729,[yu]:9986,[vu]:_u,[wu]:_u};class Eu{constructor(){Object(p.a)(this,"baseUri",""),Object(p.a)(this,"json",{}),Object(p.a)(this,"buffers",[]),Object(p.a)(this,"images",[])}postProcess(e,t={}){const{json:r,buffers:n=[],images:i=[],baseUri:a=""}=e;return hc(r),this.baseUri=a,this.json=r,this.buffers=n,this.images=i,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((e,t)=>this._resolveBufferView(e,t))),e.images&&(e.images=e.images.map((e,t)=>this._resolveImage(e,t))),e.samplers&&(e.samplers=e.samplers.map((e,t)=>this._resolveSampler(e,t))),e.textures&&(e.textures=e.textures.map((e,t)=>this._resolveTexture(e,t))),e.accessors&&(e.accessors=e.accessors.map((e,t)=>this._resolveAccessor(e,t))),e.materials&&(e.materials=e.materials.map((e,t)=>this._resolveMaterial(e,t))),e.meshes&&(e.meshes=e.meshes.map((e,t)=>this._resolveMesh(e,t))),e.nodes&&(e.nodes=e.nodes.map((e,t)=>this._resolveNode(e,t))),e.skins&&(e.skins=e.skins.map((e,t)=>this._resolveSkin(e,t))),e.scenes&&(e.scenes=e.scenes.map((e,t)=>this._resolveScene(e,t))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const r=this.json[e]&&this.json[e][t];return r||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),r}_resolveScene(e,t){return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map(e=>this.getNode(e)),e}_resolveNode(e,t){return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map(e=>this.getNode(e))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((e,t)=>{const r=this.getMesh(t);return e.id=r.id,e.primitives=e.primitives.concat(r.primitives),e},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map(e=>{const t=(e={...e}).attributes;e.attributes={};for(const r in t)e.attributes[r]=this.getAccessor(t[r]);return void 0!==e.indices&&(e.indices=this.getAccessor(e.indices)),void 0!==e.material&&(e.material=this.getMaterial(e.material)),e})),e}_resolveMaterial(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture={...e.normalTexture},e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture={...e.occlustionTexture},e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture={...e.emmisiveTexture},e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness={...e.pbrMetallicRoughness};const t=e.pbrMetallicRoughness;t.baseColorTexture&&(t.baseColorTexture={...t.baseColorTexture},t.baseColorTexture.texture=this.getTexture(t.baseColorTexture.index)),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture={...t.metallicRoughnessTexture},t.metallicRoughnessTexture.texture=this.getTexture(t.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){var r,n;if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(r=e.componentType,gu[r]),e.components=(n=e.type,mu[n]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const t=e.bufferView.buffer,{ArrayType:r,byteLength:n}=Ec(e,e.bufferView),i=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+t.byteOffset;let a=t.arrayBuffer.slice(i,i+n);e.bufferView.byteStride&&(a=this._getValueFromInterleavedBuffer(t,i,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new r(a)}return e}_getValueFromInterleavedBuffer(e,t,r,n,i){const a=new Uint8Array(i*n);for(let o=0;o<i;o++){const i=t+o*r;a.set(new Uint8Array(e.arrayBuffer.slice(i,i+n)),o*n)}return a.buffer}_resolveTexture(e,t){return e.id=e.id||"texture-".concat(t),e.sampler="sampler"in e?this.getSampler(e.sampler):xu,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||"sampler-".concat(t),e.parameters={};for(const t in e){const r=this._enumSamplerParameter(t);void 0!==r&&(e.parameters[r]=e[t])}return e}_enumSamplerParameter(e){return ku[e]}_resolveImage(e,t){e.id=e.id||"image-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const r=this.images[t];return r&&(e.image=r),e}_resolveBufferView(e,t){const r=e.buffer,n={id:"bufferView-".concat(t),...e,buffer:this.buffers[r]},i=this.buffers[r].arrayBuffer;let a=this.buffers[r].byteOffset||0;return"byteOffset"in e&&(a+=e.byteOffset),n.data=new Uint8Array(i,a,e.byteLength),n}_resolveCamera(e,t){return e.id=e.id||"camera-".concat(t),e.perspective,e.orthographic,e}}const Au=1735152710;function Su(e,t=0,r={}){const n=new DataView(e),{magic:i=Au}=r,a=n.getUint32(t,!1);return a===i||a===Au}function ju(e,t,r=0,n={}){const i=new DataView(t),a=function(e,t=0){return"".concat(String.fromCharCode(e.getUint8(t+0))).concat(String.fromCharCode(e.getUint8(t+1))).concat(String.fromCharCode(e.getUint8(t+2))).concat(String.fromCharCode(e.getUint8(t+3)))}(i,r+0),o=i.getUint32(r+4,!0),s=i.getUint32(r+8,!0);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=12,e.version){case 1:return function(e,t,r){k(e.header.byteLength>20);const n=t.getUint32(r+0,!0),i=t.getUint32(r+4,!0);return r+=8,k(0===i),Tu(e,t,r,n),r+=n,r+=Cu(e,t,r,e.header.byteLength)}(e,i,r);case 2:return function(e,t,r,n){return k(e.header.byteLength>20),function(e,t,r,n){for(;r+8<=e.header.byteLength;){const i=t.getUint32(r+0,!0),a=t.getUint32(r+4,!0);switch(r+=8,a){case 1313821514:Tu(e,t,r,i);break;case 5130562:Cu(e,t,r,i);break;case 0:n.strict||Tu(e,t,r,i);break;case 1:n.strict||Cu(e,t,r,i)}r+=dc(i,4)}}(e,t,r,n),r+e.header.byteLength}(e,i,r,{});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}function Tu(e,t,r,n){const i=new Uint8Array(t.buffer,r,n),a=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(a),dc(n,4)}function Cu(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),dc(n,4)}async function Bu(e,t,r=0,n,i){var a,o,s,c;!function(e,t,r,n){n.uri&&(e.baseUri=n.uri);if(t instanceof ArrayBuffer&&!Su(t,r,n)){const e=new TextDecoder;t=e.decode(t)}if("string"==typeof t)e.json=lc(t);else if(t instanceof ArrayBuffer){const i={};r=ju(i,t,r,n.glb),hc("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),e._glb=i,e.json=i.json}else hc(!1,"GLTF: must be ArrayBuffer or string");const i=e.json.buffers||[];if(e.buffers=new Array(i.length).fill(null),e._glb&&e._glb.header.hasBinChunk){const{binChunks:t}=e._glb;e.buffers[0]={arrayBuffer:t[0].arrayBuffer,byteOffset:t[0].byteOffset,byteLength:t[0].byteLength}}const a=e.json.images||[];e.images=new Array(a.length).fill({})}(e,t,r,n),function(e,t={}){(new du).normalize(e,t)}(e,{normalize:null==n||null===(a=n.gltf)||void 0===a?void 0:a.normalize}),function(e,t={},r){const n=lu.filter(e=>hu(e.name,t));for(const a of n){var i;null===(i=a.preprocess)||void 0===i||i.call(a,e,t,r)}}(e,n,i);const u=[];if(null!=n&&null!==(o=n.gltf)&&void 0!==o&&o.loadBuffers&&e.json.buffers&&await async function(e,t,r){const n=e.json.buffers||[];for(let o=0;o<n.length;++o){const s=n[o];if(s.uri){var i,a;const{fetch:n}=r;hc(n);const c=pc(s.uri,t),u=await(null==r||null===(i=r.fetch)||void 0===i?void 0:i.call(r,c)),l=await(null==u||null===(a=u.arrayBuffer)||void 0===a?void 0:a.call(u));e.buffers[o]={arrayBuffer:l,byteOffset:0,byteLength:l.byteLength},delete s.uri}}}(e,n,i),null!=n&&null!==(s=n.gltf)&&void 0!==s&&s.loadImages){const t=async function(e,t,r){const n=function(e){const t=new Set,r=e.json.textures||[];for(const e of r)void 0!==e.source&&t.add(e.source);return Array.from(t).sort()}(e),i=e.json.images||[],a=[];for(const o of n)a.push(Ou(e,i[o],o,t,r));return await Promise.all(a)}(e,n,i);u.push(t)}const l=async function(e,t={},r){const n=lu.filter(e=>hu(e.name,t));for(const a of n){var i;await(null===(i=a.decode)||void 0===i?void 0:i.call(a,e,t,r))}}(e,n,i);return u.push(l),await Promise.all(u),null!=n&&null!==(c=n.gltf)&&void 0!==c&&c.postProcess?function(e,t){return(new Eu).postProcess(e,t)}(e,n):e}async function Ou(e,t,r,n,i){const{fetch:a,parse:o}=i;let s;if(t.uri){const e=pc(t.uri,n),r=await a(e);s=await r.arrayBuffer()}if(Number.isFinite(t.bufferView)){const r=fc(e.json,e.buffers,t.bufferView);s=_e(r.buffer,r.byteOffset,r.byteLength)}hc(s,"glTF image has no data");let c=await o(s,[cc,Hs],{mimeType:t.mimeType,basis:n.basis||{format:Us()}},i);c&&c[0]&&(c={compressed:!0,mipmaps:!1,width:c[0].width,height:c[0].height,data:c}),e.images=e.images||[],e.images[r]=c}const Ru={name:"glTF",id:"gltf",module:"gltf",version:"3.1.8",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(e,t={},r){(t={...Ru.options,...t}).gltf={...Ru.options.gltf,...t.gltf};const{byteOffset:n=0}=t;return await Bu({},e,n,t,r)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};const Iu=0,Pu=1;function Du(e,t,r,n){e.rotateYtoZ=!0;const i=e.byteOffset+e.byteLength-r;if(0===i)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=_e(t,r,i),e.gltfByteOffset=0,e.gltfByteLength=i,r%4==0||console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.byteOffset+e.byteLength}async function Mu(e,t,r,n){const i=r["3d-tiles"]||{};if(function(e,t,r){switch(t){case Iu:const t=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),r=(new TextDecoder).decode(t);e.gltfUrl=r.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case Pu:break;default:throw new Error("b3dm: Illegal glTF format field")}}(e,t),i.loadGLTF){const{parse:t,fetch:i}=n;e.gltfUrl&&(e.gltfArrayBuffer=await i(e.gltfUrl,r),e.gltfByteOffset=0),e.gltfArrayBuffer&&(e.gltf=await t(e.gltfArrayBuffer,Ru,r,n),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength)}}async function Fu(e,t,r,n,i){var a;r=function(e,t,r,n,i){r=Ho(e,t,r),r=Go(e,t,r),r=Vo(e,t,r),r=Du(e,t,r,n);const a=new Oo(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",jo.FLOAT,3),r}(e,t,r,n),await Mu(e,Pu,n,i);const o=null==e||null===(a=e.gltf)||void 0===a?void 0:a.extensions;return o&&o.CESIUM_RTC&&(e.rtcCenter=o.CESIUM_RTC.center),r}async function Lu(e,t,r,n,i){return r=function(e,t,r,n,i){if(r=Ho(e,t,r),1!==e.version)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));r=Go(e,t,r);const a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r=Vo(e,t,r+=4),r=Du(e,t,r,n),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const o=new Oo(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",jo.FLOAT,3);new qo(e.batchTableJson,e.batchTableBinary,s);return function(e,t,r,n){const i=[new Array(n),e._batchTable][0],a=new Ar,o=new Ar,s=new Ar,c=new Ar,u=new kn,l=new Hn,h=new Ar,p={},f=new _r,d=[],m=[],g=new Ar,b=new Ar;for(let r=0;r<n;r++){let n;if(t.hasProperty("POSITION"))n=t.getProperty("POSITION",jo.FLOAT,3,r,a);else if(t.hasProperty("POSITION_QUANTIZED")){n=t.getProperty("POSITION_QUANTIZED",jo.UNSIGNED_SHORT,3,r,a);const e=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",jo.FLOAT,3,g);if(!e)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const i=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",jo.FLOAT,3,b);if(!i)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const o=65535;for(let t=0;t<3;t++)n[t]=n[t]/o*i[t]+e[t]}if(!n)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(n),p.translation=a,e.normalUp=t.getProperty("NORMAL_UP",jo.FLOAT,3,r,d),e.normalRight=t.getProperty("NORMAL_RIGHT",jo.FLOAT,3,r,m);const y=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",jo.UNSIGNED_SHORT,2,d),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",jo.UNSIGNED_SHORT,2,m),e.octNormalUp){if(!e.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}e.eastNorthUp?(Zr.WGS84.eastNorthUpToFixedFrame(a,f),f.getRotationMatrix3(u)):u.identity()}y&&(c.copy(o).cross(s).normalize(),u.setColumn(0,o),u.setColumn(1,s),u.setColumn(2,c)),l.fromMatrix3(u),p.rotation=l,h.set(1,1,1);const v=t.getProperty("SCALE",jo.FLOAT,1,r);Number.isFinite(v)&&h.multiplyByScalar(v);const w=t.getProperty("SCALE_NON_UNIFORM",jo.FLOAT,3,r,d);w&&h.scale(w),p.scale=h;let _=t.getProperty("BATCH_ID",jo.UNSIGNED_SHORT,1,r);void 0===_&&(_=r);const k=(new _r).fromQuaternion(p.rotation);f.identity(),f.translate(p.translation),f.multiplyRight(k),f.scale(p.scale);const x=f.clone();i[r]={modelMatrix:x,batchId:_}}e.instances=i}(e,o,0,s),r}(e,t,r,n),await Mu(e,e.gltfFormat,n,i),r}async function Nu(e,t=0,r,n,i={}){switch(i.byteOffset=t,i.type=function(e,t=0){const r=new DataView(e);return"".concat(String.fromCharCode(r.getUint8(t+0))).concat(String.fromCharCode(r.getUint8(t+1))).concat(String.fromCharCode(r.getUint8(t+2))).concat(String.fromCharCode(r.getUint8(t+3)))}(e,t),i.type){case Oa.COMPOSITE:return await async function(e,t,r,n,i,a){r=Ho(e,t,r);const o=new DataView(t);for(e.tilesLength=o.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&e.byteLength-r>12;){const o={};e.tiles.push(o),r=await a(t,r,n,i,o)}return r}(i,e,t,r,n,Nu);case Oa.BATCHED_3D_MODEL:return await Fu(i,e,t,r,n);case Oa.GLTF:return await async function(e,t,r,n){e.rotateYtoZ=!0,e.gltfUpAxis=r["3d-tiles"]&&r["3d-tiles"].assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y";const{parse:i}=n;e.gltf=await i(t,Ru,r,n)}(i,e,r,n);case Oa.INSTANCED_3D_MODEL:return await Lu(i,e,t,r,n);case Oa.POINT_CLOUD:return await rs(i,e,t,r,n);default:throw new Error("3DTileLoader: unknown type ".concat(i.type))}}async function zu(e,t,r){const n=e[t].bufferView,i=e.bufferViews[n],a=e.buffers[i.buffer];if(a.uri){const e=await F(a.uri),t=await e.arrayBuffer();return new Uint8Array(t,i.byteOffset,i.byteLength)}return new Uint8Array(r,i.byteOffset,i.byteLength)}function Uu(e){const t=new DataView(e);return t.getUint32(0,!0)+2**32*t.getUint32(4,!0)}const qu={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:"3.1.8",extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:async function(e){if(1952609651!==new Uint32Array(e.slice(0,4))[0])throw new Error("Wrong subtree file magic number");if(1!==new Uint32Array(e.slice(4,8))[0])throw new Error("Wrong subtree file verson, must be 1");const t=Uu(e.slice(8,16)),r=new Uint8Array(e,24,t),n=new TextDecoder("utf8").decode(r),i=JSON.parse(n),a=Uu(e.slice(16,24));let o=new ArrayBuffer(0);return a&&(o=e.slice(24+t)),"bufferView"in i.tileAvailability&&(i.tileAvailability.explicitBitstream=await zu(i,"tileAvailability",o)),"bufferView"in i.contentAvailability&&(i.contentAvailability.explicitBitstream=await zu(i,"contentAvailability",o)),"bufferView"in i.childSubtreeAvailability&&(i.childSubtreeAvailability.explicitBitstream=await zu(i,"childSubtreeAvailability",o)),i},options:{}},Hu={QUADTREE:4,OCTREE:8};function Gu(e,t){return"constant"in e?Boolean(e.constant):!!e.explicitBitstream&&function(e,t){const r=Math.floor(e/8),n=e%8;return 1==(t[r]>>n&1)}(t,e.explicitBitstream)}function Vu(e,t,r,n){const{basePath:i,refine:a,getRefine:o,lodMetricType:s,getTileType:c,rootLodMetricValue:u,rootBoundingVolume:l}=n,h=e.contentUrl&&e.contentUrl.replace("".concat(i,"/"),""),p=u/2**t,f=function(e,t,r){if(t.region){const{childTileX:n,childTileY:i,childTileZ:a}=r,[o,s,c,u,l,h]=t.region,p=2**e,f=(c-o)/p,d=(u-s)/p,m=(h-l)/p,[g,b]=[o+f*n,o+f*(n+1)],[y,v]=[s+d*i,s+d*(i+1)],[w,_]=[l+m*a,l+m*(a+1)];return{region:[g,y,b,v,w,_]}}return console.warn("Unsupported bounding volume type: ",t),null}(t,l,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:h},id:e.contentUrl,refine:o(a),type:c(e),lodMetricType:s,lodMetricValue:p,boundingVolume:f}}function Wu(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function Ku(e,t,r,n,i){const a=function(e){const t={};for(const r in e)t["{".concat(r,"}")]=e[r];return t}({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,e=>a[e])}function Ju(e){if(!e.contentUrl)return ra;const t=e.contentUrl.split(".").pop();switch(t){case"pnts":return ia;case"i3dm":case"b3dm":case"glb":case"gltf":return na;default:return t}}function Qu(e){switch(e){case"REPLACE":case"replace":return ta;case"ADD":case"add":return ea;default:return e}}function Yu(e,t){if(!e)return null;if(e.content){const r=e.content.uri||e.content.url;e.contentUrl="".concat(t.basePath,"/").concat(r)}return e.id=e.contentUrl,e.lodMetricType=ca,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=Ju(e),e.refine=Qu(e.refine),e}async function Xu(e){if(!e.root)return null;const t=e.basePath,r=e.root.extensions["3DTILES_implicit_tiling"],{subdivisionScheme:n,maximumLevel:i,subtreeLevels:a,subtrees:{uri:o}}=r,s=Ku(o,0,0,0,0),c="".concat(t,"/").concat(s),u=await St(c,qu),l="".concat(t,"/").concat(e.root.content.uri),h=e.root.refine,p=e.root.geometricError,f=e.root.boundingVolume,d={contentUrlTemplate:l,subtreesUriTemplate:o,subdivisionScheme:n,subtreeLevels:a,maximumLevel:i,refine:h,basePath:t,lodMetricType:ca,rootLodMetricValue:p,rootBoundingVolume:f,getTileType:Ju,getRefine:Qu};return await async function(e,t,r){if(!e)return null;e.lodMetricType=ca,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform;const{children:n,contentUrl:i}=await async function e(t,r,n={mortonIndex:0,x:0,y:0,z:0},i=0,a=0,o={level:0,mortonIndex:0,x:0,y:0,z:0}){const{subdivisionScheme:s,subtreeLevels:c,maximumLevel:u,contentUrlTemplate:l,subtreesUriTemplate:h,basePath:p}=r,f={children:[],lodMetricValue:0,contentUrl:""},d=Hu[s],m=1&i,g=i>>1&1,b=i>>2&1,y=(d**a-1)/(d-1);let v=Wu(n.mortonIndex,i),w=y+v,_=Wu(n.x,m),k=Wu(n.y,g),x=Wu(n.z,b),E=!1;a+1>c&&(E=Gu(t.childSubtreeAvailability,v));const A=Wu(o.x,_),S=Wu(o.y,k),j=Wu(o.z,x),T=a+o.level;if(E){const e=Ku("".concat(p,"/").concat(h),T,A,S,j);t=await St(e,qu),o.mortonIndex=v,o.x=_,o.y=k,o.z=x,o.level=a,v=0,w=0,_=0,k=0,x=0,a=0}if(!Gu(t.tileAvailability,w)||a>u)return f;Gu(t.contentAvailability,w)&&(f.contentUrl=Ku(l,T,A,S,j));const C=a+1,B={mortonIndex:v,x:_,y:k,z:x};for(let n=0;n<d;n++){const i=await e(t,r,B,n,C,o);if(i.contentUrl||i.children.length){const e=Vu(i,T+1,{childTileX:_,childTileY:k,childTileZ:x},r);f.children.push(e)}}return f}(t,r);i&&(e.contentUrl=i,e.content={uri:i.replace("".concat(r.basePath,"/"),"")});return e.refine=Qu(e.refine),e.type=Ju(e),e.children=n,e.id=e.contentUrl,e}(e.root,u,d)}const Zu={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.1.8",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(e,t,r){const i=t["3d-tiles"]||{};let a;a="auto"===i.isTileset?r.url&&-1!==r.url.indexOf(".json"):i.isTileset;e=a?await async function(e,t,r){var i;const a=JSON.parse((new TextDecoder).decode(e));return a.loader=t.loader||Zu,a.url=r.url,a.basePath=function(e){return n.dirname(e.url)}(a),a.root=function(e){var t,r;return(null==e||null===(t=e.extensionsRequired)||void 0===t?void 0:t.includes("3DTILES_implicit_tiling"))&&(null==e||null===(r=e.extensionsUsed)||void 0===r?void 0:r.includes("3DTILES_implicit_tiling"))}(a)?await Xu(a):function(e){const t=e.basePath,r=Yu(e.root,e),n=[];for(n.push(r);n.length>0;){const e=(n.pop()||{}).children||[];for(const r of e)Yu(r,{basePath:t}),n.push(r)}return r}(a),a.type=sa,a.lodMetricType=ca,a.lodMetricValue=(null===(i=a.root)||void 0===i?void 0:i.lodMetricValue)||0,a}(e,t,r):await async function(e,t,r){const n={content:{featureIds:null}};return await Nu(e,0,t,r,n.content),n.content}(e,t,r);return e},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function $u(e,t){if(!t){const r=await async function(e){k(e);const t={Authorization:"Bearer ".concat(e)},r=await F("https://api.cesium.com/v1/assets",{fetch:{headers:t}});if(!r.ok)throw new Error(r.statusText);return await r.json()}(e);for(const e of r.items)"3DTILES"===e.type&&(t=e.id)}const r=await async function(e,t){k(e,t);const r={Authorization:"Bearer ".concat(e)},n="".concat("https://api.cesium.com/v1/assets","/").concat(t);let i=await F("".concat(n),{fetch:{headers:r}});if(!i.ok)throw new Error(i.statusText);let a=await i.json();if(i=await F("".concat(n,"/endpoint"),{fetch:{headers:r}}),!i.ok)throw new Error(i.statusText);const o=await i.json();return a={...a,...o},a}(e,t),{type:n,url:i}=r;return k("3DTILES"===n&&i),r.headers={Authorization:"Bearer ".concat(r.accessToken)},r}const el={...Zu,id:"cesium-ion",name:"Cesium Ion",preload:async function(e,t={}){t=t["cesium-ion"]||{};const{accessToken:r}=t;let n=t.assetId;if(!Number.isFinite(n)){const t=e.match(/\/([0-9]+)\/tileset.json/);n=t&&t[1]}return $u(r,n)},parse:async(e,t,r)=>((t={...t})["3d-tiles"]=t["cesium-ion"],t.loader=el,Zu.parse(e,t,r)),options:{"cesium-ion":{...Zu.options["3d-tiles"],accessToken:null}}};var tl=r(2),rl=r(11),nl=r.n(rl);const il=new Uint8Array(256);let al=il.length;function ol(){return al>il.length-16&&(nl.a.randomFillSync(il),al=0),il.slice(al,al+=16)}var sl=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;var cl=function(e){return"string"==typeof e&&sl.test(e)};const ul=[];for(let e=0;e<256;++e)ul.push((e+256).toString(16).substr(1));var ll=function(e,t=0){const r=(ul[e[t+0]]+ul[e[t+1]]+ul[e[t+2]]+ul[e[t+3]]+"-"+ul[e[t+4]]+ul[e[t+5]]+"-"+ul[e[t+6]]+ul[e[t+7]]+"-"+ul[e[t+8]]+ul[e[t+9]]+"-"+ul[e[t+10]]+ul[e[t+11]]+ul[e[t+12]]+ul[e[t+13]]+ul[e[t+14]]+ul[e[t+15]]).toLowerCase();if(!cl(r))throw TypeError("Stringified UUID is invalid");return r};var hl=function(e,t,r){const n=(e=e||{}).random||(e.rng||ol)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return ll(n)},pl=r(25),fl=r.n(pl),dl=r(8),ml=r.n(dl),gl=r(80),bl=r.n(gl);class yl{constructor(e,t){Object(p.a)(this,"nodesPerPage",void 0),Object(p.a)(this,"nodesCounter",void 0),Object(p.a)(this,"writeFile",void 0),Object(p.a)(this,"nodePages",void 0),this.nodesPerPage=t,this.nodesCounter=0,this.nodePages=[{}],this.nodePages[0].nodes=[],this.writeFile=e}useWriteFunction(e){this.writeFile=e}getNodeById(e){const t=Math.floor(e/this.nodesPerPage),r=e%this.nodesPerPage;return this.nodePages[t].nodes[r]}updateMaterialByNodeId(e,t){const r=this.getNodeById(e);r.mesh&&(r.mesh.material={definition:t,resource:r.index})}updateVertexCountByNodeId(e,t){const r=this.getNodeById(e);r.mesh&&(r.mesh.geometry.vertexCount=t)}updateNodeAttributeByNodeId(e){const t=this.getNodeById(e);t.mesh&&(t.mesh.attribute.resource=t.index)}updateFeatureCountByNodeId(e,t){const r=this.getNodeById(e);r.mesh&&(r.mesh.geometry.featureCount=t)}updateTexelCountHintByNodeId(e,t){const r=this.getNodeById(e);r.mesh&&r.mesh.material&&(r.mesh.material.texelCountHint=t)}addChildRelation(e,t){var r;if(null==e)return;null===(r=this.getNodeById(e).children)||void 0===r||r.push(t)}updateResourceInMesh(e){e.mesh&&(e.mesh.geometry.resource=e.index)}push(e,t){let r=this.nodePages[this.nodePages.length-1];return r.nodes.length===this.nodesPerPage&&(r={nodes:[]},this.nodePages.push(r)),e.index=this.nodesCounter++,r.nodes.push(e),this.addChildRelation(t,e.index),this.updateResourceInMesh(e),e.index}async save(e,t,r=!1){if(r){for(const[r,n]of this.nodePages.entries()){const i=JSON.stringify(n),a=Object(tl.join)(e,"nodepages");t["nodePages/".concat(r.toString(),".json.gz")]=await this.writeFile(a,i,"".concat(r.toString(),".json"))}const r=ml()({nodeCount:this.nodesCounter},{folderPattern:{path:"folderPattern",default:"BASIC"},archiveCompressionType:{path:"archiveCompressionType",default:"STORE"},resourceCompressionType:{path:"resourceCompressionType",default:"GZIP"},I3SVersion:{path:"I3SVersion",default:"1.8"},nodeCount:{path:"nodeCount"}}),n=!1;t["metadata.json"]=await this.writeFile(e,JSON.stringify(r),"metadata.json",n)}else for(const[t,r]of this.nodePages.entries()){const n=JSON.stringify(r),i=Object(tl.join)(e,"nodepages",t.toString());await this.writeFile(i,n)}}}var vl=r(15),wl=(r(257),r(82)),_l=r.n(wl);const kl={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log("Started ".concat(e.props.command))}};class xl{constructor({id:e="browser-driver"}={}){Object(p.a)(this,"id",void 0),Object(p.a)(this,"props",{...kl}),Object(p.a)(this,"childProcess",null),Object(p.a)(this,"port",0),Object(p.a)(this,"successTimer",void 0),this.id=e}async start(e){e={...kl,...e},this.props=e;const t=[...e.arguments];return this.port=Number(e.port),e.portArg&&(e.autoPort&&(this.port=await function(e=3e3){return new Promise(t=>{_l.a.exec("lsof -i -P -n | grep LISTEN",(r,n)=>{if(r)return void t(e);const i=[],a=/:(\d+) \(LISTEN\)/;n.split("\n").forEach(e=>{const t=a.exec(e);t&&i.push(Number(t[1]))});let o=e;for(;i.includes(o);)o++;t(o)})})}(e.port)),t.push(e.portArg,String(this.port))),await new Promise((r,n)=>{try{this._setTimeout(()=>{e.onSuccess&&e.onSuccess(this),r({})}),console.log("Spawning ".concat(e.command," ").concat(e.arguments.join(" ")));const i=wl.spawn(e.command,t,e.spawn);this.childProcess=i,i.stdout.on("data",e=>{console.log(e.toString())}),i.stderr.on("data",e=>{console.log('Child process wrote to stderr: "'.concat(e,'".')),this._clearTimeout(),n(new Error(e))}),i.on("error",e=>{console.log("Child process errored with ".concat(e)),this._clearTimeout(),n(e)}),i.on("close",e=>{console.log("Child process exited with ".concat(e)),this.childProcess=null,this._clearTimeout(),r({})})}catch(e){n(e)}})}async stop(){this.childProcess&&(this.childProcess.kill(),this.childProcess=null)}async exit(e=0){try{await this.stop(),process.exit(e)}catch(e){console.error(e.message||e),process.exit(1)}}_setTimeout(e){Number(this.props.wait)>0&&(this.successTimer=setTimeout(e,this.props.wait))}_clearTimeout(){this.successTimer&&clearTimeout(this.successTimer)}}var El=r(81),Al=r.n(El);const Sl="function"==typeof atob?atob:"function"==typeof Buffer?function(e){return Buffer.from(e,"base64").toString("binary")}:Cl,jl=Sl("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACsEZ2V0WAAsBHNldEEALQRzZXRCAC4Ec2V0QwAvBHNldEQAMARzZXRYADEKzA0xWwEBf0EAJAggAEEGdCEBAkADQCMIIAFGDQEjACQEIwEkBSMCJAYjAyQHEAIjBCMAaiQAIwUjAWokASMGIwJqJAIjByMDaiQDIwhBwABqJAgMAAsLIwgjGmokGgsTACMIIxpqJAkQAxAEEAkQDhATC6IBAEEAIwlqKAIAJApBBCMJaigCACQLQQgjCWooAgAkDEEMIwlqKAIAJA1BECMJaigCACQOQRQjCWooAgAkD0EYIwlqKAIAJBBBHCMJaigCACQRQSAjCWooAgAkEkEkIwlqKAIAJBNBKCMJaigCACQUQSwjCWooAgAkFUEwIwlqKAIAJBZBNCMJaigCACQXQTgjCWooAgAkGEE8IwlqKAIAJBkLCgAQBRAGEAcQCAsuAEH4yKq7fSMKahAYQdbunsZ+IwtqEBtB2+GBoQIjDGoQGkHunfeNfCMNahAZCy0AQa+f8Kt/Iw5qEBhBqoyfvAQjD2oQG0GTjMHBeiMQahAaQYGqmmojEWoQGQssAEHYsYLMBiMSahAYQa/vk9p4IxNqEBtBsbd9IxRqEBpBvq/zyngjFWoQGQstAEGiosDcBiMWahAYQZPj4WwjF2oQG0GOh+WzeiMYahAaQaGQ0M0EIxlqEBkLCgAQChALEAwQDQsuAEHiyviwfyMLahAcQcDmgoJ8IxBqEB9B0bT5sgIjFWoQHkGqj9vNfiMKahAdCy0AQd2gvLF9Iw9qEBxB06iQEiMUahAfQYHNh8V9IxlqEB5ByPfPvn4jDmoQHQsuAEHmm4ePAiMTahAcQdaP3Jl8IxhqEB9Bh5vUpn8jDWoQHkHtqeiqBCMSahAdCy0AQYXSj896IxdqEBxB+Me+ZyMMahAfQdmFvLsGIxFqEB5Bipmp6XgjFmoQHQsKABAPEBAQERASCysAQcLyaCMPahAgQYHtx7t4IxJqECNBosL17AYjFWoQIkGM8JRvIxhqECELLgBBxNT7pXojC2oQIEGpn/veBCMOahAjQeCW7bV/IxFqECJB8Pj+9XsjFGoQIQstAEHG/e3EAiMXahAgQfrPhNV+IwpqECNBheG8p30jDWoQIkGFuqAkIxBqECELLgBBuaDTzn0jE2oQIEHls+62fiMWahAjQfj5if0BIxlqECJB5ayxpXwjDGoQIQsKABAUEBUQFhAXCy0AQcTEpKF/IwpqECRBl/+rmQQjEWoQJ0Gnx9DceiMYahAmQbnAzmQjD2oQJQstAEHDs+2qBiMWahAkQZKZs/h4Iw1qECdB/ei/fyMUahAmQdG7kax4IwtqECULLQBBz/yh/QYjEmoQJEHgzbNxIxlqECdBlIaFmHojEGoQJkGho6DwBCMXahAlCy4AQYL9zbp/Iw5qECRBteTr6XsjFWoQJ0G7pd/WAiMMahAmQZGnm9x+IxNqECULKAEBf0F/IwFzIwNxIwEjAnFyIwBqIABqIgFBB3QgAUEZdnIjAWokAAsoAQF/QX8jAnMjAHEjAiMDcXIjAWogAGoiAUEWdCABQQp2ciMCaiQBCygBAX9BfyMDcyMBcSMDIwBxciMCaiAAaiIBQRF0IAFBD3ZyIwNqJAILKAEBf0F/IwBzIwJxIwAjAXFyIwNqIABqIgFBDHQgAUEUdnIjAGokAwsoAQF/IwJBfyMDc3EjASMDcXIjAGogAGoiAUEFdCABQRt2ciMBaiQACygBAX8jA0F/IwBzcSMCIwBxciMBaiAAaiIBQRR0IAFBDHZyIwJqJAELKAEBfyMAQX8jAXNxIwMjAXFyIwJqIABqIgFBDnQgAUESdnIjA2okAgsoAQF/IwFBfyMCc3EjACMCcXIjA2ogAGoiAUEJdCABQRd2ciMAaiQDCyIBAX8jASMCcyMDcyMAaiAAaiIBQQR0IAFBHHZyIwFqJAALIgEBfyMCIwNzIwBzIwFqIABqIgFBF3QgAUEJdnIjAmokAQsiAQF/IwMjAHMjAXMjAmogAGoiAUEQdCABQRB2ciMDaiQCCyIBAX8jACMBcyMCcyMDaiAAaiIBQQt0IAFBFXZyIwBqJAMLJQEBf0F/IwNzIwFyIwJzIwBqIABqIgFBBnQgAUEadnIjAWokAAslAQF/QX8jAHMjAnIjA3MjAWogAGoiAUEVdCABQQt2ciMCaiQBCyUBAX9BfyMBcyMDciMAcyMCaiAAaiIBQQ90IAFBEXZyIwNqJAILJQEBf0F/IwJzIwByIwFzIwNqIABqIgFBCnQgAUEWdnIjAGokAwsEACMACwQAIwELBAAjAgsEACMDCwQAIxoLBgAgACQACwYAIAAkAQsGACAAJAILBgAgACQDCwYAIAAkGgsA6gQEbmFtZQGSAzIAA2xvZwEFbG9vcHMCBGxvb3ADBXByaW1lBAVsb29wQQUGbG9vcEExBgZsb29wQTIHBmxvb3BBMwgGbG9vcEE0CQVsb29wQgoGbG9vcEIxCwZsb29wQjIMBmxvb3BCMw0GbG9vcEI0DgVsb29wQw8GbG9vcEMxEAZsb29wQzIRBmxvb3BDMxIGbG9vcEM0EwVsb29wRBQGbG9vcEQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),Tl=!(!WebAssembly||Sl===Cl)&&function(e){var t,r,n,i=-1;t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);for(;t>i++;)n[i]=e.charCodeAt(i);return n}(jl).buffer;Math.floor(1048576.00032768);function Cl(e){return e}Tl||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");r(113);async function Bl(){"win32"===process.platform?await Rl(...arguments):await Ol(...arguments)}async function Ol(e,t,r=0,n="."){const i=Fl(t),a=["-".concat(r),"-r",i,n],o=new xl;await o.start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function Rl(e,t,r=0,n=Object(tl.join)(".","*"),i){"@"===n[0]&&(n="*".concat(n.substr(1)));const a=Fl(t),o=["a","-tzip","-mx=".concat(r),a,n],s=new xl;await s.start({command:i,arguments:o,spawn:{cwd:"".concat(e)},wait:0})}async function Il(e,t,r="index.json"){await Ie.promises.mkdir(e,{recursive:!0});const n=Object(tl.join)(e,r);try{await Ie.promises.writeFile(n,t)}catch(e){throw e}return console.log("".concat(n," saved.")),n}async function Pl(e,t,r="index.json",n=!0){const i=await Il(e,t,r);if(n){const e=await function(e){const t="".concat(e,".gz"),r=Object(vl.createGzip)(),n=Object(Ie.createReadStream)(e),i=Object(Ie.createWriteStream)(t);return new Promise((e,a)=>{n.on("end",()=>{console.log("".concat(t," compressed and saved.")),e(t)}),n.on("error",e=>{console.log("".concat(t,": compression error!")),a(e)}),n.pipe(r).pipe(i)})}(i);return await Ml(i),e}return i}function Dl(e){return Ie.promises.rmdir(e,{recursive:!0})}function Ml(e){return Ie.promises.unlink(e)}function Fl(e){return Object(tl.isAbsolute)(e)?e:Object(tl.join)(process.cwd(),e)}function Ll(e){let t=e[0];const r=Math.floor(t/3600);t-=3600*r;const n=Math.floor(t/60);t-=60*n;const i=Math.floor(t),a=e[1]/1e6;let o="";return r&&(o+="".concat(r,"h ")),n&&(o+="".concat(n,"m ")),i&&(o+="".concat(i,"s")),o||(o+="".concat(a,"ms")),o}async function Nl(e){const{slpk:t,outputPath:r,tilesetName:n}=e,i=Fl(r);try{if(t){const e=Object(tl.join)(i,"".concat(n,".slpk"));return(await Ie.promises.stat(e)).size}const e=Object(tl.join)(i,n);return await async function e(t){let r=0;const n=await Ie.promises.readdir(t);for(const i of n){const n=await Ie.promises.stat(Object(tl.join)(t,i));n.isDirectory()?r+=await e(Object(tl.join)(t,i)):r+=n.size}return r}(e)}catch(e){return console.log("Calculate file sizes error: ",e),null}}const zl={};class Ul extends kr{static get ZERO(){return zl.ZERO=zl.ZERO||Object.freeze(new Ul(0,0,0,0))}constructor(e=0,t=0,r=0,n=0){super(-0,-0,-0,-0),Dt(e)&&1===arguments.length?this.copy(e):(It.debug&&(qt(e),qt(t),qt(r),qt(n)),this[0]=e,this[1]=t,this[2]=r,this[3]=n)}set(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return It.debug&&(qt(e.x),qt(e.y),qt(e.z),qt(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=qt(e)}get w(){return this[3]}set w(e){this[3]=qt(e)}transform(e){return hr(this,this,e),this.check()}transformByMatrix3(e){return Yt(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,r){const n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e[3]=t[3]}(this,this,e),this.check()}transformByQuaternion(e){return fr(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}}const ql={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"},Hl=()=>{};class Gl{constructor(e){Object(p.a)(this,"draco",void 0),Object(p.a)(this,"dracoEncoder",void 0),Object(p.a)(this,"dracoMeshBuilder",void 0),Object(p.a)(this,"dracoMetadataBuilder",void 0),Object(p.a)(this,"log",void 0),this.draco=e,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.dracoMetadataBuilder=new this.draco.MetadataBuilder}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.destroyEncodedObject(this.dracoMetadataBuilder),this.dracoMeshBuilder=null,this.dracoEncoder=null,this.draco=null}destroyEncodedObject(e){e&&this.draco.destroy(e)}encodeSync(e,t={}){return this.log=Hl,this._setOptions(t),t.pointcloud?this._encodePointCloud(e,t):this._encodeMesh(e,t)}_getAttributesFromMesh(e){const t={...e,...e.attributes};return e.indices&&(t.indices=e.indices),t}_encodePointCloud(e,t){const r=new this.draco.PointCloud;t.metadata&&this._addGeometryMetadata(r,t.metadata);const n=this._getAttributesFromMesh(e);this._createDracoPointCloud(r,n,t);const i=new this.draco.DracoInt8Array;try{const e=this.dracoEncoder.EncodePointCloudToDracoBuffer(r,!1,i);if(!(e>0))throw new Error("Draco encoding failed.");return this.log("DRACO encoded ".concat(r.num_points()," points\n with ").concat(r.num_attributes()," attributes into ").concat(e," bytes")),Vl(i)}finally{this.destroyEncodedObject(i),this.destroyEncodedObject(r)}}_encodeMesh(e,t){const r=new this.draco.Mesh;t.metadata&&this._addGeometryMetadata(r,t.metadata);const n=this._getAttributesFromMesh(e);this._createDracoMesh(r,n,t);const i=new this.draco.DracoInt8Array;try{const e=this.dracoEncoder.EncodeMeshToDracoBuffer(r,i);if(e<=0)throw new Error("Draco encoding failed.");return this.log("DRACO encoded ".concat(r.num_points()," points\n with ").concat(r.num_attributes()," attributes into ").concat(e," bytes")),Vl(i)}finally{this.destroyEncodedObject(i),this.destroyEncodedObject(r)}}_setOptions(e){if("speed"in e&&this.dracoEncoder.SetSpeedOptions(...e.speed),"method"in e){const t=this.draco[e.method||"MESH_SEQUENTIAL_ENCODING"];this.dracoEncoder.SetEncodingMethod(t)}if("quantization"in e)for(const t in e.quantization){const r=e.quantization[t],n=this.draco[t];this.dracoEncoder.SetAttributeQuantization(n,r)}}_createDracoMesh(e,t,r){const n=r.attributesMetadata||{};try{const r=this._getPositionAttribute(t);if(!r)throw new Error("positions");const i=r.length/3;for(let r in t){const a=t[r];r=ql[r]||r;const o=this._addAttributeToMesh(e,r,a,i);-1!==o&&this._addAttributeMetadata(e,o,{name:r,...n[r]||{}})}}catch(t){throw this.destroyEncodedObject(e),t}return e}_createDracoPointCloud(e,t,r){const n=r.attributesMetadata||{};try{const r=this._getPositionAttribute(t);if(!r)throw new Error("positions");const i=r.length/3;for(let r in t){const a=t[r];r=ql[r]||r;const o=this._addAttributeToMesh(e,r,a,i);-1!==o&&this._addAttributeMetadata(e,o,{name:r,...n[r]||{}})}}catch(t){throw this.destroyEncodedObject(e),t}return e}_addAttributeToMesh(e,t,r,n){if(!ArrayBuffer.isView(r))return-1;const i=this._getDracoAttributeType(t),a=r.length/n;if("indices"===i){const n=r.length/3;return this.log("Adding attribute ".concat(t,", size ").concat(n)),this.dracoMeshBuilder.AddFacesToMesh(e,n,r),-1}this.log("Adding attribute ".concat(t,", size ").concat(a));const o=this.dracoMeshBuilder,{buffer:s}=r;switch(r.constructor){case Int8Array:return o.AddInt8Attribute(e,i,n,a,new Int8Array(s));case Int16Array:return o.AddInt16Attribute(e,i,n,a,new Int16Array(s));case Int32Array:return o.AddInt32Attribute(e,i,n,a,new Int32Array(s));case Uint8Array:case Uint8ClampedArray:return o.AddUInt8Attribute(e,i,n,a,new Uint8Array(s));case Uint16Array:return o.AddUInt16Attribute(e,i,n,a,new Uint16Array(s));case Uint32Array:return o.AddUInt32Attribute(e,i,n,a,new Uint32Array(s));case Float32Array:default:return o.AddFloatAttribute(e,i,n,a,new Float32Array(s))}}_getDracoAttributeType(e){switch(e.toLowerCase()){case"indices":return"indices";case"position":case"positions":case"vertices":return this.draco.POSITION;case"normal":case"normals":return this.draco.NORMAL;case"color":case"colors":return this.draco.COLOR;case"texcoord":case"texcoords":return this.draco.TEX_COORD;default:return this.draco.GENERIC}}_getPositionAttribute(e){for(const t in e){const r=e[t];if(this._getDracoAttributeType(t)===this.draco.POSITION)return r}return null}_addGeometryMetadata(e,t){const r=new this.draco.Metadata;this._populateDracoMetadata(r,t),this.dracoMeshBuilder.AddMetadata(e,r)}_addAttributeMetadata(e,t,r){const n=new this.draco.Metadata;this._populateDracoMetadata(n,r),this.dracoMeshBuilder.SetMetadataForAttribute(e,t,n)}_populateDracoMetadata(e,t){for(const[n,i]of(r=t).entries&&!r.hasOwnProperty("entries")?r.entries():Object.entries(r))switch(typeof i){case"number":Math.trunc(i)===i?this.dracoMetadataBuilder.AddIntEntry(e,n,i):this.dracoMetadataBuilder.AddDoubleEntry(e,n,i);break;case"object":i instanceof Int32Array&&this.dracoMetadataBuilder.AddIntEntryArray(e,n,i,i.length);break;case"string":default:this.dracoMetadataBuilder.AddStringEntry(e,n,i)}var r}}function Vl(e){const t=e.size(),r=new ArrayBuffer(t),n=new Int8Array(r);for(let r=0;r<t;++r)n[r]=e.GetValue(r);return r}const Wl={name:"DRACO",id:"draco",module:"draco",version:"3.1.8",extensions:["drc"],encode:async function(e,t={}){const{draco:r}=await Eo(t),n=new Gl(r);try{return n.encodeSync(e,t.draco)}finally{n.destroy()}},options:{draco:{pointcloud:!1,attributeNameEntry:"name"}}};function Kl(e){const{positions:t,normals:r,texCoords:n,colors:i,featureIndices:a,triangleCount:o}=e;if(!a.length)return{faceRange:new Uint32Array([0,o-1]),featureIds:[0],featureCount:1,positions:t,normals:r,texCoords:n,colors:i};const s=function(e){let t=1,r=1,n=e[0];const i=[],a=[],o=[n];i[0]=0,a[0]=n;for(let s=1;s<e.length;s++)n!==e[s]&&(i[t]=s/3-1,i[t+1]=s/3,a[r]=e[s],o.includes(e[s])||o.push(e[s]),t+=2,r+=1),n=e[s];i[t]=e.length/3-1;const s=new Uint32Array(i),c=o.length;return{faceRange:s,featureCount:c,featureIds:a}}(a);return function(e,t){const r=e[0],n=[r.featureId||0];let i=new Float32Array(r.positions),a=new Float32Array(r.normals),o=new Uint8Array(r.colors),s=new Float32Array(r.texCoords);const c=[0];let u=0,l=0;for(let t=1;t<e.length;t++){const r=e[t];n.push(r.featureId||0),i=we(i,r.positions),a=we(a,r.normals),o=we(o,r.colors),s=we(s,r.texCoords);const h=e[u];c.push(h.positions.length/9-1+l),c.push(h.positions.length/9+l),l+=h.positions.length/9,u+=1}c.push(i.length/9-1);return{faceRange:new Uint32Array(c),featureIds:n,positions:i,normals:a,colors:o,texCoords:s,featureCount:t}}(function(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r],i=t.find(e=>e.featureId===n.featureId);i?(i.positions=we(i.positions,n.positions),i.normals=we(i.normals,n.normals),i.colors=we(i.colors,n.colors),i.texCoords=we(i.texCoords,n.texCoords)):t.push(n)}return t}(function(e){const{featureIds:t,positions:r,normals:n,colors:i,texCoords:a,faceRange:o=new Uint32Array(0)}=e,s=[];let c=new Float32Array(r),u=new Float32Array(n),l=new Uint8Array(i),h=new Float32Array(a),p=0;for(let e=0;e<t.length;e++){const r=o[e+p],n=o[e+p+1],i=Jl("positions",r,n),a=Jl("normals",r,n),f=Jl("colors",r,n),d=Jl("texCoords",r,n);s.push({featureId:t[e],positions:c.slice(0,i),normals:u.slice(0,a),colors:l.slice(0,f),texCoords:h.slice(0,d)}),c=c.slice(i),u=u.slice(a),l=l.slice(f),h=h.slice(d),p+=1}return s.sort((e,t)=>e.featureId-t.featureId)}({...s,...e})),s.featureCount)}function Jl(e,t,r){const n=r-t+1,i=3*n;switch(e){case"positions":case"normals":return 9*n;case"colors":return 4*i;case"texCoords":return 2*i;default:return 0}}function Ql(e,t){let r,n,i;const a=e.boundingVolume,o=Zr.WGS84.cartesianToCartographic(a.center,new Ar);return o[2]=o[2]-t.getHeight(o[1],o[0]),a instanceof oi?(n=a.halfSize,r=new Ar(n[0],n[1],n[2]).len(),i=a.quaternion):(r=e.boundingVolume.radius,n=[r,r,r],i=(new Hn).fromMatrix3(new kn([n[0],0,0,0,n[1],0,0,0,n[2]])).normalize()),{mbs:[o[0],o[1],o[2],r],obb:{center:[o[0],o[1],o[2]],halfSize:n,quaternion:i}}}function Yl(e,t){const r=function(e){const t=[];for(let r=0;r<e.length;r+=3){const n=new Ar([e[r],e[r+1],e[r+2]]);t.push(n)}return t}(e),n=function(e,t=new oi){if(!e||0===e.length)return t.halfAxes=new kn([0,0,0,0,0,0,0,0,0]),t.center=new Ar,t;const r=e.length,n=new Ar(0,0,0);for(const t of e)n.add(t);const i=1/r;n.multiplyByScalar(i);let a=0,o=0,s=0,c=0,u=0,l=0;for(const t of e){const e=Mi.copy(t).subtract(n);a+=e.x*e.x,o+=e.x*e.y,s+=e.x*e.z,c+=e.y*e.y,u+=e.y*e.z,l+=e.z*e.z}a*=i,o*=i,s*=i,c*=i,u*=i,l*=i;const h=Ui;h[0]=a,h[1]=o,h[2]=s,h[3]=o,h[4]=c,h[5]=u,h[6]=s,h[7]=u,h[8]=l;const{unitary:p}=Oi(h,qi),f=t.halfAxes.copy(p);let d=f.getColumn(0,Li),m=f.getColumn(1,Ni),g=f.getColumn(2,zi),b=-Number.MAX_VALUE,y=-Number.MAX_VALUE,v=-Number.MAX_VALUE,w=Number.MAX_VALUE,_=Number.MAX_VALUE,k=Number.MAX_VALUE;for(const t of e)b=Math.max(t.dot(d),b),y=Math.max(t.dot(m),y),v=Math.max(t.dot(g),v),w=Math.min(t.dot(d),w),_=Math.min(t.dot(m),_),k=Math.min(t.dot(g),k);d=d.multiplyByScalar(.5*(w+b)),m=m.multiplyByScalar(.5*(_+y)),g=g.multiplyByScalar(.5*(k+v)),t.center.copy(d).add(m).add(g);const x=Fi.set(b-w,y-_,v-k).multiplyByScalar(.5),E=new kn([x[0],0,0,0,x[1],0,0,0,x[2]]);return t.halfAxes.multiplyRight(E),t}(r),i=function(e,t=new mn){if(!e||0===e.length)return t.fromCenterRadius([0,0,0],0);const r=wi.copy(e[0]),n=di.copy(r),i=mi.copy(r),a=gi.copy(r),o=bi.copy(r),s=yi.copy(r),c=vi.copy(r);for(const t of e){r.copy(t);const e=r.x,u=r.y,l=r.z;e<n.x&&r.copy(n),e>o.x&&r.copy(o),u<i.y&&r.copy(i),u>s.y&&r.copy(s),l<a.z&&r.copy(a),l>c.z&&r.copy(c)}const u=_i.copy(o).subtract(n).magnitudeSquared(),l=_i.copy(s).subtract(i).magnitudeSquared(),h=_i.copy(c).subtract(a).magnitudeSquared();let p=n,f=o,d=u;l>d&&(d=l,p=i,f=s),h>d&&(d=h,p=a,f=c);const m=ki;m.x=.5*(p.x+f.x),m.y=.5*(p.y+f.y),m.z=.5*(p.z+f.z);let g=_i.copy(f).subtract(m).magnitudeSquared(),b=Math.sqrt(g);const y=xi;y.x=n.x,y.y=i.y,y.z=a.z;const v=Ei;v.x=o.x,v.y=s.y,v.z=c.z;const w=Ai.copy(y).add(v).multiplyByScalar(.5);let _=0;for(const t of e){r.copy(t);const e=_i.copy(r).subtract(w).magnitude();e>_&&(_=e);const n=_i.copy(r).subtract(m).magnitudeSquared();if(n>g){const e=Math.sqrt(n);b=.5*(b+e),g=b*b;const t=e-b;m.x=(b*m.x+t*r.x)/e,m.y=(b*m.y+t*r.y)/e,m.z=(b*m.z+t*r.z)/e}}return b<_?(m.to(t.center),t.radius=b):(w.to(t.center),t.radius=_),t}(r);let a=Zr.WGS84.cartesianToCartographic(i.center,new Ar),o=Zr.WGS84.cartesianToCartographic(n.center,new Ar);return a[2]=a[2]-t.getHeight(a[1],a[0]),o[2]=o[2]-t.getHeight(o[1],o[0]),{mbs:[a[0],a[1],a[2],i.radius],obb:{center:o,halfSize:n.halfSize,quaternion:n.quaternion}}}function Xl(e){const t=e[3],r=new Ar(e[0],e[1],e[2]),n=new kn([t,0,0,0,t,0,0,0,t]);return new oi(r,n)}const Zl=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"];let $l=new Ar;async function eh(e,t,r,n,i,a,o){const s=a,c=function(e){const t=[],r=e.gltf.materials||[];for(const e of r)t.push(hh(e));return t}(e),u=function(e,t){var r;const n=new Map;for(const t of e.gltf.materials||[{id:"default"}])n.set(t.id,{positions:new Float32Array(0),normals:new Float32Array(0),texCoords:new Float32Array(0),colors:new Uint8Array(0),featureIndices:[],boundingVolumes:null});rh((e.gltf.scene||(null===(r=e.gltf.scenes)||void 0===r?void 0:r[0])||e.gltf).nodes,e,n,t);for(const e of n.keys()){const t=n.get(e);0!==t.positions.length?t.featureIndices=t.featureIndices.reduce((e,t)=>e.concat(t)):n.delete(e)}return n}(e,s);a&&function(e,t){for(const r of e.values()){const e=Yl(r.positions,t);r.boundingVolumes=e;const n=e.obb.center;for(let e=0;e<r.positions.length;e+=3){const i=r.positions.subarray(e,e+3);Zr.WGS84.cartesianToCartographic(Array.from(i),$l),$l[2]=$l[2]-t.getHeight($l[1],$l[0]),$l=$l.subtract(n),r.positions.set($l,e)}}}(u,o),u.has("default")&&c.push({material:{alphaMode:"opaque",pbrMetallicRoughness:{}}});const l=[];let h=t,{materials:p=[]}=e.gltf;null!=p&&p.length||p.push({id:"default"});for(let t=0;t<p.length;t++){const a=p[t];if(!u.has(a.id))continue;const o=u.get(a.id),{material:s,texture:f}=c[t];l.push(await th({convertedAttributes:o,material:s,texture:f,tileContent:e,nodeId:h,featuresHashArray:r,attributeStorageInfo:n,draco:i})),h++}return l.length?l:null}async function th({convertedAttributes:e,material:t,texture:r,tileContent:n,nodeId:i,featuresHashArray:a,attributeStorageInfo:o,draco:s}){const c=e.boundingVolumes,u=e.positions.length/3,l=u/3,{faceRange:h,featureIds:p,positions:f,normals:d,colors:m,texCoords:g,featureCount:b}=Kl({triangleCount:l,...e});n.batchTableJson&&function(e,t,r,n){const i=function(e,t,r){const n={};for(let i=0;i<e.length;i++){const a=e[i],o=gh(i,t,r);n[a.toString()]=o}return n}(e,n,r);bh(t,i),bh(e,i)}(p,e.featureIndices,a,n.batchTableJson);const y=new Uint32Array(2),v=function(e){const t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}(p);y.set([u,b],0);const w=new Uint8Array(ve(y.buffer,f.buffer,d.buffer,r?g.buffer:new ArrayBuffer(0),m.buffer,v.buffer,h.buffer)),_=s?await async function(e,t,r){const{positions:n,normals:i,texCoords:a,colors:o,featureIds:s,faceRange:c}=r,u=new Uint32Array(e);for(let e=0;e<u.length;e++)u.set([e],e);const l=function(e,t){const r=new Uint32Array(e.length);let n=0,i=0;for(let e=1;e<t.length;e+=2){const a=3*(t[e]+1);r.fill(n,i,a),n++,i=a+1}return r}(new Uint32Array(t.featureIndices.length?t.featureIndices:e),c),h={positions:n,normals:i,colors:o,"feature-index":l};a.length&&(h.texCoords=a);const p={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(s)}};return new Uint8Array(await jt({attributes:h,indices:u},Wl,{draco:{method:"MESH_SEQUENTIAL_ENCODING",attributesMetadata:p}}))}(u,e,{positions:f,normals:d,texCoords:r?g:new Float32Array(0),colors:m,featureIds:p,faceRange:h}):null,k=function(e,t,r){const n=[];if(e){const i={OBJECTID:t,...e};for(const e in i){const t=yh(e,r);let a=null;switch(t){case"Oid32":case"Int32":a=vh(i[e]);break;case"Float64":a=wh(i[e]);break;case"string":a=_h(i[e]);break;default:a=_h(i[e])}n.push(a)}}return n}(n.batchTableJson,p,o);return{geometry:w,compressedGeometry:_,texture:r,sharedResources:ph(n,i),meshMaterial:t,vertexCount:u,attributes:k,featureCount:b,boundingVolumes:c}}function rh(e,t,r,n,i=new _r([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){if(e)for(const a of e)nh(a,t,r,n,i)}function nh(e,t,r,n,i=new _r([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){const a=function(e,t){let r=t;const{matrix:n,rotation:i,scale:a,translation:o}=e;return n&&(r=t.multiplyRight(n)),i&&(r=r.rotateXYZ(i)),a&&(r=r.scale(a)),o&&(r=r.translate(o)),r}(e,i),o=e.mesh;o&&function(e,t,r,n=!1,i=new _r([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){for(const a of e.primitives){let e=null;a.material?e=r.get(a.material.id):r.has("default")&&(e=r.get("default")),k(null!==e,"Primitive - material mapping failed");const o=a.attributes;e.positions=we(e.positions,ih({vertices:o.POSITION.value,cartographicOrigin:t.cartographicOrigin,cartesianModelMatrix:t.cartesianModelMatrix,nodeMatrix:i,indices:a.indices.value,attributeSpecificTransformation:ah,useCartesianPositions:n})),e.normals=we(e.normals,ih({vertices:o.NORMAL&&o.NORMAL.value,cartographicOrigin:t.cartographicOrigin,cartesianModelMatrix:t.cartesianModelMatrix,nodeMatrix:i,indices:a.indices.value,attributeSpecificTransformation:oh,useCartesianPositions:!1})),e.texCoords=we(e.texCoords,sh(o.TEXCOORD_0&&o.TEXCOORD_0.value,a.indices.value)),e.colors=we(e.colors,ch(o.COLOR_0,a.indices.value)),e.featureIndices.push(uh(lh(o),a.indices.value))}}(o,t,r,n,a),rh(e.children,t,r,n,a)}function ih(e){const{vertices:t,indices:r,attributeSpecificTransformation:n}=e,i=new Float32Array(3*r.length);if(!t)return i;for(let a=0;a<r.length;a++){const o=3*r[a],s=t.subarray(o,o+3);let c=new Ar(Array.from(s));c=n(c,e),i[3*a]=c.x,i[3*a+1]=c.y,i[3*a+2]=c.z}return i}function ah(e,t){const{cartesianModelMatrix:r,cartographicOrigin:n,nodeMatrix:i,useCartesianPositions:a}=t;return i&&(e=e.transform(i)),e=e.transform(r),a?e:(Zr.WGS84.cartesianToCartographic([e[0],e[1],e[2]],e),e=e.subtract(n))}function oh(e,t){const{cartesianModelMatrix:r,nodeMatrix:n}=t;return n&&(e=e.transformAsVector(n)),e=e.transformAsVector(r)}function sh(e,t){const r=new Float32Array(2*t.length);if(!e)return r.fill(1),r;for(let n=0;n<t.length;n++){const i=2*t[n],a=e.subarray(i,i+2);r[2*n]=a[0],r[2*n+1]=a[1]}return r}function ch(e,t){const r=(null==e?void 0:e.components)||4,n=new Uint8Array(t.length*r);if(!e)return n.fill(255),n;const i=e.value;for(let e=0;e<t.length;e++){const a=t[e]*r,o=i.subarray(a,a+r),s=new Uint8Array(r);for(let e=0;e<o.length;e++)s[e]=255*o[e];n.set(s,e*r)}return n}function uh(e,t){if(!e.length||!t.length)return[];const r=[];for(let n=0;n<t.length;n++){const i=t[n];r.push(e[i])}return r}function lh(e){let t=[];for(let r=0;r<Zl.length;r++){const n=Zl[r];if(e[n]&&e[n].value){t=e[n].value;break}}return t}function hh(e){var t,r,n;const i={doubleSided:e.doubleSided,emissiveFactor:e.emissiveFactor.map(e=>Math.round(255*e)),alphaMode:(e.alphaMode||"OPAQUE").toLowerCase(),pbrMetallicRoughness:{roughnessFactor:(null==e||null===(t=e.pbrMetallicRoughness)||void 0===t?void 0:t.roughnessFactor)||1,metallicFactor:(null==e||null===(r=e.pbrMetallicRoughness)||void 0===r?void 0:r.metallicFactor)||1}};let a;if(null!=e&&null!==(n=e.pbrMetallicRoughness)&&void 0!==n&&n.baseColorTexture?(a=e.pbrMetallicRoughness.baseColorTexture.texture.source,i.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(a=e.emissiveTexture.texture.source,i.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}),!a){var o;const t=null==e||null===(o=e.pbrMetallicRoughness)||void 0===o?void 0:o.baseColorFactor;i.pbrMetallicRoughness.baseColorFactor=t&&t.map(e=>Math.round(255*e))||void 0}return{material:i,texture:a}}function ph(e,t){const r=e.gltf.materials,n={};if(!r||!r.length)return n;n.materialDefinitionInfos=[];for(const e of r){const{materialDefinitionInfo:r,textureDefinitionInfo:i}=fh(e,t);n.materialDefinitionInfos.push(r),i&&(n.textureDefinitionInfos=n.textureDefinitionInfos||[],n.textureDefinitionInfos.push(i))}return n}function fh(e,t){var r;const n=(null==e||null===(r=e.pbrMetallicRoughness)||void 0===r?void 0:r.baseColorTexture)||e.emissiveTexture;let i=null;n&&(i=function(e,t){return{encoding:[e.source.mimeType],images:[{id:mh(e,t),size:e.source.image.width,length:[e.source.image.data.length]}]}}(n.texture,t));const{baseColorFactor:a,metallicFactor:o}=(null==e?void 0:e.pbrMetallicRoughness)||{};let s=a;return a&&0!==a[3]||!e.emissiveFactor||(s=e.emissiveFactor,s[3]=s[3]||1),{materialDefinitionInfo:dh(s,o),textureDefinitionInfo:i}}function dh(e,t=1){const r=new Ul(0,0,0,1),n=new Ul(1,1,1,1),i=new Ul(.04/255,.04/255,.04/255,0),a=new Ul(e),o=n.subtract(i).multiply(a),s=o.lerp(o,r,t);i[3]=1;const c=i.lerp(i,a,t);return{diffuse:s.toArray(),specular:c.toArray()}}function mh(e,t){const{width:r,height:n}=e.source.image,i=t+1,a=32-i.toString(2).length,o="0".repeat(a).concat(i.toString(2));return BigInt("0b".concat((268435456+(r-1<<12)+(n-1<<0)).toString(2)).concat(o)).toString()}function gh(e,t,r){const n=function(e,t){let r="";for(const n in e)r+=e[n][t];return r}(t,e),i=bl()(n);return r.includes(i)?r.indexOf(i):r.push(i)-1}function bh(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function yh(e,t){return t.find(t=>t.name===e).attributeValues.valueType}function vh(e){const t=new Uint32Array([e.length]),r=new Uint32Array(e);return ve(t.buffer,r.buffer)}function wh(e){const t=new Uint32Array([e.length]),r=new Uint8Array(4),n=new Float64Array(e);return ve(t.buffer,r.buffer,n.buffer)}function _h(e){const t=new Uint32Array([e.length]);let r=0;const n=new Uint32Array(e.length),i=[];for(let t=0;t<e.length;t++){const a="".concat(String(e[t]),"\0"),o=Buffer.from(a),s=o.length;r+=s,n[t]=s,i.push(o)}const a=new Uint32Array([r]);return ve(t.buffer,a.buffer,n.buffer,...i)}function kh(e,t){const r=[],n=e.boundingVolume,i=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:2*t.mbs[3]*16/i},o={metricType:"maxScreenThresholdSQ",maxError:.25*Math.PI*a.maxError*a.maxError};return"OrientedBoundingBox"===n.constructor.name?(r.push(o),r.push(a)):(r.push(a),r.push(o)),r}function xh(e){let t=(e.header.lodSelection.maxScreenThreshold||{}).maxError;if(!t){const r=e.header.lodSelection.maxScreenThresholdSQ;r&&(t=Math.sqrt(r.maxError/(.25*Math.PI)))}return t||(t=16),2*e.header.mbs[3]*16/t}const Eh=[9,-18,-88,0,96,90,0,0,-60,-20,-9,18,8,0,-96,30,0,0,60,-20,9,-88,-18,90,96,0,-20,-60,0,0,186,-42,-42,-150,-96,-150,60,60,60,60,54,162,-78,30,-24,-90,-60,60,-60,60,-9,-32,18,30,24,0,20,-60,0,0,-9,8,18,30,-96,0,-20,60,0,0,54,-78,162,-90,-24,30,60,-60,60,-60,-54,78,78,90,144,90,-60,-60,-60,-60,9,-8,-18,-30,-24,0,20,60,0,0,-9,18,-32,0,24,30,0,0,-60,20,9,-18,-8,0,-24,-30,0,0,60,20],Ah=[0,0,-131,0,138,144,0,0,-102,-31,0,0,7,0,-138,42,0,0,102,-31,62,0,-31,0,0,-62,0,0,0,31,124,0,-62,0,0,-124,0,0,0,62,124,0,-62,0,0,-124,0,0,0,62,62,0,-31,0,0,-62,0,0,0,31,0,0,45,0,-183,-9,0,93,18,0,0,0,216,0,33,87,0,-93,12,-93,0,0,156,0,153,99,0,-93,-12,-93,0,0,-45,0,-3,9,0,93,-18,0,0,0,-55,0,48,42,0,0,-84,31,0,0,-7,0,-48,-42,0,0,84,31],Sh=[18,-36,-122,0,120,135,0,0,-84,-31,-18,36,-2,0,-120,51,0,0,84,-31,36,-165,-27,93,147,-9,0,-93,18,0,210,45,-111,-93,-57,-192,0,93,12,93,162,141,-75,-93,-129,-180,0,93,-12,93,-36,-21,27,93,39,9,0,-93,-18,0,0,0,62,0,0,31,0,0,0,-31,0,0,124,0,0,62,0,0,0,-62,0,0,124,0,0,62,0,0,0,-62,0,0,62,0,0,31,0,0,0,-31,-18,36,-64,0,66,51,0,0,-102,31,18,-36,2,0,-66,-51,0,0,102,31];class jh{constructor(e){this.options=e,this._v00=0,this._v01=0,this._v10=0,this._v11=0,this._t=[],this._ix=this.options._width,this._iy=this.options._height}getHeight(e,t){if(e=Math.abs(e)>90?NaN:e,isNaN(e)||isNaN(t))return NaN;const r=function(e,t){t=Math.abs(t);let r=Th(e,t);2*Math.abs(r)===t?r-=Th(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t);return r}(t,360);let n=(t=-180!==r?r:180)*this.options._rlonres,i=-e*this.options._rlatres,a=Math.floor(n),o=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(i));n-=a,i-=o,o+=(this.options._height-1)/2,a+=a<0?this.options._width:a>=this.options._width?-this.options._width:0;let s=0,c=0,u=0,l=0,h=new Array(10);if(a!==this._ix||o!==this._iy)if(this.options.cubic){const e=[this._rawval(a,o-1),this._rawval(a+1,o-1),this._rawval(a-1,o),this._rawval(a,o),this._rawval(a+1,o),this._rawval(a+2,o),this._rawval(a-1,o+1),this._rawval(a,o+1),this._rawval(a+1,o+1),this._rawval(a+2,o+1),this._rawval(a,o+2),this._rawval(a+1,o+2)];let t=Ah;0!==o&&(t=o===this.options._height-2?Sh:Eh);let r=372;0!==o&&(r=o===this.options._height-2?372:240);for(let n=0;n<10;++n){h[n]=0;for(let r=0;r<12;++r)h[n]+=e[r]*t[10*r+n];h[n]/=r}}else s=this._rawval(a,o),c=this._rawval(a+1,o),u=this._rawval(a,o+1),l=this._rawval(a+1,o+1);else this.options.cubic?h=this._t:(s=this._v00,c=this._v01,u=this._v10,l=this._v11);if(!this.options.cubic){const e=(1-i)*((1-n)*s+n*c)+i*((1-n)*u+n*l),t=this.options._offset+this.options._scale*e;return this._ix=a,this._iy=o,this._v00=s,this._v01=c,this._v10=u,this._v11=l,t}let p=h[0]+n*(h[1]+n*(h[3]+n*h[6]))+i*(h[2]+n*(h[4]+n*h[7])+i*(h[5]+n*h[8]+i*h[9]));return p=this.options._offset+this.options._scale*p,this._ix=a,this._iy=o,this._t=h,p}_rawval(e,t){e<0?e+=this.options._width:e>=this.options._width&&(e-=this.options._width),(t<0||t>=this.options._height)&&(t=t<0?-t:2*(this.options._height-1)-t,e+=(e<this.options._width/2?1:-1)*this.options._width/2);const r=this.options._datastart+2*(t*this.options._swidth+e);return this.options.data[r]<<8|this.options.data[r+1]}}function Th(e,t){return e-Math.floor(e/t)*t}function Ch(e,t){const r=function*(e){let t=0;do{const r=e.indexOf(10,t);if(-1!==r){const n=e.subarray(t,r);t=r+1,yield{offset:t,line:Bh(n)}}else{const r=e.subarray(t,e.length);t=e.length,yield{offset:t,line:Bh(r)}}}while(t<e.length);return{offset:t,line:""}}(e);let n=r.next();if(n.done||"P5"!==n.value.line)throw new Error("Geoid model file: File not in PGM format");let i=Number.MAX_VALUE,a=0,o=-1,s=-1,c="NONE",u="UNKNOWN",l=0,h=0,p=null,f=null;do{n=r.next();const e=n.value.line;if(e.length){if("#"!==e[0]){let t=e.split(" ");if(t=t.filter(e=>""!==e),l=parseInt(t[0],10),h=parseInt(t[1],10),!l||!h)throw new Error("Geoid model file: Error reading raster size");break}{const r=e.split(" "),n=r[0],l=r[1];if("#"!==n||!l)continue;const h=r.length>2?r.slice(2):[];if("Description"===l)c=h.join(" ");else if("DateTime"===l)u=h.join(" ");else if("Offset"===l){if(!r[2])throw new Error("Geoid model file: Error reading offset");i=parseInt(r[2],10)}else if("Scale"===l){if(!r[2])throw new Error("Geoid model file: Error reading scale");a=parseFloat(r[2])}else l===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(r[2]))&&(o=parseFloat(r[2])):l===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(r[2]))&&(s=parseFloat(r[2]))}}}while(!n.done);n=r.next();const d=parseInt(n.value.line,10);if(n.done)throw new Error("Geoid model file: Error reading maxval");if(65535!==d)throw new Error("Geoid model file: Incorrect value of maxval");if(p=n.value.offset,f=l,i===Number.MAX_VALUE)throw new Error("Geoid model file: Offset not set");if(0===a)throw new Error("Geoid model file: Scale not set");if(a<0)throw new Error("Geoid model file: Scale must be positive");if(h<2||l<2)throw new Error("Geoid model file: Raster size too small");if(1&l)throw new Error("Geoid model file: Raster width is odd");if(!(1&h))throw new Error("Geoid model file: Raster height is even");const m=l/360,g=(h-1)/180;return new jh({cubic:t.cubic,_width:l,_height:h,_rlonres:m,_rlatres:g,_offset:i,_scale:a,_swidth:f,_datastart:p,_maxerror:o,_rmserror:s,_description:c,_datetime:u,data:e})}function Bh(e){let t="";for(const r of e)t+=String.fromCharCode(r);return t}const Oh={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:"3.1.8",mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>Ch(new Uint8Array(e),t),extensions:["pgm"],options:{cubic:!1}},Rh={id:{path:"id",transform:e=>e.toUpperCase()},profile:{path:"profile",default:"meshpyramids"},version:{path:"version",default:"1.8"},resourcePattern:{path:"resourcePattern",default:["3dNodeIndexDocument","Attributes","SharedResource","Geometry"]},rootNode:{path:"rootNode",default:"./nodes/root"},extent:{path:"extent"},indexCRS:{path:"indexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},vertexCRS:{path:"vertexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},normalReferenceFrame:{path:"normalReferenceFrame",default:"east-north-up"},attributeEncoding:{path:"attributeEncoding",default:"application/octet-stream; version=1.6"},textureEncoding:{path:"textureEncoding",default:["image/jpeg","image/ktx2"]},lodType:{path:"lodType",default:"MeshPyramid"},lodModel:{path:"lodModel",default:"node-switching"},defaultGeometrySchema:{path:"defaultGeometrySchema",default:{geometryType:"triangles",header:[{property:"vertexCount",type:"UInt32"},{property:"featureCount",type:"UInt32"}],topology:"PerAttributeArray",ordering:["position","normal","uv0","color"],vertexAttributes:{position:{valueType:"Float32",valuesPerElement:3},normal:{valueType:"Float32",valuesPerElement:3},uv0:{valueType:"Float32",valuesPerElement:2},color:{valueType:"UInt8",valuesPerElement:4}},featureAttributeOrder:["id","faceRange"],featureAttributes:{id:{valueType:"UInt64",valuesPerElement:1},faceRange:{valueType:"UInt32",valuesPerElement:2}}}}},Ih=()=>({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"},mbs:{path:"mbs"},obb:{path:"obb"},lodSelection:{path:"lodSelection",default:[{metricType:"maxScreenThresholdSQ",maxError:196349.54374999998},{metricType:"maxScreenThreshold",maxError:999.9999999999999}]},children:{path:"children",default:null},neighbors:{path:"neighbors",default:null},parentNode:{path:"parentNode",transform:e=>ml()(e,{id:{path:"id"},href:{path:"href"},mbs:{path:"mbs"},obb:{path:"obb"}}),default:null},sharedResource:{path:"sharedResource",default:null},featureData:{path:"featureData",default:null},geometryData:{path:"geometryData",default:null},textureData:{path:"textureData",default:null},attributeData:{path:"attributeData",default:null}});function Ph(e,t,r){const n={};for(const[t,i]of e.entries())n["Mat".concat(r.nodePath).concat(t)]=ml()(i,{name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>ml()(r,{renderMode:{path:"renderMode",default:"solid"},shininess:{path:"shininess",default:1},reflectivity:{path:"reflectivity",default:0},ambient:{path:"ambient",default:[1,1,1,1]},diffuse:{path:"diffuse",default:[1,1,1,1]},specular:{path:"specular",default:[0,0,0,0]},useVertexColorAlpha:{path:"useVertexColorAlpha",default:!1},vertexRegions:{path:"vertexRegions",default:!1},vertexColors:{path:"vertexColors",default:!0}})}});return n}function Dh(e,t,r){if(!e)return null;const n={};for(const[t,i]of e.entries()){const e="".concat(r.nodePath).concat(t);i.imageIndex=e,n[e]=ml()(i,{encoding:{path:"encoding"},wrap:{path:"wrap",default:["none"]},atlas:{path:"atlas",default:!1},uvSet:{path:"uvSet",default:"uv0"},channels:{path:"channels",default:"rgb"},images:{path:"images",transform:(e,t,r)=>e.map(e=>ml()(e,{id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}))}})}return n}function Mh(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}const Fh={};function Lh(e="id"){Fh[e]=Fh[e]||1;const t=Fh[e]++;return"".concat(e,"-").concat(t)}const Nh={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};const zh=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Uh=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),qh=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),Hh=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),Gh={POSITION:{size:3,value:new Float32Array(Uh)},NORMAL:{size:3,value:new Float32Array(qh)},TEXCOORD_0:{size:2,value:new Float32Array(Hh)}};class Vh extends class{static get DRAW_MODE(){return Nh}constructor(e={}){const{id:t=Lh("geometry"),drawMode:r=Nh.TRIANGLES,attributes:n={},indices:i=null,vertexCount:a=null}=e;this.id=t,this.drawMode=0|r,this.attributes={},this.userData={},this._setAttributes(n,i),this.vertexCount=a||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return"Geometry ".concat(this.id," attribute ").concat(e)}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const t in e){let r=e[t];r=ArrayBuffer.isView(r)?{value:r}:r,Mh(ArrayBuffer.isView(r.value),"".concat(this._print(t),": must be typed array or object with value as typed array")),"POSITION"!==t&&"positions"!==t||r.size||(r.size=3),"indices"===t?(Mh(!this.indices),this.indices=r):this.attributes[t]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let r=1/0;for(const t in e){const n=e[t],{value:i,size:a,constant:o}=n;!o&&i&&a>=1&&(r=Math.min(r,i.length/a))}return Mh(Number.isFinite(r)),r}}{constructor(e={}){const{id:t=Lh("cube-geometry")}=e;super({...e,id:t,indices:{size:1,value:new Uint16Array(zh)},attributes:{...Gh,...e.attributes}})}}function Wh(e){var t,r;if(null==e||null===(t=e.parentNode)||void 0===t||!t.obb||null==e||null===(r=e.parentNode)||void 0===r||!r.mbs)return[];const n=[];return function(e,t){var r;const n=function(e){const{center:t,halfSize:r,quaternion:n}=e;return(new oi).fromCenterHalfSizeQuaternion(t,r,n)}(t.parentNode.obb),i=function(e){const t=new Vh,r=e.obb.halfSize,n=t.getAttributes(),i=new Float32Array(n.POSITION.value),a=Zr.WGS84.cartographicToCartesian(e.obb.center);let o=[];for(let t=0;t<i.length;t+=3){const n=new Ar(i[t]*=r[0],i[t+1]*=r[1],i[t+2]*=r[2]).transformByQuaternion(e.obb.quaternion).add(a);o=o.concat(n)}return o}(t);if(function(e,t){let r=!0;for(let n=0;n<t.length/3;n+=3){const i=[t[n],t[n+1],t[n+2]],a=Zr.WGS84.cartesianToCartographic(i);if(e.distanceTo(a)>0){r=!1;break}}return r}(n,i))return;const a="OBB of Tile (".concat(t.id,") doesn't fit into Parent (").concat(null===(r=t.parentNode)||void 0===r?void 0:r.id,") tile OBB");e.push(a)}(n,e),function(e,t){const r=Kh(t.mbs),n=Kh(t.parentNode.mbs);if(r.center.distanceTo(n.center)+r.radius>n.radius){var i;const r="MBS of Tile (".concat(t.id,") doesn't fit into Parent (").concat(null===(i=t.parentNode)||void 0===i?void 0:i.id,") tile MBS");e.push(r)}}(n,e),n}function Kh(e){return new mn([e[0],e[1],e[2]],e[3])}const Jh={name:"Basis Universal Supercompressed GPU Texture",id:"ktx2-basis-supercompressed-texture",module:"textures",version:"3.1.8",extensions:["ktx2"],options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1},encode:async function(e,t={}){const{useSRGB:r=!1,qualityLevel:n=10,encodeUASTC:i=!1,mipmaps:a=!1}=t,{BasisEncoder:o}=await cs(t),s=new o;try{const t=new Uint8Array(e.width*e.height*4);s.setCreateKTX2File(!0),s.setKTX2UASTCSupercompression(!0),s.setKTX2SRGBTransferFunc(!0),s.setSliceSourceImage(0,e.data,e.width,e.height,!1),s.setPerceptual(r),s.setMipSRGB(r),s.setQualityLevel(n),s.setUASTC(i),s.setMipGen(a);const o=s.encode(t);return t.subarray(0,o).buffer}catch(e){throw console.error("Basis Universal Supercompressed GPU Texture encoder Error: ",e),e}finally{s.delete()}}},{_encodeImageNode:Qh}=globalThis;let Yh=!0;const Xh={name:"Images",id:"image",module:"images",version:"3.1.8",extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:async function(e,t){return(t=t||{}).image=t.image||{},Qh?Qh(e,{type:t.image.mimeType}):async function(e,t){const{mimeType:r,jpegQuality:n}=t.image,{width:i,height:a}=function(e){return Ys(e)}(e),o=document.createElement("canvas");o.width=i,o.height=a,function(e,t,r=0,n=0){if(0===r&&0===n&&"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=t.getContext("bitmaprenderer");if(r)return r.transferFromImageBitmap(e),t}const i=t.getContext("2d");if(e.data){const r=new Uint8ClampedArray(e.data),n=new ImageData(r,e.width,e.height);return i.putImageData(n,0,0),t}i.drawImage(e,0,0)}(e,o);const s=await new Promise(e=>{if(n&&Yh)try{return void o.toBlob(e,r,n)}catch(e){Yh=!1}o.toBlob(e,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}(e,t)}},Zh=fl.a.env.IonToken||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlYWMxMzcyYy0zZjJkLTQwODctODNlNi01MDRkZmMzMjIxOWIiLCJpZCI6OTYyMCwic2NvcGVzIjpbImFzbCIsImFzciIsImdjIl0sImlhdCI6MTU2Mjg2NjI3M30.1FNiClUyk00YH_nWfSGpiQAjR5V2OvREDq1PJ5QMjWQ";class $h{constructor(){Object(p.a)(this,"nodePages",void 0),Object(p.a)(this,"fileMap",void 0),Object(p.a)(this,"options",void 0),Object(p.a)(this,"layers0Path",void 0),Object(p.a)(this,"materialMap",void 0),Object(p.a)(this,"materialDefinitions",void 0),Object(p.a)(this,"vertexCounter",void 0),Object(p.a)(this,"layers0",void 0),Object(p.a)(this,"featuresHashArray",void 0),Object(p.a)(this,"refinementCounter",void 0),Object(p.a)(this,"validate",void 0),Object(p.a)(this,"boundingVolumeWarnings",[]),Object(p.a)(this,"conversionStartTime",[0,0]),Object(p.a)(this,"refreshTokenTime",[0,0]),Object(p.a)(this,"sourceTileset",null),Object(p.a)(this,"geoidHeightModel",null),Object(p.a)(this,"Loader",Zu),Object(p.a)(this,"generateTextures",void 0),Object(p.a)(this,"generateBoundingVolumes",void 0),this.nodePages=new yl(Il,64),this.fileMap={},this.options={},this.layers0Path="",this.materialMap=new Map,this.materialDefinitions=[],this.vertexCounter=0,this.layers0=null,this.featuresHashArray=[],this.refinementCounter={tilesCount:0,tilesWithAddRefineCount:0},this.validate=!1,this.generateTextures=!1,this.generateBoundingVolumes=!1}async convert(e){this.conversionStartTime=fl.a.hrtime();const{tilesetName:t,slpk:r,egmFilePath:n,inputUrl:i,validate:a,outputPath:o,draco:s,sevenZipExe:c,maxDepth:u,token:l,generateTextures:h,generateBoundingVolumes:p}=e;this.options={maxDepth:u,slpk:r,sevenZipExe:c,egmFilePath:n,draco:s,token:l,inputUrl:i},this.validate=Boolean(a),this.Loader=-1!==i.indexOf("https://")?el:Zu,this.generateTextures=Boolean(h),this.generateBoundingVolumes=Boolean(p),console.log("Loading egm file..."),this.geoidHeightModel=await St(n,Oh),console.log("Loading egm file completed!"),r&&this.nodePages.useWriteFunction(Pl);const f=await this._fetchPreloadOptions(),d={loadOptions:{basis:{format:"rgba32"}}};f.headers&&(d.loadOptions.fetch={headers:f.headers}),Object.assign(d,f);const m=await St(i,this.Loader,d.loadOptions);return this.sourceTileset=new Ba(m,d),await this._createAndSaveTileset(o,t),await this._finishConversion({slpk:Boolean(r),outputPath:o,tilesetName:t}),m}async _createAndSaveTileset(e,t){const r=Object(tl.join)("".concat(e),"".concat(t));try{await Dl(r)}catch(e){}this.layers0Path=Object(tl.join)(r,"SceneServer","layers","0"),this._formLayers0(t),this.materialDefinitions=[],this.materialMap=new Map;const n=this.sourceTileset.root,i=Ql(n,this.geoidHeightModel),a=this.nodePages.push({index:0,lodThreshold:0,obb:i.obb,children:[]}),o=this.options.slpk,s=this._formRootNodeIndexDocument(i);await this._convertNodesTree(s,n,a,i),this.layers0.materialDefinitions=this.materialDefinitions,await this._writeLayers0(),async function(e,t,r){const n={serviceItemId:hl().replace(/-/gi,""),layerName:e,layers0:t},i=ml()(n,{serviceItemId:{path:"serviceItemId"},serviceName:{path:"layerName"},name:{path:"layerName"},currentVersion:{path:"currentVersion",default:10.7},serviceVersion:{path:"serviceVersion",default:"1.8"},supportedBindings:{path:"supportedBindings",default:["REST"]},layers:{path:"layers0",transform:e=>[e]}}),a=Object(tl.join)(r,"SceneServer");await Il(a,JSON.stringify(i))}(t,this.layers0,r),await this._writeNodeIndexDocument(s,"root",Object(tl.join)(this.layers0Path,"nodes","root")),await this.nodePages.save(this.layers0Path,this.fileMap,o),await this._createSlpk(r)}_formLayers0(e){const t=function(e){const t=null==e?void 0:e.cartesianCenter;if(!t)return null;const r=null==e?void 0:e.lodMetricValue,n=Zr.WGS84.cartesianToCartographic(new Ar(t[0]+r,t[1]+r,t[2]),new Ar),i=Zr.WGS84.cartesianToCartographic(new Ar(t[0]-r,t[1]-r,t[2]),new Ar),a=n[0]<i[0],o=n[1]<i[1];return[a?n[0]:i[0],o?n[1]:i[1],a?i[0]:n[0],o?i[1]:n[1]]}(this.sourceTileset),r={version:"{".concat(hl().toUpperCase(),"}"),id:0,name:e,href:"./layers/0",store:{id:"{".concat(hl().toUpperCase(),"}"),extent:t},nodePages:{nodesPerPage:64},compressGeometry:this.options.draco};this.layers0=ml()(r,{version:{path:"version",transform:e=>e.toUpperCase()},id:{path:"id",default:0},name:{path:"name"},href:{path:"href",default:"./layers/0"},layerType:{path:"layerType",default:"IntegratedMesh"},spatialReference:{path:"spatialReference",transform:e=>ml()(e,{wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}})},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>ml()(e,Rh)},heightModelInfo:{path:"heightModelInfo",transform:e=>ml()(e,{heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}})},nodePages:{path:"nodePages",transform:e=>ml()(e,{nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}})},materialDefinitions:{path:"materialDefinitions",default:[]},textureSetDefinitions:{path:"textureSetDefinitions",default:[]},geometryDefinitions:{path:"compressGeometry",transform:e=>{const t=[{geometryBuffers:[]},{geometryBuffers:[]}];return t[0].geometryBuffers.push({offset:8,position:{type:"Float32",component:3},normal:{type:"Float32",component:3},uv0:{type:"Float32",component:2},color:{type:"UInt8",component:4},featureId:{binding:"per-feature",type:"UInt64",component:1},faceRange:{binding:"per-feature",type:"UInt32",component:2}}),t[1].geometryBuffers.push({offset:8,position:{type:"Float32",component:3},normal:{type:"Float32",component:3},color:{type:"UInt8",component:4},featureId:{binding:"per-feature",type:"UInt64",component:1},faceRange:{binding:"per-feature",type:"UInt32",component:2}}),e&&(t[0].geometryBuffers.push({compressedAttributes:{encoding:"draco",attributes:["position","normal","uv0","color","feature-index"]}}),t[1].geometryBuffers.push({compressedAttributes:{encoding:"draco",attributes:["position","normal","color","feature-index"]}})),t},default:[{geometryBuffers:[{offset:8,position:{type:"Float32",component:3},normal:{type:"Float32",component:3},uv0:{type:"Float32",component:2},color:{type:"UInt8",component:4},featureId:{binding:"per-feature",type:"UInt64",component:1},faceRange:{binding:"per-feature",type:"UInt32",component:2}},{offset:8,position:{type:"Float32",component:3},normal:{type:"Float32",component:3},color:{type:"UInt8",component:4},featureId:{binding:"per-feature",type:"UInt64",component:1},faceRange:{binding:"per-feature",type:"UInt32",component:2}}]}]},attributeStorageInfo:{path:"attributeStorageInfo",default:[]},fields:{path:"fields",default:[]},popupInfo:{path:"popupInfo",default:null}})}_formRootNodeIndexDocument(e){const t={version:"{".concat(hl().toUpperCase(),"}"),id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}],...e,children:[]};return ml()(t,Ih())}async _convertNodesTree(e,t,r,n){if(await this.sourceTileset._loadTile(t),this.isContentSupported(t)){e.children=e.children||[],e.children.push({id:"1",href:"./1",...n});const[i]=await this._createNode(e,t,r,0),a=Object(tl.join)(this.layers0Path,"nodes",i.path);this.options.slpk?this.fileMap["nodes/1/3dNodeIndexDocument.json.gz"]=await Pl(a,JSON.stringify(i),"3dNodeIndexDocument.json"):await Il(a,JSON.stringify(i))}else await this._addChildrenWithNeighborsAndWriteFile({parentNode:e,sourceTiles:t.children,parentId:r,level:1});await t.unloadContent()}async _writeLayers0(){this.options.slpk?this.fileMap["3dSceneLayer.json.gz"]=await Pl(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json"):await Il(this.layers0Path,JSON.stringify(this.layers0))}async _writeNodeIndexDocument(e,t,r){this.options.slpk?this.fileMap["nodes/".concat(t,"/3dNodeIndexDocument.json.gz")]=await Pl(r,JSON.stringify(e),"3dNodeIndexDocument.json"):await Il(r,JSON.stringify(e))}async _createSlpk(e){if(this.options.slpk){const t=Object(tl.join)(e,"SceneServer","layers","0"),r="".concat(e,".slpk");await Bl(t,r,0,".",this.options.sevenZipExe);try{await Dl(e)}catch(e){}}}async _addChildrenWithNeighborsAndWriteFile(e){const t=[];await this._addChildren({...e,childNodes:t}),await this._addNeighborsAndWriteFile(e.parentNode,t)}async _addChildren(e){const{childNodes:t,sourceTiles:r,parentNode:n,parentId:i,level:a}=e;if(!(this.options.maxDepth&&a>this.options.maxDepth))for(const e of r){if("json"===e.type)await this.sourceTileset._loadTile(e),await this._addChildren({parentNode:n,sourceTiles:e.children,childNodes:t,parentId:i,level:a+1}),await e.unloadContent();else{const r=await this._createNode(n,e,i,a);n.children=n.children||[];for(const e of r)n.children.push({id:e.id,href:"../".concat(e.path),obb:e.obb,mbs:e.mbs}),t.push(e)}e.id&&console.log(e.id)}}async _addNeighborsAndWriteFile(e,t){for(const n of t){var r;const t=Object(tl.join)(this.layers0Path,"nodes",n.path),i=n.path;if(delete n.path,Number(null==e||null===(r=e.children)||void 0===r?void 0:r.length)<1e3)for(const t of e.children||[])n.id!==t.id&&n.neighbors&&n.neighbors.push({...t});else console.warn("Node ".concat(n.id,": neighbors attribute is omited because of large number of neigbors")),delete n.neighbors;await this._writeNodeIndexDocument(n,i,t),n.neighbors=[]}}async _createNode(e,t,r,n){var i;this.validate&&this._checkAddRefinementTypeForTile(t),await this._updateTilesetOptions(),await this.sourceTileset._loadTile(t);let a=Ql(t,this.geoidHeightModel);(null==t||null===(i=t.content)||void 0===i?void 0:i.batchTableJson)&&this._convertAttributeStorageInfo(t.content);const o=await this._convertResources(t),s=[],c=[],u={geometry:null,compressedGeometry:null,texture:null,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(const n of o||[u]){this.generateBoundingVolumes&&n.boundingVolumes&&(a=n.boundingVolumes);const i=kh(t,a),o=i.find(e=>"maxScreenThresholdSQ"===e.metricType)||{maxError:0},u=this._createNodeInNodePages(o,a,t,r,n),l=this._createNodeIndexDocument(e,a,i,u,n);u.mesh&&await this._writeResources(n,l.path),this.validate&&(this.boundingVolumeWarnings=Wh(l),this.boundingVolumeWarnings&&this.boundingVolumeWarnings.length&&console.warn("Bounding Volume Warnings: ",...this.boundingVolumeWarnings)),s.push(l),c.push(u)}return t.unloadContent(),await this._addChildrenWithNeighborsAndWriteFile({parentNode:s[0],sourceTiles:t.children,parentId:c[0].index,level:n+1}),s}_convertAttributeStorageInfo(e){var t,r;const n=e&&e.batchTableJson;!n||null!==(t=this.layers0)&&void 0!==t&&null!==(r=t.attributeStorageInfo)&&void 0!==r&&r.length||this._convertBatchTableInfoToNodeAttributes(n)}async _convertResources(e){var t;if(!this.isContentSupported(e))return null;return await eh(e.content,Number(this.nodePages.nodesCounter),this.featuresHashArray,null===(t=this.layers0)||void 0===t?void 0:t.attributeStorageInfo,this.options.draco,this.generateBoundingVolumes,this.geoidHeightModel)}_createNodeInNodePages(e,t,r,n,i){const{meshMaterial:a,texture:o,vertexCount:s,featureCount:c,geometry:u}=i,l={index:0,lodThreshold:e.maxError,obb:t.obb,children:[]};u&&this.isContentSupported(r)&&(l.mesh={geometry:{definition:o?0:1,resource:0},attribute:{resource:0},material:{definition:0}});const h=this.nodePages.push(l,n);if(a&&this.nodePages.updateMaterialByNodeId(h,this._findOrCreateMaterial(a)),o){const e=o.image.height*o.image.width;this.nodePages.updateTexelCountHintByNodeId(h,e)}return s&&(this.vertexCounter+=s,this.nodePages.updateVertexCountByNodeId(h,s)),this.nodePages.updateNodeAttributeByNodeId(h),c&&this.nodePages.updateFeatureCountByNodeId(h,c),l}_createNodeIndexDocument(e,t,r,n,i){const{texture:a,attributes:o}=i,s=n.index,c={version:e.version,id:s.toString(),path:s.toString(),level:e.level+1,...t,lodSelection:r,parentNode:{id:e.id,href:"../".concat(e.id),mbs:e.mbs,obb:e.obb},children:[],neighbors:[]},u=ml()(c,Ih());var l,h;if(n.mesh&&(u.geometryData=[{href:"./geometries/0"}],u.sharedResource={href:"./shared"},a&&(u.textureData=[{href:"./textures/0"},{href:"./textures/1"}]),o&&o.length&&null!==(l=this.layers0)&&void 0!==l&&null!==(h=l.attributeStorageInfo)&&void 0!==h&&h.length)){u.attributeData=[];for(let e=0;e<o.length;e++){const t=this.layers0.attributeStorageInfo[e].key;u.attributeData.push({href:"./attributes/".concat(t,"/0")})}}return u}async _writeResources(e,t){const{geometry:r,compressedGeometry:n,texture:i,sharedResources:a,attributes:o}=e,s=Object(tl.join)(this.layers0Path,"nodes",t),c=Object(tl.join)("nodes",t);await this._writeGeometries(r,n,s,c),await this._writeShared(a,s,c,t),await this._writeTexture(i,s,c),await this._writeAttributes(o,s,c)}async _writeGeometries(e,t,r,n){if(this.options.slpk){const t=Object(tl.join)(r,"geometries");this.fileMap["".concat(n,"/geometries/0.bin.gz")]=await Pl(t,e,"0.bin")}else{const t=Object(tl.join)(r,"geometries/0/");await Il(t,e,"index.bin")}if(this.options.draco)if(this.options.slpk){const e=Object(tl.join)(r,"geometries");this.fileMap["".concat(n,"/geometries/1.bin.gz")]=await Pl(e,t,"1.bin")}else{const e=Object(tl.join)(r,"geometries/1/");await Il(e,t,"index.bin")}}async _writeShared(e,t,r,n){e.nodePath=n;const i=ml()(e,{materialDefinitions:{path:"materialDefinitionInfos",transform:Ph},textureDefinitions:{path:"textureDefinitionInfos",transform:Dh}}),a=JSON.stringify(i);if(this.options.slpk){const e=Object(tl.join)(t,"shared");this.fileMap["".concat(r,"/shared/sharedResource.json.gz")]=await Pl(e,a,"sharedResource.json")}else{const e=Object(tl.join)(t,"shared/");await Il(e,a)}}async _writeTexture(e,t,r){if(e){const n=this._getFormatByMimeType(null==e?void 0:e.mimeType),i=[],a=e.bufferView.data;switch(n){case"jpg":case"png":if(i.push({name:"0",format:n}),await this.writeTextureFile(a,"0",n,t,r),this.generateTextures){i.push({name:"1",format:"ktx2"});const n=new Uint8Array(await jt(e.image,Jh));await this.writeTextureFile(n,"1","ktx2",t,r)}break;case"ktx2":if(i.push({name:"1",format:n}),await this.writeTextureFile(a,"1",n,t,r),this.generateTextures){i.push({name:"0",format:"jpg"});const n=new Uint8Array(await jt(e.image.data[0],Xh));await this.writeTextureFile(n,"0","jpg",t,r)}}this.layers0.textureSetDefinitions.length||this.layers0.textureSetDefinitions.push({formats:i})}}async writeTextureFile(e,t,r,n,i){if(this.options.slpk){const a=Object(tl.join)(n,"textures"),o=!1;this.fileMap["".concat(i,"/textures/").concat(t,".").concat(r)]=await Pl(a,e,"".concat(t,".").concat(r),o)}else{const i=Object(tl.join)(n,"textures/".concat(t,"/"));await Il(i,e,"index.".concat(r))}}async _writeAttributes(e,t,r){var n,i;if(e.length&&null!==(n=this.layers0)&&void 0!==n&&null!==(i=n.attributeStorageInfo)&&void 0!==i&&i.length)for(let n=0;n<e.length;n++){const i=this.layers0.attributeStorageInfo[n].key,a=new Uint8Array(e[n]);if(this.options.slpk){const e=Object(tl.join)(t,"attributes",i);this.fileMap["".concat(r,"/attributes/").concat(i,".bin.gz")]=await Pl(e,a,"0.bin")}else{const e=Object(tl.join)(t,"attributes/".concat(i,"/0"));await Il(e,a,"index.bin")}}}_getFormatByMimeType(e){switch(e){case"image/jpeg":return"jpg";case"image/png":return"png";case"image/ktx2":return"ktx2";default:return"jpg"}}_findOrCreateMaterial(e){const t=bl()(JSON.stringify(e));if(this.materialMap.has(t))return this.materialMap.get(t);const r=this.materialDefinitions.push(e)-1;return this.materialMap.set(t,r),r}_createdStorageAttribute(e,t,r){const n={key:"f_".concat(e),name:t,ordering:["attributeValues"],header:[{property:"count",valueType:"UInt32"}],attributeValues:{valueType:"Int32",valuesPerElement:1}};switch(r){case"OBJECTID":this._setupIdAttribute(n);break;case"string":this._setupStringAttribute(n);break;case"double":this._setupDoubleAttribute(n);break;case"Int32":break;default:this._setupStringAttribute(n)}return n}getAttributeType(e,t){return"OBJECTID"===e?"OBJECTID":"string"==typeof t?"string":"number"==typeof t?Number.isInteger(t)?"Int32":"double":"string"}_setupStringAttribute(e){e.ordering.unshift("attributeByteCounts"),e.header.push({property:"attributeValuesByteCount",valueType:"UInt32"}),e.attributeValues={valueType:"String",encoding:"UTF-8",valuesPerElement:1},e.attributeByteCounts={valueType:"UInt32",valuesPerElement:1}}_setupIdAttribute(e){e.attributeValues={valueType:"Oid32",valuesPerElement:1}}_setupDoubleAttribute(e){e.attributeValues={valueType:"Float64",valuesPerElement:1}}_createFieldAttribute(e,t){return{name:e,type:t,alias:e}}_convertBatchTableInfoToNodeAttributes(e){let t=0;const r={OBJECTID:[0],...e};for(const e in r){const n=r[e][0],i=this.getAttributeType(e,n),a=this._createdStorageAttribute(t,e,i),o=this._getFieldAttributeType(i),s=this._createFieldAttribute(e,o),c=this._createPopupInfo(r);this.layers0.attributeStorageInfo.push(a),this.layers0.fields.push(s),this.layers0.popupInfo=c,this.layers0.layerType="3DObject",t+=1}}_getFieldAttributeType(e){switch(e){case"OBJECTID":return"esriFieldTypeOID";case"string":return"esriFieldTypeString";case"Int32":return"esriFieldTypeInteger";case"double":return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}_createPopupInfo(e){const t=[],r=[];for(const r in e)t.push({fieldName:r,visible:!0,isEditable:!1,label:r});return r.push({fieldInfos:t,type:"fields"}),{title:"{OBJECTID}",mediaInfos:[],popupElements:r,fieldInfos:t,expressionInfos:[]}}async _finishConversion(e){const{tilesCount:t,tilesWithAddRefineCount:r}=this.refinementCounter,n=r?r/t*100:0,i=await Nl(e),a=Ll(fl.a.hrtime(this.conversionStartTime));console.log("------------------------------------------------"),console.log("Finishing conversion of ".concat("3DTILES")),console.log("Total conversion time: ".concat(a)),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",i," bytes"),console.log('Percentage of tiles with "ADD" refinement type:',n,"%"),console.log("------------------------------------------------")}async _fetchPreloadOptions(){if(!this.Loader.preload)return{};const e={"cesium-ion":{accessToken:this.options.token||Zh}},t=await this.Loader.preload(this.options.inputUrl,e);return this.refreshTokenTime=fl.a.hrtime(),{...e,...t}}async _updateTilesetOptions(){if(fl.a.hrtime(this.refreshTokenTime)[0]<1800)return;this.refreshTokenTime=fl.a.hrtime();const e=await this._fetchPreloadOptions();this.sourceTileset.options={...this.sourceTileset.options,...e},e.headers&&(this.sourceTileset.loadOptions.fetch={...this.sourceTileset.loadOptions.fetch,headers:e.headers},console.log("Authorization Bearer token has been updated"))}_checkAddRefinementTypeForTile(e){1===e.refine&&(this.refinementCounter.tilesWithAddRefineCount+=1,console.warn('This tile uses "ADD" type of refinement')),this.refinementCounter.tilesCount+=1}isContentSupported(e){var t;return["b3dm","glTF"].includes(null==e||null===(t=e.content)||void 0===t?void 0:t.type)}}const ep=542327876,tp=31,rp=0,np=1,ip=2,ap=3,op=4,sp=7,cp=20,up=21,lp=131072,hp=4,pp={DXT1:us.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:us.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:us.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":us.COMPRESSED_RGB_ATC_WEBGL,ATCA:us.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:us.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},fp={DXT1:mp,DXT3:gp,DXT5:gp,"ATC ":mp,ATCA:gp,ATCI:gp};function dp(e){const t=new Int32Array(e,0,tp),r=t[up];k(Boolean(t[cp]&hp),"DDS: Unsupported format, must contain a FourCC code");const n=(i=r,String.fromCharCode(255&i,i>>8&255,i>>16&255,i>>24&255));var i;const a=pp[n],o=fp[n];k(a&&o,"DDS: Unknown pixel format ".concat(r));let s=1;t[ip]&lp&&(s=Math.max(1,t[sp]));const c=t[op],u=t[ap],l=t[np]+4;return js(new Uint8Array(e,l),{mipMapLevels:s,width:c,height:u,sizeFunction:o,internalFormat:a})}function mp(e,t){return(e+3>>2)*(t+3>>2)*8}function gp(e,t){return(e+3>>2)*(t+3>>2)*16}const bp=55727696,yp=1347834371,vp=13,wp=52,_p=0,kp=2,xp=4,Ep=6,Ap=7,Sp=11,jp=12,Tp={0:[us.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[us.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[us.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[us.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[us.COMPRESSED_RGB_ETC1_WEBGL],7:[us.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[us.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[us.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[us.COMPRESSED_RGB8_ETC2],23:[us.COMPRESSED_RGBA8_ETC2_EAC],24:[us.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[us.COMPRESSED_R11_EAC],26:[us.COMPRESSED_RG11_EAC],27:[us.COMPRESSED_RGBA_ASTC_4X4_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[us.COMPRESSED_RGBA_ASTC_5X4_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[us.COMPRESSED_RGBA_ASTC_5X5_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[us.COMPRESSED_RGBA_ASTC_6X5_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[us.COMPRESSED_RGBA_ASTC_6X6_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[us.COMPRESSED_RGBA_ASTC_8X5_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[us.COMPRESSED_RGBA_ASTC_8X6_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[us.COMPRESSED_RGBA_ASTC_8X8_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[us.COMPRESSED_RGBA_ASTC_10X5_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[us.COMPRESSED_RGBA_ASTC_10X6_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[us.COMPRESSED_RGBA_ASTC_10X8_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[us.COMPRESSED_RGBA_ASTC_10X10_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[us.COMPRESSED_RGBA_ASTC_12X10_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[us.COMPRESSED_RGBA_ASTC_12X12_KHR,us.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},Cp={0:Bp,1:Bp,2:Op,3:Op,6:Rp,7:Rp,9:Ip,11:Ip,22:Rp,23:Ip,24:Rp,25:Rp,26:Ip,27:Ip,28:function(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16},29:function(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16},30:function(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16},31:function(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16},32:function(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16},33:function(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16},34:function(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16},35:function(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16},36:function(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16},37:function(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16},38:function(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16},39:function(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16},40:function(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}};function Bp(e,t){return(e=Math.max(e,16))*(t=Math.max(t,8))/4}function Op(e,t){return(e=Math.max(e,8))*(t=Math.max(t,8))/2}function Rp(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function Ip(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function Pp(e){if(Rs(e))return Is(e);if(function(e){return new Uint32Array(e,0,tp)[rp]===ep}(e))return dp(e);if(function(e){const t=new Uint32Array(e,0,vp)[_p];return t===bp||t===yp}(e))return function(e){const t=new Uint32Array(e,0,vp),r=t[kp],n=t[xp],i=Tp[r]||[],a=i.length>1&&n?i[1]:i[0],o=Cp[r],s=t[Sp],c=t[Ap],u=t[Ep],l=wp+t[jp];return js(new Uint8Array(e,l),{mipMapLevels:s,width:c,height:u,sizeFunction:o,internalFormat:a})}(e);throw new Error("Texture container format not recognized")}const Dp={name:"Texture Containers",id:"compressed-texture",module:"textures",version:"3.1.8",worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/",useBasis:!1}}},Mp={...Dp,parse:async(e,t)=>t["compressed-texture"].useBasis?(t.basis={format:{alpha:"BC3",noAlpha:"BC1"},...t.basis,containerFormat:"ktx2",module:"encoder"},await Ds(e,t)):Pp(e)};let Fp,Lp;function Np(e,t=null){return t?"".concat(e,"?token=").concat(t):e}!function(e){e.UInt8="UInt8",e.UInt16="UInt16",e.UInt32="UInt32",e.UInt64="UInt64",e.Int16="Int16",e.Int32="Int32",e.Int64="Int64",e.Float32="Float32",e.Float64="Float64"}(Fp||(Fp={})),function(e){e.vertexCount="vertexCount",e.featureCount="featureCount"}(Lp||(Lp={}));var zp=5121,Up=5125,qp=5126,Hp=5130;function Gp(e){switch(e){case Fp.UInt8:return Uint8Array;case Fp.UInt16:return Uint16Array;case Fp.UInt32:return Uint32Array;case Fp.Float32:return Float32Array;case Fp.UInt64:return Float64Array;default:throw new Error("parse i3s tile content: unknown type of data: ".concat(e))}}const Vp={UInt8:zp,UInt16:Up,Float32:qp,UInt32:Up,UInt64:Hp};function Wp(e){switch(e){case Fp.UInt8:return 1;case Fp.UInt16:case Fp.Int16:return 2;case Fp.UInt32:case Fp.Int32:case Fp.Float32:return 4;case Fp.UInt64:case Fp.Int64:case Fp.Float64:return 8;default:throw new Error("parse i3s tile content: unknown size of data: ".concat(e))}}let Kp;!function(e){e[e.DEFAULT=-1]="DEFAULT",e[e.LNGLAT=1]="LNGLAT",e[e.METER_OFFSETS=2]="METER_OFFSETS",e[e.LNGLAT_OFFSETS=3]="LNGLAT_OFFSETS",e[e.CARTESIAN=0]="CARTESIAN"}(Kp||(Kp={}));const Jp=new Ar([0,0,0]);async function Qp(e,t,r,n,i){if(t.content=t.content||{},t.content.featureIds=t.content.featureIds||null,t.content.attributes={},t.textureUrl){var a;const e=Np(t.textureUrl,null==n||null===(a=n.i3s)||void 0===a?void 0:a.token),r=function(e){switch(e){case"ktx-etc2":case"dds":return Mp;case"ktx2":return Hs;case"jpg":case"png":default:return cc}}(t.textureFormat),o=await fetch(e),s=await o.arrayBuffer();if(null!=n&&n.i3s.decodeTextures){if(r===cc){const e={...t.textureLoaderOptions,image:{type:"data"}};try{t.content.texture=await i.parse(s,e)}catch(n){t.content.texture=await At(s,r,e)}}else if(r===Mp||r===Hs){const e=await St(s,r,t.textureLoaderOptions);t.content.texture={compressed:!0,mipmaps:!1,width:e[0].width,height:e[0].height,data:e}}}else t.content.texture=s}return t.content.material=function(e,t){let r;e?r={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(r={pbrMetallicRoughness:{}},t?r.pbrMetallicRoughness.baseColorTexture={texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]);r.alphaCutoff=r.alphaCutoff||.25,r.alphaMode&&(r.alphaMode=r.alphaMode.toUpperCase());r.emissiveFactor&&(r.emissiveFactor=$p(r.emissiveFactor));r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=$p(r.pbrMetallicRoughness.baseColorFactor));t&&function(e,t){const r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:r}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:r}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:r}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:r})}(r,t);return r}(t.materialDefinition,t.content.texture),t.content.material&&(t.content.texture=null),await async function(e,t,r,n){var i;if(!t.content)return t;const a=t.content;let o,s,c,u=0,l=0;if(t.isDracoGeometry){var h;const t=await At(e,Ao,{draco:{attributeNameEntry:"i3s-attribute-type"}});s=t.header.vertexCount,c=null===(h=t.indices)||void 0===h?void 0:h.value;const{POSITION:r,NORMAL:n,COLOR_0:i,TEXCOORD_0:a,"feature-index":u,"uv-region":l}=t.attributes;o={position:r,normal:n,color:i,uv0:a,uvRegion:l,id:u},function(e,t){for(const r in t.loaderData.attributes){const n=t.loaderData.attributes[r];switch(n.name){case"POSITION":e.position.metadata=n.metadata;break;case"feature-index":e.id.metadata=n.metadata}}}(o,t);const p=function(e){var t,r;return null==e||null===(t=e.metadata)||void 0===t||null===(r=t["i3s-feature-ids"])||void 0===r?void 0:r.intArray}(u);p&&function(e,t){const r=e.id.value,n=new Float32Array(r.length);for(let e=0;e<r.length;e++)n[e]=t[r[e]];e.id.value=n}(o,p)}else{const{vertexAttributes:t,ordering:n,featureAttributes:i,featureAttributeOrder:a}=r.store.defaultGeometrySchema,c=function(e,t){let r=0,n=0,i=0;for(const{property:a,type:o}of e.store.defaultGeometrySchema.header){const e=Gp(o);switch(a){case Lp.vertexCount:n=new e(t,0,4)[0],r+=Wp(o);break;case Lp.featureCount:i=new e(t,4,4)[0],r+=Wp(o)}}return{vertexCount:n,featureCount:i,byteOffset:r}}(r,e);u=c.byteOffset,s=c.vertexCount,l=c.featureCount;const{attributes:h,byteOffset:p}=Xp(e,u,t,s,n),{attributes:f}=Xp(e,p,i,l,a);!function(e){const{id:t,faceRange:r}=e;if(!t||!r)return;const n=t.value,i=r.value,a=i[i.length-1]+1,o=new Uint32Array(3*a);let s=0,c=0;for(let e=1;e<i.length;e+=2){const t=Number(n[s]),r=i[e],a=i[e-1],u=c+3*(r-a+1);o.fill(t,c,u),s++,c=u}e.id.value=o}(f),o=function(e,t){return{...e,...t}}(h,f)}if(null!=n&&null!==(i=n.i3s)&&void 0!==i&&i.coordinateSystem&&n.i3s.coordinateSystem!==Kp.METER_OFFSETS)a.modelMatrix=function(e){var t,r;const n=e.metadata,i=(null==n||null===(t=n["i3s-scale_x"])||void 0===t?void 0:t.double)||1,a=(null==n||null===(r=n["i3s-scale_y"])||void 0===r?void 0:r.double)||1,o=new _r;return o[0]=i,o[5]=a,o}(o.position),a.coordinateSystem=Kp.LNGLAT_OFFSETS;else{const e=function(e,t){const r=t.mbs,n=e.value,i=e.metadata,a=new _r,o=new Ar(r[0],r[1],r[2]),s=new Ar;return Zr.WGS84.cartographicToCartesian(o,s),Zr.WGS84.eastNorthUpToFixedFrame(s,a),e.value=function(e,t={},r){const n=new Float64Array(e.length),i=t["i3s-scale_x"]&&t["i3s-scale_x"].double||1,a=t["i3s-scale_y"]&&t["i3s-scale_y"].double||1;for(let t=0;t<n.length;t+=3)n[t]=e[t]*i+r.x,n[t+1]=e[t+1]*a+r.y,n[t+2]=e[t+2]+r.z;for(let e=0;e<n.length;e+=3)Zr.WGS84.cartographicToCartesian(n.subarray(e,e+3),Jp),n[e]=Jp.x,n[e+1]=Jp.y,n[e+2]=Jp.z;return n}(n,i,o),a}(o.position,t);a.modelMatrix=e.invert(),a.coordinateSystem=Kp.METER_OFFSETS}a.attributes={positions:o.position,normals:o.normal,colors:Yp(o.color),texCoords:o.uv0,uvRegions:Yp(o.uvRegion)},a.indices=c||null,o.id&&o.id.value&&(t.content.featureIds=o.id.value);for(const e in a.attributes)a.attributes[e]||delete a.attributes[e];return a.vertexCount=s,a.byteLength=e.byteLength,t}(e,t,r,n)}function Yp(e){return e?(e.normalized=!0,e):e}function Xp(e,t,r,n,i){const a={};for(const o of i)if(r[o]){const{valueType:i,valuesPerElement:s}=r[o],c=n;if(t+c*s>e.byteLength)break;const u=e.slice(t);let l;if("UInt64"===i)l=Zp(u,c*s,Wp(i));else{l=new(Gp(i))(u,0,c*s)}switch(a[o]={value:l,type:Vp[i],size:s},o){case"color":a.color.normalized=!0}t+=c*s*Wp(i)}return{attributes:a,byteOffset:t}}function Zp(e,t,r){const n=[],i=new DataView(e);let a=0;for(let e=0;e<t;e++){const e=i.getUint32(a,!0)+2**32*i.getUint32(a+4,!0);n.push(e),a+=r}return new Uint32Array(n)}function $p(e){const t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}const ef={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:"3.1.8",mimeTypes:["application/octet-stream"],parse:async function(e,t,r){const{tile:n,tileset:i}=(null==t?void 0:t.i3s)||{};return await Qp(e,n,i,t,r),n.content},extensions:["bin"],options:{"i3s-content":{}}};async function tf(e){return JSON.parse((new TextDecoder).decode(e))}const rf={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:"3.1.8",mimeTypes:["application/json"],parse:async function(e){return e=tf(e)},extensions:["json"],options:{}};class nf{constructor(e,t){var r,n;Object(p.a)(this,"tileset",void 0),Object(p.a)(this,"nodePages",[]),Object(p.a)(this,"pendingNodePages",[]),Object(p.a)(this,"nodesPerPage",void 0),Object(p.a)(this,"options",void 0),Object(p.a)(this,"lodSelectionMetricType",void 0),Object(p.a)(this,"textureDefinitionsSelectedFormats",[]),Object(p.a)(this,"textureLoaderOptions",{}),this.tileset={...e},this.nodesPerPage=(null===(r=e.nodePages)||void 0===r?void 0:r.nodesPerPage)||64,this.lodSelectionMetricType=null===(n=e.nodePages)||void 0===n?void 0:n.lodSelectionMetricType,this.options=t,this.initSelectedFormatsForTextureDefinitions(e)}async getNodeById(e){const t=Math.floor(e/this.nodesPerPage);if(!this.nodePages[t]&&!this.pendingNodePages[t]){var r;const e=Np("".concat(this.tileset.url,"/nodepages/").concat(t),null===(r=this.options.i3s)||void 0===r?void 0:r.token);this.pendingNodePages[t]={status:"Pending",promise:St(e,rf,this.options)},this.nodePages[t]=await this.pendingNodePages[t].promise,this.pendingNodePages[t].status="Done"}"Pending"===this.pendingNodePages[t].status&&(this.nodePages[t]=await this.pendingNodePages[t].promise);const n=e%this.nodesPerPage;return this.nodePages[t].nodes[n]}async formTileFromNodePages(e){const t=await this.getNodeById(e),r=[];for(const e of t.children||[]){const t=await this.getNodeById(e);r.push({id:e.toString(),obb:t.obb})}let n,i,a,o="jpg",s=[],c=!1;if(t&&t.mesh){const{url:e,isDracoGeometry:r}=t.mesh.geometry&&this.getContentUrl(t.mesh.geometry)||{isDracoGeometry:!1};n=e,c=r;const{textureData:u,materialDefinition:l}=this.getInformationFromMaterial(t.mesh.material);a=l,o=u.format||o,u.name&&(i="".concat(this.tileset.url,"/nodes/").concat(t.mesh.material.resource,"/textures/").concat(u.name)),this.tileset.attributeStorageInfo&&(s=function(e,t){const r=[],{attributeStorageInfo:n,url:i}=e;for(let e=0;e<n.length;e++){const a=n[e].key;r.push("".concat(i,"/nodes/").concat(t,"/attributes/").concat(a,"/0"))}return r}(this.tileset,t.mesh.attribute.resource))}const u=this.getLodSelection(t);return af({id:e.toString(),lodSelection:u,obb:t.obb,contentUrl:n,textureUrl:i,attributeUrls:s,materialDefinition:a,textureFormat:o,textureLoaderOptions:this.textureLoaderOptions,children:r,isDracoGeometry:c})}getContentUrl(e){let t=null;const r=this.tileset.geometryDefinitions[e.definition];let n=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(n=r.geometryBuffers.findIndex(e=>e.compressedAttributes&&"draco"===e.compressedAttributes.encoding)),-1===n&&(n=r.geometryBuffers.findIndex(e=>!e.compressedAttributes)),-1!==n){const i=Boolean(r.geometryBuffers[n].compressedAttributes);t={url:"".concat(this.tileset.url,"/nodes/").concat(e.resource,"/geometries/").concat(n),isDracoGeometry:i}}return t}getLodSelection(e){const t=[];return"maxScreenThresholdSQ"===this.lodSelectionMetricType&&t.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(e.lodThreshold/(.25*Math.PI))}),t.push({metricType:this.lodSelectionMetricType,maxError:e.lodThreshold}),t}getInformationFromMaterial(e){const t={textureData:{name:null}};if(e){var r;const a=null===(r=this.tileset.materialDefinitions)||void 0===r?void 0:r[e.definition];if(a){var n,i;t.materialDefinition=a;const e=null==a||null===(n=a.pbrMetallicRoughness)||void 0===n||null===(i=n.baseColorTexture)||void 0===i?void 0:i.textureSetDefinitionId;"number"==typeof e&&(t.textureData=this.textureDefinitionsSelectedFormats[e]||t.textureData)}}return t}initSelectedFormatsForTextureDefinitions(e){this.textureDefinitionsSelectedFormats=[];const t=this.getSupportedTextureFormats(),r=e.textureSetDefinitions||[];for(const e of r){const r=e&&e.formats||[];let n=null;for(const e of t){const t=r.find(t=>t.format===e);if(t){n=t;break}}n&&"ktx2"===n.format&&(this.textureLoaderOptions.basis={format:Us(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(n)}}getSupportedTextureFormats(){const e=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){const t=fs();t.has("etc2")&&e.push("ktx-etc2"),t.has("dxt")&&e.push("dds"),e.push("ktx2")}return e.push("jpg"),e.push("png"),e}}function af(e){var t,r;const n={};let i=[0,0,0,1];if(e.mbs)i=e.mbs,n.sphere=[...Zr.WGS84.cartographicToCartesian(e.mbs.slice(0,3)),e.mbs[3]];else if(e.obb){n.box=[...Zr.WGS84.cartographicToCartesian(e.obb.center),...e.obb.halfSize,...e.obb.quaternion];const t=(new oi).fromCenterHalfSizeQuaternion(n.box.slice(0,3),e.obb.halfSize,e.obb.quaternion).getBoundingSphere();n.sphere=[...t.center,t.radius],i=[...e.obb.center,t.radius]}const a=null===(t=e.lodSelection)||void 0===t?void 0:t[0].metricType,o=null===(r=e.lodSelection)||void 0===r?void 0:r[0].maxError,s=e.transform,c=aa,u=ta;return{...e,mbs:i,boundingVolume:n,lodMetricType:a,lodMetricValue:o,transformMatrix:s,type:c,refine:u}}const of=/layers\/[0-9]+$/,sf=/nodes\/([0-9-]+|root)$/,cf={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:"3.1.8",mimeTypes:["application/octet-stream"],parse:async function(e,t,r){const n=r.url;t.i3s=t.i3s||{};if("504b0304"===function(e){if(e instanceof ArrayBuffer)return[...new Uint8Array(e,0,4)].map(e=>e.toString(16).padStart(2,"0")).join("");return null}(e))throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let i,a;i="auto"===t.i3s.isTileset?of.test(n):t.i3s.isTileset;a="auto"===t.isTileHeader?sf.test(n):t.i3s.isTileHeader;i?e=await async function(e,t,r){const n=JSON.parse((new TextDecoder).decode(e));return n.loader=cf,await async function(e,t,r){if(e.url=r.url,e.nodePages)e.nodePagesTile=new nf(e,t),e.root=await e.nodePagesTile.formTileFromNodePages(0);else{var n;const r=Np("".concat(e.url,"/nodes/root"),null===(n=t.i3s)||void 0===n?void 0:n.token);e.root=await St(r,e.loader,{...t,i3s:{...t.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}e.basePath=e.url,e.type=oa,e.lodMetricType=e.root.lodMetricType,e.lodMetricValue=e.root.lodMetricValue}(n,t,r),n}(e,t,r):a?(e=await async function(e,t,r){return function(e,t,r){const n=r.url||"";let i,a,o;return e.geometryData&&(i="".concat(n,"/").concat(e.geometryData[0].href)),e.textureData&&(a="".concat(n,"/").concat(e.textureData[0].href)),e.attributeData&&(o=function(e,t){const{attributeData:r=[]}=t,n=[];for(let t=0;t<r.length;t++){const i=r[t].href.replace("./","");n.push("".concat(e,"/").concat(i))}return n}(n,e)),af({...e,url:n,contentUrl:i,textureUrl:a,attributeUrls:o,isDracoGeometry:!1})}(e=JSON.parse((new TextDecoder).decode(e)),0,r)}(e,0,r),t.i3s.loadContent&&(t.i3s.tile=e,await St(e.contentUrl,cf,t))):e=await async function(e,t){return await At(e,ef,t)}(e,t);return e},extensions:["bin"],options:{i3s:{loadContent:!0,token:null,isTileset:"auto",isTileHeader:"auto",tile:null,tileset:null,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,coordinateSystem:Kp.METER_OFFSETS}}};async function uf(e,t){const{attributeName:r,attributeType:n}=t;return r?{[r]:n?lf(n,e):null}:{}}function lf(e,t){switch(e){case"String":return function(e){const t=[];try{const r=new DataView(e,0,4).getUint32(0,!0),n=new Uint32Array(e,8,r);let i=8+4*r;for(const r of n){const n=new TextDecoder("utf-8"),a=new Uint8Array(e,i,r);t.push(n.decode(a)),i+=r}}catch(e){console.error("Parse string attribute error: ",e.message)}return t}(t);case"Oid32":return hf(t);case"Float64":return function(e){return new Float64Array(e,8)}(t);case"Int16":return function(e){return new Int16Array(e,4)}(t);default:return hf(t)}}function hf(e){return new Uint32Array(e,4)}const pf={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:"3.1.8",mimeTypes:["application/binary"],parse:async function(e,t){return e=uf(e,t)},extensions:["bin"],options:{},binary:!0};function ff(e,t){const r=[e.center[0],e.center[1],e.center[2]+t.getHeight(e.center[1],e.center[0])],n=Zr.WGS84.cartographicToCartesian(r,new Ar),i=(new oi).fromCenterHalfSizeQuaternion(n,e.halfSize,e.quaternion);return[...i.center,...i.halfAxes.toArray()]}const df=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(e=>ml()(e,df()))}});function mf(e,t,r,n){const i=dc(r.byteLength,n),a=i-r.byteLength;if(e){const n=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),i=new Uint8Array(r);n.set(i);for(let n=0;n<a;++n)e.setUint8(t+r.byteLength+n,32)}return t+=i}function gf(e,t,r,n){return t=mf(e,t,(new TextEncoder).encode(r),n)}const bf=1179937895;function yf(e,t,r,n){return function(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}(e),function(e,t,r=0,n={}){const{magic:i=bf,version:a=2,json:o={},binary:s}=e,c=r;t&&(t.setUint32(r+0,i,!0),t.setUint32(r+4,a,!0),t.setUint32(r+8,0,!0));const u=r+8,l=r+=12;if(t&&(t.setUint32(r+0,0,!0),t.setUint32(r+4,1313821514,!0)),r=gf(t,r+=8,JSON.stringify(o),4),t){const e=r-l-8;t.setUint32(l+0,e,!0)}if(s){const e=r;if(t&&(t.setUint32(r+0,0,!0),t.setUint32(r+4,5130562,!0)),r=mf(t,r+=8,s,4),t){const n=r-e-8;t.setUint32(e+0,n,!0)}}if(t){const e=r-c;t.setUint32(u,e,!0)}return r}(e,t,r,n)}const vf={name:"glTF",id:"gltf",module:"gltf",version:"3.1.8",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,encodeSync:function(e,t={}){const{byteOffset:r=0}=t,n=yf(e,null,r,t),i=new ArrayBuffer(n),a=new DataView(i);return yf(e,a,r,t),i},options:{gltf:{}}};function wf(e,t,r){if(!t)return r+12;const{magic:n,version:i=1,byteLength:a=12}=e;return k(Array.isArray(n)&&Number.isFinite(i)&&Number.isFinite(a)),t.setUint8(r+0,n[0]),t.setUint8(r+1,n[1]),t.setUint8(r+2,n[2]),t.setUint8(r+3,n[3]),t.setUint32(r+4,i,!0),t.setUint32(r+8,a,!0),r+=12}function _f(e,t,r){e&&e.setUint32(t+8,r,!0)}function kf(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r.charCodeAt(i));return t+n}function xf(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r[i]);return t+n}const Ef={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function Af(e,t,r,n){const{featureTableJson:i=Ef}=e;let a=JSON.stringify(i);a=function(e,t){const r=e.length,n=Math.ceil(r/t)*t-r;let i="";for(let e=0;e<n;++e)i+=" ";return e+i}(a,4);const{featureTableJsonByteLength:o=a.length}=e,s=new ArrayBuffer(12),c=s.byteLength,u=r;return r+=wf(e={magic:Ra.POINT_CLOUD,...e},t,0),t&&(t.setUint32(r+0,o,!0),t.setUint32(r+4,c,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=kf(t,r,a,o),_f(t,u,(r+=xf(t,r,s,c))-u),r}function Sf(e,t,r,n){switch(k("string"==typeof e.type),e.type){case Oa.COMPOSITE:return function(e,t,r,n,i){const a=r;r+=wf(e={magic:Ra.COMPOSITE,tiles:[],...e},t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let a=0;a<e.tiles.length;++a)r+=i(e.tiles[a],t,r,n);return _f(t,a,r-a),r}(e,t,r,n,Sf);case Oa.POINT_CLOUD:return Af(e,t,r);case Oa.BATCHED_3D_MODEL:return function(e,t,r,n){const{featuresLength:i=0,batchTable:a}=e,o={BATCH_LENGTH:i},s=JSON.stringify(o),c=a?JSON.stringify(a):"",u=dc(s.length,8),l=c?dc(c.length,8):0,h=r;r=wf(e={magic:Ra.BATCHED_MODEL,...e},t,r),t&&(t.setUint32(12,u,!0),t.setUint32(16,0,!0),t.setUint32(20,l,!0),t.setUint32(24,0,!0)),r=gf(t,r+=16,s,8),a&&(r=gf(t,r,c,8));const p=e.gltfEncoded;return p&&(r=xf(t,r,p,p.byteLength)),_f(t,h,r-h),r}(e,t,r);case Oa.INSTANCED_3D_MODEL:return function(e,t,r,n){const{featuresLength:i=1,gltfFormat:a=1,gltfUri:o=""}=e,s=o.length,c={INSTANCES_LENGTH:i,POSITION:new Array(3*i).fill(0)},u=JSON.stringify(c),l=u.length,h=r;return r=wf(e={magic:Ra.INSTANCED_MODEL,...e},t,0),t&&(t.setUint32(12,l,!0),t.setUint32(16,0,!0),t.setUint32(20,0,!0),t.setUint32(24,0,!0),t.setUint32(28,a,!0)),r+=20,r+=kf(t,r,u,l),_f(t,h,(r+=kf(t,r,o,s))-h),r}(e,t,r);default:throw new Error("3D Tiles: unknown tile type")}}const jf={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:"3.1.8",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:function(e,t){return function(e,t){const r=Sf(e,null,0,t),n=new ArrayBuffer(r);return Sf(e,new DataView(n),0,t),n}(e,t)},binary:!0,options:{"3d-tiles":{}}};function Tf(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}const Cf=new _r([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),Bf=new Ar;class Of{constructor(){Object(p.a)(this,"rtcCenter",void 0),Object(p.a)(this,"i3sTile",void 0)}async convert(e,t=null){this.i3sTile=e;const r=await this.buildGltf(e);return Tt({gltfEncoded:new Uint8Array(r),type:"b3dm",featuresLength:this._getFeaturesLength(t),batchTable:t},jf)}async buildGltf(e){const{material:t,attributes:r,indices:n,cartesianOrigin:i,cartographicOrigin:a,modelMatrix:o}=e.content,s=new Sc,c=await this._addI3sTextureToGltf(e,s),u=this._convertI3sMaterialToGltfMaterial(t,c),l=s.addMaterial(u),h=r.positions,p=h.value;r.uvRegions&&r.texCoords&&(r.texCoords.value=function(e,t){const r=new Float32Array(e.length),n=function(e){const t=[];for(let r=0;r<e.length;r++)t[r]=e[r]/65535;return t}(t);for(let t=0;t<e.length;t+=2){const i=e.subarray(t,t+2),a=n.slice(2*t,2*t+4),o=Tf([i[0],i[1]]),s=[a[2]-a[0],a[3]-a[1]],c=[o[0]*s[0],o[1]*s[1]],u=[c[0]+a[0],c[1]+a[1]];r[t]=u[0],r[t+1]=u[1]}return r}(r.texCoords.value,r.uvRegions.value)),r.positions.value=this._normalizePositions(p,i,a,o),r.normals&&!this._checkNormals(r.normals.value)&&delete r.normals;const f=n||this._generateSynteticIndices(p.length/h.size),d=s.addMesh({attributes:r,indices:f,material:l}),m=this._generateTransformMatrix(i),g=s.addNode({meshIndex:d,matrix:m}),b=s.addScene({nodeIndices:[g]});s.setDefaultScene(b),s.createBinaryChunk();return Tt(s.gltf,vf)}async _addI3sTextureToGltf(e,t){const{content:{texture:r,material:n,attributes:i},header:{textureFormat:a}}=e;let o=null,s=r;if(!r&&n&&(s=n.pbrMetallicRoughness&&n.pbrMetallicRoughness.baseColorTexture&&n.pbrMetallicRoughness.baseColorTexture.texture.source.image),s){const e=this._deduceMimeTypeFromFormat(a),r=await jt(s,Xh),n=t.addImage(r,e);o=t.addTexture({imageIndex:n}),delete i.colors}return o}_normalizePositions(e,t,r,n){const i=new Float32Array(e.length);for(let a=0;a<e.length;a+=3){const o=e.subarray(a,a+3),s=new Ar(t);let c=new Ar(Array.from(o)).transform(n).add(r);Zr.WGS84.cartographicToCartesian(c,Bf),c=Bf.subtract(s),i.set(c,a)}return i}_generateTransformMatrix(e){return(new _r).translate(e).multiplyLeft(Cf)}_generateBatchId(e){const t=3*(e[e.length-1]+1),r=new Float32Array(t);let n=0,i=0;for(let t=0;t<e.length/2;t++){const t=3*e[n],a=3*(e[n+1]+1);r.fill(i,t,a),n+=2,i+=1}return r}_generateSynteticIndices(e){const t=new Uint32Array(e);for(let r=0;r<e;r++)t.set([r],r);return t}_deduceMimeTypeFromFormat(e){switch(e){case"jpg":return"image/jpeg";case"png":return"image/png";default:return console.warn("Unexpected texture format in I3S: ".concat(e)),"image/jpeg"}}_convertI3sMaterialToGltfMaterial(e,t){return e?(null!==t&&(e=this._setGltfTexture(e,t)),e):(e={alphaMode:"OPAQUE",doubleSided:!1,pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:1}},null!==t?e.pbrMetallicRoughness.baseColorTexture={index:t,texCoord:0}:e.pbrMetallicRoughness.baseColorFactor=[1,1,1,1],e)}_setGltfTexture(e,t){const r={...e,pbrMetallicRoughness:{...e.pbrMetallicRoughness}};return e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?r.pbrMetallicRoughness.baseColorTexture={index:t,texCoord:0}:e.emissiveTexture?r.emissiveTexture={index:t,texCoord:0}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?r.pbrMetallicRoughness.metallicRoughnessTexture={index:t,texCoord:0}:e.normalTexture?r.normalTexture={index:t,texCoord:0}:e.occlusionTexture&&(r.occlusionTexture={index:t,texCoord:0}),r}_getFeaturesLength(e){if(!e)return 0;const t=Object.keys(e)[0];return t?e[t].length:0}_checkNormals(e){return e.find(e=>e)}}class Rf{constructor(){Object(p.a)(this,"options",void 0),Object(p.a)(this,"tilesetPath",void 0),Object(p.a)(this,"vertexCounter",void 0),Object(p.a)(this,"conversionStartTime",void 0),Object(p.a)(this,"geoidHeightModel",void 0),Object(p.a)(this,"sourceTileset",void 0),Object(p.a)(this,"attributeStorageInfo",void 0),this.options={},this.tilesetPath="",this.vertexCounter=0,this.conversionStartTime=[0,0],this.geoidHeightModel=null,this.sourceTileset=null,this.attributeStorageInfo=null}async convert(e){const{inputUrl:t,outputPath:r,tilesetName:n,maxDepth:i,egmFilePath:a}=e;this.conversionStartTime=fl.a.hrtime(),this.options={maxDepth:i},console.log("Loading egm file..."),this.geoidHeightModel=await St(a,Oh),console.log("Loading egm file completed!");const o=await St(t,cf,{});this.sourceTileset=new Ba(o,{loadOptions:{i3s:{coordinateSystem:Kp.LNGLAT_OFFSETS}}});const s=this.sourceTileset.root;s.header.obb||(s.header.obb=Xl(s.header.mbs)),this.tilesetPath=Object(tl.join)("".concat(r),"".concat(n)),this.attributeStorageInfo=o.attributeStorageInfo;try{await Dl(this.tilesetPath)}catch(e){}const c={boundingVolume:{box:ff(s.header.obb,this.geoidHeightModel)},geometricError:xh(s),children:[]};await this._addChildren(s,c,1);const u=ml()({root:c},{asset:{path:"asset",transform:e=>ml()(e,{version:{path:"version",default:"1.0"}})},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>ml()(e,df())}});await Il(this.tilesetPath,JSON.stringify(u),"tileset.json"),this._finishConversion({slpk:!1,outputPath:r,tilesetName:n})}async _addChildren(e,t,r){if(!(this.options.maxDepth&&r>this.options.maxDepth))for(const n of e.header.children||[]){const i=await this._loadChildNode(e,n);if(e.children.push(i),i.contentUrl){await this.sourceTileset._loadTile(i),this.vertexCounter+=i.content.vertexCount;let e=null;this.attributeStorageInfo&&(e=await this._loadChildAttributes(i,this.attributeStorageInfo)),i.header.obb||(i.header.obb=Xl(i.header.mbs));const n={box:ff(i.header.obb,this.geoidHeightModel)},a={boundingVolume:n,geometricError:xh(i),children:[]},o=await(new Of).convert(i,e);a.content={uri:"".concat(i.id,".b3dm"),boundingVolume:n},await Il(this.tilesetPath,new Uint8Array(o),"".concat(i.id,".b3dm")),t.children.push(a),i.unloadContent(),await this._addChildren(i,a,r+1)}else await this._addChildren(i,t,r+1)}}async _loadChildNode(e,t){let r;if(this.sourceTileset.tileset.nodePages)console.log("Node conversion: ".concat(t.id)),r=await this.sourceTileset.tileset.nodePagesTile.formTileFromNodePages(t.id);else{const{loader:n}=this.sourceTileset,i=this._relativeUrlToFullUrl(e.url,t.href),a={i3s:{...this.sourceTileset.loadOptions,isTileHeader:!0,loadContent:!1}};console.log("Node conversion: ".concat(i)),r=await St(i,n,a)}return new ka(this.sourceTileset,r,e)}_relativeUrlToFullUrl(e,t){let r=e.split("/");const n=t.split("/");for(const e of n)switch(e){case".":continue;case"..":r=r.slice(0,-1);break;default:r.push(e)}return r.join("/")}async _loadChildAttributes(e,t){const r=[],{attributeUrls:n}=e.header;for(let e=0;e<n.length;e++){const i=n[e],a=t[e],o={attributeName:a.name,attributeType:this._getAttributeType(a)};r.push(St(i,pf,o))}const i=await Promise.all(r);return this._replaceNestedArrays(i),Object.assign({},...i)}_getAttributeType(e){return e.attributeValues?e.attributeValues.valueType:e.objectIds?"Oid32":""}_replaceNestedArrays(e){for(let t=0;t<e.length;t++){const r=e[t];for(const e in r)r[e]=Array.from(r[e])}}async _finishConversion(e){const t=await Nl(e),r=Ll(fl.a.hrtime(this.conversionStartTime));console.log("------------------------------------------------"),console.log("Finish conversion of ".concat("I3S")),console.log("Total conversion time: ".concat(r)),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",t," bytes"),console.log("------------------------------------------------")}}const If={id:"zip",module:"zip",name:"Zip Archive",version:"3.1.8",extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:async function(e,t={}){const r=[],n={};try{const i=new Al.a;return(await i.loadAsync(e,t)).forEach((e,a)=>{const o=a.name,s=async function(e,t,r={}){try{return await e.file(t).async(r.dataType||"arraybuffer")}catch(e){return r.log.error("Unable to read ".concat(t," from zip archive: ").concat(e)),e}}(i,o,t).then(t=>{n[e]=t});r.push(s)}),await Promise.all(r),n}catch(e){throw t.log.error("Unable to read zip archive: ".concat(e)),e}}};class Pf{async install(e=""){console.log('Installing "EGM2008-5" model...');const t=await St("https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",If,{});let r=process.cwd();e&&(r=Object(tl.join)(r,e)),await Il(r,new Uint8Array(t["geoids/egm2008-5.pgm"]),"egm2008-5.pgm"),console.log("All dependencies were installed succesfully.")}}},function(e,t,r){"use strict";r.r(t);var n=r(2),i=r(115);const a="object"!=typeof process||"[object process]"!==String(process)||process.browser,o={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global},s=o.global||o.self||o.window;function c(e,t,r){return t<=e&&e<=r}global["encoding-indexes"]={ibm866:[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160],"iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729],"iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729],"iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119],"iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null],"iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312],"iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217],"iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255],"iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255],"koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],"koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],macintosh:[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711],"windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null],"windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],"windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255],"windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746],"windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729],"windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255],"x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364]}||{};var u=Math.floor;function l(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function h(e){return 0<=e&&e<=127}var p=h;function f(e){this.tokens=[].slice.call(e),this.tokens.reverse()}f.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():-1},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.shift());else this.tokens.unshift(e)}};function d(e,t){if(e)throw TypeError("Decoder error");return t||65533}function m(e){throw TypeError("The code point "+e+" could not be encoded.")}function g(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(y,e)?y[e]:null}var b=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],y={};b.forEach((function(e){e.encodings.forEach((function(e){e.labels.forEach((function(t){y[t]=e}))}))}));var v,w,_={},k={};function x(e,t){return t&&t[e]||null}function E(e,t){var r=t.indexOf(e);return-1===r?null:r}function A(e){if(!("encoding-indexes"in global))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return global["encoding-indexes"][e]}function S(e,t){if(!(this instanceof S))throw TypeError("Called as a function. Did you forget 'new'?");e=void 0!==e?String(e):"utf-8",t=l(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=g(e);if(null===r||"replacement"===r.name)throw RangeError("Unknown encoding: "+e);if(!k[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");return this._encoding=r,Boolean(t.fatal)&&(this._error_mode="fatal"),Boolean(t.ignoreBOM)&&(this._ignoreBOM=!0),Object.defineProperty||(this.encoding=this._encoding.name.toLowerCase(),this.fatal="fatal"===this._error_mode,this.ignoreBOM=this._ignoreBOM),this}function j(e,t){if(!(this instanceof j))throw TypeError("Called as a function. Did you forget 'new'?");t=l(t),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(t.fatal)?"fatal":"replacement";if(Boolean(t.NONSTANDARD_allowLegacyEncoding)){var r=g(e=void 0!==e?String(e):"utf-8");if(null===r||"replacement"===r.name)throw RangeError("Unknown encoding: "+e);if(!_[r.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");this._encoding=r}else this._encoding=g("utf-8"),void 0!==e&&"console"in global&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=this._encoding.name.toLowerCase()),this}function T(e){var t=e.fatal,r=0,n=0,i=0,a=128,o=191;this.handler=function(e,s){if(-1===s&&0!==i)return i=0,d(t);if(-1===s)return-1;if(0===i){if(c(s,0,127))return s;if(c(s,194,223))i=1,r=31&s;else if(c(s,224,239))224===s&&(a=160),237===s&&(o=159),i=2,r=15&s;else{if(!c(s,240,244))return d(t);240===s&&(a=144),244===s&&(o=143),i=3,r=7&s}return null}if(!c(s,a,o))return r=i=n=0,a=128,o=191,e.prepend(s),d(t);if(a=128,o=191,r=r<<6|63&s,(n+=1)!==i)return null;var u=r;return r=i=n=0,u}}function C(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(p(t))return t;var r,n;c(t,128,2047)?(r=1,n=192):c(t,2048,65535)?(r=2,n=224):c(t,65536,1114111)&&(r=3,n=240);for(var i=[(t>>6*r)+n];r>0;){var a=t>>6*(r-1);i.push(128|63&a),r-=1}return i}}function B(e,t){var r=t.fatal;this.handler=function(t,n){if(-1===n)return-1;if(h(n))return n;var i=e[n-128];return null===i?d(r):i}}function O(e,t){t.fatal;this.handler=function(t,r){if(-1===r)return-1;if(p(r))return r;var n=E(r,e);return null===n&&m(r),n+128}}function R(e){var t=e.fatal,r=0,n=0,i=0;this.handler=function(e,a){if(-1===a&&0===r&&0===n&&0===i)return-1;var o;if(-1!==a||0===r&&0===n&&0===i||(r=0,n=0,i=0,d(t)),0!==i){o=null,c(a,48,57)&&(o=function(e){if(e>39419&&e<189e3||e>1237575)return null;if(7457===e)return 59335;var t,r=0,n=0,i=A("gb18030-ranges");for(t=0;t<i.length;++t){var a=i[t];if(!(a[0]<=e))break;r=a[0],n=a[1]}return n+e-r}(10*(126*(10*(r-129)+n-48)+i-129)+a-48));var s=[n,i,a];return r=0,n=0,i=0,null===o?(e.prepend(s),d(t)):o}if(0!==n)return c(a,129,254)?(i=a,null):(e.prepend([n,a]),r=0,n=0,d(t));if(0!==r){if(c(a,48,57))return n=a,null;var u=r,l=null;r=0;var p=a<127?64:65;return(c(a,64,126)||c(a,128,254))&&(l=190*(u-129)+(a-p)),null===(o=null===l?null:x(l,A("gb18030")))&&h(a)&&e.prepend(a),null===o?d(t):o}return h(a)?a:128===a?8364:c(a,129,254)?(r=a,null):d(t)}}function I(e,t){e.fatal;this.handler=function(e,r){if(-1===r)return-1;if(p(r))return r;if(58853===r)return m(r);if(t&&8364===r)return 128;var n=E(r,A("gb18030"));if(null!==n){var i=n%190;return[u(n/190)+129,i+(i<63?64:65)]}if(t)return m(r);n=function(e){if(59335===e)return 7457;var t,r=0,n=0,i=A("gb18030-ranges");for(t=0;t<i.length;++t){var a=i[t];if(!(a[1]<=e))break;r=a[1],n=a[0]}return n+e-r}(r);var a=u(n/10/126/10),o=u((n-=10*a*126*10)/10/126),s=u((n-=10*o*126)/10);return[a+129,o+48,s+129,n-10*s+48]}}function P(e){var t=e.fatal,r=0;this.handler=function(e,n){if(-1===n&&0!==r)return r=0,d(t);if(-1===n&&0===r)return-1;if(0!==r){var i=r,a=null;r=0;var o=n<127?64:98;switch((c(n,64,126)||c(n,161,254))&&(a=157*(i-129)+(n-o)),a){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var s=null===a?null:x(a,A("big5"));return null===s&&h(n)&&e.prepend(n),null===s?d(t):s}return h(n)?n:c(n,129,254)?(r=n,null):d(t)}}function D(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(p(t))return t;var r=function(e){var t=w=w||A("big5").map((function(e,t){return t<5024?null:e}));return 9552===e||9566===e||9569===e||9578===e||21313===e||21317===e?t.lastIndexOf(e):E(e,t)}(t);if(null===r)return m(t);var n=u(r/157)+129;if(n<161)return m(t);var i=r%157;return[n,i+(i<63?64:98)]}}function M(e){var t=e.fatal,r=!1,n=0;this.handler=function(e,i){if(-1===i&&0!==n)return n=0,d(t);if(-1===i&&0===n)return-1;if(142===n&&c(i,161,223))return n=0,65216+i;if(143===n&&c(i,161,254))return r=!0,n=i,null;if(0!==n){var a=n;n=0;var o=null;return c(a,161,254)&&c(i,161,254)&&(o=x(94*(a-161)+(i-161),A(r?"jis0212":"jis0208"))),r=!1,c(i,161,254)||e.prepend(i),null===o?d(t):o}return h(i)?i:142===i||143===i||c(i,161,254)?(n=i,null):d(t)}}function F(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(p(t))return t;if(165===t)return 92;if(8254===t)return 126;if(c(t,65377,65439))return[142,t-65377+161];8722===t&&(t=65293);var r=E(t,A("jis0208"));return null===r?m(t):[u(r/94)+161,r%94+161]}}function L(e){var t=e.fatal,r=0,n=1,i=2,a=3,o=4,s=5,u=6,l=r,h=r,p=0,f=!1;this.handler=function(e,m){switch(l){default:case r:return 27===m?(l=s,null):c(m,0,127)&&14!==m&&15!==m&&27!==m?(f=!1,m):-1===m?-1:(f=!1,d(t));case n:return 27===m?(l=s,null):92===m?(f=!1,165):126===m?(f=!1,8254):c(m,0,127)&&14!==m&&15!==m&&27!==m&&92!==m&&126!==m?(f=!1,m):-1===m?-1:(f=!1,d(t));case i:return 27===m?(l=s,null):c(m,33,95)?(f=!1,65344+m):-1===m?-1:(f=!1,d(t));case a:return 27===m?(l=s,null):c(m,33,126)?(f=!1,p=m,l=o,null):-1===m?-1:(f=!1,d(t));case o:if(27===m)return l=s,d(t);if(c(m,33,126)){l=a;var g=x(94*(p-33)+m-33,A("jis0208"));return null===g?d(t):g}return-1===m?(l=a,e.prepend(m),d(t)):(l=a,d(t));case s:return 36===m||40===m?(p=m,l=u,null):(e.prepend(m),f=!1,l=h,d(t));case u:var b=p;p=0;var y=null;if(40===b&&66===m&&(y=r),40===b&&74===m&&(y=n),40===b&&73===m&&(y=i),36!==b||64!==m&&66!==m||(y=a),null!==y){l=l=y;var v=f;return f=!0,v?d(t):null}return e.prepend([b,m]),f=!1,l=h,d(t)}}}function N(e){e.fatal;var t=0,r=1,n=2,i=t;this.handler=function(e,a){if(-1===a&&i!==t)return e.prepend(a),i=t,[27,40,66];if(-1===a&&i===t)return-1;if(!(i!==t&&i!==r||14!==a&&15!==a&&27!==a))return m(65533);if(i===t&&p(a))return a;if(i===r&&(p(a)&&92!==a&&126!==a||165==a||8254==a)){if(p(a))return a;if(165===a)return 92;if(8254===a)return 126}if(p(a)&&i!==t)return e.prepend(a),i=t,[27,40,66];if((165===a||8254===a)&&i!==r)return e.prepend(a),i=r,[27,40,74];8722===a&&(a=65293);var o=E(a,A("jis0208"));return null===o?m(a):i!==n?(e.prepend(a),i=n,[27,36,66]):[u(o/94)+33,o%94+33]}}function z(e){var t=e.fatal,r=0;this.handler=function(e,n){if(-1===n&&0!==r)return r=0,d(t);if(-1===n&&0===r)return-1;if(0!==r){var i=r,a=null;r=0;var o=n<127?64:65,s=i<160?129:193;if((c(n,64,126)||c(n,128,252))&&(a=188*(i-s)+n-o),c(a,8836,10715))return 48508+a;var u=null===a?null:x(a,A("jis0208"));return null===u&&h(n)&&e.prepend(n),null===u?d(t):u}return h(n)||128===n?n:c(n,161,223)?65216+n:c(n,129,159)||c(n,224,252)?(r=n,null):d(t)}}function U(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(p(t)||128===t)return t;if(165===t)return 92;if(8254===t)return 126;if(c(t,65377,65439))return t-65377+161;8722===t&&(t=65293);var r=function(e){return(v=v||A("jis0208").map((function(e,t){return c(t,8272,8835)?null:e}))).indexOf(e)}(t);if(null===r)return m(t);var n=u(r/188),i=r%188;return[n+(n<31?129:193),i+(i<63?64:65)]}}function q(e){var t=e.fatal,r=0;this.handler=function(e,n){if(-1===n&&0!==r)return r=0,d(t);if(-1===n&&0===r)return-1;if(0!==r){var i=r,a=null;r=0,c(n,65,254)&&(a=190*(i-129)+(n-65));var o=null===a?null:x(a,A("euc-kr"));return null===a&&h(n)&&e.prepend(n),null===o?d(t):o}return h(n)?n:c(n,129,254)?(r=n,null):d(t)}}function H(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(p(t))return t;var r=E(t,A("euc-kr"));return null===r?m(t):[u(r/190)+129,r%190+65]}}function G(e,t){var r=e>>8,n=255&e;return t?[r,n]:[n,r]}function V(e,t){var r=t.fatal,n=null,i=null;this.handler=function(t,a){if(-1===a&&(null!==n||null!==i))return d(r);if(-1===a&&null===n&&null===i)return-1;if(null===n)return n=a,null;var o;if(o=e?(n<<8)+a:(a<<8)+n,n=null,null!==i){var s=i;return i=null,c(o,56320,57343)?65536+1024*(s-55296)+(o-56320):(t.prepend(G(o,e)),d(r))}return c(o,55296,56319)?(i=o,null):c(o,56320,57343)?d(r):o}}function W(e,t){t.fatal;this.handler=function(t,r){if(-1===r)return-1;if(c(r,0,65535))return G(r,e);var n=G(55296+(r-65536>>10),e),i=G(56320+(r-65536&1023),e);return n.concat(i)}}function K(e){e.fatal;this.handler=function(e,t){return-1===t?-1:h(t)?t:63360+t-128}}function J(e){e.fatal;this.handler=function(e,t){return-1===t?-1:p(t)?t:c(t,63360,63487)?t-63360+128:m(t)}}Object.defineProperty&&(Object.defineProperty(S.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(S.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(S.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),S.prototype.decode=function(e,t){var r;r="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=l(t),this._do_not_flush||(this._decoder=k[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(t.stream);for(var n,i=new f(r),a=[];;){var o=i.read();if(-1===o)break;if(-1===(n=this._decoder.handler(i,o)))break;null!==n&&(Array.isArray(n)?a.push.apply(a,n):a.push(n))}if(!this._do_not_flush){do{if(-1===(n=this._decoder.handler(i,i.read())))break;null!==n&&(Array.isArray(n)?a.push.apply(a,n):a.push(n))}while(!i.endOfStream());this._decoder=null}return function(e){var t,r;return t=["UTF-8","UTF-16LE","UTF-16BE"],r=this._encoding.name,-1===t.indexOf(r)||this._ignoreBOM||this._BOMseen||(e.length>0&&65279===e[0]?(this._BOMseen=!0,e.shift()):e.length>0&&(this._BOMseen=!0)),function(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode(55296+(n>>10),56320+(1023&n)))}return t}(e)}.call(this,a)},Object.defineProperty&&Object.defineProperty(j.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),j.prototype.encode=function(e,t){e=void 0===e?"":String(e),t=l(t),this._do_not_flush||(this._encoder=_[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(t.stream);for(var r,n=new f(function(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var a=t.charCodeAt(n);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319)if(n===r-1)i.push(65533);else{var o=t.charCodeAt(n+1);if(56320<=o&&o<=57343){var s=1023&a,c=1023&o;i.push(65536+(s<<10)+c),n+=1}else i.push(65533)}n+=1}return i}(e)),i=[];;){var a=n.read();if(-1===a)break;if(-1===(r=this._encoder.handler(n,a)))break;Array.isArray(r)?i.push.apply(i,r):i.push(r)}if(!this._do_not_flush){for(;-1!==(r=this._encoder.handler(n,n.read()));)Array.isArray(r)?i.push.apply(i,r):i.push(r);this._encoder=null}return new Uint8Array(i)},_["UTF-8"]=function(e){return new C(e)},k["UTF-8"]=function(e){return new T(e)},"encoding-indexes"in global&&b.forEach((function(e){"Legacy single-byte encodings"===e.heading&&e.encodings.forEach((function(e){var t=e.name,r=A(t.toLowerCase());k[t]=function(e){return new B(r,e)},_[t]=function(e){return new O(r,e)}}))})),k.GBK=function(e){return new R(e)},_.GBK=function(e){return new I(e,!0)},_.gb18030=function(e){return new I(e)},k.gb18030=function(e){return new R(e)},_.Big5=function(e){return new D(e)},k.Big5=function(e){return new P(e)},_["EUC-JP"]=function(e){return new F(e)},k["EUC-JP"]=function(e){return new M(e)},_["ISO-2022-JP"]=function(e){return new N(e)},k["ISO-2022-JP"]=function(e){return new L(e)},_.Shift_JIS=function(e){return new U(e)},k.Shift_JIS=function(e){return new z(e)},_["EUC-KR"]=function(e){return new H(e)},k["EUC-KR"]=function(e){return new q(e)},_["UTF-16BE"]=function(e){return new W(!0,e)},k["UTF-16BE"]=function(e){return new V(!0,e)},_["UTF-16LE"]=function(e){return new W(!1,e)},k["UTF-16LE"]=function(e){return new V(!1,e)},_["x-user-defined"]=function(e){return new J(e)},k["x-user-defined"]=function(e){return new K(e)};function Q(e){return Buffer.from(e).toString("base64")}function Y(e){return Buffer.from(e,"base64").toString("ascii")}var X=r(0);let Z;Z=Symbol.iterator;class ${constructor(e){Object(X.a)(this,"map",void 0),this.map={},e instanceof $?e.forEach((e,t)=>this.append(t,e)):Array.isArray(e)?e.forEach(e=>this.append(e[0],e[1])):e&&Object.getOwnPropertyNames(e).forEach(t=>this.append(t,e[t]))}append(e,t){e=ee(e),t=te(t);const r=this.map[e];this.map[e]=r?"".concat(r,", ").concat(t):t}delete(e){delete this.map[ee(e)]}get(e){return e=ee(e),this.has(e)?this.map[e]:null}has(e){return this.map.hasOwnProperty(ee(e))}set(e,t){this.map[ee(e)]=te(t)}forEach(e,t=null){for(const r in this.map)this.map.hasOwnProperty(r)&&(t?e.call(t,this.map[r],r,this):e(this.map[r],r,this))}keys(){const e=[];return this.forEach((function(t,r){e.push(r)})),re(e)}values(){const e=[];return this.forEach((function(t){e.push(t)})),re(e)}entries(){const e=[];return this.forEach((function(t,r){e.push([r,t])})),re(e)}*[Z](){yield*this.entries()}}function ee(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function te(e){return"string"!=typeof e&&(e=String(e)),e}function re(e){const t={next(){const t=e.shift();return{done:void 0===t,value:t}}};return t[Symbol.iterator]=function(){return t},t}function ne(e,t){if(!e)throw new Error("@loaders.gl/polyfills assertion ".concat(t))}var ie=r(3),ae=r.n(ie),oe=r(39),se=r.n(oe),ce=r(50),ue=r.n(ce),le=r(15),he=r.n(le);function pe(e){if((t=e)&&t instanceof ArrayBuffer)return e;var t;if((e=>e&&e instanceof Buffer)(e)){return new Uint8Array(e).buffer}if(ArrayBuffer.isView(e))return e.buffer;if("string"==typeof e){const t=e;return(new TextEncoder).encode(t).buffer}if(e&&"object"==typeof e&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer(".concat(JSON.stringify(e,null,2).slice(10),")"))}async function fe(e,t){if(!function(e){return e.startsWith("http:")||e.startsWith("https:")}(e)){const t=e.split("?")[0];return await new Promise((e,r)=>{const n=ae.a.createReadStream(t,{encoding:null});n.once("readable",()=>e(n)),n.on("error",e=>r(e))})}return await new Promise((r,n)=>{const i=(e.startsWith("https:")?ue.a.request:se.a.request)(function(e,t){const r=(null==t?void 0:t.headers)||{},n={};for(const e of Object.keys(r))n[e.toLowerCase()]=r[e];n["accept-encoding"]=n["accept-encoding"]||"gzip,br,deflate";const i=new URL(e);return{hostname:i.hostname,path:i.pathname,method:"GET",...t,...null==t?void 0:t.fetch,headers:n}}(e,t),e=>r(e));i.on("error",e=>n(e)),i.end()})}async function de(e){const t=[];return await new Promise((r,n)=>{e.on("error",e=>n(e)),e.on("readable",()=>e.read()),e.on("data",e=>{"string"==typeof e&&n(new Error("Read stream not binary")),t.push(pe(e))}),e.on("end",()=>{const e=function(e){const t=e.map(e=>e instanceof ArrayBuffer?new Uint8Array(e):e),r=t.reduce((e,t)=>e+t.byteLength,0),n=new Uint8Array(r);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n.buffer}(t);r(e)})})}var me=r(5);const ge=e=>"function"==typeof e,be=e=>(e=>null!==e&&"object"==typeof e)(e)&&ge(e.read)&&ge(e.pipe)&&(e=>"boolean"==typeof e)(e.readable);class ye{constructor(e,t){Object(X.a)(this,"ok",void 0),Object(X.a)(this,"status",void 0),Object(X.a)(this,"statusText",void 0),Object(X.a)(this,"headers",void 0),Object(X.a)(this,"url",void 0),Object(X.a)(this,"bodyUsed",!1),Object(X.a)(this,"_body",void 0);const{headers:r,status:n=200,statusText:i="OK",url:a}=t||{};this.url=a,this.ok=200===n,this.status=n,this.statusText=i,this.headers=new $((null==t?void 0:t.headers)||{}),be(e)?this._body=function(e,t){switch(t.get("content-encoding")){case"br":return e.pipe(he.a.createBrotliDecompress());case"gzip":return e.pipe(he.a.createGunzip());case"deflate":return e.pipe(he.a.createDeflate());default:return e}}(e,r):this._body="string"==typeof e?me.Readable.from([(new TextEncoder).encode(e)]):me.Readable.from([e||new ArrayBuffer(0)])}get body(){return ne(!this.bodyUsed),ne(be(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){if(!be(this._body))return this._body||new ArrayBuffer(0);return await de(this._body)}async text(){const e=await this.arrayBuffer();return(new TextDecoder).decode(e)}async json(){const e=await this.text();return JSON.parse(e)}async blob(){if("undefined"==typeof Blob)throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}}const ve=e=>e.startsWith("data:");async function we(e,t){try{if(ve(e)){const{arrayBuffer:t,mimeType:r}=function(e){const t=e.indexOf(",");let r,n;return";base64"===e.slice(t-7,t)?(r=Buffer.from(e.slice(t+1),"base64"),n=e.slice(5,t-7).trim()):(r=Buffer.from(decodeURIComponent(e.slice(t+1))),n=e.slice(5,t).trim()),n?n.startsWith(";")&&(n="text/plain".concat(n)):n="text/plain;charset=US-ASCII",{arrayBuffer:pe(r),mimeType:n}}(e);return new ye(t,{headers:{"content-type":r},url:e})}const r={},n=e;e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip");const i=await fe(n,t),a=function(e,t,r={}){const n={};if(t&&t.headers){const e=t.headers;for(const t in e){const r=e[t];n[t.toLowerCase()]=String(r)}}if(!n["content-length"]){const t=function(e){if((e=>e.startsWith("http:")||e.startsWith("https:"))(e))return null;if(ve(e))return e.length-"data:".length;try{const t=e.split("?")[0];return ae.a.statSync(t).size}catch(e){}return null}(e);Number.isFinite(t)&&(n["content-length"]=t)}return Object.assign(n,r),new $(n)}(e,i,r),{status:o,statusText:s}=function(e){if(e.statusCode)return{status:e.statusCode,statusText:e.statusMessage||"NA"};return{status:200,statusText:"OK"}}(i),c=!t||t.followRedirect||void 0===t.followRedirect;if(o>=300&&o<400&&a.has("location")&&c){const r=function(e,t){if(t.startsWith("http"))return t;const r=new URL(e);return r.pathname=t,r.href}(e,a.get("location"));return await we(r,t)}return new ye(i,{headers:a,status:o,statusText:s,url:e})}catch(t){return new ye(null,{status:400,statusText:String(t),url:e})}}var _e=r(258),ke=r.n(_e),xe=r(64),Ee=r.n(xe);function Ae(e,t){const r=function(e,t){const r=t.type?t.type.replace("image/",""):"jpeg",n=Ee()(e.data,[e.width,e.height,4],[4,4*e.width,1],0);return ke()(n,r,t)}(e,t);return new Promise(e=>{const t=[];r.on("data",e=>t.push(e)),r.on("end",()=>{const r=Buffer.concat(t);e(function(e){if(Buffer.isBuffer(e)){return new Uint8Array(e).buffer}return e}(r))})})}var Se=r(259),je=r.n(Se),Te=r(1),Ce=r.n(Te);async function Be(e,t){ne(t,"MIMEType is required to parse image under Node.js");const r=Ce.a.promisify(je.a),n=e instanceof Buffer?e:Buffer.from(e),i=await r(n,t),a=[...i.shape],o=4===i.shape.length?i.shape.shift():1;return{shape:a,data:i.data,width:i.shape[0],height:i.shape[1],components:i.shape[2],layers:o}}var Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(e){return"Symbol("+e+")"};function Re(){}var Ie="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;function Pe(e){return"object"==typeof e&&null!==e||"function"==typeof e}var De=Re,Me=Promise,Fe=Promise.prototype.then,Le=Promise.resolve.bind(Me),Ne=Promise.reject.bind(Me);function ze(e){return new Me(e)}function Ue(e){return Le(e)}function qe(e){return Ne(e)}function He(e,t,r){return Fe.call(e,t,r)}function Ge(e,t,r){He(He(e,t,r),void 0,De)}function Ve(e,t){Ge(e,t)}function We(e,t){Ge(e,void 0,t)}function Ke(e,t,r){return He(e,t,r)}function Je(e){He(e,void 0,De)}var Qe=function(){var e=Ie&&Ie.queueMicrotask;if("function"==typeof e)return e;var t=Ue(void 0);return function(e){return He(t,e)}}();function Ye(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function Xe(e,t,r){try{return Ue(Ye(e,t,r))}catch(e){return qe(e)}}var Ze=function(){function e(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.push=function(e){var t=this._back,r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size},e.prototype.shift=function(){var e=this._front,t=e,r=this._cursor,n=r+1,i=e._elements,a=i[r];return 16384===n&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),i[r]=void 0,a},e.prototype.forEach=function(e){for(var t=this._cursor,r=this._front,n=r._elements;!(t===n.length&&void 0===r._next||t===n.length&&(t=0,0===(n=(r=r._next)._elements).length));)e(n[t]),++t},e.prototype.peek=function(){var e=this._front,t=this._cursor;return e._elements[t]},e}();function $e(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?nt(e):"closed"===t._state?function(e){nt(e),ot(e)}(e):it(e,t._storedError)}function et(e,t){return zn(e._ownerReadableStream,t)}function tt(e){"readable"===e._ownerReadableStream._state?at(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,t){it(e,t)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function rt(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function nt(e){e._closedPromise=ze((function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function it(e,t){nt(e),at(e,t)}function at(e,t){void 0!==e._closedPromise_reject&&(Je(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function ot(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var st=Oe("[[AbortSteps]]"),ct=Oe("[[ErrorSteps]]"),ut=Oe("[[CancelSteps]]"),lt=Oe("[[PullSteps]]"),ht=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},pt=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function ft(e,t){if(void 0!==e&&("object"!=typeof(r=e)&&"function"!=typeof r))throw new TypeError(t+" is not an object.");var r}function dt(e,t){if("function"!=typeof e)throw new TypeError(t+" is not a function.")}function mt(e,t){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError(t+" is not an object.")}function gt(e,t,r){if(void 0===e)throw new TypeError("Parameter "+t+" is required in '"+r+"'.")}function bt(e,t,r){if(void 0===e)throw new TypeError(t+" is required in '"+r+"'.")}function yt(e){return Number(e)}function vt(e){return 0===e?0:e}function wt(e,t){var r=Number.MAX_SAFE_INTEGER,n=Number(e);if(n=vt(n),!ht(n))throw new TypeError(t+" is not a finite number");if((n=function(e){return vt(pt(e))}(n))<0||n>r)throw new TypeError(t+" is outside the accepted range of 0 to "+r+", inclusive");return ht(n)&&0!==n?n:0}function _t(e,t){if(!Ln(e))throw new TypeError(t+" is not a ReadableStream.")}function kt(e){return new Ct(e)}function xt(e,t){e._reader._readRequests.push(t)}function Et(e,t,r){var n=e._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(t)}function At(e){return e._reader._readRequests.length}function St(e){var t=e._reader;return void 0!==t&&!!Bt(t)}var jt,Tt,Ct=function(){function e(e){if(gt(e,1,"ReadableStreamDefaultReader"),_t(e,"First parameter"),Nn(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");$e(this,e),this._readRequests=new Ze}return Object.defineProperty(e.prototype,"closed",{get:function(){return Bt(this)?this._closedPromise:qe(Rt("closed"))},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return void 0===e&&(e=void 0),Bt(this)?void 0===this._ownerReadableStream?qe(rt("cancel")):et(this,e):qe(Rt("cancel"))},e.prototype.read=function(){if(!Bt(this))return qe(Rt("read"));if(void 0===this._ownerReadableStream)return qe(rt("read from"));var e,t,r=ze((function(r,n){e=r,t=n}));return Ot(this,{_chunkSteps:function(t){return e({value:t,done:!1})},_closeSteps:function(){return e({value:void 0,done:!0})},_errorSteps:function(e){return t(e)}}),r},e.prototype.releaseLock=function(){if(!Bt(this))throw Rt("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");tt(this)}},e}();function Bt(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function Ot(e,t){var r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[lt](t)}function Rt(e){return new TypeError("ReadableStreamDefaultReader.prototype."+e+" can only be used on a ReadableStreamDefaultReader")}Object.defineProperties(Ct.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Ct.prototype,Oe.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof Oe.asyncIterator&&((jt={})[Oe.asyncIterator]=function(){return this},Tt=jt,Object.defineProperty(Tt,Oe.asyncIterator,{enumerable:!1}));var It=function(){function e(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}return e.prototype.next=function(){var e=this,t=function(){return e._nextSteps()};return this._ongoingPromise=this._ongoingPromise?Ke(this._ongoingPromise,t,t):t(),this._ongoingPromise},e.prototype.return=function(e){var t=this,r=function(){return t._returnSteps(e)};return this._ongoingPromise?Ke(this._ongoingPromise,r,r):r()},e.prototype._nextSteps=function(){var e=this;if(this._isFinished)return Promise.resolve({value:void 0,done:!0});var t,r,n=this._reader;if(void 0===n._ownerReadableStream)return qe(rt("iterate"));var i=ze((function(e,n){t=e,r=n}));return Ot(n,{_chunkSteps:function(r){e._ongoingPromise=void 0,Qe((function(){return t({value:r,done:!1})}))},_closeSteps:function(){e._ongoingPromise=void 0,e._isFinished=!0,tt(n),t({value:void 0,done:!0})},_errorSteps:function(t){e._ongoingPromise=void 0,e._isFinished=!0,tt(n),r(t)}}),i},e.prototype._returnSteps=function(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;var t=this._reader;if(void 0===t._ownerReadableStream)return qe(rt("finish iterating"));if(!this._preventCancel){var r=et(t,e);return tt(t),Ke(r,(function(){return{value:e,done:!0}}))}return tt(t),Ue({value:e,done:!0})},e}(),Pt={next:function(){return Dt(this)?this._asyncIteratorImpl.next():qe(Mt("next"))},return:function(e){return Dt(this)?this._asyncIteratorImpl.return(e):qe(Mt("return"))}};function Dt(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl")}function Mt(e){return new TypeError("ReadableStreamAsyncIterator."+e+" can only be used on a ReadableSteamAsyncIterator")}void 0!==Tt&&Object.setPrototypeOf(Pt,Tt);var Ft=Number.isNaN||function(e){return e!=e};function Lt(e){return!!function(e){if("number"!=typeof e)return!1;if(Ft(e))return!1;if(e<0)return!1;return!0}(e)&&e!==1/0}function Nt(e){var t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function zt(e,t,r){if(!Lt(r=Number(r)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function Ut(e){e._queue=new Ze,e._queueTotalSize=0}function qt(e){return e.slice()}var Ht=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"view",{get:function(){if(!Wt(this))throw cr("view");return this._view},enumerable:!1,configurable:!0}),e.prototype.respond=function(e){if(!Wt(this))throw cr("respond");if(gt(e,1,"respond"),e=wt(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(e,t){if(!Lt(t=Number(t)))throw new RangeError("bytesWritten must be a finite");rr(e,t)}(this._associatedReadableByteStreamController,e)},e.prototype.respondWithNewView=function(e){if(!Wt(this))throw cr("respondWithNewView");if(gt(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");!function(e,t){var r=e._pendingPullIntos.peek();if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==t.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=t.buffer,rr(e,t.byteLength)}(this._associatedReadableByteStreamController,e)},e}();Object.defineProperties(Ht.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Ht.prototype,Oe.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var Gt=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"byobRequest",{get:function(){if(!Vt(this))throw ur("byobRequest");if(null===this._byobRequest&&this._pendingPullIntos.length>0){var e=this._pendingPullIntos.peek(),t=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),r=Object.create(Ht.prototype);!function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}(r,this,t),this._byobRequest=r}return this._byobRequest},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!Vt(this))throw ur("desiredSize");return or(this)},enumerable:!1,configurable:!0}),e.prototype.close=function(){if(!Vt(this))throw ur("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError("The stream (in "+e+" state) is not in the readable state and cannot be closed");!function(e){var t=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==t._state)return;if(e._queueTotalSize>0)return void(e._closeRequested=!0);if(e._pendingPullIntos.length>0){if(e._pendingPullIntos.peek().bytesFilled>0){var r=new TypeError("Insufficient bytes to fill elements in the given buffer");throw ar(e,r),r}}ir(e),Un(t)}(this)},e.prototype.enqueue=function(e){if(!Vt(this))throw ur("enqueue");if(gt(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");var t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError("The stream (in "+t+" state) is not in the readable state and cannot be enqueued to");!function(e,t){var r=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==r._state)return;var n=t.buffer,i=t.byteOffset,a=t.byteLength,o=n;if(St(r))if(0===At(r))Yt(e,o,i,a);else{var s=new Uint8Array(o,i,a);Et(r,s,!1)}else pr(r)?(Yt(e,o,i,a),tr(e)):Yt(e,o,i,a);Kt(e)}(this,e)},e.prototype.error=function(e){if(void 0===e&&(e=void 0),!Vt(this))throw ur("error");ar(this,e)},e.prototype[ut]=function(e){this._pendingPullIntos.length>0&&(this._pendingPullIntos.peek().bytesFilled=0);Ut(this);var t=this._cancelAlgorithm(e);return ir(this),t},e.prototype[lt]=function(e){var t=this._controlledReadableByteStream;if(this._queueTotalSize>0){var r=this._queue.shift();this._queueTotalSize-=r.byteLength,$t(this);var n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);e._chunkSteps(n)}else{var i=this._autoAllocateChunkSize;if(void 0!==i){var a=void 0;try{a=new ArrayBuffer(i)}catch(t){return void e._errorSteps(t)}var o={buffer:a,byteOffset:0,byteLength:i,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(o)}xt(t,e),Kt(this)}},e}();function Vt(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function Wt(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function Kt(e){(function(e){var t=e._controlledReadableByteStream;if("readable"!==t._state)return!1;if(e._closeRequested)return!1;if(!e._started)return!1;if(St(t)&&At(t)>0)return!0;if(pr(t)&&hr(t)>0)return!0;if(or(e)>0)return!0;return!1})(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Ge(e._pullAlgorithm(),(function(){e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Kt(e))}),(function(t){ar(e,t)}))))}function Jt(e,t){var r=!1;"closed"===e._state&&(r=!0);var n=Qt(t);"default"===t.readerType?Et(e,n,r):function(e,t,r){var n=e._reader._readIntoRequests.shift();r?n._closeSteps(t):n._chunkSteps(t)}(e,n,r)}function Qt(e){var t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function Yt(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function Xt(e,t){var r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,i=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),a=t.bytesFilled+i,o=a-a%r,s=i,c=!1;o>n&&(s=o-t.bytesFilled,c=!0);for(var u,l,h,p,f,d=e._queue;s>0;){var m=d.peek(),g=Math.min(s,m.byteLength),b=t.byteOffset+t.bytesFilled;u=t.buffer,l=b,h=m.buffer,p=m.byteOffset,f=g,new Uint8Array(u).set(new Uint8Array(h,p,f),l),m.byteLength===g?d.shift():(m.byteOffset+=g,m.byteLength-=g),e._queueTotalSize-=g,Zt(e,g,t),s-=g}return c}function Zt(e,t,r){er(e),r.bytesFilled+=t}function $t(e){0===e._queueTotalSize&&e._closeRequested?(ir(e),Un(e._controlledReadableByteStream)):Kt(e)}function er(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function tr(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;var t=e._pendingPullIntos.peek();Xt(e,t)&&(nr(e),Jt(e._controlledReadableByteStream,t))}}function rr(e,t){var r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(e,t){t.buffer=t.buffer;var r=e._controlledReadableByteStream;if(pr(r))for(;hr(r)>0;){Jt(r,nr(e))}}(e,r)}else!function(e,t,r){if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range");if(Zt(e,t,r),!(r.bytesFilled<r.elementSize)){nr(e);var n=r.bytesFilled%r.elementSize;if(n>0){var i=r.byteOffset+r.bytesFilled,a=r.buffer.slice(i-n,i);Yt(e,a,0,a.byteLength)}r.buffer=r.buffer,r.bytesFilled-=n,Jt(e._controlledReadableByteStream,r),tr(e)}}(e,t,r);Kt(e)}function nr(e){var t=e._pendingPullIntos.shift();return er(e),t}function ir(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function ar(e,t){var r=e._controlledReadableByteStream;"readable"===r._state&&(!function(e){er(e),e._pendingPullIntos=new Ze}(e),Ut(e),ir(e),qn(r,t))}function or(e){var t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function sr(e,t,r){var n=Object.create(Gt.prototype),i=function(){},a=function(){return Ue(void 0)},o=function(){return Ue(void 0)};void 0!==t.start&&(i=function(){return t.start(n)}),void 0!==t.pull&&(a=function(){return t.pull(n)}),void 0!==t.cancel&&(o=function(e){return t.cancel(e)});var s=t.autoAllocateChunkSize;if(0===s)throw new TypeError("autoAllocateChunkSize must be greater than 0");!function(e,t,r,n,i,a,o){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,Ut(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=i,t._autoAllocateChunkSize=o,t._pendingPullIntos=new Ze,e._readableStreamController=t,Ge(Ue(r()),(function(){t._started=!0,Kt(t)}),(function(e){ar(t,e)}))}(e,n,i,a,o,r,s)}function cr(e){return new TypeError("ReadableStreamBYOBRequest.prototype."+e+" can only be used on a ReadableStreamBYOBRequest")}function ur(e){return new TypeError("ReadableByteStreamController.prototype."+e+" can only be used on a ReadableByteStreamController")}function lr(e,t){e._reader._readIntoRequests.push(t)}function hr(e){return e._reader._readIntoRequests.length}function pr(e){var t=e._reader;return void 0!==t&&!!dr(t)}Object.defineProperties(Gt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Gt.prototype,Oe.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var fr=function(){function e(e){if(gt(e,1,"ReadableStreamBYOBReader"),_t(e,"First parameter"),Nn(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Vt(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");$e(this,e),this._readIntoRequests=new Ze}return Object.defineProperty(e.prototype,"closed",{get:function(){return dr(this)?this._closedPromise:qe(mr("closed"))},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return void 0===e&&(e=void 0),dr(this)?void 0===this._ownerReadableStream?qe(rt("cancel")):et(this,e):qe(mr("cancel"))},e.prototype.read=function(e){if(!dr(this))return qe(mr("read"));if(!ArrayBuffer.isView(e))return qe(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return qe(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return qe(new TypeError("view's buffer must have non-zero byteLength"));if(void 0===this._ownerReadableStream)return qe(rt("read from"));var t,r,n=ze((function(e,n){t=e,r=n}));return function(e,t,r){var n=e._ownerReadableStream;n._disturbed=!0,"errored"===n._state?r._errorSteps(n._storedError):function(e,t,r){var n=e._controlledReadableByteStream,i=1;t.constructor!==DataView&&(i=t.constructor.BYTES_PER_ELEMENT);var a=t.constructor,o={buffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:i,viewConstructor:a,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(o),void lr(n,r);if("closed"!==n._state){if(e._queueTotalSize>0){if(Xt(e,o)){var s=Qt(o);return $t(e),void r._chunkSteps(s)}if(e._closeRequested){var c=new TypeError("Insufficient bytes to fill elements in the given buffer");return ar(e,c),void r._errorSteps(c)}}e._pendingPullIntos.push(o),lr(n,r),Kt(e)}else{var u=new a(o.buffer,o.byteOffset,0);r._closeSteps(u)}}(n._readableStreamController,t,r)}(this,e,{_chunkSteps:function(e){return t({value:e,done:!1})},_closeSteps:function(e){return t({value:e,done:!0})},_errorSteps:function(e){return r(e)}}),n},e.prototype.releaseLock=function(){if(!dr(this))throw mr("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");tt(this)}},e}();function dr(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function mr(e){return new TypeError("ReadableStreamBYOBReader.prototype."+e+" can only be used on a ReadableStreamBYOBReader")}function gr(e,t){var r=e.highWaterMark;if(void 0===r)return t;if(Ft(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function br(e){var t=e.size;return t||function(){return 1}}function yr(e,t){ft(e,t);var r=null==e?void 0:e.highWaterMark,n=null==e?void 0:e.size;return{highWaterMark:void 0===r?void 0:yt(r),size:void 0===n?void 0:vr(n,t+" has member 'size' that")}}function vr(e,t){return dt(e,t),function(t){return yt(e(t))}}function wr(e,t,r){return dt(e,r),function(r){return Xe(e,t,[r])}}function _r(e,t,r){return dt(e,r),function(){return Xe(e,t,[])}}function kr(e,t,r){return dt(e,r),function(r){return Ye(e,t,[r])}}function xr(e,t,r){return dt(e,r),function(r,n){return Xe(e,t,[r,n])}}function Er(e,t){if(!Tr(e))throw new TypeError(t+" is not a WritableStream.")}Object.defineProperties(fr.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(fr.prototype,Oe.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var Ar=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),void 0===e?e=null:mt(e,"First parameter");var r=yr(t,"Second parameter"),n=function(e,t){ft(e,t);var r=null==e?void 0:e.abort,n=null==e?void 0:e.close,i=null==e?void 0:e.start,a=null==e?void 0:e.type,o=null==e?void 0:e.write;return{abort:void 0===r?void 0:wr(r,e,t+" has member 'abort' that"),close:void 0===n?void 0:_r(n,e,t+" has member 'close' that"),start:void 0===i?void 0:kr(i,e,t+" has member 'start' that"),write:void 0===o?void 0:xr(o,e,t+" has member 'write' that"),type:a}}(e,"First parameter");if(jr(this),void 0!==n.type)throw new RangeError("Invalid type is specified");var i=br(r);!function(e,t,r,n){var i=Object.create(Wr.prototype),a=function(){},o=function(){return Ue(void 0)},s=function(){return Ue(void 0)},c=function(){return Ue(void 0)};void 0!==t.start&&(a=function(){return t.start(i)});void 0!==t.write&&(o=function(e){return t.write(e,i)});void 0!==t.close&&(s=function(){return t.close()});void 0!==t.abort&&(c=function(e){return t.abort(e)});Kr(e,i,a,o,s,c,r,n)}(this,n,gr(r,1),i)}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!Tr(this))throw en("locked");return Cr(this)},enumerable:!1,configurable:!0}),e.prototype.abort=function(e){return void 0===e&&(e=void 0),Tr(this)?Cr(this)?qe(new TypeError("Cannot abort a stream that already has a writer")):Br(this,e):qe(en("abort"))},e.prototype.close=function(){return Tr(this)?Cr(this)?qe(new TypeError("Cannot close a stream that already has a writer")):Dr(this)?qe(new TypeError("Cannot close an already-closing stream")):Or(this):qe(en("close"))},e.prototype.getWriter=function(){if(!Tr(this))throw en("getWriter");return Sr(this)},e}();function Sr(e){return new Lr(e)}function jr(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new Ze,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function Tr(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function Cr(e){return void 0!==e._writer}function Br(e,t){var r=e._state;if("closed"===r||"errored"===r)return Ue(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;var n=!1;"erroring"===r&&(n=!0,t=void 0);var i=ze((function(r,i){e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:i,_reason:t,_wasAlreadyErroring:n}}));return e._pendingAbortRequest._promise=i,n||Ir(e,t),i}function Or(e){var t=e._state;if("closed"===t||"errored"===t)return qe(new TypeError("The stream (in "+t+" state) is not in the writable state and cannot be closed"));var r,n=ze((function(t,r){var n={_resolve:t,_reject:r};e._closeRequest=n})),i=e._writer;return void 0!==i&&e._backpressure&&"writable"===t&&pn(i),zt(r=e._writableStreamController,Vr,0),Yr(r),n}function Rr(e,t){"writable"!==e._state?Pr(e):Ir(e,t)}function Ir(e,t){var r=e._writableStreamController;e._state="erroring",e._storedError=t;var n=e._writer;void 0!==n&&qr(n,t),!function(e){if(void 0===e._inFlightWriteRequest&&void 0===e._inFlightCloseRequest)return!1;return!0}(e)&&r._started&&Pr(e)}function Pr(e){e._state="errored",e._writableStreamController[ct]();var t=e._storedError;if(e._writeRequests.forEach((function(e){e._reject(t)})),e._writeRequests=new Ze,void 0!==e._pendingAbortRequest){var r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void Mr(e);Ge(e._writableStreamController[st](r._reason),(function(){r._resolve(),Mr(e)}),(function(t){r._reject(t),Mr(e)}))}else Mr(e)}function Dr(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function Mr(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var t=e._writer;void 0!==t&&on(t,e._storedError)}function Fr(e,t){var r=e._writer;void 0!==r&&t!==e._backpressure&&(t?function(e){cn(e)}(r):pn(r)),e._backpressure=t}Object.defineProperties(Ar.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Ar.prototype,Oe.toStringTag,{value:"WritableStream",configurable:!0});var Lr=function(){function e(e){if(gt(e,1,"WritableStreamDefaultWriter"),Er(e,"First parameter"),Cr(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;var t,r=e._state;if("writable"===r)!Dr(e)&&e._backpressure?cn(this):ln(this),nn(this);else if("erroring"===r)un(this,e._storedError),nn(this);else if("closed"===r)ln(this),nn(t=this),sn(t);else{var n=e._storedError;un(this,n),an(this,n)}}return Object.defineProperty(e.prototype,"closed",{get:function(){return Nr(this)?this._closedPromise:qe(tn("closed"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!Nr(this))throw tn("desiredSize");if(void 0===this._ownerWritableStream)throw rn("desiredSize");return function(e){var t=e._ownerWritableStream,r=t._state;if("errored"===r||"erroring"===r)return null;if("closed"===r)return 0;return Qr(t._writableStreamController)}(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return Nr(this)?this._readyPromise:qe(tn("ready"))},enumerable:!1,configurable:!0}),e.prototype.abort=function(e){return void 0===e&&(e=void 0),Nr(this)?void 0===this._ownerWritableStream?qe(rn("abort")):function(e,t){return Br(e._ownerWritableStream,t)}(this,e):qe(tn("abort"))},e.prototype.close=function(){if(!Nr(this))return qe(tn("close"));var e=this._ownerWritableStream;return void 0===e?qe(rn("close")):Dr(e)?qe(new TypeError("Cannot close an already-closing stream")):zr(this)},e.prototype.releaseLock=function(){if(!Nr(this))throw tn("releaseLock");void 0!==this._ownerWritableStream&&Hr(this)},e.prototype.write=function(e){return void 0===e&&(e=void 0),Nr(this)?void 0===this._ownerWritableStream?qe(rn("write to")):Gr(this,e):qe(tn("write"))},e}();function Nr(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function zr(e){return Or(e._ownerWritableStream)}function Ur(e,t){"pending"===e._closedPromiseState?on(e,t):function(e,t){an(e,t)}(e,t)}function qr(e,t){"pending"===e._readyPromiseState?hn(e,t):function(e,t){un(e,t)}(e,t)}function Hr(e){var t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");qr(e,r),Ur(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function Gr(e,t){var r=e._ownerWritableStream,n=r._writableStreamController,i=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return Xr(e,t),1}}(n,t);if(r!==e._ownerWritableStream)return qe(rn("write to"));var a=r._state;if("errored"===a)return qe(r._storedError);if(Dr(r)||"closed"===a)return qe(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===a)return qe(r._storedError);var o=function(e){return ze((function(t,r){var n={_resolve:t,_reject:r};e._writeRequests.push(n)}))}(r);return function(e,t,r){try{zt(e,t,r)}catch(t){return void Xr(e,t)}var n=e._controlledWritableStream;if(!Dr(n)&&"writable"===n._state){var i=Zr(e);Fr(n,i)}Yr(e)}(n,t,i),o}Object.defineProperties(Lr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Lr.prototype,Oe.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var Vr={},Wr=function(){function e(){throw new TypeError("Illegal constructor")}return e.prototype.error=function(e){if(void 0===e&&(e=void 0),!function(e){if(!Pe(e))return!1;if(!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream"))return!1;return!0}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&$r(this,e)},e.prototype[st]=function(e){var t=this._abortAlgorithm(e);return Jr(this),t},e.prototype[ct]=function(){Ut(this)},e}();function Kr(e,t,r,n,i,a,o,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,Ut(t),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=o,t._writeAlgorithm=n,t._closeAlgorithm=i,t._abortAlgorithm=a;var c=Zr(t);Fr(e,c),Ge(Ue(r()),(function(){t._started=!0,Yr(t)}),(function(r){t._started=!0,Rr(e,r)}))}function Jr(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Qr(e){return e._strategyHWM-e._queueTotalSize}function Yr(e){var t=e._controlledWritableStream;if(e._started&&void 0===t._inFlightWriteRequest)if("erroring"!==t._state){if(0!==e._queue.length){var r=e._queue.peek().value;r===Vr?function(e){var t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),Nt(e);var r=e._closeAlgorithm();Jr(e),Ge(r,(function(){!function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";var t=e._writer;void 0!==t&&sn(t)}(t)}),(function(e){!function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),Rr(e,t)}(t,e)}))}(e):function(e,t){var r=e._controlledWritableStream;(function(e){e._inFlightWriteRequest=e._writeRequests.shift()})(r),Ge(e._writeAlgorithm(t),(function(){!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);var t=r._state;if(Nt(e),!Dr(r)&&"writable"===t){var n=Zr(e);Fr(r,n)}Yr(e)}),(function(t){"writable"===r._state&&Jr(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,Rr(e,t)}(r,t)}))}(e,r)}}else Pr(t)}function Xr(e,t){"writable"===e._controlledWritableStream._state&&$r(e,t)}function Zr(e){return Qr(e)<=0}function $r(e,t){var r=e._controlledWritableStream;Jr(e),Ir(r,t)}function en(e){return new TypeError("WritableStream.prototype."+e+" can only be used on a WritableStream")}function tn(e){return new TypeError("WritableStreamDefaultWriter.prototype."+e+" can only be used on a WritableStreamDefaultWriter")}function rn(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function nn(e){e._closedPromise=ze((function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function an(e,t){nn(e),on(e,t)}function on(e,t){void 0!==e._closedPromise_reject&&(Je(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function sn(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function cn(e){e._readyPromise=ze((function(t,r){e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function un(e,t){cn(e),hn(e,t)}function ln(e){cn(e),pn(e)}function hn(e,t){void 0!==e._readyPromise_reject&&(Je(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function pn(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(Wr.prototype,{error:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Wr.prototype,Oe.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var fn="undefined"!=typeof DOMException?DOMException:void 0;var dn,mn=function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}(fn)?fn:((dn=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}).prototype=Object.create(Error.prototype),Object.defineProperty(dn.prototype,"constructor",{value:dn,writable:!0,configurable:!0}),dn);function gn(e,t,r,n,i,a){var o=kt(e),s=Sr(t);e._disturbed=!0;var c=!1,u=Ue(void 0);return ze((function(l,h){var p,f,d,m;if(void 0!==a){if(p=function(){var r=new mn("Aborted","AbortError"),a=[];n||a.push((function(){return"writable"===t._state?Br(t,r):Ue(void 0)})),i||a.push((function(){return"readable"===e._state?zn(e,r):Ue(void 0)})),v((function(){return Promise.all(a.map((function(e){return e()})))}),!0,r)},a.aborted)return void p();a.addEventListener("abort",p)}if(y(e,o._closedPromise,(function(e){n?w(!0,e):v((function(){return Br(t,e)}),!0,e)})),y(t,s._closedPromise,(function(t){i?w(!0,t):v((function(){return zn(e,t)}),!0,t)})),f=e,d=o._closedPromise,m=function(){r?w():v((function(){return function(e){var t=e._ownerWritableStream,r=t._state;return Dr(t)||"closed"===r?Ue(void 0):"errored"===r?qe(t._storedError):zr(e)}(s)}))},"closed"===f._state?m():Ve(d,m),Dr(t)||"closed"===t._state){var g=new TypeError("the destination writable stream closed before all data could be piped to it");i?w(!0,g):v((function(){return zn(e,g)}),!0,g)}function b(){var e=u;return He(u,(function(){return e!==u?b():void 0}))}function y(e,t,r){"errored"===e._state?r(e._storedError):We(t,r)}function v(e,r,n){function i(){Ge(e(),(function(){return _(r,n)}),(function(e){return _(!0,e)}))}c||(c=!0,"writable"!==t._state||Dr(t)?i():Ve(b(),i))}function w(e,r){c||(c=!0,"writable"!==t._state||Dr(t)?_(e,r):Ve(b(),(function(){return _(e,r)})))}function _(e,t){Hr(s),tt(o),void 0!==a&&a.removeEventListener("abort",p),e?h(t):l(void 0)}Je(ze((function(e,t){!function r(n){n?e():He(c?Ue(!0):He(s._readyPromise,(function(){return ze((function(e,t){Ot(o,{_chunkSteps:function(t){u=He(Gr(s,t),void 0,Re),e(!1)},_closeSteps:function(){return e(!0)},_errorSteps:t})}))})),r,t)}(!1)})))}))}var bn=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!yn(this))throw Tn("desiredSize");return An(this)},enumerable:!1,configurable:!0}),e.prototype.close=function(){if(!yn(this))throw Tn("close");if(!Sn(this))throw new TypeError("The stream is not in a state that permits close");kn(this)},e.prototype.enqueue=function(e){if(void 0===e&&(e=void 0),!yn(this))throw Tn("enqueue");if(!Sn(this))throw new TypeError("The stream is not in a state that permits enqueue");return xn(this,e)},e.prototype.error=function(e){if(void 0===e&&(e=void 0),!yn(this))throw Tn("error");En(this,e)},e.prototype[ut]=function(e){Ut(this);var t=this._cancelAlgorithm(e);return _n(this),t},e.prototype[lt]=function(e){var t=this._controlledReadableStream;if(this._queue.length>0){var r=Nt(this);this._closeRequested&&0===this._queue.length?(_n(this),Un(t)):vn(this),e._chunkSteps(r)}else xt(t,e),vn(this)},e}();function yn(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function vn(e){wn(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Ge(e._pullAlgorithm(),(function(){e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,vn(e))}),(function(t){En(e,t)}))))}function wn(e){var t=e._controlledReadableStream;return!!Sn(e)&&(!!e._started&&(!!(Nn(t)&&At(t)>0)||An(e)>0))}function _n(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function kn(e){if(Sn(e)){var t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(_n(e),Un(t))}}function xn(e,t){if(Sn(e)){var r=e._controlledReadableStream;if(Nn(r)&&At(r)>0)Et(r,t,!1);else{var n=void 0;try{n=e._strategySizeAlgorithm(t)}catch(t){throw En(e,t),t}try{zt(e,t,n)}catch(t){throw En(e,t),t}}vn(e)}}function En(e,t){var r=e._controlledReadableStream;"readable"===r._state&&(Ut(e),_n(e),qn(r,t))}function An(e){var t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function Sn(e){var t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function jn(e,t,r,n,i,a,o){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,Ut(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=o,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=i,e._readableStreamController=t,Ge(Ue(r()),(function(){t._started=!0,vn(t)}),(function(e){En(t,e)}))}function Tn(e){return new TypeError("ReadableStreamDefaultController.prototype."+e+" can only be used on a ReadableStreamDefaultController")}function Cn(e,t,r){return dt(e,r),function(r){return Xe(e,t,[r])}}function Bn(e,t,r){return dt(e,r),function(r){return Xe(e,t,[r])}}function On(e,t,r){return dt(e,r),function(r){return Ye(e,t,[r])}}function Rn(e,t){if("bytes"!==(e=""+e))throw new TypeError(t+" '"+e+"' is not a valid enumeration value for ReadableStreamType");return e}function In(e,t){if("byob"!==(e=""+e))throw new TypeError(t+" '"+e+"' is not a valid enumeration value for ReadableStreamReaderMode");return e}function Pn(e,t){ft(e,t);var r=null==e?void 0:e.preventAbort,n=null==e?void 0:e.preventCancel,i=null==e?void 0:e.preventClose,a=null==e?void 0:e.signal;return void 0!==a&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw new TypeError(t+" is not an AbortSignal.")}(a,t+" has member 'signal' that"),{preventAbort:Boolean(r),preventCancel:Boolean(n),preventClose:Boolean(i),signal:a}}Object.defineProperties(bn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(bn.prototype,Oe.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var Dn=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),void 0===e?e=null:mt(e,"First parameter");var r=yr(t,"Second parameter"),n=function(e,t){ft(e,t);var r=e,n=null==r?void 0:r.autoAllocateChunkSize,i=null==r?void 0:r.cancel,a=null==r?void 0:r.pull,o=null==r?void 0:r.start,s=null==r?void 0:r.type;return{autoAllocateChunkSize:void 0===n?void 0:wt(n,t+" has member 'autoAllocateChunkSize' that"),cancel:void 0===i?void 0:Cn(i,r,t+" has member 'cancel' that"),pull:void 0===a?void 0:Bn(a,r,t+" has member 'pull' that"),start:void 0===o?void 0:On(o,r,t+" has member 'start' that"),type:void 0===s?void 0:Rn(s,t+" has member 'type' that")}}(e,"First parameter");if(Fn(this),"bytes"===n.type){if(void 0!==r.size)throw new RangeError("The strategy for a byte stream cannot have a size function");sr(this,n,gr(r,0))}else{var i=br(r);!function(e,t,r,n){var i=Object.create(bn.prototype),a=function(){},o=function(){return Ue(void 0)},s=function(){return Ue(void 0)};void 0!==t.start&&(a=function(){return t.start(i)}),void 0!==t.pull&&(o=function(){return t.pull(i)}),void 0!==t.cancel&&(s=function(e){return t.cancel(e)}),jn(e,i,a,o,s,r,n)}(this,n,gr(r,1),i)}}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!Ln(this))throw Hn("locked");return Nn(this)},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return void 0===e&&(e=void 0),Ln(this)?Nn(this)?qe(new TypeError("Cannot cancel a stream that already has a reader")):zn(this,e):qe(Hn("cancel"))},e.prototype.getReader=function(e){if(void 0===e&&(e=void 0),!Ln(this))throw Hn("getReader");return void 0===function(e,t){ft(e,t);var r=null==e?void 0:e.mode;return{mode:void 0===r?void 0:In(r,t+" has member 'mode' that")}}(e,"First parameter").mode?kt(this):new fr(this)},e.prototype.pipeThrough=function(e,t){if(void 0===t&&(t={}),!Ln(this))throw Hn("pipeThrough");gt(e,1,"pipeThrough");var r=function(e,t){ft(e,t);var r=null==e?void 0:e.readable;bt(r,"readable","ReadableWritablePair"),_t(r,t+" has member 'readable' that");var n=null==e?void 0:e.writable;return bt(n,"writable","ReadableWritablePair"),Er(n,t+" has member 'writable' that"),{readable:r,writable:n}}(e,"First parameter"),n=Pn(t,"Second parameter");if(Nn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Cr(r.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Je(gn(this,r.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),r.readable},e.prototype.pipeTo=function(e,t){if(void 0===t&&(t={}),!Ln(this))return qe(Hn("pipeTo"));if(void 0===e)return qe("Parameter 1 is required in 'pipeTo'.");if(!Tr(e))return qe(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));var r;try{r=Pn(t,"Second parameter")}catch(e){return qe(e)}return Nn(this)?qe(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Cr(e)?qe(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):gn(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)},e.prototype.tee=function(){if(!Ln(this))throw Hn("tee");var e=function(e,t){var r,n,i,a,o,s=kt(e),c=!1,u=!1,l=!1,h=ze((function(e){o=e}));function p(){return c||(c=!0,Ot(s,{_chunkSteps:function(e){Qe((function(){c=!1;var t=e,r=e;u||xn(i._readableStreamController,t),l||xn(a._readableStreamController,r)}))},_closeSteps:function(){c=!1,u||kn(i._readableStreamController),l||kn(a._readableStreamController),u&&l||o(void 0)},_errorSteps:function(){c=!1}})),Ue(void 0)}function f(){}return i=Mn(f,p,(function(t){if(u=!0,r=t,l){var i=qt([r,n]),a=zn(e,i);o(a)}return h})),a=Mn(f,p,(function(t){if(l=!0,n=t,u){var i=qt([r,n]),a=zn(e,i);o(a)}return h})),We(s._closedPromise,(function(e){En(i._readableStreamController,e),En(a._readableStreamController,e),u&&l||o(void 0)})),[i,a]}(this);return qt(e)},e.prototype.values=function(e){if(void 0===e&&(e=void 0),!Ln(this))throw Hn("values");var t,r,n,i,a,o=function(e,t){ft(e,t);var r=null==e?void 0:e.preventCancel;return{preventCancel:Boolean(r)}}(e,"First parameter");return t=this,r=o.preventCancel,n=kt(t),i=new It(n,r),(a=Object.create(Pt))._asyncIteratorImpl=i,a},e}();function Mn(e,t,r,n,i){void 0===n&&(n=1),void 0===i&&(i=function(){return 1});var a=Object.create(Dn.prototype);return Fn(a),jn(a,Object.create(bn.prototype),e,t,r,n,i),a}function Fn(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function Ln(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function Nn(e){return void 0!==e._reader}function zn(e,t){return e._disturbed=!0,"closed"===e._state?Ue(void 0):"errored"===e._state?qe(e._storedError):(Un(e),Ke(e._readableStreamController[ut](t),Re))}function Un(e){e._state="closed";var t=e._reader;void 0!==t&&(ot(t),Bt(t)&&(t._readRequests.forEach((function(e){e._closeSteps()})),t._readRequests=new Ze))}function qn(e,t){e._state="errored",e._storedError=t;var r=e._reader;void 0!==r&&(at(r,t),Bt(r)?(r._readRequests.forEach((function(e){e._errorSteps(t)})),r._readRequests=new Ze):(r._readIntoRequests.forEach((function(e){e._errorSteps(t)})),r._readIntoRequests=new Ze))}function Hn(e){return new TypeError("ReadableStream.prototype."+e+" can only be used on a ReadableStream")}function Gn(e,t){ft(e,t);var r=null==e?void 0:e.highWaterMark;return bt(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:yt(r)}}Object.defineProperties(Dn.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Dn.prototype,Oe.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof Oe.asyncIterator&&Object.defineProperty(Dn.prototype,Oe.asyncIterator,{value:Dn.prototype.values,writable:!0,configurable:!0});var Vn=function(e){return e.byteLength},Wn=function(){function e(e){gt(e,1,"ByteLengthQueuingStrategy"),e=Gn(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}return Object.defineProperty(e.prototype,"highWaterMark",{get:function(){if(!Jn(this))throw Kn("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){if(!Jn(this))throw Kn("size");return Vn},enumerable:!1,configurable:!0}),e}();function Kn(e){return new TypeError("ByteLengthQueuingStrategy.prototype."+e+" can only be used on a ByteLengthQueuingStrategy")}function Jn(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")}Object.defineProperties(Wn.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Wn.prototype,Oe.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var Qn=function(){return 1},Yn=function(){function e(e){gt(e,1,"CountQueuingStrategy"),e=Gn(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}return Object.defineProperty(e.prototype,"highWaterMark",{get:function(){if(!Zn(this))throw Xn("highWaterMark");return this._countQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){if(!Zn(this))throw Xn("size");return Qn},enumerable:!1,configurable:!0}),e}();function Xn(e){return new TypeError("CountQueuingStrategy.prototype."+e+" can only be used on a CountQueuingStrategy")}function Zn(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")}function $n(e,t,r){return dt(e,r),function(r){return Xe(e,t,[r])}}function ei(e,t,r){return dt(e,r),function(r){return Ye(e,t,[r])}}function ti(e,t,r){return dt(e,r),function(r,n){return Xe(e,t,[r,n])}}Object.defineProperties(Yn.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(Yn.prototype,Oe.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var ri=function(){function e(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={}),void 0===e&&(e=null);var n=yr(t,"Second parameter"),i=yr(r,"Third parameter"),a=function(e,t){ft(e,t);var r=null==e?void 0:e.flush,n=null==e?void 0:e.readableType,i=null==e?void 0:e.start,a=null==e?void 0:e.transform,o=null==e?void 0:e.writableType;return{flush:void 0===r?void 0:$n(r,e,t+" has member 'flush' that"),readableType:n,start:void 0===i?void 0:ei(i,e,t+" has member 'start' that"),transform:void 0===a?void 0:ti(a,e,t+" has member 'transform' that"),writableType:o}}(e,"First parameter");if(void 0!==a.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==a.writableType)throw new RangeError("Invalid writableType specified");var o,s=gr(i,0),c=br(i),u=gr(n,1),l=br(n);!function(e,t,r,n,i,a){function o(){return t}e._writable=function(e,t,r,n,i,a){void 0===i&&(i=1),void 0===a&&(a=function(){return 1});var o=Object.create(Ar.prototype);return jr(o),Kr(o,Object.create(Wr.prototype),e,t,r,n,i,a),o}(o,(function(t){return function(e,t){var r=e._transformStreamController;if(e._backpressure){return Ke(e._backpressureChangePromise,(function(){var n=e._writable;if("erroring"===n._state)throw n._storedError;return hi(r,t)}))}return hi(r,t)}(e,t)}),(function(){return function(e){var t=e._readable,r=e._transformStreamController,n=r._flushAlgorithm();return ui(r),Ke(n,(function(){if("errored"===t._state)throw t._storedError;kn(t._readableStreamController)}),(function(r){throw ii(e,r),t._storedError}))}(e)}),(function(t){return function(e,t){return ii(e,t),Ue(void 0)}(e,t)}),r,n),e._readable=Mn(o,(function(){return function(e){return oi(e,!1),e._backpressureChangePromise}(e)}),(function(t){return ai(e,t),Ue(void 0)}),i,a),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,oi(e,!0),e._transformStreamController=void 0}(this,ze((function(e){o=e})),u,l,s,c),function(e,t){var r=Object.create(si.prototype),n=function(e){try{return li(r,e),Ue(void 0)}catch(e){return qe(e)}},i=function(){return Ue(void 0)};void 0!==t.transform&&(n=function(e){return t.transform(e,r)});void 0!==t.flush&&(i=function(){return t.flush(r)});!function(e,t,r,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n}(e,r,n,i)}(this,a),void 0!==a.start?o(a.start(this._transformStreamController)):o(void 0)}return Object.defineProperty(e.prototype,"readable",{get:function(){if(!ni(this))throw fi("readable");return this._readable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"writable",{get:function(){if(!ni(this))throw fi("writable");return this._writable},enumerable:!1,configurable:!0}),e}();function ni(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function ii(e,t){En(e._readable._readableStreamController,t),ai(e,t)}function ai(e,t){ui(e._transformStreamController),Xr(e._writable._writableStreamController,t),e._backpressure&&oi(e,!1)}function oi(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=ze((function(t){e._backpressureChangePromise_resolve=t})),e._backpressure=t}Object.defineProperties(ri.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(ri.prototype,Oe.toStringTag,{value:"TransformStream",configurable:!0});var si=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!ci(this))throw pi("desiredSize");return An(this._controlledTransformStream._readable._readableStreamController)},enumerable:!1,configurable:!0}),e.prototype.enqueue=function(e){if(void 0===e&&(e=void 0),!ci(this))throw pi("enqueue");li(this,e)},e.prototype.error=function(e){if(void 0===e&&(e=void 0),!ci(this))throw pi("error");var t;t=e,ii(this._controlledTransformStream,t)},e.prototype.terminate=function(){if(!ci(this))throw pi("terminate");!function(e){var t=e._controlledTransformStream;kn(t._readable._readableStreamController);var r=new TypeError("TransformStream terminated");ai(t,r)}(this)},e}();function ci(e){return!!Pe(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function ui(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function li(e,t){var r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!Sn(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{xn(n,t)}catch(e){throw ai(r,e),r._readable._storedError}(function(e){return!wn(e)})(n)!==r._backpressure&&oi(r,!0)}function hi(e,t){return Ke(e._transformAlgorithm(t),void 0,(function(t){throw ii(e._controlledTransformStream,t),t}))}function pi(e){return new TypeError("TransformStreamDefaultController.prototype."+e+" can only be used on a TransformStreamDefaultController")}function fi(e){return new TypeError("TransformStream.prototype."+e+" can only be used on a TransformStream")}Object.defineProperties(si.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Oe.toStringTag&&Object.defineProperty(si.prototype,Oe.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var di={ReadableStream:Dn,ReadableStreamDefaultController:bn,ReadableByteStreamController:Gt,ReadableStreamBYOBRequest:Ht,ReadableStreamDefaultReader:Ct,ReadableStreamBYOBReader:fr,WritableStream:Ar,WritableStreamDefaultController:Wr,WritableStreamDefaultWriter:Lr,ByteLengthQueuingStrategy:Wn,CountQueuingStrategy:Yn,TransformStream:ri,TransformStreamDefaultController:si};if(void 0!==Ie)for(var mi in di)Object.prototype.hasOwnProperty.call(di,mi)&&Object.defineProperty(Ie,mi,{value:di[mi],writable:!0,configurable:!0});delete global.ReadableStream;let gi,bi,yi;gi=Symbol.asyncIterator;bi=Symbol.toStringTag;yi=Symbol.toStringTag;(!a||!("TextEncoder"in s))&&(s.TextEncoder=j);(!a||!("TextDecoder"in s))&&(s.TextDecoder=S),a||"atob"in s||!Q||(s.atob=Q),a||"btoa"in s||!Y||(s.btoa=Y),a||"Headers"in s||!$||(s.Headers=$),a||"Response"in s||!ye||(s.Response=ye),a||"fetch"in s||!we||(s.fetch=we),a||"DOMParser"in s||!i.DOMParser||(s.DOMParser=i.DOMParser),a||"_encodeImageNode"in s||!Ae||(s._encodeImageNode=Ae),a||"_parseImageNode"in s||!Be||(s._parseImageNode=Be),"allSettled"in Promise||(Promise.allSettled=function(e){const t=e.map(e=>e.then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e})));return Promise.all(t)});const{I3SConverter:vi,Tiles3DConverter:wi,DepsInstaller:_i}=r(527),ki={I3S:"I3S",_3DTILES:"3DTILES"};function xi(){console.log("cli: converter 3dTiles to I3S or I3S to 3dTiles..."),console.log('--install-dependencies [Run the script for installing dependencies. Run this options separate from others. Now "*.pgm" file installation is implemented]'),console.log("--max-depth [Maximal depth of hierarchical tiles tree traversal, default: infinite]"),console.log("--name [Tileset name]"),console.log('--output [Output folder, default: "data" folder]'),console.log("--slpk [Generate slpk (Scene Layer Packages) I3S output file]"),console.log("--tileset [tileset.json file (3DTiles) / http://..../SceneServer/layers/0 resource (I3S)]"),console.log("--input-type [tileset input type: I3S or 3DTILES]"),console.log('--7zExe [location of 7z.exe archiver to create slpk on Windows, default: "C:\\Program Files\\7-Zip\\7z.exe"]'),console.log('--egm [location of Earth Gravity Model *.pgm file to convert heights from ellipsoidal to gravity-related format. A model file can be loaded from GeographicLib https://geographiclib.sourceforge.io/html/geoid.html], default: "./deps/egm2008-5.zip"'),console.log("--token [Token for Cesium ION tilesets authentication]"),console.log("--no-draco [Disable draco compression for geometry]"),console.log("--generate-textures [Enable KTX2 textures generation if only one of (JPG, PNG) texture is provided or generate JPG texture if only KTX2 is provided]"),console.log("--generate-bounding-volumes [Will generate obb and mbs bounding volumes from geometry]"),console.log("--validate [Enable validation]"),process.exit(0)}let Ei;!async function(){const[,,...e]=process.argv;if(0===e.length&&xi(),Ei=function(e){const t={inputType:null,tileset:null,name:null,output:"data",sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:Object(n.join)(process.cwd(),"deps","egm2008-5.pgm"),token:null,draco:!0,installDependencies:!1,generateTextures:!1,generateBoundingVolumes:!1,validate:!1},r=e.length,i=t=>{if(t+1>=r)return null;const n=e[t+1];return 0===n.indexOf("--")?null:n};return e.forEach((e,r)=>{if(0===e.indexOf("--"))switch(e){case"--input-type":t.inputType=i(r);break;case"--tileset":t.tileset=i(r);break;case"--name":t.name=i(r);break;case"--output":t.output=i(r);break;case"--max-depth":t.maxDepth=i(r);break;case"--slpk":t.slpk=!0;break;case"--7zExe":t.sevenZipExe=i(r);break;case"--egm":t.egm=i(r);break;case"--token":t.token=i(r);break;case"--no-draco":t.draco=!1;break;case"--validate":t.validate=!0;break;case"--install-dependencies":t.installDependencies=!0;break;case"--generate-textures":t.generateTextures=!0;break;case"--generate-bounding-volumes":t.generateBoundingVolumes=!0;break;case"--help":xi();break;default:console.warn("Unknown option "+e),process.exit(0)}}),t}(e),Ei.installDependencies){(new _i).install("deps")}else!function(e){const t={name:()=>console.log("Missed: --name [Tileset name]"),tileset:()=>console.log("Missed: --tileset [tileset.json file]"),inputType:()=>console.log("Missed/Incorrect: --input-type [tileset input type: I3S or 3DTILES]")},r=[];for(const n in t){const i=e[n],a=Boolean(i)&&"inputType"===n&&!Object.values(ki).includes(i.toUpperCase());i&&!a||r.push(t[n])}r.length&&(r.forEach(e=>e()),process.exit(0))}(Ei),await async function(e){console.log("------------------------------------------------"),console.log("Starting conversion of "+e.inputType),console.log("------------------------------------------------");switch(e.inputType.toUpperCase()){case ki.I3S:(new wi).convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case ki._3DTILES:const t=new vi;await t.convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,slpk:e.slpk,sevenZipExe:e.sevenZipExe,egmFilePath:e.egm,token:e.token,draco:e.draco,generateTextures:e.generateTextures,generateBoundingVolumes:e.generateBoundingVolumes,validate:e.validate});break;default:xi()}}(Ei)}()},,,,,,,function(e,t,r){"use strict";function n(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const t="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}r.d(t,"a",(function(){return _}));const i="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",a=n();class o{constructor(e,t,r="sessionStorage"){this.storage=function(e){try{const t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}(r),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function s(e,t,r,n=600){const i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));const a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}const c={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function u(e){return"string"==typeof e?c[e.toUpperCase()]||c.WHITE:e}function l(e,t){if(!e)throw new Error(t||"Assertion failed")}const h={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},p=h.window||h.self||h.global,f=h.process||{};console;function d(){let e;if(a&&p.performance)e=p.performance.now();else if(f.hrtime){const t=f.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}const m={debug:a&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},g={enabled:!0,level:0};function b(){}const y={},v={once:!0};function w(e){for(const t in e)for(const r in e[t])return r||"untitled";return"empty"}class _{constructor({id:e}={id:""}){this.id=e,this.VERSION=i,this._startTs=d(),this._deltaTs=d(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new o("__probe-".concat(this.id,"__"),g),this.userData={},this.timeStamp("".concat(this.id," started")),function(e,t=["constructor"]){const r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r);for(const r of n)"function"==typeof e[r]&&(t.find(e=>r===e)||(e[r]=e[r].bind(e)))}(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((d()-this._startTs).toPrecision(10))}getDelta(){return Number((d()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.updateConfiguration({enabled:e}),this}setLevel(e){return this._storage.updateConfiguration({level:e}),this}assert(e,t){l(e,t)}warn(e){return this._getLogFunction(0,e,m.warn,arguments,v)}error(e){return this._getLogFunction(0,e,m.error,arguments)}deprecated(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}probe(e,t){return this._getLogFunction(e,t,m.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,m.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,m.debug||m.info,arguments,v)}table(e,t,r){return t?this._getLogFunction(e,t,console.table||b,r&&[r],{tag:w(t)}):b}image({logLevel:e,priority:t,image:n,message:i="",scale:o=1}){return this._shouldLog(e||t)?a?function({image:e,message:t="",scale:r=1}){if("string"==typeof e){const n=new Image;return n.onload=()=>{const e=s(n,t,r);console.log(...e)},n.src=e,b}const n=e.nodeName||"";if("img"===n.toLowerCase())return console.log(...s(e,t,r)),b;if("canvas"===n.toLowerCase()){const n=new Image;return n.onload=()=>console.log(...s(n,t,r)),n.src=e.toDataURL(),b}return b}({image:n,message:i,scale:o}):function({image:e,message:t="",scale:n=1}){let i=null;try{i=r(!function(){var e=new Error("Cannot find module 'asciify-image'");throw e.code="MODULE_NOT_FOUND",e}())}catch(e){}if(i)return()=>i(e,{fit:"box",width:"".concat(Math.round(80*n),"%")}).then(e=>console.log(e));return b}({image:n,message:i,scale:o}):b}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(e){return this._storage.config[e]}set(e,t){this._storage.updateConfiguration({[e]:t})}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||b)}group(e,t,r={collapsed:!1}){r=x({logLevel:e,message:t,opts:r});const{collapsed:n}=r;return r.method=(n?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(e,t,r={}){return this.group(e,t,Object.assign({},r,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||b)}withGroup(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=k(e)}_getLogFunction(e,t,r,n=[],i){if(this._shouldLog(e)){i=x({logLevel:e,message:t,args:n,opts:i}),l(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=d();const o=i.tag||i.message;if(i.once){if(y[o])return b;y[o]=d()}return t=function(e,t,r){if("string"==typeof t){const s=r.time?function(e,t=8){const r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}(function(e){let t;return t=e<10?"".concat(e.toFixed(2),"ms"):e<100?"".concat(e.toFixed(1),"ms"):e<1e3?"".concat(e.toFixed(0),"ms"):"".concat((e/1e3).toFixed(2),"s"),t}(r.total)):"";t=r.time?"".concat(e,": ").concat(s," ").concat(t):"".concat(e,": ").concat(t),n=t,i=r.color,o=r.background,a||"string"!=typeof n||(i&&(i=u(i),n="[".concat(i,"m").concat(n,"")),o&&(i=u(o),n="[".concat(o+10,"m").concat(n,""))),t=n}var n,i,o;return t}(this.id,i.message,i),r.bind(console,t,...i.args)}return b}}function k(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return l(Number.isFinite(t)&&t>=0),t}function x(e){const{logLevel:t,message:r}=e;e.logLevel=k(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(e.args=n,typeof t){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());const i=typeof e.message;return l("string"===i||"object"===i),Object.assign(e,e.opts)}_.VERSION=i}]);