wrangler 2.5.0 → 2.6.0

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.
@@ -447,7 +447,7 @@ var require_util = __commonJS({
447
447
  const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR);
448
448
  return m ? parseInt(m[1], 10) * 1e3 : null;
449
449
  }
450
- function parseHeaders(headers, obj = {}) {
450
+ function parseHeaders2(headers, obj = {}) {
451
451
  for (let i2 = 0; i2 < headers.length; i2 += 2) {
452
452
  const key2 = headers[i2].toString().toLowerCase();
453
453
  let val = obj[key2];
@@ -582,7 +582,7 @@ var require_util = __commonJS({
582
582
  isAsyncIterable,
583
583
  isDestroyed,
584
584
  parseRawHeaders,
585
- parseHeaders,
585
+ parseHeaders: parseHeaders2,
586
586
  parseKeepAliveTimeout,
587
587
  destroy,
588
588
  bodyLength,
@@ -11037,7 +11037,7 @@ var require_headers = __commonJS({
11037
11037
  return this[kHeadersMap][Symbol.iterator]();
11038
11038
  }
11039
11039
  };
11040
- var Headers2 = class {
11040
+ var Headers3 = class {
11041
11041
  constructor(init = void 0) {
11042
11042
  this[kHeadersList] = new HeadersList();
11043
11043
  this[kGuard] = "none";
@@ -11050,7 +11050,7 @@ var require_headers = __commonJS({
11050
11050
  return this.constructor.name;
11051
11051
  }
11052
11052
  append(name, value) {
11053
- if (!(this instanceof Headers2)) {
11053
+ if (!(this instanceof Headers3)) {
11054
11054
  throw new TypeError("Illegal invocation");
11055
11055
  }
11056
11056
  if (arguments.length < 2) {
@@ -11081,7 +11081,7 @@ var require_headers = __commonJS({
11081
11081
  return this[kHeadersList].append(name, value);
11082
11082
  }
11083
11083
  delete(name) {
11084
- if (!(this instanceof Headers2)) {
11084
+ if (!(this instanceof Headers3)) {
11085
11085
  throw new TypeError("Illegal invocation");
11086
11086
  }
11087
11087
  if (arguments.length < 1) {
@@ -11107,7 +11107,7 @@ var require_headers = __commonJS({
11107
11107
  return this[kHeadersList].delete(name);
11108
11108
  }
11109
11109
  get(name) {
11110
- if (!(this instanceof Headers2)) {
11110
+ if (!(this instanceof Headers3)) {
11111
11111
  throw new TypeError("Illegal invocation");
11112
11112
  }
11113
11113
  if (arguments.length < 1) {
@@ -11126,7 +11126,7 @@ var require_headers = __commonJS({
11126
11126
  return this[kHeadersList].get(name);
11127
11127
  }
11128
11128
  has(name) {
11129
- if (!(this instanceof Headers2)) {
11129
+ if (!(this instanceof Headers3)) {
11130
11130
  throw new TypeError("Illegal invocation");
11131
11131
  }
11132
11132
  if (arguments.length < 1) {
@@ -11145,7 +11145,7 @@ var require_headers = __commonJS({
11145
11145
  return this[kHeadersList].contains(name);
11146
11146
  }
11147
11147
  set(name, value) {
11148
- if (!(this instanceof Headers2)) {
11148
+ if (!(this instanceof Headers3)) {
11149
11149
  throw new TypeError("Illegal invocation");
11150
11150
  }
11151
11151
  if (arguments.length < 2) {
@@ -11182,25 +11182,25 @@ var require_headers = __commonJS({
11182
11182
  return this[kHeadersList][kHeadersSortedMap];
11183
11183
  }
11184
11184
  keys() {
11185
- if (!(this instanceof Headers2)) {
11185
+ if (!(this instanceof Headers3)) {
11186
11186
  throw new TypeError("Illegal invocation");
11187
11187
  }
11188
11188
  return makeIterator(this[kHeadersSortedMap].keys(), "Headers");
11189
11189
  }
11190
11190
  values() {
11191
- if (!(this instanceof Headers2)) {
11191
+ if (!(this instanceof Headers3)) {
11192
11192
  throw new TypeError("Illegal invocation");
11193
11193
  }
11194
11194
  return makeIterator(this[kHeadersSortedMap].values(), "Headers");
11195
11195
  }
11196
11196
  entries() {
11197
- if (!(this instanceof Headers2)) {
11197
+ if (!(this instanceof Headers3)) {
11198
11198
  throw new TypeError("Illegal invocation");
11199
11199
  }
11200
11200
  return makeIterator(this[kHeadersSortedMap].entries(), "Headers");
11201
11201
  }
11202
11202
  forEach(callbackFn, thisArg = globalThis) {
11203
- if (!(this instanceof Headers2)) {
11203
+ if (!(this instanceof Headers3)) {
11204
11204
  throw new TypeError("Illegal invocation");
11205
11205
  }
11206
11206
  if (arguments.length < 1) {
@@ -11218,14 +11218,14 @@ var require_headers = __commonJS({
11218
11218
  }
11219
11219
  }
11220
11220
  [Symbol.for("nodejs.util.inspect.custom")]() {
11221
- if (!(this instanceof Headers2)) {
11221
+ if (!(this instanceof Headers3)) {
11222
11222
  throw new TypeError("Illegal invocation");
11223
11223
  }
11224
11224
  return this[kHeadersList];
11225
11225
  }
11226
11226
  };
11227
- Headers2.prototype[Symbol.iterator] = Headers2.prototype.entries;
11228
- Object.defineProperties(Headers2.prototype, {
11227
+ Headers3.prototype[Symbol.iterator] = Headers3.prototype.entries;
11228
+ Object.defineProperties(Headers3.prototype, {
11229
11229
  append: kEnumerableProperty,
11230
11230
  delete: kEnumerableProperty,
11231
11231
  get: kEnumerableProperty,
@@ -11251,7 +11251,7 @@ var require_headers = __commonJS({
11251
11251
  };
11252
11252
  module2.exports = {
11253
11253
  fill,
11254
- Headers: Headers2,
11254
+ Headers: Headers3,
11255
11255
  HeadersList
11256
11256
  };
11257
11257
  }
@@ -11302,7 +11302,7 @@ var require_response = __commonJS({
11302
11302
  "node_modules/undici/lib/fetch/response.js"(exports2, module2) {
11303
11303
  "use strict";
11304
11304
  init_import_meta_url();
11305
- var { Headers: Headers2, HeadersList, fill } = require_headers();
11305
+ var { Headers: Headers3, HeadersList, fill } = require_headers();
11306
11306
  var { extractBody, cloneBody, mixinBody } = require_body();
11307
11307
  var util3 = require_util();
11308
11308
  var { kEnumerableProperty } = util3;
@@ -11328,10 +11328,10 @@ var require_response = __commonJS({
11328
11328
  var assert14 = require("assert");
11329
11329
  var { types } = require("util");
11330
11330
  var ReadableStream = globalThis.ReadableStream || require("stream/web").ReadableStream;
11331
- var Response = class {
11331
+ var Response2 = class {
11332
11332
  static error() {
11333
11333
  const relevantRealm = { settingsObject: {} };
11334
- const responseObject = new Response();
11334
+ const responseObject = new Response2();
11335
11335
  responseObject[kState] = makeNetworkError();
11336
11336
  responseObject[kRealm] = relevantRealm;
11337
11337
  responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList;
@@ -11353,7 +11353,7 @@ var require_response = __commonJS({
11353
11353
  );
11354
11354
  const body = extractBody(bytes);
11355
11355
  const relevantRealm = { settingsObject: {} };
11356
- const responseObject = new Response();
11356
+ const responseObject = new Response2();
11357
11357
  responseObject[kRealm] = relevantRealm;
11358
11358
  responseObject[kHeaders][kGuard] = "response";
11359
11359
  responseObject[kHeaders][kRealm] = relevantRealm;
@@ -11380,7 +11380,7 @@ var require_response = __commonJS({
11380
11380
  if (!redirectStatus.includes(status)) {
11381
11381
  throw new RangeError("Invalid status code");
11382
11382
  }
11383
- const responseObject = new Response();
11383
+ const responseObject = new Response2();
11384
11384
  responseObject[kRealm] = relevantRealm;
11385
11385
  responseObject[kHeaders][kGuard] = "immutable";
11386
11386
  responseObject[kHeaders][kRealm] = relevantRealm;
@@ -11396,7 +11396,7 @@ var require_response = __commonJS({
11396
11396
  init = webidl.converters.ResponseInit(init);
11397
11397
  this[kRealm] = { settingsObject: {} };
11398
11398
  this[kState] = makeResponse({});
11399
- this[kHeaders] = new Headers2();
11399
+ this[kHeaders] = new Headers3();
11400
11400
  this[kHeaders][kGuard] = "response";
11401
11401
  this[kHeaders][kHeadersList] = this[kState].headersList;
11402
11402
  this[kHeaders][kRealm] = this[kRealm];
@@ -11411,13 +11411,13 @@ var require_response = __commonJS({
11411
11411
  return this.constructor.name;
11412
11412
  }
11413
11413
  get type() {
11414
- if (!(this instanceof Response)) {
11414
+ if (!(this instanceof Response2)) {
11415
11415
  throw new TypeError("Illegal invocation");
11416
11416
  }
11417
11417
  return this[kState].type;
11418
11418
  }
11419
11419
  get url() {
11420
- if (!(this instanceof Response)) {
11420
+ if (!(this instanceof Response2)) {
11421
11421
  throw new TypeError("Illegal invocation");
11422
11422
  }
11423
11423
  let url3 = responseURL(this[kState]);
@@ -11431,37 +11431,37 @@ var require_response = __commonJS({
11431
11431
  return url3.toString();
11432
11432
  }
11433
11433
  get redirected() {
11434
- if (!(this instanceof Response)) {
11434
+ if (!(this instanceof Response2)) {
11435
11435
  throw new TypeError("Illegal invocation");
11436
11436
  }
11437
11437
  return this[kState].urlList.length > 1;
11438
11438
  }
11439
11439
  get status() {
11440
- if (!(this instanceof Response)) {
11440
+ if (!(this instanceof Response2)) {
11441
11441
  throw new TypeError("Illegal invocation");
11442
11442
  }
11443
11443
  return this[kState].status;
11444
11444
  }
11445
11445
  get ok() {
11446
- if (!(this instanceof Response)) {
11446
+ if (!(this instanceof Response2)) {
11447
11447
  throw new TypeError("Illegal invocation");
11448
11448
  }
11449
11449
  return this[kState].status >= 200 && this[kState].status <= 299;
11450
11450
  }
11451
11451
  get statusText() {
11452
- if (!(this instanceof Response)) {
11452
+ if (!(this instanceof Response2)) {
11453
11453
  throw new TypeError("Illegal invocation");
11454
11454
  }
11455
11455
  return this[kState].statusText;
11456
11456
  }
11457
11457
  get headers() {
11458
- if (!(this instanceof Response)) {
11458
+ if (!(this instanceof Response2)) {
11459
11459
  throw new TypeError("Illegal invocation");
11460
11460
  }
11461
11461
  return this[kHeaders];
11462
11462
  }
11463
11463
  clone() {
11464
- if (!(this instanceof Response)) {
11464
+ if (!(this instanceof Response2)) {
11465
11465
  throw new TypeError("Illegal invocation");
11466
11466
  }
11467
11467
  if (this.bodyUsed || this.body && this.body.locked) {
@@ -11471,7 +11471,7 @@ var require_response = __commonJS({
11471
11471
  });
11472
11472
  }
11473
11473
  const clonedResponse = cloneResponse(this[kState]);
11474
- const clonedResponseObject = new Response();
11474
+ const clonedResponseObject = new Response2();
11475
11475
  clonedResponseObject[kState] = clonedResponse;
11476
11476
  clonedResponseObject[kRealm] = this[kRealm];
11477
11477
  clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList;
@@ -11480,8 +11480,8 @@ var require_response = __commonJS({
11480
11480
  return clonedResponseObject;
11481
11481
  }
11482
11482
  };
11483
- mixinBody(Response);
11484
- Object.defineProperties(Response.prototype, {
11483
+ mixinBody(Response2);
11484
+ Object.defineProperties(Response2.prototype, {
11485
11485
  type: kEnumerableProperty,
11486
11486
  url: kEnumerableProperty,
11487
11487
  status: kEnumerableProperty,
@@ -11670,7 +11670,7 @@ var require_response = __commonJS({
11670
11670
  makeResponse,
11671
11671
  makeAppropriateNetworkError,
11672
11672
  filterResponse,
11673
- Response
11673
+ Response: Response2
11674
11674
  };
11675
11675
  }
11676
11676
  });
@@ -11681,7 +11681,7 @@ var require_request2 = __commonJS({
11681
11681
  "use strict";
11682
11682
  init_import_meta_url();
11683
11683
  var { extractBody, mixinBody, cloneBody } = require_body();
11684
- var { Headers: Headers2, fill: fillHeaders, HeadersList } = require_headers();
11684
+ var { Headers: Headers3, fill: fillHeaders, HeadersList } = require_headers();
11685
11685
  var { FinalizationRegistry: FinalizationRegistry2 } = require_dispatcher_weakref()();
11686
11686
  var util3 = require_util();
11687
11687
  var {
@@ -11901,7 +11901,7 @@ var require_request2 = __commonJS({
11901
11901
  requestFinalizer.register(this, { signal, abort: abort2 });
11902
11902
  }
11903
11903
  }
11904
- this[kHeaders] = new Headers2();
11904
+ this[kHeaders] = new Headers3();
11905
11905
  this[kHeaders][kHeadersList] = request.headersList;
11906
11906
  this[kHeaders][kGuard] = "request";
11907
11907
  this[kHeaders][kRealm] = this[kRealm];
@@ -11914,7 +11914,7 @@ var require_request2 = __commonJS({
11914
11914
  this[kHeaders][kGuard] = "request-no-cors";
11915
11915
  }
11916
11916
  if (Object.keys(init).length !== 0) {
11917
- let headers = new Headers2(this[kHeaders]);
11917
+ let headers = new Headers3(this[kHeaders]);
11918
11918
  if (init.headers !== void 0) {
11919
11919
  headers = init.headers;
11920
11920
  }
@@ -12078,7 +12078,7 @@ var require_request2 = __commonJS({
12078
12078
  const clonedRequestObject = new Request2(kInit);
12079
12079
  clonedRequestObject[kState] = clonedRequest;
12080
12080
  clonedRequestObject[kRealm] = this[kRealm];
12081
- clonedRequestObject[kHeaders] = new Headers2();
12081
+ clonedRequestObject[kHeaders] = new Headers3();
12082
12082
  clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList;
12083
12083
  clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard];
12084
12084
  clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm];
@@ -12537,13 +12537,13 @@ var require_fetch = __commonJS({
12537
12537
  "use strict";
12538
12538
  init_import_meta_url();
12539
12539
  var {
12540
- Response,
12540
+ Response: Response2,
12541
12541
  makeNetworkError,
12542
12542
  makeAppropriateNetworkError,
12543
12543
  filterResponse,
12544
12544
  makeResponse
12545
12545
  } = require_response();
12546
- var { Headers: Headers2 } = require_headers();
12546
+ var { Headers: Headers3 } = require_headers();
12547
12547
  var { Request: Request2, makeRequest } = require_request2();
12548
12548
  var zlib = require("zlib");
12549
12549
  var {
@@ -12672,7 +12672,7 @@ var require_fetch = __commonJS({
12672
12672
  );
12673
12673
  return;
12674
12674
  }
12675
- responseObject = new Response();
12675
+ responseObject = new Response2();
12676
12676
  responseObject[kState] = response;
12677
12677
  responseObject[kRealm] = relevantRealm;
12678
12678
  responseObject[kHeaders][kHeadersList] = response.headersList;
@@ -13415,7 +13415,7 @@ var require_fetch = __commonJS({
13415
13415
  }
13416
13416
  let codings = [];
13417
13417
  let location = "";
13418
- const headers = new Headers2();
13418
+ const headers = new Headers3();
13419
13419
  for (let n = 0; n < headersList.length; n += 2) {
13420
13420
  const key2 = headersList[n + 0].toString("latin1");
13421
13421
  const val = headersList[n + 1].toString("latin1");
@@ -18797,7 +18797,7 @@ var require_lodash = __commonJS({
18797
18797
  }
18798
18798
  return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
18799
18799
  });
18800
- function join13(array, separator) {
18800
+ function join14(array, separator) {
18801
18801
  return array == null ? "" : nativeJoin.call(array, separator);
18802
18802
  }
18803
18803
  function last(array) {
@@ -20716,7 +20716,7 @@ var require_lodash = __commonJS({
20716
20716
  lodash.isUndefined = isUndefined;
20717
20717
  lodash.isWeakMap = isWeakMap;
20718
20718
  lodash.isWeakSet = isWeakSet;
20719
- lodash.join = join13;
20719
+ lodash.join = join14;
20720
20720
  lodash.kebabCase = kebabCase;
20721
20721
  lodash.last = last;
20722
20722
  lodash.lastIndexOf = lastIndexOf;
@@ -28941,14 +28941,14 @@ var require_nbind = __commonJS({
28941
28941
  function reportProblem(problem, id, kind, structureType, place) {
28942
28942
  throw new Error(problem + " type " + kind.replace("X", id + "?") + (structureType ? " with flag " + structureType : "") + " in " + place);
28943
28943
  }
28944
- function getComplexType(id, constructType2, getType3, queryType2, place, kind, prevStructure, depth) {
28944
+ function getComplexType(id, constructType2, getType4, queryType2, place, kind, prevStructure, depth) {
28945
28945
  if (kind === void 0) {
28946
28946
  kind = "X";
28947
28947
  }
28948
28948
  if (depth === void 0) {
28949
28949
  depth = 1;
28950
28950
  }
28951
- var result = getType3(id);
28951
+ var result = getType4(id);
28952
28952
  if (result)
28953
28953
  return result;
28954
28954
  var query = queryType2(id);
@@ -28967,7 +28967,7 @@ var require_nbind = __commonJS({
28967
28967
  if (problem)
28968
28968
  reportProblem(problem, id, kind, structureType, place || "?");
28969
28969
  var subId = query.paramList[0];
28970
- var subType = getComplexType(subId, constructType2, getType3, queryType2, place, kind, structure, depth + 1);
28970
+ var subType = getComplexType(subId, constructType2, getType4, queryType2, place, kind, structure, depth + 1);
28971
28971
  var srcSpec;
28972
28972
  var spec = { flags: structure[0], id, name: "", paramList: [subType] };
28973
28973
  var argList2 = [];
@@ -28996,7 +28996,7 @@ var require_nbind = __commonJS({
28996
28996
  case 9:
28997
28997
  for (var _i = 0, _a2 = query.paramList[1]; _i < _a2.length; _i++) {
28998
28998
  var paramId = _a2[_i];
28999
- var paramType = getComplexType(paramId, constructType2, getType3, queryType2, place, kind, structure, depth + 1);
28999
+ var paramType = getComplexType(paramId, constructType2, getType4, queryType2, place, kind, structure, depth + 1);
29000
29000
  argList2.push(paramType.name);
29001
29001
  spec.paramList.push(paramType);
29002
29002
  }
@@ -75216,7 +75216,7 @@ var require_util3 = __commonJS({
75216
75216
  "../../node_modules/ink/node_modules/chalk/source/util.js"(exports2, module2) {
75217
75217
  "use strict";
75218
75218
  init_import_meta_url();
75219
- var stringReplaceAll = (string, substring, replacer) => {
75219
+ var stringReplaceAll = (string, substring, replacer2) => {
75220
75220
  let index = string.indexOf(substring);
75221
75221
  if (index === -1) {
75222
75222
  return string;
@@ -75225,7 +75225,7 @@ var require_util3 = __commonJS({
75225
75225
  let endIndex = 0;
75226
75226
  let returnValue = "";
75227
75227
  do {
75228
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
75228
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer2;
75229
75229
  endIndex = index + substringLength;
75230
75230
  index = string.indexOf(substring, endIndex);
75231
75231
  } while (index !== -1);
@@ -99691,7 +99691,7 @@ var require_get_intrinsic = __commonJS({
99691
99691
  if (arguments.length > 1 && typeof allowMissing !== "boolean") {
99692
99692
  throw new $TypeError('"allowMissing" argument must be a boolean');
99693
99693
  }
99694
- if ($exec(/^%?[^%]*%?$/g, name) === null) {
99694
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
99695
99695
  throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
99696
99696
  }
99697
99697
  var parts = stringToPath(name);
@@ -103396,7 +103396,7 @@ var require_view = __commonJS({
103396
103396
  var dirname12 = path41.dirname;
103397
103397
  var basename5 = path41.basename;
103398
103398
  var extname5 = path41.extname;
103399
- var join13 = path41.join;
103399
+ var join14 = path41.join;
103400
103400
  var resolve15 = path41.resolve;
103401
103401
  module2.exports = View;
103402
103402
  function View(name, options6) {
@@ -103444,12 +103444,12 @@ var require_view = __commonJS({
103444
103444
  };
103445
103445
  View.prototype.resolve = function resolve16(dir, file) {
103446
103446
  var ext = this.ext;
103447
- var path42 = join13(dir, file);
103447
+ var path42 = join14(dir, file);
103448
103448
  var stat3 = tryStat(path42);
103449
103449
  if (stat3 && stat3.isFile()) {
103450
103450
  return path42;
103451
103451
  }
103452
- path42 = join13(dir, basename5(file, ext), "index" + ext);
103452
+ path42 = join14(dir, basename5(file, ext), "index" + ext);
103453
103453
  stat3 = tryStat(path42);
103454
103454
  if (stat3 && stat3.isFile()) {
103455
103455
  return path42;
@@ -104584,7 +104584,7 @@ var require_send = __commonJS({
104584
104584
  var Stream = require("stream");
104585
104585
  var util3 = require("util");
104586
104586
  var extname5 = path41.extname;
104587
- var join13 = path41.join;
104587
+ var join14 = path41.join;
104588
104588
  var normalize2 = path41.normalize;
104589
104589
  var resolve15 = path41.resolve;
104590
104590
  var sep2 = path41.sep;
@@ -104803,7 +104803,7 @@ var require_send = __commonJS({
104803
104803
  return res;
104804
104804
  }
104805
104805
  parts = path42.split(sep2);
104806
- path42 = normalize2(join13(root, path42));
104806
+ path42 = normalize2(join14(root, path42));
104807
104807
  } else {
104808
104808
  if (UP_PATH_REGEXP.test(path42)) {
104809
104809
  debug('malicious path "%s"', path42);
@@ -104944,7 +104944,7 @@ var require_send = __commonJS({
104944
104944
  return self2.onStatError(err2);
104945
104945
  return self2.error(404);
104946
104946
  }
104947
- var p = join13(path42, self2._index[i2]);
104947
+ var p = join14(path42, self2._index[i2]);
104948
104948
  debug('stat "%s"', p);
104949
104949
  fs18.stat(p, function(err3, stat3) {
104950
104950
  if (err3)
@@ -106759,7 +106759,7 @@ var require_mediaType = __commonJS({
106759
106759
  var priorities = provided.map(function getPriority(type2, index) {
106760
106760
  return getMediaTypePriority(type2, accepts, index);
106761
106761
  });
106762
- return priorities.filter(isQuality).sort(compareSpecs).map(function getType3(priority) {
106762
+ return priorities.filter(isQuality).sort(compareSpecs).map(function getType4(priority) {
106763
106763
  return provided[priorities.indexOf(priority)];
106764
106764
  });
106765
106765
  }
@@ -107527,9 +107527,9 @@ var require_response2 = __commonJS({
107527
107527
  }
107528
107528
  var app = this.app;
107529
107529
  var escape2 = app.get("json escape");
107530
- var replacer = app.get("json replacer");
107530
+ var replacer2 = app.get("json replacer");
107531
107531
  var spaces = app.get("json spaces");
107532
- var body = stringify(val, replacer, spaces, escape2);
107532
+ var body = stringify(val, replacer2, spaces, escape2);
107533
107533
  if (!this.get("Content-Type")) {
107534
107534
  this.set("Content-Type", "application/json");
107535
107535
  }
@@ -107549,9 +107549,9 @@ var require_response2 = __commonJS({
107549
107549
  }
107550
107550
  var app = this.app;
107551
107551
  var escape2 = app.get("json escape");
107552
- var replacer = app.get("json replacer");
107552
+ var replacer2 = app.get("json replacer");
107553
107553
  var spaces = app.get("json spaces");
107554
- var body = stringify(val, replacer, spaces, escape2);
107554
+ var body = stringify(val, replacer2, spaces, escape2);
107555
107555
  var callback = this.req.query[app.get("jsonp callback name")];
107556
107556
  if (!this.get("Content-Type")) {
107557
107557
  this.set("X-Content-Type-Options", "nosniff");
@@ -107901,8 +107901,8 @@ var require_response2 = __commonJS({
107901
107901
  }
107902
107902
  file.pipe(res2);
107903
107903
  }
107904
- function stringify(value, replacer, spaces, escape2) {
107905
- var json = replacer || spaces ? JSON.stringify(value, replacer, spaces) : JSON.stringify(value);
107904
+ function stringify(value, replacer2, spaces, escape2) {
107905
+ var json = replacer2 || spaces ? JSON.stringify(value, replacer2, spaces) : JSON.stringify(value);
107906
107906
  if (escape2 && typeof json === "string") {
107907
107907
  json = json.replace(/[<>&]/g, function(c) {
107908
107908
  switch (c.charCodeAt(0)) {
@@ -118146,7 +118146,7 @@ var require_fast_safe_stringify = __commonJS({
118146
118146
  edgesLimit: Number.MAX_SAFE_INTEGER
118147
118147
  };
118148
118148
  }
118149
- function stringify(obj, replacer, spacer, options6) {
118149
+ function stringify(obj, replacer2, spacer, options6) {
118150
118150
  if (typeof options6 === "undefined") {
118151
118151
  options6 = defaultOptions();
118152
118152
  }
@@ -118154,9 +118154,9 @@ var require_fast_safe_stringify = __commonJS({
118154
118154
  var res;
118155
118155
  try {
118156
118156
  if (replacerStack.length === 0) {
118157
- res = JSON.stringify(obj, replacer, spacer);
118157
+ res = JSON.stringify(obj, replacer2, spacer);
118158
118158
  } else {
118159
- res = JSON.stringify(obj, replaceGetterValues(replacer), spacer);
118159
+ res = JSON.stringify(obj, replaceGetterValues(replacer2), spacer);
118160
118160
  }
118161
118161
  } catch (_2) {
118162
118162
  return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]");
@@ -118228,7 +118228,7 @@ var require_fast_safe_stringify = __commonJS({
118228
118228
  }
118229
118229
  return 0;
118230
118230
  }
118231
- function deterministicStringify(obj, replacer, spacer, options6) {
118231
+ function deterministicStringify(obj, replacer2, spacer, options6) {
118232
118232
  if (typeof options6 === "undefined") {
118233
118233
  options6 = defaultOptions();
118234
118234
  }
@@ -118236,9 +118236,9 @@ var require_fast_safe_stringify = __commonJS({
118236
118236
  var res;
118237
118237
  try {
118238
118238
  if (replacerStack.length === 0) {
118239
- res = JSON.stringify(tmp5, replacer, spacer);
118239
+ res = JSON.stringify(tmp5, replacer2, spacer);
118240
118240
  } else {
118241
- res = JSON.stringify(tmp5, replaceGetterValues(replacer), spacer);
118241
+ res = JSON.stringify(tmp5, replaceGetterValues(replacer2), spacer);
118242
118242
  }
118243
118243
  } catch (_2) {
118244
118244
  return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]");
@@ -118302,8 +118302,8 @@ var require_fast_safe_stringify = __commonJS({
118302
118302
  stack.pop();
118303
118303
  }
118304
118304
  }
118305
- function replaceGetterValues(replacer) {
118306
- replacer = typeof replacer !== "undefined" ? replacer : function(k, v) {
118305
+ function replaceGetterValues(replacer2) {
118306
+ replacer2 = typeof replacer2 !== "undefined" ? replacer2 : function(k, v) {
118307
118307
  return v;
118308
118308
  };
118309
118309
  return function(key2, val) {
@@ -118317,7 +118317,7 @@ var require_fast_safe_stringify = __commonJS({
118317
118317
  }
118318
118318
  }
118319
118319
  }
118320
- return replacer.call(this, key2, val);
118320
+ return replacer2.call(this, key2, val);
118321
118321
  };
118322
118322
  }
118323
118323
  }
@@ -118617,21 +118617,21 @@ var require_shim = __commonJS({
118617
118617
  var define2 = require_define_properties();
118618
118618
  var getPolyfill = require_polyfill();
118619
118619
  module2.exports = function shimGlobal() {
118620
- var polyfill = getPolyfill();
118620
+ var polyfill2 = getPolyfill();
118621
118621
  if (define2.supportsDescriptors) {
118622
- var descriptor2 = Object.getOwnPropertyDescriptor(polyfill, "globalThis");
118623
- if (!descriptor2 || descriptor2.configurable && (descriptor2.enumerable || !descriptor2.writable || globalThis !== polyfill)) {
118624
- Object.defineProperty(polyfill, "globalThis", {
118622
+ var descriptor2 = Object.getOwnPropertyDescriptor(polyfill2, "globalThis");
118623
+ if (!descriptor2 || descriptor2.configurable && (descriptor2.enumerable || !descriptor2.writable || globalThis !== polyfill2)) {
118624
+ Object.defineProperty(polyfill2, "globalThis", {
118625
118625
  configurable: true,
118626
118626
  enumerable: false,
118627
- value: polyfill,
118627
+ value: polyfill2,
118628
118628
  writable: true
118629
118629
  });
118630
118630
  }
118631
- } else if (typeof globalThis !== "object" || globalThis !== polyfill) {
118632
- polyfill.globalThis = polyfill;
118631
+ } else if (typeof globalThis !== "object" || globalThis !== polyfill2) {
118632
+ polyfill2.globalThis = polyfill2;
118633
118633
  }
118634
- return polyfill;
118634
+ return polyfill2;
118635
118635
  };
118636
118636
  }
118637
118637
  });
@@ -118645,9 +118645,9 @@ var require_globalthis = __commonJS({
118645
118645
  var implementation = require_implementation3();
118646
118646
  var getPolyfill = require_polyfill();
118647
118647
  var shim3 = require_shim();
118648
- var polyfill = getPolyfill();
118648
+ var polyfill2 = getPolyfill();
118649
118649
  var getGlobal = function() {
118650
- return polyfill;
118650
+ return polyfill2;
118651
118651
  };
118652
118652
  defineProperties(getGlobal, {
118653
118653
  getPolyfill,
@@ -129352,6 +129352,751 @@ var require_build3 = __commonJS({
129352
129352
  }
129353
129353
  });
129354
129354
 
129355
+ // ../../node_modules/mime/Mime.js
129356
+ var require_Mime = __commonJS({
129357
+ "../../node_modules/mime/Mime.js"(exports2, module2) {
129358
+ "use strict";
129359
+ init_import_meta_url();
129360
+ function Mime() {
129361
+ this._types = /* @__PURE__ */ Object.create(null);
129362
+ this._extensions = /* @__PURE__ */ Object.create(null);
129363
+ for (let i2 = 0; i2 < arguments.length; i2++) {
129364
+ this.define(arguments[i2]);
129365
+ }
129366
+ this.define = this.define.bind(this);
129367
+ this.getType = this.getType.bind(this);
129368
+ this.getExtension = this.getExtension.bind(this);
129369
+ }
129370
+ Mime.prototype.define = function(typeMap, force) {
129371
+ for (let type2 in typeMap) {
129372
+ let extensions = typeMap[type2].map(function(t2) {
129373
+ return t2.toLowerCase();
129374
+ });
129375
+ type2 = type2.toLowerCase();
129376
+ for (let i2 = 0; i2 < extensions.length; i2++) {
129377
+ const ext = extensions[i2];
129378
+ if (ext[0] === "*") {
129379
+ continue;
129380
+ }
129381
+ if (!force && ext in this._types) {
129382
+ throw new Error(
129383
+ 'Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type2 + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type2 + '".'
129384
+ );
129385
+ }
129386
+ this._types[ext] = type2;
129387
+ }
129388
+ if (force || !this._extensions[type2]) {
129389
+ const ext = extensions[0];
129390
+ this._extensions[type2] = ext[0] !== "*" ? ext : ext.substr(1);
129391
+ }
129392
+ }
129393
+ };
129394
+ Mime.prototype.getType = function(path41) {
129395
+ path41 = String(path41);
129396
+ let last = path41.replace(/^.*[/\\]/, "").toLowerCase();
129397
+ let ext = last.replace(/^.*\./, "").toLowerCase();
129398
+ let hasPath = last.length < path41.length;
129399
+ let hasDot = ext.length < last.length - 1;
129400
+ return (hasDot || !hasPath) && this._types[ext] || null;
129401
+ };
129402
+ Mime.prototype.getExtension = function(type2) {
129403
+ type2 = /^\s*([^;\s]*)/.test(type2) && RegExp.$1;
129404
+ return type2 && this._extensions[type2.toLowerCase()] || null;
129405
+ };
129406
+ module2.exports = Mime;
129407
+ }
129408
+ });
129409
+
129410
+ // ../../node_modules/mime/types/standard.js
129411
+ var require_standard = __commonJS({
129412
+ "../../node_modules/mime/types/standard.js"(exports2, module2) {
129413
+ init_import_meta_url();
129414
+ module2.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"] };
129415
+ }
129416
+ });
129417
+
129418
+ // ../../node_modules/mime/types/other.js
129419
+ var require_other = __commonJS({
129420
+ "../../node_modules/mime/types/other.js"(exports2, module2) {
129421
+ init_import_meta_url();
129422
+ module2.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"] };
129423
+ }
129424
+ });
129425
+
129426
+ // ../../node_modules/mime/index.js
129427
+ var require_mime2 = __commonJS({
129428
+ "../../node_modules/mime/index.js"(exports2, module2) {
129429
+ "use strict";
129430
+ init_import_meta_url();
129431
+ var Mime = require_Mime();
129432
+ module2.exports = new Mime(require_standard(), require_other());
129433
+ }
129434
+ });
129435
+
129436
+ // ../pages-shared/environment-polyfills/index.ts
129437
+ var polyfill;
129438
+ var init_environment_polyfills = __esm({
129439
+ "../pages-shared/environment-polyfills/index.ts"() {
129440
+ init_import_meta_url();
129441
+ polyfill = (environment) => {
129442
+ Object.entries(environment).map(([name, value]) => {
129443
+ Object.defineProperty(globalThis, name, {
129444
+ value,
129445
+ configurable: true,
129446
+ enumerable: true,
129447
+ writable: true
129448
+ });
129449
+ });
129450
+ };
129451
+ }
129452
+ });
129453
+
129454
+ // ../pages-shared/environment-polyfills/miniflare-tre.ts
129455
+ var miniflare_tre_exports = {};
129456
+ var import_tre;
129457
+ var init_miniflare_tre = __esm({
129458
+ "../pages-shared/environment-polyfills/miniflare-tre.ts"() {
129459
+ init_import_meta_url();
129460
+ import_tre = require("@miniflare/tre");
129461
+ init_environment_polyfills();
129462
+ polyfill({
129463
+ fetch: import_tre.fetch,
129464
+ Headers: import_tre.Headers,
129465
+ Request: import_tre.Request,
129466
+ Response: import_tre.Response
129467
+ });
129468
+ }
129469
+ });
129470
+
129471
+ // ../pages-shared/environment-polyfills/miniflare.ts
129472
+ var miniflare_exports = {};
129473
+ var import_core2;
129474
+ var init_miniflare = __esm({
129475
+ "../pages-shared/environment-polyfills/miniflare.ts"() {
129476
+ init_import_meta_url();
129477
+ import_core2 = require("@miniflare/core");
129478
+ init_environment_polyfills();
129479
+ polyfill({
129480
+ fetch: import_core2.fetch,
129481
+ Headers: import_core2.Headers,
129482
+ Request: import_core2.Request,
129483
+ Response: import_core2.Response
129484
+ });
129485
+ }
129486
+ });
129487
+
129488
+ // ../pages-shared/asset-server/responses.ts
129489
+ function mergeHeaders(base, extra) {
129490
+ base = new Headers(base ?? {});
129491
+ extra = new Headers(extra ?? {});
129492
+ return new Headers({
129493
+ ...Object.fromEntries(base.entries()),
129494
+ ...Object.fromEntries(extra.entries())
129495
+ });
129496
+ }
129497
+ var OkResponse, MovedPermanentlyResponse, FoundResponse, NotModifiedResponse, PermanentRedirectResponse, NotFoundResponse, MethodNotAllowedResponse, NotAcceptableResponse, InternalServerErrorResponse, SeeOtherResponse, TemporaryRedirectResponse;
129498
+ var init_responses = __esm({
129499
+ "../pages-shared/asset-server/responses.ts"() {
129500
+ init_import_meta_url();
129501
+ OkResponse = class extends Response {
129502
+ constructor(...[body, init]) {
129503
+ super(body, {
129504
+ ...init,
129505
+ status: 200,
129506
+ statusText: "OK"
129507
+ });
129508
+ }
129509
+ };
129510
+ MovedPermanentlyResponse = class extends Response {
129511
+ constructor(location, init) {
129512
+ super(`Redirecting to ${location}`, {
129513
+ ...init,
129514
+ status: 301,
129515
+ statusText: "Moved Permanently",
129516
+ headers: mergeHeaders(init?.headers, {
129517
+ location
129518
+ })
129519
+ });
129520
+ }
129521
+ };
129522
+ FoundResponse = class extends Response {
129523
+ constructor(location, init) {
129524
+ super(`Redirecting to ${location}`, {
129525
+ ...init,
129526
+ status: 302,
129527
+ statusText: "Found",
129528
+ headers: mergeHeaders(init?.headers, {
129529
+ location
129530
+ })
129531
+ });
129532
+ }
129533
+ };
129534
+ NotModifiedResponse = class extends Response {
129535
+ constructor(...[_body, _init]) {
129536
+ super(void 0, {
129537
+ status: 304,
129538
+ statusText: "Not Modified"
129539
+ });
129540
+ }
129541
+ };
129542
+ PermanentRedirectResponse = class extends Response {
129543
+ constructor(location, init) {
129544
+ super(void 0, {
129545
+ ...init,
129546
+ status: 308,
129547
+ statusText: "Permanent Redirect",
129548
+ headers: mergeHeaders(init?.headers, {
129549
+ location
129550
+ })
129551
+ });
129552
+ }
129553
+ };
129554
+ NotFoundResponse = class extends Response {
129555
+ constructor(...[body, init]) {
129556
+ super(body, {
129557
+ ...init,
129558
+ status: 404,
129559
+ statusText: "Not Found"
129560
+ });
129561
+ }
129562
+ };
129563
+ MethodNotAllowedResponse = class extends Response {
129564
+ constructor(...[body, init]) {
129565
+ super(body, {
129566
+ ...init,
129567
+ status: 405,
129568
+ statusText: "Method Not Allowed"
129569
+ });
129570
+ }
129571
+ };
129572
+ NotAcceptableResponse = class extends Response {
129573
+ constructor(...[body, init]) {
129574
+ super(body, {
129575
+ ...init,
129576
+ status: 406,
129577
+ statusText: "Not Acceptable"
129578
+ });
129579
+ }
129580
+ };
129581
+ InternalServerErrorResponse = class extends Response {
129582
+ constructor(err2, init) {
129583
+ let body = void 0;
129584
+ if (globalThis.DEBUG) {
129585
+ body = `${err2.message}
129586
+
129587
+ ${err2.stack}`;
129588
+ }
129589
+ super(body, {
129590
+ ...init,
129591
+ status: 500,
129592
+ statusText: "Internal Server Error"
129593
+ });
129594
+ }
129595
+ };
129596
+ SeeOtherResponse = class extends Response {
129597
+ constructor(location, init) {
129598
+ super(`Redirecting to ${location}`, {
129599
+ ...init,
129600
+ status: 303,
129601
+ statusText: "See Other",
129602
+ headers: mergeHeaders(init?.headers, { location })
129603
+ });
129604
+ }
129605
+ };
129606
+ TemporaryRedirectResponse = class extends Response {
129607
+ constructor(location, init) {
129608
+ super(`Redirecting to ${location}`, {
129609
+ ...init,
129610
+ status: 307,
129611
+ statusText: "Temporary Redirect",
129612
+ headers: mergeHeaders(init?.headers, { location })
129613
+ });
129614
+ }
129615
+ };
129616
+ }
129617
+ });
129618
+
129619
+ // ../pages-shared/asset-server/rulesEngine.ts
129620
+ var ESCAPE_REGEX_CHARACTERS, escapeRegex, HOST_PLACEHOLDER_REGEX, PLACEHOLDER_REGEX2, replacer, generateRulesMatcher;
129621
+ var init_rulesEngine = __esm({
129622
+ "../pages-shared/asset-server/rulesEngine.ts"() {
129623
+ init_import_meta_url();
129624
+ ESCAPE_REGEX_CHARACTERS = /[-/\\^$*+?.()|[\]{}]/g;
129625
+ escapeRegex = (str) => {
129626
+ return str.replace(ESCAPE_REGEX_CHARACTERS, "\\$&");
129627
+ };
129628
+ HOST_PLACEHOLDER_REGEX = /(?<=^https:\\\/\\\/[^/]*?):([^\\]+)(?=\\)/g;
129629
+ PLACEHOLDER_REGEX2 = /:(\w+)/g;
129630
+ replacer = (str, replacements) => {
129631
+ for (const [replacement, value] of Object.entries(replacements)) {
129632
+ str = str.replaceAll(`:${replacement}`, value);
129633
+ }
129634
+ return str;
129635
+ };
129636
+ generateRulesMatcher = (rules, replacerFn = (match) => match) => {
129637
+ if (!rules)
129638
+ return () => [];
129639
+ const compiledRules = Object.entries(rules).map(([rule, match]) => {
129640
+ const crossHost = rule.startsWith("https://");
129641
+ rule = rule.split("*").map(escapeRegex).join("(?<splat>.*)");
129642
+ const host_matches = rule.matchAll(HOST_PLACEHOLDER_REGEX);
129643
+ for (const host_match of host_matches) {
129644
+ rule = rule.split(host_match[0]).join(`(?<${host_match[1]}>[^/.]+)`);
129645
+ }
129646
+ const path_matches = rule.matchAll(PLACEHOLDER_REGEX2);
129647
+ for (const path_match of path_matches) {
129648
+ rule = rule.split(path_match[0]).join(`(?<${path_match[1]}>[^/]+)`);
129649
+ }
129650
+ rule = "^" + rule + "$";
129651
+ try {
129652
+ const regExp = new RegExp(rule);
129653
+ return [{ crossHost, regExp }, match];
129654
+ } catch {
129655
+ }
129656
+ }).filter((value) => value !== void 0);
129657
+ return ({ request }) => {
129658
+ const { pathname, host } = new URL(request.url);
129659
+ return compiledRules.map(([{ crossHost, regExp }, match]) => {
129660
+ const test = crossHost ? `https://${host}${pathname}` : pathname;
129661
+ const result = regExp.exec(test);
129662
+ if (result) {
129663
+ return replacerFn(match, result.groups || {});
129664
+ }
129665
+ }).filter((value) => value !== void 0);
129666
+ };
129667
+ };
129668
+ }
129669
+ });
129670
+
129671
+ // ../pages-shared/asset-server/url.ts
129672
+ function stringifyURLToRootRelativePathname(url3) {
129673
+ return `${url3.pathname}${url3.search}${url3.hash}`;
129674
+ }
129675
+ var init_url = __esm({
129676
+ "../pages-shared/asset-server/url.ts"() {
129677
+ init_import_meta_url();
129678
+ }
129679
+ });
129680
+
129681
+ // ../pages-shared/asset-server/handler.ts
129682
+ var handler_exports = {};
129683
+ __export(handler_exports, {
129684
+ ANALYTICS_VERSION: () => ANALYTICS_VERSION2,
129685
+ ASSET_PRESERVATION_CACHE: () => ASSET_PRESERVATION_CACHE,
129686
+ CACHE_CONTROL_BROWSER: () => CACHE_CONTROL_BROWSER,
129687
+ HEADERS_VERSION: () => HEADERS_VERSION2,
129688
+ HEADERS_VERSION_V1: () => HEADERS_VERSION_V1,
129689
+ REDIRECTS_VERSION: () => REDIRECTS_VERSION2,
129690
+ generateHandler: () => generateHandler,
129691
+ getResponseFromMatch: () => getResponseFromMatch,
129692
+ normaliseHeaders: () => normaliseHeaders,
129693
+ parseQualityWeightedList: () => parseQualityWeightedList
129694
+ });
129695
+ function normaliseHeaders(headers) {
129696
+ if (headers.version === HEADERS_VERSION2) {
129697
+ return headers.rules;
129698
+ } else if (headers.version === HEADERS_VERSION_V1) {
129699
+ return Object.keys(headers.rules).reduce(
129700
+ (acc, key2) => {
129701
+ acc[key2] = {
129702
+ set: headers.rules[key2]
129703
+ };
129704
+ return acc;
129705
+ },
129706
+ {}
129707
+ );
129708
+ } else {
129709
+ return {};
129710
+ }
129711
+ }
129712
+ async function generateHandler({
129713
+ request,
129714
+ metadata,
129715
+ xServerEnvHeader,
129716
+ logError,
129717
+ findAssetEntryForPath,
129718
+ getAssetKey,
129719
+ negotiateContent,
129720
+ fetchAsset,
129721
+ generateNotFoundResponse = async (notFoundRequest, notFoundFindAssetEntryForPath, notFoundServeAsset) => {
129722
+ let assetEntry;
129723
+ if (assetEntry = await notFoundFindAssetEntryForPath("/index.html")) {
129724
+ return notFoundServeAsset(assetEntry, { preserve: false });
129725
+ }
129726
+ return new NotFoundResponse();
129727
+ },
129728
+ attachAdditionalHeaders = () => {
129729
+ },
129730
+ caches,
129731
+ waitUntil
129732
+ }) {
129733
+ const url3 = new URL(request.url);
129734
+ const { protocol, host, search } = url3;
129735
+ let { pathname } = url3;
129736
+ const earlyHintsCache = metadata.deploymentId ? await caches?.open(`eh:${metadata.deploymentId}`) : void 0;
129737
+ const headerRules = metadata.headers ? normaliseHeaders(metadata.headers) : {};
129738
+ const staticRules = metadata.redirects?.version === REDIRECTS_VERSION2 ? metadata.redirects.staticRules || {} : {};
129739
+ const staticRedirectsMatcher = () => {
129740
+ const withHostMatch = staticRules[`https://${host}${pathname}`];
129741
+ const withoutHostMatch = staticRules[pathname];
129742
+ if (withHostMatch && withoutHostMatch) {
129743
+ if (withHostMatch.lineNumber < withoutHostMatch.lineNumber) {
129744
+ return withHostMatch;
129745
+ } else {
129746
+ return withoutHostMatch;
129747
+ }
129748
+ }
129749
+ return withHostMatch || withoutHostMatch;
129750
+ };
129751
+ const generateRedirectsMatcher = () => generateRulesMatcher(
129752
+ metadata.redirects?.version === REDIRECTS_VERSION2 ? metadata.redirects.rules : {},
129753
+ ({ status, to }, replacements) => ({
129754
+ status,
129755
+ to: replacer(to, replacements)
129756
+ })
129757
+ );
129758
+ let assetEntry;
129759
+ async function generateResponse() {
129760
+ const match = staticRedirectsMatcher() || generateRedirectsMatcher()({ request })[0];
129761
+ if (match) {
129762
+ return getResponseFromMatch(match, url3);
129763
+ }
129764
+ if (!request.method.match(/^(get|head)$/i)) {
129765
+ return new MethodNotAllowedResponse();
129766
+ }
129767
+ try {
129768
+ pathname = globalThis.decodeURIComponent(pathname);
129769
+ } catch (err2) {
129770
+ }
129771
+ if (pathname.endsWith("/")) {
129772
+ if (assetEntry = await findAssetEntryForPath(`${pathname}index.html`)) {
129773
+ return serveAsset(assetEntry);
129774
+ } else if (pathname.endsWith("/index/")) {
129775
+ return new PermanentRedirectResponse(
129776
+ `/${pathname.slice(1, -"index/".length)}${search}`
129777
+ );
129778
+ } else if (assetEntry = await findAssetEntryForPath(
129779
+ `${pathname.replace(/\/$/, ".html")}`
129780
+ )) {
129781
+ return new PermanentRedirectResponse(
129782
+ `/${pathname.slice(1, -1)}${search}`
129783
+ );
129784
+ } else {
129785
+ return notFound();
129786
+ }
129787
+ }
129788
+ if (assetEntry = await findAssetEntryForPath(pathname)) {
129789
+ if (pathname.endsWith(".html")) {
129790
+ const extensionlessPath = pathname.slice(0, -".html".length);
129791
+ if (extensionlessPath.endsWith("/index")) {
129792
+ return new PermanentRedirectResponse(
129793
+ `${extensionlessPath.replace(/\/index$/, "/")}${search}`
129794
+ );
129795
+ } else if (await findAssetEntryForPath(extensionlessPath) || extensionlessPath === "/") {
129796
+ return serveAsset(assetEntry);
129797
+ } else {
129798
+ return new PermanentRedirectResponse(`${extensionlessPath}${search}`);
129799
+ }
129800
+ } else {
129801
+ return serveAsset(assetEntry);
129802
+ }
129803
+ } else if (pathname.endsWith("/index")) {
129804
+ return new PermanentRedirectResponse(
129805
+ `/${pathname.slice(1, -"index".length)}${search}`
129806
+ );
129807
+ } else if (assetEntry = await findAssetEntryForPath(`${pathname}.html`)) {
129808
+ return serveAsset(assetEntry);
129809
+ } else if (hasFileExtension(pathname)) {
129810
+ return notFound();
129811
+ }
129812
+ if (assetEntry = await findAssetEntryForPath(`${pathname}/index.html`)) {
129813
+ return new PermanentRedirectResponse(`${pathname}/${search}`);
129814
+ } else {
129815
+ return notFound();
129816
+ }
129817
+ }
129818
+ async function attachHeaders(response) {
129819
+ const existingHeaders = new Headers(response.headers);
129820
+ const extraHeaders = new Headers({
129821
+ "access-control-allow-origin": "*",
129822
+ "referrer-policy": "strict-origin-when-cross-origin",
129823
+ ...existingHeaders.has("content-type") ? { "x-content-type-options": "nosniff" } : {}
129824
+ });
129825
+ const headers = new Headers({
129826
+ ...Object.fromEntries(existingHeaders.entries()),
129827
+ ...Object.fromEntries(extraHeaders.entries())
129828
+ });
129829
+ if (earlyHintsCache) {
129830
+ const preEarlyHintsHeaders = new Headers(headers);
129831
+ const earlyHintsCacheKey = `${protocol}//${host}${pathname}`;
129832
+ const earlyHintsResponse = await earlyHintsCache.match(
129833
+ earlyHintsCacheKey
129834
+ );
129835
+ if (earlyHintsResponse) {
129836
+ const earlyHintsLinkHeader = earlyHintsResponse.headers.get("Link");
129837
+ if (earlyHintsLinkHeader) {
129838
+ headers.set("Link", earlyHintsLinkHeader);
129839
+ }
129840
+ }
129841
+ const clonedResponse = response.clone();
129842
+ if (waitUntil) {
129843
+ waitUntil(
129844
+ (async () => {
129845
+ try {
129846
+ const links = [];
129847
+ const transformedResponse = new HTMLRewriter().on("link[rel~=preconnect],link[rel~=preload]", {
129848
+ element(element) {
129849
+ for (const [attributeName] of element.attributes) {
129850
+ if (!ALLOWED_EARLY_HINT_LINK_ATTRIBUTES.includes(
129851
+ attributeName.toLowerCase()
129852
+ )) {
129853
+ return;
129854
+ }
129855
+ }
129856
+ const href = element.getAttribute("href") || void 0;
129857
+ const rel = element.getAttribute("rel") || void 0;
129858
+ const as = element.getAttribute("as") || void 0;
129859
+ if (href && !href.startsWith("data:") && rel) {
129860
+ links.push({ href, rel, as });
129861
+ }
129862
+ }
129863
+ }).transform(clonedResponse);
129864
+ await transformedResponse.text();
129865
+ links.forEach(({ href, rel, as }) => {
129866
+ let link = `<${href}>; rel="${rel}"`;
129867
+ if (as) {
129868
+ link += `; as=${as}`;
129869
+ }
129870
+ preEarlyHintsHeaders.append("Link", link);
129871
+ });
129872
+ const linkHeader = preEarlyHintsHeaders.get("Link");
129873
+ if (linkHeader) {
129874
+ await earlyHintsCache.put(
129875
+ earlyHintsCacheKey,
129876
+ new Response(null, { headers: { Link: linkHeader } })
129877
+ );
129878
+ }
129879
+ } catch (err2) {
129880
+ }
129881
+ })()
129882
+ );
129883
+ }
129884
+ }
129885
+ const headersMatcher = generateRulesMatcher(
129886
+ headerRules,
129887
+ ({ set = {}, unset = [] }, replacements) => {
129888
+ const replacedSet = {};
129889
+ Object.keys(set).forEach((key2) => {
129890
+ replacedSet[key2] = replacer(set[key2], replacements);
129891
+ });
129892
+ return {
129893
+ set: replacedSet,
129894
+ unset
129895
+ };
129896
+ }
129897
+ );
129898
+ const matches = headersMatcher({ request });
129899
+ const setMap = /* @__PURE__ */ new Set();
129900
+ matches.forEach(({ set = {}, unset = [] }) => {
129901
+ unset.forEach((key2) => {
129902
+ headers.delete(key2);
129903
+ });
129904
+ Object.keys(set).forEach((key2) => {
129905
+ if (setMap.has(key2.toLowerCase())) {
129906
+ headers.append(key2, set[key2]);
129907
+ } else {
129908
+ headers.set(key2, set[key2]);
129909
+ setMap.add(key2.toLowerCase());
129910
+ }
129911
+ });
129912
+ });
129913
+ return new Response(
129914
+ [101, 204, 205, 304].includes(response.status) ? null : response.body,
129915
+ {
129916
+ headers,
129917
+ status: response.status,
129918
+ statusText: response.statusText
129919
+ }
129920
+ );
129921
+ }
129922
+ return await attachHeaders(await generateResponse());
129923
+ async function serveAsset(servingAssetEntry, options6 = { preserve: true }) {
129924
+ let content;
129925
+ try {
129926
+ content = negotiateContent(request, servingAssetEntry);
129927
+ } catch (err2) {
129928
+ return new NotAcceptableResponse();
129929
+ }
129930
+ const assetKey = getAssetKey(servingAssetEntry, content);
129931
+ const etag = `"${assetKey}"`;
129932
+ const weakEtag = `W/${etag}`;
129933
+ const ifNoneMatch = request.headers.get("if-none-match");
129934
+ if (ifNoneMatch === weakEtag || ifNoneMatch === etag) {
129935
+ return new NotModifiedResponse();
129936
+ }
129937
+ try {
129938
+ const asset = await fetchAsset(assetKey);
129939
+ const headers = {
129940
+ etag,
129941
+ "content-type": asset.contentType
129942
+ };
129943
+ let encodeBody = "automatic";
129944
+ if (xServerEnvHeader) {
129945
+ headers["x-server-env"] = xServerEnvHeader;
129946
+ }
129947
+ if (content.encoding) {
129948
+ encodeBody = "manual";
129949
+ headers["cache-control"] = "no-transform";
129950
+ headers["content-encoding"] = content.encoding;
129951
+ }
129952
+ const response = new OkResponse(
129953
+ request.method === "HEAD" ? null : asset.body,
129954
+ {
129955
+ headers,
129956
+ encodeBody
129957
+ }
129958
+ );
129959
+ if (isCacheable(request)) {
129960
+ response.headers.append("cache-control", CACHE_CONTROL_BROWSER);
129961
+ }
129962
+ attachAdditionalHeaders(response, content, servingAssetEntry, asset);
129963
+ if (isPreview(new URL(request.url))) {
129964
+ response.headers.set("x-robots-tag", "noindex");
129965
+ }
129966
+ if (options6.preserve) {
129967
+ const preservedResponse = new Response(
129968
+ [101, 204, 205, 304].includes(response.status) ? null : response.clone().body,
129969
+ response
129970
+ );
129971
+ preservedResponse.headers.set(
129972
+ "cache-control",
129973
+ CACHE_CONTROL_PRESERVATION
129974
+ );
129975
+ preservedResponse.headers.set("x-robots-tag", "noindex");
129976
+ if (waitUntil && caches) {
129977
+ waitUntil(
129978
+ caches.open(ASSET_PRESERVATION_CACHE).then(
129979
+ (assetPreservationCache) => assetPreservationCache.put(request.url, preservedResponse)
129980
+ ).catch((err2) => {
129981
+ logError(err2);
129982
+ })
129983
+ );
129984
+ }
129985
+ }
129986
+ if (asset.contentType.startsWith("text/html") && metadata.analytics?.version === ANALYTICS_VERSION2) {
129987
+ return new HTMLRewriter().on("body", {
129988
+ element(e2) {
129989
+ e2.append(
129990
+ `<!-- Cloudflare Pages Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "${metadata.analytics?.token}"}'><\/script><!-- Cloudflare Pages Analytics -->`,
129991
+ { html: true }
129992
+ );
129993
+ }
129994
+ }).transform(response);
129995
+ }
129996
+ return response;
129997
+ } catch (err2) {
129998
+ logError(err2);
129999
+ return new InternalServerErrorResponse(err2);
130000
+ }
130001
+ }
130002
+ async function notFound() {
130003
+ if (caches) {
130004
+ const assetPreservationCache = await caches.open(
130005
+ ASSET_PRESERVATION_CACHE
130006
+ );
130007
+ const preservedResponse = await assetPreservationCache.match(request.url);
130008
+ if (preservedResponse) {
130009
+ return preservedResponse;
130010
+ }
130011
+ }
130012
+ let cwd2 = pathname;
130013
+ while (cwd2) {
130014
+ cwd2 = cwd2.slice(0, cwd2.lastIndexOf("/"));
130015
+ if (assetEntry = await findAssetEntryForPath(`${cwd2}/404.html`)) {
130016
+ let content;
130017
+ try {
130018
+ content = negotiateContent(request, assetEntry);
130019
+ } catch (err2) {
130020
+ return new NotAcceptableResponse();
130021
+ }
130022
+ const assetKey = getAssetKey(assetEntry, content);
130023
+ try {
130024
+ const { body, contentType } = await fetchAsset(assetKey);
130025
+ const response = new NotFoundResponse(body);
130026
+ response.headers.set("content-type", contentType);
130027
+ return response;
130028
+ } catch (err2) {
130029
+ logError(err2);
130030
+ return new InternalServerErrorResponse(err2);
130031
+ }
130032
+ }
130033
+ }
130034
+ return await generateNotFoundResponse(
130035
+ request,
130036
+ findAssetEntryForPath,
130037
+ serveAsset
130038
+ );
130039
+ }
130040
+ }
130041
+ function getResponseFromMatch({
130042
+ status,
130043
+ to
130044
+ }, requestUrl) {
130045
+ const destination = new URL(to, requestUrl);
130046
+ destination.search = destination.search || requestUrl.search;
130047
+ const location = destination.origin === requestUrl.origin ? stringifyURLToRootRelativePathname(destination) : destination.toString();
130048
+ switch (status) {
130049
+ case 301:
130050
+ return new MovedPermanentlyResponse(location);
130051
+ case 303:
130052
+ return new SeeOtherResponse(location);
130053
+ case 307:
130054
+ return new TemporaryRedirectResponse(location);
130055
+ case 308:
130056
+ return new PermanentRedirectResponse(location);
130057
+ case 302:
130058
+ default:
130059
+ return new FoundResponse(location);
130060
+ }
130061
+ }
130062
+ function parseQualityWeightedList(list = "") {
130063
+ const items = {};
130064
+ list.replace(/\s/g, "").split(",").forEach((el) => {
130065
+ const [item, weight] = el.split(";q=");
130066
+ items[item] = weight ? parseFloat(weight) : 1;
130067
+ });
130068
+ return items;
130069
+ }
130070
+ function isCacheable(request) {
130071
+ return !request.headers.has("authorization") && !request.headers.has("range");
130072
+ }
130073
+ function hasFileExtension(path41) {
130074
+ return /\/.+\.[a-z0-9]+$/i.test(path41);
130075
+ }
130076
+ function isPreview(url3) {
130077
+ if (url3.hostname.endsWith(".pages.dev")) {
130078
+ return url3.hostname.split(".").length > 3 ? true : false;
130079
+ }
130080
+ return false;
130081
+ }
130082
+ var ASSET_PRESERVATION_CACHE, CACHE_CONTROL_PRESERVATION, CACHE_CONTROL_BROWSER, REDIRECTS_VERSION2, HEADERS_VERSION2, HEADERS_VERSION_V1, ANALYTICS_VERSION2, ALLOWED_EARLY_HINT_LINK_ATTRIBUTES;
130083
+ var init_handler = __esm({
130084
+ "../pages-shared/asset-server/handler.ts"() {
130085
+ init_import_meta_url();
130086
+ init_responses();
130087
+ init_rulesEngine();
130088
+ init_url();
130089
+ ASSET_PRESERVATION_CACHE = "assetPreservationCache";
130090
+ CACHE_CONTROL_PRESERVATION = "public, s-maxage=604800";
130091
+ CACHE_CONTROL_BROWSER = "public, max-age=0, must-revalidate";
130092
+ REDIRECTS_VERSION2 = 1;
130093
+ HEADERS_VERSION2 = 2;
130094
+ HEADERS_VERSION_V1 = 1;
130095
+ ANALYTICS_VERSION2 = 1;
130096
+ ALLOWED_EARLY_HINT_LINK_ATTRIBUTES = ["rel", "as", "href"];
130097
+ }
130098
+ });
130099
+
129355
130100
  // ../../node_modules/glob-to-regexp/index.js
129356
130101
  var require_glob_to_regexp = __commonJS({
129357
130102
  "../../node_modules/glob-to-regexp/index.js"(exports2, module2) {
@@ -130941,7 +131686,7 @@ var require_util5 = __commonJS({
130941
131686
  "../../node_modules/ink-text-input/node_modules/chalk/source/util.js"(exports2, module2) {
130942
131687
  "use strict";
130943
131688
  init_import_meta_url();
130944
- var stringReplaceAll = (string, substring, replacer) => {
131689
+ var stringReplaceAll = (string, substring, replacer2) => {
130945
131690
  let index = string.indexOf(substring);
130946
131691
  if (index === -1) {
130947
131692
  return string;
@@ -130950,7 +131695,7 @@ var require_util5 = __commonJS({
130950
131695
  let endIndex = 0;
130951
131696
  let returnValue = "";
130952
131697
  do {
130953
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
131698
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer2;
130954
131699
  endIndex = index + substringLength;
130955
131700
  index = string.indexOf(substring, endIndex);
130956
131701
  } while (index !== -1);
@@ -133072,87 +133817,6 @@ var require_build5 = __commonJS({
133072
133817
  }
133073
133818
  });
133074
133819
 
133075
- // ../../node_modules/mime/Mime.js
133076
- var require_Mime = __commonJS({
133077
- "../../node_modules/mime/Mime.js"(exports2, module2) {
133078
- "use strict";
133079
- init_import_meta_url();
133080
- function Mime() {
133081
- this._types = /* @__PURE__ */ Object.create(null);
133082
- this._extensions = /* @__PURE__ */ Object.create(null);
133083
- for (let i2 = 0; i2 < arguments.length; i2++) {
133084
- this.define(arguments[i2]);
133085
- }
133086
- this.define = this.define.bind(this);
133087
- this.getType = this.getType.bind(this);
133088
- this.getExtension = this.getExtension.bind(this);
133089
- }
133090
- Mime.prototype.define = function(typeMap, force) {
133091
- for (let type2 in typeMap) {
133092
- let extensions = typeMap[type2].map(function(t2) {
133093
- return t2.toLowerCase();
133094
- });
133095
- type2 = type2.toLowerCase();
133096
- for (let i2 = 0; i2 < extensions.length; i2++) {
133097
- const ext = extensions[i2];
133098
- if (ext[0] === "*") {
133099
- continue;
133100
- }
133101
- if (!force && ext in this._types) {
133102
- throw new Error(
133103
- 'Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type2 + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type2 + '".'
133104
- );
133105
- }
133106
- this._types[ext] = type2;
133107
- }
133108
- if (force || !this._extensions[type2]) {
133109
- const ext = extensions[0];
133110
- this._extensions[type2] = ext[0] !== "*" ? ext : ext.substr(1);
133111
- }
133112
- }
133113
- };
133114
- Mime.prototype.getType = function(path41) {
133115
- path41 = String(path41);
133116
- let last = path41.replace(/^.*[/\\]/, "").toLowerCase();
133117
- let ext = last.replace(/^.*\./, "").toLowerCase();
133118
- let hasPath = last.length < path41.length;
133119
- let hasDot = ext.length < last.length - 1;
133120
- return (hasDot || !hasPath) && this._types[ext] || null;
133121
- };
133122
- Mime.prototype.getExtension = function(type2) {
133123
- type2 = /^\s*([^;\s]*)/.test(type2) && RegExp.$1;
133124
- return type2 && this._extensions[type2.toLowerCase()] || null;
133125
- };
133126
- module2.exports = Mime;
133127
- }
133128
- });
133129
-
133130
- // ../../node_modules/mime/types/standard.js
133131
- var require_standard = __commonJS({
133132
- "../../node_modules/mime/types/standard.js"(exports2, module2) {
133133
- init_import_meta_url();
133134
- module2.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"] };
133135
- }
133136
- });
133137
-
133138
- // ../../node_modules/mime/types/other.js
133139
- var require_other = __commonJS({
133140
- "../../node_modules/mime/types/other.js"(exports2, module2) {
133141
- init_import_meta_url();
133142
- module2.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"] };
133143
- }
133144
- });
133145
-
133146
- // ../../node_modules/mime/index.js
133147
- var require_mime2 = __commonJS({
133148
- "../../node_modules/mime/index.js"(exports2, module2) {
133149
- "use strict";
133150
- init_import_meta_url();
133151
- var Mime = require_Mime();
133152
- module2.exports = new Mime(require_standard(), require_other());
133153
- }
133154
- });
133155
-
133156
133820
  // node_modules/minimatch/lib/path.js
133157
133821
  var require_path = __commonJS({
133158
133822
  "node_modules/minimatch/lib/path.js"(exports2, module2) {
@@ -134642,7 +135306,7 @@ var require_rc = __commonJS({
134642
135306
  "../../node_modules/rc/index.js"(exports2, module2) {
134643
135307
  init_import_meta_url();
134644
135308
  var cc = require_utils5();
134645
- var join13 = require("path").join;
135309
+ var join14 = require("path").join;
134646
135310
  var deepExtend = require_deep_extend();
134647
135311
  var etc = "/etc";
134648
135312
  var win = process.platform === "win32";
@@ -134668,15 +135332,15 @@ var require_rc = __commonJS({
134668
135332
  }
134669
135333
  if (!win)
134670
135334
  [
134671
- join13(etc, name, "config"),
134672
- join13(etc, name + "rc")
135335
+ join14(etc, name, "config"),
135336
+ join14(etc, name + "rc")
134673
135337
  ].forEach(addConfigFile);
134674
135338
  if (home)
134675
135339
  [
134676
- join13(home, ".config", name, "config"),
134677
- join13(home, ".config", name),
134678
- join13(home, "." + name, "config"),
134679
- join13(home, "." + name + "rc")
135340
+ join14(home, ".config", name, "config"),
135341
+ join14(home, ".config", name),
135342
+ join14(home, "." + name, "config"),
135343
+ join14(home, "." + name + "rc")
134680
135344
  ].forEach(addConfigFile);
134681
135345
  addConfigFile(cc.find("." + name + "rc"));
134682
135346
  if (env5.config)
@@ -134879,7 +135543,7 @@ var require_update_check = __commonJS({
134879
135543
  "../../node_modules/update-check/index.js"(exports2, module2) {
134880
135544
  init_import_meta_url();
134881
135545
  var { URL: URL4 } = require("url");
134882
- var { join: join13 } = require("path");
135546
+ var { join: join14 } = require("path");
134883
135547
  var fs18 = require("fs");
134884
135548
  var { promisify: promisify2 } = require("util");
134885
135549
  var { tmpdir: tmpdir4 } = require("os");
@@ -134891,7 +135555,7 @@ var require_update_check = __commonJS({
134891
135555
  var encode = (value) => encodeURIComponent(value).replace(/^%40/, "@");
134892
135556
  var getFile = async (details, distTag) => {
134893
135557
  const rootDir = tmpdir4();
134894
- const subDir = join13(rootDir, "update-check");
135558
+ const subDir = join14(rootDir, "update-check");
134895
135559
  if (!fs18.existsSync(subDir)) {
134896
135560
  await mkdir4(subDir);
134897
135561
  }
@@ -134899,7 +135563,7 @@ var require_update_check = __commonJS({
134899
135563
  if (details.scope) {
134900
135564
  name = `${details.scope}-${name}`;
134901
135565
  }
134902
- return join13(subDir, name);
135566
+ return join14(subDir, name);
134903
135567
  };
134904
135568
  var evaluateCache = async (file, time, interval2) => {
134905
135569
  if (fs18.existsSync(file)) {
@@ -136694,9 +137358,9 @@ var import_undici12 = __toESM(require_undici());
136694
137358
 
136695
137359
  // src/dev.tsx
136696
137360
  init_import_meta_url();
136697
- var import_node_path38 = __toESM(require("node:path"));
137361
+ var import_node_path39 = __toESM(require("node:path"));
136698
137362
  var import_chalk8 = __toESM(require_chalk());
136699
- var import_chokidar4 = require("chokidar");
137363
+ var import_chokidar5 = require("chokidar");
136700
137364
 
136701
137365
  // ../../node_modules/get-port/index.js
136702
137366
  init_import_meta_url();
@@ -138541,6 +139205,16 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, envNam
138541
139205
  validateBindingArray(envName, validateServiceBinding),
138542
139206
  []
138543
139207
  ),
139208
+ analytics_engine_datasets: notInheritable(
139209
+ diagnostics,
139210
+ topLevelEnv,
139211
+ rawConfig,
139212
+ rawEnv,
139213
+ envName,
139214
+ "analytics_engine_datasets",
139215
+ validateBindingArray(envName, validateAnalyticsEngineBinding),
139216
+ []
139217
+ ),
138544
139218
  dispatch_namespaces: notInheritable(
138545
139219
  diagnostics,
138546
139220
  topLevelEnv,
@@ -139126,6 +139800,7 @@ var validateBindingsHaveUniqueNames = (diagnostics, {
139126
139800
  durable_objects,
139127
139801
  kv_namespaces,
139128
139802
  r2_buckets,
139803
+ analytics_engine_datasets,
139129
139804
  text_blobs,
139130
139805
  unsafe,
139131
139806
  vars,
@@ -139138,6 +139813,7 @@ var validateBindingsHaveUniqueNames = (diagnostics, {
139138
139813
  "Durable Object": getBindingNames(durable_objects),
139139
139814
  "KV Namespace": getBindingNames(kv_namespaces),
139140
139815
  "R2 Bucket": getBindingNames(r2_buckets),
139816
+ "Analytics Engine Dataset": getBindingNames(analytics_engine_datasets),
139141
139817
  "Text Blob": getBindingNames(text_blobs),
139142
139818
  Unsafe: getBindingNames(unsafe),
139143
139819
  "Environment Variable": getBindingNames(vars),
@@ -139220,6 +139896,34 @@ var validateServiceBinding = (diagnostics, field, value) => {
139220
139896
  }
139221
139897
  return isValid;
139222
139898
  };
139899
+ var validateAnalyticsEngineBinding = (diagnostics, field, value) => {
139900
+ if (typeof value !== "object" || value === null) {
139901
+ diagnostics.errors.push(
139902
+ `"analytics_engine" bindings should be objects, but got ${JSON.stringify(
139903
+ value
139904
+ )}`
139905
+ );
139906
+ return false;
139907
+ }
139908
+ let isValid = true;
139909
+ if (!isRequiredProperty(value, "binding", "string")) {
139910
+ diagnostics.errors.push(
139911
+ `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
139912
+ value
139913
+ )}.`
139914
+ );
139915
+ isValid = false;
139916
+ }
139917
+ if (!isOptionalProperty(value, "dataset", "string") || value.dataset?.length === 0) {
139918
+ diagnostics.errors.push(
139919
+ `"${field}" bindings should, optionally, have a string "dataset" field but got ${JSON.stringify(
139920
+ value
139921
+ )}.`
139922
+ );
139923
+ isValid = false;
139924
+ }
139925
+ return isValid;
139926
+ };
139223
139927
  var validateWorkerNamespaceBinding = (diagnostics, field, value) => {
139224
139928
  if (typeof value !== "object" || value === null) {
139225
139929
  diagnostics.errors.push(
@@ -139383,6 +140087,7 @@ function printBindings(bindings) {
139383
140087
  r2_buckets,
139384
140088
  logfwdr,
139385
140089
  services,
140090
+ analytics_engine_datasets,
139386
140091
  text_blobs,
139387
140092
  unsafe,
139388
140093
  vars,
@@ -139443,12 +140148,21 @@ function printBindings(bindings) {
139443
140148
  if (d1_databases !== void 0 && d1_databases.length > 0) {
139444
140149
  output.push({
139445
140150
  type: "D1 Databases",
139446
- entries: d1_databases.map(({ binding, database_name, database_id }) => {
139447
- return {
139448
- key: removeD1BetaPrefix(binding),
139449
- value: database_name ? `${database_name} (${database_id})` : database_id
139450
- };
139451
- })
140151
+ entries: d1_databases.map(
140152
+ ({ binding, database_name, database_id, preview_database_id }) => {
140153
+ let databaseValue = `${database_id}`;
140154
+ if (database_name) {
140155
+ databaseValue = `${database_name} (${database_id})`;
140156
+ }
140157
+ if (preview_database_id) {
140158
+ databaseValue += `, Preview: (${preview_database_id})`;
140159
+ }
140160
+ return {
140161
+ key: removeD1BetaPrefix(binding),
140162
+ value: databaseValue
140163
+ };
140164
+ }
140165
+ )
139452
140166
  });
139453
140167
  }
139454
140168
  if (r2_buckets !== void 0 && r2_buckets.length > 0) {
@@ -139488,6 +140202,17 @@ function printBindings(bindings) {
139488
140202
  })
139489
140203
  });
139490
140204
  }
140205
+ if (analytics_engine_datasets !== void 0 && analytics_engine_datasets.length > 0) {
140206
+ output.push({
140207
+ type: "Analytics Engine Datasets",
140208
+ entries: analytics_engine_datasets.map(({ binding, dataset }) => {
140209
+ return {
140210
+ key: binding,
140211
+ value: dataset ?? binding
140212
+ };
140213
+ })
140214
+ });
140215
+ }
139491
140216
  if (text_blobs !== void 0 && Object.keys(text_blobs).length > 0) {
139492
140217
  output.push({
139493
140218
  type: "Text Blobs",
@@ -139586,7 +140311,7 @@ init_import_meta_url();
139586
140311
  var import_node_child_process3 = require("node:child_process");
139587
140312
  var path19 = __toESM(require("node:path"));
139588
140313
  var util = __toESM(require("node:util"));
139589
- var import_chokidar2 = require("chokidar");
140314
+ var import_chokidar3 = require("chokidar");
139590
140315
 
139591
140316
  // ../../node_modules/clipboardy/index.js
139592
140317
  init_import_meta_url();
@@ -141160,7 +141885,7 @@ var import_websocket_server = __toESM(require_websocket_server2(), 1);
141160
141885
  var wrapper_default = import_websocket.default;
141161
141886
 
141162
141887
  // package.json
141163
- var version = "2.5.0";
141888
+ var version = "2.6.0";
141164
141889
  var package_default = {
141165
141890
  name: "wrangler",
141166
141891
  version,
@@ -141282,7 +142007,7 @@ var package_default = {
141282
142007
  "@databases/sql": "^3.2.0",
141283
142008
  "@iarna/toml": "^3.0.0",
141284
142009
  "@microsoft/api-extractor": "^7.28.3",
141285
- "@miniflare/tre": "^3.0.0-next.7",
142010
+ "@miniflare/tre": "^3.0.0-next.8",
141286
142011
  "@types/better-sqlite3": "^7.6.0",
141287
142012
  "@types/busboy": "^1.5.0",
141288
142013
  "@types/command-exists": "^1.2.0",
@@ -141325,7 +142050,7 @@ var package_default = {
141325
142050
  "jest-websocket-mock": "^2.3.0",
141326
142051
  mime: "^3.0.0",
141327
142052
  minimatch: "^5.1.0",
141328
- msw: "^0.47.1",
142053
+ msw: "^0.49.1",
141329
142054
  "npx-import": "^1.1.3",
141330
142055
  open: "^8.4.0",
141331
142056
  "p-queue": "^7.2.0",
@@ -142478,9 +143203,9 @@ async function openInBrowser(url3) {
142478
143203
  init_import_meta_url();
142479
143204
  var import_node_assert5 = __toESM(require("node:assert"));
142480
143205
  var import_node_child_process2 = require("node:child_process");
142481
- var import_node_fs6 = require("node:fs");
143206
+ var import_node_fs8 = require("node:fs");
142482
143207
  var import_promises3 = require("node:fs/promises");
142483
- var import_node_path15 = __toESM(require("node:path"));
143208
+ var import_node_path17 = __toESM(require("node:path"));
142484
143209
  var import_chalk = __toESM(require_chalk());
142485
143210
 
142486
143211
  // ../../node_modules/npx-import/lib/index.js
@@ -143789,11 +144514,593 @@ async function fetchDashboardScript(resource, bodyInit = {}) {
143789
144514
  }
143790
144515
  }
143791
144516
 
144517
+ // src/miniflare-cli/assets.ts
144518
+ init_import_meta_url();
144519
+ var import_node_fs7 = require("node:fs");
144520
+ var import_node_path15 = require("node:path");
144521
+
144522
+ // ../pages-shared/metadata-generator/createMetadataObject.ts
144523
+ init_import_meta_url();
144524
+
144525
+ // ../pages-shared/metadata-generator/constants.ts
144526
+ init_import_meta_url();
144527
+ var REDIRECTS_VERSION = 1;
144528
+ var HEADERS_VERSION = 2;
144529
+ var ANALYTICS_VERSION = 1;
144530
+ var PERMITTED_STATUS_CODES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
144531
+ var HEADER_SEPARATOR = ":";
144532
+ var MAX_LINE_LENGTH = 2e3;
144533
+ var MAX_HEADER_RULES = 100;
144534
+ var MAX_DYNAMIC_REDIRECT_RULES = 100;
144535
+ var MAX_STATIC_REDIRECT_RULES = 2e3;
144536
+ var UNSET_OPERATOR = "! ";
144537
+ var SPLAT_REGEX = /\*/g;
144538
+ var PLACEHOLDER_REGEX = /:\w+/g;
144539
+
144540
+ // ../pages-shared/metadata-generator/createMetadataObject.ts
144541
+ function createMetadataObject({
144542
+ redirects,
144543
+ headers,
144544
+ webAnalyticsToken,
144545
+ deploymentId,
144546
+ failOpen,
144547
+ logger: logger2 = (_message) => {
144548
+ }
144549
+ }) {
144550
+ return {
144551
+ ...constructRedirects({ redirects, logger: logger2 }),
144552
+ ...constructHeaders({ headers, logger: logger2 }),
144553
+ ...constructWebAnalytics({ webAnalyticsToken, logger: logger2 }),
144554
+ deploymentId,
144555
+ failOpen
144556
+ };
144557
+ }
144558
+ function constructRedirects({
144559
+ redirects,
144560
+ logger: logger2
144561
+ }) {
144562
+ if (!redirects)
144563
+ return {};
144564
+ const num_valid = redirects.rules.length;
144565
+ const num_invalid = redirects.invalid.length;
144566
+ logger2(
144567
+ `Parsed ${num_valid} valid redirect rule${num_valid === 1 ? "" : "s"}.`
144568
+ );
144569
+ if (num_invalid > 0) {
144570
+ logger2(`Found invalid redirect lines:`);
144571
+ for (const { line, lineNumber, message } of redirects.invalid) {
144572
+ if (line)
144573
+ logger2(` - ${lineNumber ? `#${lineNumber}: ` : ""}${line}`);
144574
+ logger2(` ${message}`);
144575
+ }
144576
+ }
144577
+ if (num_valid === 0) {
144578
+ return {};
144579
+ }
144580
+ const staticRedirects = {};
144581
+ const dynamicRedirects = {};
144582
+ let canCreateStaticRule = true;
144583
+ for (const rule of redirects.rules) {
144584
+ if (!rule.from.match(SPLAT_REGEX) && !rule.from.match(PLACEHOLDER_REGEX)) {
144585
+ if (canCreateStaticRule) {
144586
+ staticRedirects[rule.from] = {
144587
+ status: rule.status,
144588
+ to: rule.to,
144589
+ lineNumber: rule.lineNumber
144590
+ };
144591
+ continue;
144592
+ } else {
144593
+ logger2(
144594
+ `Info: the redirect rule ${rule.from} \u2192 ${rule.status} ${rule.to} could be made more performant by bringing it above any lines with splats or placeholders.`
144595
+ );
144596
+ }
144597
+ }
144598
+ dynamicRedirects[rule.from] = { status: rule.status, to: rule.to };
144599
+ canCreateStaticRule = false;
144600
+ }
144601
+ return {
144602
+ redirects: {
144603
+ version: REDIRECTS_VERSION,
144604
+ staticRules: staticRedirects,
144605
+ rules: dynamicRedirects
144606
+ }
144607
+ };
144608
+ }
144609
+ function constructHeaders({
144610
+ headers,
144611
+ logger: logger2
144612
+ }) {
144613
+ if (!headers)
144614
+ return {};
144615
+ const num_valid = headers.rules.length;
144616
+ const num_invalid = headers.invalid.length;
144617
+ logger2(`Parsed ${num_valid} valid header rule${num_valid === 1 ? "" : "s"}.`);
144618
+ if (num_invalid > 0) {
144619
+ logger2(`Found invalid header lines:`);
144620
+ for (const { line, lineNumber, message } of headers.invalid) {
144621
+ if (line)
144622
+ logger2(` - ${lineNumber ? `#${lineNumber}: ` : ""} ${line}`);
144623
+ logger2(` ${message}`);
144624
+ }
144625
+ }
144626
+ if (num_valid === 0) {
144627
+ return {};
144628
+ }
144629
+ const rules = {};
144630
+ for (const rule of headers.rules) {
144631
+ rules[rule.path] = {};
144632
+ if (Object.keys(rule.headers).length) {
144633
+ rules[rule.path].set = rule.headers;
144634
+ }
144635
+ if (rule.unsetHeaders.length) {
144636
+ rules[rule.path].unset = rule.unsetHeaders;
144637
+ }
144638
+ }
144639
+ return {
144640
+ headers: {
144641
+ version: HEADERS_VERSION,
144642
+ rules
144643
+ }
144644
+ };
144645
+ }
144646
+ function constructWebAnalytics({
144647
+ webAnalyticsToken
144648
+ }) {
144649
+ if (!webAnalyticsToken)
144650
+ return {};
144651
+ return {
144652
+ analytics: {
144653
+ version: ANALYTICS_VERSION,
144654
+ token: webAnalyticsToken
144655
+ }
144656
+ };
144657
+ }
144658
+
144659
+ // ../pages-shared/metadata-generator/parseHeaders.ts
144660
+ init_import_meta_url();
144661
+
144662
+ // ../pages-shared/metadata-generator/validateURL.ts
144663
+ init_import_meta_url();
144664
+ var extractPathname = (path41 = "/", includeSearch, includeHash) => {
144665
+ if (!path41.startsWith("/"))
144666
+ path41 = `/${path41}`;
144667
+ const url3 = new URL(`//${path41}`, "relative://");
144668
+ return `${url3.pathname}${includeSearch ? url3.search : ""}${includeHash ? url3.hash : ""}`;
144669
+ };
144670
+ var URL_REGEX = /^https:\/\/+(?<host>[^/]+)\/?(?<path>.*)/;
144671
+ var PATH_REGEX = /^\//;
144672
+ var validateUrl = (token, onlyRelative = false, includeSearch = false, includeHash = false) => {
144673
+ const host = URL_REGEX.exec(token);
144674
+ if (host && host.groups && host.groups.host) {
144675
+ if (onlyRelative)
144676
+ return [
144677
+ void 0,
144678
+ `Only relative URLs are allowed. Skipping absolute URL ${token}.`
144679
+ ];
144680
+ return [
144681
+ `https://${host.groups.host}${extractPathname(
144682
+ host.groups.path,
144683
+ includeSearch,
144684
+ includeHash
144685
+ )}`,
144686
+ void 0
144687
+ ];
144688
+ } else {
144689
+ if (!token.startsWith("/") && onlyRelative)
144690
+ token = `/${token}`;
144691
+ const path41 = PATH_REGEX.exec(token);
144692
+ if (path41) {
144693
+ try {
144694
+ return [extractPathname(token, includeSearch, includeHash), void 0];
144695
+ } catch {
144696
+ return [void 0, `Error parsing URL segment ${token}. Skipping.`];
144697
+ }
144698
+ }
144699
+ }
144700
+ return [
144701
+ void 0,
144702
+ onlyRelative ? "URLs should begin with a forward-slash." : 'URLs should either be relative (e.g. begin with a forward-slash), or use HTTPS (e.g. begin with "https://").'
144703
+ ];
144704
+ };
144705
+
144706
+ // ../pages-shared/metadata-generator/parseHeaders.ts
144707
+ var LINE_IS_PROBABLY_A_PATH = new RegExp(/^([^\s]+:\/\/|^\/)/);
144708
+ function parseHeaders(input) {
144709
+ const lines = input.split("\n");
144710
+ const rules = [];
144711
+ const invalid = [];
144712
+ let rule = void 0;
144713
+ for (let i2 = 0; i2 < lines.length; i2++) {
144714
+ const line = lines[i2].trim();
144715
+ if (line.length === 0 || line.startsWith("#"))
144716
+ continue;
144717
+ if (line.length > MAX_LINE_LENGTH) {
144718
+ invalid.push({
144719
+ message: `Ignoring line ${i2 + 1} as it exceeds the maximum allowed length of ${MAX_LINE_LENGTH}.`
144720
+ });
144721
+ continue;
144722
+ }
144723
+ if (LINE_IS_PROBABLY_A_PATH.test(line)) {
144724
+ if (rules.length >= MAX_HEADER_RULES) {
144725
+ invalid.push({
144726
+ message: `Maximum number of rules supported is ${MAX_HEADER_RULES}. Skipping remaining ${lines.length - i2} lines of file.`
144727
+ });
144728
+ break;
144729
+ }
144730
+ if (rule) {
144731
+ if (isValidRule(rule)) {
144732
+ rules.push({
144733
+ path: rule.path,
144734
+ headers: rule.headers,
144735
+ unsetHeaders: rule.unsetHeaders
144736
+ });
144737
+ } else {
144738
+ invalid.push({
144739
+ line: rule.line,
144740
+ lineNumber: i2 + 1,
144741
+ message: "No headers specified"
144742
+ });
144743
+ }
144744
+ }
144745
+ const [path41, pathError] = validateUrl(line);
144746
+ if (pathError) {
144747
+ invalid.push({
144748
+ line,
144749
+ lineNumber: i2 + 1,
144750
+ message: pathError
144751
+ });
144752
+ rule = void 0;
144753
+ continue;
144754
+ }
144755
+ rule = {
144756
+ path: path41,
144757
+ line,
144758
+ headers: {},
144759
+ unsetHeaders: []
144760
+ };
144761
+ continue;
144762
+ }
144763
+ if (!line.includes(HEADER_SEPARATOR)) {
144764
+ if (!rule) {
144765
+ invalid.push({
144766
+ line,
144767
+ lineNumber: i2 + 1,
144768
+ message: "Expected a path beginning with at least one forward-slash"
144769
+ });
144770
+ } else {
144771
+ if (line.trim().startsWith(UNSET_OPERATOR)) {
144772
+ rule.unsetHeaders.push(line.trim().replace(UNSET_OPERATOR, ""));
144773
+ } else {
144774
+ invalid.push({
144775
+ line,
144776
+ lineNumber: i2 + 1,
144777
+ message: "Expected a colon-separated header pair (e.g. name: value)"
144778
+ });
144779
+ }
144780
+ }
144781
+ continue;
144782
+ }
144783
+ const [rawName, ...rawValue] = line.split(HEADER_SEPARATOR);
144784
+ const name = rawName.trim().toLowerCase();
144785
+ if (name.includes(" ")) {
144786
+ invalid.push({
144787
+ line,
144788
+ lineNumber: i2 + 1,
144789
+ message: "Header name cannot include spaces"
144790
+ });
144791
+ continue;
144792
+ }
144793
+ const value = rawValue.join(HEADER_SEPARATOR).trim();
144794
+ if (name === "") {
144795
+ invalid.push({
144796
+ line,
144797
+ lineNumber: i2 + 1,
144798
+ message: "No header name specified"
144799
+ });
144800
+ continue;
144801
+ }
144802
+ if (value === "") {
144803
+ invalid.push({
144804
+ line,
144805
+ lineNumber: i2 + 1,
144806
+ message: "No header value specified"
144807
+ });
144808
+ continue;
144809
+ }
144810
+ if (!rule) {
144811
+ invalid.push({
144812
+ line,
144813
+ lineNumber: i2 + 1,
144814
+ message: `Path should come before header (${name}: ${value})`
144815
+ });
144816
+ continue;
144817
+ }
144818
+ const existingValues = rule.headers[name];
144819
+ rule.headers[name] = existingValues ? `${existingValues}, ${value}` : value;
144820
+ }
144821
+ if (rule) {
144822
+ if (isValidRule(rule)) {
144823
+ rules.push({
144824
+ path: rule.path,
144825
+ headers: rule.headers,
144826
+ unsetHeaders: rule.unsetHeaders
144827
+ });
144828
+ } else {
144829
+ invalid.push({ line: rule.line, message: "No headers specified" });
144830
+ }
144831
+ }
144832
+ return {
144833
+ rules,
144834
+ invalid
144835
+ };
144836
+ }
144837
+ function isValidRule(rule) {
144838
+ return Object.keys(rule.headers).length > 0 || rule.unsetHeaders.length > 0;
144839
+ }
144840
+
144841
+ // ../pages-shared/metadata-generator/parseRedirects.ts
144842
+ init_import_meta_url();
144843
+ function parseRedirects(input) {
144844
+ const lines = input.split("\n");
144845
+ const rules = [];
144846
+ const seen_paths = /* @__PURE__ */ new Set();
144847
+ const invalid = [];
144848
+ let staticRules = 0;
144849
+ let dynamicRules = 0;
144850
+ let canCreateStaticRule = true;
144851
+ for (let i2 = 0; i2 < lines.length; i2++) {
144852
+ const line = lines[i2].trim();
144853
+ if (line.length === 0 || line.startsWith("#"))
144854
+ continue;
144855
+ if (line.length > MAX_LINE_LENGTH) {
144856
+ invalid.push({
144857
+ message: `Ignoring line ${i2 + 1} as it exceeds the maximum allowed length of ${MAX_LINE_LENGTH}.`
144858
+ });
144859
+ continue;
144860
+ }
144861
+ const tokens = line.split(/\s+/);
144862
+ if (tokens.length < 2 || tokens.length > 3) {
144863
+ invalid.push({
144864
+ line,
144865
+ lineNumber: i2 + 1,
144866
+ message: `Expected exactly 2 or 3 whitespace-separated tokens. Got ${tokens.length}.`
144867
+ });
144868
+ continue;
144869
+ }
144870
+ const [str_from, str_to, str_status = "302"] = tokens;
144871
+ const fromResult = validateUrl(str_from, true, false, false);
144872
+ if (fromResult[0] === void 0) {
144873
+ invalid.push({
144874
+ line,
144875
+ lineNumber: i2 + 1,
144876
+ message: fromResult[1]
144877
+ });
144878
+ continue;
144879
+ }
144880
+ const from = fromResult[0];
144881
+ if (canCreateStaticRule && !from.match(SPLAT_REGEX) && !from.match(PLACEHOLDER_REGEX)) {
144882
+ staticRules += 1;
144883
+ if (staticRules > MAX_STATIC_REDIRECT_RULES) {
144884
+ invalid.push({
144885
+ message: `Maximum number of static rules supported is ${MAX_STATIC_REDIRECT_RULES}. Skipping line.`
144886
+ });
144887
+ continue;
144888
+ }
144889
+ } else {
144890
+ dynamicRules += 1;
144891
+ canCreateStaticRule = false;
144892
+ if (dynamicRules > MAX_DYNAMIC_REDIRECT_RULES) {
144893
+ invalid.push({
144894
+ message: `Maximum number of dynamic rules supported is ${MAX_DYNAMIC_REDIRECT_RULES}. Skipping remaining ${lines.length - i2} lines of file.`
144895
+ });
144896
+ break;
144897
+ }
144898
+ }
144899
+ const toResult = validateUrl(str_to, false, true, true);
144900
+ if (toResult[0] === void 0) {
144901
+ invalid.push({
144902
+ line,
144903
+ lineNumber: i2 + 1,
144904
+ message: toResult[1]
144905
+ });
144906
+ continue;
144907
+ }
144908
+ const to = toResult[0];
144909
+ const status = Number(str_status);
144910
+ if (isNaN(status) || !PERMITTED_STATUS_CODES.has(status)) {
144911
+ invalid.push({
144912
+ line,
144913
+ lineNumber: i2 + 1,
144914
+ message: `Valid status codes are 301, 302 (default), 303, 307, or 308. Got ${str_status}.`
144915
+ });
144916
+ continue;
144917
+ }
144918
+ if (seen_paths.has(from)) {
144919
+ invalid.push({
144920
+ line,
144921
+ lineNumber: i2 + 1,
144922
+ message: `Ignoring duplicate rule for path ${from}.`
144923
+ });
144924
+ continue;
144925
+ }
144926
+ seen_paths.add(from);
144927
+ rules.push({ from, to, status, lineNumber: i2 + 1 });
144928
+ }
144929
+ return {
144930
+ rules,
144931
+ invalid
144932
+ };
144933
+ }
144934
+
144935
+ // src/miniflare-cli/assets.ts
144936
+ var import_chokidar = require("chokidar");
144937
+ var import_mime = __toESM(require_mime2());
144938
+
144939
+ // src/pages/hash.tsx
144940
+ init_import_meta_url();
144941
+ var import_node_fs6 = require("node:fs");
144942
+ var import_node_path14 = require("node:path");
144943
+ var import_blake3_wasm = require("blake3-wasm");
144944
+ var hashFile = (filepath) => {
144945
+ const contents = (0, import_node_fs6.readFileSync)(filepath);
144946
+ const base64Contents = contents.toString("base64");
144947
+ const extension = (0, import_node_path14.extname)(filepath).substring(1);
144948
+ return (0, import_blake3_wasm.hash)(base64Contents + extension).toString("hex").slice(0, 32);
144949
+ };
144950
+
144951
+ // src/miniflare-cli/assets.ts
144952
+ async function generateASSETSBinding(options6) {
144953
+ const assetsFetch = options6.directory !== void 0 ? await generateAssetsFetch(options6.directory, options6.log, options6.tre) : invalidAssetsFetch;
144954
+ const miniflare = options6.tre ? await import("@miniflare/tre") : await import("@miniflare/core");
144955
+ const Request2 = miniflare.Request;
144956
+ const Response2 = miniflare.Response;
144957
+ const fetch10 = options6.tre ? miniflare.fetch : (await import("@miniflare/web-sockets")).upgradingFetch;
144958
+ return async function(miniflareRequest) {
144959
+ if (options6.proxyPort) {
144960
+ try {
144961
+ const url3 = new URL(miniflareRequest.url);
144962
+ url3.host = `localhost:${options6.proxyPort}`;
144963
+ const proxyRequest = new Request2(url3, miniflareRequest);
144964
+ if (proxyRequest.headers.get("Upgrade") === "websocket") {
144965
+ proxyRequest.headers.delete("Sec-WebSocket-Accept");
144966
+ proxyRequest.headers.delete("Sec-WebSocket-Key");
144967
+ }
144968
+ return await fetch10(proxyRequest);
144969
+ } catch (thrown) {
144970
+ options6.log.error(new Error(`Could not proxy request: ${thrown}`));
144971
+ return new Response2(`[wrangler] Could not proxy request: ${thrown}`, {
144972
+ status: 502
144973
+ });
144974
+ }
144975
+ } else {
144976
+ try {
144977
+ return await assetsFetch(miniflareRequest);
144978
+ } catch (thrown) {
144979
+ options6.log.error(new Error(`Could not serve static asset: ${thrown}`));
144980
+ return new Response2(
144981
+ `[wrangler] Could not serve static asset: ${thrown}`,
144982
+ { status: 502 }
144983
+ );
144984
+ }
144985
+ }
144986
+ };
144987
+ }
144988
+ async function generateAssetsFetch(directory, log, tre) {
144989
+ if (tre) {
144990
+ await Promise.resolve().then(() => (init_miniflare_tre(), miniflare_tre_exports));
144991
+ } else {
144992
+ await Promise.resolve().then(() => (init_miniflare(), miniflare_exports));
144993
+ }
144994
+ const miniflare = tre ? await import("@miniflare/tre") : await import("@miniflare/core");
144995
+ const Request2 = miniflare.Request;
144996
+ const { generateHandler: generateHandler3, parseQualityWeightedList: parseQualityWeightedList2 } = await Promise.resolve().then(() => (init_handler(), handler_exports));
144997
+ const headersFile = (0, import_node_path15.join)(directory, "_headers");
144998
+ const redirectsFile = (0, import_node_path15.join)(directory, "_redirects");
144999
+ const workerFile = (0, import_node_path15.join)(directory, "_worker.js");
145000
+ const ignoredFiles = [headersFile, redirectsFile, workerFile];
145001
+ let redirects;
145002
+ if ((0, import_node_fs7.existsSync)(redirectsFile)) {
145003
+ const contents = (0, import_node_fs7.readFileSync)(redirectsFile, "utf-8");
145004
+ redirects = parseRedirects(contents);
145005
+ }
145006
+ let headers;
145007
+ if ((0, import_node_fs7.existsSync)(headersFile)) {
145008
+ const contents = (0, import_node_fs7.readFileSync)(headersFile, "utf-8");
145009
+ headers = parseHeaders(contents);
145010
+ }
145011
+ let metadata = createMetadataObject({
145012
+ redirects,
145013
+ headers,
145014
+ logger: log.warn.bind(log)
145015
+ });
145016
+ (0, import_chokidar.watch)([headersFile, redirectsFile], { persistent: true }).on(
145017
+ "change",
145018
+ (path41) => {
145019
+ switch (path41) {
145020
+ case headersFile: {
145021
+ log.log("_headers modified. Re-evaluating...");
145022
+ const contents = (0, import_node_fs7.readFileSync)(headersFile).toString();
145023
+ headers = parseHeaders(contents);
145024
+ break;
145025
+ }
145026
+ case redirectsFile: {
145027
+ log.log("_redirects modified. Re-evaluating...");
145028
+ const contents = (0, import_node_fs7.readFileSync)(redirectsFile).toString();
145029
+ redirects = parseRedirects(contents);
145030
+ break;
145031
+ }
145032
+ }
145033
+ metadata = createMetadataObject({
145034
+ redirects,
145035
+ headers,
145036
+ logger: log.warn
145037
+ });
145038
+ }
145039
+ );
145040
+ const generateResponse = async (request) => {
145041
+ const assetKeyEntryMap = /* @__PURE__ */ new Map();
145042
+ return await generateHandler3({
145043
+ request,
145044
+ metadata,
145045
+ xServerEnvHeader: "dev",
145046
+ logError: console.error,
145047
+ findAssetEntryForPath: async (path41) => {
145048
+ const filepath = (0, import_node_path15.join)(directory, path41);
145049
+ if ((0, import_node_fs7.existsSync)(filepath) && (0, import_node_fs7.lstatSync)(filepath).isFile() && !ignoredFiles.includes(filepath)) {
145050
+ const hash = hashFile(filepath);
145051
+ assetKeyEntryMap.set(hash, filepath);
145052
+ return hash;
145053
+ }
145054
+ return null;
145055
+ },
145056
+ getAssetKey: (assetEntry) => {
145057
+ return assetEntry;
145058
+ },
145059
+ negotiateContent: (contentRequest) => {
145060
+ let rawAcceptEncoding;
145061
+ if (contentRequest.cf && "clientAcceptEncoding" in contentRequest.cf && contentRequest.cf.clientAcceptEncoding) {
145062
+ rawAcceptEncoding = contentRequest.cf.clientAcceptEncoding;
145063
+ } else {
145064
+ rawAcceptEncoding = contentRequest.headers.get("Accept-Encoding") || void 0;
145065
+ }
145066
+ const acceptEncoding = parseQualityWeightedList2(rawAcceptEncoding);
145067
+ if (acceptEncoding["identity"] === 0 || acceptEncoding["*"] === 0 && acceptEncoding["identity"] === void 0) {
145068
+ throw new Error("No acceptable encodings available");
145069
+ }
145070
+ return { encoding: null };
145071
+ },
145072
+ fetchAsset: async (assetKey) => {
145073
+ const filepath = assetKeyEntryMap.get(assetKey);
145074
+ if (!filepath) {
145075
+ throw new Error(
145076
+ "Could not fetch asset. Please file an issue on GitHub (https://github.com/cloudflare/wrangler2/issues/new/choose) with reproduction steps."
145077
+ );
145078
+ }
145079
+ const body = (0, import_node_fs7.readFileSync)(filepath);
145080
+ let contentType = (0, import_mime.getType)(filepath) || "application/octet-stream";
145081
+ if (contentType.startsWith("text/") && !contentType.includes("charset")) {
145082
+ contentType = `${contentType}; charset=utf-8`;
145083
+ }
145084
+ return { body, contentType };
145085
+ }
145086
+ });
145087
+ };
145088
+ return async (input, init) => {
145089
+ const request = new Request2(input, init);
145090
+ return await generateResponse(request);
145091
+ };
145092
+ }
145093
+ var invalidAssetsFetch = () => {
145094
+ throw new Error(
145095
+ "Trying to fetch assets directly when there is no `directory` option specified."
145096
+ );
145097
+ };
145098
+
143792
145099
  // src/module-collection.ts
143793
145100
  init_import_meta_url();
143794
145101
  var import_node_crypto3 = __toESM(require("node:crypto"));
143795
145102
  var import_promises2 = require("node:fs/promises");
143796
- var import_node_path14 = __toESM(require("node:path"));
145103
+ var import_node_path16 = __toESM(require("node:path"));
143797
145104
  var import_glob_to_regexp = __toESM(require_glob_to_regexp());
143798
145105
  function flipObject(obj) {
143799
145106
  return Object.fromEntries(Object.entries(obj).map(([k, v]) => [v, k]));
@@ -143878,18 +145185,18 @@ function createModuleCollector(props) {
143878
145185
  return;
143879
145186
  }
143880
145187
  logger.warn(
143881
- `Deprecation: detected a legacy module import in "./${import_node_path14.default.relative(
145188
+ `Deprecation: detected a legacy module import in "./${import_node_path16.default.relative(
143882
145189
  process.cwd(),
143883
145190
  args.importer
143884
145191
  )}". This will stop working in the future. Replace references to "${args.path}" with "./${args.path}";`
143885
145192
  );
143886
- const filePath = import_node_path14.default.join(
145193
+ const filePath = import_node_path16.default.join(
143887
145194
  props.wrangler1xlegacyModuleReferences.rootDirectory,
143888
145195
  args.path
143889
145196
  );
143890
145197
  const fileContent = await (0, import_promises2.readFile)(filePath);
143891
145198
  const fileHash = import_node_crypto3.default.createHash("sha1").update(fileContent).digest("hex");
143892
- const fileName = `./${fileHash}-${import_node_path14.default.basename(args.path)}`;
145199
+ const fileName = `./${fileHash}-${import_node_path16.default.basename(args.path)}`;
143893
145200
  const { rule } = rulesMatchers.find(({ regex }) => regex.test(fileName)) || {};
143894
145201
  if (rule) {
143895
145202
  modules.push({
@@ -143914,10 +145221,10 @@ function createModuleCollector(props) {
143914
145221
  build5.onResolve(
143915
145222
  { filter: (0, import_glob_to_regexp.default)(glob) },
143916
145223
  async (args) => {
143917
- const filePath = import_node_path14.default.join(args.resolveDir, args.path);
145224
+ const filePath = import_node_path16.default.join(args.resolveDir, args.path);
143918
145225
  const fileContent = await (0, import_promises2.readFile)(filePath);
143919
145226
  const fileHash = import_node_crypto3.default.createHash("sha1").update(fileContent).digest("hex");
143920
- const fileName = `./${fileHash}-${import_node_path14.default.basename(args.path)}`;
145227
+ const fileName = `./${fileHash}-${import_node_path16.default.basename(args.path)}`;
143921
145228
  modules.push({
143922
145229
  name: fileName,
143923
145230
  content: fileContent,
@@ -143986,7 +145293,6 @@ function useLocalWorker({
143986
145293
  workerDefinitions,
143987
145294
  assetPaths,
143988
145295
  initialPort,
143989
- inspectorPort,
143990
145296
  rules,
143991
145297
  localPersistencePath,
143992
145298
  liveReload,
@@ -144008,6 +145314,7 @@ function useLocalWorker({
144008
145314
  const removeSignalExitListener = (0, import_react5.useRef)();
144009
145315
  const removeExperimentalLocalSignalExitListener = (0, import_react5.useRef)();
144010
145316
  const [inspectorUrl, setInspectorUrl] = (0, import_react5.useState)();
145317
+ const runtimeInspectorPortRef = (0, import_react5.useRef)();
144011
145318
  (0, import_react5.useEffect)(() => {
144012
145319
  if (bindings.services && bindings.services.length > 0) {
144013
145320
  logger.warn(
@@ -144028,18 +145335,13 @@ function useLocalWorker({
144028
145335
  async function startLocalWorker() {
144029
145336
  if (!bundle || !format6)
144030
145337
  return;
144031
- await waitForPortToBeAvailable(initialPort, {
144032
- retryPeriod: 200,
144033
- timeout: 2e3,
144034
- abortSignal: abortController.signal
144035
- });
144036
145338
  for (const module2 of bundle.modules) {
144037
145339
  await (0, import_promises3.writeFile)(
144038
- import_node_path15.default.join(import_node_path15.default.dirname(bundle.path), module2.name),
145340
+ import_node_path17.default.join(import_node_path17.default.dirname(bundle.path), module2.name),
144039
145341
  module2.content
144040
145342
  );
144041
145343
  }
144042
- const scriptPath = (0, import_node_fs6.realpathSync)(bundle.path);
145344
+ const scriptPath = (0, import_node_fs8.realpathSync)(bundle.path);
144043
145345
  const upstream = typeof localUpstream === "string" ? `${localProtocol}://${localUpstream}` : void 0;
144044
145346
  const {
144045
145347
  externalDurableObjects,
@@ -144055,6 +145357,8 @@ function useLocalWorker({
144055
145357
  format: format6,
144056
145358
  bundle
144057
145359
  });
145360
+ runtimeInspectorPortRef.current ??= await getPorts();
145361
+ const runtimeInspectorPort = runtimeInspectorPortRef.current;
144058
145362
  const { forkOptions, miniflareCLIPath, options: options6 } = setupMiniflareOptions({
144059
145363
  workerName,
144060
145364
  port: initialPort,
@@ -144093,11 +145397,12 @@ function useLocalWorker({
144093
145397
  format: format6,
144094
145398
  bundle,
144095
145399
  log,
145400
+ enablePagesAssetsServiceBinding,
144096
145401
  kvNamespaces: bindings?.kv_namespaces,
144097
145402
  r2Buckets: bindings?.r2_buckets,
144098
145403
  authenticatedAccountId: accountId,
144099
145404
  kvRemote: experimentalLocalRemoteKv,
144100
- inspectorPort
145405
+ inspectorPort: runtimeInspectorPort
144101
145406
  });
144102
145407
  const current = experimentalLocalRef.current;
144103
145408
  if (current === void 0) {
@@ -144119,7 +145424,7 @@ function useLocalWorker({
144119
145424
  await current.setOptions(mf3Options);
144120
145425
  }
144121
145426
  try {
144122
- const inspectorJSONArr = await (await fetch(`http://127.0.0.1:${inspectorPort}/json`)).json();
145427
+ const inspectorJSONArr = await (await fetch(`http://127.0.0.1:${runtimeInspectorPort}/json`)).json();
144123
145428
  const foundInspectorURL = inspectorJSONArr?.find(
144124
145429
  (inspectorJSON) => inspectorJSON.id.startsWith("core:user")
144125
145430
  )?.webSocketDebuggerUrl;
@@ -144137,14 +145442,18 @@ function useLocalWorker({
144137
145442
  }
144138
145443
  return;
144139
145444
  }
145445
+ await waitForPortToBeAvailable(initialPort, {
145446
+ retryPeriod: 200,
145447
+ timeout: 2e3,
145448
+ abortSignal: abortController.signal
145449
+ });
144140
145450
  const nodeOptions = setupNodeOptions({
144141
145451
  inspect: inspect2,
144142
- ip: initialIp,
144143
- inspectorPort
145452
+ inspectorPort: runtimeInspectorPort
144144
145453
  });
144145
145454
  logger.log("\u2394 Starting a local server...");
144146
145455
  const child = local.current = (0, import_node_child_process2.fork)(miniflareCLIPath, forkOptions, {
144147
- cwd: import_node_path15.default.dirname(scriptPath),
145456
+ cwd: import_node_path17.default.dirname(scriptPath),
144148
145457
  execArgv: nodeOptions,
144149
145458
  stdio: "pipe",
144150
145459
  env: {
@@ -144213,7 +145522,11 @@ function useLocalWorker({
144213
145522
  });
144214
145523
  }
144215
145524
  startLocalWorker().catch((err2) => {
144216
- logger.error("local worker:", err2);
145525
+ if (err2.code === "ERR_RUNTIME_FAILURE") {
145526
+ logger.error(err2.message);
145527
+ } else {
145528
+ logger.error("local worker:", err2);
145529
+ }
144217
145530
  });
144218
145531
  return () => {
144219
145532
  abortController.abort();
@@ -144230,7 +145543,6 @@ function useLocalWorker({
144230
145543
  workerName,
144231
145544
  format6,
144232
145545
  initialPort,
144233
- inspectorPort,
144234
145546
  initialIp,
144235
145547
  queueConsumers,
144236
145548
  bindings.queues,
@@ -144287,15 +145599,15 @@ function setupBindings({
144287
145599
  }) {
144288
145600
  const wasmBindings = {};
144289
145601
  for (const [name, filePath] of Object.entries(wasm_modules || {})) {
144290
- wasmBindings[name] = import_node_path15.default.join(process.cwd(), filePath);
145602
+ wasmBindings[name] = import_node_path17.default.join(process.cwd(), filePath);
144291
145603
  }
144292
145604
  const textBlobBindings = {};
144293
145605
  for (const [name, filePath] of Object.entries(text_blobs || {})) {
144294
- textBlobBindings[name] = import_node_path15.default.join(process.cwd(), filePath);
145606
+ textBlobBindings[name] = import_node_path17.default.join(process.cwd(), filePath);
144295
145607
  }
144296
145608
  const dataBlobBindings = {};
144297
145609
  for (const [name, filePath] of Object.entries(data_blobs || {})) {
144298
- dataBlobBindings[name] = import_node_path15.default.join(process.cwd(), filePath);
145610
+ dataBlobBindings[name] = import_node_path17.default.join(process.cwd(), filePath);
144299
145611
  }
144300
145612
  if (format6 === "service-worker") {
144301
145613
  for (const { type: type2, name } of bundle.modules) {
@@ -144414,11 +145726,11 @@ function setupMiniflareOptions({
144414
145726
  ),
144415
145727
  d1Databases: d1_databases?.map((db) => db.binding),
144416
145728
  ...localPersistencePath ? {
144417
- cachePersist: import_node_path15.default.join(localPersistencePath, "cache"),
144418
- durableObjectsPersist: import_node_path15.default.join(localPersistencePath, "do"),
144419
- kvPersist: import_node_path15.default.join(localPersistencePath, "kv"),
144420
- r2Persist: import_node_path15.default.join(localPersistencePath, "r2"),
144421
- d1Persist: import_node_path15.default.join(localPersistencePath, "d1")
145729
+ cachePersist: import_node_path17.default.join(localPersistencePath, "cache"),
145730
+ durableObjectsPersist: import_node_path17.default.join(localPersistencePath, "do"),
145731
+ kvPersist: import_node_path17.default.join(localPersistencePath, "kv"),
145732
+ r2Persist: import_node_path17.default.join(localPersistencePath, "r2"),
145733
+ d1Persist: import_node_path17.default.join(localPersistencePath, "d1")
144422
145734
  } : {
144423
145735
  cachePersist: true,
144424
145736
  durableObjectsPersist: true,
@@ -144426,7 +145738,7 @@ function setupMiniflareOptions({
144426
145738
  r2Persist: true
144427
145739
  },
144428
145740
  liveReload,
144429
- sitePath: assetPaths?.assetDirectory ? import_node_path15.default.join(assetPaths.baseDirectory, assetPaths.assetDirectory) : void 0,
145741
+ sitePath: assetPaths?.assetDirectory ? import_node_path17.default.join(assetPaths.baseDirectory, assetPaths.assetDirectory) : void 0,
144430
145742
  siteInclude: assetPaths?.includePatterns.length ? assetPaths?.includePatterns : void 0,
144431
145743
  siteExclude: assetPaths?.excludePatterns.length ? assetPaths.excludePatterns : void 0,
144432
145744
  bindings: vars,
@@ -144441,7 +145753,7 @@ function setupMiniflareOptions({
144441
145753
  logOptions: logPrefix ? { prefix: logPrefix } : void 0,
144442
145754
  enablePagesAssetsServiceBinding
144443
145755
  };
144444
- const miniflareCLIPath = import_node_path15.default.resolve(
145756
+ const miniflareCLIPath = import_node_path17.default.resolve(
144445
145757
  getBasePath(),
144446
145758
  "miniflare-dist/index.mjs"
144447
145759
  );
@@ -144454,7 +145766,6 @@ function setupMiniflareOptions({
144454
145766
  }
144455
145767
  function setupNodeOptions({
144456
145768
  inspect: inspect2,
144457
- ip: ip2,
144458
145769
  inspectorPort
144459
145770
  }) {
144460
145771
  const nodeOptions = [
@@ -144462,7 +145773,7 @@ function setupNodeOptions({
144462
145773
  "--no-warnings"
144463
145774
  ];
144464
145775
  if (inspect2) {
144465
- nodeOptions.push(`--inspect=${ip2}:${inspectorPort}`);
145776
+ nodeOptions.push(`--inspect=127.0.0.1:${inspectorPort}`);
144466
145777
  }
144467
145778
  return nodeOptions;
144468
145779
  }
@@ -144479,6 +145790,7 @@ async function transformMf2OptionsToMf3Options({
144479
145790
  format: format6,
144480
145791
  bundle,
144481
145792
  log,
145793
+ enablePagesAssetsServiceBinding,
144482
145794
  kvNamespaces,
144483
145795
  r2Buckets,
144484
145796
  authenticatedAccountId,
@@ -144507,8 +145819,18 @@ async function transformMf2OptionsToMf3Options({
144507
145819
  cloudflareFetch,
144508
145820
  log
144509
145821
  };
145822
+ if (enablePagesAssetsServiceBinding !== void 0) {
145823
+ options6.serviceBindings = {
145824
+ ...options6.serviceBindings,
145825
+ ASSETS: await generateASSETSBinding({
145826
+ log,
145827
+ ...enablePagesAssetsServiceBinding,
145828
+ tre: true
145829
+ })
145830
+ };
145831
+ }
144510
145832
  if (format6 === "modules") {
144511
- const root = import_node_path15.default.dirname(bundle.path);
145833
+ const root = import_node_path17.default.dirname(bundle.path);
144512
145834
  import_node_assert5.default.strictEqual(bundle.type, "esm");
144513
145835
  options6.modulesRoot = root;
144514
145836
  options6.modules = [
@@ -144519,27 +145841,27 @@ async function transformMf2OptionsToMf3Options({
144519
145841
  },
144520
145842
  ...bundle.modules.map((module2) => ({
144521
145843
  type: ModuleTypeToRuleType[module2.type ?? "esm"],
144522
- path: import_node_path15.default.resolve(root, module2.name),
145844
+ path: import_node_path17.default.resolve(root, module2.name),
144523
145845
  contents: module2.content
144524
145846
  }))
144525
145847
  ];
144526
145848
  }
144527
145849
  if (kvRemote) {
144528
145850
  (0, import_node_assert5.default)(options6.kvPersist);
144529
- const kvRemoteCache = options6.kvPersist === true ? import_node_path15.default.join(import_node_path15.default.dirname(bundle.path), ".mf", "kv-remote") : import_node_path15.default.join(import_node_path15.default.dirname(options6.kvPersist), "kv-remote");
145851
+ const kvRemoteCache = options6.kvPersist === true ? import_node_path17.default.join(import_node_path17.default.dirname(bundle.path), ".mf", "kv-remote") : import_node_path17.default.join(import_node_path17.default.dirname(options6.kvPersist), "kv-remote");
144530
145852
  options6.kvPersist = `remote:?cache=${encodeURIComponent(kvRemoteCache)}`;
144531
145853
  }
144532
145854
  return options6;
144533
145855
  }
144534
145856
  var miniflare3Module;
144535
145857
  async function getMiniflare3() {
144536
- return miniflare3Module ??= await npxImport("@miniflare/tre@3.0.0-next.7");
145858
+ return miniflare3Module ??= await npxImport("@miniflare/tre@3.0.0-next.8");
144537
145859
  }
144538
145860
 
144539
145861
  // src/dev/remote.tsx
144540
145862
  init_import_meta_url();
144541
145863
  var import_promises5 = require("node:fs/promises");
144542
- var import_node_path16 = __toESM(require("node:path"));
145864
+ var import_node_path18 = __toESM(require("node:path"));
144543
145865
  var import_react6 = __toESM(require_react());
144544
145866
  var import_react_error_boundary = __toESM(require_react_error_boundary_cjs());
144545
145867
 
@@ -144594,7 +145916,7 @@ var import_undici6 = __toESM(require_undici());
144594
145916
 
144595
145917
  // src/create-worker-upload-form.ts
144596
145918
  init_import_meta_url();
144597
- var import_node_fs7 = require("node:fs");
145919
+ var import_node_fs9 = require("node:fs");
144598
145920
  var import_undici5 = __toESM(require_undici());
144599
145921
  function toMimeType(type2) {
144600
145922
  switch (type2) {
@@ -144683,6 +146005,13 @@ function createWorkerUploadForm(worker) {
144683
146005
  ...environment && { environment }
144684
146006
  });
144685
146007
  });
146008
+ bindings.analytics_engine_datasets?.forEach(({ binding, dataset }) => {
146009
+ metadataBindings.push({
146010
+ name: binding,
146011
+ type: "analytics_engine",
146012
+ dataset
146013
+ });
146014
+ });
144686
146015
  bindings.dispatch_namespaces?.forEach(({ binding, namespace }) => {
144687
146016
  metadataBindings.push({
144688
146017
  name: binding,
@@ -144705,7 +146034,7 @@ function createWorkerUploadForm(worker) {
144705
146034
  });
144706
146035
  formData.set(
144707
146036
  name,
144708
- new import_undici5.File([(0, import_node_fs7.readFileSync)(filePath)], filePath, {
146037
+ new import_undici5.File([(0, import_node_fs9.readFileSync)(filePath)], filePath, {
144709
146038
  type: "application/wasm"
144710
146039
  })
144711
146040
  );
@@ -144719,7 +146048,7 @@ function createWorkerUploadForm(worker) {
144719
146048
  if (name !== "__STATIC_CONTENT_MANIFEST") {
144720
146049
  formData.set(
144721
146050
  name,
144722
- new import_undici5.File([(0, import_node_fs7.readFileSync)(filePath)], filePath, {
146051
+ new import_undici5.File([(0, import_node_fs9.readFileSync)(filePath)], filePath, {
144723
146052
  type: "text/plain"
144724
146053
  })
144725
146054
  );
@@ -144733,7 +146062,7 @@ function createWorkerUploadForm(worker) {
144733
146062
  });
144734
146063
  formData.set(
144735
146064
  name,
144736
- new import_undici5.File([(0, import_node_fs7.readFileSync)(filePath)], filePath, {
146065
+ new import_undici5.File([(0, import_node_fs9.readFileSync)(filePath)], filePath, {
144737
146066
  type: "application/octet-stream"
144738
146067
  })
144739
146068
  );
@@ -144797,7 +146126,7 @@ function createWorkerUploadForm(worker) {
144797
146126
  const filePath = bindings.logfwdr.schema;
144798
146127
  formData.set(
144799
146128
  filePath,
144800
- new import_undici5.File([(0, import_node_fs7.readFileSync)(filePath)], filePath, {
146129
+ new import_undici5.File([(0, import_node_fs9.readFileSync)(filePath)], filePath, {
144801
146130
  type: "application/octet-stream"
144802
146131
  })
144803
146132
  );
@@ -145704,7 +147033,7 @@ ${onboardingLink}`);
145704
147033
  async function createRemoteWorkerInit(props) {
145705
147034
  const content = await (0, import_promises5.readFile)(props.bundle.path, "utf-8");
145706
147035
  void printBundleSize(
145707
- { name: import_node_path16.default.basename(props.bundle.path), content },
147036
+ { name: import_node_path18.default.basename(props.bundle.path), content },
145708
147037
  props.modules
145709
147038
  );
145710
147039
  const assets = await syncAssets(
@@ -145717,7 +147046,7 @@ async function createRemoteWorkerInit(props) {
145717
147046
  const init = {
145718
147047
  name: props.name,
145719
147048
  main: {
145720
- name: import_node_path16.default.basename(props.bundle.path),
147049
+ name: import_node_path18.default.basename(props.bundle.path),
145721
147050
  type: props.format === "modules" ? "esm" : "commonjs",
145722
147051
  content
145723
147052
  },
@@ -145768,7 +147097,7 @@ function getWorkerAccountAndContext(props) {
145768
147097
  // src/dev/use-esbuild.ts
145769
147098
  init_import_meta_url();
145770
147099
  var import_node_assert8 = __toESM(require("node:assert"));
145771
- var import_chokidar = require("chokidar");
147100
+ var import_chokidar2 = require("chokidar");
145772
147101
  var import_ink3 = __toESM(require_build2());
145773
147102
  var import_react7 = __toESM(require_react());
145774
147103
 
@@ -145809,7 +147138,7 @@ async function bundleWorker(entry, destination, options6) {
145809
147138
  jsxFactory,
145810
147139
  jsxFragment,
145811
147140
  rules,
145812
- watch: watch5,
147141
+ watch: watch6,
145813
147142
  tsconfig,
145814
147143
  minify,
145815
147144
  nodeCompat,
@@ -145957,7 +147286,7 @@ async function bundleWorker(entry, destination, options6) {
145957
147286
  ...jsxFactory && { jsxFactory },
145958
147287
  ...jsxFragment && { jsxFragment },
145959
147288
  ...tsconfig && { tsconfig },
145960
- watch: watch5,
147289
+ watch: watch6,
145961
147290
  logLevel: "silent"
145962
147291
  };
145963
147292
  let result;
@@ -146375,7 +147704,7 @@ function useEsbuild({
146375
147704
  });
146376
147705
  stopWatching = stop;
146377
147706
  if (noBundle) {
146378
- const watcher = (0, import_chokidar.watch)(entry.file, {
147707
+ const watcher = (0, import_chokidar2.watch)(entry.file, {
146379
147708
  persistent: true
146380
147709
  }).on("change", async (_event) => {
146381
147710
  updateBundle();
@@ -146715,7 +148044,7 @@ function useCustomBuild(expectedEntry, build5) {
146715
148044
  return;
146716
148045
  let watcher;
146717
148046
  if (build5.watch_dir) {
146718
- watcher = (0, import_chokidar2.watch)(build5.watch_dir, {
148047
+ watcher = (0, import_chokidar3.watch)(build5.watch_dir, {
146719
148048
  persistent: true,
146720
148049
  ignoreInitial: true
146721
148050
  }).on("all", (_event, filePath) => {
@@ -146875,10 +148204,10 @@ function getVarsForDev(config, env5) {
146875
148204
 
146876
148205
  // src/dev/get-local-persistence-path.tsx
146877
148206
  init_import_meta_url();
146878
- var import_node_path17 = __toESM(require("node:path"));
148207
+ var import_node_path19 = __toESM(require("node:path"));
146879
148208
  function getLocalPersistencePath(persistTo, doPersist, configPath) {
146880
- return persistTo ? import_node_path17.default.resolve(process.cwd(), persistTo) : doPersist ? import_node_path17.default.resolve(
146881
- configPath ? import_node_path17.default.dirname(configPath) : process.cwd(),
148209
+ return persistTo ? import_node_path19.default.resolve(process.cwd(), persistTo) : doPersist ? import_node_path19.default.resolve(
148210
+ configPath ? import_node_path19.default.dirname(configPath) : process.cwd(),
146882
148211
  ".wrangler/state"
146883
148212
  ) : null;
146884
148213
  }
@@ -146886,7 +148215,7 @@ function getLocalPersistencePath(persistTo, doPersist, configPath) {
146886
148215
  // src/dev/start-server.ts
146887
148216
  init_import_meta_url();
146888
148217
  var import_node_child_process4 = require("node:child_process");
146889
- var import_node_fs8 = require("node:fs");
148218
+ var import_node_fs10 = require("node:fs");
146890
148219
  var import_promises6 = require("node:fs/promises");
146891
148220
  var path22 = __toESM(require("node:path"));
146892
148221
  var util2 = __toESM(require("node:util"));
@@ -147150,7 +148479,7 @@ async function startLocalServer({
147150
148479
  module2.content
147151
148480
  );
147152
148481
  }
147153
- const scriptPath = (0, import_node_fs8.realpathSync)(bundle.path);
148482
+ const scriptPath = (0, import_node_fs10.realpathSync)(bundle.path);
147154
148483
  const upstream = typeof localUpstream === "string" ? `${localProtocol}://${localUpstream}` : void 0;
147155
148484
  const {
147156
148485
  externalDurableObjects,
@@ -147222,11 +148551,7 @@ async function startLocalServer({
147222
148551
  onReady?.(runtimeURL.hostname, parseInt(runtimeURL.port ?? 8787));
147223
148552
  return;
147224
148553
  }
147225
- const nodeOptions = setupNodeOptions({
147226
- inspect: inspect2,
147227
- ip: initialIp,
147228
- inspectorPort
147229
- });
148554
+ const nodeOptions = setupNodeOptions({ inspect: inspect2, inspectorPort });
147230
148555
  logger.log("\u2394 Starting a local server...");
147231
148556
  const child = local = (0, import_node_child_process4.fork)(miniflareCLIPath, forkOptions, {
147232
148557
  cwd: path22.dirname(scriptPath),
@@ -147327,8 +148652,8 @@ var import_undici9 = __toESM(require_undici());
147327
148652
  // src/metrics/metrics-config.ts
147328
148653
  init_import_meta_url();
147329
148654
  var import_node_crypto4 = require("node:crypto");
147330
- var import_node_fs9 = require("node:fs");
147331
- var import_node_path18 = __toESM(require("node:path"));
148655
+ var import_node_fs11 = require("node:fs");
148656
+ var import_node_path20 = __toESM(require("node:path"));
147332
148657
 
147333
148658
  // src/dialogs.tsx
147334
148659
  init_import_meta_url();
@@ -147476,7 +148801,7 @@ async function getMetricsConfig({
147476
148801
  "Would you like to help improve Wrangler by sending usage metrics to Cloudflare?"
147477
148802
  );
147478
148803
  logger.log(
147479
- `Your choice has been saved in the following file: ${import_node_path18.default.relative(
148804
+ `Your choice has been saved in the following file: ${import_node_path20.default.relative(
147480
148805
  process.cwd(),
147481
148806
  getMetricsConfigPath()
147482
148807
  )}.
@@ -147496,8 +148821,8 @@ async function getMetricsConfig({
147496
148821
  return { enabled, deviceId, userId };
147497
148822
  }
147498
148823
  function writeMetricsConfig(config) {
147499
- (0, import_node_fs9.mkdirSync)(import_node_path18.default.dirname(getMetricsConfigPath()), { recursive: true });
147500
- (0, import_node_fs9.writeFileSync)(
148824
+ (0, import_node_fs11.mkdirSync)(import_node_path20.default.dirname(getMetricsConfigPath()), { recursive: true });
148825
+ (0, import_node_fs11.writeFileSync)(
147501
148826
  getMetricsConfigPath(),
147502
148827
  JSON.stringify(
147503
148828
  config,
@@ -147508,7 +148833,7 @@ function writeMetricsConfig(config) {
147508
148833
  }
147509
148834
  function readMetricsConfig() {
147510
148835
  try {
147511
- const config = (0, import_node_fs9.readFileSync)(getMetricsConfigPath(), "utf8");
148836
+ const config = (0, import_node_fs11.readFileSync)(getMetricsConfigPath(), "utf8");
147512
148837
  return JSON.parse(
147513
148838
  config,
147514
148839
  (key2, value) => key2 === "date" ? new Date(value) : value
@@ -147518,7 +148843,7 @@ function readMetricsConfig() {
147518
148843
  }
147519
148844
  }
147520
148845
  function getMetricsConfigPath() {
147521
- return import_node_path18.default.resolve(getGlobalWranglerConfigPath(), "metrics.json");
148846
+ return import_node_path20.default.resolve(getGlobalWranglerConfigPath(), "metrics.json");
147522
148847
  }
147523
148848
  function getDeviceId(config) {
147524
148849
  const deviceId = config.deviceId ?? (0, import_node_crypto4.randomUUID)();
@@ -152994,7 +154319,7 @@ function _createClass4(Constructor, protoProps, staticProps) {
152994
154319
  var TimeAgo = /* @__PURE__ */ function() {
152995
154320
  function TimeAgo2() {
152996
154321
  var locales = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
152997
- var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, polyfill = _ref.polyfill;
154322
+ var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, polyfill2 = _ref.polyfill;
152998
154323
  _classCallCheck4(this, TimeAgo2);
152999
154324
  if (typeof locales === "string") {
153000
154325
  locales = [locales];
@@ -153005,7 +154330,7 @@ var TimeAgo = /* @__PURE__ */ function() {
153005
154330
  this.numberFormat = new Intl.NumberFormat(this.locale);
153006
154331
  }
153007
154332
  }
153008
- if (polyfill === false) {
154333
+ if (polyfill2 === false) {
153009
154334
  this.IntlRelativeTimeFormat = Intl.RelativeTimeFormat;
153010
154335
  this.IntlPluralRules = Intl.PluralRules;
153011
154336
  } else {
@@ -154014,9 +155339,9 @@ var Handler3 = withConfig(
154014
155339
 
154015
155340
  // src/d1/execute.tsx
154016
155341
  init_import_meta_url();
154017
- var import_node_fs10 = require("node:fs");
155342
+ var import_node_fs12 = require("node:fs");
154018
155343
  var import_promises8 = require("node:fs/promises");
154019
- var import_node_path19 = __toESM(require("node:path"));
155344
+ var import_node_path21 = __toESM(require("node:path"));
154020
155345
  var import_chalk3 = __toESM(require_chalk());
154021
155346
  var import_ink9 = __toESM(require_build2());
154022
155347
  var import_ink_table4 = __toESM(require_dist2());
@@ -154122,13 +155447,13 @@ async function executeLocally(config, name, shouldPrompt, queries, persistTo) {
154122
155447
  true,
154123
155448
  config.configPath
154124
155449
  );
154125
- const dbDir = import_node_path19.default.join(persistencePath, "d1");
154126
- const dbPath = import_node_path19.default.join(dbDir, `${localDB.binding}.sqlite3`);
155450
+ const dbDir = import_node_path21.default.join(persistencePath, "d1");
155451
+ const dbPath = import_node_path21.default.join(dbDir, `${localDB.binding}.sqlite3`);
154127
155452
  const [{ Statement }, { createSQLiteDB }] = await npxImport(
154128
155453
  ["@miniflare/d1", "@miniflare/shared"],
154129
155454
  logDim
154130
155455
  );
154131
- if (!(0, import_node_fs10.existsSync)(dbDir) && shouldPrompt) {
155456
+ if (!(0, import_node_fs12.existsSync)(dbDir) && shouldPrompt) {
154132
155457
  const ok = await confirm(
154133
155458
  `About to create ${readableRelative(dbPath)}, ok?`
154134
155459
  );
@@ -154240,7 +155565,7 @@ init_import_meta_url();
154240
155565
 
154241
155566
  // src/d1/migrations/apply.tsx
154242
155567
  init_import_meta_url();
154243
- var import_node_fs12 = __toESM(require("node:fs"));
155568
+ var import_node_fs14 = __toESM(require("node:fs"));
154244
155569
  var import_path6 = __toESM(require("path"));
154245
155570
  var import_ink10 = __toESM(require_build2());
154246
155571
  var import_ink_table5 = __toESM(require_dist2());
@@ -154248,16 +155573,16 @@ var import_react14 = __toESM(require_react());
154248
155573
 
154249
155574
  // src/d1/migrations/helpers.ts
154250
155575
  init_import_meta_url();
154251
- var import_node_fs11 = __toESM(require("node:fs"));
155576
+ var import_node_fs13 = __toESM(require("node:fs"));
154252
155577
  var import_path5 = __toESM(require("path"));
154253
155578
  async function getMigrationsPath(projectPath, migrationsFolderPath, createIfMissing) {
154254
155579
  const dir = import_path5.default.resolve(projectPath, migrationsFolderPath);
154255
- if (import_node_fs11.default.existsSync(dir))
155580
+ if (import_node_fs13.default.existsSync(dir))
154256
155581
  return dir;
154257
155582
  const warning = `No migrations folder found.${migrationsFolderPath === DEFAULT_MIGRATION_PATH ? " Set `migrations_dir` in wrangler.toml to choose a different path." : ""}`;
154258
155583
  if (createIfMissing && await confirm(`${warning}
154259
155584
  Ok to create ${dir}?`)) {
154260
- import_node_fs11.default.mkdirSync(dir, { recursive: true });
155585
+ import_node_fs13.default.mkdirSync(dir, { recursive: true });
154261
155586
  return dir;
154262
155587
  } else {
154263
155588
  logger.warn(warning);
@@ -154302,7 +155627,7 @@ var listAppliedMigrations = async (migrationsTableName, local, config, name, per
154302
155627
  };
154303
155628
  function getMigrationNames(migrationsPath) {
154304
155629
  const migrations = [];
154305
- const dir = import_node_fs11.default.opendirSync(migrationsPath);
155630
+ const dir = import_node_fs13.default.opendirSync(migrationsPath);
154306
155631
  let dirent;
154307
155632
  while ((dirent = dir.readSync()) !== null) {
154308
155633
  if (dirent.name.endsWith(".sql"))
@@ -154426,7 +155751,7 @@ Your database may not be available to serve requests during the migration, conti
154426
155751
  (0, import_ink10.render)(/* @__PURE__ */ import_react14.default.createElement(import_ink10.Text, null, "\u{1F552} Creating backup..."));
154427
155752
  await createBackup(accountId, databaseInfo.uuid);
154428
155753
  for (const migration of unappliedMigrations) {
154429
- let query = import_node_fs12.default.readFileSync(
155754
+ let query = import_node_fs14.default.readFileSync(
154430
155755
  `${migrationsPath}/${migration.Name}`,
154431
155756
  "utf8"
154432
155757
  );
@@ -154490,7 +155815,7 @@ Your database may not be available to serve requests during the migration, conti
154490
155815
 
154491
155816
  // src/d1/migrations/create.tsx
154492
155817
  init_import_meta_url();
154493
- var import_node_fs13 = __toESM(require("node:fs"));
155818
+ var import_node_fs15 = __toESM(require("node:fs"));
154494
155819
  var import_path7 = __toESM(require("path"));
154495
155820
  var import_ink11 = __toESM(require_build2());
154496
155821
  var import_react15 = __toESM(require_react());
@@ -154522,7 +155847,7 @@ var CreateHandler2 = withConfig(
154522
155847
  const nextMigrationNumber = pad(getNextMigrationNumber(migrationsPath), 4);
154523
155848
  const migrationName = message.replaceAll(" ", "_");
154524
155849
  const newMigrationName = `${nextMigrationNumber}_${migrationName}.sql`;
154525
- import_node_fs13.default.writeFileSync(
155850
+ import_node_fs15.default.writeFileSync(
154526
155851
  `${migrationsPath}/${newMigrationName}`,
154527
155852
  `-- Migration number: ${nextMigrationNumber} ${new Date().toISOString()}
154528
155853
  `
@@ -154739,13 +156064,13 @@ async function deleteSiteNamespaceIfExisting(scriptName, accountId) {
154739
156064
 
154740
156065
  // src/deployments.ts
154741
156066
  init_import_meta_url();
154742
- var import_url2 = require("url");
156067
+ var import_url3 = require("url");
154743
156068
  async function deployments(accountId, scriptName) {
154744
156069
  const scriptMetadata = await fetchResult(
154745
156070
  `/accounts/${accountId}/workers/services/${scriptName}`
154746
156071
  );
154747
156072
  const scriptTag = scriptMetadata.default_environment.script.tag;
154748
- const params = new import_url2.URLSearchParams({ order: "asc" });
156073
+ const params = new import_url3.URLSearchParams({ order: "asc" });
154749
156074
  const { items: deploys } = await fetchResult(
154750
156075
  `/accounts/${accountId}/workers/deployments/by-script/${scriptTag}`,
154751
156076
  void 0,
@@ -154779,8 +156104,8 @@ function sourceStr(source) {
154779
156104
 
154780
156105
  // src/deprecated/index.ts
154781
156106
  init_import_meta_url();
154782
- var import_node_fs16 = __toESM(require("node:fs"));
154783
- var import_node_path23 = __toESM(require("node:path"));
156107
+ var import_node_fs18 = __toESM(require("node:fs"));
156108
+ var import_node_path25 = __toESM(require("node:path"));
154784
156109
 
154785
156110
  // src/errors.ts
154786
156111
  init_import_meta_url();
@@ -154799,9 +156124,9 @@ var FatalError = class extends Error {
154799
156124
 
154800
156125
  // src/git-client.ts
154801
156126
  init_import_meta_url();
154802
- var import_node_fs14 = __toESM(require("node:fs"));
156127
+ var import_node_fs16 = __toESM(require("node:fs"));
154803
156128
  var import_node_os9 = __toESM(require("node:os"));
154804
- var import_node_path20 = __toESM(require("node:path"));
156129
+ var import_node_path22 = __toESM(require("node:path"));
154805
156130
  var import_semiver = __toESM(require_semiver());
154806
156131
  async function isInsideGitRepo(cwd2) {
154807
156132
  const res = await findUp(".git", { cwd: cwd2, type: "directory" });
@@ -154821,9 +156146,18 @@ async function getGitVersioon() {
154821
156146
  }
154822
156147
  async function initializeGit(cwd2) {
154823
156148
  try {
154824
- await execa5("git", ["init", "--initial-branch", "main"], {
154825
- cwd: cwd2
154826
- });
156149
+ const { stdout: defaultBranchName } = await execa5("git", [
156150
+ "config",
156151
+ "--get",
156152
+ "init.defaultBranch"
156153
+ ]);
156154
+ await execa5(
156155
+ "git",
156156
+ ["init", "--initial-branch", defaultBranchName.trim() ?? "main"],
156157
+ {
156158
+ cwd: cwd2
156159
+ }
156160
+ );
154827
156161
  } catch {
154828
156162
  await execa5("git", ["init"], {
154829
156163
  cwd: cwd2
@@ -154847,8 +156181,8 @@ async function cloneIntoDirectory(remote, targetDirectory, subdirectory) {
154847
156181
  args.push("-b", remote.substring(tagIndex + 1));
154848
156182
  args.push(remote.substring(0, tagIndex));
154849
156183
  }
154850
- const tempDir = import_node_fs14.default.mkdtempSync(
154851
- import_node_path20.default.join(import_node_os9.default.tmpdir(), `wrangler-generate-repo-`)
156184
+ const tempDir = import_node_fs16.default.mkdtempSync(
156185
+ import_node_path22.default.join(import_node_os9.default.tmpdir(), `wrangler-generate-repo-`)
154852
156186
  );
154853
156187
  args.push(tempDir);
154854
156188
  await execa5("git", args);
@@ -154857,13 +156191,13 @@ async function cloneIntoDirectory(remote, targetDirectory, subdirectory) {
154857
156191
  cwd: tempDir
154858
156192
  });
154859
156193
  }
154860
- const templatePath = subdirectory !== void 0 ? import_node_path20.default.join(tempDir, subdirectory) : tempDir;
156194
+ const templatePath = subdirectory !== void 0 ? import_node_path22.default.join(tempDir, subdirectory) : tempDir;
154861
156195
  try {
154862
- import_node_fs14.default.renameSync(templatePath, targetDirectory);
156196
+ import_node_fs16.default.renameSync(templatePath, targetDirectory);
154863
156197
  } catch {
154864
156198
  throw new Error(`Failed to find "${subdirectory}" in ${remote}`);
154865
156199
  }
154866
- import_node_fs14.default.rmSync(import_node_path20.default.join(targetDirectory, ".git"), {
156200
+ import_node_fs16.default.rmSync(import_node_path22.default.join(targetDirectory, ".git"), {
154867
156201
  recursive: true,
154868
156202
  force: true
154869
156203
  });
@@ -154873,13 +156207,13 @@ async function cloneIntoDirectory(remote, targetDirectory, subdirectory) {
154873
156207
  init_import_meta_url();
154874
156208
  var fs12 = __toESM(require("node:fs"));
154875
156209
  var import_promises9 = require("node:fs/promises");
154876
- var import_node_path22 = __toESM(require("node:path"));
156210
+ var import_node_path24 = __toESM(require("node:path"));
154877
156211
  var import_toml4 = __toESM(require_toml());
154878
156212
 
154879
156213
  // src/package-manager.ts
154880
156214
  init_import_meta_url();
154881
- var import_node_fs15 = require("node:fs");
154882
- var import_node_path21 = require("node:path");
156215
+ var import_node_fs17 = require("node:fs");
156216
+ var import_node_path23 = require("node:path");
154883
156217
  var import_node_process6 = require("node:process");
154884
156218
  async function getPackageManager2(cwd2) {
154885
156219
  const [hasYarn, hasNpm, hasPnpm] = await Promise.all([
@@ -154887,9 +156221,9 @@ async function getPackageManager2(cwd2) {
154887
156221
  supportsNpm(),
154888
156222
  supportsPnpm()
154889
156223
  ]);
154890
- const hasYarnLock = (0, import_node_fs15.existsSync)((0, import_node_path21.join)(cwd2, "yarn.lock"));
154891
- const hasNpmLock = (0, import_node_fs15.existsSync)((0, import_node_path21.join)(cwd2, "package-lock.json"));
154892
- const hasPnpmLock = (0, import_node_fs15.existsSync)((0, import_node_path21.join)(cwd2, "pnpm-lock.yaml"));
156224
+ const hasYarnLock = (0, import_node_fs17.existsSync)((0, import_node_path23.join)(cwd2, "yarn.lock"));
156225
+ const hasNpmLock = (0, import_node_fs17.existsSync)((0, import_node_path23.join)(cwd2, "package-lock.json"));
156226
+ const hasPnpmLock = (0, import_node_fs17.existsSync)((0, import_node_path23.join)(cwd2, "pnpm-lock.yaml"));
154893
156227
  const userAgent = sniffUserAgent();
154894
156228
  if (hasNpmLock) {
154895
156229
  if (hasNpm) {
@@ -155073,12 +156407,12 @@ async function initHandler(args) {
155073
156407
  const instructions = [];
155074
156408
  let shouldRunPackageManagerInstall = false;
155075
156409
  const fromDashScriptName = args["from-dash"];
155076
- const creationDirectory = import_node_path22.default.resolve(
156410
+ const creationDirectory = import_node_path24.default.resolve(
155077
156411
  process.cwd(),
155078
156412
  (args.name ? args.name : fromDashScriptName) ?? ""
155079
156413
  );
155080
156414
  if (args.site) {
155081
- const gitDirectory = creationDirectory !== process.cwd() ? import_node_path22.default.basename(creationDirectory) : "my-site";
156415
+ const gitDirectory = creationDirectory !== process.cwd() ? import_node_path24.default.basename(creationDirectory) : "my-site";
155082
156416
  const message = `The --site option is no longer supported.
155083
156417
  If you wish to create a brand new Worker Sites project then clone the \`worker-sites-template\` starter repository:
155084
156418
 
@@ -155091,9 +156425,9 @@ Find out more about how to create and maintain Sites projects at https://develop
155091
156425
  Have you considered using Cloudflare Pages instead? See https://pages.cloudflare.com/.`;
155092
156426
  throw new CommandLineArgsError(message);
155093
156427
  }
155094
- const workerName = import_node_path22.default.basename(creationDirectory).toLowerCase().replaceAll(/[^a-z0-9\-_]/gm, "-");
156428
+ const workerName = import_node_path24.default.basename(creationDirectory).toLowerCase().replaceAll(/[^a-z0-9\-_]/gm, "-");
155095
156429
  const packageManager = await getPackageManager2(creationDirectory);
155096
- const wranglerTomlDestination = import_node_path22.default.join(
156430
+ const wranglerTomlDestination = import_node_path24.default.join(
155097
156431
  creationDirectory,
155098
156432
  "./wrangler.toml"
155099
156433
  );
@@ -155101,7 +156435,7 @@ Have you considered using Cloudflare Pages instead? See https://pages.cloudflare
155101
156435
  if (fs12.existsSync(wranglerTomlDestination)) {
155102
156436
  let shouldContinue = false;
155103
156437
  logger.warn(
155104
- `${import_node_path22.default.relative(process.cwd(), wranglerTomlDestination)} already exists!`
156438
+ `${import_node_path24.default.relative(process.cwd(), wranglerTomlDestination)} already exists!`
155105
156439
  );
155106
156440
  if (!fromDashScriptName) {
155107
156441
  shouldContinue = await confirm(
@@ -155123,12 +156457,12 @@ Have you considered using Cloudflare Pages instead? See https://pages.cloudflare
155123
156457
  }) + "\n"
155124
156458
  );
155125
156459
  logger.log(
155126
- `\u2728 Created ${import_node_path22.default.relative(process.cwd(), wranglerTomlDestination)}`
156460
+ `\u2728 Created ${import_node_path24.default.relative(process.cwd(), wranglerTomlDestination)}`
155127
156461
  );
155128
156462
  justCreatedWranglerToml = true;
155129
156463
  } catch (err2) {
155130
156464
  throw new Error(
155131
- `Failed to create ${import_node_path22.default.relative(
156465
+ `Failed to create ${import_node_path24.default.relative(
155132
156466
  process.cwd(),
155133
156467
  wranglerTomlDestination
155134
156468
  )}.
@@ -155142,11 +156476,11 @@ ${err2.message ?? err2}`
155142
156476
  if (shouldInitGit) {
155143
156477
  await initializeGit(creationDirectory);
155144
156478
  await (0, import_promises9.writeFile)(
155145
- import_node_path22.default.join(creationDirectory, ".gitignore"),
155146
- readFileSync5(import_node_path22.default.join(getBasePath(), "templates/gitignore"))
156479
+ import_node_path24.default.join(creationDirectory, ".gitignore"),
156480
+ readFileSync5(import_node_path24.default.join(getBasePath(), "templates/gitignore"))
155147
156481
  );
155148
156482
  logger.log(
155149
- args.name && args.name !== "." ? `\u2728 Initialized git repository at ${import_node_path22.default.relative(
156483
+ args.name && args.name !== "." ? `\u2728 Initialized git repository at ${import_node_path24.default.relative(
155150
156484
  process.cwd(),
155151
156485
  creationDirectory
155152
156486
  )}` : `\u2728 Initialized git repository`
@@ -155166,7 +156500,7 @@ ${err2.message ?? err2}`
155166
156500
  shouldCreatePackageJson = yesFlag || await confirm("No package.json found. Would you like to create one?");
155167
156501
  if (shouldCreatePackageJson) {
155168
156502
  await (0, import_promises9.writeFile)(
155169
- import_node_path22.default.join(creationDirectory, "./package.json"),
156503
+ import_node_path24.default.join(creationDirectory, "./package.json"),
155170
156504
  JSON.stringify(
155171
156505
  {
155172
156506
  name: workerName,
@@ -155181,9 +156515,9 @@ ${err2.message ?? err2}`
155181
156515
  ) + "\n"
155182
156516
  );
155183
156517
  shouldRunPackageManagerInstall = true;
155184
- pathToPackageJson = import_node_path22.default.join(creationDirectory, "package.json");
156518
+ pathToPackageJson = import_node_path24.default.join(creationDirectory, "package.json");
155185
156519
  logger.log(
155186
- `\u2728 Created ${import_node_path22.default.relative(process.cwd(), pathToPackageJson)}`
156520
+ `\u2728 Created ${import_node_path24.default.relative(process.cwd(), pathToPackageJson)}`
155187
156521
  );
155188
156522
  } else {
155189
156523
  return;
@@ -155195,7 +156529,7 @@ ${err2.message ?? err2}`
155195
156529
  );
155196
156530
  if (!(packageJson.devDependencies?.wrangler || packageJson.dependencies?.wrangler)) {
155197
156531
  const shouldInstall = yesFlag || await confirm(
155198
- `Would you like to install wrangler into ${import_node_path22.default.relative(
156532
+ `Would you like to install wrangler into ${import_node_path24.default.relative(
155199
156533
  process.cwd(),
155200
156534
  pathToPackageJson
155201
156535
  )}?`
@@ -155215,13 +156549,13 @@ ${err2.message ?? err2}`
155215
156549
  if (yesFlag || await confirm("Would you like to use TypeScript?")) {
155216
156550
  isTypescriptProject = true;
155217
156551
  await (0, import_promises9.writeFile)(
155218
- import_node_path22.default.join(creationDirectory, "./tsconfig.json"),
155219
- readFileSync5(import_node_path22.default.join(getBasePath(), "templates/tsconfig.json"))
156552
+ import_node_path24.default.join(creationDirectory, "./tsconfig.json"),
156553
+ readFileSync5(import_node_path24.default.join(getBasePath(), "templates/tsconfig.json"))
155220
156554
  );
155221
156555
  devDepsToInstall.push("@cloudflare/workers-types");
155222
156556
  devDepsToInstall.push("typescript");
155223
- pathToTSConfig = import_node_path22.default.join(creationDirectory, "tsconfig.json");
155224
- logger.log(`\u2728 Created ${import_node_path22.default.relative(process.cwd(), pathToTSConfig)}`);
156557
+ pathToTSConfig = import_node_path24.default.join(creationDirectory, "tsconfig.json");
156558
+ logger.log(`\u2728 Created ${import_node_path24.default.relative(process.cwd(), pathToTSConfig)}`);
155225
156559
  }
155226
156560
  } else {
155227
156561
  isTypescriptProject = true;
@@ -155236,7 +156570,7 @@ ${err2.message ?? err2}`
155236
156570
  if (shouldInstall) {
155237
156571
  devDepsToInstall.push("@cloudflare/workers-types");
155238
156572
  instructions.push(
155239
- `\u{1F6A8} Please add "@cloudflare/workers-types" to compilerOptions.types in ${import_node_path22.default.relative(
156573
+ `\u{1F6A8} Please add "@cloudflare/workers-types" to compilerOptions.types in ${import_node_path24.default.relative(
155240
156574
  process.cwd(),
155241
156575
  pathToTSConfig
155242
156576
  )}`
@@ -155273,7 +156607,7 @@ ${err2.message ?? err2}`
155273
156607
  };
155274
156608
  fs12.writeFileSync(wranglerTomlDestination, import_toml4.default.stringify(newToml));
155275
156609
  }
155276
- const isNamedWorker = isCreatingWranglerToml && import_node_path22.default.dirname(packagePath) !== process.cwd();
156610
+ const isNamedWorker = isCreatingWranglerToml && import_node_path24.default.dirname(packagePath) !== process.cwd();
155277
156611
  const isAddingTestScripts = isAddingTests && !packageJsonContent.scripts?.test;
155278
156612
  if (isWritingScripts) {
155279
156613
  await (0, import_promises9.writeFile)(
@@ -155313,10 +156647,10 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
155313
156647
  }
155314
156648
  }
155315
156649
  if (isTypescriptProject) {
155316
- if (!fs12.existsSync(import_node_path22.default.join(creationDirectory, "./src/index.ts"))) {
155317
- const newWorkerFilename = import_node_path22.default.relative(
156650
+ if (!fs12.existsSync(import_node_path24.default.join(creationDirectory, "./src/index.ts"))) {
156651
+ const newWorkerFilename = import_node_path24.default.relative(
155318
156652
  process.cwd(),
155319
- import_node_path22.default.join(creationDirectory, "./src/index.ts")
156653
+ import_node_path24.default.join(creationDirectory, "./src/index.ts")
155320
156654
  );
155321
156655
  if (fromDashScriptName) {
155322
156656
  logger.warn(
@@ -155325,7 +156659,7 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
155325
156659
  );
155326
156660
  const config = readConfig(args.config, args);
155327
156661
  const accountId = await requireAuth(config);
155328
- await (0, import_promises9.mkdir)(import_node_path22.default.join(creationDirectory, "./src"), {
156662
+ await (0, import_promises9.mkdir)(import_node_path24.default.join(creationDirectory, "./src"), {
155329
156663
  recursive: true
155330
156664
  });
155331
156665
  const serviceMetaData = await fetchResult(
@@ -155336,7 +156670,7 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
155336
156670
  `/accounts/${accountId}/workers/services/${fromDashScriptName}/environments/${defaultEnvironment}/content`
155337
156671
  );
155338
156672
  await (0, import_promises9.writeFile)(
155339
- import_node_path22.default.join(creationDirectory, "./src/index.ts"),
156673
+ import_node_path24.default.join(creationDirectory, "./src/index.ts"),
155340
156674
  dashScript
155341
156675
  );
155342
156676
  await writePackageJsonScriptsAndUpdateWranglerToml({
@@ -155353,17 +156687,17 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
155353
156687
  const newWorkerType = yesFlag ? "fetch" : await getNewWorkerType(newWorkerFilename);
155354
156688
  if (newWorkerType !== "none") {
155355
156689
  const template = getNewWorkerTemplate("ts", newWorkerType);
155356
- await (0, import_promises9.mkdir)(import_node_path22.default.join(creationDirectory, "./src"), {
156690
+ await (0, import_promises9.mkdir)(import_node_path24.default.join(creationDirectory, "./src"), {
155357
156691
  recursive: true
155358
156692
  });
155359
156693
  await (0, import_promises9.writeFile)(
155360
- import_node_path22.default.join(creationDirectory, "./src/index.ts"),
155361
- readFileSync5(import_node_path22.default.join(getBasePath(), `templates/${template}`))
156694
+ import_node_path24.default.join(creationDirectory, "./src/index.ts"),
156695
+ readFileSync5(import_node_path24.default.join(getBasePath(), `templates/${template}`))
155362
156696
  );
155363
156697
  logger.log(
155364
- `\u2728 Created ${import_node_path22.default.relative(
156698
+ `\u2728 Created ${import_node_path24.default.relative(
155365
156699
  process.cwd(),
155366
- import_node_path22.default.join(creationDirectory, "./src/index.ts")
156700
+ import_node_path24.default.join(creationDirectory, "./src/index.ts")
155367
156701
  )}`
155368
156702
  );
155369
156703
  await writePackageJsonScriptsAndUpdateWranglerToml({
@@ -155377,10 +156711,10 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
155377
156711
  }
155378
156712
  }
155379
156713
  } else {
155380
- if (!fs12.existsSync(import_node_path22.default.join(creationDirectory, "./src/index.js"))) {
155381
- const newWorkerFilename = import_node_path22.default.relative(
156714
+ if (!fs12.existsSync(import_node_path24.default.join(creationDirectory, "./src/index.js"))) {
156715
+ const newWorkerFilename = import_node_path24.default.relative(
155382
156716
  process.cwd(),
155383
- import_node_path22.default.join(creationDirectory, "./src/index.js")
156717
+ import_node_path24.default.join(creationDirectory, "./src/index.js")
155384
156718
  );
155385
156719
  if (fromDashScriptName) {
155386
156720
  logger.warn(
@@ -155389,7 +156723,7 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
155389
156723
  );
155390
156724
  const config = readConfig(args.config, args);
155391
156725
  const accountId = await requireAuth(config);
155392
- await (0, import_promises9.mkdir)(import_node_path22.default.join(creationDirectory, "./src"), {
156726
+ await (0, import_promises9.mkdir)(import_node_path24.default.join(creationDirectory, "./src"), {
155393
156727
  recursive: true
155394
156728
  });
155395
156729
  const serviceMetaData = await fetchResult(
@@ -155400,7 +156734,7 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
155400
156734
  `/accounts/${accountId}/workers/services/${fromDashScriptName}/environments/${defaultEnvironment}/content`
155401
156735
  );
155402
156736
  await (0, import_promises9.writeFile)(
155403
- import_node_path22.default.join(creationDirectory, "./src/index.js"),
156737
+ import_node_path24.default.join(creationDirectory, "./src/index.js"),
155404
156738
  dashScript
155405
156739
  );
155406
156740
  await writePackageJsonScriptsAndUpdateWranglerToml({
@@ -155417,17 +156751,17 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
155417
156751
  const newWorkerType = yesFlag ? "fetch" : await getNewWorkerType(newWorkerFilename);
155418
156752
  if (newWorkerType !== "none") {
155419
156753
  const template = getNewWorkerTemplate("js", newWorkerType);
155420
- await (0, import_promises9.mkdir)(import_node_path22.default.join(creationDirectory, "./src"), {
156754
+ await (0, import_promises9.mkdir)(import_node_path24.default.join(creationDirectory, "./src"), {
155421
156755
  recursive: true
155422
156756
  });
155423
156757
  await (0, import_promises9.writeFile)(
155424
- import_node_path22.default.join(creationDirectory, "./src/index.js"),
155425
- readFileSync5(import_node_path22.default.join(getBasePath(), `templates/${template}`))
156758
+ import_node_path24.default.join(creationDirectory, "./src/index.js"),
156759
+ readFileSync5(import_node_path24.default.join(getBasePath(), `templates/${template}`))
155426
156760
  );
155427
156761
  logger.log(
155428
- `\u2728 Created ${import_node_path22.default.relative(
156762
+ `\u2728 Created ${import_node_path24.default.relative(
155429
156763
  process.cwd(),
155430
- import_node_path22.default.join(creationDirectory, "./src/index.js")
156764
+ import_node_path24.default.join(creationDirectory, "./src/index.js")
155431
156765
  )}`
155432
156766
  );
155433
156767
  shouldCreateTests = yesFlag || await confirm("Would you like us to write your first test?");
@@ -155435,18 +156769,18 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
155435
156769
  newWorkerTestType = await getNewWorkerTestType();
155436
156770
  devDepsToInstall.push(newWorkerTestType);
155437
156771
  await (0, import_promises9.writeFile)(
155438
- import_node_path22.default.join(creationDirectory, "./src/index.test.js"),
156772
+ import_node_path24.default.join(creationDirectory, "./src/index.test.js"),
155439
156773
  readFileSync5(
155440
- import_node_path22.default.join(
156774
+ import_node_path24.default.join(
155441
156775
  getBasePath(),
155442
156776
  `templates/init-tests/test-${newWorkerTestType}-new-worker.js`
155443
156777
  )
155444
156778
  )
155445
156779
  );
155446
156780
  logger.log(
155447
- `\u2728 Created ${import_node_path22.default.relative(
156781
+ `\u2728 Created ${import_node_path24.default.relative(
155448
156782
  process.cwd(),
155449
- import_node_path22.default.join(creationDirectory, "./src/index.test.js")
156783
+ import_node_path24.default.join(creationDirectory, "./src/index.test.js")
155450
156784
  )}`
155451
156785
  );
155452
156786
  }
@@ -155555,7 +156889,7 @@ function getNewWorkerToml(workerType) {
155555
156889
  }
155556
156890
  async function findPath(isolatedInit, cwd2, basename5) {
155557
156891
  if (isolatedInit) {
155558
- return fs12.existsSync(import_node_path22.default.resolve(cwd2, basename5)) ? import_node_path22.default.resolve(cwd2, basename5) : void 0;
156892
+ return fs12.existsSync(import_node_path24.default.resolve(cwd2, basename5)) ? import_node_path24.default.resolve(cwd2, basename5) : void 0;
155559
156893
  } else {
155560
156894
  return await findUp(basename5, {
155561
156895
  cwd: cwd2
@@ -155646,6 +156980,14 @@ async function getWorkerConfig(accountId, fromDashScriptName, {
155646
156980
  ];
155647
156981
  }
155648
156982
  break;
156983
+ case "analytics_engine":
156984
+ {
156985
+ configObj.analytics_engine_datasets = [
156986
+ ...configObj.analytics_engine_datasets ?? [],
156987
+ { binding: binding.name, dataset: binding.dataset }
156988
+ ];
156989
+ }
156990
+ break;
155649
156991
  case "namespace":
155650
156992
  {
155651
156993
  configObj.dispatch_namespaces = [
@@ -155753,7 +157095,7 @@ function generateOptions(yargs) {
155753
157095
  deprecated: true
155754
157096
  });
155755
157097
  }
155756
- async function generateHandler({
157098
+ async function generateHandler2({
155757
157099
  name = "",
155758
157100
  template,
155759
157101
  type: type2,
@@ -155776,7 +157118,7 @@ async function generateHandler({
155776
157118
  }
155777
157119
  const creationDirectory = generateWorkerDirectoryName(name);
155778
157120
  if (site) {
155779
- const gitDirectory = creationDirectory !== process.cwd() ? import_node_path23.default.basename(creationDirectory) : "my-site";
157121
+ const gitDirectory = creationDirectory !== process.cwd() ? import_node_path25.default.basename(creationDirectory) : "my-site";
155780
157122
  const message = `The --site option is no longer supported.
155781
157123
  If you wish to create a brand new Worker Sites project then clone the \`worker-sites-template\` starter repository:
155782
157124
 
@@ -155790,7 +157132,7 @@ Have you considered using Cloudflare Pages instead? See https://pages.cloudflare
155790
157132
  throw new CommandLineArgsError(message);
155791
157133
  }
155792
157134
  logger.log(
155793
- `Creating a worker in ${import_node_path23.default.basename(creationDirectory)} from ${template}`
157135
+ `Creating a worker in ${import_node_path25.default.basename(creationDirectory)} from ${template}`
155794
157136
  );
155795
157137
  const { remote, subdirectory } = parseTemplatePath(template);
155796
157138
  await cloneIntoDirectory(remote, creationDirectory, subdirectory);
@@ -155798,10 +157140,10 @@ Have you considered using Cloudflare Pages instead? See https://pages.cloudflare
155798
157140
  logger.log("\u2728 Success!");
155799
157141
  }
155800
157142
  function generateWorkerDirectoryName(workerName) {
155801
- let workerDirectoryPath = import_node_path23.default.resolve(process.cwd(), workerName);
157143
+ let workerDirectoryPath = import_node_path25.default.resolve(process.cwd(), workerName);
155802
157144
  let i2 = 1;
155803
- while (import_node_fs16.default.existsSync(workerDirectoryPath)) {
155804
- workerDirectoryPath = import_node_path23.default.resolve(process.cwd(), `${workerName}-${i2}`);
157145
+ while (import_node_fs18.default.existsSync(workerDirectoryPath)) {
157146
+ workerDirectoryPath = import_node_path25.default.resolve(process.cwd(), `${workerName}-${i2}`);
155805
157147
  i2++;
155806
157148
  }
155807
157149
  return workerDirectoryPath;
@@ -156567,9 +157909,9 @@ init_import_meta_url();
156567
157909
 
156568
157910
  // src/pages/build.tsx
156569
157911
  init_import_meta_url();
156570
- var import_node_fs17 = require("node:fs");
157912
+ var import_node_fs19 = require("node:fs");
156571
157913
  var import_node_os10 = require("node:os");
156572
- var import_node_path29 = require("node:path");
157914
+ var import_node_path31 = require("node:path");
156573
157915
 
156574
157916
  // src/pages/constants.ts
156575
157917
  init_import_meta_url();
@@ -156750,13 +158092,13 @@ and that at least one include rule is provided.
156750
158092
  // src/pages/functions/buildPlugin.ts
156751
158093
  init_import_meta_url();
156752
158094
  var import_promises10 = require("node:fs/promises");
156753
- var import_node_path24 = require("node:path");
158095
+ var import_node_path26 = require("node:path");
156754
158096
  function buildPlugin({
156755
158097
  routesModule,
156756
158098
  outfile = "bundle.js",
156757
158099
  minify = false,
156758
158100
  sourcemap = false,
156759
- watch: watch5 = false,
158101
+ watch: watch6 = false,
156760
158102
  onEnd = () => {
156761
158103
  },
156762
158104
  nodeCompat,
@@ -156766,16 +158108,16 @@ function buildPlugin({
156766
158108
  }) {
156767
158109
  return bundleWorker(
156768
158110
  {
156769
- file: (0, import_node_path24.resolve)(getBasePath(), "templates/pages-template-plugin.ts"),
158111
+ file: (0, import_node_path26.resolve)(getBasePath(), "templates/pages-template-plugin.ts"),
156770
158112
  directory: functionsDirectory,
156771
158113
  format: "modules"
156772
158114
  },
156773
- (0, import_node_path24.resolve)(outfile),
158115
+ (0, import_node_path26.resolve)(outfile),
156774
158116
  {
156775
158117
  inject: [routesModule],
156776
158118
  minify,
156777
158119
  sourcemap,
156778
- watch: watch5,
158120
+ watch: watch6,
156779
158121
  nodeCompat,
156780
158122
  define: {},
156781
158123
  betaD1Shims: (betaD1Shims || []).map(
@@ -156806,9 +158148,9 @@ function buildPlugin({
156806
158148
  name: "Assets",
156807
158149
  setup(pluginBuild) {
156808
158150
  if (pluginBuild.initialOptions.outfile) {
156809
- const outdir = (0, import_node_path24.dirname)(pluginBuild.initialOptions.outfile);
158151
+ const outdir = (0, import_node_path26.dirname)(pluginBuild.initialOptions.outfile);
156810
158152
  pluginBuild.onResolve({ filter: /^assets:/ }, async (args) => {
156811
- const directory = (0, import_node_path24.resolve)(
158153
+ const directory = (0, import_node_path26.resolve)(
156812
158154
  args.resolveDir,
156813
158155
  args.path.slice("assets:".length)
156814
158156
  );
@@ -156823,7 +158165,7 @@ function buildPlugin({
156823
158165
  ]
156824
158166
  };
156825
158167
  }
156826
- const path41 = `assets:./${(0, import_node_path24.relative)(outdir, directory)}`;
158168
+ const path41 = `assets:./${(0, import_node_path26.relative)(outdir, directory)}`;
156827
158169
  return { path: path41, external: true, namespace: "assets" };
156828
158170
  });
156829
158171
  }
@@ -156845,7 +158187,7 @@ function buildPlugin({
156845
158187
  // src/pages/functions/buildWorker.ts
156846
158188
  init_import_meta_url();
156847
158189
  var import_promises11 = require("node:fs/promises");
156848
- var import_node_path25 = require("node:path");
158190
+ var import_node_path27 = require("node:path");
156849
158191
 
156850
158192
  // ../../node_modules/nanoid/index.js
156851
158193
  init_import_meta_url();
@@ -156886,7 +158228,7 @@ function buildWorker({
156886
158228
  minify = false,
156887
158229
  sourcemap = false,
156888
158230
  fallbackService = "ASSETS",
156889
- watch: watch5 = false,
158231
+ watch: watch6 = false,
156890
158232
  onEnd = () => {
156891
158233
  },
156892
158234
  buildOutputDirectory,
@@ -156897,16 +158239,16 @@ function buildWorker({
156897
158239
  }) {
156898
158240
  return bundleWorker(
156899
158241
  {
156900
- file: (0, import_node_path25.resolve)(getBasePath(), "templates/pages-template-worker.ts"),
158242
+ file: (0, import_node_path27.resolve)(getBasePath(), "templates/pages-template-worker.ts"),
156901
158243
  directory: functionsDirectory,
156902
158244
  format: "modules"
156903
158245
  },
156904
- (0, import_node_path25.resolve)(outfile),
158246
+ (0, import_node_path27.resolve)(outfile),
156905
158247
  {
156906
158248
  inject: [routesModule],
156907
158249
  minify,
156908
158250
  sourcemap,
156909
- watch: watch5,
158251
+ watch: watch6,
156910
158252
  nodeCompat,
156911
158253
  loader: {
156912
158254
  ".txt": "text",
@@ -156944,7 +158286,7 @@ function buildWorker({
156944
158286
  setup(pluginBuild) {
156945
158287
  const identifiers = /* @__PURE__ */ new Map();
156946
158288
  pluginBuild.onResolve({ filter: /^assets:/ }, async (args) => {
156947
- const directory = (0, import_node_path25.resolve)(
158289
+ const directory = (0, import_node_path27.resolve)(
156948
158290
  args.resolveDir,
156949
158291
  args.path.slice("assets:".length)
156950
158292
  );
@@ -156972,7 +158314,7 @@ function buildWorker({
156972
158314
  async (args) => {
156973
158315
  const identifier = identifiers.get(args.path);
156974
158316
  if (buildOutputDirectory) {
156975
- const staticAssetsOutputDirectory = (0, import_node_path25.join)(
158317
+ const staticAssetsOutputDirectory = (0, import_node_path27.join)(
156976
158318
  buildOutputDirectory,
156977
158319
  "cdn-cgi",
156978
158320
  "pages-plugins",
@@ -157016,7 +158358,7 @@ function buildWorker({
157016
158358
  // src/pages/functions/filepath-routing.ts
157017
158359
  init_import_meta_url();
157018
158360
  var import_promises12 = __toESM(require("node:fs/promises"));
157019
- var import_node_path26 = __toESM(require("node:path"));
158361
+ var import_node_path28 = __toESM(require("node:path"));
157020
158362
  var import_esbuild3 = require("esbuild");
157021
158363
  async function generateConfigFromFileTree({
157022
158364
  baseDir,
@@ -157030,13 +158372,13 @@ async function generateConfigFromFileTree({
157030
158372
  baseURL = baseURL.slice(0, -1);
157031
158373
  }
157032
158374
  await forEachFile(baseDir, async (filepath) => {
157033
- const ext = import_node_path26.default.extname(filepath);
158375
+ const ext = import_node_path28.default.extname(filepath);
157034
158376
  if (/^\.(mjs|js|ts|tsx|jsx)$/.test(ext)) {
157035
158377
  const { metafile } = await (0, import_esbuild3.build)({
157036
158378
  metafile: true,
157037
158379
  write: false,
157038
158380
  bundle: false,
157039
- entryPoints: [import_node_path26.default.resolve(filepath)]
158381
+ entryPoints: [import_node_path28.default.resolve(filepath)]
157040
158382
  });
157041
158383
  const exportNames = [];
157042
158384
  if (metafile) {
@@ -157049,13 +158391,13 @@ async function generateConfigFromFileTree({
157049
158391
  /^onRequest(Get|Post|Put|Patch|Delete|Options|Head)?$/
157050
158392
  ) ?? [];
157051
158393
  if (match) {
157052
- const basename5 = import_node_path26.default.basename(filepath).slice(0, -ext.length);
158394
+ const basename5 = import_node_path28.default.basename(filepath).slice(0, -ext.length);
157053
158395
  const isIndexFile = basename5 === "index";
157054
158396
  const isMiddlewareFile = basename5 === "_middleware" || basename5 === "_middleware_";
157055
- let routePath = import_node_path26.default.relative(baseDir, filepath).slice(0, -ext.length);
157056
- let mountPath = import_node_path26.default.dirname(routePath);
158397
+ let routePath = import_node_path28.default.relative(baseDir, filepath).slice(0, -ext.length);
158398
+ let mountPath = import_node_path28.default.dirname(routePath);
157057
158399
  if (isIndexFile || isMiddlewareFile) {
157058
- routePath = import_node_path26.default.dirname(routePath);
158400
+ routePath = import_node_path28.default.dirname(routePath);
157059
158401
  }
157060
158402
  if (routePath === ".") {
157061
158403
  routePath = "";
@@ -157069,7 +158411,7 @@ async function generateConfigFromFileTree({
157069
158411
  routePath = routePath.replaceAll(/\[([^\]]+)\]/g, ":$1");
157070
158412
  mountPath = mountPath.replace(/\[\[([^\]]+)\]\]/g, ":$1*");
157071
158413
  mountPath = mountPath.replaceAll(/\[([^\]]+)\]/g, ":$1");
157072
- const modulePath = toUrlPath(import_node_path26.default.relative(baseDir, filepath));
158414
+ const modulePath = toUrlPath(import_node_path28.default.relative(baseDir, filepath));
157073
158415
  const routeEntry = {
157074
158416
  routePath: toUrlPath(routePath),
157075
158417
  mountPath: toUrlPath(mountPath),
@@ -157138,7 +158480,7 @@ async function forEachFile(baseDir, fn) {
157138
158480
  const cwd2 = searchPaths.shift();
157139
158481
  const dir = await import_promises12.default.readdir(cwd2, { withFileTypes: true });
157140
158482
  for (const entry of dir) {
157141
- const pathname = import_node_path26.default.join(cwd2, entry.name);
158483
+ const pathname = import_node_path28.default.join(cwd2, entry.name);
157142
158484
  if (entry.isDirectory()) {
157143
158485
  searchPaths.push(pathname);
157144
158486
  } else if (entry.isFile()) {
@@ -157155,7 +158497,7 @@ function isNotEmpty(array) {
157155
158497
  // src/pages/functions/routes.ts
157156
158498
  init_import_meta_url();
157157
158499
  var import_promises13 = __toESM(require("node:fs/promises"));
157158
- var import_node_path27 = __toESM(require("node:path"));
158500
+ var import_node_path29 = __toESM(require("node:path"));
157159
158501
 
157160
158502
  // src/pages/functions/identifiers.ts
157161
158503
  init_import_meta_url();
@@ -157251,8 +158593,8 @@ function parseConfig(config, baseDir) {
157251
158593
  return paths.map((modulePath) => {
157252
158594
  const [filepath, name = "default"] = modulePath.split(":");
157253
158595
  let { identifier } = importMap.get(modulePath) ?? {};
157254
- const resolvedPath = import_node_path27.default.resolve(baseDir, filepath);
157255
- if (import_node_path27.default.relative(baseDir, resolvedPath).startsWith("..")) {
158596
+ const resolvedPath = import_node_path29.default.resolve(baseDir, filepath);
158597
+ if (import_node_path29.default.relative(baseDir, resolvedPath).startsWith("..")) {
157256
158598
  throw new Error(`Invalid module path "${filepath}"`);
157257
158599
  }
157258
158600
  if (name !== "default" && !isValidIdentifier(name)) {
@@ -157301,7 +158643,7 @@ export const routes = [
157301
158643
 
157302
158644
  // src/pages/functions/routes-transformation.ts
157303
158645
  init_import_meta_url();
157304
- var import_node_path28 = require("node:path");
158646
+ var import_node_path30 = require("node:path");
157305
158647
 
157306
158648
  // src/pages/functions/routes-consolidation.ts
157307
158649
  init_import_meta_url();
@@ -157353,7 +158695,7 @@ function convertRoutesToGlobPatterns(routes) {
157353
158695
  const globbedRoutePath = routePath.replace(/:\w+\*?.*/, "*");
157354
158696
  if (typeof middleware === "string" || Array.isArray(middleware) && middleware.length > 0) {
157355
158697
  if (!globbedRoutePath.endsWith("*")) {
157356
- return toUrlPath((0, import_node_path28.join)(globbedRoutePath, "*"));
158698
+ return toUrlPath((0, import_node_path30.join)(globbedRoutePath, "*"));
157357
158699
  }
157358
158700
  }
157359
158701
  return toUrlPath(globbedRoutePath);
@@ -157491,7 +158833,7 @@ var Handler5 = async ({
157491
158833
  minify,
157492
158834
  sourcemap,
157493
158835
  fallbackService,
157494
- watch: watch5,
158836
+ watch: watch6,
157495
158837
  plugin,
157496
158838
  buildOutputDirectory,
157497
158839
  nodeCompat,
@@ -157514,7 +158856,7 @@ var Handler5 = async ({
157514
158856
  throw new FatalError("Could not parse a valid set of 'bindings'.", 1);
157515
158857
  }
157516
158858
  }
157517
- buildOutputDirectory ??= (0, import_node_path29.dirname)(outfile);
158859
+ buildOutputDirectory ??= (0, import_node_path31.dirname)(outfile);
157518
158860
  try {
157519
158861
  await buildFunctions({
157520
158862
  outfile,
@@ -157523,7 +158865,7 @@ var Handler5 = async ({
157523
158865
  minify,
157524
158866
  sourcemap,
157525
158867
  fallbackService,
157526
- watch: watch5,
158868
+ watch: watch6,
157527
158869
  plugin,
157528
158870
  buildOutputDirectory,
157529
158871
  nodeCompat,
@@ -157550,7 +158892,7 @@ async function buildFunctions({
157550
158892
  minify = false,
157551
158893
  sourcemap = false,
157552
158894
  fallbackService = "ASSETS",
157553
- watch: watch5 = false,
158895
+ watch: watch6 = false,
157554
158896
  onEnd,
157555
158897
  plugin = false,
157556
158898
  buildOutputDirectory,
@@ -157562,7 +158904,7 @@ async function buildFunctions({
157562
158904
  RUNNING_BUILDERS.forEach(
157563
158905
  (runningBuilder) => runningBuilder.stop && runningBuilder.stop()
157564
158906
  );
157565
- const routesModule = (0, import_node_path29.join)((0, import_node_os10.tmpdir)(), `./functionsRoutes-${Math.random()}.mjs`);
158907
+ const routesModule = (0, import_node_path31.join)((0, import_node_os10.tmpdir)(), `./functionsRoutes-${Math.random()}.mjs`);
157566
158908
  const baseURL = toUrlPath("/");
157567
158909
  const config = await generateConfigFromFileTree({
157568
158910
  baseDir: functionsDirectory,
@@ -157575,10 +158917,10 @@ async function buildFunctions({
157575
158917
  }
157576
158918
  if (routesOutputPath) {
157577
158919
  const routesJSON = convertRoutesToRoutesJSONSpec(config.routes);
157578
- (0, import_node_fs17.writeFileSync)(routesOutputPath, JSON.stringify(routesJSON, null, 2));
158920
+ (0, import_node_fs19.writeFileSync)(routesOutputPath, JSON.stringify(routesJSON, null, 2));
157579
158921
  }
157580
158922
  if (outputConfigPath) {
157581
- (0, import_node_fs17.writeFileSync)(
158923
+ (0, import_node_fs19.writeFileSync)(
157582
158924
  outputConfigPath,
157583
158925
  JSON.stringify({ ...config, baseURL }, null, 2)
157584
158926
  );
@@ -157588,7 +158930,7 @@ async function buildFunctions({
157588
158930
  srcDir: functionsDirectory,
157589
158931
  outfile: routesModule
157590
158932
  });
157591
- const absoluteFunctionsDirectory = (0, import_node_path29.resolve)(functionsDirectory);
158933
+ const absoluteFunctionsDirectory = (0, import_node_path31.resolve)(functionsDirectory);
157592
158934
  if (plugin) {
157593
158935
  RUNNING_BUILDERS.push(
157594
158936
  await buildPlugin({
@@ -157596,7 +158938,7 @@ async function buildFunctions({
157596
158938
  outfile,
157597
158939
  minify,
157598
158940
  sourcemap,
157599
- watch: watch5,
158941
+ watch: watch6,
157600
158942
  nodeCompat,
157601
158943
  functionsDirectory: absoluteFunctionsDirectory,
157602
158944
  local,
@@ -157612,7 +158954,7 @@ async function buildFunctions({
157612
158954
  minify,
157613
158955
  sourcemap,
157614
158956
  fallbackService,
157615
- watch: watch5,
158957
+ watch: watch6,
157616
158958
  functionsDirectory: absoluteFunctionsDirectory,
157617
158959
  local,
157618
158960
  betaD1Shims: d1Databases,
@@ -158275,10 +159617,10 @@ async function ListHandler4({ projectName }) {
158275
159617
  // src/pages/dev.tsx
158276
159618
  init_import_meta_url();
158277
159619
  var import_node_child_process6 = require("node:child_process");
158278
- var import_node_fs18 = require("node:fs");
159620
+ var import_node_fs20 = require("node:fs");
158279
159621
  var import_node_os11 = require("node:os");
158280
- var import_node_path30 = require("node:path");
158281
- var import_chokidar3 = require("chokidar");
159622
+ var import_node_path32 = require("node:path");
159623
+ var import_chokidar4 = require("chokidar");
158282
159624
  var esbuild3 = __toESM(require("esbuild"));
158283
159625
  var DURABLE_OBJECTS_BINDING_REGEXP = new RegExp(
158284
159626
  /^(?<binding>[^=]+)=(?<className>[^@\s]+)(@(?<scriptName>.*)$)?$/
@@ -158384,6 +159726,11 @@ function Options7(yargs) {
158384
159726
  type: "boolean",
158385
159727
  hidden: true
158386
159728
  },
159729
+ "experimental-local": {
159730
+ describe: "Run on my machine using the Cloudflare Workers runtime",
159731
+ type: "boolean",
159732
+ default: false
159733
+ },
158387
159734
  config: {
158388
159735
  describe: "Pages does not support wrangler.toml",
158389
159736
  type: "string",
@@ -158416,6 +159763,7 @@ var Handler7 = async ({
158416
159763
  persist,
158417
159764
  persistTo,
158418
159765
  "node-compat": nodeCompat,
159766
+ "experimental-local": experimentalLocal,
158419
159767
  config,
158420
159768
  _: [_pages, _dev, ...remaining],
158421
159769
  logLevel
@@ -158445,7 +159793,7 @@ var Handler7 = async ({
158445
159793
  if (proxyPort === void 0)
158446
159794
  return void 0;
158447
159795
  } else {
158448
- directory = (0, import_node_path30.resolve)(directory);
159796
+ directory = (0, import_node_path32.resolve)(directory);
158449
159797
  }
158450
159798
  if (!compatibilityDate) {
158451
159799
  const currentDate = new Date().toISOString().substring(0, 10);
@@ -158470,10 +159818,10 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
158470
159818
  const scriptReadyPromise = new Promise(
158471
159819
  (promiseResolve) => scriptReadyResolve = promiseResolve
158472
159820
  );
158473
- const workerScriptPath = directory !== void 0 ? (0, import_node_path30.join)(directory, singleWorkerScriptPath) : singleWorkerScriptPath;
158474
- const usingWorkerScript = (0, import_node_fs18.existsSync)(workerScriptPath);
159821
+ const workerScriptPath = directory !== void 0 ? (0, import_node_path32.join)(directory, singleWorkerScriptPath) : singleWorkerScriptPath;
159822
+ const usingWorkerScript = (0, import_node_fs20.existsSync)(workerScriptPath);
158475
159823
  const functionsDirectory = "./functions";
158476
- let usingFunctions = !usingWorkerScript && (0, import_node_fs18.existsSync)(functionsDirectory);
159824
+ let usingFunctions = !usingWorkerScript && (0, import_node_fs20.existsSync)(functionsDirectory);
158477
159825
  let scriptPath = "";
158478
159826
  if (usingWorkerScript) {
158479
159827
  scriptReadyResolve();
@@ -158490,14 +159838,14 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
158490
159838
  }
158491
159839
  };
158492
159840
  await runBuild();
158493
- (0, import_chokidar3.watch)([scriptPath], {
159841
+ (0, import_chokidar4.watch)([scriptPath], {
158494
159842
  persistent: true,
158495
159843
  ignoreInitial: true
158496
159844
  }).on("all", async () => {
158497
159845
  await runBuild();
158498
159846
  });
158499
159847
  } else if (usingFunctions) {
158500
- const outfile = (0, import_node_path30.join)((0, import_node_os11.tmpdir)(), `./functionsWorker-${Math.random()}.mjs`);
159848
+ const outfile = (0, import_node_path32.join)((0, import_node_os11.tmpdir)(), `./functionsWorker-${Math.random()}.mjs`);
158501
159849
  scriptPath = outfile;
158502
159850
  if (nodeCompat) {
158503
159851
  console.warn(
@@ -158518,7 +159866,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
158518
159866
  local: true
158519
159867
  });
158520
159868
  await sendMetricsEvent("build pages functions");
158521
- (0, import_chokidar3.watch)([functionsDirectory], {
159869
+ (0, import_chokidar4.watch)([functionsDirectory], {
158522
159870
  persistent: true,
158523
159871
  ignoreInitial: true
158524
159872
  }).on("all", async () => {
@@ -158559,7 +159907,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
158559
159907
  if (!usingFunctions && !usingWorkerScript) {
158560
159908
  scriptReadyResolve();
158561
159909
  logger.log("No functions. Shimming...");
158562
- scriptPath = (0, import_node_path30.resolve)(getBasePath(), "templates/pages-shim.ts");
159910
+ scriptPath = (0, import_node_path32.resolve)(getBasePath(), "templates/pages-shim.ts");
158563
159911
  }
158564
159912
  await scriptReadyPromise;
158565
159913
  if (scriptPath === "") {
@@ -158570,13 +159918,13 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
158570
159918
  }
158571
159919
  let entrypoint = scriptPath;
158572
159920
  if (directory && (usingFunctions || usingWorkerScript)) {
158573
- const routesJSONPath = (0, import_node_path30.join)(directory, "_routes.json");
158574
- if ((0, import_node_fs18.existsSync)(routesJSONPath)) {
159921
+ const routesJSONPath = (0, import_node_path32.join)(directory, "_routes.json");
159922
+ if ((0, import_node_fs20.existsSync)(routesJSONPath)) {
158575
159923
  let routesJSONContents;
158576
159924
  const runBuild = async (entrypointFile, outfile, routes) => {
158577
159925
  await esbuild3.build({
158578
159926
  entryPoints: [
158579
- (0, import_node_path30.resolve)(getBasePath(), "templates/pages-dev-pipeline.ts")
159927
+ (0, import_node_path32.resolve)(getBasePath(), "templates/pages-dev-pipeline.ts")
158580
159928
  ],
158581
159929
  bundle: true,
158582
159930
  sourcemap: true,
@@ -158584,7 +159932,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
158584
159932
  plugins: [
158585
159933
  esbuildAliasExternalPlugin({
158586
159934
  __ENTRY_POINT__: entrypointFile,
158587
- "./pages-dev-util": (0, import_node_path30.resolve)(
159935
+ "./pages-dev-util": (0, import_node_path32.resolve)(
158588
159936
  getBasePath(),
158589
159937
  "templates/pages-dev-util.ts"
158590
159938
  )
@@ -158597,9 +159945,9 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
158597
159945
  });
158598
159946
  };
158599
159947
  try {
158600
- routesJSONContents = (0, import_node_fs18.readFileSync)(routesJSONPath, "utf-8");
159948
+ routesJSONContents = (0, import_node_fs20.readFileSync)(routesJSONPath, "utf-8");
158601
159949
  validateRoutes2(JSON.parse(routesJSONContents), directory);
158602
- entrypoint = (0, import_node_path30.join)(
159950
+ entrypoint = (0, import_node_path32.join)(
158603
159951
  (0, import_node_os11.tmpdir)(),
158604
159952
  `${Math.random().toString(36).slice(2)}.js`
158605
159953
  );
@@ -158614,12 +159962,12 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
158614
159962
  );
158615
159963
  }
158616
159964
  }
158617
- (0, import_chokidar3.watch)([routesJSONPath], {
159965
+ (0, import_chokidar4.watch)([routesJSONPath], {
158618
159966
  persistent: true,
158619
159967
  ignoreInitial: true
158620
159968
  }).on("all", async () => {
158621
159969
  try {
158622
- routesJSONContents = (0, import_node_fs18.readFileSync)(routesJSONPath, "utf-8");
159970
+ routesJSONContents = (0, import_node_fs20.readFileSync)(routesJSONPath, "utf-8");
158623
159971
  validateRoutes2(JSON.parse(routesJSONContents), directory);
158624
159972
  await runBuild(scriptPath, entrypoint, routesJSONContents);
158625
159973
  } catch (err2) {
@@ -158655,6 +160003,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
158655
160003
  compatibilityDate,
158656
160004
  compatibilityFlags,
158657
160005
  nodeCompat,
160006
+ experimentalLocal,
158658
160007
  vars: Object.fromEntries(
158659
160008
  bindings.map((binding) => binding.toString().split("=")).map(([key2, ...values]) => [key2, values.join("=")])
158660
160009
  ),
@@ -158834,8 +160183,8 @@ You should bundle your Worker or remove the import if it is unused.`
158834
160183
 
158835
160184
  // src/pages/functions.tsx
158836
160185
  init_import_meta_url();
158837
- var import_node_fs19 = require("node:fs");
158838
- var import_node_path31 = __toESM(require("node:path"));
160186
+ var import_node_fs21 = require("node:fs");
160187
+ var import_node_path33 = __toESM(require("node:path"));
158839
160188
  function OptimizeRoutesOptions(yargs) {
158840
160189
  return yargs.options({
158841
160190
  "routes-path": {
@@ -158859,21 +160208,21 @@ async function OptimizeRoutesHandler({
158859
160208
  logger.log(pagesBetaWarning);
158860
160209
  }
158861
160210
  let routesFileContents;
158862
- const routesOutputDirectory = import_node_path31.default.dirname(outputRoutesPath);
158863
- if (!(0, import_node_fs19.existsSync)(routesPath)) {
160211
+ const routesOutputDirectory = import_node_path33.default.dirname(outputRoutesPath);
160212
+ if (!(0, import_node_fs21.existsSync)(routesPath)) {
158864
160213
  throw new FatalError(
158865
160214
  `Oops! File ${routesPath} does not exist. Please make sure --routes-path is a valid file path (for example "/public/_routes.json").`,
158866
160215
  1
158867
160216
  );
158868
160217
  }
158869
- if (!(0, import_node_fs19.existsSync)(routesOutputDirectory) || !(0, import_node_fs19.lstatSync)(routesOutputDirectory).isDirectory()) {
160218
+ if (!(0, import_node_fs21.existsSync)(routesOutputDirectory) || !(0, import_node_fs21.lstatSync)(routesOutputDirectory).isDirectory()) {
158870
160219
  throw new FatalError(
158871
160220
  `Oops! Folder ${routesOutputDirectory} does not exist. Please make sure --output-routes-path is a valid file path (for example "/public/_routes.json").`,
158872
160221
  1
158873
160222
  );
158874
160223
  }
158875
160224
  try {
158876
- routesFileContents = (0, import_node_fs19.readFileSync)(routesPath, "utf-8");
160225
+ routesFileContents = (0, import_node_fs21.readFileSync)(routesPath, "utf-8");
158877
160226
  } catch (err2) {
158878
160227
  throw new FatalError(`Error while reading ${routesPath} file: ${err2}`);
158879
160228
  }
@@ -158882,7 +160231,7 @@ async function OptimizeRoutesHandler({
158882
160231
  const optimizedRoutes = optimizeRoutesJSONSpec(routes);
158883
160232
  const optimizedRoutesContents = JSON.stringify(optimizedRoutes);
158884
160233
  try {
158885
- (0, import_node_fs19.writeFileSync)(outputRoutesPath, optimizedRoutesContents);
160234
+ (0, import_node_fs21.writeFileSync)(outputRoutesPath, optimizedRoutesContents);
158886
160235
  } catch (err2) {
158887
160236
  throw new FatalError(
158888
160237
  `Error writing to ${outputRoutesPath} file: ${err2}`,
@@ -158894,9 +160243,9 @@ async function OptimizeRoutesHandler({
158894
160243
  // src/pages/publish.tsx
158895
160244
  init_import_meta_url();
158896
160245
  var import_node_child_process7 = require("node:child_process");
158897
- var import_node_fs21 = require("node:fs");
160246
+ var import_node_fs22 = require("node:fs");
158898
160247
  var import_node_os12 = require("node:os");
158899
- var import_node_path34 = require("node:path");
160248
+ var import_node_path35 = require("node:path");
158900
160249
  var import_node_process7 = require("node:process");
158901
160250
  var import_ink17 = __toESM(require_build2());
158902
160251
  var import_ink_select_input4 = __toESM(require_build3());
@@ -158906,10 +160255,10 @@ var import_undici10 = __toESM(require_undici());
158906
160255
  // src/pages/upload.tsx
158907
160256
  init_import_meta_url();
158908
160257
  var import_promises15 = require("node:fs/promises");
158909
- var import_node_path33 = require("node:path");
160258
+ var import_node_path34 = require("node:path");
158910
160259
  var import_ink16 = __toESM(require_build2());
158911
160260
  var import_ink_spinner = __toESM(require_build5());
158912
- var import_mime = __toESM(require_mime2());
160261
+ var import_mime2 = __toESM(require_mime2());
158913
160262
  var import_minimatch = __toESM(require_minimatch2());
158914
160263
 
158915
160264
  // ../../node_modules/p-queue/dist/index.js
@@ -159332,20 +160681,6 @@ _PQueue_carryoverConcurrencyCount = /* @__PURE__ */ new WeakMap(), _PQueue_isInt
159332
160681
 
159333
160682
  // src/pages/upload.tsx
159334
160683
  var import_react20 = __toESM(require_react());
159335
-
159336
- // src/pages/hash.tsx
159337
- init_import_meta_url();
159338
- var import_node_fs20 = require("node:fs");
159339
- var import_node_path32 = require("node:path");
159340
- var import_blake3_wasm = require("blake3-wasm");
159341
- var hashFile = (filepath) => {
159342
- const contents = (0, import_node_fs20.readFileSync)(filepath);
159343
- const base64Contents = contents.toString("base64");
159344
- const extension = (0, import_node_path32.extname)(filepath).substring(1);
159345
- return (0, import_blake3_wasm.hash)(base64Contents + extension).toString("hex").slice(0, 32);
159346
- };
159347
-
159348
- // src/pages/upload.tsx
159349
160684
  function Options8(yargs) {
159350
160685
  return yargs.positional("directory", {
159351
160686
  type: "string",
@@ -159373,7 +160708,7 @@ var Handler8 = async ({
159373
160708
  jwt: process.env.CF_PAGES_UPLOAD_JWT
159374
160709
  });
159375
160710
  if (outputManifestPath) {
159376
- await (0, import_promises15.mkdir)((0, import_node_path33.dirname)(outputManifestPath), { recursive: true });
160711
+ await (0, import_promises15.mkdir)((0, import_node_path34.dirname)(outputManifestPath), { recursive: true });
159377
160712
  await (0, import_promises15.writeFile)(outputManifestPath, JSON.stringify(manifest));
159378
160713
  }
159379
160714
  logger.log(`\u2728 Upload complete!`);
@@ -159398,13 +160733,13 @@ var upload = async (args) => {
159398
160733
  "**/node_modules",
159399
160734
  "**/.git"
159400
160735
  ].map((pattern) => new import_minimatch.Minimatch(pattern));
159401
- const directory = (0, import_node_path33.resolve)(args.directory);
160736
+ const directory = (0, import_node_path34.resolve)(args.directory);
159402
160737
  const walk = async (dir, fileMap2 = /* @__PURE__ */ new Map(), startingDir = dir) => {
159403
160738
  const files2 = await (0, import_promises15.readdir)(dir);
159404
160739
  await Promise.all(
159405
160740
  files2.map(async (file) => {
159406
- const filepath = (0, import_node_path33.join)(dir, file);
159407
- const relativeFilepath = (0, import_node_path33.relative)(startingDir, filepath);
160741
+ const filepath = (0, import_node_path34.join)(dir, file);
160742
+ const relativeFilepath = (0, import_node_path34.relative)(startingDir, filepath);
159408
160743
  const filestat = await (0, import_promises15.stat)(filepath);
159409
160744
  for (const minimatch of IGNORE_LIST) {
159410
160745
  if (minimatch.match(relativeFilepath)) {
@@ -159417,7 +160752,7 @@ var upload = async (args) => {
159417
160752
  if (filestat.isDirectory()) {
159418
160753
  fileMap2 = await walk(filepath, fileMap2, startingDir);
159419
160754
  } else {
159420
- const name = relativeFilepath.split(import_node_path33.sep).join("/");
160755
+ const name = relativeFilepath.split(import_node_path34.sep).join("/");
159421
160756
  if (filestat.size > MAX_ASSET_SIZE) {
159422
160757
  throw new FatalError(
159423
160758
  `Error: Pages only supports files up to ${prettyBytes(
@@ -159429,7 +160764,7 @@ ${name} is ${prettyBytes(filestat.size)} in size`,
159429
160764
  }
159430
160765
  fileMap2.set(name, {
159431
160766
  path: filepath,
159432
- contentType: (0, import_mime.getType)(name) || "application/octet-stream",
160767
+ contentType: (0, import_mime2.getType)(name) || "application/octet-stream",
159433
160768
  sizeInBytes: filestat.size,
159434
160769
  hash: hashFile(filepath)
159435
160770
  });
@@ -159809,19 +161144,19 @@ To silence this warning, pass in --commit-dirty=true`
159809
161144
  }
159810
161145
  let _headers, _redirects, _routesGenerated, _routesCustom, _workerJS;
159811
161146
  try {
159812
- _headers = (0, import_node_fs21.readFileSync)((0, import_node_path34.join)(directory, "_headers"), "utf-8");
161147
+ _headers = (0, import_node_fs22.readFileSync)((0, import_node_path35.join)(directory, "_headers"), "utf-8");
159813
161148
  } catch {
159814
161149
  }
159815
161150
  try {
159816
- _redirects = (0, import_node_fs21.readFileSync)((0, import_node_path34.join)(directory, "_redirects"), "utf-8");
161151
+ _redirects = (0, import_node_fs22.readFileSync)((0, import_node_path35.join)(directory, "_redirects"), "utf-8");
159817
161152
  } catch {
159818
161153
  }
159819
161154
  try {
159820
- _routesCustom = (0, import_node_fs21.readFileSync)((0, import_node_path34.join)(directory, "_routes.json"), "utf-8");
161155
+ _routesCustom = (0, import_node_fs22.readFileSync)((0, import_node_path35.join)(directory, "_routes.json"), "utf-8");
159821
161156
  } catch {
159822
161157
  }
159823
161158
  try {
159824
- _workerJS = (0, import_node_fs21.readFileSync)((0, import_node_path34.join)(directory, "_worker.js"), "utf-8");
161159
+ _workerJS = (0, import_node_fs22.readFileSync)((0, import_node_path35.join)(directory, "_worker.js"), "utf-8");
159825
161160
  } catch {
159826
161161
  }
159827
161162
  const project = await fetchResult(
@@ -159832,12 +161167,12 @@ To silence this warning, pass in --commit-dirty=true`
159832
161167
  isProduction = project.production_branch === branch;
159833
161168
  }
159834
161169
  let builtFunctions = void 0;
159835
- const functionsDirectory = (0, import_node_path34.join)((0, import_node_process7.cwd)(), "functions");
159836
- const routesOutputPath = !(0, import_node_fs21.existsSync)((0, import_node_path34.join)(directory, "_routes.json")) ? (0, import_node_path34.join)((0, import_node_os12.tmpdir)(), `_routes-${Math.random()}.json`) : void 0;
161170
+ const functionsDirectory = (0, import_node_path35.join)((0, import_node_process7.cwd)(), "functions");
161171
+ const routesOutputPath = !(0, import_node_fs22.existsSync)((0, import_node_path35.join)(directory, "_routes.json")) ? (0, import_node_path35.join)((0, import_node_os12.tmpdir)(), `_routes-${Math.random()}.json`) : void 0;
159837
161172
  let filepathRoutingConfig;
159838
- if (!_workerJS && (0, import_node_fs21.existsSync)(functionsDirectory)) {
159839
- const outfile = (0, import_node_path34.join)((0, import_node_os12.tmpdir)(), `./functionsWorker-${Math.random()}.js`);
159840
- const outputConfigPath = (0, import_node_path34.join)(
161173
+ if (!_workerJS && (0, import_node_fs22.existsSync)(functionsDirectory)) {
161174
+ const outfile = (0, import_node_path35.join)((0, import_node_os12.tmpdir)(), `./functionsWorker-${Math.random()}.js`);
161175
+ const outputConfigPath = (0, import_node_path35.join)(
159841
161176
  (0, import_node_os12.tmpdir)(),
159842
161177
  `functions-filepath-routing-config-${Math.random()}.json`
159843
161178
  );
@@ -159848,15 +161183,15 @@ To silence this warning, pass in --commit-dirty=true`
159848
161183
  functionsDirectory,
159849
161184
  onEnd: () => {
159850
161185
  },
159851
- buildOutputDirectory: (0, import_node_path34.dirname)(outfile),
161186
+ buildOutputDirectory: (0, import_node_path35.dirname)(outfile),
159852
161187
  routesOutputPath,
159853
161188
  local: false,
159854
161189
  d1Databases: Object.keys(
159855
161190
  project.deployment_configs[isProduction ? "production" : "preview"].d1_databases ?? {}
159856
161191
  )
159857
161192
  });
159858
- builtFunctions = (0, import_node_fs21.readFileSync)(outfile, "utf-8");
159859
- filepathRoutingConfig = (0, import_node_fs21.readFileSync)(outputConfigPath, "utf-8");
161193
+ builtFunctions = (0, import_node_fs22.readFileSync)(outfile, "utf-8");
161194
+ filepathRoutingConfig = (0, import_node_fs22.readFileSync)(outputConfigPath, "utf-8");
159860
161195
  } catch (e2) {
159861
161196
  if (e2 instanceof FunctionsNoRoutesError) {
159862
161197
  logger.warn(
@@ -159905,7 +161240,7 @@ To silence this warning, pass in --commit-dirty=true`
159905
161240
  if (_routesCustom) {
159906
161241
  try {
159907
161242
  const routesCustomJSON = JSON.parse(_routesCustom);
159908
- validateRoutes2(routesCustomJSON, (0, import_node_path34.join)(directory, "_routes.json"));
161243
+ validateRoutes2(routesCustomJSON, (0, import_node_path35.join)(directory, "_routes.json"));
159909
161244
  formData.append(
159910
161245
  "_routes.json",
159911
161246
  new import_undici10.File([_routesCustom], "_routes.json")
@@ -159927,7 +161262,7 @@ To silence this warning, pass in --commit-dirty=true`
159927
161262
  if (_routesCustom) {
159928
161263
  try {
159929
161264
  const routesCustomJSON = JSON.parse(_routesCustom);
159930
- validateRoutes2(routesCustomJSON, (0, import_node_path34.join)(directory, "_routes.json"));
161265
+ validateRoutes2(routesCustomJSON, (0, import_node_path35.join)(directory, "_routes.json"));
159931
161266
  formData.append(
159932
161267
  "_routes.json",
159933
161268
  new import_undici10.File([_routesCustom], "_routes.json")
@@ -159943,7 +161278,7 @@ To silence this warning, pass in --commit-dirty=true`
159943
161278
  }
159944
161279
  } else if (routesOutputPath) {
159945
161280
  try {
159946
- _routesGenerated = (0, import_node_fs21.readFileSync)(routesOutputPath, "utf-8");
161281
+ _routesGenerated = (0, import_node_fs22.readFileSync)(routesOutputPath, "utf-8");
159947
161282
  if (_routesGenerated) {
159948
161283
  formData.append(
159949
161284
  "_routes.json",
@@ -160043,13 +161378,13 @@ var pages = (yargs) => {
160043
161378
 
160044
161379
  // src/publish/index.ts
160045
161380
  init_import_meta_url();
160046
- var import_node_path36 = __toESM(require("node:path"));
161381
+ var import_node_path37 = __toESM(require("node:path"));
160047
161382
 
160048
161383
  // src/publish/publish.ts
160049
161384
  init_import_meta_url();
160050
161385
  var import_node_assert10 = __toESM(require("node:assert"));
160051
- var import_node_fs22 = require("node:fs");
160052
- var import_node_path35 = __toESM(require("node:path"));
161386
+ var import_node_fs23 = require("node:fs");
161387
+ var import_node_path36 = __toESM(require("node:path"));
160053
161388
  var import_node_url12 = require("node:url");
160054
161389
  var import_chalk5 = __toESM(require_chalk());
160055
161390
  var import_tmp_promise4 = __toESM(require_tmp_promise());
@@ -160485,9 +161820,9 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
160485
161820
  "A [site] definition requires a `bucket` field with a path to the site's assets directory."
160486
161821
  );
160487
161822
  if (props.outDir) {
160488
- (0, import_node_fs22.mkdirSync)(props.outDir, { recursive: true });
160489
- const readmePath = import_node_path35.default.join(props.outDir, "README.md");
160490
- (0, import_node_fs22.writeFileSync)(
161823
+ (0, import_node_fs23.mkdirSync)(props.outDir, { recursive: true });
161824
+ const readmePath = import_node_path36.default.join(props.outDir, "README.md");
161825
+ (0, import_node_fs23.writeFileSync)(
160491
161826
  readmePath,
160492
161827
  `This folder contains the built output assets for the worker "${scriptName}" generated at ${new Date().toISOString()}.`
160493
161828
  );
@@ -160524,10 +161859,10 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
160524
161859
  try {
160525
161860
  if (props.noBundle) {
160526
161861
  const destinationDir = typeof destination === "string" ? destination : destination.path;
160527
- (0, import_node_fs22.mkdirSync)(destinationDir, { recursive: true });
160528
- (0, import_node_fs22.writeFileSync)(
160529
- import_node_path35.default.join(destinationDir, import_node_path35.default.basename(props.entry.file)),
160530
- (0, import_node_fs22.readFileSync)(props.entry.file, "utf-8")
161862
+ (0, import_node_fs23.mkdirSync)(destinationDir, { recursive: true });
161863
+ (0, import_node_fs23.writeFileSync)(
161864
+ import_node_path36.default.join(destinationDir, import_node_path36.default.basename(props.entry.file)),
161865
+ (0, import_node_fs23.readFileSync)(props.entry.file, "utf-8")
160531
161866
  );
160532
161867
  }
160533
161868
  const betaD1Shims = identifyD1BindingsAsBeta(config.d1_databases);
@@ -160575,7 +161910,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
160575
161910
  experimentalLocal: false
160576
161911
  }
160577
161912
  );
160578
- const content = (0, import_node_fs22.readFileSync)(resolvedEntryPointPath, {
161913
+ const content = (0, import_node_fs23.readFileSync)(resolvedEntryPointPath, {
160579
161914
  encoding: "utf-8"
160580
161915
  });
160581
161916
  const migrations = !props.dryRun ? await getMigrationsToUpload(scriptName, {
@@ -160611,6 +161946,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
160611
161946
  r2_buckets: config.r2_buckets,
160612
161947
  d1_databases: identifyD1BindingsAsBeta(config.d1_databases),
160613
161948
  services: config.services,
161949
+ analytics_engine_datasets: config.analytics_engine_datasets,
160614
161950
  dispatch_namespaces: config.dispatch_namespaces,
160615
161951
  logfwdr: config.logfwdr,
160616
161952
  unsafe: config.unsafe?.bindings
@@ -160625,7 +161961,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
160625
161961
  const worker = {
160626
161962
  name: scriptName,
160627
161963
  main: {
160628
- name: import_node_path35.default.basename(resolvedEntryPointPath),
161964
+ name: import_node_path36.default.basename(resolvedEntryPointPath),
160629
161965
  content,
160630
161966
  type: bundleType
160631
161967
  },
@@ -160639,7 +161975,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
160639
161975
  logpush: props.logpush !== void 0 ? props.logpush : config.logpush
160640
161976
  };
160641
161977
  const bundleSizePromise = printBundleSize(
160642
- { name: import_node_path35.default.basename(resolvedEntryPointPath), content },
161978
+ { name: import_node_path36.default.basename(resolvedEntryPointPath), content },
160643
161979
  modules
160644
161980
  );
160645
161981
  if (process.env.JEST_WORKER_ID !== void 0)
@@ -161099,7 +162435,7 @@ function publishOptions(yargs) {
161099
162435
  }
161100
162436
  async function publishHandler(args) {
161101
162437
  await printWranglerBanner();
161102
- const configPath = args.config || args.script && findWranglerToml(import_node_path36.default.dirname(args.script));
162438
+ const configPath = args.config || args.script && findWranglerToml(import_node_path37.default.dirname(args.script));
161103
162439
  const config = readConfig(configPath, args);
161104
162440
  const entry = await getEntry(args, config, "publish");
161105
162441
  await sendMetricsEvent(
@@ -162265,7 +163601,7 @@ ${key2} is ${prettyBytes(objectSize)} in size`,
162265
163601
 
162266
163602
  // src/secret/index.ts
162267
163603
  init_import_meta_url();
162268
- var import_node_path37 = __toESM(require("node:path"));
163604
+ var import_node_path38 = __toESM(require("node:path"));
162269
163605
  var secret = (secretYargs) => {
162270
163606
  return secretYargs.option("legacy-env", {
162271
163607
  type: "boolean",
@@ -162333,6 +163669,7 @@ var secret = (secretYargs) => {
162333
163669
  r2_buckets: [],
162334
163670
  d1_databases: [],
162335
163671
  services: [],
163672
+ analytics_engine_datasets: [],
162336
163673
  wasm_modules: {},
162337
163674
  text_blobs: {},
162338
163675
  data_blobs: {},
@@ -162481,7 +163818,7 @@ var secretBulkHandler = async (secretBulkArgs) => {
162481
163818
  logger.log(
162482
163819
  `\u{1F300} Creating the secrets for the Worker "${scriptName}" ${secretBulkArgs.env && !isLegacyEnv(config) ? `(${secretBulkArgs.env})` : ""}`
162483
163820
  );
162484
- const jsonFilePath = import_node_path37.default.resolve(secretBulkArgs.json);
163821
+ const jsonFilePath = import_node_path38.default.resolve(secretBulkArgs.json);
162485
163822
  const content = parseJSON(
162486
163823
  readFileSync5(jsonFilePath),
162487
163824
  jsonFilePath
@@ -162714,6 +164051,13 @@ async function generateTypes(configToDTS, config) {
162714
164051
  envTypeStructure.push(`${service.binding}: Fetcher;`);
162715
164052
  }
162716
164053
  }
164054
+ if (configToDTS.analytics_engine_datasets) {
164055
+ for (const analyticsEngine of configToDTS.analytics_engine_datasets) {
164056
+ envTypeStructure.push(
164057
+ `${analyticsEngine.binding}: AnalyticsEngineDataset;`
164058
+ );
164059
+ }
164060
+ }
162717
164061
  if (configToDTS.dispatch_namespaces) {
162718
164062
  for (const namespace of configToDTS.dispatch_namespaces) {
162719
164063
  envTypeStructure.push(`${namespace.binding}: any;`);
@@ -162789,13 +164133,13 @@ function writeDTSFile({
162789
164133
  let combinedTypeStrings = "";
162790
164134
  if (formatType === "modules") {
162791
164135
  combinedTypeStrings += `interface Env {
162792
- ${envTypeStructure.map((value) => ` ${value}`).join("\n")}
164136
+ ${envTypeStructure.map((value) => ` ${value}`).join("\n")}
162793
164137
  }
162794
164138
  ${modulesTypeStructure.join("\n")}`;
162795
164139
  } else {
162796
164140
  combinedTypeStrings += `export {};
162797
164141
  declare global {
162798
- ${envTypeStructure.map((value) => ` const ${value}`).join("\n")}
164142
+ ${envTypeStructure.map((value) => ` const ${value}`).join("\n")}
162799
164143
  }
162800
164144
  ${modulesTypeStructure.join("\n")}`;
162801
164145
  }
@@ -163041,7 +164385,7 @@ function createCLIParser(argv) {
163041
164385
  "generate [name] [template]",
163042
164386
  false,
163043
164387
  generateOptions,
163044
- generateHandler
164388
+ generateHandler2
163045
164389
  );
163046
164390
  wrangler.command(
163047
164391
  "init [name]",
@@ -163246,6 +164590,7 @@ function createCLIParser(argv) {
163246
164590
  r2_buckets: config.r2_buckets,
163247
164591
  d1_databases: config.d1_databases,
163248
164592
  services: config.services,
164593
+ analytics_engine_datasets: config.analytics_engine_datasets,
163249
164594
  dispatch_namespaces: config.dispatch_namespaces,
163250
164595
  logfwdr: config.logfwdr,
163251
164596
  unsafe: { bindings: config.unsafe?.bindings },
@@ -163539,6 +164884,14 @@ function devOptions(yargs) {
163539
164884
  });
163540
164885
  }
163541
164886
  async function devHandler(args) {
164887
+ if (!args.local) {
164888
+ const isLoggedIn = await loginOrRefreshIfRequired();
164889
+ if (!isLoggedIn) {
164890
+ throw new Error(
164891
+ "You must be logged in to use wrangler dev in remote mode. Try logging in, or run wrangler dev --local."
164892
+ );
164893
+ }
164894
+ }
163542
164895
  let watcher;
163543
164896
  try {
163544
164897
  const devInstance = await startDev(args);
@@ -163567,15 +164920,15 @@ Switch out --local for ${import_chalk8.default.bold(
163567
164920
  )
163568
164921
  );
163569
164922
  }
163570
- const configPath = args.config || args.script && findWranglerToml(import_node_path38.default.dirname(args.script));
164923
+ const configPath = args.config || args.script && findWranglerToml(import_node_path39.default.dirname(args.script));
163571
164924
  let config = readConfig(configPath, args);
163572
164925
  if (config.configPath) {
163573
- watcher = (0, import_chokidar4.watch)(config.configPath, {
164926
+ watcher = (0, import_chokidar5.watch)(config.configPath, {
163574
164927
  persistent: true
163575
164928
  }).on("change", async (_event) => {
163576
164929
  config = readConfig(configPath, args);
163577
164930
  if (config.configPath) {
163578
- logger.log(`${import_node_path38.default.basename(config.configPath)} changed...`);
164931
+ logger.log(`${import_node_path39.default.basename(config.configPath)} changed...`);
163579
164932
  rerender(await getDevReactElement(config));
163580
164933
  }
163581
164934
  });
@@ -163676,7 +165029,7 @@ async function startApiDev(args) {
163676
165029
  logger.loggerLevel = args.logLevel;
163677
165030
  }
163678
165031
  await printWranglerBanner();
163679
- const configPath = args.config || args.script && findWranglerToml(import_node_path38.default.dirname(args.script));
165032
+ const configPath = args.config || args.script && findWranglerToml(import_node_path39.default.dirname(args.script));
163680
165033
  const config = readConfig(configPath, args);
163681
165034
  const {
163682
165035
  entry,
@@ -163957,10 +165310,21 @@ async function getBindings(configParam, env5, args) {
163957
165310
  ],
163958
165311
  dispatch_namespaces: configParam.dispatch_namespaces,
163959
165312
  services: configParam.services,
165313
+ analytics_engine_datasets: configParam.analytics_engine_datasets,
163960
165314
  unsafe: configParam.unsafe?.bindings,
163961
165315
  logfwdr: configParam.logfwdr,
163962
165316
  d1_databases: identifyD1BindingsAsBeta([
163963
- ...configParam.d1_databases,
165317
+ ...(configParam.d1_databases ?? []).map((d1Db) => {
165318
+ if (!d1Db.preview_database_id) {
165319
+ throw new Error(
165320
+ `In development, you should use a separate D1 database than the one you'd use in production. Please create a new D1 database with "wrangler d1 create <name>" and add its id as preview_database_id to the d1_database "${d1Db.binding}" in your wrangler.toml`
165321
+ );
165322
+ }
165323
+ return {
165324
+ ...d1Db,
165325
+ database_id: d1Db.preview_database_id
165326
+ };
165327
+ }),
163964
165328
  ...args.d1Databases || []
163965
165329
  ])
163966
165330
  };