@chromatic-com/vitest 0.0.0 → 0.12.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.
@@ -0,0 +1,789 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/node/plugin.ts
5
+ import { rmSync } from "node:fs";
6
+ import { resolve } from "node:path";
7
+ import colors from "tinyrainbow";
8
+
9
+ // ../shared/dist/index.mjs
10
+ import S, { join } from "path";
11
+ import { existsSync, mkdirSync } from "fs";
12
+ import { writeFile } from "fs/promises";
13
+ import { createHash } from "crypto";
14
+ import { Analytics } from "@segment/analytics-node";
15
+ var xi = Object.create;
16
+ var N = Object.defineProperty;
17
+ var vi = Object.getOwnPropertyDescriptor;
18
+ var ui = Object.getOwnPropertyNames;
19
+ var fi = Object.getPrototypeOf;
20
+ var hi = Object.prototype.hasOwnProperty;
21
+ var gi = /* @__PURE__ */ __name((a, i, t) => i in a ? N(a, i, { enumerable: true, configurable: true, writable: true, value: t }) : a[i] = t, "gi");
22
+ var o = /* @__PURE__ */ __name((a, i) => N(a, "name", { value: i, configurable: true }), "o");
23
+ var j = /* @__PURE__ */ __name((a, i) => () => (i || a((i = { exports: {} }).exports, i), i.exports), "j");
24
+ var bi = /* @__PURE__ */ __name((a, i, t, p) => {
25
+ if (i && typeof i == "object" || typeof i == "function")
26
+ for (let e of ui(i))
27
+ !hi.call(a, e) && e !== t && N(a, e, { get: () => i[e], enumerable: !(p = vi(i, e)) || p.enumerable });
28
+ return a;
29
+ }, "bi");
30
+ var G = /* @__PURE__ */ __name((a, i, t) => (t = a != null ? xi(fi(a)) : {}, bi(!a || !a.__esModule ? N(t, "default", { value: a, enumerable: true }) : t, a)), "G");
31
+ var d = /* @__PURE__ */ __name((a, i, t) => (gi(a, typeof i != "symbol" ? i + "" : i, t), t), "d");
32
+ var Y = j((Mi, K) => {
33
+ function _() {
34
+ this._types = /* @__PURE__ */ Object.create(null), this._extensions = /* @__PURE__ */ Object.create(null);
35
+ for (let a = 0; a < arguments.length; a++)
36
+ this.define(arguments[a]);
37
+ this.define = this.define.bind(this), this.getType = this.getType.bind(this), this.getExtension = this.getExtension.bind(this);
38
+ }
39
+ __name(_, "_");
40
+ o(_, "Mime");
41
+ _.prototype.define = function(a, i) {
42
+ for (let t in a) {
43
+ let p = a[t].map(function(e) {
44
+ return e.toLowerCase();
45
+ });
46
+ t = t.toLowerCase();
47
+ for (let e = 0; e < p.length; e++) {
48
+ let n = p[e];
49
+ if (n[0] !== "*") {
50
+ if (!i && n in this._types)
51
+ throw new Error('Attempt to change mapping for "' + n + '" extension from "' + this._types[n] + '" to "' + t + '". Pass `force=true` to allow this, otherwise remove "' + n + '" from the list of extensions for "' + t + '".');
52
+ this._types[n] = t;
53
+ }
54
+ }
55
+ if (i || !this._extensions[t]) {
56
+ let e = p[0];
57
+ this._extensions[t] = e[0] !== "*" ? e : e.substr(1);
58
+ }
59
+ }
60
+ };
61
+ _.prototype.getType = function(a) {
62
+ a = String(a);
63
+ let i = a.replace(/^.*[/\\]/, "").toLowerCase(), t = i.replace(/^.*\./, "").toLowerCase(), p = i.length < a.length;
64
+ return (t.length < i.length - 1 || !p) && this._types[t] || null;
65
+ };
66
+ _.prototype.getExtension = function(a) {
67
+ return a = /^\s*([^;\s]*)/.test(a) && RegExp.$1, a && this._extensions[a.toLowerCase()] || null;
68
+ };
69
+ K.exports = _;
70
+ });
71
+ var M = j((Ii, Q) => {
72
+ Q.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
73
+ });
74
+ var I = j((ia, Z) => {
75
+ Z.exports = { "application/prs.cww": ["cww"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.sap.vds": ["vds"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] };
76
+ });
77
+ var ai = j((aa, ii) => {
78
+ var qi = Y();
79
+ ii.exports = new qi(M(), I());
80
+ });
81
+ var oi = j((B) => {
82
+ var Ni = /\s*([^,]\S*[^,](?:\s+[^,]+)?)\s*(?:,|$)/, pi = o((a, i, t) => {
83
+ if (a[t] = a[t] || {}, a[t][i])
84
+ throw new Error(`No more than one image candidate is allowed for a given descriptor: ${i}${t}`);
85
+ a[t][i] = true;
86
+ }, "duplicateDescriptorCheck"), Ei = o((a) => {
87
+ if (a.fallback)
88
+ throw new Error("Only one fallback image candidate is allowed");
89
+ if (a.x[1])
90
+ throw new Error("A fallback image is equivalent to a 1x descriptor, providing both is invalid.");
91
+ a.fallback = true;
92
+ }, "fallbackDescriptorDuplicateCheck"), ei = o((a, i) => {
93
+ if (i.length === 0)
94
+ Ei(a);
95
+ else if (i.length > 1)
96
+ throw new Error(`Image candidate may have no more than one descriptor, found ${i.length}: ${i.join(" ")}`);
97
+ }, "descriptorCountCheck"), ni = o((a, i, t) => {
98
+ if (Number.isNaN(a))
99
+ throw new TypeError(`${t || a} is not a valid number`);
100
+ switch (i) {
101
+ case "w": {
102
+ if (a <= 0)
103
+ throw new Error("Width descriptor must be greater than zero");
104
+ if (!Number.isInteger(a))
105
+ throw new TypeError("Width descriptor must be an integer");
106
+ break;
107
+ }
108
+ case "x": {
109
+ if (a <= 0)
110
+ throw new Error("Pixel density descriptor must be greater than zero");
111
+ break;
112
+ }
113
+ case "h":
114
+ throw new Error("Height descriptor is no longer allowed");
115
+ default:
116
+ throw new Error(`Invalid srcset descriptor: ${t}`);
117
+ }
118
+ }, "validDescriptorCheck");
119
+ B.parse = (a, { strict: i = false } = {}) => {
120
+ let t = i ? {} : void 0;
121
+ return a.split(Ni).filter((p, e) => e % 2 === 1).map((p) => {
122
+ let [e, ...n] = p.trim().split(/\s+/), s = { url: e };
123
+ i && ei(t, n);
124
+ for (let l of n) {
125
+ let c = l[l.length - 1], r = Number.parseFloat(l.slice(0, -1));
126
+ switch (i && (ni(r, c, l), pi(t, r, c)), c) {
127
+ case "w": {
128
+ s.width = r;
129
+ break;
130
+ }
131
+ case "h": {
132
+ s.height = r;
133
+ break;
134
+ }
135
+ case "x": {
136
+ s.density = r;
137
+ break;
138
+ }
139
+ }
140
+ }
141
+ return s;
142
+ });
143
+ };
144
+ var Li = /* @__PURE__ */ new Set(["width", "height", "density"]);
145
+ B.stringify = (a, { strict: i = false } = {}) => {
146
+ let t = i ? {} : null;
147
+ return a.map((p) => {
148
+ if (!p.url) {
149
+ if (i)
150
+ throw new Error("URL is required");
151
+ return "";
152
+ }
153
+ let e = Object.keys(p).filter((s) => Li.has(s));
154
+ i && ei(t, e);
155
+ let n = [p.url];
156
+ for (let s of e) {
157
+ let l = p[s], c;
158
+ switch (s) {
159
+ case "width": {
160
+ c = "w";
161
+ break;
162
+ }
163
+ case "height": {
164
+ c = "h";
165
+ break;
166
+ }
167
+ case "density": {
168
+ c = "x";
169
+ break;
170
+ }
171
+ }
172
+ let r = `${l}${c}`;
173
+ i && (ni(l, c), pi(t, l, c)), n.push(r);
174
+ }
175
+ return n.join(" ");
176
+ }).join(", ");
177
+ };
178
+ });
179
+ var v = process.env.LOG ? console : { log: (...a) => {
180
+ }, warn: (...a) => {
181
+ } };
182
+ var R = class R2 {
183
+ static {
184
+ __name(this, "R");
185
+ }
186
+ constructor(i, t, p) {
187
+ d(this, "archive", {});
188
+ d(this, "client");
189
+ d(this, "assetDomains");
190
+ d(this, "firstUrl");
191
+ d(this, "httpCredentials");
192
+ d(this, "pendingRequests", /* @__PURE__ */ new Set());
193
+ d(this, "authRequired", o(async ({ requestId: i2, request: t2 }) => {
194
+ await this.clientSend(t2, "Fetch.continueWithAuth", { requestId: i2, authChallengeResponse: { response: "ProvideCredentials", ...this.httpCredentials } });
195
+ }, "authRequired"));
196
+ d(this, "requestPaused", o(async ({ requestId: i2, request: t2, responseStatusCode: p2, responseStatusText: e, responseErrorReason: n, responseHeaders: s }) => {
197
+ if (this.pendingRequests.delete(i2), !t2.method.match(/get/i)) {
198
+ await this.clientSend(t2, "Fetch.continueRequest", { requestId: i2 });
199
+ return;
200
+ }
201
+ if (p2 === 304) {
202
+ await this.clientSend(t2, "Fetch.continueRequest", { requestId: i2 });
203
+ return;
204
+ }
205
+ let l = new URL(t2.url);
206
+ this.firstUrl ?? (this.firstUrl = l);
207
+ let c = l.origin === this.firstUrl.origin || this.assetDomains.includes(l.origin);
208
+ if (v.log("requestPaused", l.toString(), p2 || n ? "response" : "request", this.firstUrl.toString(), c), n) {
209
+ v.log(`Got response error: ${n}`), await this.clientSend(t2, "Fetch.continueRequest", { requestId: i2 });
210
+ return;
211
+ }
212
+ if (p2) {
213
+ await this.handleSuccessfulResponse({ request: t2, requestId: i2, responseStatusCode: p2, responseStatusText: e, responseHeaders: s }, l, c);
214
+ return;
215
+ }
216
+ this.pendingRequests.add(i2), await this.clientSend(t2, "Fetch.continueRequest", { requestId: i2, interceptResponse: true });
217
+ }, "requestPaused"));
218
+ this.client = i, this.assetDomains = (t || []).map((e) => `https://${e}`), this.httpCredentials = p;
219
+ }
220
+ async watch() {
221
+ this.client.on("Fetch.requestPaused", this.requestPaused), this.client.on("Fetch.authRequired", this.authRequired), await this.client.send("Fetch.enable", { handleAuthRequests: true });
222
+ }
223
+ async off() {
224
+ this.client.off?.("Fetch.requestPaused", this.requestPaused), this.client.off?.("Fetch.authRequired", this.authRequired), await this.client.send("Fetch.disable");
225
+ }
226
+ getPendingRequestsCount() {
227
+ return this.pendingRequests.size;
228
+ }
229
+ async clientSend(i, t, p) {
230
+ try {
231
+ return await this.client.send(t, p);
232
+ } catch (e) {
233
+ return v.log("Client error", i.url, e), this.archive[i.url] = { error: e }, null;
234
+ }
235
+ }
236
+ async handleSuccessfulResponse(i, t, p) {
237
+ let { request: e, requestId: n, responseStatusCode: s, responseStatusText: l, responseHeaders: c } = i;
238
+ if ([301, 302, 303, 307, 308].includes(s)) {
239
+ await this.clientSend(e, "Fetch.continueRequest", { requestId: n, interceptResponse: true });
240
+ return;
241
+ }
242
+ let r = await this.clientSend(e, "Fetch.getResponseBody", { requestId: n });
243
+ if (r === null)
244
+ return;
245
+ let { body: u, base64Encoded: m } = r, f = c.find(({ name: w }) => w.toLowerCase() === "content-type"), b = t.toString() === this.firstUrl.toString();
246
+ p && !b && (this.archive[e.url] = { statusCode: s, statusText: l, body: Buffer.from(u, m ? "base64" : "utf8"), contentType: f?.value }), await this.clientSend(e, "Fetch.continueRequest", { requestId: n });
247
+ }
248
+ };
249
+ o(R, "ResourceArchiver");
250
+ var J = R;
251
+ function T(a) {
252
+ existsSync(a) || mkdirSync(a, { recursive: true });
253
+ }
254
+ __name(T, "T");
255
+ o(T, "ensureDir");
256
+ async function E(a, i) {
257
+ return T(S.dirname(a)), writeFile(a, i, { mode: 511 });
258
+ }
259
+ __name(E, "E");
260
+ o(E, "outputFile");
261
+ async function U(a, i) {
262
+ return E(a, JSON.stringify(i));
263
+ }
264
+ __name(U, "U");
265
+ o(U, "outputJSONFile");
266
+ function Si(a) {
267
+ return createHash("shake256", { outputLength: 2 }).update(a).digest("hex");
268
+ }
269
+ __name(Si, "Si");
270
+ o(Si, "hash");
271
+ var z = 255;
272
+ function L(a, i = z) {
273
+ let t = new TextEncoder(), p = new TextDecoder(), e = a.split("/"), n = e.pop();
274
+ if (t.encode(n).byteLength <= i)
275
+ return a;
276
+ let l = Si(n), [c, ...r] = n.split("."), u = t.encode(c), m = r.join("."), f = m.length === 0 ? 0 : t.encode(m).byteLength + 1, b = t.encode(l).byteLength + f, w = u.slice(0, i - b), x = [`${p.decode(w)}${l}`, m].filter(Boolean).join(".");
277
+ return [...e, x].join("/");
278
+ }
279
+ __name(L, "L");
280
+ o(L, "truncateFileName");
281
+ var X = o((a) => {
282
+ let i;
283
+ try {
284
+ return i = new URL(a), i.hostname === "localhost" ? i.pathname + i.search + i.hash : a;
285
+ } catch {
286
+ return a;
287
+ }
288
+ }, "removeLocalhostFromBaseUrl");
289
+ var ti = G(ai());
290
+ var Ci = ["/index.json", "/iframe.html", "/index.html", "/main.iframe.bundle.js", "/runtime~main.iframe.bundle.js", "/sb-preview/runtime.js"];
291
+ var O = class O2 {
292
+ static {
293
+ __name(this, "O");
294
+ }
295
+ constructor(i, t, p) {
296
+ d(this, "url");
297
+ d(this, "response");
298
+ d(this, "shortenedFileNameLength");
299
+ d(this, "pageUrl");
300
+ this.url = new URL(i), this.response = t, this.shortenedFileNameLength = 250, this.pageUrl = new URL(p);
301
+ }
302
+ originalSrc() {
303
+ return this.url.toString();
304
+ }
305
+ toFileSystemPath() {
306
+ let i = this.url.pathname;
307
+ return i = this.preserveExternalDomain(), i = this.ensureNonDirectory(i), i = this.encodeQueryString(i), i = this.truncateFileName(i), i = this.removeSpecialChars(i), i = this.renameReservedPathnames(i), i = this.addExtension(i), i;
308
+ }
309
+ ensureNonDirectory(i) {
310
+ return i.endsWith("/") ? `${i}index.html` : i;
311
+ }
312
+ encodeQueryString(i) {
313
+ let t = this.url.search;
314
+ if (!t)
315
+ return i;
316
+ let p = this.hash(t);
317
+ return `${i}-${p}`;
318
+ }
319
+ truncateFileName(i) {
320
+ let t = i.split("/"), p = [];
321
+ return t.forEach((e, n) => {
322
+ let s = e;
323
+ e.length > this.shortenedFileNameLength && (s = e.substring(0, this.shortenedFileNameLength), v.log(`Chunk of filename '${e}' is too long. Shortening to '${s}'`)), p.push(s);
324
+ }), p.join("/");
325
+ }
326
+ removeSpecialChars(i) {
327
+ return i.replace(/[%:@]/g, "");
328
+ }
329
+ addExtension(i) {
330
+ if ("error" in this.response)
331
+ return i;
332
+ let t = i;
333
+ if (!S.extname(t)) {
334
+ let p = ti.default.getExtension(this.response.contentType) || "tmp";
335
+ t = `${i}.${p}`;
336
+ }
337
+ return t;
338
+ }
339
+ preserveExternalDomain() {
340
+ return this.url.origin === this.pageUrl.origin ? this.url.pathname : `/${encodeURIComponent(this.url.host)}${this.url.pathname}`;
341
+ }
342
+ hash(i) {
343
+ return createHash("md5").update(i).digest("hex");
344
+ }
345
+ renameReservedPathnames(i) {
346
+ if (this.url.origin === this.pageUrl.origin && Ci.includes(i)) {
347
+ let t = this.hash(this.url.toString()), p = S.basename(i, S.extname(i));
348
+ return `${S.dirname(i)}/${p}-${t}${S.extname(i)}`;
349
+ }
350
+ return i;
351
+ }
352
+ };
353
+ o(O, "ArchiveFile");
354
+ var D = O;
355
+ var h = ((a) => (a[a.Document = 0] = "Document", a[a.DocumentType = 1] = "DocumentType", a[a.Element = 2] = "Element", a[a.Text = 3] = "Text", a[a.CDATA = 4] = "CDATA", a[a.Comment = 5] = "Comment", a))(h || {});
356
+ var V = G(oi());
357
+ var _i = /url\((?!['"]?(?:data):)['"]?([^'")]*)['"]?\)/gi;
358
+ var W = class W2 {
359
+ static {
360
+ __name(this, "W");
361
+ }
362
+ constructor(i) {
363
+ d(this, "snapshot");
364
+ if (Buffer.isBuffer(i)) {
365
+ let t = i.toString("utf-8");
366
+ this.snapshot = JSON.parse(t);
367
+ } else
368
+ this.snapshot = JSON.parse(i);
369
+ }
370
+ async mapAssetPaths(i) {
371
+ let t = await this.mapNode(this.snapshot, i);
372
+ return JSON.stringify(t);
373
+ }
374
+ async mapNode(i, t) {
375
+ return i = this.mapNodeAttributes(i, t), i = this.mapTextElement(i, t), "childNodes" in i && (i.childNodes = await Promise.all(i.childNodes.map(async (p) => this.mapNode(p, t)))), i;
376
+ }
377
+ mapNodeAttributes(i, t) {
378
+ if (i.type === h.Element) {
379
+ if (i.attributes.src) {
380
+ let p = i.attributes.src;
381
+ t.has(p) && (i.attributes.src = t.get(p));
382
+ }
383
+ if (i.attributes.style) {
384
+ let p = i.attributes.style, e = this.mapCssUrls(p, t);
385
+ i.attributes.style = e;
386
+ }
387
+ if (i.attributes._cssText) {
388
+ let p = i.attributes._cssText, e = this.mapCssUrls(p, t);
389
+ i.attributes._cssText = e;
390
+ }
391
+ if (["link", "use"].includes(i.tagName) && i.attributes.href) {
392
+ let e = i.attributes.href.split("#"), n = e[0];
393
+ t.has(n) && (e[0] = t.get(n), i.attributes.href = e.join("#"));
394
+ }
395
+ if (i.tagName === "img" && i.attributes.srcset) {
396
+ let p = i.attributes.srcset, e = this.mapSrcsetUrls(p, t);
397
+ e && (i.attributes.src = e, delete i.attributes.srcset, delete i.attributes.sizes);
398
+ }
399
+ i.tagName === "picture" && this.mapPictureElement(i, t), i.tagName === "base" && i.attributes.href && (i.attributes.href = X(i.attributes.href));
400
+ }
401
+ return i;
402
+ }
403
+ mapPictureElement(i, t) {
404
+ let e = i.childNodes.filter(this.isSourceElement).map((n) => V.default.parse(n.attributes?.srcset ?? "").map((l) => l.url)).flat().find((n) => t.has(n));
405
+ if (e) {
406
+ i.childNodes = i.childNodes.filter((s) => !this.isSourceElement(s));
407
+ let n = i.childNodes.find((s) => s.type === h.Element && s.tagName === "img");
408
+ n && n.attributes && (n.attributes.src = t.get(e));
409
+ }
410
+ }
411
+ isSourceElement(i) {
412
+ return i.type === h.Element && i.tagName === "source";
413
+ }
414
+ mapTextElement(i, t) {
415
+ if (i.type === h.Text && i.isStyle && i.textContent) {
416
+ let p = this.mapCssUrls(i.textContent, t);
417
+ i.textContent = p;
418
+ }
419
+ return i;
420
+ }
421
+ mapCssUrls(i, t) {
422
+ return i.replace(_i, (p, e) => {
423
+ let n = p;
424
+ return t.has(e) && (n = p.replace(e, t.get(e))), n;
425
+ });
426
+ }
427
+ mapSrcsetUrls(i, t) {
428
+ let p = V.default.parse(i), e;
429
+ return p.forEach((n) => {
430
+ t.has(n.url) && (e = t.get(n.url));
431
+ }), e;
432
+ }
433
+ };
434
+ o(W, "DOMSnapshot");
435
+ var $ = W;
436
+ function H(a) {
437
+ return `w${a.width}h${a.height}`;
438
+ }
439
+ __name(H, "H");
440
+ o(H, "viewportToString");
441
+ function Di(a) {
442
+ let i = a.match(/w(\d+)h(\d+)/);
443
+ return { width: Number(i[1]), height: Number(i[2]) };
444
+ }
445
+ __name(Di, "Di");
446
+ o(Di, "parseViewport");
447
+ var q = o((a) => a.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "-").replace(/[\r\n]/g, "-").replace(/-+/g, "-").replace(/^-+/, "").replace(/-+$/, ""), "sanitize");
448
+ var $i = "snapshot.json";
449
+ function A(a, i) {
450
+ let t = `${q(a)}-${q(i)}`, p = z - 25;
451
+ return L(t, p);
452
+ }
453
+ __name(A, "A");
454
+ o(A, "snapshotId");
455
+ function si(a, i) {
456
+ return [a, H(i), $i].join(".");
457
+ }
458
+ __name(si, "si");
459
+ o(si, "snapshotFileName");
460
+ var Ai = "stories.json";
461
+ function li(a) {
462
+ let i = [q(a), Ai].join("."), t = z - 25;
463
+ return L(i, t);
464
+ }
465
+ __name(li, "li");
466
+ o(li, "storiesFileName");
467
+ function ci(a, i, t) {
468
+ return { title: a, stories: Object.keys(i).map((p) => ({ name: p, parameters: { server: { id: A(a, p) }, chromatic: { ...t } } })) };
469
+ }
470
+ __name(ci, "ci");
471
+ o(ci, "createStories");
472
+ async function Pa(a, i, t, p) {
473
+ let { titlePath: e, outputDir: n, pageUrl: s, viewport: l } = a, r = e.map((x) => x.replace(/\.(ts|js|mjs|cjs|tsx|jsx|cjsx|coffee)$/, "").replace(/\.(spec|test|cy)$/, "")).join("/"), u = join(n, "chromatic-archives"), m = join(u, "archive");
474
+ await T(m), v.log(`Writing test results for "${r}"`);
475
+ let f = /* @__PURE__ */ new Map();
476
+ await Promise.all(Object.entries(t).map(async ([x, k]) => {
477
+ if ("error" in k)
478
+ return;
479
+ let P = new D(x, k, s), C = P.originalSrc(), y = P.toFileSystemPath();
480
+ C !== y && f.set(C, y), await E(join(m, y), k.body);
481
+ })), await Promise.all(await Object.entries(i).map(async ([x, k]) => {
482
+ let C = await new $(k).mapAssetPaths(f), y = si(A(r, x), l);
483
+ await E(join(m, y), C);
484
+ }));
485
+ let b = li(r), w = ci(r, i, p);
486
+ await U(join(u, b), w);
487
+ let F = Object.entries(t).filter(([, x]) => "error" in x);
488
+ F.length > 0 && (v.log(`Encountered ${F.length} errors archiving resources, writing to 'errors.json'`), await U(join(m, "errors.json"), { errors: Object.fromEntries(F) }));
489
+ }
490
+ __name(Pa, "Pa");
491
+ o(Pa, "writeTestResult");
492
+ var Ri = new Analytics({ writeKey: process.env.SEGMENT_WRITE_KEY || "cwWhBWso2gwzyenW29CnCp30Kjz4DogE" });
493
+ var Ti = "@chromaui/test-archiver run";
494
+ function mi(a, i) {
495
+ Ri.track({ userId: Ti, event: a, properties: i });
496
+ }
497
+ __name(mi, "mi");
498
+ o(mi, "track");
499
+ var ri = false;
500
+ function Oa(a = {}) {
501
+ ri || (mi("run", a), ri = true);
502
+ }
503
+ __name(Oa, "Oa");
504
+ o(Oa, "trackRun");
505
+ var di = false;
506
+ function Ba(a = {}) {
507
+ di || (mi("complete", a), di = true);
508
+ }
509
+ __name(Ba, "Ba");
510
+ o(Ba, "trackComplete");
511
+ var Ha = 1e4;
512
+
513
+ // src/node/commands.ts
514
+ import assert from "node:assert";
515
+
516
+ // src/node/NetworkIdleTracker.ts
517
+ var NetworkIdleTimeoutError = class NetworkIdleTimeoutError2 extends Error {
518
+ static {
519
+ __name(this, "NetworkIdleTimeoutError");
520
+ }
521
+ name = "NetworkIdleTimeoutError";
522
+ };
523
+ var NetworkIdleTracker = class _NetworkIdleTracker {
524
+ static {
525
+ __name(this, "NetworkIdleTracker");
526
+ }
527
+ cdp;
528
+ idleTimeout;
529
+ pending;
530
+ idleTimer;
531
+ idleResolvers;
532
+ constructor(cdp, idleTimeout) {
533
+ this.cdp = cdp;
534
+ this.idleTimeout = idleTimeout;
535
+ this.pending = /* @__PURE__ */ new Set();
536
+ this.idleTimer = null;
537
+ this.idleResolvers = [];
538
+ this.onComplete = (params) => {
539
+ this.pending.delete(params.requestId);
540
+ if (this.pending.size === 0) {
541
+ this.startTimer();
542
+ }
543
+ };
544
+ this.onRequest = (params) => {
545
+ this.pending.add(params.requestId);
546
+ this.clearTimer();
547
+ };
548
+ }
549
+ static async create(cdp, idleTimeout) {
550
+ const tracker = new _NetworkIdleTracker(cdp, idleTimeout);
551
+ await tracker.watch();
552
+ return tracker;
553
+ }
554
+ async watch() {
555
+ this.cdp.on("Network.requestWillBeSent", this.onRequest);
556
+ this.cdp.on("Network.loadingFinished", this.onComplete);
557
+ this.cdp.on("Network.loadingFailed", this.onComplete);
558
+ await this.cdp.send("Network.enable");
559
+ }
560
+ async off() {
561
+ this.cdp.off("Network.requestWillBeSent", this.onRequest);
562
+ this.cdp.off("Network.loadingFinished", this.onComplete);
563
+ this.cdp.off("Network.loadingFailed", this.onComplete);
564
+ this.clearTimer();
565
+ await this.cdp.send("Network.disable");
566
+ }
567
+ waitForIdle(rejectTimeout) {
568
+ if (this.pending.size === 0 && this.idleTimer === null) {
569
+ return Promise.resolve();
570
+ }
571
+ return new Promise((resolve2, reject) => {
572
+ const timeout = setTimeout(() => reject(new NetworkIdleTimeoutError("Timed out waiting for network to be idle")), rejectTimeout);
573
+ this.idleResolvers.push(resolve2, () => clearTimeout(timeout));
574
+ });
575
+ }
576
+ onComplete;
577
+ onRequest;
578
+ startTimer() {
579
+ this.clearTimer();
580
+ this.idleTimer = setTimeout(() => {
581
+ this.idleTimer = null;
582
+ this.idleResolvers.splice(0).forEach((fn) => fn());
583
+ }, this.idleTimeout)?.unref();
584
+ }
585
+ clearTimer() {
586
+ if (this.idleTimer) {
587
+ clearTimeout(this.idleTimer);
588
+ this.idleTimer = null;
589
+ }
590
+ }
591
+ };
592
+
593
+ // src/node/commands.ts
594
+ var resourceArchivers = /* @__PURE__ */ new Map();
595
+ var networkIdleTrackers = /* @__PURE__ */ new Map();
596
+ var snapshots = /* @__PURE__ */ new Map();
597
+ function createCommands(options) {
598
+ return {
599
+ /**
600
+ * Get resolved options on the client side.
601
+ * All options must be serializable at this point.
602
+ */
603
+ async __chromatic_getOptions() {
604
+ return options;
605
+ },
606
+ /**
607
+ * Store a `@rrweb` generated DOM snapshot for the test.
608
+ * Can be called multiple times during a single test case.
609
+ */
610
+ async __chromatic_uploadDOMSnapshot(_, id, snapshot, name) {
611
+ let sessionSnapshots = snapshots.get(id);
612
+ if (!sessionSnapshots) {
613
+ sessionSnapshots = /* @__PURE__ */ new Map();
614
+ snapshots.set(id, sessionSnapshots);
615
+ }
616
+ name ||= `Snapshot #${sessionSnapshots.size + 1}`;
617
+ sessionSnapshots.set(name, snapshot);
618
+ },
619
+ /**
620
+ * Wait for network to be idle, meaning no new network requests for at least `idleNetworkInterval` ms.
621
+ * Use `timeout` argument to reject if network doesn't become idle within given time.
622
+ */
623
+ async __chromatic_waitForIdleNetwork(_, id, timeout) {
624
+ const networkIdleTracker = networkIdleTrackers.get(id);
625
+ assert(networkIdleTracker, `No network idle tracker found for test ${id}`);
626
+ await networkIdleTracker.waitForIdle(timeout);
627
+ },
628
+ /**
629
+ * Start recording HTTP resources and network activity for given test.
630
+ */
631
+ async __chromatic_interceptFetch(context, id) {
632
+ const cdp = await context.provider.getCDPSession?.(context.sessionId);
633
+ assert(cdp, `Unable to get CDP session for session ${context.sessionId}`);
634
+ const { contextOptions } = context.project.config.browser.provider?.options ?? {};
635
+ const resourceArchiver = new J(cdp, options.assetDomains, contextOptions?.httpCredentials);
636
+ resourceArchivers.set(id, resourceArchiver);
637
+ await resourceArchiver.watch();
638
+ networkIdleTrackers.set(id, await NetworkIdleTracker.create(cdp, options.idleNetworkInterval));
639
+ },
640
+ /**
641
+ * Write captured snapshots and network resources to disk.
642
+ * Should be called only once per test, as it also clears resources.
643
+ */
644
+ async __chromatic_writeTestResult(context, id) {
645
+ const entity = context.project.vitest.state.getReportedEntityById(id);
646
+ assert(entity?.type === "test", `Expected entity with id ${id} to be a test, found ${entity?.type}`);
647
+ const { archive, sessionSnapshots } = await onTestCleanup(id);
648
+ assert(sessionSnapshots, `No snapshots found for test ${id}`);
649
+ const snapshotBuffers = {};
650
+ for (const [name, domSnapshot] of sessionSnapshots) {
651
+ snapshotBuffers[name] = Buffer.from(JSON.stringify(domSnapshot));
652
+ }
653
+ await Pa({
654
+ outputDir: options.outputDirectory,
655
+ pageUrl: context.page.url(),
656
+ titlePath: getNames(entity),
657
+ viewport: context.page.viewportSize() || {
658
+ width: 1920,
659
+ height: 1080
660
+ }
661
+ }, snapshotBuffers, archive, {
662
+ delay: options.delay,
663
+ diffIncludeAntiAliasing: options.diffIncludeAntiAliasing,
664
+ diffThreshold: options.diffThreshold,
665
+ forcedColors: options.forcedColors,
666
+ pauseAnimationAtEnd: options.pauseAnimationAtEnd,
667
+ prefersReducedMotion: options.prefersReducedMotion,
668
+ cropToViewport: options.cropToViewport,
669
+ ignoreSelectors: options.ignoreSelectors
670
+ });
671
+ },
672
+ /**
673
+ * Clear test state without writing test results.
674
+ */
675
+ async __chromatic_stopWithoutSnapshots(_, id) {
676
+ await onTestCleanup(id);
677
+ },
678
+ /**
679
+ * Reset all state of the plugin. Should be called between test runs.
680
+ */
681
+ async __chromatic_reset() {
682
+ resourceArchivers.clear();
683
+ networkIdleTrackers.clear();
684
+ snapshots.clear();
685
+ }
686
+ };
687
+ }
688
+ __name(createCommands, "createCommands");
689
+ async function onTestCleanup(id) {
690
+ const resourceArchiver = resourceArchivers.get(id);
691
+ assert(resourceArchiver, `No resource archiver found for test ${id}`);
692
+ resourceArchivers.delete(id);
693
+ await resourceArchiver.off();
694
+ const networkIdleTracker = networkIdleTrackers.get(id);
695
+ networkIdleTrackers.delete(id);
696
+ await networkIdleTracker?.off();
697
+ const sessionSnapshots = snapshots.get(id);
698
+ snapshots.delete(id);
699
+ return {
700
+ archive: resourceArchiver.archive,
701
+ sessionSnapshots
702
+ };
703
+ }
704
+ __name(onTestCleanup, "onTestCleanup");
705
+ function getNames(test) {
706
+ const names = [
707
+ test.name
708
+ ];
709
+ let current = test;
710
+ while ("parent" in current && current.parent) {
711
+ current = current.parent;
712
+ if ("name" in current && current.name) {
713
+ names.unshift(current.name);
714
+ }
715
+ }
716
+ if (current.type === "module") {
717
+ names.unshift(current.relativeModuleId);
718
+ }
719
+ return names;
720
+ }
721
+ __name(getNames, "getNames");
722
+
723
+ // src/node/plugin.ts
724
+ var DEFAULT_TAG_DESCRIPTION = "Visual Regression Tests for `@chromatic-com/vitest`";
725
+ function chromaticPlugin(userOptions = {}) {
726
+ const options = {
727
+ assetDomains: [],
728
+ disableAutoSnapshot: false,
729
+ outputDirectory: process.cwd(),
730
+ resourceArchiveTimeout: Ha,
731
+ idleNetworkInterval: 100,
732
+ ...userOptions
733
+ };
734
+ function clean() {
735
+ rmSync(resolve(options.outputDirectory, "chromatic-archives"), {
736
+ recursive: true,
737
+ force: true
738
+ });
739
+ }
740
+ __name(clean, "clean");
741
+ return {
742
+ name: "vitest:chromatic",
743
+ config() {
744
+ const isDist = import.meta.url.includes("dist/plugin.mjs");
745
+ const setupFile = resolve(import.meta.dirname, isDist ? "./setupFile.mjs" : "../browser/setupFile.ts");
746
+ clean();
747
+ return {
748
+ optimizeDeps: {
749
+ // TODO: Check if this is needed
750
+ include: [
751
+ "@chromaui/rrweb-snapshot"
752
+ ]
753
+ },
754
+ test: {
755
+ setupFiles: [
756
+ setupFile
757
+ ],
758
+ browser: {
759
+ commands: createCommands(options)
760
+ }
761
+ }
762
+ };
763
+ },
764
+ configureVitest(context) {
765
+ const project = context.project;
766
+ const resolvedTags = project.config.tags;
767
+ for (const tag of options.tags || []) {
768
+ const exists = resolvedTags.find((userTag) => userTag.name === tag);
769
+ if (!exists) {
770
+ resolvedTags.push({
771
+ name: tag,
772
+ description: DEFAULT_TAG_DESCRIPTION
773
+ });
774
+ }
775
+ }
776
+ if (!project.config.browser.enabled) {
777
+ context.vitest.logger.warn(colors.bgYellow(colors.black(" chromatic ")), colors.yellow("Plugin is used in a non-browser context."));
778
+ }
779
+ project.onTestsRerun(async () => {
780
+ clean();
781
+ await project.browser?.triggerCommand("__chromatic_reset", {});
782
+ });
783
+ }
784
+ };
785
+ }
786
+ __name(chromaticPlugin, "chromaticPlugin");
787
+ export {
788
+ chromaticPlugin
789
+ };