@medplum/agent 4.1.10 → 4.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cjs/index.cjs +413 -410
  2. package/package.json +5 -5
@@ -6763,7 +6763,7 @@ var require_stream = __commonJS({
6763
6763
  this.emit("error", err);
6764
6764
  }
6765
6765
  }
6766
- function createWebSocketStream2(ws2, options) {
6766
+ function createWebSocketStream2(ws, options) {
6767
6767
  let terminateOnDestroy = true;
6768
6768
  const duplex = new Duplex({
6769
6769
  ...options,
@@ -6772,65 +6772,65 @@ var require_stream = __commonJS({
6772
6772
  objectMode: false,
6773
6773
  writableObjectMode: false
6774
6774
  });
6775
- ws2.on("message", function message(msg, isBinary) {
6775
+ ws.on("message", function message(msg, isBinary) {
6776
6776
  const data2 = !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;
6777
- if (!duplex.push(data2)) ws2.pause();
6777
+ if (!duplex.push(data2)) ws.pause();
6778
6778
  });
6779
- ws2.once("error", function error(err) {
6779
+ ws.once("error", function error(err) {
6780
6780
  if (duplex.destroyed) return;
6781
6781
  terminateOnDestroy = false;
6782
6782
  duplex.destroy(err);
6783
6783
  });
6784
- ws2.once("close", function close() {
6784
+ ws.once("close", function close() {
6785
6785
  if (duplex.destroyed) return;
6786
6786
  duplex.push(null);
6787
6787
  });
6788
6788
  duplex._destroy = function(err, callback) {
6789
- if (ws2.readyState === ws2.CLOSED) {
6789
+ if (ws.readyState === ws.CLOSED) {
6790
6790
  callback(err);
6791
6791
  process.nextTick(emitClose, duplex);
6792
6792
  return;
6793
6793
  }
6794
6794
  let called = false;
6795
- ws2.once("error", function error(err2) {
6795
+ ws.once("error", function error(err2) {
6796
6796
  called = true;
6797
6797
  callback(err2);
6798
6798
  });
6799
- ws2.once("close", function close() {
6799
+ ws.once("close", function close() {
6800
6800
  if (!called) callback(err);
6801
6801
  process.nextTick(emitClose, duplex);
6802
6802
  });
6803
- if (terminateOnDestroy) ws2.terminate();
6803
+ if (terminateOnDestroy) ws.terminate();
6804
6804
  };
6805
6805
  duplex._final = function(callback) {
6806
- if (ws2.readyState === ws2.CONNECTING) {
6807
- ws2.once("open", function open() {
6806
+ if (ws.readyState === ws.CONNECTING) {
6807
+ ws.once("open", function open() {
6808
6808
  duplex._final(callback);
6809
6809
  });
6810
6810
  return;
6811
6811
  }
6812
- if (ws2._socket === null) return;
6813
- if (ws2._socket._writableState.finished) {
6812
+ if (ws._socket === null) return;
6813
+ if (ws._socket._writableState.finished) {
6814
6814
  callback();
6815
6815
  if (duplex._readableState.endEmitted) duplex.destroy();
6816
6816
  } else {
6817
- ws2._socket.once("finish", function finish() {
6817
+ ws._socket.once("finish", function finish() {
6818
6818
  callback();
6819
6819
  });
6820
- ws2.close();
6820
+ ws.close();
6821
6821
  }
6822
6822
  };
6823
6823
  duplex._read = function() {
6824
- if (ws2.isPaused) ws2.resume();
6824
+ if (ws.isPaused) ws.resume();
6825
6825
  };
6826
6826
  duplex._write = function(chunk, encoding, callback) {
6827
- if (ws2.readyState === ws2.CONNECTING) {
6828
- ws2.once("open", function open() {
6827
+ if (ws.readyState === ws.CONNECTING) {
6828
+ ws.once("open", function open() {
6829
6829
  duplex._write(chunk, encoding, callback);
6830
6830
  });
6831
6831
  return;
6832
6832
  }
6833
- ws2.send(chunk, callback);
6833
+ ws.send(chunk, callback);
6834
6834
  };
6835
6835
  duplex.on("end", duplexOnEnd);
6836
6836
  duplex.on("error", duplexOnError);
@@ -7194,12 +7194,12 @@ var require_websocket_server = __commonJS({
7194
7194
  "Connection: Upgrade",
7195
7195
  `Sec-WebSocket-Accept: ${digest}`
7196
7196
  ];
7197
- const ws2 = new this.options.WebSocket(null, void 0, this.options);
7197
+ const ws = new this.options.WebSocket(null, void 0, this.options);
7198
7198
  if (protocols.size) {
7199
7199
  const protocol = this.options.handleProtocols ? this.options.handleProtocols(protocols, req) : protocols.values().next().value;
7200
7200
  if (protocol) {
7201
7201
  headers.push(`Sec-WebSocket-Protocol: ${protocol}`);
7202
- ws2._protocol = protocol;
7202
+ ws._protocol = protocol;
7203
7203
  }
7204
7204
  }
7205
7205
  if (extensions[PerMessageDeflate.extensionName]) {
@@ -7208,26 +7208,26 @@ var require_websocket_server = __commonJS({
7208
7208
  [PerMessageDeflate.extensionName]: [params]
7209
7209
  });
7210
7210
  headers.push(`Sec-WebSocket-Extensions: ${value}`);
7211
- ws2._extensions = extensions;
7211
+ ws._extensions = extensions;
7212
7212
  }
7213
7213
  this.emit("headers", headers, req);
7214
7214
  socket.write(headers.concat("\r\n").join("\r\n"));
7215
7215
  socket.removeListener("error", socketOnError);
7216
- ws2.setSocket(socket, head, {
7216
+ ws.setSocket(socket, head, {
7217
7217
  allowSynchronousEvents: this.options.allowSynchronousEvents,
7218
7218
  maxPayload: this.options.maxPayload,
7219
7219
  skipUTF8Validation: this.options.skipUTF8Validation
7220
7220
  });
7221
7221
  if (this.clients) {
7222
- this.clients.add(ws2);
7223
- ws2.on("close", () => {
7224
- this.clients.delete(ws2);
7222
+ this.clients.add(ws);
7223
+ ws.on("close", () => {
7224
+ this.clients.delete(ws);
7225
7225
  if (this._shouldEmitClose && !this.clients.size) {
7226
7226
  process.nextTick(emitClose, this);
7227
7227
  }
7228
7228
  });
7229
7229
  }
7230
- cb(ws2, req);
7230
+ cb(ws, req);
7231
7231
  }
7232
7232
  };
7233
7233
  module2.exports = WebSocketServer2;
@@ -7578,8 +7578,8 @@ var require_dcmjs = __commonJS({
7578
7578
  if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
7579
7579
  var o = [null];
7580
7580
  o.push.apply(o, e);
7581
- var p2 = new (t.bind.apply(t, o))();
7582
- return r6 && _setPrototypeOf(p2, r6.prototype), p2;
7581
+ var p = new (t.bind.apply(t, o))();
7582
+ return r6 && _setPrototypeOf(p, r6.prototype), p;
7583
7583
  }
7584
7584
  function _isNativeReflectConstruct() {
7585
7585
  try {
@@ -7713,12 +7713,12 @@ var require_dcmjs = __commonJS({
7713
7713
  };
7714
7714
  return _getPrototypeOf(o);
7715
7715
  }
7716
- function _setPrototypeOf(o, p2) {
7717
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
7718
- o2.__proto__ = p3;
7716
+ function _setPrototypeOf(o, p) {
7717
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
7718
+ o2.__proto__ = p2;
7719
7719
  return o2;
7720
7720
  };
7721
- return _setPrototypeOf(o, p2);
7721
+ return _setPrototypeOf(o, p);
7722
7722
  }
7723
7723
  function _isNativeFunction(fn) {
7724
7724
  try {
@@ -8672,19 +8672,19 @@ var require_dcmjs = __commonJS({
8672
8672
  };
8673
8673
  const slide_hash = (s) => {
8674
8674
  let n, m2;
8675
- let p2;
8675
+ let p;
8676
8676
  let wsize = s.w_size;
8677
8677
  n = s.hash_size;
8678
- p2 = n;
8678
+ p = n;
8679
8679
  do {
8680
- m2 = s.head[--p2];
8681
- s.head[p2] = m2 >= wsize ? m2 - wsize : 0;
8680
+ m2 = s.head[--p];
8681
+ s.head[p] = m2 >= wsize ? m2 - wsize : 0;
8682
8682
  } while (--n);
8683
8683
  n = wsize;
8684
- p2 = n;
8684
+ p = n;
8685
8685
  do {
8686
- m2 = s.prev[--p2];
8687
- s.prev[p2] = m2 >= wsize ? m2 - wsize : 0;
8686
+ m2 = s.prev[--p];
8687
+ s.prev[p] = m2 >= wsize ? m2 - wsize : 0;
8688
8688
  } while (--n);
8689
8689
  };
8690
8690
  let HASH_ZLIB = (s, prev, data3) => (prev << s.hash_shift ^ data3) & s.hash_mask;
@@ -9763,9 +9763,9 @@ var require_dcmjs = __commonJS({
9763
9763
  if (typeof source !== "object") {
9764
9764
  throw new TypeError(source + "must be non-object");
9765
9765
  }
9766
- for (const p2 in source) {
9767
- if (_has(source, p2)) {
9768
- obj[p2] = source[p2];
9766
+ for (const p in source) {
9767
+ if (_has(source, p)) {
9768
+ obj[p] = source[p];
9769
9769
  }
9770
9770
  }
9771
9771
  }
@@ -18026,17 +18026,17 @@ var require_dcmjs = __commonJS({
18026
18026
  if (shape === void 0) {
18027
18027
  shape = [data3.length];
18028
18028
  }
18029
- var d2 = shape.length;
18029
+ var d3 = shape.length;
18030
18030
  if (stride === void 0) {
18031
- stride = new Array(d2);
18032
- for (var i2 = d2 - 1, sz = 1; i2 >= 0; --i2) {
18031
+ stride = new Array(d3);
18032
+ for (var i2 = d3 - 1, sz = 1; i2 >= 0; --i2) {
18033
18033
  stride[i2] = sz;
18034
18034
  sz *= shape[i2];
18035
18035
  }
18036
18036
  }
18037
18037
  if (offset === void 0) {
18038
18038
  offset = 0;
18039
- for (var i2 = 0; i2 < d2; ++i2) {
18039
+ for (var i2 = 0; i2 < d3; ++i2) {
18040
18040
  if (stride[i2] < 0) {
18041
18041
  offset -= (shape[i2] - 1) * stride[i2];
18042
18042
  }
@@ -18044,10 +18044,10 @@ var require_dcmjs = __commonJS({
18044
18044
  }
18045
18045
  var dtype = arrayDType(data3);
18046
18046
  var ctor_list = CACHED_CONSTRUCTORS[dtype];
18047
- while (ctor_list.length <= d2 + 1) {
18047
+ while (ctor_list.length <= d3 + 1) {
18048
18048
  ctor_list.push(compileConstructor(dtype, ctor_list.length - 1));
18049
18049
  }
18050
- var ctor = ctor_list[d2 + 1];
18050
+ var ctor = ctor_list[d3 + 1];
18051
18051
  return ctor(data3, shape, stride, offset);
18052
18052
  }
18053
18053
  var ndarray = wrappedNDArrayCtor;
@@ -18208,8 +18208,8 @@ var require_dcmjs = __commonJS({
18208
18208
  var imageId = images[frame].imageId;
18209
18209
  var imageIdSpecificToolState = toolState[imageId];
18210
18210
  var brushPixelData = imageIdSpecificToolState.brush.data[segmentIndex].pixelData;
18211
- for (var p2 = 0; p2 < brushPixelData.length; p2++) {
18212
- pixelData[pixelDataIndex] = brushPixelData[p2];
18211
+ for (var p = 0; p < brushPixelData.length; p++) {
18212
+ pixelData[pixelDataIndex] = brushPixelData[p];
18213
18213
  pixelDataIndex++;
18214
18214
  }
18215
18215
  }
@@ -18349,11 +18349,11 @@ var require_dcmjs = __commonJS({
18349
18349
  var brushDataI = toolState[imageId].brush.data[segmentIndex];
18350
18350
  brushDataI.pixelData = new Uint8Array(pixelData2D.data.length);
18351
18351
  var cToolsPixelData = brushDataI.pixelData;
18352
- for (var p2 = 0; p2 < cToolsPixelData.length; p2++) {
18353
- if (pixelData2D.data[p2]) {
18354
- cToolsPixelData[p2] = 1;
18352
+ for (var p = 0; p < cToolsPixelData.length; p++) {
18353
+ if (pixelData2D.data[p]) {
18354
+ cToolsPixelData[p] = 1;
18355
18355
  } else {
18356
- cToolsPixelData[p2] = 0;
18356
+ cToolsPixelData[p] = 0;
18357
18357
  }
18358
18358
  }
18359
18359
  }
@@ -18547,8 +18547,8 @@ var require_dcmjs = __commonJS({
18547
18547
  if (byteValue <= 127) {
18548
18548
  var N2 = byteValue + 1;
18549
18549
  var next = i2 + 1;
18550
- for (var p2 = next; p2 < next + N2; p2++) {
18551
- pixelData[pixelDataIndex] = uInt8Frame[p2];
18550
+ for (var p = next; p < next + N2; p++) {
18551
+ pixelData[pixelDataIndex] = uInt8Frame[p];
18552
18552
  pixelDataIndex++;
18553
18553
  }
18554
18554
  i2 += N2 + 1;
@@ -20148,8 +20148,8 @@ var require_dcmjs = __commonJS({
20148
20148
  value: function getCornerstoneLabelFromDefaultState(defaultState) {
20149
20149
  var _defaultState$finding = defaultState.findingSites, findingSites = _defaultState$finding === void 0 ? [] : _defaultState$finding, finding = defaultState.finding;
20150
20150
  var cornersoneFreeTextCodingValue = CodingScheme.codeValues.CORNERSTONEFREETEXT;
20151
- var freeTextLabel = findingSites.find(function(fs4) {
20152
- return fs4.CodeValue === cornersoneFreeTextCodingValue;
20151
+ var freeTextLabel = findingSites.find(function(fs3) {
20152
+ return fs3.CodeValue === cornersoneFreeTextCodingValue;
20153
20153
  });
20154
20154
  if (freeTextLabel) {
20155
20155
  return freeTextLabel.CodeMeaning;
@@ -20744,18 +20744,18 @@ var require_dcmjs = __commonJS({
20744
20744
  out[2] = az + t * (b2[2] - az);
20745
20745
  return out;
20746
20746
  }
20747
- function hermite(out, a2, b2, c, d2, t) {
20747
+ function hermite(out, a2, b2, c, d3, t) {
20748
20748
  var factorTimes2 = t * t;
20749
20749
  var factor1 = factorTimes2 * (2 * t - 3) + 1;
20750
20750
  var factor2 = factorTimes2 * (t - 2) + t;
20751
20751
  var factor3 = factorTimes2 * (t - 1);
20752
20752
  var factor4 = factorTimes2 * (3 - 2 * t);
20753
- out[0] = a2[0] * factor1 + b2[0] * factor2 + c[0] * factor3 + d2[0] * factor4;
20754
- out[1] = a2[1] * factor1 + b2[1] * factor2 + c[1] * factor3 + d2[1] * factor4;
20755
- out[2] = a2[2] * factor1 + b2[2] * factor2 + c[2] * factor3 + d2[2] * factor4;
20753
+ out[0] = a2[0] * factor1 + b2[0] * factor2 + c[0] * factor3 + d3[0] * factor4;
20754
+ out[1] = a2[1] * factor1 + b2[1] * factor2 + c[1] * factor3 + d3[1] * factor4;
20755
+ out[2] = a2[2] * factor1 + b2[2] * factor2 + c[2] * factor3 + d3[2] * factor4;
20756
20756
  return out;
20757
20757
  }
20758
- function bezier(out, a2, b2, c, d2, t) {
20758
+ function bezier(out, a2, b2, c, d3, t) {
20759
20759
  var inverseFactor = 1 - t;
20760
20760
  var inverseFactorTimesTwo = inverseFactor * inverseFactor;
20761
20761
  var factorTimes2 = t * t;
@@ -20763,9 +20763,9 @@ var require_dcmjs = __commonJS({
20763
20763
  var factor2 = 3 * t * inverseFactorTimesTwo;
20764
20764
  var factor3 = 3 * factorTimes2 * inverseFactor;
20765
20765
  var factor4 = factorTimes2 * t;
20766
- out[0] = a2[0] * factor1 + b2[0] * factor2 + c[0] * factor3 + d2[0] * factor4;
20767
- out[1] = a2[1] * factor1 + b2[1] * factor2 + c[1] * factor3 + d2[1] * factor4;
20768
- out[2] = a2[2] * factor1 + b2[2] * factor2 + c[2] * factor3 + d2[2] * factor4;
20766
+ out[0] = a2[0] * factor1 + b2[0] * factor2 + c[0] * factor3 + d3[0] * factor4;
20767
+ out[1] = a2[1] * factor1 + b2[1] * factor2 + c[1] * factor3 + d3[1] * factor4;
20768
+ out[2] = a2[2] * factor1 + b2[2] * factor2 + c[2] * factor3 + d3[2] * factor4;
20769
20769
  return out;
20770
20770
  }
20771
20771
  function random(out, scale2) {
@@ -20812,39 +20812,39 @@ var require_dcmjs = __commonJS({
20812
20812
  return out;
20813
20813
  }
20814
20814
  function rotateX(out, a2, b2, rad) {
20815
- var p2 = [], r6 = [];
20816
- p2[0] = a2[0] - b2[0];
20817
- p2[1] = a2[1] - b2[1];
20818
- p2[2] = a2[2] - b2[2];
20819
- r6[0] = p2[0];
20820
- r6[1] = p2[1] * Math.cos(rad) - p2[2] * Math.sin(rad);
20821
- r6[2] = p2[1] * Math.sin(rad) + p2[2] * Math.cos(rad);
20815
+ var p = [], r6 = [];
20816
+ p[0] = a2[0] - b2[0];
20817
+ p[1] = a2[1] - b2[1];
20818
+ p[2] = a2[2] - b2[2];
20819
+ r6[0] = p[0];
20820
+ r6[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);
20821
+ r6[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);
20822
20822
  out[0] = r6[0] + b2[0];
20823
20823
  out[1] = r6[1] + b2[1];
20824
20824
  out[2] = r6[2] + b2[2];
20825
20825
  return out;
20826
20826
  }
20827
20827
  function rotateY(out, a2, b2, rad) {
20828
- var p2 = [], r6 = [];
20829
- p2[0] = a2[0] - b2[0];
20830
- p2[1] = a2[1] - b2[1];
20831
- p2[2] = a2[2] - b2[2];
20832
- r6[0] = p2[2] * Math.sin(rad) + p2[0] * Math.cos(rad);
20833
- r6[1] = p2[1];
20834
- r6[2] = p2[2] * Math.cos(rad) - p2[0] * Math.sin(rad);
20828
+ var p = [], r6 = [];
20829
+ p[0] = a2[0] - b2[0];
20830
+ p[1] = a2[1] - b2[1];
20831
+ p[2] = a2[2] - b2[2];
20832
+ r6[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);
20833
+ r6[1] = p[1];
20834
+ r6[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);
20835
20835
  out[0] = r6[0] + b2[0];
20836
20836
  out[1] = r6[1] + b2[1];
20837
20837
  out[2] = r6[2] + b2[2];
20838
20838
  return out;
20839
20839
  }
20840
20840
  function rotateZ(out, a2, b2, rad) {
20841
- var p2 = [], r6 = [];
20842
- p2[0] = a2[0] - b2[0];
20843
- p2[1] = a2[1] - b2[1];
20844
- p2[2] = a2[2] - b2[2];
20845
- r6[0] = p2[0] * Math.cos(rad) - p2[1] * Math.sin(rad);
20846
- r6[1] = p2[0] * Math.sin(rad) + p2[1] * Math.cos(rad);
20847
- r6[2] = p2[2];
20841
+ var p = [], r6 = [];
20842
+ p[0] = a2[0] - b2[0];
20843
+ p[1] = a2[1] - b2[1];
20844
+ p[2] = a2[2] - b2[2];
20845
+ r6[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);
20846
+ r6[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);
20847
+ r6[2] = p[2];
20848
20848
  out[0] = r6[0] + b2[0];
20849
20849
  out[1] = r6[1] + b2[1];
20850
20850
  out[2] = r6[2] + b2[2];
@@ -25777,19 +25777,19 @@ var require_decorator = __commonJS({
25777
25777
  mergedObject[key] = (0, util_1.unique)([...(_a = o1 === null || o1 === void 0 ? void 0 : o1[key]) !== null && _a !== void 0 ? _a : [], ...(_b = o2 === null || o2 === void 0 ? void 0 : o2[key]) !== null && _b !== void 0 ? _b : []]);
25778
25778
  return mergedObject;
25779
25779
  };
25780
- var mergePropertyAndMethodDecorators = (d1, d2) => {
25780
+ var mergePropertyAndMethodDecorators = (d1, d22) => {
25781
25781
  var _a, _b, _c, _d;
25782
25782
  return {
25783
- property: mergeObjectsOfDecorators((_a = d1 === null || d1 === void 0 ? void 0 : d1.property) !== null && _a !== void 0 ? _a : {}, (_b = d2 === null || d2 === void 0 ? void 0 : d2.property) !== null && _b !== void 0 ? _b : {}),
25784
- method: mergeObjectsOfDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.method) !== null && _c !== void 0 ? _c : {}, (_d = d2 === null || d2 === void 0 ? void 0 : d2.method) !== null && _d !== void 0 ? _d : {})
25783
+ property: mergeObjectsOfDecorators((_a = d1 === null || d1 === void 0 ? void 0 : d1.property) !== null && _a !== void 0 ? _a : {}, (_b = d22 === null || d22 === void 0 ? void 0 : d22.property) !== null && _b !== void 0 ? _b : {}),
25784
+ method: mergeObjectsOfDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.method) !== null && _c !== void 0 ? _c : {}, (_d = d22 === null || d22 === void 0 ? void 0 : d22.method) !== null && _d !== void 0 ? _d : {})
25785
25785
  };
25786
25786
  };
25787
- var mergeDecorators = (d1, d2) => {
25787
+ var mergeDecorators = (d1, d22) => {
25788
25788
  var _a, _b, _c, _d, _e, _f;
25789
25789
  return {
25790
- class: (0, util_1.unique)([...(_a = d1 === null || d1 === void 0 ? void 0 : d1.class) !== null && _a !== void 0 ? _a : [], ...(_b = d2 === null || d2 === void 0 ? void 0 : d2.class) !== null && _b !== void 0 ? _b : []]),
25791
- static: mergePropertyAndMethodDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.static) !== null && _c !== void 0 ? _c : {}, (_d = d2 === null || d2 === void 0 ? void 0 : d2.static) !== null && _d !== void 0 ? _d : {}),
25792
- instance: mergePropertyAndMethodDecorators((_e = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e !== void 0 ? _e : {}, (_f = d2 === null || d2 === void 0 ? void 0 : d2.instance) !== null && _f !== void 0 ? _f : {})
25790
+ class: (0, util_1.unique)([...(_a = d1 === null || d1 === void 0 ? void 0 : d1.class) !== null && _a !== void 0 ? _a : [], ...(_b = d22 === null || d22 === void 0 ? void 0 : d22.class) !== null && _b !== void 0 ? _b : []]),
25791
+ static: mergePropertyAndMethodDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.static) !== null && _c !== void 0 ? _c : {}, (_d = d22 === null || d22 === void 0 ? void 0 : d22.static) !== null && _d !== void 0 ? _d : {}),
25792
+ instance: mergePropertyAndMethodDecorators((_e = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e !== void 0 ? _e : {}, (_f = d22 === null || d22 === void 0 ? void 0 : d22.instance) !== null && _f !== void 0 ? _f : {})
25793
25793
  };
25794
25794
  };
25795
25795
  var decorators = /* @__PURE__ */ new Map();
@@ -25817,7 +25817,7 @@ var require_decorator = __commonJS({
25817
25817
  return {};
25818
25818
  if (decoratorsForClassChain.length == 1)
25819
25819
  return decoratorsForClassChain[0];
25820
- return decoratorsForClassChain.reduce((d1, d2) => mergeDecorators(d1, d2));
25820
+ return decoratorsForClassChain.reduce((d1, d22) => mergeDecorators(d1, d22));
25821
25821
  };
25822
25822
  exports2.deepDecoratorSearch = deepDecoratorSearch;
25823
25823
  var directDecoratorSearch = (...classes) => {
@@ -25826,7 +25826,7 @@ var require_decorator = __commonJS({
25826
25826
  return {};
25827
25827
  if (classDecorators.length === 1)
25828
25828
  return classDecorators[0];
25829
- return classDecorators.reduce((d1, d2) => mergeDecorators(d1, d2));
25829
+ return classDecorators.reduce((d1, d22) => mergeDecorators(d1, d22));
25830
25830
  };
25831
25831
  exports2.directDecoratorSearch = directDecoratorSearch;
25832
25832
  var getDecoratorsForClass = (clazz) => {
@@ -26162,7 +26162,7 @@ var require_dcmjs_codecs_min = __commonJS({
26162
26162
  "use strict";
26163
26163
  e.exports = __WEBPACK_EXTERNAL_MODULE__111__;
26164
26164
  }, 190: (e, t, r6) => {
26165
- const { Implementation: s, StorageClass: o, TranscodeMap: i2, TransferSyntax: n } = r6(492), { Codec: a2 } = r6(258), l3 = r6(111), { DicomDict: c, DicomMessage: d2, DicomMetaDictionary: p2, ReadBufferStream: h3, WriteBufferStream: m2 } = l3.data, u2 = l3.log;
26165
+ const { Implementation: s, StorageClass: o, TranscodeMap: i2, TransferSyntax: n } = r6(492), { Codec: a2 } = r6(258), l3 = r6(111), { DicomDict: c, DicomMessage: d3, DicomMetaDictionary: p, ReadBufferStream: h3, WriteBufferStream: m2 } = l3.data, u2 = l3.log;
26166
26166
  e.exports = class {
26167
26167
  constructor(e2, t2, r7 = {}) {
26168
26168
  r7 = { ignoreErrors: true, ...r7 }, u2.level = "error", this.transferSyntaxUid = t2 || n.ImplicitVRLittleEndian, e2 instanceof ArrayBuffer ? t2 ? this._fromElementsBuffer(e2, t2, r7) : this._fromP10Buffer(e2) : this.elements = e2 || {};
@@ -26195,24 +26195,24 @@ var require_dcmjs_codecs_min = __commonJS({
26195
26195
  }
26196
26196
  getDicomDataset(e2, t2) {
26197
26197
  e2 = { fragmentMultiframe: false, ...e2 };
26198
- const r7 = t2 ? p2.denaturalizeDataset(this.getElements(), { ...p2.nameMap, ...t2 }) : p2.denaturalizeDataset(this.getElements()), s2 = new m2();
26199
- return d2.write(r7, s2, this.transferSyntaxUid, e2), s2.getBuffer();
26198
+ const r7 = t2 ? p.denaturalizeDataset(this.getElements(), { ...p.nameMap, ...t2 }) : p.denaturalizeDataset(this.getElements()), s2 = new m2();
26199
+ return d3.write(r7, s2, this.transferSyntaxUid, e2), s2.getBuffer();
26200
26200
  }
26201
26201
  getDicomPart10(e2, t2) {
26202
26202
  e2 = { fragmentMultiframe: false, ...e2 };
26203
- const r7 = { _meta: { FileMetaInformationVersion: new Uint8Array([0, 1]).buffer, MediaStorageSOPClassUID: this._getElement("SOPClassUID") || o.SecondaryCaptureImageStorage, MediaStorageSOPInstanceUID: this._getElement("SOPInstanceUID") || p2.uid(), TransferSyntaxUID: this.getTransferSyntaxUid(), ImplementationClassUID: s.ImplementationClassUid, ImplementationVersionName: s.ImplementationVersion }, ...this.getElements() }, i3 = p2.denaturalizeDataset(r7._meta), n2 = new c(i3);
26204
- return n2.dict = t2 ? p2.denaturalizeDataset(r7, { ...p2.nameMap, ...t2 }) : p2.denaturalizeDataset(r7), n2.write(e2);
26203
+ const r7 = { _meta: { FileMetaInformationVersion: new Uint8Array([0, 1]).buffer, MediaStorageSOPClassUID: this._getElement("SOPClassUID") || o.SecondaryCaptureImageStorage, MediaStorageSOPInstanceUID: this._getElement("SOPInstanceUID") || p.uid(), TransferSyntaxUID: this.getTransferSyntaxUid(), ImplementationClassUID: s.ImplementationClassUid, ImplementationVersionName: s.ImplementationVersion }, ...this.getElements() }, i3 = p.denaturalizeDataset(r7._meta), n2 = new c(i3);
26204
+ return n2.dict = t2 ? p.denaturalizeDataset(r7, { ...p.nameMap, ...t2 }) : p.denaturalizeDataset(r7), n2.write(e2);
26205
26205
  }
26206
26206
  _getElement(e2) {
26207
26207
  return this.elements[e2];
26208
26208
  }
26209
26209
  _fromP10Buffer(e2, t2) {
26210
- const r7 = d2.readFile(e2, t2), s2 = p2.naturalizeDataset(r7.meta).TransferSyntaxUID, o2 = p2.naturalizeDataset(r7.dict);
26210
+ const r7 = d3.readFile(e2, t2), s2 = p.naturalizeDataset(r7.meta).TransferSyntaxUID, o2 = p.naturalizeDataset(r7.dict);
26211
26211
  this.elements = o2, this.transferSyntaxUid = s2;
26212
26212
  }
26213
26213
  _fromElementsBuffer(e2, t2, r7) {
26214
- const s2 = new h3(e2), o2 = t2 === n.ImplicitVRLittleEndian ? n.ImplicitVRLittleEndian : t2 === n.ExplicitVRBigEndian ? n.ExplicitVRBigEndian : n.ExplicitVRLittleEndian, i3 = d2._read(s2, o2, r7);
26215
- this.elements = p2.naturalizeDataset(i3), this.transferSyntaxUid = t2;
26214
+ const s2 = new h3(e2), o2 = t2 === n.ImplicitVRLittleEndian ? n.ImplicitVRLittleEndian : t2 === n.ExplicitVRBigEndian ? n.ExplicitVRBigEndian : n.ExplicitVRLittleEndian, i3 = d3._read(s2, o2, r7);
26215
+ this.elements = p.naturalizeDataset(i3), this.transferSyntaxUid = t2;
26216
26216
  }
26217
26217
  };
26218
26218
  }, 213: function(e, t, r6) {
@@ -26246,16 +26246,16 @@ var require_dcmjs_codecs_min = __commonJS({
26246
26246
  }
26247
26247
  if (this.log = this.debug, typeof console === t2 && r8 < this.levels.SILENT) return "No console available for logging";
26248
26248
  }
26249
- function d2(e3) {
26249
+ function d3(e3) {
26250
26250
  return function() {
26251
26251
  typeof console !== t2 && (c.call(this), this[e3].apply(this, arguments));
26252
26252
  };
26253
26253
  }
26254
- function p2(e3, t3, r8) {
26255
- return l3(e3) || d2.apply(this, arguments);
26254
+ function p(e3, t3, r8) {
26255
+ return l3(e3) || d3.apply(this, arguments);
26256
26256
  }
26257
26257
  function h3(e3, r8) {
26258
- var n2, a3, l4, d3 = this, h4 = "loglevel";
26258
+ var n2, a3, l4, d4 = this, h4 = "loglevel";
26259
26259
  function m3(e4) {
26260
26260
  var r9 = (s2[e4] || "silent").toUpperCase();
26261
26261
  if (typeof window !== t2 && h4) {
@@ -26281,7 +26281,7 @@ var require_dcmjs_codecs_min = __commonJS({
26281
26281
  -1 !== o3 && (e4 = /^([^;]+)/.exec(r9.slice(o3 + s3.length + 1))[1]);
26282
26282
  } catch (e5) {
26283
26283
  }
26284
- return void 0 === d3.levels[e4] && (e4 = void 0), e4;
26284
+ return void 0 === d4.levels[e4] && (e4 = void 0), e4;
26285
26285
  }
26286
26286
  }
26287
26287
  function g2() {
@@ -26298,26 +26298,26 @@ var require_dcmjs_codecs_min = __commonJS({
26298
26298
  }
26299
26299
  function f3(e4) {
26300
26300
  var t3 = e4;
26301
- if ("string" == typeof t3 && void 0 !== d3.levels[t3.toUpperCase()] && (t3 = d3.levels[t3.toUpperCase()]), "number" == typeof t3 && t3 >= 0 && t3 <= d3.levels.SILENT) return t3;
26301
+ if ("string" == typeof t3 && void 0 !== d4.levels[t3.toUpperCase()] && (t3 = d4.levels[t3.toUpperCase()]), "number" == typeof t3 && t3 >= 0 && t3 <= d4.levels.SILENT) return t3;
26302
26302
  throw new TypeError("log.setLevel() called with invalid level: " + e4);
26303
26303
  }
26304
- "string" == typeof e3 ? h4 += ":" + e3 : "symbol" == typeof e3 && (h4 = void 0), d3.name = e3, d3.levels = { TRACE: 0, DEBUG: 1, INFO: 2, WARN: 3, ERROR: 4, SILENT: 5 }, d3.methodFactory = r8 || p2, d3.getLevel = function() {
26304
+ "string" == typeof e3 ? h4 += ":" + e3 : "symbol" == typeof e3 && (h4 = void 0), d4.name = e3, d4.levels = { TRACE: 0, DEBUG: 1, INFO: 2, WARN: 3, ERROR: 4, SILENT: 5 }, d4.methodFactory = r8 || p, d4.getLevel = function() {
26305
26305
  return null != l4 ? l4 : null != a3 ? a3 : n2;
26306
- }, d3.setLevel = function(e4, t3) {
26307
- return l4 = f3(e4), false !== t3 && m3(l4), c.call(d3);
26308
- }, d3.setDefaultLevel = function(e4) {
26309
- a3 = f3(e4), u2() || d3.setLevel(e4, false);
26310
- }, d3.resetLevel = function() {
26311
- l4 = null, g2(), c.call(d3);
26312
- }, d3.enableAll = function(e4) {
26313
- d3.setLevel(d3.levels.TRACE, e4);
26314
- }, d3.disableAll = function(e4) {
26315
- d3.setLevel(d3.levels.SILENT, e4);
26316
- }, d3.rebuild = function() {
26317
- if (i2 !== d3 && (n2 = f3(i2.getLevel())), c.call(d3), i2 === d3) for (var e4 in o2) o2[e4].rebuild();
26306
+ }, d4.setLevel = function(e4, t3) {
26307
+ return l4 = f3(e4), false !== t3 && m3(l4), c.call(d4);
26308
+ }, d4.setDefaultLevel = function(e4) {
26309
+ a3 = f3(e4), u2() || d4.setLevel(e4, false);
26310
+ }, d4.resetLevel = function() {
26311
+ l4 = null, g2(), c.call(d4);
26312
+ }, d4.enableAll = function(e4) {
26313
+ d4.setLevel(d4.levels.TRACE, e4);
26314
+ }, d4.disableAll = function(e4) {
26315
+ d4.setLevel(d4.levels.SILENT, e4);
26316
+ }, d4.rebuild = function() {
26317
+ if (i2 !== d4 && (n2 = f3(i2.getLevel())), c.call(d4), i2 === d4) for (var e4 in o2) o2[e4].rebuild();
26318
26318
  }, n2 = f3(i2 ? i2.getLevel() : "WARN");
26319
26319
  var w2 = u2();
26320
- null != w2 && (l4 = f3(w2)), c.call(d3);
26320
+ null != w2 && (l4 = f3(w2)), c.call(d4);
26321
26321
  }
26322
26322
  (i2 = new h3()).getLogger = function(e3) {
26323
26323
  if ("symbol" != typeof e3 && "string" != typeof e3 || "" === e3) throw new TypeError("You must supply a name when creating a logger.");
@@ -26336,8 +26336,8 @@ var require_dcmjs_codecs_min = __commonJS({
26336
26336
  const { PhotometricInterpretation: s } = r6(492);
26337
26337
  class o {
26338
26338
  constructor(e2 = {}) {
26339
- const { width: t2, height: r7, bitsAllocated: s2, bitsStored: o2, samplesPerPixel: i2, pixelRepresentation: n, planarConfiguration: a2, photometricInterpretation: l3, encodedBuffer: c, decodedBuffer: d2 } = e2;
26340
- this.width = t2, this.height = r7, this.bitsAllocated = s2, this.bitsStored = o2, this.samplesPerPixel = i2, this.pixelRepresentation = n, this.planarConfiguration = a2, this.photometricInterpretation = l3, this.encodedBuffer = c, this.decodedBuffer = d2;
26339
+ const { width: t2, height: r7, bitsAllocated: s2, bitsStored: o2, samplesPerPixel: i2, pixelRepresentation: n, planarConfiguration: a2, photometricInterpretation: l3, encodedBuffer: c, decodedBuffer: d3 } = e2;
26340
+ this.width = t2, this.height = r7, this.bitsAllocated = s2, this.bitsStored = o2, this.samplesPerPixel = i2, this.pixelRepresentation = n, this.planarConfiguration = a2, this.photometricInterpretation = l3, this.encodedBuffer = c, this.decodedBuffer = d3;
26341
26341
  }
26342
26342
  getWidth() {
26343
26343
  return this.width;
@@ -26422,10 +26422,10 @@ var require_dcmjs_codecs_min = __commonJS({
26422
26422
  }
26423
26423
  e.exports = o;
26424
26424
  }, 237: (e, t, r6) => {
26425
- const { Codec: s, ExplicitVRBigEndianCodec: o, ExplicitVRLittleEndianCodec: i2, HtJpeg2000LosslessCodec: n, HtJpeg2000LosslessRpclCodec: a2, HtJpeg2000LossyCodec: l3, ImplicitVRLittleEndianCodec: c, Jpeg2000LosslessCodec: d2, Jpeg2000LossyCodec: p2, JpegBaselineProcess1Codec: h3, JpegLosslessProcess14V1Codec: m2, JpegLsLosslessCodec: u2, JpegLsLossyCodec: g2, RleLosslessCodec: f3 } = r6(258), { Jpeg2000ProgressionOrder: w2, JpegSampleFactor: P, PhotometricInterpretation: y3, PixelRepresentation: x, PlanarConfiguration: C2, TransferSyntax: b2 } = r6(492), _2 = r6(234), I2 = r6(25), A2 = r6(190), S2 = { codecs: { Codec: s, ExplicitVRBigEndianCodec: o, ExplicitVRLittleEndianCodec: i2, HtJpeg2000LosslessCodec: n, HtJpeg2000LosslessRpclCodec: a2, HtJpeg2000LossyCodec: l3, ImplicitVRLittleEndianCodec: c, Jpeg2000LosslessCodec: d2, Jpeg2000LossyCodec: p2, JpegBaselineProcess1Codec: h3, JpegLosslessProcess14V1Codec: m2, JpegLsLosslessCodec: u2, JpegLsLossyCodec: g2, RleLosslessCodec: f3 }, constants: { Jpeg2000ProgressionOrder: w2, JpegSampleFactor: P, PhotometricInterpretation: y3, PixelRepresentation: x, PlanarConfiguration: C2, TransferSyntax: b2 }, Context: _2, log: r6(547), NativeCodecs: I2, Transcoder: A2, version: r6(837) };
26425
+ const { Codec: s, ExplicitVRBigEndianCodec: o, ExplicitVRLittleEndianCodec: i2, HtJpeg2000LosslessCodec: n, HtJpeg2000LosslessRpclCodec: a2, HtJpeg2000LossyCodec: l3, ImplicitVRLittleEndianCodec: c, Jpeg2000LosslessCodec: d3, Jpeg2000LossyCodec: p, JpegBaselineProcess1Codec: h3, JpegLosslessProcess14V1Codec: m2, JpegLsLosslessCodec: u2, JpegLsLossyCodec: g2, RleLosslessCodec: f3 } = r6(258), { Jpeg2000ProgressionOrder: w2, JpegSampleFactor: P, PhotometricInterpretation: y3, PixelRepresentation: x, PlanarConfiguration: C2, TransferSyntax: b2 } = r6(492), _2 = r6(234), I2 = r6(25), A2 = r6(190), S2 = { codecs: { Codec: s, ExplicitVRBigEndianCodec: o, ExplicitVRLittleEndianCodec: i2, HtJpeg2000LosslessCodec: n, HtJpeg2000LosslessRpclCodec: a2, HtJpeg2000LossyCodec: l3, ImplicitVRLittleEndianCodec: c, Jpeg2000LosslessCodec: d3, Jpeg2000LossyCodec: p, JpegBaselineProcess1Codec: h3, JpegLosslessProcess14V1Codec: m2, JpegLsLosslessCodec: u2, JpegLsLossyCodec: g2, RleLosslessCodec: f3 }, constants: { Jpeg2000ProgressionOrder: w2, JpegSampleFactor: P, PhotometricInterpretation: y3, PixelRepresentation: x, PlanarConfiguration: C2, TransferSyntax: b2 }, Context: _2, log: r6(547), NativeCodecs: I2, Transcoder: A2, version: r6(837) };
26426
26426
  e.exports = S2;
26427
26427
  }, 258: (e, t, r6) => {
26428
- const { Jpeg2000ProgressionOrder: s, JpegSampleFactor: o, PhotometricInterpretation: i2, PlanarConfiguration: n, TransferSyntax: a2 } = r6(492), { FrameConverter: l3, Frames: c } = r6(859), d2 = r6(234), p2 = r6(25), h3 = r6(984);
26428
+ const { Jpeg2000ProgressionOrder: s, JpegSampleFactor: o, PhotometricInterpretation: i2, PlanarConfiguration: n, TransferSyntax: a2 } = r6(492), { FrameConverter: l3, Frames: c } = r6(859), d3 = r6(234), p = r6(25), h3 = r6(984);
26429
26429
  class m2 {
26430
26430
  encode(e2, t2, r7 = {}) {
26431
26431
  throw new Error("encode should be implemented");
@@ -26443,9 +26443,9 @@ var require_dcmjs_codecs_min = __commonJS({
26443
26443
  for (let t3 = 0; t3 < i3; t3++) {
26444
26444
  let i4 = o2.getFrameBuffer(t3);
26445
26445
  s2.unpackLow16 && (i4 = l3.unpackLow16(i4)), s2.convertYbrFullToRgb && (i4 = l3.ybrFullToRgb(i4)), s2.convertYbrFull422ToRgb && (i4 = l3.ybrFull422ToRgb(i4, o2.getWidth())), s2.updatePlanarConfiguration && (i4 = l3.changePlanarConfiguration(i4, e2.BitsAllocated, e2.SamplesPerPixel, n.Planar));
26446
- const c2 = d2.fromDicomElements(e2);
26446
+ const c2 = d3.fromDicomElements(e2);
26447
26447
  c2.setDecodedBuffer(i4);
26448
- const m3 = p2[r7](c2, s2);
26448
+ const m3 = p[r7](c2, s2);
26449
26449
  let u3 = m3.getEncodedBuffer();
26450
26450
  u3.length % 2 != 0 && (u3 = h3.concatBuffers([u3, Uint8Array.from([0])])), a3.push(u3.buffer.slice(u3.byteOffset, u3.byteOffset + u3.byteLength)), Object.assign(e2, m3.toDicomElements());
26451
26451
  }
@@ -26454,9 +26454,9 @@ var require_dcmjs_codecs_min = __commonJS({
26454
26454
  _baseDecodeImpl(e2, t2, r7, s2 = {}) {
26455
26455
  const o2 = new c(e2, t2), i3 = o2.getNumberOfFrames(), a3 = [];
26456
26456
  for (let t3 = 0; t3 < i3; t3++) {
26457
- const i4 = o2.getFrameBuffer(t3), c2 = d2.fromDicomElements(e2);
26457
+ const i4 = o2.getFrameBuffer(t3), c2 = d3.fromDicomElements(e2);
26458
26458
  c2.setEncodedBuffer(i4);
26459
- const m3 = p2[r7](c2, s2);
26459
+ const m3 = p[r7](c2, s2);
26460
26460
  let u3 = m3.getDecodedBuffer();
26461
26461
  u3.length % 2 != 0 && (u3 = h3.concatBuffers([u3, Uint8Array.from([0])])), s2.updatePlanarConfiguration && (u3 = l3.changePlanarConfiguration(u3, e2.BitsAllocated, e2.SamplesPerPixel, n.Interleaved)), a3.push(u3.buffer.slice(u3.byteOffset, u3.byteOffset + u3.byteLength)), Object.assign(e2, m3.toDicomElements());
26462
26462
  }
@@ -26670,8 +26670,8 @@ var require_dcmjs_codecs_min = __commonJS({
26670
26670
  Object.freeze(l3);
26671
26671
  const c = { Sf444: 0, Sf422: 1, Unknown: 2 };
26672
26672
  Object.freeze(c);
26673
- const d2 = { Lrcp: 0, Rlcp: 1, Rpcl: 2, Pcrl: 3, Cprl: 4 };
26674
- Object.freeze(d2), e.exports = { ErrNo: l3, Implementation: n, Jpeg2000ProgressionOrder: d2, JpegSampleFactor: c, PhotometricInterpretation: s, PixelRepresentation: i2, PlanarConfiguration: o, StorageClass: a2, TranscodeMap: r6, TransferSyntax: t };
26673
+ const d3 = { Lrcp: 0, Rlcp: 1, Rpcl: 2, Pcrl: 3, Cprl: 4 };
26674
+ Object.freeze(d3), e.exports = { ErrNo: l3, Implementation: n, Jpeg2000ProgressionOrder: d3, JpegSampleFactor: c, PhotometricInterpretation: s, PixelRepresentation: i2, PlanarConfiguration: o, StorageClass: a2, TranscodeMap: r6, TransferSyntax: t };
26675
26675
  }, 547: (e, t, r6) => {
26676
26676
  const s = r6(213), o = r6(935);
26677
26677
  o.reg(s), s.enableAll(false), o.apply(s, { format: (e2, t2, r7) => `${r7} -- ${e2.toUpperCase()} --`, timestampFormatter: (e2) => e2.toISOString() }), e.exports = s;
@@ -26829,14 +26829,14 @@ var require_dcmjs_codecs_min = __commonJS({
26829
26829
  if (!e3 || !e3.setLevel) throw new TypeError("Argument is not a logger");
26830
26830
  var n2 = e3.methodFactory, a3 = e3.name || "", l3 = i2[a3] || i2[""] || o2;
26831
26831
  function c(e4, t3, r9) {
26832
- var s3 = n2(e4, t3, r9), o3 = i2[r9] || i2[""], l4 = -1 !== o3.template.indexOf("%t"), c2 = -1 !== o3.template.indexOf("%l"), d2 = -1 !== o3.template.indexOf("%n");
26832
+ var s3 = n2(e4, t3, r9), o3 = i2[r9] || i2[""], l4 = -1 !== o3.template.indexOf("%t"), c2 = -1 !== o3.template.indexOf("%l"), d3 = -1 !== o3.template.indexOf("%n");
26833
26833
  return function() {
26834
- for (var t4 = "", n3 = arguments.length, p2 = Array(n3), h3 = 0; h3 < n3; h3++) p2[h3] = arguments[h3];
26834
+ for (var t4 = "", n3 = arguments.length, p = Array(n3), h3 = 0; h3 < n3; h3++) p[h3] = arguments[h3];
26835
26835
  if (a3 || !i2[r9]) {
26836
26836
  var m2 = o3.timestampFormatter(/* @__PURE__ */ new Date()), u2 = o3.levelFormatter(e4), g2 = o3.nameFormatter(r9);
26837
- o3.format ? t4 += o3.format(u2, g2, m2) : (t4 += o3.template, l4 && (t4 = t4.replace(/%t/, m2)), c2 && (t4 = t4.replace(/%l/, u2)), d2 && (t4 = t4.replace(/%n/, g2))), p2.length && "string" == typeof p2[0] ? p2[0] = t4 + " " + p2[0] : p2.unshift(t4);
26837
+ o3.format ? t4 += o3.format(u2, g2, m2) : (t4 += o3.template, l4 && (t4 = t4.replace(/%t/, m2)), c2 && (t4 = t4.replace(/%l/, u2)), d3 && (t4 = t4.replace(/%n/, g2))), p.length && "string" == typeof p[0] ? p[0] = t4 + " " + p[0] : p.unshift(t4);
26838
26838
  }
26839
- s3.apply(void 0, p2);
26839
+ s3.apply(void 0, p);
26840
26840
  };
26841
26841
  }
26842
26842
  return i2[a3] || (e3.methodFactory = c), (r8 = r8 || {}).template && (r8.format = void 0), i2[a3] = s2({}, l3, r8), e3.setLevel(e3.getLevel()), t2 || e3.warn("It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"), e3;
@@ -29267,8 +29267,8 @@ var require_dcmjs_dimse_min = __commonJS({
29267
29267
  if (t3 !== a3.ImplicitVRLittleEndian && t3 !== a3.ExplicitVRLittleEndian && t3 !== a3.ExplicitVRBigEndian && true !== n2.isInitialized()) throw new Error("Transcoding is not initialized. Please call Transcoding.initializeAsync() first.");
29268
29268
  if (!r7.includes(e3.getTransferSyntaxUid()) || !r7.includes(t3)) throw new Error(`Transcoding dataset from ${this._transferSyntaxDescriptionFromValue(e3.getTransferSyntaxUid())} to ${this._transferSyntaxDescriptionFromValue(t3)} is not supported.`);
29269
29269
  c2.info(`Transcoding dataset from ${this._transferSyntaxDescriptionFromValue(e3.getTransferSyntaxUid())} to ${this._transferSyntaxDescriptionFromValue(t3)}...`);
29270
- const d3 = new i3(e3.getElements(), e3.getTransferSyntaxUid());
29271
- return d3.transcode(t3, s3), new o2(d3.getElements(), d3.getTransferSyntaxUid());
29270
+ const d4 = new i3(e3.getElements(), e3.getTransferSyntaxUid());
29271
+ return d4.transcode(t3, s3), new o2(d4.getElements(), d4.getTransferSyntaxUid());
29272
29272
  }
29273
29273
  static _transferSyntaxDescriptionFromValue(e3) {
29274
29274
  const t3 = Object.keys(a3).find((t4) => a3[t4] === e3);
@@ -29305,7 +29305,7 @@ var require_dcmjs_dimse_min = __commonJS({
29305
29305
  "use strict";
29306
29306
  e2.exports = t;
29307
29307
  }, 237: (e2, t2, s2) => {
29308
- const { Association: n2, PresentationContext: i3 } = s2(570), { Scp: r7, Server: a3 } = s2(538), { CCancelRequest: o2, CEchoRequest: c2, CEchoResponse: d3, CFindRequest: u2, CFindResponse: h3, CGetRequest: m2, CGetResponse: g2, CMoveRequest: l3, CMoveResponse: p2, CStoreRequest: R2, CStoreResponse: S2, NActionRequest: y3, NActionResponse: f3, NCreateRequest: I2, NCreateResponse: C2, NDeleteRequest: P, NDeleteResponse: A2, NEventReportRequest: v2, NEventReportResponse: x, NGetRequest: w2, NGetResponse: U, NSetRequest: q2, NSetResponse: D2 } = s2(940), { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: M2, RejectReason: B2, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j, TransferSyntax: V2, Uid: _2, UserIdentityType: G2 } = s2(492), z2 = s2(422), Q2 = s2(825), W2 = s2(139), J2 = s2(906), X2 = s2(73), H = { association: { Association: n2, PresentationContext: i3 }, Client: z2, constants: { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: M2, RejectReason: B2, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j, TransferSyntax: V2, Uid: _2, UserIdentityType: G2 }, Dataset: Q2, Implementation: W2, log: s2(547), requests: { CCancelRequest: o2, CEchoRequest: c2, CFindRequest: u2, CGetRequest: m2, CMoveRequest: l3, CStoreRequest: R2, NActionRequest: y3, NCreateRequest: I2, NDeleteRequest: P, NEventReportRequest: v2, NGetRequest: w2, NSetRequest: q2 }, responses: { CEchoResponse: d3, CFindResponse: h3, CGetResponse: g2, CMoveResponse: p2, CStoreResponse: S2, NActionResponse: f3, NCreateResponse: C2, NDeleteResponse: A2, NEventReportResponse: x, NGetResponse: U, NSetResponse: D2 }, Scp: r7, Server: a3, Statistics: J2, Transcoding: X2, version: s2(837) };
29308
+ const { Association: n2, PresentationContext: i3 } = s2(570), { Scp: r7, Server: a3 } = s2(538), { CCancelRequest: o2, CEchoRequest: c2, CEchoResponse: d4, CFindRequest: u2, CFindResponse: h3, CGetRequest: m2, CGetResponse: g2, CMoveRequest: l3, CMoveResponse: p, CStoreRequest: R2, CStoreResponse: S2, NActionRequest: y3, NActionResponse: f3, NCreateRequest: I2, NCreateResponse: C2, NDeleteRequest: P, NDeleteResponse: A2, NEventReportRequest: v2, NEventReportResponse: x, NGetRequest: w2, NGetResponse: U, NSetRequest: q2, NSetResponse: D2 } = s2(940), { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: M2, RejectReason: B2, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j, TransferSyntax: V2, Uid: _2, UserIdentityType: G2 } = s2(492), z2 = s2(422), Q2 = s2(825), W2 = s2(139), J2 = s2(906), X2 = s2(73), H = { association: { Association: n2, PresentationContext: i3 }, Client: z2, constants: { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: M2, RejectReason: B2, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j, TransferSyntax: V2, Uid: _2, UserIdentityType: G2 }, Dataset: Q2, Implementation: W2, log: s2(547), requests: { CCancelRequest: o2, CEchoRequest: c2, CFindRequest: u2, CGetRequest: m2, CMoveRequest: l3, CStoreRequest: R2, NActionRequest: y3, NCreateRequest: I2, NDeleteRequest: P, NEventReportRequest: v2, NGetRequest: w2, NSetRequest: q2 }, responses: { CEchoResponse: d4, CFindResponse: h3, CGetResponse: g2, CMoveResponse: p, CStoreResponse: S2, NActionResponse: f3, NCreateResponse: C2, NDeleteResponse: A2, NEventReportResponse: x, NGetResponse: U, NSetResponse: D2 }, Scp: r7, Server: a3, Statistics: J2, Transcoding: X2, version: s2(837) };
29309
29309
  e2.exports = H;
29310
29310
  }, 278: (e2) => {
29311
29311
  "use strict";
@@ -29314,7 +29314,7 @@ var require_dcmjs_dimse_min = __commonJS({
29314
29314
  "use strict";
29315
29315
  e2.exports = s;
29316
29316
  }, 371: (e2, t2, s2) => {
29317
- const { Association: n2 } = s2(570), { AAbort: i3, AAssociateAC: r7, AAssociateRJ: a3, AAssociateRQ: o2, AReleaseRP: c2, AReleaseRQ: d3, PDataTF: u2, Pdv: h3, RawPdu: m2 } = s2(942), { CommandFieldType: g2, RawPduType: l3, Status: p2 } = s2(492), { CCancelRequest: R2, CEchoRequest: S2, CEchoResponse: y3, CFindRequest: f3, CFindResponse: I2, CGetRequest: C2, CGetResponse: P, CMoveRequest: A2, CMoveResponse: v2, Command: x, CStoreRequest: w2, CStoreResponse: U, NActionRequest: q2, NActionResponse: D2, NCreateRequest: E2, NCreateResponse: T, NDeleteRequest: b2, NDeleteResponse: O2, NEventReportRequest: N2, NEventReportResponse: M2, NGetRequest: B2, NGetResponse: L2, NSetRequest: F2, NSetResponse: k2, Response: $ } = s2(940), j = s2(825), V2 = s2(139), _2 = s2(906), G2 = s2(73), z2 = s2(547), { SmartBuffer: Q2 } = s2(766), { EOL: W2 } = s2(857), J2 = s2(733), X2 = s2(235);
29317
+ const { Association: n2 } = s2(570), { AAbort: i3, AAssociateAC: r7, AAssociateRJ: a3, AAssociateRQ: o2, AReleaseRP: c2, AReleaseRQ: d4, PDataTF: u2, Pdv: h3, RawPdu: m2 } = s2(942), { CommandFieldType: g2, RawPduType: l3, Status: p } = s2(492), { CCancelRequest: R2, CEchoRequest: S2, CEchoResponse: y3, CFindRequest: f3, CFindResponse: I2, CGetRequest: C2, CGetResponse: P, CMoveRequest: A2, CMoveResponse: v2, Command: x, CStoreRequest: w2, CStoreResponse: U, NActionRequest: q2, NActionResponse: D2, NCreateRequest: E2, NCreateResponse: T, NDeleteRequest: b2, NDeleteResponse: O2, NEventReportRequest: N2, NEventReportResponse: M2, NGetRequest: B2, NGetResponse: L2, NSetRequest: F2, NSetResponse: k2, Response: $ } = s2(940), j = s2(825), V2 = s2(139), _2 = s2(906), G2 = s2(73), z2 = s2(547), { SmartBuffer: Q2 } = s2(766), { EOL: W2 } = s2(857), J2 = s2(733), X2 = s2(235);
29318
29318
  class H extends J2 {
29319
29319
  constructor() {
29320
29320
  super();
@@ -29367,7 +29367,7 @@ var require_dcmjs_dimse_min = __commonJS({
29367
29367
  z2.info(`${this.logId} -> Association reject ${n3.toString()}`), this._sendPdu(i4);
29368
29368
  }
29369
29369
  sendAssociationReleaseRequest() {
29370
- const e3 = new d3().write();
29370
+ const e3 = new d4().write();
29371
29371
  z2.info(`${this.logId} -> Association release request`), this._sendPdu(e3);
29372
29372
  }
29373
29373
  sendAssociationReleaseResponse() {
@@ -29488,7 +29488,7 @@ var require_dcmjs_dimse_min = __commonJS({
29488
29488
  break;
29489
29489
  }
29490
29490
  case l3.AReleaseRQ:
29491
- new d3().read(t3), z2.info(`${this.logId} <- Association release request`), this.emit("associationReleaseRequested");
29491
+ new d4().read(t3), z2.info(`${this.logId} <- Association release request`), this.emit("associationReleaseRequested");
29492
29492
  break;
29493
29493
  case l3.AReleaseRP:
29494
29494
  new c2().read(t3), z2.info(`${this.logId} <- Association release response`), this.emit("associationReleaseResponse");
@@ -29606,7 +29606,7 @@ var require_dcmjs_dimse_min = __commonJS({
29606
29606
  _performDimse(e3, t3) {
29607
29607
  if (t3 instanceof $) {
29608
29608
  const e4 = Object.assign(Object.create(Object.getPrototypeOf(t3)), t3), s3 = this.pending.find((e5) => e5.getMessageId() === t3.getMessageIdBeingRespondedTo());
29609
- s3 && (s3.raiseResponseEvent(e4), e4.getStatus() !== p2.Pending && s3.raiseDoneEvent());
29609
+ s3 && (s3.raiseResponseEvent(e4), e4.getStatus() !== p.Pending && s3.raiseDoneEvent());
29610
29610
  } else t3.getCommandFieldType() === g2.CEchoRequest ? this.emit("cEchoRequest", t3, (t4) => {
29611
29611
  this._sendDimse({ context: e3, command: t4 });
29612
29612
  }) : t3.getCommandFieldType() === g2.CFindRequest ? this.emit("cFindRequest", t3, (t4) => {
@@ -29671,10 +29671,10 @@ var require_dcmjs_dimse_min = __commonJS({
29671
29671
  }
29672
29672
  };
29673
29673
  }, 422: (e2, t2, s2) => {
29674
- const { Association: n2, PresentationContext: i3 } = s2(570), { TransferSyntax: r7, UserIdentityType: a3 } = s2(492), { Request: o2 } = s2(940), c2 = s2(371), d3 = s2(906), u2 = s2(547), h3 = s2(733), m2 = s2(278), g2 = s2(756);
29674
+ const { Association: n2, PresentationContext: i3 } = s2(570), { TransferSyntax: r7, UserIdentityType: a3 } = s2(492), { Request: o2 } = s2(940), c2 = s2(371), d4 = s2(906), u2 = s2(547), h3 = s2(733), m2 = s2(278), g2 = s2(756);
29675
29675
  e2.exports = class extends h3 {
29676
29676
  constructor() {
29677
- super(), this.requests = [], this.additionalPresentationContexts = [], this.network = void 0, this.statistics = new d3();
29677
+ super(), this.requests = [], this.additionalPresentationContexts = [], this.network = void 0, this.statistics = new d4();
29678
29678
  }
29679
29679
  addRequest(e3) {
29680
29680
  if (!(e3 instanceof o2)) throw new Error(`${e3.toString()} is not a request`);
@@ -29689,37 +29689,37 @@ var require_dcmjs_dimse_min = __commonJS({
29689
29689
  }
29690
29690
  send(e3, t3, s3, i4, o3) {
29691
29691
  if (o3 = o3 || {}, this.associationLingerTimeout = o3.associationLingerTimeout || 0, 0 === this.requests.length) throw new Error("There are no requests to perform");
29692
- const d4 = new n2(s3, i4);
29693
- o3.asyncOps && (d4.setMaxAsyncOpsInvoked(o3.asyncOps.maxAsyncOpsInvoked || 1), d4.setMaxAsyncOpsPerformed(o3.asyncOps.maxAsyncOpsPerformed || 1), d4.setNegotiateAsyncOps(1 !== d4.getMaxAsyncOpsInvoked() || 1 !== d4.getMaxAsyncOpsPerformed())), o3.userIdentity && (d4.setUserIdentityType(o3.userIdentity.type || a3.Username), d4.setUserIdentityPositiveResponseRequested(o3.userIdentity.positiveResponseRequested || false), d4.setUserIdentityPrimaryField(o3.userIdentity.primaryField || ""), d4.setUserIdentitySecondaryField(o3.userIdentity.secondaryField || ""), d4.setNegotiateUserIdentity(true)), this.requests.forEach((e4) => {
29694
- d4.addPresentationContextFromRequest(e4, [r7.ImplicitVRLittleEndian, r7.ExplicitVRLittleEndian]);
29692
+ const d5 = new n2(s3, i4);
29693
+ o3.asyncOps && (d5.setMaxAsyncOpsInvoked(o3.asyncOps.maxAsyncOpsInvoked || 1), d5.setMaxAsyncOpsPerformed(o3.asyncOps.maxAsyncOpsPerformed || 1), d5.setNegotiateAsyncOps(1 !== d5.getMaxAsyncOpsInvoked() || 1 !== d5.getMaxAsyncOpsPerformed())), o3.userIdentity && (d5.setUserIdentityType(o3.userIdentity.type || a3.Username), d5.setUserIdentityPositiveResponseRequested(o3.userIdentity.positiveResponseRequested || false), d5.setUserIdentityPrimaryField(o3.userIdentity.primaryField || ""), d5.setUserIdentitySecondaryField(o3.userIdentity.secondaryField || ""), d5.setNegotiateUserIdentity(true)), this.requests.forEach((e4) => {
29694
+ d5.addPresentationContextFromRequest(e4, [r7.ImplicitVRLittleEndian, r7.ExplicitVRLittleEndian]);
29695
29695
  }), this.additionalPresentationContexts.forEach((e4) => {
29696
- const t4 = e4.addAsNew ? d4.addPresentationContext(e4.context.getAbstractSyntaxUid()) : d4.addOrGetPresentationContext(e4.context.getAbstractSyntaxUid());
29696
+ const t4 = e4.addAsNew ? d5.addPresentationContext(e4.context.getAbstractSyntaxUid()) : d5.addOrGetPresentationContext(e4.context.getAbstractSyntaxUid());
29697
29697
  e4.context.getTransferSyntaxUids().forEach((e5) => {
29698
- d4.addTransferSyntaxToPresentationContext(t4, e5);
29698
+ d5.addTransferSyntaxToPresentationContext(t4, e5);
29699
29699
  });
29700
29700
  });
29701
29701
  let h4 = {};
29702
29702
  o3.securityOptions && (h4 = { key: o3.securityOptions.key, cert: o3.securityOptions.cert, ca: o3.securityOptions.ca, requestCert: o3.securityOptions.requestCert, rejectUnauthorized: o3.securityOptions.rejectUnauthorized, minVersion: o3.securityOptions.minVersion, maxVersion: o3.securityOptions.maxVersion, ciphers: o3.securityOptions.ciphers }), u2.info(`Connecting to ${e3}:${t3} ${o3.securityOptions ? "(TLS)" : ""}`);
29703
- const l3 = (o3.securityOptions ? g2 : m2).connect({ host: e3, port: t3, ...h4 }), p2 = new c2(l3, o3);
29704
- p2.on("connect", () => {
29705
- this.emit("connected"), p2.sendAssociationRequest(d4);
29706
- }), p2.on("associationAccepted", (e4) => {
29707
- this.emit("associationAccepted", e4), p2.sendRequests(this.requests);
29708
- }), p2.on("associationReleaseResponse", () => {
29703
+ const l3 = (o3.securityOptions ? g2 : m2).connect({ host: e3, port: t3, ...h4 }), p = new c2(l3, o3);
29704
+ p.on("connect", () => {
29705
+ this.emit("connected"), p.sendAssociationRequest(d5);
29706
+ }), p.on("associationAccepted", (e4) => {
29707
+ this.emit("associationAccepted", e4), p.sendRequests(this.requests);
29708
+ }), p.on("associationReleaseResponse", () => {
29709
29709
  this.emit("associationReleased"), l3.end();
29710
- }), p2.on("associationRejected", (e4) => {
29710
+ }), p.on("associationRejected", (e4) => {
29711
29711
  this.emit("associationRejected", e4), l3.end();
29712
- }), p2.on("done", () => {
29713
- setTimeout(() => p2.sendAssociationReleaseRequest(), this.associationLingerTimeout);
29714
- }), p2.on("cStoreRequest", (e4, t4) => {
29712
+ }), p.on("done", () => {
29713
+ setTimeout(() => p.sendAssociationReleaseRequest(), this.associationLingerTimeout);
29714
+ }), p.on("cStoreRequest", (e4, t4) => {
29715
29715
  this.emit("cStoreRequest", e4, t4);
29716
- }), p2.on("nEventReportRequest", (e4, t4) => {
29716
+ }), p.on("nEventReportRequest", (e4, t4) => {
29717
29717
  this.emit("nEventReportRequest", e4, t4);
29718
- }), p2.on("networkError", (e4) => {
29718
+ }), p.on("networkError", (e4) => {
29719
29719
  l3.end(), this.emit("networkError", e4);
29720
- }), p2.on("close", () => {
29721
- this.statistics.addFromOtherStatistics(p2.getStatistics()), this.network = void 0, this.emit("closed");
29722
- }), this.network = p2;
29720
+ }), p.on("close", () => {
29721
+ this.statistics.addFromOtherStatistics(p.getStatistics()), this.network = void 0, this.emit("closed");
29722
+ }), this.network = p;
29723
29723
  }
29724
29724
  getStatistics() {
29725
29725
  return this.statistics;
@@ -29753,8 +29753,8 @@ var require_dcmjs_dimse_min = __commonJS({
29753
29753
  Object.freeze(o2);
29754
29754
  const c2 = { ServiceUser: 1, ServiceProviderAcse: 2, ServiceProviderPresentation: 3 };
29755
29755
  Object.freeze(c2);
29756
- const d3 = { NoReasonGiven: 1, ApplicationContextNotSupported: 2, CallingAeNotRecognized: 3, CalledAeNotRecognized: 7, ProtocolVersionNotSupported: 2, TemporaryCongestion: 1, LocalLimitExceeded: 2 };
29757
- Object.freeze(d3);
29756
+ const d4 = { NoReasonGiven: 1, ApplicationContextNotSupported: 2, CallingAeNotRecognized: 3, CalledAeNotRecognized: 7, ProtocolVersionNotSupported: 2, TemporaryCongestion: 1, LocalLimitExceeded: 2 };
29757
+ Object.freeze(d4);
29758
29758
  const u2 = { Low: 2, Medium: 0, High: 1 };
29759
29759
  Object.freeze(u2);
29760
29760
  const h3 = { Success: 0, Cancel: 65024, Pending: 65280, ClassInstanceConflict: 281, DataSetSopClassMismatch: 43264, DuplicateSOPInstance: 273, DuplicateInvocation: 528, InvalidArgumentValue: 277, InvalidAttributeValue: 262, InvalidObjectInstance: 279, MissingAttribute: 288, MissingAttributeValue: 289, MistypedArgument: 530, MoveDestinationUnknown: 43009, NoSuchActionType: 291, NoSuchArgument: 276, NoSuchEventType: 275, NoSuchObjectInstance: 274, NoSuchSopClass: 280, NotAuthorized: 292, OutOfResourcesNumberOfMatches: 42753, OutOfResourcesSubOperations: 42754, ProcessingFailure: 272, ResourceLimitation: 531, SopClassNotSupported: 290, UnrecognizedOperation: 529 };
@@ -29765,14 +29765,14 @@ var require_dcmjs_dimse_min = __commonJS({
29765
29765
  Object.freeze(g2);
29766
29766
  const l3 = { Verification: "1.2.840.10008.1.1", StudyRootQueryRetrieveInformationModelFind: "1.2.840.10008.5.1.4.1.2.2.1", ModalityWorklistInformationModelFind: "1.2.840.10008.5.1.4.31", ModalityPerformedProcedureStep: "1.2.840.10008.3.1.2.3.3", StudyRootQueryRetrieveInformationModelMove: "1.2.840.10008.5.1.4.1.2.2.2", StudyRootQueryRetrieveInformationModelGet: "1.2.840.10008.5.1.4.1.2.2.3", StorageCommitmentPushModel: "1.2.840.10008.1.20.1", BasicFilmSession: "1.2.840.10008.5.1.1.1", PrintJob: "1.2.840.10008.5.1.1.14", BasicAnnotationBox: "1.2.840.10008.5.1.1.15", Printer: "1.2.840.10008.5.1.1.16", PrinterConfigurationRetrieval: "1.2.840.10008.5.1.1.16.376", BasicGrayscalePrintManagementMeta: "1.2.840.10008.5.1.1.9", BasicColorPrintManagementMeta: "1.2.840.10008.5.1.1.18", BasicFilmBox: "1.2.840.10008.5.1.1.2", PresentationLut: "1.2.840.10008.5.1.1.23", BasicGrayscaleImageBox: "1.2.840.10008.5.1.1.4", BasicColorImageBox: "1.2.840.10008.5.1.1.4.1", InstanceAvailabilityNotification: "1.2.840.10008.5.1.4.33" };
29767
29767
  Object.freeze(l3);
29768
- const p2 = { ImplicitVRLittleEndian: "1.2.840.10008.1.2", ExplicitVRLittleEndian: "1.2.840.10008.1.2.1", DeflatedExplicitVRLittleEndian: "1.2.840.10008.1.2.1.99", ExplicitVRBigEndian: "1.2.840.10008.1.2.2", RleLossless: "1.2.840.10008.1.2.5", JpegBaseline: "1.2.840.10008.1.2.4.50", JpegLossless: "1.2.840.10008.1.2.4.70", JpegLsLossless: "1.2.840.10008.1.2.4.80", JpegLsLossy: "1.2.840.10008.1.2.4.81", Jpeg2000Lossless: "1.2.840.10008.1.2.4.90", Jpeg2000Lossy: "1.2.840.10008.1.2.4.91", JpegXlLossless: "1.2.840.10008.1.2.4.110", JpegXlRecompression: "1.2.840.10008.1.2.4.111", JpegXl: "1.2.840.10008.1.2.4.112", HtJpeg2000Lossless: "1.2.840.10008.1.2.4.201", HtJpeg2000LosslessRpcl: "1.2.840.10008.1.2.4.202", HtJpeg2000Lossy: "1.2.840.10008.1.2.4.203" };
29769
- Object.freeze(p2);
29770
- const R2 = [p2.ImplicitVRLittleEndian, p2.ExplicitVRLittleEndian, p2.ExplicitVRBigEndian, p2.RleLossless, p2.JpegBaseline, p2.JpegLossless, p2.JpegLsLossless, p2.JpegLsLossy, p2.Jpeg2000Lossless, p2.Jpeg2000Lossy, p2.HtJpeg2000Lossless, p2.HtJpeg2000LosslessRpcl, p2.HtJpeg2000Lossy];
29768
+ const p = { ImplicitVRLittleEndian: "1.2.840.10008.1.2", ExplicitVRLittleEndian: "1.2.840.10008.1.2.1", DeflatedExplicitVRLittleEndian: "1.2.840.10008.1.2.1.99", ExplicitVRBigEndian: "1.2.840.10008.1.2.2", RleLossless: "1.2.840.10008.1.2.5", JpegBaseline: "1.2.840.10008.1.2.4.50", JpegLossless: "1.2.840.10008.1.2.4.70", JpegLsLossless: "1.2.840.10008.1.2.4.80", JpegLsLossy: "1.2.840.10008.1.2.4.81", Jpeg2000Lossless: "1.2.840.10008.1.2.4.90", Jpeg2000Lossy: "1.2.840.10008.1.2.4.91", JpegXlLossless: "1.2.840.10008.1.2.4.110", JpegXlRecompression: "1.2.840.10008.1.2.4.111", JpegXl: "1.2.840.10008.1.2.4.112", HtJpeg2000Lossless: "1.2.840.10008.1.2.4.201", HtJpeg2000LosslessRpcl: "1.2.840.10008.1.2.4.202", HtJpeg2000Lossy: "1.2.840.10008.1.2.4.203" };
29769
+ Object.freeze(p);
29770
+ const R2 = [p.ImplicitVRLittleEndian, p.ExplicitVRLittleEndian, p.ExplicitVRBigEndian, p.RleLossless, p.JpegBaseline, p.JpegLossless, p.JpegLsLossless, p.JpegLsLossy, p.Jpeg2000Lossless, p.Jpeg2000Lossy, p.HtJpeg2000Lossless, p.HtJpeg2000LosslessRpcl, p.HtJpeg2000Lossy];
29771
29771
  Object.freeze(R2);
29772
29772
  const S2 = { ImplementationClassUid: "1.2.826.0.1.3680043.10.854", ImplementationVersion: "DCMJS-DIMSE-V0.2", MaxPduLength: 262144 };
29773
- Object.freeze(S2), e2.exports = { AbortReason: a3, AbortSource: r7, CommandFieldType: s2, DefaultImplementation: S2, PresentationContextResult: n2, Priority: u2, RawPduType: t2, RejectReason: d3, RejectResult: o2, RejectSource: c2, SopClass: l3, Status: h3, StorageClass: g2, TranscodableTransferSyntaxes: R2, TransferSyntax: p2, Uid: m2, UserIdentityType: i3 };
29773
+ Object.freeze(S2), e2.exports = { AbortReason: a3, AbortSource: r7, CommandFieldType: s2, DefaultImplementation: S2, PresentationContextResult: n2, Priority: u2, RawPduType: t2, RejectReason: d4, RejectResult: o2, RejectSource: c2, SopClass: l3, Status: h3, StorageClass: g2, TranscodableTransferSyntaxes: R2, TransferSyntax: p, Uid: m2, UserIdentityType: i3 };
29774
29774
  }, 538: (e2, t2, s2) => {
29775
- const { CEchoResponse: n2, CFindResponse: i3, CGetResponse: r7, CMoveResponse: a3, CStoreResponse: o2, NActionResponse: c2, NCreateResponse: d3, NDeleteResponse: u2, NEventReportResponse: h3, NGetResponse: m2, NSetResponse: g2 } = s2(940), l3 = s2(371), p2 = s2(906), R2 = s2(547), S2 = s2(733), y3 = s2(278), f3 = s2(756);
29775
+ const { CEchoResponse: n2, CFindResponse: i3, CGetResponse: r7, CMoveResponse: a3, CStoreResponse: o2, NActionResponse: c2, NCreateResponse: d4, NDeleteResponse: u2, NEventReportResponse: h3, NGetResponse: m2, NSetResponse: g2 } = s2(940), l3 = s2(371), p = s2(906), R2 = s2(547), S2 = s2(733), y3 = s2(278), f3 = s2(756);
29776
29776
  e2.exports = { Scp: class extends l3 {
29777
29777
  constructor(e3, t3) {
29778
29778
  super(e3, t3), this.on("associationRequested", (e4) => {
@@ -29835,7 +29835,7 @@ var require_dcmjs_dimse_min = __commonJS({
29835
29835
  R2.error("cGetRequest method must be implemented"), t3(r7.fromRequest(e3));
29836
29836
  }
29837
29837
  nCreateRequest(e3, t3) {
29838
- R2.error("nCreateRequest method must be implemented"), t3(d3.fromRequest(e3));
29838
+ R2.error("nCreateRequest method must be implemented"), t3(d4.fromRequest(e3));
29839
29839
  }
29840
29840
  nActionRequest(e3, t3) {
29841
29841
  R2.error("nActionRequest method must be implemented"), t3(c2.fromRequest(e3));
@@ -29860,7 +29860,7 @@ var require_dcmjs_dimse_min = __commonJS({
29860
29860
  }
29861
29861
  }, Server: class extends S2 {
29862
29862
  constructor(e3) {
29863
- super(), this.scp = { class: e3 }, this.server = void 0, this.clients = [], this.statistics = new p2();
29863
+ super(), this.scp = { class: e3 }, this.server = void 0, this.clients = [], this.statistics = new p();
29864
29864
  }
29865
29865
  listen(e3, t3) {
29866
29866
  let s3 = {};
@@ -29892,7 +29892,7 @@ var require_dcmjs_dimse_min = __commonJS({
29892
29892
  const n2 = s2(360), i3 = s2(707);
29893
29893
  i3.reg(n2), n2.enableAll(false), i3.apply(n2, { format: (e3, t3, s3) => `${s3} -- ${e3.toUpperCase()} --`, timestampFormatter: (e3) => e3.toISOString() }), e2.exports = n2;
29894
29894
  }, 570: (e2, t2, s2) => {
29895
- const { CGetRequest: n2, CStoreRequest: i3 } = s2(940), { CommandFieldType: r7, PresentationContextResult: a3, SopClass: o2, StorageClass: c2, TransferSyntax: d3, Uid: u2, UserIdentityType: h3 } = s2(492), m2 = s2(139), { EOL: g2 } = s2(857);
29895
+ const { CGetRequest: n2, CStoreRequest: i3 } = s2(940), { CommandFieldType: r7, PresentationContextResult: a3, SopClass: o2, StorageClass: c2, TransferSyntax: d4, Uid: u2, UserIdentityType: h3 } = s2(492), m2 = s2(139), { EOL: g2 } = s2(857);
29896
29896
  class l3 {
29897
29897
  constructor(e3, t3, s3, n3) {
29898
29898
  this.pcId = e3, this.abstractSyntaxUid = t3, this.transferSyntaxes = [], s3 && this.transferSyntaxes.push(s3), this.result = n3 || a3.Proposed;
@@ -30087,7 +30087,7 @@ var require_dcmjs_dimse_min = __commonJS({
30087
30087
  this.presentationContexts.length = 0;
30088
30088
  }
30089
30089
  addPresentationContextFromRequest(e3, t3) {
30090
- let s3 = t3 || d3.ImplicitVRLittleEndian;
30090
+ let s3 = t3 || d4.ImplicitVRLittleEndian;
30091
30091
  s3 = Array.isArray(s3) ? s3 : [s3];
30092
30092
  const r8 = this._sopClassFromRequest(e3);
30093
30093
  let a4;
@@ -30098,7 +30098,7 @@ var require_dcmjs_dimse_min = __commonJS({
30098
30098
  this.addTransferSyntaxToPresentationContext(a4, e4);
30099
30099
  });
30100
30100
  const t4 = e3.getDataset().getTransferSyntaxUid();
30101
- t4 !== d3.ImplicitVRLittleEndian && t4 !== d3.ExplicitVRLittleEndian && (a4 = this.findPresentationContextByAbstractSyntaxAndTransferSyntax(r8, t4), void 0 === a4 && (a4 = this.addPresentationContext(r8), this.addTransferSyntaxToPresentationContext(a4, t4)));
30101
+ t4 !== d4.ImplicitVRLittleEndian && t4 !== d4.ExplicitVRLittleEndian && (a4 = this.findPresentationContextByAbstractSyntaxAndTransferSyntax(r8, t4), void 0 === a4 && (a4 = this.addPresentationContext(r8), this.addTransferSyntaxToPresentationContext(a4, t4)));
30102
30102
  } else e3 instanceof n2 ? (a4 = this.addOrGetPresentationContext(r8), s3.forEach((e4) => {
30103
30103
  this.addTransferSyntaxToPresentationContext(a4, e4);
30104
30104
  }), true === e3.getAddStorageSopClassesToAssociation() && Object.keys(c2).forEach((e4) => {
@@ -30127,7 +30127,7 @@ var require_dcmjs_dimse_min = __commonJS({
30127
30127
  return e3.push(`Application Context: ${this.getApplicationContextName()}`), e3.push(`Implementation Class: ${this.getImplementationClassUid()}`), e3.push(`Implementation Version: ${this.getImplementationVersion()}`), e3.push(`Maximum PDU Length: ${this.getMaxPduLength()}`), e3.push(`Called AE Title: ${this.getCalledAeTitle()}`), e3.push(`Calling AE Title: ${this.getCallingAeTitle()}`), this.getNegotiateAsyncOps() && e3.push(`Asynchronous Operations: Invoked: ${this.getMaxAsyncOpsInvoked()} Performed:${this.getMaxAsyncOpsPerformed()}`), this.getNegotiateUserIdentity() && e3.push(`User Identity: ${this._userIdentityTypeToString(this.getUserIdentityType()) || ""}`), e3.push(`Presentation Contexts: ${this.presentationContexts.length}`), this.presentationContexts.forEach((t3) => {
30128
30128
  const s3 = this.getPresentationContext(t3.id);
30129
30129
  e3.push(` Presentation Context: ${t3.id} [${s3.getResultDescription()}]`), e3.push(` Abstract: ${this._uidNameFromValue([o2, c2], s3.getAbstractSyntaxUid()) || s3.getAbstractSyntaxUid()}`), s3.getTransferSyntaxUids().forEach((t4) => {
30130
- e3.push(` Transfer: ${this._uidNameFromValue(d3, t4) || t4}`);
30130
+ e3.push(` Transfer: ${this._uidNameFromValue(d4, t4) || t4}`);
30131
30131
  });
30132
30132
  }), e3.push(""), e3.join(g2);
30133
30133
  }
@@ -30188,7 +30188,7 @@ var require_dcmjs_dimse_min = __commonJS({
30188
30188
  "use strict";
30189
30189
  e2.exports = o;
30190
30190
  }, 825: (e2, t2, s2) => {
30191
- const { StorageClass: n2, TransferSyntax: i3 } = s2(492), r7 = s2(139), { readFile: a3, readFileSync: o2, writeFile: c2, writeFileSync: d3 } = s2(896), { EOL: u2 } = s2(857), h3 = s2(111), { DicomDict: m2, DicomMessage: g2, DicomMetaDictionary: l3, ReadBufferStream: p2, WriteBufferStream: R2 } = h3.data, S2 = h3.log;
30191
+ const { StorageClass: n2, TransferSyntax: i3 } = s2(492), r7 = s2(139), { readFile: a3, readFileSync: o2, writeFile: c2, writeFileSync: d4 } = s2(896), { EOL: u2 } = s2(857), h3 = s2(111), { DicomDict: m2, DicomMessage: g2, DicomMetaDictionary: l3, ReadBufferStream: p, WriteBufferStream: R2 } = h3.data, S2 = h3.log;
30192
30192
  class y3 {
30193
30193
  constructor(e3, t3, s3) {
30194
30194
  s3 = s3 || {}, s3 = { ignoreErrors: true, ...s3 }, S2.level = "error", this.transferSyntaxUid = t3 || i3.ImplicitVRLittleEndian, Buffer.isBuffer(e3) ? this.elements = this._fromElementsBuffer(e3, this.transferSyntaxUid, s3) : this.elements = e3 || {};
@@ -30231,7 +30231,7 @@ var require_dcmjs_dimse_min = __commonJS({
30231
30231
  const a4 = { _meta: { FileMetaInformationVersion: new Uint8Array([0, 1]).buffer, MediaStorageSOPClassUID: this.getElement("SOPClassUID") || n2.SecondaryCaptureImageStorage, MediaStorageSOPInstanceUID: this.getElement("SOPInstanceUID") || y3.generateDerivedUid(), TransferSyntaxUID: this.getTransferSyntaxUid(), ImplementationClassUID: r7.getImplementationClassUid(), ImplementationVersionName: r7.getImplementationVersion() }, ...this.getElements() }, o3 = l3.denaturalizeDataset(a4._meta), u3 = new m2(o3);
30232
30232
  u3.dict = s3 ? l3.denaturalizeDataset(a4, { ...l3.nameMap, ...s3 }) : l3.denaturalizeDataset(a4), t3 instanceof Function ? c2(e3, Buffer.from(u3.write(i4)), (e4) => {
30233
30233
  t3(e4 || void 0);
30234
- }) : d3(e3, Buffer.from(u3.write(i4)));
30234
+ }) : d4(e3, Buffer.from(u3.write(i4)));
30235
30235
  }
30236
30236
  static generateDerivedUid() {
30237
30237
  return l3.uid();
@@ -30246,7 +30246,7 @@ var require_dcmjs_dimse_min = __commonJS({
30246
30246
  return new y3(i4, n3);
30247
30247
  }
30248
30248
  _fromElementsBuffer(e3, t3, s3) {
30249
- const n3 = new p2(e3.buffer.slice(e3.byteOffset, e3.byteOffset + e3.byteLength)), r8 = t3 === i3.ImplicitVRLittleEndian ? i3.ImplicitVRLittleEndian : t3 === i3.ExplicitVRBigEndian ? i3.ExplicitVRBigEndian : i3.ExplicitVRLittleEndian, a4 = g2._read(n3, r8, s3);
30249
+ const n3 = new p(e3.buffer.slice(e3.byteOffset, e3.byteOffset + e3.byteLength)), r8 = t3 === i3.ImplicitVRLittleEndian ? i3.ImplicitVRLittleEndian : t3 === i3.ExplicitVRBigEndian ? i3.ExplicitVRBigEndian : i3.ExplicitVRLittleEndian, a4 = g2._read(n3, r8, s3);
30250
30250
  return l3.naturalizeDataset(a4);
30251
30251
  }
30252
30252
  }
@@ -30292,7 +30292,7 @@ var require_dcmjs_dimse_min = __commonJS({
30292
30292
  }
30293
30293
  };
30294
30294
  }, 940: (e2, t2, s2) => {
30295
- const { CommandFieldType: n2, Priority: i3, SopClass: r7, Status: a3 } = s2(492), o2 = s2(825), { Mixin: c2 } = s2(429), { EOL: d3 } = s2(857), u2 = s2(733), h3 = s2(111), { DicomMetaDictionary: m2 } = h3.data;
30295
+ const { CommandFieldType: n2, Priority: i3, SopClass: r7, Status: a3 } = s2(492), o2 = s2(825), { Mixin: c2 } = s2(429), { EOL: d4 } = s2(857), u2 = s2(733), h3 = s2(111), { DicomMetaDictionary: m2 } = h3.data;
30296
30296
  class g2 {
30297
30297
  constructor(e3, t3) {
30298
30298
  this.commandDataset = e3 || new o2(), this.dataset = t3;
@@ -30317,7 +30317,7 @@ var require_dcmjs_dimse_min = __commonJS({
30317
30317
  }
30318
30318
  toString(e3) {
30319
30319
  const t3 = e3 || {}, s3 = t3.includeCommandDataset || false, n3 = t3.includeDataset || false, i4 = [];
30320
- return i4.push(`${this._typeToString(this.getCommandFieldType())} [HasDataset: ${this.hasDataset()}]`), s3 && (i4.push("DIMSE Command Dataset:"), i4.push("=".repeat(50)), i4.push(JSON.stringify(this.commandDataset.getElements()))), n3 && this.dataset && (i4.push("DIMSE Dataset:"), i4.push("=".repeat(50)), i4.push(JSON.stringify(this.dataset.getElements()))), i4.join(d3);
30320
+ return i4.push(`${this._typeToString(this.getCommandFieldType())} [HasDataset: ${this.hasDataset()}]`), s3 && (i4.push("DIMSE Command Dataset:"), i4.push("=".repeat(50)), i4.push(JSON.stringify(this.commandDataset.getElements()))), n3 && this.dataset && (i4.push("DIMSE Dataset:"), i4.push("=".repeat(50)), i4.push(JSON.stringify(this.dataset.getElements()))), i4.join(d4);
30321
30321
  }
30322
30322
  _typeToString(e3) {
30323
30323
  switch (e3) {
@@ -30435,7 +30435,7 @@ var require_dcmjs_dimse_min = __commonJS({
30435
30435
  return `${super.toString(e3)} [id: ${this.getMessageId() || ""}]`;
30436
30436
  }
30437
30437
  }
30438
- class p2 extends g2 {
30438
+ class p extends g2 {
30439
30439
  constructor(e3, t3, s3, i4, r8) {
30440
30440
  switch (super(new o2({ CommandField: e3, CommandDataSetType: s3 ? 514 : 257, Status: i4, ErrorComment: r8 })), e3) {
30441
30441
  case n2.NGetRequest:
@@ -30547,7 +30547,7 @@ var require_dcmjs_dimse_min = __commonJS({
30547
30547
  super(n2.CEchoRequest, r7.Verification, false);
30548
30548
  }
30549
30549
  }
30550
- class S2 extends p2 {
30550
+ class S2 extends p {
30551
30551
  constructor(e3, t3) {
30552
30552
  super(n2.CEchoResponse, r7.Verification, false, e3, t3);
30553
30553
  }
@@ -30592,7 +30592,7 @@ var require_dcmjs_dimse_min = __commonJS({
30592
30592
  return n3.setAffectedSopClassUid(r7.ModalityWorklistInformationModelFind), n3.setDataset(new o2(s3)), n3;
30593
30593
  }
30594
30594
  }
30595
- class f3 extends p2 {
30595
+ class f3 extends p {
30596
30596
  constructor(e3, t3) {
30597
30597
  super(n2.CFindResponse, r7.StudyRootQueryRetrieveInformationModelFind, false, e3, t3);
30598
30598
  }
@@ -30627,7 +30627,7 @@ var require_dcmjs_dimse_min = __commonJS({
30627
30627
  void 0 !== this.needsFullDatasetLoading && true === this.needsFullDatasetLoading && void 0 !== this.datasetOrFile && "" !== this.datasetOrFile.trim() && this.setDataset(o2.fromFile(this.datasetOrFile));
30628
30628
  }
30629
30629
  }
30630
- class C2 extends p2 {
30630
+ class C2 extends p {
30631
30631
  constructor(e3, t3) {
30632
30632
  super(n2.CStoreResponse, "", false, e3, t3);
30633
30633
  }
@@ -30660,7 +30660,7 @@ var require_dcmjs_dimse_min = __commonJS({
30660
30660
  return a4.setDataset(new o2(r8)), a4.getCommandDataset().setElement("MoveDestination", e3), a4;
30661
30661
  }
30662
30662
  }
30663
- class A2 extends p2 {
30663
+ class A2 extends p {
30664
30664
  constructor(e3, t3) {
30665
30665
  super(n2.CMoveResponse, r7.StudyRootQueryRetrieveInformationModelMove, false, e3, t3);
30666
30666
  }
@@ -30726,7 +30726,7 @@ var require_dcmjs_dimse_min = __commonJS({
30726
30726
  return r8.setDataset(new o2(i4)), r8;
30727
30727
  }
30728
30728
  }
30729
- class x extends p2 {
30729
+ class x extends p {
30730
30730
  constructor(e3, t3) {
30731
30731
  super(n2.CGetResponse, r7.StudyRootQueryRetrieveInformationModelGet, false, e3, t3);
30732
30732
  }
@@ -30768,7 +30768,7 @@ var require_dcmjs_dimse_min = __commonJS({
30768
30768
  super(n2.NCreateRequest, e3, false), this.setAffectedSopInstanceUid(t3), this.setMetaSopClassUid(s3);
30769
30769
  }
30770
30770
  }
30771
- class U extends p2 {
30771
+ class U extends p {
30772
30772
  constructor(e3, t3, s3, i4) {
30773
30773
  super(n2.NCreateResponse, e3, false, s3, i4), this.setAffectedSopInstanceUid(t3);
30774
30774
  }
@@ -30789,7 +30789,7 @@ var require_dcmjs_dimse_min = __commonJS({
30789
30789
  this.getCommandDataset().setElement("ActionTypeID", e3);
30790
30790
  }
30791
30791
  }
30792
- class D2 extends p2 {
30792
+ class D2 extends p {
30793
30793
  constructor(e3, t3, s3, i4, r8) {
30794
30794
  super(n2.NActionResponse, e3, false, i4, r8), this.setAffectedSopInstanceUid(t3), this.setActionTypeId(s3);
30795
30795
  }
@@ -30810,7 +30810,7 @@ var require_dcmjs_dimse_min = __commonJS({
30810
30810
  super(n2.NDeleteRequest, e3, false), this.setRequestedSopInstanceUid(t3), this.setMetaSopClassUid(s3);
30811
30811
  }
30812
30812
  }
30813
- class T extends p2 {
30813
+ class T extends p {
30814
30814
  constructor(e3, t3, s3, i4) {
30815
30815
  super(n2.NDeleteResponse, e3, false, s3, i4), this.setAffectedSopInstanceUid(t3);
30816
30816
  }
@@ -30831,7 +30831,7 @@ var require_dcmjs_dimse_min = __commonJS({
30831
30831
  this.getCommandDataset().setElement("EventTypeID", e3);
30832
30832
  }
30833
30833
  }
30834
- class O2 extends p2 {
30834
+ class O2 extends p {
30835
30835
  constructor(e3, t3, s3, i4, r8) {
30836
30836
  super(n2.NEventReportResponse, e3, false, i4, r8), this.setAffectedSopInstanceUid(t3), this.setEventTypeId(s3);
30837
30837
  }
@@ -30873,7 +30873,7 @@ var require_dcmjs_dimse_min = __commonJS({
30873
30873
  return "0".repeat(t3 - s3.length) + s3;
30874
30874
  }
30875
30875
  }
30876
- class M2 extends p2 {
30876
+ class M2 extends p {
30877
30877
  constructor(e3, t3, s3, i4) {
30878
30878
  super(n2.NGetResponse, e3, false, s3, i4), this.setAffectedSopInstanceUid(t3);
30879
30879
  }
@@ -30888,7 +30888,7 @@ var require_dcmjs_dimse_min = __commonJS({
30888
30888
  super(n2.NSetRequest, e3, false), this.setRequestedSopInstanceUid(t3), this.setMetaSopClassUid(s3);
30889
30889
  }
30890
30890
  }
30891
- class L2 extends p2 {
30891
+ class L2 extends p {
30892
30892
  constructor(e3, t3, s3, i4) {
30893
30893
  super(n2.NSetResponse, e3, false, s3, i4), this.setAffectedSopInstanceUid(t3);
30894
30894
  }
@@ -30913,9 +30913,9 @@ var require_dcmjs_dimse_min = __commonJS({
30913
30913
  return new F2(e3.getAffectedSopClassUid(), e3.getMessageId());
30914
30914
  }
30915
30915
  }
30916
- e2.exports = { CCancelRequest: F2, CEchoRequest: R2, CEchoResponse: S2, CFindRequest: y3, CFindResponse: f3, CGetRequest: v2, CGetResponse: x, CMoveRequest: P, CMoveResponse: A2, Command: g2, CStoreRequest: I2, CStoreResponse: C2, NActionRequest: q2, NActionResponse: D2, NCreateRequest: w2, NCreateResponse: U, NDeleteRequest: E2, NDeleteResponse: T, NEventReportRequest: b2, NEventReportResponse: O2, NGetRequest: N2, NGetResponse: M2, NSetRequest: B2, NSetResponse: L2, Request: l3, Response: p2 };
30916
+ e2.exports = { CCancelRequest: F2, CEchoRequest: R2, CEchoResponse: S2, CFindRequest: y3, CFindResponse: f3, CGetRequest: v2, CGetResponse: x, CMoveRequest: P, CMoveResponse: A2, Command: g2, CStoreRequest: I2, CStoreResponse: C2, NActionRequest: q2, NActionResponse: D2, NCreateRequest: w2, NCreateResponse: U, NDeleteRequest: E2, NDeleteResponse: T, NEventReportRequest: b2, NEventReportResponse: O2, NGetRequest: N2, NGetResponse: M2, NSetRequest: B2, NSetResponse: L2, Request: l3, Response: p };
30917
30917
  }, 942: (e2, t2, s2) => {
30918
- const { AbortReason: n2, AbortSource: i3, RawPduType: r7, RejectReason: a3, RejectResult: o2, RejectSource: c2, TransferSyntax: d3 } = s2(492), { SmartBuffer: u2 } = s2(766), { EOL: h3 } = s2(857);
30918
+ const { AbortReason: n2, AbortSource: i3, RawPduType: r7, RejectReason: a3, RejectResult: o2, RejectSource: c2, TransferSyntax: d4 } = s2(492), { SmartBuffer: u2 } = s2(766), { EOL: h3 } = s2(857);
30919
30919
  class m2 {
30920
30920
  constructor(e3) {
30921
30921
  if (this.m16 = [], this.m32 = [], Buffer.isBuffer(e3)) return this.buffer = u2.fromBuffer(e3, "ascii"), void (this.type = this.buffer.readUInt8());
@@ -31101,7 +31101,7 @@ var require_dcmjs_dimse_min = __commonJS({
31101
31101
  const e3 = new m2(r7.AAssociateAC);
31102
31102
  return e3.writeUInt16("Version", 1), e3.writeByteMultiple("Reserved", 0, 2), e3.writeStringWithPadding("Called AE", this.association.getCalledAeTitle(), 16, " "), e3.writeStringWithPadding("Calling AE", this.association.getCallingAeTitle(), 16, " "), e3.writeByteMultiple("Reserved", 0, 32), e3.writeByte("Item-Type", 16), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeString("Application Context Name", this.association.getApplicationContextName()), e3.writeLength16(), this.association.getPresentationContexts().forEach((t3) => {
31103
31103
  const s3 = this.association.getPresentationContext(t3.id);
31104
- e3.writeByte("Item-Type", 33), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeByte("Presentation Context ID", s3.getPresentationContextId()), e3.writeByte("Reserved", 0), e3.writeByte("Result", s3.getResult()), e3.writeByte("Reserved", 0), e3.writeByte("Item-Type", 64), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeString("Transfer Syntax UID", s3.getAcceptedTransferSyntaxUid() || d3.ImplicitVRLittleEndian), e3.writeLength16(), e3.writeLength16();
31104
+ e3.writeByte("Item-Type", 33), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeByte("Presentation Context ID", s3.getPresentationContextId()), e3.writeByte("Reserved", 0), e3.writeByte("Result", s3.getResult()), e3.writeByte("Reserved", 0), e3.writeByte("Item-Type", 64), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeString("Transfer Syntax UID", s3.getAcceptedTransferSyntaxUid() || d4.ImplicitVRLittleEndian), e3.writeLength16(), e3.writeLength16();
31105
31105
  }), e3.writeByte("Item-Type", 80), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeByte("Item-Type", 81), e3.writeByte("Reserved", 0), e3.writeUInt16("Item-Length", 4), e3.writeUInt32("Max PDU Length", this.association.getMaxPduLength()), e3.writeByte("Item-Type", 82), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeString("Implementation Class UID", this.association.getImplementationClassUid()), e3.writeLength16(), !this.association.getNegotiateAsyncOps() || 1 === this.association.getMaxAsyncOpsInvoked() && 1 === this.association.getMaxAsyncOpsPerformed() || (e3.writeByte("Item-Type", 83), e3.writeByte("Reserved", 0), e3.writeUInt16("Item-Length", 4), e3.writeUInt16("Asynchronous Operations Invoked", this.association.getMaxAsyncOpsInvoked()), e3.writeUInt16("Asynchronous Operations Performed", this.association.getMaxAsyncOpsPerformed())), e3.writeByte("Item-Type", 85), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeString("Implementation Version", this.association.getImplementationVersion()), e3.writeLength16(), this.association.getNegotiateUserIdentityServerResponse() && (e3.writeByte("Item-Type", 89), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.markLength16("Server Response-Length"), e3.writeString("Server Response", this.association.getUserIdentityServerResponse()), e3.writeLength16(), e3.writeLength16()), e3.writeLength16(), e3;
31106
31106
  }
31107
31107
  read(e3) {
@@ -31343,13 +31343,13 @@ var require_dcmjs_dimse_min = __commonJS({
31343
31343
  return `(P-DATA-TF) [PDV count: ${this.getPdvCount()}, PDV length: ${this.getLengthOfPdvs()}]`;
31344
31344
  }
31345
31345
  }, Pdv: g2, RawPdu: m2 };
31346
- } }, d2 = {}, function e2(t2) {
31347
- var s2 = d2[t2];
31346
+ } }, d3 = {}, function e2(t2) {
31347
+ var s2 = d3[t2];
31348
31348
  if (void 0 !== s2) return s2.exports;
31349
- var n2 = d2[t2] = { exports: {} };
31349
+ var n2 = d3[t2] = { exports: {} };
31350
31350
  return c[t2](n2, n2.exports, e2), n2.exports;
31351
31351
  }(237);
31352
- var c, d2;
31352
+ var c, d3;
31353
31353
  });
31354
31354
  }
31355
31355
  });
@@ -31496,38 +31496,41 @@ function y(r6) {
31496
31496
  function Tn(r6) {
31497
31497
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "exception", details: { text: "Internal server error" }, diagnostics: r6.toString() }] };
31498
31498
  }
31499
+ function ao(r6) {
31500
+ return !r6 || typeof r6 != "object" ? false : r6 instanceof Error || typeof DOMException < "u" && r6 instanceof DOMException ? true : Object.prototype.toString.call(r6) === "[object Error]";
31501
+ }
31499
31502
  function Ae(r6) {
31500
31503
  return typeof r6 == "object" && r6 !== null && r6.resourceType === "OperationOutcome";
31501
31504
  }
31502
- function dr(r6) {
31505
+ function pr(r6) {
31503
31506
  return r6.id === nr || r6.id === it || r6.id === or || r6.id === ot;
31504
31507
  }
31505
- var p = class extends Error {
31508
+ var d = class extends Error {
31506
31509
  constructor(e, t) {
31507
31510
  super(Sn(e)), this.outcome = e, this.cause = t;
31508
31511
  }
31509
31512
  };
31510
31513
  function st(r6) {
31511
- return r6 instanceof p ? r6.outcome : Ae(r6) ? r6 : b(Oe(r6));
31514
+ return r6 instanceof d ? r6.outcome : Ae(r6) ? r6 : b(Oe(r6));
31512
31515
  }
31513
31516
  function Oe(r6) {
31514
- return r6 ? typeof r6 == "string" ? r6 : r6 instanceof Error ? r6.message : Ae(r6) ? Sn(r6) : typeof r6 == "object" && "code" in r6 && typeof r6.code == "string" ? r6.code : JSON.stringify(r6) : "Unknown error";
31517
+ return r6 ? typeof r6 == "string" ? r6 : ao(r6) ? r6.message : Ae(r6) ? Sn(r6) : typeof r6 == "object" && "code" in r6 && typeof r6.code == "string" ? r6.code : JSON.stringify(r6) : "Unknown error";
31515
31518
  }
31516
31519
  function Sn(r6) {
31517
- let e = r6.issue?.map(ao) ?? [];
31520
+ let e = r6.issue?.map(co) ?? [];
31518
31521
  return e.length > 0 ? e.join("; ") : "Unknown error";
31519
31522
  }
31520
- function ao(r6) {
31523
+ function co(r6) {
31521
31524
  let e;
31522
31525
  return r6.details?.text ? r6.diagnostics ? e = `${r6.details.text} (${r6.diagnostics})` : e = r6.details.text : r6.diagnostics ? e = r6.diagnostics : e = "Unknown error", r6.expression?.length && (e += ` (${r6.expression.join(", ")})`), e;
31523
31526
  }
31524
- function uo(r6, e) {
31527
+ function lo(r6, e) {
31525
31528
  let t = e.max && e.max === Number.MAX_SAFE_INTEGER ? Number.POSITIVE_INFINITY : e.max;
31526
31529
  return { path: r6, description: "", type: e.type ?? [], min: e.min ?? 0, max: t ?? 1, isArray: !!t && t > 1, constraints: [] };
31527
31530
  }
31528
31531
  function Rn(r6) {
31529
31532
  let e = /* @__PURE__ */ Object.create(null);
31530
- for (let [t, n] of Object.entries(r6)) e[t] = { name: t, type: t, path: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i2, o]) => [i2, uo(i2, o)])), constraints: [], innerTypes: [] };
31533
+ for (let [t, n] of Object.entries(r6)) e[t] = { name: t, type: t, path: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i2, o]) => [i2, lo(i2, o)])), constraints: [], innerTypes: [] };
31531
31534
  return e;
31532
31535
  }
31533
31536
  var Cn = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, DataRequirementCodeFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, DosageDoseAndRate: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { type: [{ code: "CodeableConcept" }] }, "dose[x]": { type: [{ code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, "rate[x]": { type: [{ code: "Ratio" }, { code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, ElementDefinitionSlicingDiscriminator: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionSlicing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, discriminator: { max: 9007199254740991, type: [{ code: "ElementDefinitionSlicingDiscriminator" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionBase: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: 9007199254740991, type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, label: { min: 1, type: [{ code: "string" }] }, "value[x]": { min: 1, type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, ElementDefinitionConstraint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, key: { min: 1, type: [{ code: "id" }] }, requirements: { type: [{ code: "string" }] }, severity: { min: 1, type: [{ code: "code" }] }, human: { min: 1, type: [{ code: "string" }] }, expression: { type: [{ code: "string" }] }, xpath: { type: [{ code: "string" }] }, source: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, ElementDefinitionBinding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, strength: { min: 1, type: [{ code: "code" }] }, description: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] } } }, ElementDefinitionMapping: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, accounts: { max: 9007199254740991, type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, SubstanceAmountReferenceRange: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "bounds[x]": { type: [{ code: "Duration" }, { code: "Range" }, { code: "Period" }] }, count: { type: [{ code: "positiveInt" }] }, countMax: { type: [{ code: "positiveInt" }] }, duration: { type: [{ code: "decimal" }] }, durationMax: { type: [{ code: "decimal" }] }, durationUnit: { type: [{ code: "code" }] }, frequency: { type: [{ code: "positiveInt" }] }, frequencyMax: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "decimal" }] }, periodMax: { type: [{ code: "decimal" }] }, periodUnit: { type: [{ code: "code" }] }, dayOfWeek: { max: 9007199254740991, type: [{ code: "code" }] }, timeOfDay: { max: 9007199254740991, type: [{ code: "time" }] }, when: { max: 9007199254740991, type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
@@ -31537,7 +31540,7 @@ function mr(r6) {
31537
31540
  var fe = Rn(Cn);
31538
31541
  var yr = /* @__PURE__ */ Object.create(null);
31539
31542
  var Pn = /* @__PURE__ */ Object.create(null);
31540
- var po = { "http://hl7.org/fhir/StructureDefinition/MoneyQuantity": "MoneyQuantity", "http://hl7.org/fhir/StructureDefinition/SimpleQuantity": "SimpleQuantity", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition": "ViewDefinition" };
31543
+ var fo = { "http://hl7.org/fhir/StructureDefinition/MoneyQuantity": "MoneyQuantity", "http://hl7.org/fhir/StructureDefinition/SimpleQuantity": "SimpleQuantity", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition": "ViewDefinition" };
31541
31544
  function In(r6) {
31542
31545
  let e;
31543
31546
  return e = Pn[r6], e || (e = Pn[r6] = /* @__PURE__ */ Object.create(null)), e;
@@ -31550,7 +31553,7 @@ function gr(r6) {
31550
31553
  function xr(r6) {
31551
31554
  if (!r6?.name) throw new Error("Failed loading StructureDefinition from bundle");
31552
31555
  if (r6.resourceType !== "StructureDefinition") return;
31553
- let e = mr(r6), t = po[r6.url], n, i2;
31556
+ let e = mr(r6), t = fo[r6.url], n, i2;
31554
31557
  t ? (n = fe, i2 = t) : r6.url === `http://hl7.org/fhir/StructureDefinition/${r6.type}` || r6.url === `https://medplum.com/fhir/StructureDefinition/${r6.type}` || r6.type?.startsWith("http://") || r6.type?.startsWith("https://") ? (n = fe, i2 = r6.type) : (n = In(r6.url), i2 = r6.type), n[i2] = e;
31555
31558
  for (let o of e.innerTypes) o.parentType = e, n[o.name] = o;
31556
31559
  yr[r6.url] = e;
@@ -31571,7 +31574,7 @@ function Mn(r6) {
31571
31574
  var fr = class {
31572
31575
  constructor(e) {
31573
31576
  if (!e.snapshot?.element || e.snapshot.element.length === 0) throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);
31574
- this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, version: e.version, kind: e.kind, description: yo(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
31577
+ this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, version: e.version, kind: e.kind, description: go(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
31575
31578
  }
31576
31579
  parse() {
31577
31580
  let e = this.next();
@@ -31579,7 +31582,7 @@ var fr = class {
31579
31582
  if (e.sliceName) this.parseSliceStart(e);
31580
31583
  else if (e.id?.includes(":")) {
31581
31584
  if (this.slicingContext?.current) {
31582
- let t = pr(e, this.slicingContext.path);
31585
+ let t = dr(e, this.slicingContext.path);
31583
31586
  this.slicingContext.current.elements[t] = this.parseElementDefinition(e);
31584
31587
  }
31585
31588
  } else {
@@ -31588,13 +31591,13 @@ var fr = class {
31588
31591
  let n = this.backboneContext;
31589
31592
  for (; n; ) {
31590
31593
  if (e.path?.startsWith(n.path + ".")) {
31591
- n.type.elements[pr(e, n.path)] = t;
31594
+ n.type.elements[dr(e, n.path)] = t;
31592
31595
  break;
31593
31596
  }
31594
31597
  n = n.parent;
31595
31598
  }
31596
31599
  if (!n) {
31597
- let i2 = pr(e, this.root.path);
31600
+ let i2 = dr(e, this.root.path);
31598
31601
  e.isSummary && this.resourceSchema.summaryProperties?.add(i2.replace("[x]", "")), t.min > 0 && this.resourceSchema.mandatoryProperties?.add(i2.replace("[x]", "")), this.resourceSchema.elements[i2] = t;
31599
31602
  }
31600
31603
  this.checkFieldExit(e);
@@ -31612,7 +31615,7 @@ var fr = class {
31612
31615
  this.backboneContext = { type: { name: t, type: t, path: e.path, title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path, parent: Ie(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
31613
31616
  }
31614
31617
  enterSlice(e, t) {
31615
- mo(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
31618
+ yo(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
31616
31619
  if (n.type !== "value" && n.type !== "pattern" && n.type !== "type") throw new Error(`Unsupported slicing discriminator type: ${n.type}`);
31617
31620
  return { path: n.path, type: n.type };
31618
31621
  }), slices: [], ordered: e.slicing?.ordered ?? false, rule: e.slicing?.rules }, this.slicingContext = { field: t.slicing, path: e.path ?? "" });
@@ -31659,10 +31662,10 @@ var fr = class {
31659
31662
  function An(r6) {
31660
31663
  return r6 === "*" ? Number.POSITIVE_INFINITY : Number.parseInt(r6, 10);
31661
31664
  }
31662
- function pr(r6, e = "") {
31663
- return ho(r6.path, e);
31665
+ function dr(r6, e = "") {
31666
+ return mo(r6.path, e);
31664
31667
  }
31665
- function ho(r6, e) {
31668
+ function mo(r6, e) {
31666
31669
  return r6 ? e && r6.startsWith(e) ? r6.substring(e.length + 1) : r6 : "";
31667
31670
  }
31668
31671
  function Ie(r6, e) {
@@ -31671,15 +31674,15 @@ function Ie(r6, e) {
31671
31674
  function On(r6) {
31672
31675
  return Array.isArray(r6) && r6.length > 0 ? r6[0] : S(r6) ? void 0 : r6;
31673
31676
  }
31674
- function mo(r6) {
31677
+ function yo(r6) {
31675
31678
  let e = r6.slicing?.discriminator;
31676
31679
  return !!(r6.type?.some((t) => t.code === "Extension") && e?.length === 1 && e[0].type === "value" && e[0].path === "url");
31677
31680
  }
31678
- function yo(r6) {
31681
+ function go(r6) {
31679
31682
  let e = r6.description;
31680
31683
  return e?.startsWith(`Base StructureDefinition for ${r6.name} Type: `) && (e = e.substring(`Base StructureDefinition for ${r6.name} Type: `.length)), e;
31681
31684
  }
31682
- var vo = new Pe(1e3);
31685
+ var To = new Pe(1e3);
31683
31686
  var ut = { base64Binary: /^([A-Za-z\d+/]{4})*([A-Za-z\d+/]{2}==|[A-Za-z\d+/]{3}=)?$/, canonical: /^\S*$/, code: /^[^\s]+( [^\s]+)*$/, date: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1]))?)?$/, dateTime: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1])(T([01]\d|2[0-3])(:[0-5]\d:([0-5]\d|60)(\.\d{1,9})?)?)?)?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00)?)?)?$/, id: /^[A-Za-z0-9\-.]{1,64}$/, instant: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2]\d|3[0-1])T([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00))$/, markdown: /^[\r\n\t\u0020-\uFFFF]+$/, oid: /^urn:oid:[0-2](\.(0|[1-9]\d*))+$/, string: /^[\r\n\t\u0020-\uFFFF]+$/, time: /^([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?$/, uri: /^\S*$/, url: /^\S*$/, uuid: /^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, xhtml: /.*/ };
31684
31687
  function h(r6) {
31685
31688
  return [{ type: l.boolean, value: r6 }];
@@ -31699,29 +31702,29 @@ function G(r6, e) {
31699
31702
  function C(r6, e, t) {
31700
31703
  if (!r6.value) return;
31701
31704
  let n = ft(r6.type, e, t?.profileUrl);
31702
- return n ? Po(r6, e, n) : wo(r6, e);
31705
+ return n ? wo(r6, e, n) : Ao(r6, e);
31703
31706
  }
31704
- function Po(r6, e, t) {
31707
+ function wo(r6, e, t) {
31705
31708
  let n = r6.value, i2 = t.type;
31706
31709
  if (!i2 || i2.length === 0) return;
31707
31710
  let o, s = "undefined", a2, c = t.path.lastIndexOf("."), u2 = t.path.substring(c + 1);
31708
- for (let d2 of i2) {
31709
- let m2 = u2.replace("[x]", I(d2.code));
31711
+ for (let p of i2) {
31712
+ let m2 = u2.replace("[x]", I(p.code));
31710
31713
  if (o = n[m2], a2 = n["_" + m2], o !== void 0 || a2 !== void 0) {
31711
- s = d2.code;
31714
+ s = p.code;
31712
31715
  break;
31713
31716
  }
31714
31717
  }
31715
31718
  if (a2) if (Array.isArray(o)) {
31716
31719
  o = o.slice();
31717
- for (let d2 = 0; d2 < Math.max(o.length, a2.length); d2++) o[d2] = Wn(o[d2], a2[d2]);
31720
+ for (let p = 0; p < Math.max(o.length, a2.length); p++) o[p] = Wn(o[p], a2[p]);
31718
31721
  } else o = Wn(o, a2);
31719
- if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((d2) => Fn(d2, s)) : Fn(o, s);
31722
+ if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((p) => Fn(p, s)) : Fn(o, s);
31720
31723
  }
31721
31724
  function Fn(r6, e) {
31722
31725
  return e === "Resource" && A(r6) && (e = r6.resourceType), { type: e, value: r6 };
31723
31726
  }
31724
- function wo(r6, e) {
31727
+ function Ao(r6, e) {
31725
31728
  let t = r6.value;
31726
31729
  if (!t || typeof t != "object") return;
31727
31730
  let n;
@@ -31770,9 +31773,9 @@ function $e(r6, e) {
31770
31773
  return typeof t == "number" && typeof n == "number" ? h(Math.abs(t - n) < 1e-8) : k(t) && k(n) ? h(Hn(t, n)) : h(typeof t == "object" && typeof n == "object" ? wr(r6, e) : t === n);
31771
31774
  }
31772
31775
  function Pr(r6, e) {
31773
- return r6.length === 0 && e.length === 0 ? h(true) : r6.length !== e.length ? h(false) : (r6.sort(Nn), e.sort(Nn), h(r6.every((t, n) => _(Ao(t, e[n])))));
31776
+ return r6.length === 0 && e.length === 0 ? h(true) : r6.length !== e.length ? h(false) : (r6.sort(Nn), e.sort(Nn), h(r6.every((t, n) => _(Oo(t, e[n])))));
31774
31777
  }
31775
- function Ao(r6, e) {
31778
+ function Oo(r6, e) {
31776
31779
  let { type: t, value: n } = r6, { type: i2, value: o } = e, s = n?.valueOf(), a2 = o?.valueOf();
31777
31780
  return typeof s == "number" && typeof a2 == "number" ? h(Math.abs(s - a2) < 0.01) : k(s) && k(a2) ? h(Hn(s, a2)) : h(t === "Coding" && i2 === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? wr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
31778
31781
  }
@@ -31780,7 +31783,7 @@ function Nn(r6, e) {
31780
31783
  let t = r6.value?.valueOf(), n = e.value?.valueOf();
31781
31784
  return typeof t == "number" && typeof n == "number" ? t - n : typeof t == "string" && typeof n == "string" ? t.localeCompare(n) : 0;
31782
31785
  }
31783
- function dt(r6, e) {
31786
+ function pt(r6, e) {
31784
31787
  let { value: t } = r6;
31785
31788
  if (t == null) return false;
31786
31789
  let n = e;
@@ -31797,7 +31800,7 @@ function dt(r6, e) {
31797
31800
  case "Time":
31798
31801
  return typeof t == "string" && !!/^T\d/.exec(t);
31799
31802
  case "Period":
31800
- return pt(t);
31803
+ return dt(t);
31801
31804
  case "Quantity":
31802
31805
  return k(t);
31803
31806
  default:
@@ -31810,7 +31813,7 @@ function Gn(r6) {
31810
31813
  function De(r6) {
31811
31814
  return typeof r6 == "string" && !!ut.dateTime.exec(r6);
31812
31815
  }
31813
- function pt(r6) {
31816
+ function dt(r6) {
31814
31817
  return !!(r6 && typeof r6 == "object" && ("start" in r6 && De(r6.start) || "end" in r6 && De(r6.end)));
31815
31818
  }
31816
31819
  function k(r6) {
@@ -31836,18 +31839,18 @@ function Bn(r6) {
31836
31839
  function Wn(r6, e) {
31837
31840
  if (e) {
31838
31841
  if (typeof e != "object") throw new Error("Primitive extension must be an object");
31839
- return Oo(r6 ?? {}, e);
31842
+ return Io(r6 ?? {}, e);
31840
31843
  }
31841
31844
  return r6;
31842
31845
  }
31843
- function Oo(r6, e) {
31846
+ function Io(r6, e) {
31844
31847
  return delete e.__proto__, delete e.constructor, Object.assign(r6, e);
31845
31848
  }
31846
31849
  function kr(r6, e) {
31847
31850
  return A(r6, e) && "id" in r6 && typeof r6.id == "string";
31848
31851
  }
31849
31852
  function he(r6) {
31850
- let e = B(r6) ?? "undefined/undefined", t = ko(r6);
31853
+ let e = B(r6) ?? "undefined/undefined", t = Do(r6);
31851
31854
  return t === e ? { reference: e } : { reference: e, display: t };
31852
31855
  }
31853
31856
  function B(r6) {
@@ -31857,16 +31860,16 @@ function B(r6) {
31857
31860
  function me(r6) {
31858
31861
  if (r6) return X(r6) ? r6.reference.split("/")[1] : r6.id;
31859
31862
  }
31860
- function Io(r6) {
31863
+ function ko(r6) {
31861
31864
  return r6.resourceType === "Patient" || r6.resourceType === "Practitioner" || r6.resourceType === "RelatedPerson";
31862
31865
  }
31863
- function ko(r6) {
31864
- if (Io(r6)) {
31865
- let e = Do(r6);
31866
+ function Do(r6) {
31867
+ if (ko(r6)) {
31868
+ let e = Vo(r6);
31866
31869
  if (e) return e;
31867
31870
  }
31868
31871
  if (r6.resourceType === "Device") {
31869
- let e = Vo(r6);
31872
+ let e = Mo(r6);
31870
31873
  if (e) return e;
31871
31874
  }
31872
31875
  if (r6.resourceType === "MedicationRequest" && r6.medicationCodeableConcept) return Ge(r6.medicationCodeableConcept);
@@ -31876,15 +31879,15 @@ function ko(r6) {
31876
31879
  if ("code" in r6 && r6.code) {
31877
31880
  let e = r6.code;
31878
31881
  if (Array.isArray(e) && (e = e[0]), Or(e)) return Ge(e);
31879
- if (Wo(e)) return e.text;
31882
+ if (qo(e)) return e.text;
31880
31883
  }
31881
31884
  return B(r6) ?? "";
31882
31885
  }
31883
- function Do(r6) {
31886
+ function Vo(r6) {
31884
31887
  let e = r6.name;
31885
31888
  if (e && e.length > 0) return He(e[0]);
31886
31889
  }
31887
- function Vo(r6) {
31890
+ function Mo(r6) {
31888
31891
  let e = r6.deviceName;
31889
31892
  if (e && e.length > 0) return e[0].name;
31890
31893
  }
@@ -31893,12 +31896,12 @@ function ht(r6, e) {
31893
31896
  t.setUTCHours(0, 0, 0, 0);
31894
31897
  let n = e ? new Date(e) : /* @__PURE__ */ new Date();
31895
31898
  n.setUTCHours(0, 0, 0, 0);
31896
- let i2 = t.getUTCFullYear(), o = t.getUTCMonth(), s = t.getUTCDate(), a2 = n.getUTCFullYear(), c = n.getUTCMonth(), u2 = n.getUTCDate(), d2 = a2 - i2;
31897
- (c < o || c === o && u2 < s) && d2--;
31899
+ let i2 = t.getUTCFullYear(), o = t.getUTCMonth(), s = t.getUTCDate(), a2 = n.getUTCFullYear(), c = n.getUTCMonth(), u2 = n.getUTCDate(), p = a2 - i2;
31900
+ (c < o || c === o && u2 < s) && p--;
31898
31901
  let m2 = a2 * 12 + c - (i2 * 12 + o);
31899
31902
  u2 < s && m2--;
31900
31903
  let x = Math.floor((n.getTime() - t.getTime()) / (1e3 * 60 * 60 * 24));
31901
- return { years: d2, months: m2, days: x };
31904
+ return { years: p, months: m2, days: x };
31902
31905
  }
31903
31906
  function ne(r6, ...e) {
31904
31907
  let t = r6;
@@ -31910,9 +31913,9 @@ function mt(r6, e) {
31910
31913
  return JSON.stringify(t, null, e ? 2 : void 0) ?? "";
31911
31914
  }
31912
31915
  function Dr(r6) {
31913
- if (!(r6 == null || r6 === "")) return typeof r6 == "object" ? Array.isArray(r6) ? _o(r6) : Lo(r6) : r6;
31916
+ if (!(r6 == null || r6 === "")) return typeof r6 == "object" ? Array.isArray(r6) ? Lo(r6) : Fo(r6) : r6;
31914
31917
  }
31915
- function _o(r6) {
31918
+ function Lo(r6) {
31916
31919
  let e = r6.length;
31917
31920
  if (e === 0) return;
31918
31921
  let t, n = 0;
@@ -31922,7 +31925,7 @@ function _o(r6) {
31922
31925
  }
31923
31926
  if (n !== 0) return t ?? r6;
31924
31927
  }
31925
- function Lo(r6) {
31928
+ function Fo(r6) {
31926
31929
  let e, t = 0;
31927
31930
  for (let n in r6) {
31928
31931
  let i2 = r6[n], o = Dr(i2);
@@ -31941,14 +31944,14 @@ function Y(r6) {
31941
31944
  return e === "string" && r6 !== "" || e === "object" && ("length" in r6 && r6.length > 0 || Object.keys(r6).length > 0);
31942
31945
  }
31943
31946
  function ie(r6, e, t) {
31944
- return r6 === e || S(r6) && S(e) ? true : S(r6) || S(e) ? false : Array.isArray(r6) && Array.isArray(e) ? Fo(r6, e) : Array.isArray(r6) || Array.isArray(e) ? false : E(r6) && E(e) ? No(r6, e, t) : (E(r6) || E(e), false);
31947
+ return r6 === e || S(r6) && S(e) ? true : S(r6) || S(e) ? false : Array.isArray(r6) && Array.isArray(e) ? No(r6, e) : Array.isArray(r6) || Array.isArray(e) ? false : E(r6) && E(e) ? Uo(r6, e, t) : (E(r6) || E(e), false);
31945
31948
  }
31946
- function Fo(r6, e) {
31949
+ function No(r6, e) {
31947
31950
  if (r6.length !== e.length) return false;
31948
31951
  for (let t = 0; t < r6.length; t++) if (!ie(r6[t], e[t])) return false;
31949
31952
  return true;
31950
31953
  }
31951
- function No(r6, e, t) {
31954
+ function Uo(r6, e, t) {
31952
31955
  let n = /* @__PURE__ */ new Set();
31953
31956
  Object.keys(r6).forEach((i2) => n.add(i2)), Object.keys(e).forEach((i2) => n.add(i2)), t === "meta" && (n.delete("versionId"), n.delete("lastUpdated"), n.delete("author"));
31954
31957
  for (let i2 of n) {
@@ -31972,7 +31975,7 @@ function Ar(r6) {
31972
31975
  function Or(r6) {
31973
31976
  return E(r6) && "coding" in r6 && Array.isArray(r6.coding) && r6.coding.every(Ar);
31974
31977
  }
31975
- function Wo(r6) {
31978
+ function qo(r6) {
31976
31979
  return E(r6) && "text" in r6 && typeof r6.text == "string";
31977
31980
  }
31978
31981
  var Xn = [];
@@ -32002,11 +32005,11 @@ function yt(r6) {
32002
32005
  function Fr(r6) {
32003
32006
  return r6.endsWith("/") ? r6 : r6 + "/";
32004
32007
  }
32005
- function zo(r6) {
32008
+ function Jo(r6) {
32006
32009
  return r6.startsWith("/") ? r6.slice(1) : r6;
32007
32010
  }
32008
32011
  function W(r6, e) {
32009
- return new URL(zo(e), Fr(r6.toString())).toString();
32012
+ return new URL(Jo(e), Fr(r6.toString())).toString();
32010
32013
  }
32011
32014
  function ii(r6, e) {
32012
32015
  return W(r6, e).toString().replace("http://", "ws://").replace("https://", "wss://");
@@ -32014,9 +32017,9 @@ function ii(r6, e) {
32014
32017
  function oi(r6) {
32015
32018
  return typeof r6 == "object" && !Array.isArray(r6) && !(r6 instanceof URLSearchParams) && (r6 = Object.fromEntries(Object.entries(r6).filter((e) => e[1] !== void 0))), new URLSearchParams(r6).toString();
32016
32019
  }
32017
- var Jo = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-_]*[A-Za-z0-9])$/;
32018
- function El(r6) {
32019
- return Jo.test(r6);
32020
+ var Ko = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-_]*[A-Za-z0-9])$/;
32021
+ function Rl(r6) {
32022
+ return Ko.test(r6);
32020
32023
  }
32021
32024
  function He(r6, e) {
32022
32025
  if (!r6) return "";
@@ -32060,16 +32063,16 @@ function Br(r6) {
32060
32063
  }
32061
32064
  function hr(r6) {
32062
32065
  let e = r6.type?.[0]?.code;
32063
- return e === "BackboneElement" || e === "Element" ? ss((r6.base?.path ?? r6.path)?.split(".")) : e;
32066
+ return e === "BackboneElement" || e === "Element" ? as((r6.base?.path ?? r6.path)?.split(".")) : e;
32064
32067
  }
32065
- function ss(r6) {
32068
+ function as(r6) {
32066
32069
  return r6.length === 1 ? r6[0] : r6.map(I).join("");
32067
32070
  }
32068
32071
  function ft(r6, e, t) {
32069
32072
  let n = We(r6, t);
32070
- if (n) return ls(n.elements, e);
32073
+ if (n) return ps(n.elements, e);
32071
32074
  }
32072
- function ls(r6, e) {
32075
+ function ps(r6, e) {
32073
32076
  let t = r6[e] ?? r6[e + "[x]"];
32074
32077
  if (t) return t;
32075
32078
  for (let n = 0; n < e.length; n++) {
@@ -32214,7 +32217,7 @@ var O = { empty: (r6, e) => h(e.length === 0 || e.every((t) => S(t.value))), has
32214
32217
  return [{ type: l.Quantity, value: { value: c[a2], unit: a2 } }];
32215
32218
  }, is: (r6, e, t) => {
32216
32219
  let n = "";
32217
- return t instanceof q ? n = t.name : t instanceof ae && (n = t.left.name + "." + t.right.name), n ? e.map((i2) => ({ type: l.boolean, value: dt(i2, n) })) : [];
32220
+ return t instanceof q ? n = t.name : t instanceof ae && (n = t.left.name + "." + t.right.name), n ? e.map((i2) => ({ type: l.boolean, value: pt(i2, n) })) : [];
32218
32221
  }, not: (r6, e) => O.toBoolean(r6, e).map((t) => ({ type: l.boolean, value: !t.value })), resolve: (r6, e) => e.map((t) => {
32219
32222
  let n = t.value, i2;
32220
32223
  if (typeof n == "string") i2 = n;
@@ -32264,7 +32267,7 @@ function Q(r6, e, t, ...n) {
32264
32267
  if (t.length === 0) return [];
32265
32268
  let [{ value: i2 }] = z(t, 1), o = k(i2), s = o ? i2.value : i2;
32266
32269
  if (typeof s != "number") throw new Error("Math function cannot be called with non-number");
32267
- let a2 = r6(s, ...n.map((d2) => d2.eval(e, t)[0]?.value)), c = o ? l.Quantity : t[0].type, u2 = o ? { ...i2, value: a2 } : a2;
32270
+ let a2 = r6(s, ...n.map((p) => p.eval(e, t)[0]?.value)), c = o ? l.Quantity : t[0].type, u2 = o ? { ...i2, value: a2 } : a2;
32268
32271
  return [{ type: c, value: u2 }];
32269
32272
  }
32270
32273
  function z(r6, e) {
@@ -32446,7 +32449,7 @@ var Te = class extends R {
32446
32449
  let n = this.left.eval(e, t);
32447
32450
  if (n.length !== 1) return [];
32448
32451
  let i2 = this.right.name;
32449
- return h(dt(n[0], i2));
32452
+ return h(pt(n[0], i2));
32450
32453
  }
32451
32454
  };
32452
32455
  var Pt = class extends R {
@@ -32516,37 +32519,37 @@ var Se = class {
32516
32519
  };
32517
32520
  var ze = ["!=", "!~", "<=", ">=", "{}", "->"];
32518
32521
  var g = { FunctionCall: 0, Dot: 1, Indexer: 2, UnaryAdd: 3, UnarySubtract: 3, Multiply: 4, Divide: 4, IntegerDivide: 4, Modulo: 4, Add: 5, Subtract: 5, Ampersand: 5, Is: 6, As: 6, Union: 7, GreaterThan: 8, GreaterThanOrEquals: 8, LessThan: 8, LessThanOrEquals: 8, Equals: 9, Equivalent: 9, NotEquals: 9, NotEquivalent: 9, In: 10, Contains: 10, And: 11, Xor: 12, Or: 12, Implies: 13, Arrow: 100, Semicolon: 200 };
32519
- var fs2 = { parse(r6) {
32522
+ var hs = { parse(r6) {
32520
32523
  let e = r6.consumeAndParse();
32521
32524
  if (!r6.match(")")) throw new Error("Parse error: expected `)` got `" + r6.peek()?.value + "`");
32522
32525
  return e;
32523
32526
  } };
32524
- var hs = { parse(r6, e) {
32527
+ var ms = { parse(r6, e) {
32525
32528
  let t = r6.consumeAndParse();
32526
32529
  if (!r6.match("]")) throw new Error("Parse error: expected `]`");
32527
32530
  return new Se(e, t);
32528
32531
  }, precedence: g.Indexer };
32529
- var ms = { parse(r6, e) {
32532
+ var ys = { parse(r6, e) {
32530
32533
  if (!(e instanceof q)) throw new Error("Unexpected parentheses");
32531
32534
  let t = [];
32532
32535
  for (; !r6.match(")"); ) t.push(r6.consumeAndParse()), r6.match(",");
32533
32536
  return new ee(e.name, t);
32534
32537
  }, precedence: g.FunctionCall };
32535
- function ys(r6) {
32538
+ function gs(r6) {
32536
32539
  let e = r6.split(" "), t = parseFloat(e[0]), n = e[1];
32537
32540
  return n?.startsWith("'") && n.endsWith("'") ? n = n.substring(1, n.length - 1) : n = "{" + n + "}", { value: t, unit: n };
32538
32541
  }
32539
32542
  function Je() {
32540
- return new nt().registerPrefix("String", { parse: (r6, e) => new N({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r6, e) => new N({ type: l.dateTime, value: Me(e.value) }) }).registerPrefix("Quantity", { parse: (r6, e) => new N({ type: l.Quantity, value: ys(e.value) }) }).registerPrefix("Number", { parse: (r6, e) => new N({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new N({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new N({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r6, e) => new q(e.value) }).registerPrefix("{}", { parse: () => new gt() }).registerPrefix("(", fs2).registerInfix("[", hs).registerInfix("(", ms).prefix("+", g.UnaryAdd, (r6, e) => new xt("+", e, (t) => t)).prefix("-", g.UnarySubtract, (r6, e) => new D("-", e, e, (t, n) => -n)).infixLeft(".", g.Dot, (r6, e, t) => new ae(r6, t)).infixLeft("/", g.Divide, (r6, e, t) => new D("/", r6, t, (n, i2) => n / i2)).infixLeft("*", g.Multiply, (r6, e, t) => new D("*", r6, t, (n, i2) => n * i2)).infixLeft("+", g.Add, (r6, e, t) => new D("+", r6, t, (n, i2) => n + i2)).infixLeft("-", g.Subtract, (r6, e, t) => new D("-", r6, t, (n, i2) => n - i2)).infixLeft("|", g.Union, (r6, e, t) => new ve(r6, t)).infixLeft("=", g.Equals, (r6, e, t) => new bt(r6, t)).infixLeft("!=", g.NotEquals, (r6, e, t) => new Et(r6, t)).infixLeft("~", g.Equivalent, (r6, e, t) => new Rt(r6, t)).infixLeft("!~", g.NotEquivalent, (r6, e, t) => new Ct(r6, t)).infixLeft("<", g.LessThan, (r6, e, t) => new D("<", r6, t, (n, i2) => n < i2)).infixLeft("<=", g.LessThanOrEquals, (r6, e, t) => new D("<=", r6, t, (n, i2) => n <= i2)).infixLeft(">", g.GreaterThan, (r6, e, t) => new D(">", r6, t, (n, i2) => n > i2)).infixLeft(">=", g.GreaterThanOrEquals, (r6, e, t) => new D(">=", r6, t, (n, i2) => n >= i2)).infixLeft("&", g.Ampersand, (r6, e, t) => new vt(r6, t)).infixLeft("and", g.And, (r6, e, t) => new Pt(r6, t)).infixLeft("as", g.As, (r6, e, t) => new ce(r6, t)).infixLeft("contains", g.Contains, (r6, e, t) => new Tt(r6, t)).infixLeft("div", g.Divide, (r6, e, t) => new D("div", r6, t, (n, i2) => n / i2 | 0)).infixLeft("in", g.In, (r6, e, t) => new St(r6, t)).infixLeft("is", g.Is, (r6, e, t) => new Te(r6, t)).infixLeft("mod", g.Modulo, (r6, e, t) => new D("mod", r6, t, (n, i2) => n % i2)).infixLeft("or", g.Or, (r6, e, t) => new wt(r6, t)).infixLeft("xor", g.Xor, (r6, e, t) => new At(r6, t)).infixLeft("implies", g.Implies, (r6, e, t) => new Ot(r6, t));
32543
+ return new nt().registerPrefix("String", { parse: (r6, e) => new N({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r6, e) => new N({ type: l.dateTime, value: Me(e.value) }) }).registerPrefix("Quantity", { parse: (r6, e) => new N({ type: l.Quantity, value: gs(e.value) }) }).registerPrefix("Number", { parse: (r6, e) => new N({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new N({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new N({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r6, e) => new q(e.value) }).registerPrefix("{}", { parse: () => new gt() }).registerPrefix("(", hs).registerInfix("[", ms).registerInfix("(", ys).prefix("+", g.UnaryAdd, (r6, e) => new xt("+", e, (t) => t)).prefix("-", g.UnarySubtract, (r6, e) => new D("-", e, e, (t, n) => -n)).infixLeft(".", g.Dot, (r6, e, t) => new ae(r6, t)).infixLeft("/", g.Divide, (r6, e, t) => new D("/", r6, t, (n, i2) => n / i2)).infixLeft("*", g.Multiply, (r6, e, t) => new D("*", r6, t, (n, i2) => n * i2)).infixLeft("+", g.Add, (r6, e, t) => new D("+", r6, t, (n, i2) => n + i2)).infixLeft("-", g.Subtract, (r6, e, t) => new D("-", r6, t, (n, i2) => n - i2)).infixLeft("|", g.Union, (r6, e, t) => new ve(r6, t)).infixLeft("=", g.Equals, (r6, e, t) => new bt(r6, t)).infixLeft("!=", g.NotEquals, (r6, e, t) => new Et(r6, t)).infixLeft("~", g.Equivalent, (r6, e, t) => new Rt(r6, t)).infixLeft("!~", g.NotEquivalent, (r6, e, t) => new Ct(r6, t)).infixLeft("<", g.LessThan, (r6, e, t) => new D("<", r6, t, (n, i2) => n < i2)).infixLeft("<=", g.LessThanOrEquals, (r6, e, t) => new D("<=", r6, t, (n, i2) => n <= i2)).infixLeft(">", g.GreaterThan, (r6, e, t) => new D(">", r6, t, (n, i2) => n > i2)).infixLeft(">=", g.GreaterThanOrEquals, (r6, e, t) => new D(">=", r6, t, (n, i2) => n >= i2)).infixLeft("&", g.Ampersand, (r6, e, t) => new vt(r6, t)).infixLeft("and", g.And, (r6, e, t) => new Pt(r6, t)).infixLeft("as", g.As, (r6, e, t) => new ce(r6, t)).infixLeft("contains", g.Contains, (r6, e, t) => new Tt(r6, t)).infixLeft("div", g.Divide, (r6, e, t) => new D("div", r6, t, (n, i2) => n / i2 | 0)).infixLeft("in", g.In, (r6, e, t) => new St(r6, t)).infixLeft("is", g.Is, (r6, e, t) => new Te(r6, t)).infixLeft("mod", g.Modulo, (r6, e, t) => new D("mod", r6, t, (n, i2) => n % i2)).infixLeft("or", g.Or, (r6, e, t) => new wt(r6, t)).infixLeft("xor", g.Xor, (r6, e, t) => new At(r6, t)).infixLeft("implies", g.Implies, (r6, e, t) => new Ot(r6, t));
32541
32544
  }
32542
- var gs = Je();
32545
+ var xs = Je();
32543
32546
  var f = { EQUALS: "eq", NOT_EQUALS: "ne", GREATER_THAN: "gt", LESS_THAN: "lt", GREATER_THAN_OR_EQUALS: "ge", LESS_THAN_OR_EQUALS: "le", STARTS_AFTER: "sa", ENDS_BEFORE: "eb", APPROXIMATELY: "ap", CONTAINS: "contains", STARTS_WITH: "sw", EXACT: "exact", TEXT: "text", NOT: "not", ABOVE: "above", BELOW: "below", IN: "in", NOT_IN: "not-in", OF_TYPE: "of-type", MISSING: "missing", PRESENT: "present", IDENTIFIER: "identifier", ITERATE: "iterate" };
32544
32547
  var gi = { contains: f.CONTAINS, exact: f.EXACT, above: f.ABOVE, below: f.BELOW, text: f.TEXT, not: f.NOT, in: f.IN, "not-in": f.NOT_IN, "of-type": f.OF_TYPE, missing: f.MISSING, identifier: f.IDENTIFIER, iterate: f.ITERATE };
32545
32548
  var qr = { eq: f.EQUALS, ne: f.NOT_EQUALS, lt: f.LESS_THAN, le: f.LESS_THAN_OR_EQUALS, gt: f.GREATER_THAN, ge: f.GREATER_THAN_OR_EQUALS, sa: f.STARTS_AFTER, eb: f.ENDS_BEFORE, ap: f.APPROXIMATELY, sw: f.STARTS_WITH };
32546
- var ws = [f.MISSING, f.PRESENT];
32549
+ var As = [f.MISSING, f.PRESENT];
32547
32550
  var be = { READ: "read", VREAD: "vread", UPDATE: "update", DELETE: "delete", HISTORY: "history", CREATE: "create", SEARCH: "search" };
32548
- var Qs = [be.READ, be.VREAD, be.HISTORY, be.SEARCH];
32549
- function Ks(r6) {
32551
+ var zs = [be.READ, be.VREAD, be.HISTORY, be.SEARCH];
32552
+ function Xs(r6) {
32550
32553
  if (typeof window < "u") {
32551
32554
  let e = window.atob(r6), t = Uint8Array.from(e, (n) => n.charCodeAt(0));
32552
32555
  return new window.TextDecoder().decode(t);
@@ -32565,7 +32568,7 @@ function Ft(r6) {
32565
32568
  function Si(r6) {
32566
32569
  r6 = r6.padEnd(r6.length + (4 - r6.length % 4) % 4, "=");
32567
32570
  let e = r6.replace(/-/g, "+").replace(/_/g, "/");
32568
- return Ks(e);
32571
+ return Xs(e);
32569
32572
  }
32570
32573
  function $r() {
32571
32574
  let r6 = new Uint32Array(28);
@@ -32580,7 +32583,7 @@ function Ee() {
32580
32583
  return (r6 === "x" ? e : e & 3 | 8).toString(16);
32581
32584
  });
32582
32585
  }
32583
- var w = { CSS: "text/css", DICOM: "application/dicom", FAVICON: "image/vnd.microsoft.icon", FHIR_JSON: "application/fhir+json", FORM_URL_ENCODED: "application/x-www-form-urlencoded", HL7_V2: "x-application/hl7-v2+er7", HTML: "text/html", JAVASCRIPT: "text/javascript", JSON: "application/json", JSON_PATCH: "application/json-patch+json", MULTIPART_FORM_DATA: "multipart/form-data", PNG: "image/png", SCIM_JSON: "application/scim+json", SVG: "image/svg+xml", TEXT: "text/plain", TYPESCRIPT: "text/typescript", PING: "x-application/ping", XML: "text/xml", CDA_XML: "application/cda+xml" };
32586
+ var w = { CSS: "text/css", DICOM: "application/dicom", FAVICON: "image/vnd.microsoft.icon", FHIR_JSON: "application/fhir+json", FORM_URL_ENCODED: "application/x-www-form-urlencoded", HL7_V2: "x-application/hl7-v2+er7", HTML: "text/html", JAVASCRIPT: "text/javascript", JSON: "application/json", JSON_PATCH: "application/json-patch+json", JWT: "application/jwt", MULTIPART_FORM_DATA: "multipart/form-data", PNG: "image/png", SCIM_JSON: "application/scim+json", SVG: "image/svg+xml", TEXT: "text/plain", TYPESCRIPT: "text/typescript", PING: "x-application/ping", XML: "text/xml", CDA_XML: "application/cda+xml" };
32584
32587
  var Gr = class {
32585
32588
  constructor() {
32586
32589
  this.listeners = {};
@@ -32624,23 +32627,23 @@ var J = class {
32624
32627
  }
32625
32628
  };
32626
32629
  var Hr = { "Patient-open": "Patient-open", "Patient-close": "Patient-close", "ImagingStudy-open": "ImagingStudy-open", "ImagingStudy-close": "ImagingStudy-close", "Encounter-open": "Encounter-open", "Encounter-close": "Encounter-close", "DiagnosticReport-open": "DiagnosticReport-open", "DiagnosticReport-close": "DiagnosticReport-close", "DiagnosticReport-select": "DiagnosticReport-select", "DiagnosticReport-update": "DiagnosticReport-update", syncerror: "syncerror" };
32627
- var ra = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
32630
+ var na = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
32628
32631
  var Qr = ["DiagnosticReport-update"];
32629
32632
  function Ri(r6) {
32630
32633
  return Qr.includes(r6);
32631
32634
  }
32632
32635
  function Ci(r6) {
32633
- if (Qr.includes(r6)) throw new p(y(`'context.version' is required for '${r6}'.`));
32636
+ if (Qr.includes(r6)) throw new d(y(`'context.version' is required for '${r6}'.`));
32634
32637
  }
32635
- var na = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, select: { resourceType: "*", reference: true, manyAllowed: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
32636
- function ia(r6) {
32637
- return ra.includes(r6);
32638
+ var ia = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, select: { resourceType: "*", reference: true, manyAllowed: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
32639
+ function oa(r6) {
32640
+ return na.includes(r6);
32638
32641
  }
32639
32642
  function Pi(r6) {
32640
32643
  return !!r6.endpoint;
32641
32644
  }
32642
32645
  function zr(r6) {
32643
- if (!Ut(r6)) throw new p(y("subscriptionRequest must be an object conforming to SubscriptionRequest type."));
32646
+ if (!Ut(r6)) throw new d(y("subscriptionRequest must be an object conforming to SubscriptionRequest type."));
32644
32647
  let { channelType: e, mode: t, topic: n, events: i2 } = r6, o = { "hub.channel.type": e, "hub.mode": t, "hub.topic": n, "hub.events": i2.join(",") };
32645
32648
  return Pi(r6) && (o.endpoint = r6.endpoint), new URLSearchParams(o).toString();
32646
32649
  }
@@ -32651,45 +32654,45 @@ function Ut(r6) {
32651
32654
  for (let o of i2) if (!Hr[o]) return false;
32652
32655
  return !(Pi(r6) && !(typeof r6.endpoint == "string" && r6.endpoint.startsWith("ws")));
32653
32656
  }
32654
- function oa(r6, e, t, n) {
32655
- if (typeof e != "object") throw new p(y(`context[${t}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));
32656
- if (!(e.id && typeof e.id == "string")) throw new p(y(`context[${t}] is invalid. Resource must contain a valid string ID.`));
32657
- if (!e.resourceType) throw new p(y(`context[${t}] is invalid. Resource must contain a resource type. No resource type found.`));
32657
+ function sa(r6, e, t, n) {
32658
+ if (typeof e != "object") throw new d(y(`context[${t}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));
32659
+ if (!(e.id && typeof e.id == "string")) throw new d(y(`context[${t}] is invalid. Resource must contain a valid string ID.`));
32660
+ if (!e.resourceType) throw new d(y(`context[${t}] is invalid. Resource must contain a resource type. No resource type found.`));
32658
32661
  let i2 = n.resourceType;
32659
32662
  if (i2 !== "*") {
32660
- if (!ia(e.resourceType)) throw new p(y(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
32661
- if (i2 && e.resourceType !== i2) throw new p(y(`context[${t}] is invalid. context[${t}] for the '${r6}' event should contain resource of type ${i2}.`));
32663
+ if (!oa(e.resourceType)) throw new d(y(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
32664
+ if (i2 && e.resourceType !== i2) throw new d(y(`context[${t}] is invalid. context[${t}] for the '${r6}' event should contain resource of type ${i2}.`));
32662
32665
  }
32663
32666
  }
32664
- function sa(r6, e, t, n, i2) {
32667
+ function aa(r6, e, t, n, i2) {
32665
32668
  if (i2.set(e.key, (i2.get(e.key) ?? 0) + 1), n.reference) {
32666
- if (!X(e.reference)) throw new p(y(`context[${t}] is invalid. Expected key '${e.key}' to be a reference.`));
32667
- } else oa(r6, e.resource, t, n);
32669
+ if (!X(e.reference)) throw new d(y(`context[${t}] is invalid. Expected key '${e.key}' to be a reference.`));
32670
+ } else sa(r6, e.resource, t, n);
32668
32671
  }
32669
- function aa(r6, e) {
32670
- let t = /* @__PURE__ */ new Map(), n = na[r6];
32672
+ function ca(r6, e) {
32673
+ let t = /* @__PURE__ */ new Map(), n = ia[r6];
32671
32674
  for (let i2 = 0; i2 < e.length; i2++) {
32672
32675
  let o = e[i2].key;
32673
- if (!n[o]) throw new p(y(`Key '${o}' not found for event '${r6}'. Make sure to add only valid keys.`));
32674
- sa(r6, e[i2], i2, n[o], t);
32676
+ if (!n[o]) throw new d(y(`Key '${o}' not found for event '${r6}'. Make sure to add only valid keys.`));
32677
+ aa(r6, e[i2], i2, n[o], t);
32675
32678
  }
32676
32679
  for (let [i2, o] of Object.entries(n)) {
32677
- if (!(o.optional || t.has(i2))) throw new p(y(`Missing required key '${i2}' on context for '${r6}' event.`));
32678
- if (!o.manyAllowed && (t.get(i2) ?? 0) > 1) throw new p(y(`${t.get(i2)} context entries with key '${i2}' found for the '${r6}' event when schema only allows for 1.`));
32680
+ if (!(o.optional || t.has(i2))) throw new d(y(`Missing required key '${i2}' on context for '${r6}' event.`));
32681
+ if (!o.manyAllowed && (t.get(i2) ?? 0) > 1) throw new d(y(`${t.get(i2)} context entries with key '${i2}' found for the '${r6}' event when schema only allows for 1.`));
32679
32682
  }
32680
32683
  }
32681
32684
  function Jr(r6, e, t, n) {
32682
- if (!(r6 && typeof r6 == "string")) throw new p(y("Must provide a topic."));
32683
- if (!Hr[e]) throw new p(y(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Hr).join(", ")}`));
32684
- if (typeof t != "object") throw new p(y("context must be a context object or array of context objects."));
32685
- if (Qr.includes(e) && !n) throw new p(y(`The '${e}' event must contain a 'context.versionId'.`));
32685
+ if (!(r6 && typeof r6 == "string")) throw new d(y("Must provide a topic."));
32686
+ if (!Hr[e]) throw new d(y(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Hr).join(", ")}`));
32687
+ if (typeof t != "object") throw new d(y("context must be a context object or array of context objects."));
32688
+ if (Qr.includes(e) && !n) throw new d(y(`The '${e}' event must contain a 'context.versionId'.`));
32686
32689
  let i2 = Array.isArray(t) ? t : [t];
32687
- return aa(e, i2), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: Ee(), event: { "hub.topic": r6, "hub.event": e, context: i2, ...n ? { "context.versionId": n } : {} } };
32690
+ return ca(e, i2), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: Ee(), event: { "hub.topic": r6, "hub.event": e, context: i2, ...n ? { "context.versionId": n } : {} } };
32688
32691
  }
32689
32692
  var Nt = class extends J {
32690
32693
  constructor(e) {
32691
- if (super(), this.subRequest = e, !e.endpoint) throw new p(y("Subscription request should contain an endpoint."));
32692
- if (!Ut(e)) throw new p(y("Subscription request failed validation."));
32694
+ if (super(), this.subRequest = e, !e.endpoint) throw new d(y("Subscription request should contain an endpoint."));
32695
+ if (!Ut(e)) throw new d(y("Subscription request failed validation."));
32693
32696
  let t = new WebSocket(e.endpoint);
32694
32697
  t.addEventListener("open", () => {
32695
32698
  this.dispatchEvent({ type: "connect" }), t.addEventListener("message", (n) => {
@@ -32706,7 +32709,7 @@ var Nt = class extends J {
32706
32709
  this.websocket.close();
32707
32710
  }
32708
32711
  };
32709
- function ca(r6) {
32712
+ function ua(r6) {
32710
32713
  return JSON.parse(Si(r6));
32711
32714
  }
32712
32715
  function wi(r6) {
@@ -32714,7 +32717,7 @@ function wi(r6) {
32714
32717
  }
32715
32718
  function Bt(r6) {
32716
32719
  let [e, t, n] = r6.split(".");
32717
- return ca(t);
32720
+ return ua(t);
32718
32721
  }
32719
32722
  function Ai(r6) {
32720
32723
  try {
@@ -32827,7 +32830,7 @@ var Kr = class {
32827
32830
  };
32828
32831
  var Ne = { Event: typeof globalThis.Event < "u" ? globalThis.Event : void 0, ErrorEvent: void 0, CloseEvent: void 0 };
32829
32832
  var Di = false;
32830
- function ua() {
32833
+ function la() {
32831
32834
  if (typeof globalThis.Event > "u") throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");
32832
32835
  Ne.Event = globalThis.Event, Ne.ErrorEvent = class extends Event {
32833
32836
  constructor(e, t) {
@@ -32841,7 +32844,7 @@ function ua() {
32841
32844
  }
32842
32845
  };
32843
32846
  }
32844
- function la(r6, e) {
32847
+ function pa(r6, e) {
32845
32848
  if (!r6) throw new Error(e);
32846
32849
  }
32847
32850
  function qt(r6) {
@@ -32851,7 +32854,7 @@ var Re = { maxReconnectionDelay: 1e4, minReconnectionDelay: 1e3 + Math.random()
32851
32854
  var Vi = false;
32852
32855
  var jt = class r extends J {
32853
32856
  constructor(t, n, i2 = {}) {
32854
- Di || (ua(), Di = true);
32857
+ Di || (la(), Di = true);
32855
32858
  super();
32856
32859
  this._retryCount = -1;
32857
32860
  this._shouldReconnect = true;
@@ -32866,7 +32869,7 @@ var jt = class r extends J {
32866
32869
  this._handleOpen = (t2) => {
32867
32870
  this._debug("open event");
32868
32871
  let { minUptime: n2 = Re.minUptime } = this._options;
32869
- clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), la(this._ws, "WebSocket is not defined"), this._ws.binaryType = this._binaryType, this._messageQueue.forEach((i3) => this._ws?.send(i3)), this._messageQueue = [], this.onopen && this.onopen(t2), this.dispatchEvent(qt(t2));
32872
+ clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), pa(this._ws, "WebSocket is not defined"), this._ws.binaryType = this._binaryType, this._messageQueue.forEach((i3) => this._ws?.send(i3)), this._messageQueue = [], this.onopen && this.onopen(t2), this.dispatchEvent(qt(t2));
32870
32873
  };
32871
32874
  this._handleMessage = (t2) => {
32872
32875
  this._debug("message event"), this.onmessage && this.onmessage(t2), this.dispatchEvent(qt(t2));
@@ -33036,12 +33039,12 @@ var $t = class {
33036
33039
  constructor(e, t, n) {
33037
33040
  this.pingTimer = void 0;
33038
33041
  this.waitingForPong = false;
33039
- if (!(e instanceof Gt)) throw new p(y("First arg of constructor should be a `MedplumClient`"));
33042
+ if (!(e instanceof Gt)) throw new d(y("First arg of constructor should be a `MedplumClient`"));
33040
33043
  let i2;
33041
33044
  try {
33042
33045
  i2 = new URL(t).toString();
33043
33046
  } catch {
33044
- throw new p(y("Not a valid URL"));
33047
+ throw new d(y("Not a valid URL"));
33045
33048
  }
33046
33049
  let o = n?.ReconnectingWebSocket ? new n.ReconnectingWebSocket(i2, void 0, { debug: n?.debug, debugLogger: n?.debugLogger }) : new jt(i2, void 0, { debug: n?.debug, debugLogger: n?.debugLogger });
33047
33050
  this.medplum = e, this.ws = o, this.masterSubEmitter = new Ye(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? da, this.currentProfile = e.getProfile(), this.setupListeners();
@@ -33085,7 +33088,7 @@ var $t = class {
33085
33088
  for (let o of this.getAllCriteriaEmitters()) o.dispatchEvent({ ...i2 });
33086
33089
  }
33087
33090
  }), e.addEventListener("error", () => {
33088
- let t = { type: "error", payload: new p(Tn(new Error("WebSocket error"))) };
33091
+ let t = { type: "error", payload: new d(Tn(new Error("WebSocket error"))) };
33089
33092
  this.masterSubEmitter?.dispatchEvent(t);
33090
33093
  for (let n of this.getAllCriteriaEmitters()) n.dispatchEvent({ ...t });
33091
33094
  }), e.addEventListener("close", () => {
@@ -33124,8 +33127,8 @@ var $t = class {
33124
33127
  let t = e?.subscriptionId;
33125
33128
  t || (t = (await this.medplum.createResource({ ...e.subscriptionProps, resourceType: "Subscription", status: "active", reason: `WebSocket subscription for ${B(this.medplum.getProfile())}`, channel: { type: "websocket" }, criteria: e.criteria })).id);
33126
33129
  let { parameter: n } = await this.medplum.get(`fhir/R4/Subscription/${t}/$get-ws-binding-token`), i2 = n?.find((s) => s.name === "token")?.valueString, o = n?.find((s) => s.name === "websocket-url")?.valueUrl;
33127
- if (!i2) throw new p(y("Failed to get token"));
33128
- if (!o) throw new p(y("Failed to get URL from $get-ws-binding-token"));
33130
+ if (!i2) throw new d(y("Failed to get token"));
33131
+ if (!o) throw new d(y("Failed to get URL from $get-ws-binding-token"));
33129
33132
  return [t, i2];
33130
33133
  }
33131
33134
  maybeGetCriteriaEntry(e, t) {
@@ -33202,24 +33205,24 @@ var $t = class {
33202
33205
  return this.masterSubEmitter || (this.masterSubEmitter = new Ye(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
33203
33206
  }
33204
33207
  };
33205
- var Yr = "4.1.10-b8a9c246d";
33206
- var ha = w.FHIR_JSON + ", */*; q=0.1";
33207
- var ma = "https://api.medplum.com/";
33208
- var ya = 1e3;
33209
- var ga = 6e4;
33210
- var xa = 0;
33211
- var va = 3e5;
33212
- var Ta = "Binary/";
33208
+ var Yr = "4.1.11-e00f5c4a8";
33209
+ var ma = w.FHIR_JSON + ", */*; q=0.1";
33210
+ var ya = "https://api.medplum.com/";
33211
+ var ga = 1e3;
33212
+ var xa = 6e4;
33213
+ var va = 0;
33214
+ var Ta = 3e5;
33215
+ var Sa = "Binary/";
33213
33216
  var Mi = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
33214
33217
  var Ue = { ClientCredentials: "client_credentials", AuthorizationCode: "authorization_code", RefreshToken: "refresh_token", JwtBearer: "urn:ietf:params:oauth:grant-type:jwt-bearer", TokenExchange: "urn:ietf:params:oauth:grant-type:token-exchange" };
33215
- var Sa = { AccessToken: "urn:ietf:params:oauth:token-type:access_token", RefreshToken: "urn:ietf:params:oauth:token-type:refresh_token", IdToken: "urn:ietf:params:oauth:token-type:id_token", Saml1Token: "urn:ietf:params:oauth:token-type:saml1", Saml2Token: "urn:ietf:params:oauth:token-type:saml2" };
33216
- var ba = { JwtBearer: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" };
33218
+ var ba = { AccessToken: "urn:ietf:params:oauth:token-type:access_token", RefreshToken: "urn:ietf:params:oauth:token-type:refresh_token", IdToken: "urn:ietf:params:oauth:token-type:id_token", Saml1Token: "urn:ietf:params:oauth:token-type:saml1", Saml2Token: "urn:ietf:params:oauth:token-type:saml2" };
33219
+ var Ea = { JwtBearer: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" };
33217
33220
  var Gt = class extends J {
33218
33221
  constructor(t) {
33219
33222
  super();
33220
33223
  this.initComplete = true;
33221
33224
  if (t?.baseUrl && !t.baseUrl.startsWith("http")) throw new Error("Base URL must start with http or https");
33222
- this.options = t ?? {}, this.fetch = t?.fetch ?? Ea(), this.storage = t?.storage ?? new Xe(), this.createPdfImpl = t?.createPdf, this.baseUrl = Fr(t?.baseUrl ?? ma), this.fhirBaseUrl = W(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = W(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = W(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = W(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = W(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.credentialsInHeader = t?.authCredentialsMethod === "header", this.defaultHeaders = t?.defaultHeaders ?? {}, this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? va, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? xa : ga), this.cacheTime > 0 ? this.requestCache = new Pe(t?.resourceCacheSize ?? ya) : this.requestCache = void 0, t?.autoBatchTime ? (this.autoBatchTime = t.autoBatchTime, this.autoBatchQueue = []) : (this.autoBatchTime = 0, this.autoBatchQueue = void 0), t?.accessToken && this.setAccessToken(t.accessToken), this.storage.getInitPromise === void 0 ? (t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initPromise = Promise.resolve(), this.dispatchEvent({ type: "storageInitialized" })) : (this.initComplete = false, this.initPromise = this.storage.getInitPromise(), this.initPromise.then(() => {
33225
+ this.options = t ?? {}, this.fetch = t?.fetch ?? Ra(), this.storage = t?.storage ?? new Xe(), this.createPdfImpl = t?.createPdf, this.baseUrl = Fr(t?.baseUrl ?? ya), this.fhirBaseUrl = W(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = W(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = W(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = W(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = W(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.credentialsInHeader = t?.authCredentialsMethod === "header", this.defaultHeaders = t?.defaultHeaders ?? {}, this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? Ta, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? va : xa), this.cacheTime > 0 ? this.requestCache = new Pe(t?.resourceCacheSize ?? ga) : this.requestCache = void 0, t?.autoBatchTime ? (this.autoBatchTime = t.autoBatchTime, this.autoBatchQueue = []) : (this.autoBatchTime = 0, this.autoBatchQueue = void 0), t?.accessToken && this.setAccessToken(t.accessToken), this.storage.getInitPromise === void 0 ? (t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initPromise = Promise.resolve(), this.dispatchEvent({ type: "storageInitialized" })) : (this.initComplete = false, this.initPromise = this.storage.getInitPromise(), this.initPromise.then(() => {
33223
33226
  t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initComplete = true, this.dispatchEvent({ type: "storageInitialized" });
33224
33227
  }).catch((n) => {
33225
33228
  console.error(n), this.initComplete = true, this.dispatchEvent({ type: "storageInitFailed", payload: { error: n } });
@@ -33331,7 +33334,7 @@ var Gt = class extends J {
33331
33334
  }
33332
33335
  async exchangeExternalAccessToken(t, n) {
33333
33336
  if (n = n ?? this.clientId, !n) throw new Error("MedplumClient is missing clientId");
33334
- return this.fetchTokens({ grant_type: Ue.TokenExchange, subject_token_type: Sa.AccessToken, client_id: n, subject_token: t });
33337
+ return this.fetchTokens({ grant_type: Ue.TokenExchange, subject_token_type: ba.AccessToken, client_id: n, subject_token: t });
33335
33338
  }
33336
33339
  getExternalAuthRedirectUri(t, n, i2, o, s = true) {
33337
33340
  let a2 = new URL(t);
@@ -33507,8 +33510,8 @@ var Gt = class extends J {
33507
33510
  async createAttachment(t, n, i2, o, s) {
33508
33511
  let a2 = Ni(t, n, i2, o);
33509
33512
  if (a2.contentType === w.XML) {
33510
- let d2 = a2.data, m2;
33511
- d2 instanceof Blob ? m2 = await new Promise((x, U) => {
33513
+ let p = a2.data, m2;
33514
+ p instanceof Blob ? m2 = await new Promise((x, U) => {
33512
33515
  let $ = new FileReader();
33513
33516
  $.onload = () => {
33514
33517
  if (!$.result) {
@@ -33516,25 +33519,25 @@ var Gt = class extends J {
33516
33519
  return;
33517
33520
  }
33518
33521
  x($.result);
33519
- }, $.readAsText(d2, "utf-8");
33520
- }) : ArrayBuffer.isView(d2) ? m2 = new TextDecoder().decode(d2) : m2 = d2, m2.includes("<ClinicalDocument") && m2.includes("urn:hl7-org:v3") && (a2 = { ...a2, contentType: w.CDA_XML });
33522
+ }, $.readAsText(p, "utf-8");
33523
+ }) : ArrayBuffer.isView(p) ? m2 = new TextDecoder().decode(p) : m2 = p, m2.includes("<ClinicalDocument") && m2.includes("urn:hl7-org:v3") && (a2 = { ...a2, contentType: w.CDA_XML });
33521
33524
  }
33522
33525
  let c = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a2, c);
33523
33526
  return { contentType: a2.contentType, url: u2.url, title: a2.filename };
33524
33527
  }
33525
33528
  createBinary(t, n, i2, o, s) {
33526
- let a2 = Ni(t, n, i2, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: d2, filename: m2, securityContext: x, onProgress: U } = a2, $ = this.fhirUrl("Binary");
33527
- return m2 && $.searchParams.set("_filename", m2), x?.reference && this.setRequestHeader(c, "X-Security-Context", x.reference), U ? this.uploadwithProgress($, u2, d2, U, c) : this.post($, u2, d2, c);
33529
+ let a2 = Ni(t, n, i2, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: p, filename: m2, securityContext: x, onProgress: U } = a2, $ = this.fhirUrl("Binary");
33530
+ return m2 && $.searchParams.set("_filename", m2), x?.reference && this.setRequestHeader(c, "X-Security-Context", x.reference), U ? this.uploadwithProgress($, u2, p, U, c) : this.post($, u2, p, c);
33528
33531
  }
33529
33532
  uploadwithProgress(t, n, i2, o, s) {
33530
33533
  return new Promise((a2, c) => {
33531
- let u2 = new XMLHttpRequest(), d2 = () => u2.abort();
33532
- s?.signal?.addEventListener("abort", d2);
33534
+ let u2 = new XMLHttpRequest(), p = () => u2.abort();
33535
+ s?.signal?.addEventListener("abort", p);
33533
33536
  let m2 = (x) => {
33534
- s?.signal?.removeEventListener("abort", d2), x instanceof Error ? c(x) : a2(x);
33537
+ s?.signal?.removeEventListener("abort", p), x instanceof Error ? c(x) : a2(x);
33535
33538
  };
33536
33539
  if (u2.responseType = "json", u2.onabort = () => m2(new DOMException("Request aborted", "AbortError")), u2.onerror = () => m2(new Error("Request error")), o && (u2.upload.onprogress = (x) => o(x), u2.upload.onload = (x) => o(x)), u2.onload = () => {
33537
- u2.status >= 200 && u2.status < 300 ? m2(u2.response) : m2(new p(st(u2.response || u2.statusText)));
33540
+ u2.status >= 200 && u2.status < 300 ? m2(u2.response) : m2(new d(st(u2.response || u2.statusText)));
33538
33541
  }, u2.open("POST", t), u2.withCredentials = true, u2.setRequestHeader("Authorization", "Bearer " + this.accessToken), u2.setRequestHeader("Cache-Control", "no-cache, no-store, max-age=0"), u2.setRequestHeader("Content-Type", i2), this.options.extendedMode !== false && u2.setRequestHeader("X-Medplum", "extended"), s?.headers) {
33539
33542
  let x = s.headers;
33540
33543
  for (let [U, $] of Object.entries(x)) u2.setRequestHeader(U, $);
@@ -33544,7 +33547,7 @@ var Gt = class extends J {
33544
33547
  }
33545
33548
  async createPdf(t, n, i2, o) {
33546
33549
  if (!this.createPdfImpl) throw new Error("PDF creation not enabled");
33547
- let s = Pa(t, n, i2, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: d2, ...m2 } = s, x = await this.createPdfImpl(c, u2, d2), U = { ...m2, data: x, contentType: "application/pdf" };
33550
+ let s = wa(t, n, i2, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: p, ...m2 } = s, x = await this.createPdfImpl(c, u2, p), U = { ...m2, data: x, contentType: "application/pdf" };
33548
33551
  return this.createBinary(U, a2);
33549
33552
  }
33550
33553
  createComment(t, n, i2) {
@@ -33654,7 +33657,7 @@ var Gt = class extends J {
33654
33657
  async download(t, n = {}) {
33655
33658
  this.refreshPromise && await this.refreshPromise;
33656
33659
  let i2 = t.toString();
33657
- i2.startsWith(Ta) && (t = this.fhirUrl(i2));
33660
+ i2.startsWith(Sa) && (t = this.fhirUrl(i2));
33658
33661
  let o = n.headers;
33659
33662
  return o || (o = {}, n.headers = o), o.Accept || (o.Accept = "*/*"), this.addFetchOptionsDefaults(n), (await this.fetchWithRetry(t.toString(), n)).blob();
33660
33663
  }
@@ -33712,17 +33715,17 @@ var Gt = class extends J {
33712
33715
  if (s.status === 401) return this.handleUnauthenticated(t, n, i2);
33713
33716
  if (s.status === 204 || s.status === 304) return;
33714
33717
  let c = s.headers.get("content-type")?.includes("json");
33715
- if (s.status === 404 && !c) throw new p(xn);
33718
+ if (s.status === 404 && !c) throw new d(xn);
33716
33719
  let u2 = await this.parseBody(s, c);
33717
33720
  if (s.status === 200 && i2.followRedirectOnOk || s.status === 201 && i2.followRedirectOnCreated) {
33718
- let d2 = await Li(s, u2);
33719
- if (d2) return this.request("GET", d2, { ...i2, body: void 0 });
33721
+ let p = await Li(s, u2);
33722
+ if (p) return this.request("GET", p, { ...i2, body: void 0 });
33720
33723
  }
33721
33724
  if (s.status === 202 && i2.pollStatusOnAccepted) {
33722
33725
  let m2 = await Li(s, u2) ?? o.statusUrl;
33723
33726
  if (m2) return this.pollStatus(m2, i2, o);
33724
33727
  }
33725
- if (s.status >= 400) throw new p(st(u2));
33728
+ if (s.status >= 400) throw new d(st(u2));
33726
33729
  return u2;
33727
33730
  }
33728
33731
  async parseBody(t, n) {
@@ -33743,7 +33746,7 @@ var Gt = class extends J {
33743
33746
  for (let o = 0; o <= i2; o++) try {
33744
33747
  this.options.verbose && this.logRequest(t, n);
33745
33748
  let s = await this.fetch(t, n);
33746
- if (this.options.verbose && this.logResponse(s), this.setCurrentRateLimit(s), o >= i2 || !wa(s)) return s;
33749
+ if (this.options.verbose && this.logResponse(s), this.setCurrentRateLimit(s), o >= i2 || !Aa(s)) return s;
33747
33750
  let a2 = this.getRetryDelay(o), c = n.maxRetryTime ?? 2e3;
33748
33751
  if (a2 > c) return s;
33749
33752
  await _r(a2);
@@ -33771,7 +33774,7 @@ var Gt = class extends J {
33771
33774
  return t.split(/\s*;\s*/g).map((n) => {
33772
33775
  let i2 = n.split(/\s*,\s*/g);
33773
33776
  if (i2.length !== 3) throw new Error("Could not parse RateLimit header: " + t);
33774
- let o = i2[0].substring(1, i2[0].length - 1), s = i2.find((d2) => d2.startsWith("r=")), a2 = s ? parseInt(s.substring(2), 10) : NaN, c = i2.find((d2) => d2.startsWith("t=")), u2 = c ? parseInt(c.substring(2), 10) : NaN;
33777
+ let o = i2[0].substring(1, i2[0].length - 1), s = i2.find((p) => p.startsWith("r=")), a2 = s ? parseInt(s.substring(2), 10) : NaN, c = i2.find((p) => p.startsWith("t=")), u2 = c ? parseInt(c.substring(2), 10) : NaN;
33775
33778
  if (!o || Number.isNaN(a2) || Number.isNaN(u2)) throw new Error("Could not parse RateLimit header: " + t);
33776
33779
  return { name: o, remainingUnits: a2, secondsUntilReset: u2 };
33777
33780
  });
@@ -33798,20 +33801,20 @@ var Gt = class extends J {
33798
33801
  try {
33799
33802
  o.resolve(await this.request(o.method, W(this.fhirBaseUrl, o.url), o.options));
33800
33803
  } catch (s) {
33801
- o.reject(new p(st(s)));
33804
+ o.reject(new d(st(s)));
33802
33805
  }
33803
33806
  return;
33804
33807
  }
33805
33808
  let n = { resourceType: "Bundle", type: "batch", entry: t.map((o) => ({ request: { method: o.method, url: o.url }, resource: o.options.body ? JSON.parse(o.options.body) : void 0 })) }, i2 = await this.post(this.fhirBaseUrl, n);
33806
33809
  for (let o = 0; o < t.length; o++) {
33807
33810
  let s = t[o], a2 = i2.entry?.[o];
33808
- a2?.response?.outcome && !dr(a2.response.outcome) ? s.reject(new p(a2.response.outcome)) : s.resolve(a2?.resource);
33811
+ a2?.response?.outcome && !pr(a2.response.outcome) ? s.reject(new d(a2.response.outcome)) : s.resolve(a2?.resource);
33809
33812
  }
33810
33813
  }
33811
33814
  addFetchOptionsDefaults(t) {
33812
33815
  Object.entries(this.defaultHeaders).forEach(([n, i2]) => {
33813
33816
  this.setRequestHeader(t, n, i2);
33814
- }), this.setRequestHeader(t, "Accept", ha, true), this.options.extendedMode !== false && this.setRequestHeader(t, "X-Medplum", "extended"), t.body && this.setRequestHeader(t, "Content-Type", w.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
33817
+ }), this.setRequestHeader(t, "Accept", ma, true), this.options.extendedMode !== false && this.setRequestHeader(t, "X-Medplum", "extended"), t.body && this.setRequestHeader(t, "Content-Type", w.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
33815
33818
  }
33816
33819
  setRequestContentType(t, n) {
33817
33820
  this.setRequestHeader(t, "Content-Type", n);
@@ -33825,7 +33828,7 @@ var Gt = class extends J {
33825
33828
  typeof n == "string" || typeof Blob < "u" && (n instanceof Blob || n?.constructor.name === "Blob") || typeof File < "u" && (n instanceof File || n?.constructor.name === "File") || typeof Uint8Array < "u" && (n instanceof Uint8Array || n?.constructor.name === "Uint8Array") ? t.body = n : n && (t.body = JSON.stringify(n));
33826
33829
  }
33827
33830
  handleUnauthenticated(t, n, i2) {
33828
- return this.refresh() ? this.request(t, n, i2) : (this.clear(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new p(we)));
33831
+ return this.refresh() ? this.request(t, n, i2) : (this.clear(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new d(we)));
33829
33832
  }
33830
33833
  async startPkce() {
33831
33834
  let t = $r();
@@ -33862,21 +33865,21 @@ var Gt = class extends J {
33862
33865
  return this.clientId = t, this.fetchTokens({ grant_type: Ue.JwtBearer, client_id: t, assertion: n, scope: i2 });
33863
33866
  }
33864
33867
  async startJwtAssertionLogin(t) {
33865
- return this.fetchTokens({ grant_type: Ue.ClientCredentials, client_assertion_type: ba.JwtBearer, client_assertion: t });
33868
+ return this.fetchTokens({ grant_type: Ue.ClientCredentials, client_assertion_type: Ea.JwtBearer, client_assertion: t });
33866
33869
  }
33867
33870
  setBasicAuth(t, n) {
33868
33871
  this.clientId = t, this.clientSecret = n, this.basicAuth = Ft(t + ":" + n);
33869
33872
  }
33870
33873
  async fhircastSubscribe(t, n) {
33871
- if (!(typeof t == "string" && t !== "")) throw new p(y("Invalid topic provided. Topic must be a valid string."));
33872
- if (!(typeof n == "object" && Array.isArray(n) && n.length > 0)) throw new p(y("Invalid events provided. Events must be an array of event names containing at least one event."));
33874
+ if (!(typeof t == "string" && t !== "")) throw new d(y("Invalid topic provided. Topic must be a valid string."));
33875
+ if (!(typeof n == "object" && Array.isArray(n) && n.length > 0)) throw new d(y("Invalid events provided. Events must be an array of event names containing at least one event."));
33873
33876
  let i2 = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, zr(i2), w.FORM_URL_ENCODED))["hub.channel.endpoint"];
33874
33877
  if (!s) throw new Error("Invalid response!");
33875
33878
  return i2.endpoint = s, i2;
33876
33879
  }
33877
33880
  async fhircastUnsubscribe(t) {
33878
- if (!Ut(t)) throw new p(y("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));
33879
- if (!(t.endpoint && typeof t.endpoint == "string" && t.endpoint.startsWith("ws"))) throw new p(y("Provided subscription request must have an endpoint in order to unsubscribe."));
33881
+ if (!Ut(t)) throw new d(y("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));
33882
+ if (!(t.endpoint && typeof t.endpoint == "string" && t.endpoint.startsWith("ws"))) throw new d(y("Provided subscription request must have an endpoint in order to unsubscribe."));
33880
33883
  t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, zr(t), w.FORM_URL_ENCODED);
33881
33884
  }
33882
33885
  fhircastConnect(t) {
@@ -33904,9 +33907,9 @@ var Gt = class extends J {
33904
33907
  this.clearActiveLogin();
33905
33908
  try {
33906
33909
  let c = await s.json();
33907
- throw new p(b(c.error_description));
33910
+ throw new d(b(c.error_description));
33908
33911
  } catch (c) {
33909
- throw new p(b("Failed to fetch tokens"), c);
33912
+ throw new d(b("Failed to fetch tokens"), c);
33910
33913
  }
33911
33914
  }
33912
33915
  let a2 = await s.json();
@@ -33916,10 +33919,10 @@ var Gt = class extends J {
33916
33919
  let n = t.access_token;
33917
33920
  if (wi(n)) {
33918
33921
  let i2 = Bt(n);
33919
- if (Date.now() >= i2.exp * 1e3) throw this.clearActiveLogin(), new p(vn);
33922
+ if (Date.now() >= i2.exp * 1e3) throw this.clearActiveLogin(), new d(vn);
33920
33923
  if (i2.cid) {
33921
- if (i2.cid !== this.clientId) throw this.clearActiveLogin(), new p(lr);
33922
- } else if (this.clientId && i2.client_id !== this.clientId) throw this.clearActiveLogin(), new p(lr);
33924
+ if (i2.cid !== this.clientId) throw this.clearActiveLogin(), new d(lr);
33925
+ } else if (this.clientId && i2.client_id !== this.clientId) throw this.clearActiveLogin(), new d(lr);
33923
33926
  }
33924
33927
  return this.setActiveLogin({ accessToken: n, refreshToken: t.refresh_token, project: t.project, profile: t.profile });
33925
33928
  }
@@ -33951,7 +33954,7 @@ var Gt = class extends J {
33951
33954
  return this.getSubscriptionManager().getMasterEmitter();
33952
33955
  }
33953
33956
  };
33954
- function Ea() {
33957
+ function Ra() {
33955
33958
  if (!globalThis.fetch) throw new Error("Fetch not available in this environment");
33956
33959
  return globalThis.fetch.bind(globalThis);
33957
33960
  }
@@ -33969,29 +33972,29 @@ function Fi(r6) {
33969
33972
  let e = r6.entry?.map((t) => t.resource) ?? [];
33970
33973
  return Object.assign(e, { bundle: r6 });
33971
33974
  }
33972
- function Ra(r6) {
33975
+ function Ca(r6) {
33973
33976
  return E(r6) && "data" in r6 && "contentType" in r6;
33974
33977
  }
33975
33978
  function Ni(r6, e, t, n) {
33976
- return Ra(r6) ? r6 : { data: r6, filename: e, contentType: t, onProgress: n };
33979
+ return Ca(r6) ? r6 : { data: r6, filename: e, contentType: t, onProgress: n };
33977
33980
  }
33978
- function Ca(r6) {
33981
+ function Pa(r6) {
33979
33982
  return E(r6) && "docDefinition" in r6;
33980
33983
  }
33981
- function Pa(r6, e, t, n) {
33982
- return Ca(r6) ? r6 : { docDefinition: r6, filename: e, tableLayouts: t, fonts: n };
33984
+ function wa(r6, e, t, n) {
33985
+ return Pa(r6) ? r6 : { docDefinition: r6, filename: e, tableLayouts: t, fonts: n };
33983
33986
  }
33984
- function wa(r6) {
33987
+ function Aa(r6) {
33985
33988
  return r6.status === 429 || r6.status >= 500;
33986
33989
  }
33987
- var Ba = [...ze, "->", "<<", ">>", "=="];
33988
- var ja = Je().registerInfix("->", { precedence: g.Arrow }).registerInfix(";", { precedence: g.Semicolon });
33989
- var ac = " ".repeat(2);
33990
- var uc = [...ze, "eq", "ne", "co"];
33991
- var lc = { eq: f.EXACT, ne: f.NOT_EQUALS, co: f.CONTAINS, sw: f.STARTS_WITH, ew: void 0, gt: f.GREATER_THAN, lt: f.LESS_THAN, ge: f.GREATER_THAN_OR_EQUALS, le: f.LESS_THAN_OR_EQUALS, ap: f.APPROXIMATELY, sa: f.STARTS_AFTER, eb: f.ENDS_BEFORE, pr: f.PRESENT, po: void 0, ss: void 0, sb: void 0, in: f.IN, ni: f.NOT_IN, re: f.EQUALS, identifier: f.IDENTIFIER };
33992
- var pc = Je();
33993
- var fc = { AA: "OK", AE: "Application Error", AR: "Application Reject", CA: "Commit Accept", CE: "Commit Error", CR: "Commit Reject" };
33994
- var de = class {
33990
+ var Wa = [...ze, "->", "<<", ">>", "=="];
33991
+ var $a = Je().registerInfix("->", { precedence: g.Arrow }).registerInfix(";", { precedence: g.Semicolon });
33992
+ var cc = " ".repeat(2);
33993
+ var lc = [...ze, "eq", "ne", "co"];
33994
+ var pc = { eq: f.EXACT, ne: f.NOT_EQUALS, co: f.CONTAINS, sw: f.STARTS_WITH, ew: void 0, gt: f.GREATER_THAN, lt: f.LESS_THAN, ge: f.GREATER_THAN_OR_EQUALS, le: f.LESS_THAN_OR_EQUALS, ap: f.APPROXIMATELY, sa: f.STARTS_AFTER, eb: f.ENDS_BEFORE, pr: f.PRESENT, po: void 0, ss: void 0, sb: void 0, in: f.IN, ni: f.NOT_IN, re: f.EQUALS, identifier: f.IDENTIFIER };
33995
+ var fc = Je();
33996
+ var hc = { AA: "OK", AE: "Application Error", AR: "Application Reject", CA: "Commit Accept", CE: "Commit Error", CR: "Commit Reject" };
33997
+ var pe = class {
33995
33998
  constructor(e = "\r", t = "|", n = "^", i2 = "~", o = "\\", s = "&") {
33996
33999
  this.segmentSeparator = e, this.fieldSeparator = t, this.componentSeparator = n, this.repetitionSeparator = i2, this.escapeCharacter = o, this.subcomponentSeparator = s;
33997
34000
  }
@@ -34003,7 +34006,7 @@ var de = class {
34003
34006
  }
34004
34007
  };
34005
34008
  var io = class r2 {
34006
- constructor(e, t = new de()) {
34009
+ constructor(e, t = new pe()) {
34007
34010
  this.context = t, this.segments = e;
34008
34011
  }
34009
34012
  get header() {
@@ -34025,8 +34028,8 @@ var io = class r2 {
34025
34028
  return this.segments.map((e) => e.toString()).join(this.context.segmentSeparator);
34026
34029
  }
34027
34030
  buildAck(e) {
34028
- let t = /* @__PURE__ */ new Date(), n = this.getSegment("MSH"), i2 = n?.getField(3)?.toString() ?? "", o = n?.getField(4)?.toString() ?? "", s = n?.getField(5)?.toString() ?? "", a2 = n?.getField(6)?.toString() ?? "", c = n?.getField(10)?.toString() ?? "", u2 = n?.getField(12)?.toString() ?? "2.5.1", d2 = e?.ackCode ?? "AA";
34029
- return new r2([new tt(["MSH", this.context.getMsh2(), s, a2, i2, o, mc(t), "", this.buildAckMessageType(n), t.getTime().toString(), "P", u2], this.context), new tt(["MSA", d2, c, fc[d2]], this.context), ...e?.errSegment ? [e.errSegment] : []]);
34031
+ let t = /* @__PURE__ */ new Date(), n = this.getSegment("MSH"), i2 = n?.getField(3)?.toString() ?? "", o = n?.getField(4)?.toString() ?? "", s = n?.getField(5)?.toString() ?? "", a2 = n?.getField(6)?.toString() ?? "", c = n?.getField(10)?.toString() ?? "", u2 = n?.getField(12)?.toString() ?? "2.5.1", p = e?.ackCode ?? "AA";
34032
+ return new r2([new tt(["MSH", this.context.getMsh2(), s, a2, i2, o, yc(t), "", this.buildAckMessageType(n), t.getTime().toString(), "P", u2], this.context), new tt(["MSA", p, c, hc[p]], this.context), ...e?.errSegment ? [e.errSegment] : []]);
34030
34033
  }
34031
34034
  buildAckMessageType(e) {
34032
34035
  let t = e?.getField(9), n = t?.getComponent(2), i2 = t?.getComponent(3), o = "ACK";
@@ -34037,7 +34040,7 @@ var io = class r2 {
34037
34040
  let n = new Error("Invalid HL7 message");
34038
34041
  throw n.type = "entity.parse.failed", n;
34039
34042
  }
34040
- let t = new de("\r", e.charAt(3), e.charAt(4), e.charAt(5), e.charAt(6), e.charAt(7));
34043
+ let t = new pe("\r", e.charAt(3), e.charAt(4), e.charAt(5), e.charAt(6), e.charAt(7));
34041
34044
  return new r2(e.split(/[\r\n]+/).map((n) => tt.parse(n, t)), t);
34042
34045
  }
34043
34046
  setSegment(e, t) {
@@ -34052,7 +34055,7 @@ var io = class r2 {
34052
34055
  }
34053
34056
  };
34054
34057
  var tt = class r3 {
34055
- constructor(e, t = new de()) {
34058
+ constructor(e, t = new pe()) {
34056
34059
  this.context = t, Kn(e) ? this.fields = e.map((n) => K.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
34057
34060
  }
34058
34061
  get(e) {
@@ -34072,7 +34075,7 @@ var tt = class r3 {
34072
34075
  toString() {
34073
34076
  return this.fields.map((e) => e.toString()).join(this.context.fieldSeparator);
34074
34077
  }
34075
- static parse(e, t = new de()) {
34078
+ static parse(e, t = new pe()) {
34076
34079
  return new r3(e.split(t.fieldSeparator).map((n) => K.parse(n, t)), t);
34077
34080
  }
34078
34081
  setField(e, t) {
@@ -34093,7 +34096,7 @@ var tt = class r3 {
34093
34096
  }
34094
34097
  };
34095
34098
  var K = class r4 {
34096
- constructor(e, t = new de()) {
34099
+ constructor(e, t = new pe()) {
34097
34100
  this.context = t, this.components = e;
34098
34101
  }
34099
34102
  get(e, t, n = 0) {
@@ -34106,7 +34109,7 @@ var K = class r4 {
34106
34109
  toString() {
34107
34110
  return this.components.map((e) => e.join(this.context.componentSeparator)).join(this.context.repetitionSeparator);
34108
34111
  }
34109
- static parse(e, t = new de()) {
34112
+ static parse(e, t = new pe()) {
34110
34113
  return new r4(e.split(t.repetitionSeparator).map((n) => n.split(t.componentSeparator)), t);
34111
34114
  }
34112
34115
  setComponent(e, t, n, i2 = 0) {
@@ -34121,12 +34124,12 @@ var K = class r4 {
34121
34124
  return true;
34122
34125
  }
34123
34126
  };
34124
- function mc(r6) {
34127
+ function yc(r6) {
34125
34128
  let e = r6 instanceof Date ? r6 : new Date(r6), n = e.toISOString().replace(/[-:T]/g, "").replace(/(\.\d+)?Z$/, ""), i2 = e.getUTCMilliseconds();
34126
34129
  return i2 > 0 && (n += "." + i2.toString()), n;
34127
34130
  }
34128
34131
  var Be = { NONE: 0, ERROR: 1, WARN: 2, INFO: 3, DEBUG: 4 };
34129
- var yc = ["NONE", "ERROR", "WARN", "INFO", "DEBUG"];
34132
+ var gc = ["NONE", "ERROR", "WARN", "INFO", "DEBUG"];
34130
34133
  var oo = class r5 {
34131
34134
  constructor(e, t = {}, n = Be.INFO, i2 = {}) {
34132
34135
  this.write = e, this.metadata = t, this.level = n, this.options = i2, i2?.prefix && (this.prefix = i2.prefix), this.error = this.error.bind(this), this.warn = this.warn.bind(this), this.info = this.info.bind(this), this.debug = this.debug.bind(this), this.log = this.log.bind(this);
@@ -34153,17 +34156,17 @@ var oo = class r5 {
34153
34156
  }
34154
34157
  log(e, t, n) {
34155
34158
  e > this.level || (n instanceof Error && (n = { error: n.toString(), stack: n.stack?.split(`
34156
- `) }), this.write(JSON.stringify({ level: yc[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
34159
+ `) }), this.write(JSON.stringify({ level: gc[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
34157
34160
  }
34158
34161
  };
34159
- function jh(r6) {
34162
+ function $h(r6) {
34160
34163
  let e = Be[r6.toUpperCase()];
34161
34164
  if (e === void 0) throw new Error(`Invalid log level: ${r6}`);
34162
34165
  return e;
34163
34166
  }
34164
- var Ec = "https://meta.medplum.com/releases";
34167
+ var Rc = "https://meta.medplum.com/releases";
34165
34168
  var tr = /* @__PURE__ */ new Map();
34166
- function Rc(r6) {
34169
+ function Cc(r6) {
34167
34170
  let e = r6;
34168
34171
  if (!e.tag_name) throw new Error("Manifest missing tag_name");
34169
34172
  let t = e.assets;
@@ -34176,7 +34179,7 @@ function Rc(r6) {
34176
34179
  async function ln(r6, e, t) {
34177
34180
  let n = tr.get(e ?? "latest");
34178
34181
  if (!n) {
34179
- let i2 = e ? `v${e}` : "latest", o = new URL(`${Ec}/${i2}.json`);
34182
+ let i2 = e ? `v${e}` : "latest", o = new URL(`${Rc}/${i2}.json`);
34180
34183
  if (o.searchParams.set("a", r6), o.searchParams.set("c", Yr), t) for (let [c, u2] of Object.entries(t)) o.searchParams.set(c, u2);
34181
34184
  let s = await fetch(o.toString());
34182
34185
  if (s.status !== 200) {
@@ -34189,15 +34192,15 @@ async function ln(r6, e, t) {
34189
34192
  throw new Error(`Received status code ${s.status} while fetching manifest for version '${e ?? "latest"}'. Message: ${c}`);
34190
34193
  }
34191
34194
  let a2 = await s.json();
34192
- Rc(a2), n = a2, tr.set(e ?? "latest", n), e || tr.set(n.tag_name.slice(1), n);
34195
+ Cc(a2), n = a2, tr.set(e ?? "latest", n), e || tr.set(n.tag_name.slice(1), n);
34193
34196
  }
34194
34197
  return n;
34195
34198
  }
34196
- function Cc(r6) {
34199
+ function Pc(r6) {
34197
34200
  return /^\d+\.\d+\.\d+$/.test(r6);
34198
34201
  }
34199
- async function im(r6, e) {
34200
- if (!Cc(e)) return false;
34202
+ async function om(r6, e) {
34203
+ if (!Pc(e)) return false;
34201
34204
  try {
34202
34205
  await ln(r6, e);
34203
34206
  } catch {
@@ -34205,7 +34208,7 @@ async function im(r6, e) {
34205
34208
  }
34206
34209
  return true;
34207
34210
  }
34208
- async function om(r6) {
34211
+ async function sm(r6) {
34209
34212
  let e = await ln(r6);
34210
34213
  if (!e.tag_name.startsWith("v")) throw new Error(`Invalid release name found. Release tag '${e.tag_name}' did not start with 'v'`);
34211
34214
  return e.tag_name.slice(1);
@@ -34241,7 +34244,7 @@ var l2 = class extends Event {
34241
34244
  super("close");
34242
34245
  }
34243
34246
  };
34244
- var d = class extends a {
34247
+ var d2 = class extends a {
34245
34248
  constructor(e, s = "utf-8", r6 = false) {
34246
34249
  super();
34247
34250
  this.chunks = [];
@@ -34305,7 +34308,7 @@ var u = class extends a {
34305
34308
  })), this.socket.on("connect", () => {
34306
34309
  if (!this.socket) return;
34307
34310
  let s;
34308
- this.connection = s = new d(this.socket, this.encoding), this.socket.setTimeout(0), s.addEventListener("close", () => {
34311
+ this.connection = s = new d2(this.socket, this.encoding), this.socket.setTimeout(0), s.addEventListener("close", () => {
34309
34312
  this.socket = void 0, this.dispatchEvent(new l2());
34310
34313
  }), s.addEventListener("error", (r6) => {
34311
34314
  this.dispatchEvent(new i(r6.error));
@@ -34331,7 +34334,7 @@ var f2 = class {
34331
34334
  }
34332
34335
  start(t, e, s = false) {
34333
34336
  let r6 = import_node_net2.default.createServer((n) => {
34334
- let o = new d(n, e, s);
34337
+ let o = new d2(n, e, s);
34335
34338
  this.handler(o);
34336
34339
  });
34337
34340
  r6.listen(t), this.server = r6;
@@ -35098,7 +35101,7 @@ IPv6 is currently unsupported.`;
35098
35101
  this.log.error(errMsg);
35099
35102
  throw new Error(errMsg);
35100
35103
  }
35101
- if (!((0, import_node_net3.isIPv4)(message.remote) || El(message.remote))) {
35104
+ if (!((0, import_node_net3.isIPv4)(message.remote) || Rl(message.remote))) {
35102
35105
  const errMsg = `Attempted to ping an invalid host.
35103
35106
 
35104
35107
  "${message.remote}" is not a valid IPv4 address or a resolvable hostname.`;
@@ -35161,7 +35164,7 @@ ${result}`);
35161
35164
  return;
35162
35165
  }
35163
35166
  let child;
35164
- if (message.version && !await im("agent-upgrader", message.version)) {
35167
+ if (message.version && !await om("agent-upgrader", message.version)) {
35165
35168
  const versionTag = message.version ? `v${message.version}` : "latest";
35166
35169
  const errMsg = `Error during upgrading to version '${versionTag}'. '${message.version}' is not a valid version`;
35167
35170
  this.log.error(errMsg);
@@ -35172,7 +35175,7 @@ ${result}`);
35172
35175
  });
35173
35176
  return;
35174
35177
  }
35175
- const targetVersion = message.version ?? await om("agent-upgrader");
35178
+ const targetVersion = message.version ?? await sm("agent-upgrader");
35176
35179
  if (Yr.startsWith(targetVersion)) {
35177
35180
  if (!message?.force) {
35178
35181
  this.log.info(`Attempted to upgrade to version ${targetVersion}, but agent is already on that version`);
@@ -35372,7 +35375,7 @@ async function agentMain(argv) {
35372
35375
  await _r(RETRY_WAIT_DURATION_MS);
35373
35376
  }
35374
35377
  }
35375
- const app = new App(medplum, agentId, jh(args.logLevel ?? "INFO"));
35378
+ const app = new App(medplum, agentId, $h(args.logLevel ?? "INFO"));
35376
35379
  await app.start();
35377
35380
  process.on("SIGINT", async () => {
35378
35381
  console.log("Gracefully shutting down from SIGINT (Ctrl-C)");
@@ -35512,10 +35515,10 @@ async function upgraderMain(argv) {
35512
35515
  });
35513
35516
  });
35514
35517
  import_node_process3.default.send({ type: "STARTED" });
35515
- if (argv[3] && !Cc(argv[3])) {
35518
+ if (argv[3] && !Pc(argv[3])) {
35516
35519
  throw new Error("Invalid version specified");
35517
35520
  }
35518
- const version = argv[3] ?? await om("agent-upgrader");
35521
+ const version = argv[3] ?? await sm("agent-upgrader");
35519
35522
  const binPath = getReleaseBinPath(version);
35520
35523
  if (!(0, import_node_fs6.existsSync)(binPath)) {
35521
35524
  globalLogger.info(`Could not find binary at "${binPath}". Downloading release from GitHub...`);