@silverbulletmd/silverbullet 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/LICENSE.md +18 -0
  2. package/README.md +98 -0
  3. package/client/asset_bundle/bundle.ts +95 -0
  4. package/client/data/datastore.ts +85 -0
  5. package/client/data/kv_primitives.ts +25 -0
  6. package/client/markdown_parser/constants.ts +13 -0
  7. package/client/plugos/event.ts +36 -0
  8. package/client/plugos/eventhook.ts +8 -0
  9. package/client/plugos/hooks/code_widget.ts +59 -0
  10. package/client/plugos/hooks/command.ts +104 -0
  11. package/client/plugos/hooks/document_editor.ts +77 -0
  12. package/client/plugos/hooks/event.ts +187 -0
  13. package/client/plugos/hooks/mq.ts +154 -0
  14. package/client/plugos/hooks/plug_namespace.ts +85 -0
  15. package/client/plugos/hooks/slash_command.ts +192 -0
  16. package/client/plugos/hooks/syscall.ts +66 -0
  17. package/client/plugos/manifest_cache.ts +67 -0
  18. package/client/plugos/plug.ts +99 -0
  19. package/client/plugos/plug_compile.ts +202 -0
  20. package/client/plugos/protocol.ts +40 -0
  21. package/client/plugos/proxy_fetch.ts +53 -0
  22. package/client/plugos/sandboxes/deno_worker_sandbox.ts +6 -0
  23. package/client/plugos/sandboxes/sandbox.ts +14 -0
  24. package/client/plugos/sandboxes/web_worker_sandbox.ts +17 -0
  25. package/client/plugos/sandboxes/worker_sandbox.ts +132 -0
  26. package/client/plugos/syscalls/asset.ts +35 -0
  27. package/client/plugos/syscalls/clientStore.ts +21 -0
  28. package/client/plugos/syscalls/client_code_widget.ts +12 -0
  29. package/client/plugos/syscalls/code_widget.ts +24 -0
  30. package/client/plugos/syscalls/config.ts +46 -0
  31. package/client/plugos/syscalls/datastore.ts +89 -0
  32. package/client/plugos/syscalls/editor.ts +673 -0
  33. package/client/plugos/syscalls/event.ts +36 -0
  34. package/client/plugos/syscalls/fetch.ts +128 -0
  35. package/client/plugos/syscalls/index.ts +102 -0
  36. package/client/plugos/syscalls/jsonschema.ts +69 -0
  37. package/client/plugos/syscalls/language.ts +23 -0
  38. package/client/plugos/syscalls/lua.ts +58 -0
  39. package/client/plugos/syscalls/markdown.ts +84 -0
  40. package/client/plugos/syscalls/mq.ts +52 -0
  41. package/client/plugos/syscalls/service_registry.ts +43 -0
  42. package/client/plugos/syscalls/shell.ts +39 -0
  43. package/client/plugos/syscalls/space.ts +139 -0
  44. package/client/plugos/syscalls/sync.ts +77 -0
  45. package/client/plugos/syscalls/system.ts +150 -0
  46. package/client/plugos/system.ts +201 -0
  47. package/client/plugos/types.ts +60 -0
  48. package/client/plugos/util.ts +14 -0
  49. package/client/plugos/worker_runtime.ts +195 -0
  50. package/client/space_lua/ast.ts +328 -0
  51. package/client/space_lua/ast_narrow.ts +81 -0
  52. package/client/space_lua/eval.ts +2478 -0
  53. package/client/space_lua/labels.ts +416 -0
  54. package/client/space_lua/numeric.ts +240 -0
  55. package/client/space_lua/parse.ts +1522 -0
  56. package/client/space_lua/query_collection.ts +232 -0
  57. package/client/space_lua/rp.ts +27 -0
  58. package/client/space_lua/runtime.ts +1702 -0
  59. package/client/space_lua/stdlib/crypto.ts +10 -0
  60. package/client/space_lua/stdlib/encoding.ts +19 -0
  61. package/client/space_lua/stdlib/format.ts +770 -0
  62. package/client/space_lua/stdlib/js.ts +73 -0
  63. package/client/space_lua/stdlib/load.ts +52 -0
  64. package/client/space_lua/stdlib/math.ts +193 -0
  65. package/client/space_lua/stdlib/net.ts +113 -0
  66. package/client/space_lua/stdlib/os.ts +368 -0
  67. package/client/space_lua/stdlib/space_lua.ts +153 -0
  68. package/client/space_lua/stdlib/string.ts +286 -0
  69. package/client/space_lua/stdlib/table.ts +401 -0
  70. package/client/space_lua/stdlib.ts +489 -0
  71. package/client/space_lua/tonumber.ts +501 -0
  72. package/client/space_lua/util.ts +96 -0
  73. package/dist/plug-compile.js +1513 -0
  74. package/package.json +120 -0
  75. package/plug-api/constants.ts +42 -0
  76. package/plug-api/lib/async.ts +162 -0
  77. package/plug-api/lib/crypto.ts +202 -0
  78. package/plug-api/lib/dates.ts +13 -0
  79. package/plug-api/lib/json.ts +136 -0
  80. package/plug-api/lib/limited_map.ts +72 -0
  81. package/plug-api/lib/memory_cache.ts +21 -0
  82. package/plug-api/lib/native_fetch.ts +6 -0
  83. package/plug-api/lib/ref.ts +275 -0
  84. package/plug-api/lib/resolve.ts +90 -0
  85. package/plug-api/lib/tags.ts +15 -0
  86. package/plug-api/lib/transclusion.ts +122 -0
  87. package/plug-api/lib/tree.ts +232 -0
  88. package/plug-api/lib/yaml.ts +284 -0
  89. package/plug-api/syscall.ts +15 -0
  90. package/plug-api/syscalls/asset.ts +36 -0
  91. package/plug-api/syscalls/client_store.ts +33 -0
  92. package/plug-api/syscalls/code_widget.ts +8 -0
  93. package/plug-api/syscalls/config.ts +58 -0
  94. package/plug-api/syscalls/datastore.ts +96 -0
  95. package/plug-api/syscalls/editor.ts +517 -0
  96. package/plug-api/syscalls/event.ts +47 -0
  97. package/plug-api/syscalls/index.ts +77 -0
  98. package/plug-api/syscalls/jsonschema.ts +25 -0
  99. package/plug-api/syscalls/language.ts +23 -0
  100. package/plug-api/syscalls/lua.ts +20 -0
  101. package/plug-api/syscalls/markdown.ts +38 -0
  102. package/plug-api/syscalls/mq.ts +79 -0
  103. package/plug-api/syscalls/shell.ts +14 -0
  104. package/plug-api/syscalls/space.ts +212 -0
  105. package/plug-api/syscalls/sync.ts +28 -0
  106. package/plug-api/syscalls/system.ts +102 -0
  107. package/plug-api/syscalls/yaml.ts +28 -0
  108. package/plug-api/syscalls.ts +21 -0
  109. package/plug-api/system_mock.ts +89 -0
  110. package/plug-api/types/client.ts +116 -0
  111. package/plug-api/types/config.ts +22 -0
  112. package/plug-api/types/datastore.ts +28 -0
  113. package/plug-api/types/event.ts +27 -0
  114. package/plug-api/types/index.ts +56 -0
  115. package/plug-api/types/manifest.ts +98 -0
  116. package/plug-api/types/namespace.ts +6 -0
  117. package/plugs/builtin_plugs.ts +14 -0
@@ -0,0 +1,1513 @@
1
+ #!/usr/bin/env node
2
+
3
+ // bin/plug-compile.ts
4
+ import { Command } from "commander";
5
+
6
+ // version.ts
7
+ var version = "2.4.1";
8
+
9
+ // client/plugos/plug_compile.ts
10
+ import * as path from "node:path";
11
+ import { readFile as readFile2, writeFile, mkdtemp, rm, mkdir } from "node:fs/promises";
12
+ import { tmpdir } from "node:os";
13
+ import * as YAML from "js-yaml";
14
+
15
+ // build_deps.ts
16
+ import * as esbuild from "esbuild";
17
+ import { readFileSync } from "node:fs";
18
+ import { resolve, dirname } from "node:path";
19
+ import { fileURLToPath } from "node:url";
20
+ var __filename = fileURLToPath(import.meta.url);
21
+ var __dirname = dirname(__filename);
22
+ function denoPlugin(options) {
23
+ const configPath = options?.configPath || resolve(__dirname, "deno.json");
24
+ const denoConfig = JSON.parse(readFileSync(configPath, "utf-8"));
25
+ const imports = denoConfig.imports || {};
26
+ return {
27
+ name: "deno-resolver",
28
+ setup(build) {
29
+ build.onResolve({ filter: /^file:\/\// }, (args) => {
30
+ const filePath = args.path.replace(/^file:\/\//, "");
31
+ return { path: filePath };
32
+ });
33
+ build.onResolve({ filter: /^@silverbulletmd\/silverbullet\// }, (args) => {
34
+ const importPath = args.path;
35
+ if (imports[importPath]) {
36
+ const resolvedPath = resolve(__dirname, imports[importPath]);
37
+ return { path: resolvedPath };
38
+ }
39
+ return null;
40
+ });
41
+ build.onResolve({ filter: /.*/ }, (args) => {
42
+ if (args.path.startsWith(".") || args.path.startsWith("/")) {
43
+ return null;
44
+ }
45
+ const importPath = args.path;
46
+ if (imports[importPath]) {
47
+ let mapped = imports[importPath];
48
+ if (mapped.startsWith("npm:")) {
49
+ return { path: mapped.replace(/^npm:/, ""), external: true };
50
+ }
51
+ if (mapped.startsWith("jsr:")) {
52
+ return { path: args.path, external: true };
53
+ }
54
+ if (mapped.startsWith("http://") || mapped.startsWith("https://")) {
55
+ return { path: args.path, external: true };
56
+ }
57
+ const resolvedPath = resolve(__dirname, mapped);
58
+ return { path: resolvedPath };
59
+ }
60
+ return null;
61
+ });
62
+ }
63
+ };
64
+ }
65
+
66
+ // client/asset_bundle/builder.ts
67
+ import picomatch from "picomatch";
68
+ import { readFile, readdir } from "node:fs/promises";
69
+ import { join } from "node:path";
70
+
71
+ // node_modules/mime/dist/types/other.js
72
+ var types = {
73
+ "application/prs.cww": ["cww"],
74
+ "application/prs.xsf+xml": ["xsf"],
75
+ "application/vnd.1000minds.decision-model+xml": ["1km"],
76
+ "application/vnd.3gpp.pic-bw-large": ["plb"],
77
+ "application/vnd.3gpp.pic-bw-small": ["psb"],
78
+ "application/vnd.3gpp.pic-bw-var": ["pvb"],
79
+ "application/vnd.3gpp2.tcap": ["tcap"],
80
+ "application/vnd.3m.post-it-notes": ["pwn"],
81
+ "application/vnd.accpac.simply.aso": ["aso"],
82
+ "application/vnd.accpac.simply.imp": ["imp"],
83
+ "application/vnd.acucobol": ["acu"],
84
+ "application/vnd.acucorp": ["atc", "acutc"],
85
+ "application/vnd.adobe.air-application-installer-package+zip": ["air"],
86
+ "application/vnd.adobe.formscentral.fcdt": ["fcdt"],
87
+ "application/vnd.adobe.fxp": ["fxp", "fxpl"],
88
+ "application/vnd.adobe.xdp+xml": ["xdp"],
89
+ "application/vnd.adobe.xfdf": ["*xfdf"],
90
+ "application/vnd.age": ["age"],
91
+ "application/vnd.ahead.space": ["ahead"],
92
+ "application/vnd.airzip.filesecure.azf": ["azf"],
93
+ "application/vnd.airzip.filesecure.azs": ["azs"],
94
+ "application/vnd.amazon.ebook": ["azw"],
95
+ "application/vnd.americandynamics.acc": ["acc"],
96
+ "application/vnd.amiga.ami": ["ami"],
97
+ "application/vnd.android.package-archive": ["apk"],
98
+ "application/vnd.anser-web-certificate-issue-initiation": ["cii"],
99
+ "application/vnd.anser-web-funds-transfer-initiation": ["fti"],
100
+ "application/vnd.antix.game-component": ["atx"],
101
+ "application/vnd.apple.installer+xml": ["mpkg"],
102
+ "application/vnd.apple.keynote": ["key"],
103
+ "application/vnd.apple.mpegurl": ["m3u8"],
104
+ "application/vnd.apple.numbers": ["numbers"],
105
+ "application/vnd.apple.pages": ["pages"],
106
+ "application/vnd.apple.pkpass": ["pkpass"],
107
+ "application/vnd.aristanetworks.swi": ["swi"],
108
+ "application/vnd.astraea-software.iota": ["iota"],
109
+ "application/vnd.audiograph": ["aep"],
110
+ "application/vnd.autodesk.fbx": ["fbx"],
111
+ "application/vnd.balsamiq.bmml+xml": ["bmml"],
112
+ "application/vnd.blueice.multipass": ["mpm"],
113
+ "application/vnd.bmi": ["bmi"],
114
+ "application/vnd.businessobjects": ["rep"],
115
+ "application/vnd.chemdraw+xml": ["cdxml"],
116
+ "application/vnd.chipnuts.karaoke-mmd": ["mmd"],
117
+ "application/vnd.cinderella": ["cdy"],
118
+ "application/vnd.citationstyles.style+xml": ["csl"],
119
+ "application/vnd.claymore": ["cla"],
120
+ "application/vnd.cloanto.rp9": ["rp9"],
121
+ "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"],
122
+ "application/vnd.cluetrust.cartomobile-config": ["c11amc"],
123
+ "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"],
124
+ "application/vnd.commonspace": ["csp"],
125
+ "application/vnd.contact.cmsg": ["cdbcmsg"],
126
+ "application/vnd.cosmocaller": ["cmc"],
127
+ "application/vnd.crick.clicker": ["clkx"],
128
+ "application/vnd.crick.clicker.keyboard": ["clkk"],
129
+ "application/vnd.crick.clicker.palette": ["clkp"],
130
+ "application/vnd.crick.clicker.template": ["clkt"],
131
+ "application/vnd.crick.clicker.wordbank": ["clkw"],
132
+ "application/vnd.criticaltools.wbs+xml": ["wbs"],
133
+ "application/vnd.ctc-posml": ["pml"],
134
+ "application/vnd.cups-ppd": ["ppd"],
135
+ "application/vnd.curl.car": ["car"],
136
+ "application/vnd.curl.pcurl": ["pcurl"],
137
+ "application/vnd.dart": ["dart"],
138
+ "application/vnd.data-vision.rdz": ["rdz"],
139
+ "application/vnd.dbf": ["dbf"],
140
+ "application/vnd.dcmp+xml": ["dcmp"],
141
+ "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"],
142
+ "application/vnd.dece.ttml+xml": ["uvt", "uvvt"],
143
+ "application/vnd.dece.unspecified": ["uvx", "uvvx"],
144
+ "application/vnd.dece.zip": ["uvz", "uvvz"],
145
+ "application/vnd.denovo.fcselayout-link": ["fe_launch"],
146
+ "application/vnd.dna": ["dna"],
147
+ "application/vnd.dolby.mlp": ["mlp"],
148
+ "application/vnd.dpgraph": ["dpg"],
149
+ "application/vnd.dreamfactory": ["dfac"],
150
+ "application/vnd.ds-keypoint": ["kpxx"],
151
+ "application/vnd.dvb.ait": ["ait"],
152
+ "application/vnd.dvb.service": ["svc"],
153
+ "application/vnd.dynageo": ["geo"],
154
+ "application/vnd.ecowin.chart": ["mag"],
155
+ "application/vnd.enliven": ["nml"],
156
+ "application/vnd.epson.esf": ["esf"],
157
+ "application/vnd.epson.msf": ["msf"],
158
+ "application/vnd.epson.quickanime": ["qam"],
159
+ "application/vnd.epson.salt": ["slt"],
160
+ "application/vnd.epson.ssf": ["ssf"],
161
+ "application/vnd.eszigno3+xml": ["es3", "et3"],
162
+ "application/vnd.ezpix-album": ["ez2"],
163
+ "application/vnd.ezpix-package": ["ez3"],
164
+ "application/vnd.fdf": ["*fdf"],
165
+ "application/vnd.fdsn.mseed": ["mseed"],
166
+ "application/vnd.fdsn.seed": ["seed", "dataless"],
167
+ "application/vnd.flographit": ["gph"],
168
+ "application/vnd.fluxtime.clip": ["ftc"],
169
+ "application/vnd.framemaker": ["fm", "frame", "maker", "book"],
170
+ "application/vnd.frogans.fnc": ["fnc"],
171
+ "application/vnd.frogans.ltf": ["ltf"],
172
+ "application/vnd.fsc.weblaunch": ["fsc"],
173
+ "application/vnd.fujitsu.oasys": ["oas"],
174
+ "application/vnd.fujitsu.oasys2": ["oa2"],
175
+ "application/vnd.fujitsu.oasys3": ["oa3"],
176
+ "application/vnd.fujitsu.oasysgp": ["fg5"],
177
+ "application/vnd.fujitsu.oasysprs": ["bh2"],
178
+ "application/vnd.fujixerox.ddd": ["ddd"],
179
+ "application/vnd.fujixerox.docuworks": ["xdw"],
180
+ "application/vnd.fujixerox.docuworks.binder": ["xbd"],
181
+ "application/vnd.fuzzysheet": ["fzs"],
182
+ "application/vnd.genomatix.tuxedo": ["txd"],
183
+ "application/vnd.geogebra.file": ["ggb"],
184
+ "application/vnd.geogebra.slides": ["ggs"],
185
+ "application/vnd.geogebra.tool": ["ggt"],
186
+ "application/vnd.geometry-explorer": ["gex", "gre"],
187
+ "application/vnd.geonext": ["gxt"],
188
+ "application/vnd.geoplan": ["g2w"],
189
+ "application/vnd.geospace": ["g3w"],
190
+ "application/vnd.gmx": ["gmx"],
191
+ "application/vnd.google-apps.document": ["gdoc"],
192
+ "application/vnd.google-apps.drawing": ["gdraw"],
193
+ "application/vnd.google-apps.form": ["gform"],
194
+ "application/vnd.google-apps.jam": ["gjam"],
195
+ "application/vnd.google-apps.map": ["gmap"],
196
+ "application/vnd.google-apps.presentation": ["gslides"],
197
+ "application/vnd.google-apps.script": ["gscript"],
198
+ "application/vnd.google-apps.site": ["gsite"],
199
+ "application/vnd.google-apps.spreadsheet": ["gsheet"],
200
+ "application/vnd.google-earth.kml+xml": ["kml"],
201
+ "application/vnd.google-earth.kmz": ["kmz"],
202
+ "application/vnd.gov.sk.xmldatacontainer+xml": ["xdcf"],
203
+ "application/vnd.grafeq": ["gqf", "gqs"],
204
+ "application/vnd.groove-account": ["gac"],
205
+ "application/vnd.groove-help": ["ghf"],
206
+ "application/vnd.groove-identity-message": ["gim"],
207
+ "application/vnd.groove-injector": ["grv"],
208
+ "application/vnd.groove-tool-message": ["gtm"],
209
+ "application/vnd.groove-tool-template": ["tpl"],
210
+ "application/vnd.groove-vcard": ["vcg"],
211
+ "application/vnd.hal+xml": ["hal"],
212
+ "application/vnd.handheld-entertainment+xml": ["zmm"],
213
+ "application/vnd.hbci": ["hbci"],
214
+ "application/vnd.hhe.lesson-player": ["les"],
215
+ "application/vnd.hp-hpgl": ["hpgl"],
216
+ "application/vnd.hp-hpid": ["hpid"],
217
+ "application/vnd.hp-hps": ["hps"],
218
+ "application/vnd.hp-jlyt": ["jlt"],
219
+ "application/vnd.hp-pcl": ["pcl"],
220
+ "application/vnd.hp-pclxl": ["pclxl"],
221
+ "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"],
222
+ "application/vnd.ibm.minipay": ["mpy"],
223
+ "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"],
224
+ "application/vnd.ibm.rights-management": ["irm"],
225
+ "application/vnd.ibm.secure-container": ["sc"],
226
+ "application/vnd.iccprofile": ["icc", "icm"],
227
+ "application/vnd.igloader": ["igl"],
228
+ "application/vnd.immervision-ivp": ["ivp"],
229
+ "application/vnd.immervision-ivu": ["ivu"],
230
+ "application/vnd.insors.igm": ["igm"],
231
+ "application/vnd.intercon.formnet": ["xpw", "xpx"],
232
+ "application/vnd.intergeo": ["i2g"],
233
+ "application/vnd.intu.qbo": ["qbo"],
234
+ "application/vnd.intu.qfx": ["qfx"],
235
+ "application/vnd.ipunplugged.rcprofile": ["rcprofile"],
236
+ "application/vnd.irepository.package+xml": ["irp"],
237
+ "application/vnd.is-xpr": ["xpr"],
238
+ "application/vnd.isac.fcs": ["fcs"],
239
+ "application/vnd.jam": ["jam"],
240
+ "application/vnd.jcp.javame.midlet-rms": ["rms"],
241
+ "application/vnd.jisp": ["jisp"],
242
+ "application/vnd.joost.joda-archive": ["joda"],
243
+ "application/vnd.kahootz": ["ktz", "ktr"],
244
+ "application/vnd.kde.karbon": ["karbon"],
245
+ "application/vnd.kde.kchart": ["chrt"],
246
+ "application/vnd.kde.kformula": ["kfo"],
247
+ "application/vnd.kde.kivio": ["flw"],
248
+ "application/vnd.kde.kontour": ["kon"],
249
+ "application/vnd.kde.kpresenter": ["kpr", "kpt"],
250
+ "application/vnd.kde.kspread": ["ksp"],
251
+ "application/vnd.kde.kword": ["kwd", "kwt"],
252
+ "application/vnd.kenameaapp": ["htke"],
253
+ "application/vnd.kidspiration": ["kia"],
254
+ "application/vnd.kinar": ["kne", "knp"],
255
+ "application/vnd.koan": ["skp", "skd", "skt", "skm"],
256
+ "application/vnd.kodak-descriptor": ["sse"],
257
+ "application/vnd.las.las+xml": ["lasxml"],
258
+ "application/vnd.llamagraphics.life-balance.desktop": ["lbd"],
259
+ "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"],
260
+ "application/vnd.lotus-1-2-3": ["123"],
261
+ "application/vnd.lotus-approach": ["apr"],
262
+ "application/vnd.lotus-freelance": ["pre"],
263
+ "application/vnd.lotus-notes": ["nsf"],
264
+ "application/vnd.lotus-organizer": ["org"],
265
+ "application/vnd.lotus-screencam": ["scm"],
266
+ "application/vnd.lotus-wordpro": ["lwp"],
267
+ "application/vnd.macports.portpkg": ["portpkg"],
268
+ "application/vnd.mapbox-vector-tile": ["mvt"],
269
+ "application/vnd.mcd": ["mcd"],
270
+ "application/vnd.medcalcdata": ["mc1"],
271
+ "application/vnd.mediastation.cdkey": ["cdkey"],
272
+ "application/vnd.mfer": ["mwf"],
273
+ "application/vnd.mfmp": ["mfm"],
274
+ "application/vnd.micrografx.flo": ["flo"],
275
+ "application/vnd.micrografx.igx": ["igx"],
276
+ "application/vnd.mif": ["mif"],
277
+ "application/vnd.mobius.daf": ["daf"],
278
+ "application/vnd.mobius.dis": ["dis"],
279
+ "application/vnd.mobius.mbk": ["mbk"],
280
+ "application/vnd.mobius.mqy": ["mqy"],
281
+ "application/vnd.mobius.msl": ["msl"],
282
+ "application/vnd.mobius.plc": ["plc"],
283
+ "application/vnd.mobius.txf": ["txf"],
284
+ "application/vnd.mophun.application": ["mpn"],
285
+ "application/vnd.mophun.certificate": ["mpc"],
286
+ "application/vnd.mozilla.xul+xml": ["xul"],
287
+ "application/vnd.ms-artgalry": ["cil"],
288
+ "application/vnd.ms-cab-compressed": ["cab"],
289
+ "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"],
290
+ "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"],
291
+ "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"],
292
+ "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"],
293
+ "application/vnd.ms-excel.template.macroenabled.12": ["xltm"],
294
+ "application/vnd.ms-fontobject": ["eot"],
295
+ "application/vnd.ms-htmlhelp": ["chm"],
296
+ "application/vnd.ms-ims": ["ims"],
297
+ "application/vnd.ms-lrm": ["lrm"],
298
+ "application/vnd.ms-officetheme": ["thmx"],
299
+ "application/vnd.ms-outlook": ["msg"],
300
+ "application/vnd.ms-pki.seccat": ["cat"],
301
+ "application/vnd.ms-pki.stl": ["*stl"],
302
+ "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"],
303
+ "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"],
304
+ "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"],
305
+ "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"],
306
+ "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"],
307
+ "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"],
308
+ "application/vnd.ms-project": ["*mpp", "mpt"],
309
+ "application/vnd.ms-visio.viewer": ["vdx"],
310
+ "application/vnd.ms-word.document.macroenabled.12": ["docm"],
311
+ "application/vnd.ms-word.template.macroenabled.12": ["dotm"],
312
+ "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"],
313
+ "application/vnd.ms-wpl": ["wpl"],
314
+ "application/vnd.ms-xpsdocument": ["xps"],
315
+ "application/vnd.mseq": ["mseq"],
316
+ "application/vnd.musician": ["mus"],
317
+ "application/vnd.muvee.style": ["msty"],
318
+ "application/vnd.mynfc": ["taglet"],
319
+ "application/vnd.nato.bindingdataobject+xml": ["bdo"],
320
+ "application/vnd.neurolanguage.nlu": ["nlu"],
321
+ "application/vnd.nitf": ["ntf", "nitf"],
322
+ "application/vnd.noblenet-directory": ["nnd"],
323
+ "application/vnd.noblenet-sealer": ["nns"],
324
+ "application/vnd.noblenet-web": ["nnw"],
325
+ "application/vnd.nokia.n-gage.ac+xml": ["*ac"],
326
+ "application/vnd.nokia.n-gage.data": ["ngdat"],
327
+ "application/vnd.nokia.n-gage.symbian.install": ["n-gage"],
328
+ "application/vnd.nokia.radio-preset": ["rpst"],
329
+ "application/vnd.nokia.radio-presets": ["rpss"],
330
+ "application/vnd.novadigm.edm": ["edm"],
331
+ "application/vnd.novadigm.edx": ["edx"],
332
+ "application/vnd.novadigm.ext": ["ext"],
333
+ "application/vnd.oasis.opendocument.chart": ["odc"],
334
+ "application/vnd.oasis.opendocument.chart-template": ["otc"],
335
+ "application/vnd.oasis.opendocument.database": ["odb"],
336
+ "application/vnd.oasis.opendocument.formula": ["odf"],
337
+ "application/vnd.oasis.opendocument.formula-template": ["odft"],
338
+ "application/vnd.oasis.opendocument.graphics": ["odg"],
339
+ "application/vnd.oasis.opendocument.graphics-template": ["otg"],
340
+ "application/vnd.oasis.opendocument.image": ["odi"],
341
+ "application/vnd.oasis.opendocument.image-template": ["oti"],
342
+ "application/vnd.oasis.opendocument.presentation": ["odp"],
343
+ "application/vnd.oasis.opendocument.presentation-template": ["otp"],
344
+ "application/vnd.oasis.opendocument.spreadsheet": ["ods"],
345
+ "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"],
346
+ "application/vnd.oasis.opendocument.text": ["odt"],
347
+ "application/vnd.oasis.opendocument.text-master": ["odm"],
348
+ "application/vnd.oasis.opendocument.text-template": ["ott"],
349
+ "application/vnd.oasis.opendocument.text-web": ["oth"],
350
+ "application/vnd.olpc-sugar": ["xo"],
351
+ "application/vnd.oma.dd2+xml": ["dd2"],
352
+ "application/vnd.openblox.game+xml": ["obgx"],
353
+ "application/vnd.openofficeorg.extension": ["oxt"],
354
+ "application/vnd.openstreetmap.data+xml": ["osm"],
355
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation": [
356
+ "pptx"
357
+ ],
358
+ "application/vnd.openxmlformats-officedocument.presentationml.slide": [
359
+ "sldx"
360
+ ],
361
+ "application/vnd.openxmlformats-officedocument.presentationml.slideshow": [
362
+ "ppsx"
363
+ ],
364
+ "application/vnd.openxmlformats-officedocument.presentationml.template": [
365
+ "potx"
366
+ ],
367
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"],
368
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template": [
369
+ "xltx"
370
+ ],
371
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [
372
+ "docx"
373
+ ],
374
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template": [
375
+ "dotx"
376
+ ],
377
+ "application/vnd.osgeo.mapguide.package": ["mgp"],
378
+ "application/vnd.osgi.dp": ["dp"],
379
+ "application/vnd.osgi.subsystem": ["esa"],
380
+ "application/vnd.palm": ["pdb", "pqa", "oprc"],
381
+ "application/vnd.pawaafile": ["paw"],
382
+ "application/vnd.pg.format": ["str"],
383
+ "application/vnd.pg.osasli": ["ei6"],
384
+ "application/vnd.picsel": ["efif"],
385
+ "application/vnd.pmi.widget": ["wg"],
386
+ "application/vnd.pocketlearn": ["plf"],
387
+ "application/vnd.powerbuilder6": ["pbd"],
388
+ "application/vnd.previewsystems.box": ["box"],
389
+ "application/vnd.procrate.brushset": ["brushset"],
390
+ "application/vnd.procreate.brush": ["brush"],
391
+ "application/vnd.procreate.dream": ["drm"],
392
+ "application/vnd.proteus.magazine": ["mgz"],
393
+ "application/vnd.publishare-delta-tree": ["qps"],
394
+ "application/vnd.pvi.ptid1": ["ptid"],
395
+ "application/vnd.pwg-xhtml-print+xml": ["xhtm"],
396
+ "application/vnd.quark.quarkxpress": [
397
+ "qxd",
398
+ "qxt",
399
+ "qwd",
400
+ "qwt",
401
+ "qxl",
402
+ "qxb"
403
+ ],
404
+ "application/vnd.rar": ["rar"],
405
+ "application/vnd.realvnc.bed": ["bed"],
406
+ "application/vnd.recordare.musicxml": ["mxl"],
407
+ "application/vnd.recordare.musicxml+xml": ["musicxml"],
408
+ "application/vnd.rig.cryptonote": ["cryptonote"],
409
+ "application/vnd.rim.cod": ["cod"],
410
+ "application/vnd.rn-realmedia": ["rm"],
411
+ "application/vnd.rn-realmedia-vbr": ["rmvb"],
412
+ "application/vnd.route66.link66+xml": ["link66"],
413
+ "application/vnd.sailingtracker.track": ["st"],
414
+ "application/vnd.seemail": ["see"],
415
+ "application/vnd.sema": ["sema"],
416
+ "application/vnd.semd": ["semd"],
417
+ "application/vnd.semf": ["semf"],
418
+ "application/vnd.shana.informed.formdata": ["ifm"],
419
+ "application/vnd.shana.informed.formtemplate": ["itp"],
420
+ "application/vnd.shana.informed.interchange": ["iif"],
421
+ "application/vnd.shana.informed.package": ["ipk"],
422
+ "application/vnd.simtech-mindmapper": ["twd", "twds"],
423
+ "application/vnd.smaf": ["mmf"],
424
+ "application/vnd.smart.teacher": ["teacher"],
425
+ "application/vnd.software602.filler.form+xml": ["fo"],
426
+ "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"],
427
+ "application/vnd.spotfire.dxp": ["dxp"],
428
+ "application/vnd.spotfire.sfs": ["sfs"],
429
+ "application/vnd.stardivision.calc": ["sdc"],
430
+ "application/vnd.stardivision.draw": ["sda"],
431
+ "application/vnd.stardivision.impress": ["sdd"],
432
+ "application/vnd.stardivision.math": ["smf"],
433
+ "application/vnd.stardivision.writer": ["sdw", "vor"],
434
+ "application/vnd.stardivision.writer-global": ["sgl"],
435
+ "application/vnd.stepmania.package": ["smzip"],
436
+ "application/vnd.stepmania.stepchart": ["sm"],
437
+ "application/vnd.sun.wadl+xml": ["wadl"],
438
+ "application/vnd.sun.xml.calc": ["sxc"],
439
+ "application/vnd.sun.xml.calc.template": ["stc"],
440
+ "application/vnd.sun.xml.draw": ["sxd"],
441
+ "application/vnd.sun.xml.draw.template": ["std"],
442
+ "application/vnd.sun.xml.impress": ["sxi"],
443
+ "application/vnd.sun.xml.impress.template": ["sti"],
444
+ "application/vnd.sun.xml.math": ["sxm"],
445
+ "application/vnd.sun.xml.writer": ["sxw"],
446
+ "application/vnd.sun.xml.writer.global": ["sxg"],
447
+ "application/vnd.sun.xml.writer.template": ["stw"],
448
+ "application/vnd.sus-calendar": ["sus", "susp"],
449
+ "application/vnd.svd": ["svd"],
450
+ "application/vnd.symbian.install": ["sis", "sisx"],
451
+ "application/vnd.syncml+xml": ["xsm"],
452
+ "application/vnd.syncml.dm+wbxml": ["bdm"],
453
+ "application/vnd.syncml.dm+xml": ["xdm"],
454
+ "application/vnd.syncml.dmddf+xml": ["ddf"],
455
+ "application/vnd.tao.intent-module-archive": ["tao"],
456
+ "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"],
457
+ "application/vnd.tmobile-livetv": ["tmo"],
458
+ "application/vnd.trid.tpt": ["tpt"],
459
+ "application/vnd.triscape.mxs": ["mxs"],
460
+ "application/vnd.trueapp": ["tra"],
461
+ "application/vnd.ufdl": ["ufd", "ufdl"],
462
+ "application/vnd.uiq.theme": ["utz"],
463
+ "application/vnd.umajin": ["umj"],
464
+ "application/vnd.unity": ["unityweb"],
465
+ "application/vnd.uoml+xml": ["uoml", "uo"],
466
+ "application/vnd.vcx": ["vcx"],
467
+ "application/vnd.visio": ["vsd", "vst", "vss", "vsw", "vsdx", "vtx"],
468
+ "application/vnd.visionary": ["vis"],
469
+ "application/vnd.vsf": ["vsf"],
470
+ "application/vnd.wap.wbxml": ["wbxml"],
471
+ "application/vnd.wap.wmlc": ["wmlc"],
472
+ "application/vnd.wap.wmlscriptc": ["wmlsc"],
473
+ "application/vnd.webturbo": ["wtb"],
474
+ "application/vnd.wolfram.player": ["nbp"],
475
+ "application/vnd.wordperfect": ["wpd"],
476
+ "application/vnd.wqd": ["wqd"],
477
+ "application/vnd.wt.stf": ["stf"],
478
+ "application/vnd.xara": ["xar"],
479
+ "application/vnd.xfdl": ["xfdl"],
480
+ "application/vnd.yamaha.hv-dic": ["hvd"],
481
+ "application/vnd.yamaha.hv-script": ["hvs"],
482
+ "application/vnd.yamaha.hv-voice": ["hvp"],
483
+ "application/vnd.yamaha.openscoreformat": ["osf"],
484
+ "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"],
485
+ "application/vnd.yamaha.smaf-audio": ["saf"],
486
+ "application/vnd.yamaha.smaf-phrase": ["spf"],
487
+ "application/vnd.yellowriver-custom-menu": ["cmp"],
488
+ "application/vnd.zul": ["zir", "zirz"],
489
+ "application/vnd.zzazz.deck+xml": ["zaz"],
490
+ "application/x-7z-compressed": ["7z"],
491
+ "application/x-abiword": ["abw"],
492
+ "application/x-ace-compressed": ["ace"],
493
+ "application/x-apple-diskimage": ["*dmg"],
494
+ "application/x-arj": ["arj"],
495
+ "application/x-authorware-bin": ["aab", "x32", "u32", "vox"],
496
+ "application/x-authorware-map": ["aam"],
497
+ "application/x-authorware-seg": ["aas"],
498
+ "application/x-bcpio": ["bcpio"],
499
+ "application/x-bdoc": ["*bdoc"],
500
+ "application/x-bittorrent": ["torrent"],
501
+ "application/x-blender": ["blend"],
502
+ "application/x-blorb": ["blb", "blorb"],
503
+ "application/x-bzip": ["bz"],
504
+ "application/x-bzip2": ["bz2", "boz"],
505
+ "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"],
506
+ "application/x-cdlink": ["vcd"],
507
+ "application/x-cfs-compressed": ["cfs"],
508
+ "application/x-chat": ["chat"],
509
+ "application/x-chess-pgn": ["pgn"],
510
+ "application/x-chrome-extension": ["crx"],
511
+ "application/x-cocoa": ["cco"],
512
+ "application/x-compressed": ["*rar"],
513
+ "application/x-conference": ["nsc"],
514
+ "application/x-cpio": ["cpio"],
515
+ "application/x-csh": ["csh"],
516
+ "application/x-debian-package": ["*deb", "udeb"],
517
+ "application/x-dgc-compressed": ["dgc"],
518
+ "application/x-director": [
519
+ "dir",
520
+ "dcr",
521
+ "dxr",
522
+ "cst",
523
+ "cct",
524
+ "cxt",
525
+ "w3d",
526
+ "fgd",
527
+ "swa"
528
+ ],
529
+ "application/x-doom": ["wad"],
530
+ "application/x-dtbncx+xml": ["ncx"],
531
+ "application/x-dtbook+xml": ["dtb"],
532
+ "application/x-dtbresource+xml": ["res"],
533
+ "application/x-dvi": ["dvi"],
534
+ "application/x-envoy": ["evy"],
535
+ "application/x-eva": ["eva"],
536
+ "application/x-font-bdf": ["bdf"],
537
+ "application/x-font-ghostscript": ["gsf"],
538
+ "application/x-font-linux-psf": ["psf"],
539
+ "application/x-font-pcf": ["pcf"],
540
+ "application/x-font-snf": ["snf"],
541
+ "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"],
542
+ "application/x-freearc": ["arc"],
543
+ "application/x-futuresplash": ["spl"],
544
+ "application/x-gca-compressed": ["gca"],
545
+ "application/x-glulx": ["ulx"],
546
+ "application/x-gnumeric": ["gnumeric"],
547
+ "application/x-gramps-xml": ["gramps"],
548
+ "application/x-gtar": ["gtar"],
549
+ "application/x-hdf": ["hdf"],
550
+ "application/x-httpd-php": ["php"],
551
+ "application/x-install-instructions": ["install"],
552
+ "application/x-ipynb+json": ["ipynb"],
553
+ "application/x-iso9660-image": ["*iso"],
554
+ "application/x-iwork-keynote-sffkey": ["*key"],
555
+ "application/x-iwork-numbers-sffnumbers": ["*numbers"],
556
+ "application/x-iwork-pages-sffpages": ["*pages"],
557
+ "application/x-java-archive-diff": ["jardiff"],
558
+ "application/x-java-jnlp-file": ["jnlp"],
559
+ "application/x-keepass2": ["kdbx"],
560
+ "application/x-latex": ["latex"],
561
+ "application/x-lua-bytecode": ["luac"],
562
+ "application/x-lzh-compressed": ["lzh", "lha"],
563
+ "application/x-makeself": ["run"],
564
+ "application/x-mie": ["mie"],
565
+ "application/x-mobipocket-ebook": ["*prc", "mobi"],
566
+ "application/x-ms-application": ["application"],
567
+ "application/x-ms-shortcut": ["lnk"],
568
+ "application/x-ms-wmd": ["wmd"],
569
+ "application/x-ms-wmz": ["wmz"],
570
+ "application/x-ms-xbap": ["xbap"],
571
+ "application/x-msaccess": ["mdb"],
572
+ "application/x-msbinder": ["obd"],
573
+ "application/x-mscardfile": ["crd"],
574
+ "application/x-msclip": ["clp"],
575
+ "application/x-msdos-program": ["*exe"],
576
+ "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"],
577
+ "application/x-msmediaview": ["mvb", "m13", "m14"],
578
+ "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"],
579
+ "application/x-msmoney": ["mny"],
580
+ "application/x-mspublisher": ["pub"],
581
+ "application/x-msschedule": ["scd"],
582
+ "application/x-msterminal": ["trm"],
583
+ "application/x-mswrite": ["wri"],
584
+ "application/x-netcdf": ["nc", "cdf"],
585
+ "application/x-ns-proxy-autoconfig": ["pac"],
586
+ "application/x-nzb": ["nzb"],
587
+ "application/x-perl": ["pl", "pm"],
588
+ "application/x-pilot": ["*prc", "*pdb"],
589
+ "application/x-pkcs12": ["p12", "pfx"],
590
+ "application/x-pkcs7-certificates": ["p7b", "spc"],
591
+ "application/x-pkcs7-certreqresp": ["p7r"],
592
+ "application/x-rar-compressed": ["*rar"],
593
+ "application/x-redhat-package-manager": ["rpm"],
594
+ "application/x-research-info-systems": ["ris"],
595
+ "application/x-sea": ["sea"],
596
+ "application/x-sh": ["sh"],
597
+ "application/x-shar": ["shar"],
598
+ "application/x-shockwave-flash": ["swf"],
599
+ "application/x-silverlight-app": ["xap"],
600
+ "application/x-sql": ["*sql"],
601
+ "application/x-stuffit": ["sit"],
602
+ "application/x-stuffitx": ["sitx"],
603
+ "application/x-subrip": ["srt"],
604
+ "application/x-sv4cpio": ["sv4cpio"],
605
+ "application/x-sv4crc": ["sv4crc"],
606
+ "application/x-t3vm-image": ["t3"],
607
+ "application/x-tads": ["gam"],
608
+ "application/x-tar": ["tar"],
609
+ "application/x-tcl": ["tcl", "tk"],
610
+ "application/x-tex": ["tex"],
611
+ "application/x-tex-tfm": ["tfm"],
612
+ "application/x-texinfo": ["texinfo", "texi"],
613
+ "application/x-tgif": ["*obj"],
614
+ "application/x-ustar": ["ustar"],
615
+ "application/x-virtualbox-hdd": ["hdd"],
616
+ "application/x-virtualbox-ova": ["ova"],
617
+ "application/x-virtualbox-ovf": ["ovf"],
618
+ "application/x-virtualbox-vbox": ["vbox"],
619
+ "application/x-virtualbox-vbox-extpack": ["vbox-extpack"],
620
+ "application/x-virtualbox-vdi": ["vdi"],
621
+ "application/x-virtualbox-vhd": ["vhd"],
622
+ "application/x-virtualbox-vmdk": ["vmdk"],
623
+ "application/x-wais-source": ["src"],
624
+ "application/x-web-app-manifest+json": ["webapp"],
625
+ "application/x-x509-ca-cert": ["der", "crt", "pem"],
626
+ "application/x-xfig": ["fig"],
627
+ "application/x-xliff+xml": ["*xlf"],
628
+ "application/x-xpinstall": ["xpi"],
629
+ "application/x-xz": ["xz"],
630
+ "application/x-zip-compressed": ["*zip"],
631
+ "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"],
632
+ "audio/vnd.dece.audio": ["uva", "uvva"],
633
+ "audio/vnd.digital-winds": ["eol"],
634
+ "audio/vnd.dra": ["dra"],
635
+ "audio/vnd.dts": ["dts"],
636
+ "audio/vnd.dts.hd": ["dtshd"],
637
+ "audio/vnd.lucent.voice": ["lvp"],
638
+ "audio/vnd.ms-playready.media.pya": ["pya"],
639
+ "audio/vnd.nuera.ecelp4800": ["ecelp4800"],
640
+ "audio/vnd.nuera.ecelp7470": ["ecelp7470"],
641
+ "audio/vnd.nuera.ecelp9600": ["ecelp9600"],
642
+ "audio/vnd.rip": ["rip"],
643
+ "audio/x-aac": ["*aac"],
644
+ "audio/x-aiff": ["aif", "aiff", "aifc"],
645
+ "audio/x-caf": ["caf"],
646
+ "audio/x-flac": ["flac"],
647
+ "audio/x-m4a": ["*m4a"],
648
+ "audio/x-matroska": ["mka"],
649
+ "audio/x-mpegurl": ["m3u"],
650
+ "audio/x-ms-wax": ["wax"],
651
+ "audio/x-ms-wma": ["wma"],
652
+ "audio/x-pn-realaudio": ["ram", "ra"],
653
+ "audio/x-pn-realaudio-plugin": ["rmp"],
654
+ "audio/x-realaudio": ["*ra"],
655
+ "audio/x-wav": ["*wav"],
656
+ "chemical/x-cdx": ["cdx"],
657
+ "chemical/x-cif": ["cif"],
658
+ "chemical/x-cmdf": ["cmdf"],
659
+ "chemical/x-cml": ["cml"],
660
+ "chemical/x-csml": ["csml"],
661
+ "chemical/x-xyz": ["xyz"],
662
+ "image/prs.btif": ["btif", "btf"],
663
+ "image/prs.pti": ["pti"],
664
+ "image/vnd.adobe.photoshop": ["psd"],
665
+ "image/vnd.airzip.accelerator.azv": ["azv"],
666
+ "image/vnd.blockfact.facti": ["facti"],
667
+ "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"],
668
+ "image/vnd.djvu": ["djvu", "djv"],
669
+ "image/vnd.dvb.subtitle": ["*sub"],
670
+ "image/vnd.dwg": ["dwg"],
671
+ "image/vnd.dxf": ["dxf"],
672
+ "image/vnd.fastbidsheet": ["fbs"],
673
+ "image/vnd.fpx": ["fpx"],
674
+ "image/vnd.fst": ["fst"],
675
+ "image/vnd.fujixerox.edmics-mmr": ["mmr"],
676
+ "image/vnd.fujixerox.edmics-rlc": ["rlc"],
677
+ "image/vnd.microsoft.icon": ["ico"],
678
+ "image/vnd.ms-dds": ["dds"],
679
+ "image/vnd.ms-modi": ["mdi"],
680
+ "image/vnd.ms-photo": ["wdp"],
681
+ "image/vnd.net-fpx": ["npx"],
682
+ "image/vnd.pco.b16": ["b16"],
683
+ "image/vnd.tencent.tap": ["tap"],
684
+ "image/vnd.valve.source.texture": ["vtf"],
685
+ "image/vnd.wap.wbmp": ["wbmp"],
686
+ "image/vnd.xiff": ["xif"],
687
+ "image/vnd.zbrush.pcx": ["pcx"],
688
+ "image/x-3ds": ["3ds"],
689
+ "image/x-adobe-dng": ["dng"],
690
+ "image/x-cmu-raster": ["ras"],
691
+ "image/x-cmx": ["cmx"],
692
+ "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"],
693
+ "image/x-icon": ["*ico"],
694
+ "image/x-jng": ["jng"],
695
+ "image/x-mrsid-image": ["sid"],
696
+ "image/x-ms-bmp": ["*bmp"],
697
+ "image/x-pcx": ["*pcx"],
698
+ "image/x-pict": ["pic", "pct"],
699
+ "image/x-portable-anymap": ["pnm"],
700
+ "image/x-portable-bitmap": ["pbm"],
701
+ "image/x-portable-graymap": ["pgm"],
702
+ "image/x-portable-pixmap": ["ppm"],
703
+ "image/x-rgb": ["rgb"],
704
+ "image/x-tga": ["tga"],
705
+ "image/x-xbitmap": ["xbm"],
706
+ "image/x-xpixmap": ["xpm"],
707
+ "image/x-xwindowdump": ["xwd"],
708
+ "message/vnd.wfa.wsc": ["wsc"],
709
+ "model/vnd.bary": ["bary"],
710
+ "model/vnd.cld": ["cld"],
711
+ "model/vnd.collada+xml": ["dae"],
712
+ "model/vnd.dwf": ["dwf"],
713
+ "model/vnd.gdl": ["gdl"],
714
+ "model/vnd.gtw": ["gtw"],
715
+ "model/vnd.mts": ["*mts"],
716
+ "model/vnd.opengex": ["ogex"],
717
+ "model/vnd.parasolid.transmit.binary": ["x_b"],
718
+ "model/vnd.parasolid.transmit.text": ["x_t"],
719
+ "model/vnd.pytha.pyox": ["pyo", "pyox"],
720
+ "model/vnd.sap.vds": ["vds"],
721
+ "model/vnd.usda": ["usda"],
722
+ "model/vnd.usdz+zip": ["usdz"],
723
+ "model/vnd.valve.source.compiled-map": ["bsp"],
724
+ "model/vnd.vtu": ["vtu"],
725
+ "text/prs.lines.tag": ["dsc"],
726
+ "text/vnd.curl": ["curl"],
727
+ "text/vnd.curl.dcurl": ["dcurl"],
728
+ "text/vnd.curl.mcurl": ["mcurl"],
729
+ "text/vnd.curl.scurl": ["scurl"],
730
+ "text/vnd.dvb.subtitle": ["sub"],
731
+ "text/vnd.familysearch.gedcom": ["ged"],
732
+ "text/vnd.fly": ["fly"],
733
+ "text/vnd.fmi.flexstor": ["flx"],
734
+ "text/vnd.graphviz": ["gv"],
735
+ "text/vnd.in3d.3dml": ["3dml"],
736
+ "text/vnd.in3d.spot": ["spot"],
737
+ "text/vnd.sun.j2me.app-descriptor": ["jad"],
738
+ "text/vnd.wap.wml": ["wml"],
739
+ "text/vnd.wap.wmlscript": ["wmls"],
740
+ "text/x-asm": ["s", "asm"],
741
+ "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"],
742
+ "text/x-component": ["htc"],
743
+ "text/x-fortran": ["f", "for", "f77", "f90"],
744
+ "text/x-handlebars-template": ["hbs"],
745
+ "text/x-java-source": ["java"],
746
+ "text/x-lua": ["lua"],
747
+ "text/x-markdown": ["mkd"],
748
+ "text/x-nfo": ["nfo"],
749
+ "text/x-opml": ["opml"],
750
+ "text/x-org": ["*org"],
751
+ "text/x-pascal": ["p", "pas"],
752
+ "text/x-processing": ["pde"],
753
+ "text/x-sass": ["sass"],
754
+ "text/x-scss": ["scss"],
755
+ "text/x-setext": ["etx"],
756
+ "text/x-sfv": ["sfv"],
757
+ "text/x-suse-ymp": ["ymp"],
758
+ "text/x-uuencode": ["uu"],
759
+ "text/x-vcalendar": ["vcs"],
760
+ "text/x-vcard": ["vcf"],
761
+ "video/vnd.dece.hd": ["uvh", "uvvh"],
762
+ "video/vnd.dece.mobile": ["uvm", "uvvm"],
763
+ "video/vnd.dece.pd": ["uvp", "uvvp"],
764
+ "video/vnd.dece.sd": ["uvs", "uvvs"],
765
+ "video/vnd.dece.video": ["uvv", "uvvv"],
766
+ "video/vnd.dvb.file": ["dvb"],
767
+ "video/vnd.fvt": ["fvt"],
768
+ "video/vnd.mpegurl": ["mxu", "m4u"],
769
+ "video/vnd.ms-playready.media.pyv": ["pyv"],
770
+ "video/vnd.uvvu.mp4": ["uvu", "uvvu"],
771
+ "video/vnd.vivo": ["viv"],
772
+ "video/x-f4v": ["f4v"],
773
+ "video/x-fli": ["fli"],
774
+ "video/x-flv": ["flv"],
775
+ "video/x-m4v": ["m4v"],
776
+ "video/x-matroska": ["mkv", "mk3d", "mks"],
777
+ "video/x-mng": ["mng"],
778
+ "video/x-ms-asf": ["asf", "asx"],
779
+ "video/x-ms-vob": ["vob"],
780
+ "video/x-ms-wm": ["wm"],
781
+ "video/x-ms-wmv": ["wmv"],
782
+ "video/x-ms-wmx": ["wmx"],
783
+ "video/x-ms-wvx": ["wvx"],
784
+ "video/x-msvideo": ["avi"],
785
+ "video/x-sgi-movie": ["movie"],
786
+ "video/x-smv": ["smv"],
787
+ "x-conference/x-cooltalk": ["ice"]
788
+ };
789
+ Object.freeze(types);
790
+ var other_default = types;
791
+
792
+ // node_modules/mime/dist/types/standard.js
793
+ var types2 = {
794
+ "application/andrew-inset": ["ez"],
795
+ "application/appinstaller": ["appinstaller"],
796
+ "application/applixware": ["aw"],
797
+ "application/appx": ["appx"],
798
+ "application/appxbundle": ["appxbundle"],
799
+ "application/atom+xml": ["atom"],
800
+ "application/atomcat+xml": ["atomcat"],
801
+ "application/atomdeleted+xml": ["atomdeleted"],
802
+ "application/atomsvc+xml": ["atomsvc"],
803
+ "application/atsc-dwd+xml": ["dwd"],
804
+ "application/atsc-held+xml": ["held"],
805
+ "application/atsc-rsat+xml": ["rsat"],
806
+ "application/automationml-aml+xml": ["aml"],
807
+ "application/automationml-amlx+zip": ["amlx"],
808
+ "application/bdoc": ["bdoc"],
809
+ "application/calendar+xml": ["xcs"],
810
+ "application/ccxml+xml": ["ccxml"],
811
+ "application/cdfx+xml": ["cdfx"],
812
+ "application/cdmi-capability": ["cdmia"],
813
+ "application/cdmi-container": ["cdmic"],
814
+ "application/cdmi-domain": ["cdmid"],
815
+ "application/cdmi-object": ["cdmio"],
816
+ "application/cdmi-queue": ["cdmiq"],
817
+ "application/cpl+xml": ["cpl"],
818
+ "application/cu-seeme": ["cu"],
819
+ "application/cwl": ["cwl"],
820
+ "application/dash+xml": ["mpd"],
821
+ "application/dash-patch+xml": ["mpp"],
822
+ "application/davmount+xml": ["davmount"],
823
+ "application/dicom": ["dcm"],
824
+ "application/docbook+xml": ["dbk"],
825
+ "application/dssc+der": ["dssc"],
826
+ "application/dssc+xml": ["xdssc"],
827
+ "application/ecmascript": ["ecma"],
828
+ "application/emma+xml": ["emma"],
829
+ "application/emotionml+xml": ["emotionml"],
830
+ "application/epub+zip": ["epub"],
831
+ "application/exi": ["exi"],
832
+ "application/express": ["exp"],
833
+ "application/fdf": ["fdf"],
834
+ "application/fdt+xml": ["fdt"],
835
+ "application/font-tdpfr": ["pfr"],
836
+ "application/geo+json": ["geojson"],
837
+ "application/gml+xml": ["gml"],
838
+ "application/gpx+xml": ["gpx"],
839
+ "application/gxf": ["gxf"],
840
+ "application/gzip": ["gz"],
841
+ "application/hjson": ["hjson"],
842
+ "application/hyperstudio": ["stk"],
843
+ "application/inkml+xml": ["ink", "inkml"],
844
+ "application/ipfix": ["ipfix"],
845
+ "application/its+xml": ["its"],
846
+ "application/java-archive": ["jar", "war", "ear"],
847
+ "application/java-serialized-object": ["ser"],
848
+ "application/java-vm": ["class"],
849
+ "application/javascript": ["*js"],
850
+ "application/json": ["json", "map"],
851
+ "application/json5": ["json5"],
852
+ "application/jsonml+json": ["jsonml"],
853
+ "application/ld+json": ["jsonld"],
854
+ "application/lgr+xml": ["lgr"],
855
+ "application/lost+xml": ["lostxml"],
856
+ "application/mac-binhex40": ["hqx"],
857
+ "application/mac-compactpro": ["cpt"],
858
+ "application/mads+xml": ["mads"],
859
+ "application/manifest+json": ["webmanifest"],
860
+ "application/marc": ["mrc"],
861
+ "application/marcxml+xml": ["mrcx"],
862
+ "application/mathematica": ["ma", "nb", "mb"],
863
+ "application/mathml+xml": ["mathml"],
864
+ "application/mbox": ["mbox"],
865
+ "application/media-policy-dataset+xml": ["mpf"],
866
+ "application/mediaservercontrol+xml": ["mscml"],
867
+ "application/metalink+xml": ["metalink"],
868
+ "application/metalink4+xml": ["meta4"],
869
+ "application/mets+xml": ["mets"],
870
+ "application/mmt-aei+xml": ["maei"],
871
+ "application/mmt-usd+xml": ["musd"],
872
+ "application/mods+xml": ["mods"],
873
+ "application/mp21": ["m21", "mp21"],
874
+ "application/mp4": ["*mp4", "*mpg4", "mp4s", "m4p"],
875
+ "application/msix": ["msix"],
876
+ "application/msixbundle": ["msixbundle"],
877
+ "application/msword": ["doc", "dot"],
878
+ "application/mxf": ["mxf"],
879
+ "application/n-quads": ["nq"],
880
+ "application/n-triples": ["nt"],
881
+ "application/node": ["cjs"],
882
+ "application/octet-stream": [
883
+ "bin",
884
+ "dms",
885
+ "lrf",
886
+ "mar",
887
+ "so",
888
+ "dist",
889
+ "distz",
890
+ "pkg",
891
+ "bpk",
892
+ "dump",
893
+ "elc",
894
+ "deploy",
895
+ "exe",
896
+ "dll",
897
+ "deb",
898
+ "dmg",
899
+ "iso",
900
+ "img",
901
+ "msi",
902
+ "msp",
903
+ "msm",
904
+ "buffer"
905
+ ],
906
+ "application/oda": ["oda"],
907
+ "application/oebps-package+xml": ["opf"],
908
+ "application/ogg": ["ogx"],
909
+ "application/omdoc+xml": ["omdoc"],
910
+ "application/onenote": [
911
+ "onetoc",
912
+ "onetoc2",
913
+ "onetmp",
914
+ "onepkg",
915
+ "one",
916
+ "onea"
917
+ ],
918
+ "application/oxps": ["oxps"],
919
+ "application/p2p-overlay+xml": ["relo"],
920
+ "application/patch-ops-error+xml": ["xer"],
921
+ "application/pdf": ["pdf"],
922
+ "application/pgp-encrypted": ["pgp"],
923
+ "application/pgp-keys": ["asc"],
924
+ "application/pgp-signature": ["sig", "*asc"],
925
+ "application/pics-rules": ["prf"],
926
+ "application/pkcs10": ["p10"],
927
+ "application/pkcs7-mime": ["p7m", "p7c"],
928
+ "application/pkcs7-signature": ["p7s"],
929
+ "application/pkcs8": ["p8"],
930
+ "application/pkix-attr-cert": ["ac"],
931
+ "application/pkix-cert": ["cer"],
932
+ "application/pkix-crl": ["crl"],
933
+ "application/pkix-pkipath": ["pkipath"],
934
+ "application/pkixcmp": ["pki"],
935
+ "application/pls+xml": ["pls"],
936
+ "application/postscript": ["ai", "eps", "ps"],
937
+ "application/provenance+xml": ["provx"],
938
+ "application/pskc+xml": ["pskcxml"],
939
+ "application/raml+yaml": ["raml"],
940
+ "application/rdf+xml": ["rdf", "owl"],
941
+ "application/reginfo+xml": ["rif"],
942
+ "application/relax-ng-compact-syntax": ["rnc"],
943
+ "application/resource-lists+xml": ["rl"],
944
+ "application/resource-lists-diff+xml": ["rld"],
945
+ "application/rls-services+xml": ["rs"],
946
+ "application/route-apd+xml": ["rapd"],
947
+ "application/route-s-tsid+xml": ["sls"],
948
+ "application/route-usd+xml": ["rusd"],
949
+ "application/rpki-ghostbusters": ["gbr"],
950
+ "application/rpki-manifest": ["mft"],
951
+ "application/rpki-roa": ["roa"],
952
+ "application/rsd+xml": ["rsd"],
953
+ "application/rss+xml": ["rss"],
954
+ "application/rtf": ["rtf"],
955
+ "application/sbml+xml": ["sbml"],
956
+ "application/scvp-cv-request": ["scq"],
957
+ "application/scvp-cv-response": ["scs"],
958
+ "application/scvp-vp-request": ["spq"],
959
+ "application/scvp-vp-response": ["spp"],
960
+ "application/sdp": ["sdp"],
961
+ "application/senml+xml": ["senmlx"],
962
+ "application/sensml+xml": ["sensmlx"],
963
+ "application/set-payment-initiation": ["setpay"],
964
+ "application/set-registration-initiation": ["setreg"],
965
+ "application/shf+xml": ["shf"],
966
+ "application/sieve": ["siv", "sieve"],
967
+ "application/smil+xml": ["smi", "smil"],
968
+ "application/sparql-query": ["rq"],
969
+ "application/sparql-results+xml": ["srx"],
970
+ "application/sql": ["sql"],
971
+ "application/srgs": ["gram"],
972
+ "application/srgs+xml": ["grxml"],
973
+ "application/sru+xml": ["sru"],
974
+ "application/ssdl+xml": ["ssdl"],
975
+ "application/ssml+xml": ["ssml"],
976
+ "application/swid+xml": ["swidtag"],
977
+ "application/tei+xml": ["tei", "teicorpus"],
978
+ "application/thraud+xml": ["tfi"],
979
+ "application/timestamped-data": ["tsd"],
980
+ "application/toml": ["toml"],
981
+ "application/trig": ["trig"],
982
+ "application/ttml+xml": ["ttml"],
983
+ "application/ubjson": ["ubj"],
984
+ "application/urc-ressheet+xml": ["rsheet"],
985
+ "application/urc-targetdesc+xml": ["td"],
986
+ "application/voicexml+xml": ["vxml"],
987
+ "application/wasm": ["wasm"],
988
+ "application/watcherinfo+xml": ["wif"],
989
+ "application/widget": ["wgt"],
990
+ "application/winhlp": ["hlp"],
991
+ "application/wsdl+xml": ["wsdl"],
992
+ "application/wspolicy+xml": ["wspolicy"],
993
+ "application/xaml+xml": ["xaml"],
994
+ "application/xcap-att+xml": ["xav"],
995
+ "application/xcap-caps+xml": ["xca"],
996
+ "application/xcap-diff+xml": ["xdf"],
997
+ "application/xcap-el+xml": ["xel"],
998
+ "application/xcap-ns+xml": ["xns"],
999
+ "application/xenc+xml": ["xenc"],
1000
+ "application/xfdf": ["xfdf"],
1001
+ "application/xhtml+xml": ["xhtml", "xht"],
1002
+ "application/xliff+xml": ["xlf"],
1003
+ "application/xml": ["xml", "xsl", "xsd", "rng"],
1004
+ "application/xml-dtd": ["dtd"],
1005
+ "application/xop+xml": ["xop"],
1006
+ "application/xproc+xml": ["xpl"],
1007
+ "application/xslt+xml": ["*xsl", "xslt"],
1008
+ "application/xspf+xml": ["xspf"],
1009
+ "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"],
1010
+ "application/yang": ["yang"],
1011
+ "application/yin+xml": ["yin"],
1012
+ "application/zip": ["zip"],
1013
+ "application/zip+dotlottie": ["lottie"],
1014
+ "audio/3gpp": ["*3gpp"],
1015
+ "audio/aac": ["adts", "aac"],
1016
+ "audio/adpcm": ["adp"],
1017
+ "audio/amr": ["amr"],
1018
+ "audio/basic": ["au", "snd"],
1019
+ "audio/midi": ["mid", "midi", "kar", "rmi"],
1020
+ "audio/mobile-xmf": ["mxmf"],
1021
+ "audio/mp3": ["*mp3"],
1022
+ "audio/mp4": ["m4a", "mp4a", "m4b"],
1023
+ "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"],
1024
+ "audio/ogg": ["oga", "ogg", "spx", "opus"],
1025
+ "audio/s3m": ["s3m"],
1026
+ "audio/silk": ["sil"],
1027
+ "audio/wav": ["wav"],
1028
+ "audio/wave": ["*wav"],
1029
+ "audio/webm": ["weba"],
1030
+ "audio/xm": ["xm"],
1031
+ "font/collection": ["ttc"],
1032
+ "font/otf": ["otf"],
1033
+ "font/ttf": ["ttf"],
1034
+ "font/woff": ["woff"],
1035
+ "font/woff2": ["woff2"],
1036
+ "image/aces": ["exr"],
1037
+ "image/apng": ["apng"],
1038
+ "image/avci": ["avci"],
1039
+ "image/avcs": ["avcs"],
1040
+ "image/avif": ["avif"],
1041
+ "image/bmp": ["bmp", "dib"],
1042
+ "image/cgm": ["cgm"],
1043
+ "image/dicom-rle": ["drle"],
1044
+ "image/dpx": ["dpx"],
1045
+ "image/emf": ["emf"],
1046
+ "image/fits": ["fits"],
1047
+ "image/g3fax": ["g3"],
1048
+ "image/gif": ["gif"],
1049
+ "image/heic": ["heic"],
1050
+ "image/heic-sequence": ["heics"],
1051
+ "image/heif": ["heif"],
1052
+ "image/heif-sequence": ["heifs"],
1053
+ "image/hej2k": ["hej2"],
1054
+ "image/ief": ["ief"],
1055
+ "image/jaii": ["jaii"],
1056
+ "image/jais": ["jais"],
1057
+ "image/jls": ["jls"],
1058
+ "image/jp2": ["jp2", "jpg2"],
1059
+ "image/jpeg": ["jpg", "jpeg", "jpe"],
1060
+ "image/jph": ["jph"],
1061
+ "image/jphc": ["jhc"],
1062
+ "image/jpm": ["jpm", "jpgm"],
1063
+ "image/jpx": ["jpx", "jpf"],
1064
+ "image/jxl": ["jxl"],
1065
+ "image/jxr": ["jxr"],
1066
+ "image/jxra": ["jxra"],
1067
+ "image/jxrs": ["jxrs"],
1068
+ "image/jxs": ["jxs"],
1069
+ "image/jxsc": ["jxsc"],
1070
+ "image/jxsi": ["jxsi"],
1071
+ "image/jxss": ["jxss"],
1072
+ "image/ktx": ["ktx"],
1073
+ "image/ktx2": ["ktx2"],
1074
+ "image/pjpeg": ["jfif"],
1075
+ "image/png": ["png"],
1076
+ "image/sgi": ["sgi"],
1077
+ "image/svg+xml": ["svg", "svgz"],
1078
+ "image/t38": ["t38"],
1079
+ "image/tiff": ["tif", "tiff"],
1080
+ "image/tiff-fx": ["tfx"],
1081
+ "image/webp": ["webp"],
1082
+ "image/wmf": ["wmf"],
1083
+ "message/disposition-notification": ["disposition-notification"],
1084
+ "message/global": ["u8msg"],
1085
+ "message/global-delivery-status": ["u8dsn"],
1086
+ "message/global-disposition-notification": ["u8mdn"],
1087
+ "message/global-headers": ["u8hdr"],
1088
+ "message/rfc822": ["eml", "mime", "mht", "mhtml"],
1089
+ "model/3mf": ["3mf"],
1090
+ "model/gltf+json": ["gltf"],
1091
+ "model/gltf-binary": ["glb"],
1092
+ "model/iges": ["igs", "iges"],
1093
+ "model/jt": ["jt"],
1094
+ "model/mesh": ["msh", "mesh", "silo"],
1095
+ "model/mtl": ["mtl"],
1096
+ "model/obj": ["obj"],
1097
+ "model/prc": ["prc"],
1098
+ "model/step": ["step", "stp", "stpnc", "p21", "210"],
1099
+ "model/step+xml": ["stpx"],
1100
+ "model/step+zip": ["stpz"],
1101
+ "model/step-xml+zip": ["stpxz"],
1102
+ "model/stl": ["stl"],
1103
+ "model/u3d": ["u3d"],
1104
+ "model/vrml": ["wrl", "vrml"],
1105
+ "model/x3d+binary": ["*x3db", "x3dbz"],
1106
+ "model/x3d+fastinfoset": ["x3db"],
1107
+ "model/x3d+vrml": ["*x3dv", "x3dvz"],
1108
+ "model/x3d+xml": ["x3d", "x3dz"],
1109
+ "model/x3d-vrml": ["x3dv"],
1110
+ "text/cache-manifest": ["appcache", "manifest"],
1111
+ "text/calendar": ["ics", "ifb"],
1112
+ "text/coffeescript": ["coffee", "litcoffee"],
1113
+ "text/css": ["css"],
1114
+ "text/csv": ["csv"],
1115
+ "text/html": ["html", "htm", "shtml"],
1116
+ "text/jade": ["jade"],
1117
+ "text/javascript": ["js", "mjs"],
1118
+ "text/jsx": ["jsx"],
1119
+ "text/less": ["less"],
1120
+ "text/markdown": ["md", "markdown"],
1121
+ "text/mathml": ["mml"],
1122
+ "text/mdx": ["mdx"],
1123
+ "text/n3": ["n3"],
1124
+ "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"],
1125
+ "text/richtext": ["rtx"],
1126
+ "text/rtf": ["*rtf"],
1127
+ "text/sgml": ["sgml", "sgm"],
1128
+ "text/shex": ["shex"],
1129
+ "text/slim": ["slim", "slm"],
1130
+ "text/spdx": ["spdx"],
1131
+ "text/stylus": ["stylus", "styl"],
1132
+ "text/tab-separated-values": ["tsv"],
1133
+ "text/troff": ["t", "tr", "roff", "man", "me", "ms"],
1134
+ "text/turtle": ["ttl"],
1135
+ "text/uri-list": ["uri", "uris", "urls"],
1136
+ "text/vcard": ["vcard"],
1137
+ "text/vtt": ["vtt"],
1138
+ "text/wgsl": ["wgsl"],
1139
+ "text/xml": ["*xml"],
1140
+ "text/yaml": ["yaml", "yml"],
1141
+ "video/3gpp": ["3gp", "3gpp"],
1142
+ "video/3gpp2": ["3g2"],
1143
+ "video/h261": ["h261"],
1144
+ "video/h263": ["h263"],
1145
+ "video/h264": ["h264"],
1146
+ "video/iso.segment": ["m4s"],
1147
+ "video/jpeg": ["jpgv"],
1148
+ "video/jpm": ["*jpm", "*jpgm"],
1149
+ "video/mj2": ["mj2", "mjp2"],
1150
+ "video/mp2t": ["ts", "m2t", "m2ts", "mts"],
1151
+ "video/mp4": ["mp4", "mp4v", "mpg4"],
1152
+ "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"],
1153
+ "video/ogg": ["ogv"],
1154
+ "video/quicktime": ["qt", "mov"],
1155
+ "video/webm": ["webm"]
1156
+ };
1157
+ Object.freeze(types2);
1158
+ var standard_default = types2;
1159
+
1160
+ // node_modules/mime/dist/src/Mime.js
1161
+ var __classPrivateFieldGet = function(receiver, state, kind, f) {
1162
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
1163
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
1164
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1165
+ };
1166
+ var _Mime_extensionToType;
1167
+ var _Mime_typeToExtension;
1168
+ var _Mime_typeToExtensions;
1169
+ var Mime = class {
1170
+ constructor(...args) {
1171
+ _Mime_extensionToType.set(this, /* @__PURE__ */ new Map());
1172
+ _Mime_typeToExtension.set(this, /* @__PURE__ */ new Map());
1173
+ _Mime_typeToExtensions.set(this, /* @__PURE__ */ new Map());
1174
+ for (const arg of args) {
1175
+ this.define(arg);
1176
+ }
1177
+ }
1178
+ define(typeMap, force = false) {
1179
+ for (let [type, extensions] of Object.entries(typeMap)) {
1180
+ type = type.toLowerCase();
1181
+ extensions = extensions.map((ext) => ext.toLowerCase());
1182
+ if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, "f").has(type)) {
1183
+ __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").set(type, /* @__PURE__ */ new Set());
1184
+ }
1185
+ const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type);
1186
+ let first = true;
1187
+ for (let extension of extensions) {
1188
+ const starred = extension.startsWith("*");
1189
+ extension = starred ? extension.slice(1) : extension;
1190
+ allExtensions?.add(extension);
1191
+ if (first) {
1192
+ __classPrivateFieldGet(this, _Mime_typeToExtension, "f").set(type, extension);
1193
+ }
1194
+ first = false;
1195
+ if (starred)
1196
+ continue;
1197
+ const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(extension);
1198
+ if (currentType && currentType != type && !force) {
1199
+ throw new Error(`"${type} -> ${extension}" conflicts with "${currentType} -> ${extension}". Pass \`force=true\` to override this definition.`);
1200
+ }
1201
+ __classPrivateFieldGet(this, _Mime_extensionToType, "f").set(extension, type);
1202
+ }
1203
+ }
1204
+ return this;
1205
+ }
1206
+ getType(path2) {
1207
+ if (typeof path2 !== "string")
1208
+ return null;
1209
+ const last = path2.replace(/^.*[/\\]/s, "").toLowerCase();
1210
+ const ext = last.replace(/^.*\./s, "").toLowerCase();
1211
+ const hasPath = last.length < path2.length;
1212
+ const hasDot = ext.length < last.length - 1;
1213
+ if (!hasDot && hasPath)
1214
+ return null;
1215
+ return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
1216
+ }
1217
+ getExtension(type) {
1218
+ if (typeof type !== "string")
1219
+ return null;
1220
+ type = type?.split?.(";")[0];
1221
+ return (type && __classPrivateFieldGet(this, _Mime_typeToExtension, "f").get(type.trim().toLowerCase())) ?? null;
1222
+ }
1223
+ getAllExtensions(type) {
1224
+ if (typeof type !== "string")
1225
+ return null;
1226
+ return __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type.toLowerCase()) ?? null;
1227
+ }
1228
+ _freeze() {
1229
+ this.define = () => {
1230
+ throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
1231
+ };
1232
+ Object.freeze(this);
1233
+ for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").values()) {
1234
+ Object.freeze(extensions);
1235
+ }
1236
+ return this;
1237
+ }
1238
+ _getTestState() {
1239
+ return {
1240
+ types: __classPrivateFieldGet(this, _Mime_extensionToType, "f"),
1241
+ extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, "f")
1242
+ };
1243
+ }
1244
+ };
1245
+ _Mime_extensionToType = /* @__PURE__ */ new WeakMap(), _Mime_typeToExtension = /* @__PURE__ */ new WeakMap(), _Mime_typeToExtensions = /* @__PURE__ */ new WeakMap();
1246
+ var Mime_default = Mime;
1247
+
1248
+ // node_modules/mime/dist/src/index.js
1249
+ var src_default = new Mime_default(standard_default, other_default)._freeze();
1250
+
1251
+ // plug-api/lib/crypto.ts
1252
+ function base64Decode(s) {
1253
+ const binString = atob(s);
1254
+ const len = binString.length;
1255
+ const bytes = new Uint8Array(len);
1256
+ for (let i = 0; i < len; i++) {
1257
+ bytes[i] = binString.charCodeAt(i);
1258
+ }
1259
+ return bytes;
1260
+ }
1261
+ function base64Encode(buffer) {
1262
+ if (typeof buffer === "string") {
1263
+ buffer = new TextEncoder().encode(buffer);
1264
+ }
1265
+ let binary = "";
1266
+ const len = buffer.byteLength;
1267
+ for (let i = 0; i < len; i++) {
1268
+ binary += String.fromCharCode(buffer[i]);
1269
+ }
1270
+ return btoa(binary);
1271
+ }
1272
+ function base64EncodedDataUrl(mimeType, buffer) {
1273
+ return `data:${mimeType};base64,${base64Encode(buffer)}`;
1274
+ }
1275
+ var fixedCounter = new Uint8Array(16);
1276
+
1277
+ // client/asset_bundle/bundle.ts
1278
+ var AssetBundle = class {
1279
+ bundle;
1280
+ constructor(bundle = {}) {
1281
+ this.bundle = bundle;
1282
+ }
1283
+ has(path2) {
1284
+ return path2 in this.bundle;
1285
+ }
1286
+ listFiles() {
1287
+ return Object.keys(this.bundle);
1288
+ }
1289
+ readFileSync(path2) {
1290
+ const content = this.bundle[path2];
1291
+ if (!content) {
1292
+ throw new Error(`No such file ${path2}`);
1293
+ }
1294
+ const data = content.data.split(",", 2)[1];
1295
+ return base64Decode(data);
1296
+ }
1297
+ readFileAsDataUrl(path2) {
1298
+ const content = this.bundle[path2];
1299
+ if (!content) {
1300
+ throw new Error(`No such file ${path2}`);
1301
+ }
1302
+ return content.data;
1303
+ }
1304
+ readTextFileSync(path2) {
1305
+ return new TextDecoder().decode(this.readFileSync(path2));
1306
+ }
1307
+ getMimeType(path2) {
1308
+ const entry = this.bundle[path2];
1309
+ if (!entry) {
1310
+ throw new Error(`No such file ${path2}`);
1311
+ }
1312
+ return entry.data.split(";")[0].split(":")[1];
1313
+ }
1314
+ getMtime(path2) {
1315
+ const entry = this.bundle[path2];
1316
+ if (!entry) {
1317
+ throw new Error(`No such file ${path2}`);
1318
+ }
1319
+ return entry.mtime;
1320
+ }
1321
+ writeFileSync(path2, mimeType, data, mtime = Date.now()) {
1322
+ path2 = path2.replaceAll("\\", "/");
1323
+ this.bundle[path2] = {
1324
+ data: base64EncodedDataUrl(mimeType, data),
1325
+ mtime
1326
+ };
1327
+ }
1328
+ writeTextFileSync(path2, mimeType, s, mtime = Date.now()) {
1329
+ this.writeFileSync(path2, mimeType, new TextEncoder().encode(s), mtime);
1330
+ }
1331
+ toJSON() {
1332
+ return this.bundle;
1333
+ }
1334
+ };
1335
+
1336
+ // client/asset_bundle/builder.ts
1337
+ async function* walk(dir) {
1338
+ const entries = await readdir(dir, { withFileTypes: true });
1339
+ for (const entry of entries) {
1340
+ const fullPath = join(dir, entry.name);
1341
+ if (entry.isDirectory()) {
1342
+ yield* walk(fullPath);
1343
+ } else if (entry.isFile()) {
1344
+ yield { path: fullPath };
1345
+ }
1346
+ }
1347
+ }
1348
+ async function bundleAssets(rootPath, patterns) {
1349
+ const bundle = new AssetBundle();
1350
+ if (patterns.length === 0) {
1351
+ return bundle;
1352
+ }
1353
+ const isMatch = picomatch(patterns);
1354
+ for await (const file of walk(rootPath)) {
1355
+ const cleanPath = file.path.substring(rootPath.length + 1);
1356
+ if (isMatch(cleanPath)) {
1357
+ bundle.writeFileSync(
1358
+ cleanPath,
1359
+ src_default.getType(cleanPath) || "application/octet-stream",
1360
+ await readFile(file.path)
1361
+ );
1362
+ }
1363
+ }
1364
+ return bundle;
1365
+ }
1366
+
1367
+ // client/plugos/plug_compile.ts
1368
+ var workerRuntimeUrl = `https://deno.land/x/silverbullet@${version}/client/plugos/worker_runtime.ts`;
1369
+ async function compileManifest(manifestPath, destPath, options = {}) {
1370
+ const rootPath = path.dirname(manifestPath);
1371
+ const manifestContent = await readFile2(manifestPath, "utf-8");
1372
+ const manifest = YAML.load(manifestContent);
1373
+ if (!manifest.name) {
1374
+ throw new Error(`Missing 'name' in ${manifestPath}`);
1375
+ }
1376
+ const assetsBundle = await bundleAssets(
1377
+ path.resolve(rootPath),
1378
+ manifest.assets || []
1379
+ );
1380
+ manifest.assets = assetsBundle.toJSON();
1381
+ if (!manifest.functions) {
1382
+ manifest.functions = {};
1383
+ }
1384
+ const jsFile = `
1385
+ import { setupMessageListener } from "${options.runtimeUrl || workerRuntimeUrl}";
1386
+
1387
+ // Imports
1388
+ ${Object.entries(manifest.functions).map(([funcName, def]) => {
1389
+ if (!def.path) {
1390
+ return "";
1391
+ }
1392
+ let [filePath, jsFunctionName] = def.path.split(":");
1393
+ filePath = path.join(rootPath, filePath);
1394
+ return `import {${jsFunctionName} as ${funcName}} from "file://${// Replacing \ with / for Windows
1395
+ path.resolve(filePath).replaceAll(
1396
+ "\\",
1397
+ "\\\\"
1398
+ )}";
1399
+ `;
1400
+ }).join("")}
1401
+
1402
+ // Function mapping
1403
+ const functionMapping = {
1404
+ ${Object.entries(manifest.functions).map(([funcName, def]) => {
1405
+ if (!def.path) {
1406
+ return "";
1407
+ }
1408
+ return ` ${funcName}: ${funcName},
1409
+ `;
1410
+ }).join("")}
1411
+ };
1412
+
1413
+ // Manifest
1414
+ const manifest = ${JSON.stringify(manifest, null, 2)};
1415
+
1416
+ export const plug = {manifest, functionMapping};
1417
+
1418
+ setupMessageListener(functionMapping, manifest, self.postMessage);
1419
+ `;
1420
+ const tempDir = await mkdtemp(path.join(tmpdir(), "plug-compile-"));
1421
+ const inFile = path.join(tempDir, "input.js");
1422
+ const outFile = `${destPath}/${manifest.name}.plug.js`;
1423
+ await writeFile(inFile, jsFile, "utf-8");
1424
+ const result = await esbuild.build({
1425
+ entryPoints: [inFile],
1426
+ bundle: true,
1427
+ format: "esm",
1428
+ globalName: "mod",
1429
+ platform: "browser",
1430
+ sourcemap: "linked",
1431
+ minify: !options.debug,
1432
+ outfile: outFile,
1433
+ metafile: options.info,
1434
+ treeShaking: true,
1435
+ plugins: [
1436
+ denoPlugin({
1437
+ configPath: options.configPath && path.resolve(process.cwd(), options.configPath)
1438
+ })
1439
+ ]
1440
+ });
1441
+ if (options.info) {
1442
+ const text = await esbuild.analyzeMetafile(result.metafile);
1443
+ console.log("Bundle info for", manifestPath, text);
1444
+ }
1445
+ let jsCode = await readFile2(outFile, "utf-8");
1446
+ jsCode = patchDenoLibJS(jsCode);
1447
+ await writeFile(outFile, jsCode, "utf-8");
1448
+ await rm(tempDir, { recursive: true, force: true });
1449
+ console.log(`Plug ${manifest.name} written to ${outFile}.`);
1450
+ return outFile;
1451
+ }
1452
+ async function compileManifests(manifestFiles, dist, options = {}) {
1453
+ let building = false;
1454
+ dist = path.resolve(dist);
1455
+ async function buildAll() {
1456
+ if (building) {
1457
+ return;
1458
+ }
1459
+ console.log("Building", manifestFiles);
1460
+ building = true;
1461
+ await mkdir(dist, { recursive: true });
1462
+ const startTime = Date.now();
1463
+ await Promise.all(manifestFiles.map(async (plugManifestPath) => {
1464
+ const manifestPath = plugManifestPath;
1465
+ try {
1466
+ await compileManifest(
1467
+ manifestPath,
1468
+ dist,
1469
+ options
1470
+ );
1471
+ } catch (e) {
1472
+ console.error(`Error building ${manifestPath}:`, e.message);
1473
+ throw e;
1474
+ }
1475
+ }));
1476
+ console.log(`Done building plugs in ${Date.now() - startTime}ms`);
1477
+ building = false;
1478
+ }
1479
+ await buildAll();
1480
+ }
1481
+ function patchDenoLibJS(code) {
1482
+ return code.replaceAll("/(?<=\\n)/", "/()/");
1483
+ }
1484
+ async function plugCompileCommand({ dist, debug, info, config, runtimeUrl }, ...manifestPaths) {
1485
+ await compileManifests(
1486
+ manifestPaths,
1487
+ dist,
1488
+ {
1489
+ debug,
1490
+ info,
1491
+ runtimeUrl,
1492
+ configPath: config
1493
+ }
1494
+ );
1495
+ esbuild.stop();
1496
+ process.exit(0);
1497
+ }
1498
+
1499
+ // bin/plug-compile.ts
1500
+ var program = new Command();
1501
+ program.name("plug-compile").description("Bundle (compile) one or more plug manifests").version(version).usage("<options> <manifest paths>").argument("<manifestPaths...>", "One or more .plug.yaml manifest files").option("--debug", "Do not minify code", false).option("--info", "Print out size info per function", false).option("-w, --watch", "Watch for changes and rebuild", false).option("--dist <path>", "Folder to put the resulting .plug.json file into", ".").option("-c, --config <path>", "Path to deno.json file to use").option("--runtimeUrl <url>", "URL to worker_runtime.ts to use").action(async (manifestPaths, options) => {
1502
+ await plugCompileCommand(
1503
+ {
1504
+ dist: options.dist,
1505
+ debug: options.debug,
1506
+ info: options.info,
1507
+ config: options.config,
1508
+ runtimeUrl: options.runtimeUrl
1509
+ },
1510
+ ...manifestPaths
1511
+ );
1512
+ });
1513
+ program.parse(process.argv);