@vxrn/vite-native-hmr 1.14.4 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,33 +2,35 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: true
30
+ }) : target, mod));
31
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: true
33
+ }), mod);
32
34
  var devServerClient_exports = {};
33
35
  __export(devServerClient_exports, {
34
36
  client: () => client,
@@ -39,9 +41,9 @@ __export(devServerClient_exports, {
39
41
  setup: () => setup
40
42
  });
41
43
  module.exports = __toCommonJS(devServerClient_exports);
42
- var import_pretty_format = __toESM(require("pretty-format")),
43
- import_getDevServerLocation = require("./getDevServerLocation.cjs"),
44
- import_hmr_client = require("./hmr-client.cjs");
44
+ var import_pretty_format = __toESM(require("pretty-format"));
45
+ var import_getDevServerLocation = require("./getDevServerLocation.cjs");
46
+ var import_hmr_client = require("./hmr-client.cjs");
45
47
  (0, import_hmr_client.loadHMRClient)();
46
48
  class DevServerClient {
47
49
  socket;
@@ -51,24 +53,29 @@ class DevServerClient {
51
53
  const address = `ws://${(0, import_getDevServerLocation.getDevServerLocation)().host}/__client`;
52
54
  this.socket = new WebSocket(address);
53
55
  const onClose = event => {
54
- console.warn("Disconnected from the Dev Server:", event.message), this.socket = void 0;
56
+ console.warn("Disconnected from the Dev Server:", event.message);
57
+ this.socket = void 0;
55
58
  };
56
- this.socket.onclose = onClose, this.socket.onerror = onClose, this.socket.onopen = () => {
59
+ this.socket.onclose = onClose;
60
+ this.socket.onerror = onClose;
61
+ this.socket.onopen = () => {
57
62
  this.flushBuffer();
58
63
  };
59
64
  };
60
- process.env.NODE_ENV === "development" && initSocket();
65
+ if (process.env.NODE_ENV === "development") {
66
+ initSocket();
67
+ }
61
68
  }
62
69
  send(level, data) {
63
70
  try {
64
71
  this.socket?.send(JSON.stringify({
65
72
  type: "client-log",
66
73
  level,
67
- data: data.map(item => typeof item == "string" ? item : (0, import_pretty_format.default)(item, {
68
- escapeString: !0,
69
- highlight: !0,
74
+ data: data.map(item => typeof item === "string" ? item : (0, import_pretty_format.default)(item, {
75
+ escapeString: true,
76
+ highlight: true,
70
77
  maxDepth: 3,
71
- min: !0,
78
+ min: true,
72
79
  plugins: [
73
80
  // @ts-expect-error
74
81
  import_pretty_format.default.plugins.ReactElement]
@@ -81,7 +88,7 @@ class DevServerClient {
81
88
  level,
82
89
  data: data.map((item, index) => {
83
90
  try {
84
- return typeof item == "string" ? item : JSON.stringify(item);
91
+ return typeof item === "string" ? item : JSON.stringify(item);
85
92
  } catch (err) {
86
93
  return `Error stringifying item at index ${index} - ${item} - ${err}`;
87
94
  }
@@ -99,24 +106,35 @@ class DevServerClient {
99
106
  }
100
107
  }
101
108
  flushBuffer() {
102
- globalThis.__vxrnTmpLogs && (globalThis.__vxrnTmpLogs.forEach(({
103
- level,
104
- data
105
- }) => {
106
- this.buffer.push({
109
+ if (globalThis["__vxrnTmpLogs"]) {
110
+ globalThis["__vxrnTmpLogs"].forEach(({
107
111
  level,
108
112
  data
113
+ }) => {
114
+ this.buffer.push({
115
+ level,
116
+ data
117
+ });
109
118
  });
110
- }), delete globalThis.__vxrnTmpLogs);
119
+ delete globalThis["__vxrnTmpLogs"];
120
+ }
111
121
  for (const {
112
122
  level,
113
123
  data
114
- } of this.buffer) this.send(level, data);
124
+ } of this.buffer) {
125
+ this.send(level, data);
126
+ }
115
127
  this.buffer = [];
116
128
  }
117
129
  log(level, data) {
118
- if (level !== "groupEnd") if (this.socket && this.socket.readyState === WebSocket.OPEN) this.flushBuffer(), this.send(level, data);else {
119
- if (globalThis.__vxrnTmpLogs) return;
130
+ if (level === "groupEnd") {
131
+ return;
132
+ }
133
+ if (this.socket && this.socket.readyState === WebSocket.OPEN) {
134
+ this.flushBuffer();
135
+ this.send(level, data);
136
+ } else {
137
+ if (globalThis["__vxrnTmpLogs"]) return;
120
138
  this.buffer.push({
121
139
  level,
122
140
  data
@@ -126,11 +144,11 @@ class DevServerClient {
126
144
  // Mock for React Native 0.79 to prevent native error "getPropertyAsObject: property 'setup' is undefined, expected an Object"
127
145
  setup() {}
128
146
  }
129
- const client = new DevServerClient(),
130
- setup = () => {},
131
- enable = () => {},
132
- disable = () => {},
133
- registerBundle = () => {},
134
- log = (level, data) => {
135
- client.log(level, data);
136
- };
147
+ const client = new DevServerClient();
148
+ const setup = () => {};
149
+ const enable = () => {};
150
+ const disable = () => {};
151
+ const registerBundle = () => {};
152
+ const log = (level, data) => {
153
+ client.log(level, data);
154
+ };
@@ -4,33 +4,35 @@ var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf,
8
- __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
9
  var __export = (target, all) => {
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: !0
13
- });
14
- },
15
- __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
18
  get: () => from[key],
18
19
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
20
  });
20
- return to;
21
- };
21
+ }
22
+ return to;
23
+ };
22
24
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: !0
30
- }) : target, mod)),
31
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: !0
33
- }), mod);
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
+ value: mod,
31
+ enumerable: true
32
+ }) : target, mod));
33
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
34
+ value: true
35
+ }), mod);
34
36
  var devServerClient_exports = {};
35
37
  __export(devServerClient_exports, {
36
38
  client: () => client,
@@ -41,101 +43,121 @@ __export(devServerClient_exports, {
41
43
  setup: () => setup
42
44
  });
43
45
  module.exports = __toCommonJS(devServerClient_exports);
44
- var import_pretty_format = __toESM(require("pretty-format")),
45
- import_getDevServerLocation = require("./getDevServerLocation.native.js"),
46
- import_hmr_client = require("./hmr-client.native.js");
46
+ var import_pretty_format = __toESM(require("pretty-format"));
47
+ var import_getDevServerLocation = require("./getDevServerLocation.native.js");
48
+ var import_hmr_client = require("./hmr-client.native.js");
47
49
  function _class_call_check(instance, Constructor) {
48
- if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
50
+ if (!(instance instanceof Constructor)) {
51
+ throw new TypeError("Cannot call a class as a function");
52
+ }
49
53
  }
50
54
  function _defineProperties(target, props) {
51
55
  for (var i = 0; i < props.length; i++) {
52
56
  var descriptor = props[i];
53
- descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
57
+ descriptor.enumerable = descriptor.enumerable || false;
58
+ descriptor.configurable = true;
59
+ if ("value" in descriptor) descriptor.writable = true;
60
+ Object.defineProperty(target, descriptor.key, descriptor);
54
61
  }
55
62
  }
56
63
  function _create_class(Constructor, protoProps, staticProps) {
57
- return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
64
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
65
+ if (staticProps) _defineProperties(Constructor, staticProps);
66
+ return Constructor;
58
67
  }
59
68
  function _define_property(obj, key, value) {
60
- return key in obj ? Object.defineProperty(obj, key, {
61
- value,
62
- enumerable: !0,
63
- configurable: !0,
64
- writable: !0
65
- }) : obj[key] = value, obj;
69
+ if (key in obj) {
70
+ Object.defineProperty(obj, key, {
71
+ value,
72
+ enumerable: true,
73
+ configurable: true,
74
+ writable: true
75
+ });
76
+ } else {
77
+ obj[key] = value;
78
+ }
79
+ return obj;
66
80
  }
67
81
  (0, import_hmr_client.loadHMRClient)();
68
82
  var DevServerClient = /* @__PURE__ */function () {
69
- "use strict";
83
+ "use strict";
70
84
 
71
- function DevServerClient2() {
72
- var _this = this;
73
- _class_call_check(this, DevServerClient2), _define_property(this, "socket", void 0), _define_property(this, "buffer", []);
74
- var initSocket = function () {
75
- var address = `ws://${(0, import_getDevServerLocation.getDevServerLocation)().host}/__client`;
76
- _this.socket = new WebSocket(address);
77
- var onClose = function (event) {
78
- console.warn("Disconnected from the Dev Server:", event.message), _this.socket = void 0;
79
- };
80
- _this.socket.onclose = onClose, _this.socket.onerror = onClose, _this.socket.onopen = function () {
81
- _this.flushBuffer();
82
- };
85
+ function DevServerClient2() {
86
+ var _this = this;
87
+ _class_call_check(this, DevServerClient2);
88
+ _define_property(this, "socket", void 0);
89
+ _define_property(this, "buffer", []);
90
+ var initSocket = function () {
91
+ var address = `ws://${(0, import_getDevServerLocation.getDevServerLocation)().host}/__client`;
92
+ _this.socket = new WebSocket(address);
93
+ var onClose = function (event) {
94
+ console.warn("Disconnected from the Dev Server:", event.message);
95
+ _this.socket = void 0;
96
+ };
97
+ _this.socket.onclose = onClose;
98
+ _this.socket.onerror = onClose;
99
+ _this.socket.onopen = function () {
100
+ _this.flushBuffer();
83
101
  };
84
- process.env.NODE_ENV === "development" && initSocket();
102
+ };
103
+ if (process.env.NODE_ENV === "development") {
104
+ initSocket();
85
105
  }
86
- return _create_class(DevServerClient2, [{
87
- key: "send",
88
- value: function (level, data) {
106
+ }
107
+ _create_class(DevServerClient2, [{
108
+ key: "send",
109
+ value: function send(level, data) {
110
+ try {
111
+ var _this_socket;
112
+ (_this_socket = this.socket) === null || _this_socket === void 0 ? void 0 : _this_socket.send(JSON.stringify({
113
+ type: "client-log",
114
+ level,
115
+ data: data.map(function (item) {
116
+ return typeof item === "string" ? item : (0, import_pretty_format.default)(item, {
117
+ escapeString: true,
118
+ highlight: true,
119
+ maxDepth: 3,
120
+ min: true,
121
+ plugins: [
122
+ // @ts-expect-error
123
+ import_pretty_format.default.plugins.ReactElement]
124
+ });
125
+ })
126
+ }));
127
+ } catch (unused) {
89
128
  try {
90
- var _this_socket;
91
- (_this_socket = this.socket) === null || _this_socket === void 0 || _this_socket.send(JSON.stringify({
129
+ var _this_socket1;
130
+ (_this_socket1 = this.socket) === null || _this_socket1 === void 0 ? void 0 : _this_socket1.send(JSON.stringify({
92
131
  type: "client-log",
93
132
  level,
94
- data: data.map(function (item) {
95
- return typeof item == "string" ? item : (0, import_pretty_format.default)(item, {
96
- escapeString: !0,
97
- highlight: !0,
98
- maxDepth: 3,
99
- min: !0,
100
- plugins: [
101
- // @ts-expect-error
102
- import_pretty_format.default.plugins.ReactElement]
103
- });
133
+ data: data.map(function (item, index) {
134
+ try {
135
+ return typeof item === "string" ? item : JSON.stringify(item);
136
+ } catch (err) {
137
+ return `Error stringifying item at index ${index} - ${item} - ${err}`;
138
+ }
104
139
  })
105
140
  }));
106
- } catch {
141
+ } catch (err) {
107
142
  try {
108
- var _this_socket1;
109
- (_this_socket1 = this.socket) === null || _this_socket1 === void 0 || _this_socket1.send(JSON.stringify({
143
+ var _this_socket2;
144
+ (_this_socket2 = this.socket) === null || _this_socket2 === void 0 ? void 0 : _this_socket2.send(JSON.stringify({
110
145
  type: "client-log",
111
- level,
112
- data: data.map(function (item, index) {
113
- try {
114
- return typeof item == "string" ? item : JSON.stringify(item);
115
- } catch (err) {
116
- return `Error stringifying item at index ${index} - ${item} - ${err}`;
117
- }
118
- })
146
+ level: "error",
147
+ data: ["error sending client log: " + err]
119
148
  }));
120
- } catch (err) {
121
- try {
122
- var _this_socket2;
123
- (_this_socket2 = this.socket) === null || _this_socket2 === void 0 || _this_socket2.send(JSON.stringify({
124
- type: "client-log",
125
- level: "error",
126
- data: ["error sending client log: " + err]
127
- }));
128
- } catch {}
129
- }
149
+ } catch (unused2) {}
130
150
  }
131
151
  }
132
- }, {
133
- // final err
134
- // Ignore error
135
- key: "flushBuffer",
136
- value: function () {
137
- var _this = this;
138
- globalThis.__vxrnTmpLogs && (globalThis.__vxrnTmpLogs.forEach(function (param) {
152
+ }
153
+ }, {
154
+ // final err
155
+ // Ignore error
156
+ key: "flushBuffer",
157
+ value: function flushBuffer() {
158
+ var _this = this;
159
+ if (globalThis["__vxrnTmpLogs"]) {
160
+ globalThis["__vxrnTmpLogs"].forEach(function (param) {
139
161
  var {
140
162
  level: level2,
141
163
  data: data2
@@ -144,52 +166,66 @@ var DevServerClient = /* @__PURE__ */function () {
144
166
  level: level2,
145
167
  data: data2
146
168
  });
147
- }), delete globalThis.__vxrnTmpLogs);
148
- var _iteratorNormalCompletion = !0,
149
- _didIteratorError = !1,
150
- _iteratorError = void 0;
169
+ });
170
+ delete globalThis["__vxrnTmpLogs"];
171
+ }
172
+ var _iteratorNormalCompletion = true,
173
+ _didIteratorError = false,
174
+ _iteratorError = void 0;
175
+ try {
176
+ for (var _iterator = this.buffer[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
177
+ var {
178
+ level,
179
+ data
180
+ } = _step.value;
181
+ this.send(level, data);
182
+ }
183
+ } catch (err) {
184
+ _didIteratorError = true;
185
+ _iteratorError = err;
186
+ } finally {
151
187
  try {
152
- for (var _iterator = this.buffer[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
153
- var {
154
- level,
155
- data
156
- } = _step.value;
157
- this.send(level, data);
188
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
189
+ _iterator.return();
158
190
  }
159
- } catch (err) {
160
- _didIteratorError = !0, _iteratorError = err;
161
191
  } finally {
162
- try {
163
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
164
- } finally {
165
- if (_didIteratorError) throw _iteratorError;
192
+ if (_didIteratorError) {
193
+ throw _iteratorError;
166
194
  }
167
195
  }
168
- this.buffer = [];
169
196
  }
170
- }, {
171
- key: "log",
172
- value: function (level, data) {
173
- if (level !== "groupEnd") if (this.socket && this.socket.readyState === WebSocket.OPEN) this.flushBuffer(), this.send(level, data);else {
174
- if (globalThis.__vxrnTmpLogs) return;
175
- this.buffer.push({
176
- level,
177
- data
178
- });
179
- }
197
+ this.buffer = [];
198
+ }
199
+ }, {
200
+ key: "log",
201
+ value: function log2(level, data) {
202
+ if (level === "groupEnd") {
203
+ return;
204
+ }
205
+ if (this.socket && this.socket.readyState === WebSocket.OPEN) {
206
+ this.flushBuffer();
207
+ this.send(level, data);
208
+ } else {
209
+ if (globalThis["__vxrnTmpLogs"]) return;
210
+ this.buffer.push({
211
+ level,
212
+ data
213
+ });
180
214
  }
181
- }, {
182
- // Mock for React Native 0.79 to prevent native error "getPropertyAsObject: property 'setup' is undefined, expected an Object"
183
- key: "setup",
184
- value: function () {}
185
- }]), DevServerClient2;
186
- }(),
187
- client = new DevServerClient(),
188
- setup = function () {},
189
- enable = function () {},
190
- disable = function () {},
191
- registerBundle = function () {},
192
- log = function (level, data) {
193
- client.log(level, data);
194
- };
215
+ }
216
+ }, {
217
+ // Mock for React Native 0.79 to prevent native error "getPropertyAsObject: property 'setup' is undefined, expected an Object"
218
+ key: "setup",
219
+ value: function setup2() {}
220
+ }]);
221
+ return DevServerClient2;
222
+ }();
223
+ var client = new DevServerClient();
224
+ var setup = function () {};
225
+ var enable = function () {};
226
+ var disable = function () {};
227
+ var registerBundle = function () {};
228
+ var log = function (level, data) {
229
+ client.log(level, data);
230
+ };
195
231
  //# sourceMappingURL=devServerClient.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","devServerClient_exports","__export","client","disable","enable","log","registerBundle","setup","module","exports","import_pretty_format","__toESM","require","import_getDevServerLocation","import_hmr_client","_class_call_check","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","_create_class","protoProps","staticProps","prototype","_define_property","obj","loadHMRClient","DevServerClient","DevServerClient2","_this","initSocket","address","getDevServerLocation","host","socket","WebSocket","onClose","event","console","warn","message","onclose","onerror","onopen","flushBuffer","process","env","NODE_ENV","level","data","_this_socket","send","JSON","stringify","type","map","item","default","escapeString","highlight","maxDepth","min","plugins","ReactElement","_this_socket1","index","err","_this_socket2"],"sources":["../../src/devServerClient.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;IAAAC,KAAA;EAAA,IAAAH,GAAA;AAAA,IAAAI,uBAAA;AAAAC,QAAA,CAAAD,uBAAA;EAAAE,MAAA,EAAAA,CAAA,KAAAA,MAAA;EAAAC,OAAA,EAAAA,CAAA,KAAAA,OAAA;EAAAC,MAAA,EAAAA,CAAA,KAAAA,MAAA;EAAAC,GAAA,EAAAA,CAAA,KAAAA,GAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA,cAAA;EAAAC,KAAA,EAAAA,CAAA,KAAAA;AAAA;AAAA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AA,QAAA9B,MAAA,cAAA8B,aAAA,eAAAA,aAAA,CAAAb,IAAA,CAAAC,IAAA,CAAAC,SAAA;cACFC,IAAA;cAEFN,KAAA;cACFC,IAAA,EAAAA,IAAA,CAAAM,GAAA,WAAAC,IAAA,EAAAS,KAAA;gBAEc;kBACG,cAAAT,IACb,YAAW,GAAAA,IAAA,GAAiBJ,IAAA,CAAAC,SAAW,CAAAG,IAAO;gBACvC,EAAO,OAAOU,GAAA;kBAEd,2CAAWD,KAAA,MAAAT,IAAA,MAAAU,GAAA;gBAGT;cACJ;YAEF;UACP,SAAAA,GAAA;YAEI,IAAe;cACb,IAAUC,aAAA;cAIV,CAAKA,aAAU,GAAK,KAAAjC,MAAO,UAAe,IAAAiC,aAAU,eAAAA,aAAA,CAAAhB,IAAA,CAAAC,IAAA,CAAAC,SAAA;gBACjDC,IAAA,cACA;gBACAN,KAAA;gBACDC,IAAA,GACC,4BAA2B,GAAAiB,GAAA;cAEpC;YAAA,SAGQ;UAER;QACF;MAEa;IAGA,GACA;MACA;MACA;MACX/C,GAAO,eAAe;MACxB/B,KAAA,WAAAA,CAAA","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","devServerClient_exports","__export","client","disable","enable","log","registerBundle","setup","module","exports","import_pretty_format","__toESM","require","import_getDevServerLocation","import_hmr_client","_class_call_check","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","_create_class","protoProps","staticProps","prototype","_define_property","obj","loadHMRClient","DevServerClient","DevServerClient2","_this","initSocket","address","getDevServerLocation","host","socket","WebSocket","onClose","event","console","warn","message","onclose","onerror","onopen","flushBuffer","process","env","NODE_ENV","send","level","data","_this_socket","JSON","stringify","type","map","item","default","escapeString","highlight","maxDepth","min","plugins","ReactElement","unused","_this_socket1","index","err","_this_socket2","unused2"],"sources":["../../src/devServerClient.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;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AA,uBAAAA,YAAA,CAAAH,IAAA,CAAAI,IAAA,CAAAC,SAAA;UAAAC,IACN,cAAO;UAAAL,KACP;UACFC,IAAC,EAAAA,IAAA,CAAAK,GAAA,WAAAC,IAAA;YACH,cAAAA,IAAA,gBAAAA,IAAA,OAAAzD,oBAAA,CAAA0D,OAAA,EAAAD,IAAA;cACME,YAAA;cAERC,SAAA;cACFC,QAAA;cAEFC,GAAA;cACFC,OAAA;cAEc;cACR/D,oBAA6B,CAAA0D,OAAA,CAAAK,OAAA,CAAAC,YAAA;YAExB;UACN;QACD,GAAO;MACT,SAAAC,MAAA;QAEA;UACO,IAAKC,aAAW;UACvB,CAAAA,aAAA,QAAA/B,MAAA,cAAA+B,aAAA,uBAAAA,aAAA,CAAAjB,IAAA,CAAAI,IAAA,CAAAC,SAAA;YACKC,IAAS,EAAC;YACjBL,KAAA;YAEmBC,IAAA,EAAaA,IAAA,CAAAK,GAAA,WAAAC,IAAA,EAAAU,KAAA;cAC1B,IAAU;gBACZ,cAAAV,IAAA,gBAAAA,IAAA,GAAAJ,IAAA,CAAAC,SAAA,CAAAG,IAAA;cACF,SAAAW,GAAA;gBAES,OAAU,oCAAqCD,KAAM,MAAAV,IAAA,MAAAW,GAAA;cACvD;YACA;UACA;QACD,SAAAA,GAAW;UACV;YACP,IAAAC,aAAA;YACF,CAAAA,aAAA,QAAAlC,MAAA,cAAAkC,aAAA,uBAAAA,aAAA,CAAApB,IAAA,CAAAI,IAAA,CAAAC,SAAA;cAAAC,IAAA;cAGQL,KAAA;cAERC,IAAA,GACF,+BAAAiB,GAAA;YAIqB;UAAO,SAAAE,OAAA,GACf;QAAgB;MAChB;IAAiB;EACvB,GAA8B;IACxB;IACX;IACFlD,GAAA","ignoreList":[]}
@@ -2,33 +2,35 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: true
30
+ }) : target, mod));
31
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: true
33
+ }), mod);
32
34
  var getDevServerLocation_exports = {};
33
35
  __export(getDevServerLocation_exports, {
34
36
  getDevServerLocation: () => getDevServerLocation
@@ -39,10 +41,10 @@ let location;
39
41
  function getDevServerLocation() {
40
42
  if (!location) {
41
43
  const {
42
- url
43
- } = (0, import_getDevServer.default)(),
44
- origin = url.replace(/\/$/, ""),
45
- host = origin.replace(/https?:\/\//, "");
44
+ url
45
+ } = (0, import_getDevServer.default)();
46
+ const origin = url.replace(/\/$/, "");
47
+ const host = origin.replace(/https?:\/\//, "");
46
48
  location = {
47
49
  host,
48
50
  hostname: host.split(":")[0],