@roomle/embedding-lib 5.7.0-debug.1 → 5.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,32 @@
1
1
  var C = Object.defineProperty;
2
- var F = (r, s, e) => s in r ? C(r, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[s] = e;
3
- var c = (r, s, e) => F(r, typeof s != "symbol" ? s + "" : s, e);
4
- class M {
5
- constructor(s, e, n, t) {
2
+ var F = (s, t, e) => t in s ? C(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var c = (s, t, e) => F(s, typeof t != "symbol" ? t + "" : t, e);
4
+ class y {
5
+ constructor(t, e, o, r) {
6
6
  c(this, "_side");
7
7
  // for better debugging (who handles message? iframe or website?)
8
8
  c(this, "_incomingMessageBus", null);
9
9
  c(this, "_outgoingMessageBus", null);
10
10
  c(this, "_execMessage", null);
11
- this._side = s, this._incomingMessageBus = e, this._outgoingMessageBus = n, this._execMessage = t, this._incomingMessageBus && this._incomingMessageBus.addEventListener(
11
+ this._side = t, this._incomingMessageBus = e, this._outgoingMessageBus = o, this._execMessage = r, this._incomingMessageBus && this._incomingMessageBus.addEventListener(
12
12
  "message",
13
13
  this._handleMessage.bind(this)
14
14
  );
15
15
  }
16
- setOutgoingMessageBus(s) {
17
- this._outgoingMessageBus = s;
16
+ setOutgoingMessageBus(t) {
17
+ this._outgoingMessageBus = t;
18
18
  }
19
- setMessageExecution(s) {
20
- this._execMessage = s;
19
+ setMessageExecution(t) {
20
+ this._execMessage = t;
21
21
  }
22
- sendMessage(s, e = []) {
23
- return new Promise((n, t) => {
22
+ sendMessage(t, e = []) {
23
+ return new Promise((o, r) => {
24
24
  if (this._incomingMessageBus === this._outgoingMessageBus)
25
- return n(void 0);
26
- const o = new MessageChannel();
27
- o.port1.onmessage = (i) => {
25
+ return o(void 0);
26
+ const n = new MessageChannel();
27
+ n.port1.onmessage = (i) => {
28
28
  if (!i || !i.data)
29
- return o.port1.close(), o.port2.close(), t(
29
+ return n.port1.close(), n.port2.close(), r(
30
30
  new Error(
31
31
  this._side + " received message but response can not be interpreted"
32
32
  )
@@ -35,75 +35,75 @@ class M {
35
35
  try {
36
36
  l = JSON.parse(i.data);
37
37
  } catch (d) {
38
- return o.port1.close(), o.port2.close(), this._prepareError(d), t(d);
38
+ return n.port1.close(), n.port2.close(), this._prepareError(d), r(d);
39
39
  }
40
- l.error ? t(l.error) : l.result !== void 0 ? n(l.result) : n(void 0), o.port1.close(), o.port2.close();
40
+ l.error ? r(l.error) : l.result !== void 0 ? o(l.result) : o(void 0), n.port1.close(), n.port2.close();
41
41
  };
42
42
  let a = "";
43
43
  try {
44
- a = JSON.stringify({ message: s, args: e });
44
+ a = JSON.stringify({ message: t, args: e });
45
45
  } catch {
46
- return t(
46
+ return r(
47
47
  new Error(
48
48
  this._side + ": can not create command because it is not JSON.stringify able"
49
49
  )
50
50
  );
51
51
  }
52
52
  if (!this._outgoingMessageBus)
53
- return t(new Error(this._side + ": outgoing bus not set yet"));
53
+ return r(new Error(this._side + ": outgoing bus not set yet"));
54
54
  this._outgoingMessageBus.postMessage(a, "*", [
55
- o.port2
55
+ n.port2
56
56
  ]);
57
57
  });
58
58
  }
59
- _handleMessage(s) {
60
- const e = s.ports && Array.isArray(s.ports) && s.ports.length > 0 ? s.ports[0] : null;
61
- if (s.data && e)
59
+ _handleMessage(t) {
60
+ const e = t.ports && Array.isArray(t.ports) && t.ports.length > 0 ? t.ports[0] : null;
61
+ if (t.data && e)
62
62
  try {
63
- const n = JSON.parse(s.data);
63
+ const o = JSON.parse(t.data);
64
64
  if (!this._execMessage)
65
65
  return e.postMessage(
66
66
  JSON.stringify({
67
67
  error: this._side + " is not ready to handle messages"
68
68
  })
69
69
  );
70
- Array.isArray(n.args) || (n.args = [n.args]);
71
- const t = this._execMessage(n, s);
72
- if (t === void 0)
70
+ Array.isArray(o.args) || (o.args = [o.args]);
71
+ const r = this._execMessage(o, t);
72
+ if (r === void 0)
73
73
  return;
74
- t.then(
75
- (o = {}) => {
74
+ r.then(
75
+ (n = {}) => {
76
76
  let a, i;
77
- typeof o == "object" && o !== null && (a = o.error, i = o.result), a ? e.postMessage(
77
+ typeof n == "object" && n !== null && (a = n.error, i = n.result), a ? e.postMessage(
78
78
  JSON.stringify({ error: a })
79
79
  ) : i !== void 0 ? e.postMessage(
80
80
  JSON.stringify({ result: i })
81
81
  ) : e.postMessage(
82
- JSON.stringify({ result: o })
82
+ JSON.stringify({ result: n })
83
83
  );
84
84
  },
85
- (o) => {
85
+ (n) => {
86
86
  e.postMessage(
87
87
  JSON.stringify({
88
- error: this._prepareError(o)
88
+ error: this._prepareError(n)
89
89
  })
90
90
  );
91
91
  }
92
92
  );
93
- } catch (n) {
93
+ } catch (o) {
94
94
  e.postMessage(
95
95
  JSON.stringify({
96
- error: this._prepareError(n)
96
+ error: this._prepareError(o)
97
97
  })
98
98
  );
99
99
  }
100
100
  }
101
- _prepareError(s) {
102
- if (typeof s == "string") {
103
- const e = this._side + ": " + s;
101
+ _prepareError(t) {
102
+ if (typeof t == "string") {
103
+ const e = this._side + ": " + t;
104
104
  return console.error(e), e;
105
105
  }
106
- return s.message = this._side + ": " + s.message, console.error(s), s.message;
106
+ return t.message = this._side + ": " + t.message, console.error(t), t.message;
107
107
  }
108
108
  }
109
109
  const p = ".", E = {
@@ -115,15 +115,15 @@ const p = ".", E = {
115
115
  RETURN_METHODS: "returnMethods",
116
116
  REGISTER_CUSTOM_VIEW: "registerCustomView",
117
117
  REGISTER_CUSTOM_VIEW_DONE: "registerCustomViewDone"
118
- }, U = async (r, s) => {
119
- if (typeof r != "string")
118
+ }, U = async (s, t) => {
119
+ if (typeof s != "string")
120
120
  throw new Error(
121
- 'Configurator ID is not a string type: "' + typeof r + '"'
121
+ 'Configurator ID is not a string type: "' + typeof s + '"'
122
122
  );
123
- const e = s.customApiUrl ? s.customApiUrl : "https://api.roomle.com/v2", n = s.overrideTenant || 9, t = e + "/configurators/" + r, o = "roomle_portal_v2", a = "03-" + window.btoa((/* @__PURE__ */ new Date()).toISOString() + ";anonymous;" + o), i = () => {
123
+ const e = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/v2", o = t.overrideTenant || 9, r = e + "/configurators/" + s, n = "roomle_portal_v2", a = "03-" + window.btoa((/* @__PURE__ */ new Date()).toISOString() + ";anonymous;" + n), i = () => {
124
124
  const h = {
125
- apiKey: o,
126
- currentTenant: n,
125
+ apiKey: n,
126
+ currentTenant: o,
127
127
  locale: "en",
128
128
  language: "en",
129
129
  device: 1,
@@ -131,7 +131,7 @@ const p = ".", E = {
131
131
  platform: "web"
132
132
  };
133
133
  return new Headers(h);
134
- }, l = new Request(t, {
134
+ }, l = new Request(r, {
135
135
  method: "GET",
136
136
  headers: i(),
137
137
  mode: "cors",
@@ -144,44 +144,44 @@ const p = ".", E = {
144
144
  } catch {
145
145
  return !0;
146
146
  }
147
- }, k = ["127.0.0.1", "localhost", "0.0.0.0"], W = () => {
148
- const r = B();
149
- let s = window.location.href;
150
- if (r) {
147
+ }, W = ["127.0.0.1", "localhost", "0.0.0.0"], x = () => {
148
+ const s = B();
149
+ let t = window.location.href;
150
+ if (s) {
151
151
  if (!document.referrer)
152
152
  return null;
153
- s = document.referrer;
153
+ t = document.referrer;
154
154
  }
155
- const { hostname: e } = new URL(s);
155
+ const { hostname: e } = new URL(t);
156
156
  return e;
157
- }, x = (r) => !!(k.includes(r) || r.endsWith("roomle.com") || r.endsWith("gitlab.io") || r.endsWith("gitlab.com")), y = [
157
+ }, k = (s) => !!(W.includes(s) || s.endsWith("roomle.com") || s.endsWith("gitlab.io") || s.endsWith("gitlab.com")), I = [
158
158
  "language",
159
159
  "browserLanguage",
160
160
  "userLanguage",
161
161
  "systemLanguage"
162
- ], G = (r = null) => {
163
- const s = window.navigator;
164
- if (r)
165
- return r.substr(0, 2);
166
- if (Array.isArray(s.languages) && s.languages.length > 0)
167
- return s.languages[0].substr(0, 2);
168
- for (let e = 0, n = y.length; e < n; e++) {
169
- const t = s[y[e]];
170
- if (t)
171
- return t.substr(0, 2);
162
+ ], G = (s = null) => {
163
+ const t = window.navigator;
164
+ if (s)
165
+ return s.substr(0, 2);
166
+ if (Array.isArray(t.languages) && t.languages.length > 0)
167
+ return t.languages[0].substr(0, 2);
168
+ for (let e = 0, o = I.length; e < o; e++) {
169
+ const r = t[I[e]];
170
+ if (r)
171
+ return r.substr(0, 2);
172
172
  }
173
173
  return "en";
174
- }, V = (r, s) => {
175
- const e = JSON.parse(JSON.stringify(r));
176
- return S(e, s);
177
- }, S = (r, s) => {
178
- for (const e in s)
174
+ }, V = (s, t) => {
175
+ const e = JSON.parse(JSON.stringify(s));
176
+ return M(e, t);
177
+ }, M = (s, t) => {
178
+ for (const e in t)
179
179
  try {
180
- s[e].constructor === Object ? r[e] = S(r[e], s[e]) : r[e] = s[e];
180
+ t[e].constructor === Object ? s[e] = M(s[e], t[e]) : s[e] = t[e];
181
181
  } catch {
182
- r[e] = s[e];
182
+ s[e] = t[e];
183
183
  }
184
- return r;
184
+ return s;
185
185
  };
186
186
  var J = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 };
187
187
  const $ = {
@@ -206,32 +206,34 @@ const $ = {
206
206
  wallAutoHeight: !1
207
207
  },
208
208
  rotationSnapDegrees: 10
209
- }, z = "(idle)", Y = (r) => (O(r), r != null && r.customApiUrl && (r.customApiUrl = decodeURIComponent(r.customApiUrl)), r.shareUrl && (r.deeplink = r.shareUrl.replace(
209
+ }, z = "(idle)", Y = (s) => (O(s), s != null && s.customApiUrl && (s.customApiUrl = decodeURIComponent(s.customApiUrl)), s.shareUrl && (s.deeplink = s.shareUrl.replace(
210
210
  Q,
211
211
  X
212
- )), r), O = (r) => {
213
- if (!r)
212
+ )), s), O = (s) => {
213
+ if (!s)
214
214
  return;
215
- const s = Object.keys(r);
216
- for (const e of s) {
217
- const n = r[e];
218
- if (!Array.isArray(n) && typeof n == "object" && n !== null && O(n), Array.isArray(n))
219
- for (const t of n)
220
- O(t);
221
- (n === "true" || n === "false") && (r[e] = n === "true");
215
+ const t = Object.keys(s);
216
+ for (const e of t) {
217
+ const o = s[e];
218
+ if (!Array.isArray(o) && typeof o == "object" && o !== null && O(o), Array.isArray(o))
219
+ for (const r of o)
220
+ O(r);
221
+ (o === "true" || o === "false") && (s[e] = o === "true");
222
222
  }
223
- }, q = (r, s) => {
224
- s.configuratorId = r.id;
225
- const e = r.settings || {};
226
- return !s.overrideTenant && r.tenant && (s.overrideTenant = r.tenant), V(e, s);
223
+ }, q = (s, t) => {
224
+ t.configuratorId = s.id;
225
+ const e = s.settings || {};
226
+ return !t.overrideTenant && s.tenant && (t.overrideTenant = s.tenant), V(e, t);
227
227
  }, K = () => {
228
- const r = {
228
+ const s = {
229
229
  ...$
230
230
  };
231
- r.locale || (r.locale = G()), r.id === z && delete r.id;
232
- const s = W();
233
- return s && x(s) && (r.configuratorId = "demoConfigurator"), r.customApiUrl = J.VITE_RAPI_URL, r.emails = !1, r;
234
- }, Q = "<CONF_ID>", X = "#CONFIGURATIONID#", R = () => /(android)/i.test(navigator.userAgent);
231
+ s.locale || (s.locale = G()), s.id === z && delete s.id;
232
+ const t = x();
233
+ return t && k(t) && (s.configuratorId = "demoConfigurator"), s.customApiUrl = J.VITE_RAPI_URL, s.emails = !1, s;
234
+ }, Q = "<CONF_ID>", X = "#CONFIGURATIONID#", Z = (s) => {
235
+ s.featureFlags || (s.featureFlags = {}), typeof s.featureFlags.realPartList != "boolean" && (s.featureFlags.realPartList = !0), typeof s.featureFlags.globalCallbacks != "boolean" && (s.featureFlags.globalCallbacks = !0), typeof s.featureFlags.mocAr != "boolean" && (s.featureFlags.mocAr = !1);
236
+ }, R = () => /(android)/i.test(navigator.userAgent);
235
237
  class A {
236
238
  constructor() {
237
239
  c(this, "_messageHandler", null);
@@ -255,51 +257,51 @@ class A {
255
257
  callbacks: {}
256
258
  });
257
259
  }
258
- setMessageHandler(s) {
259
- this._messageHandler = s;
260
+ setMessageHandler(t) {
261
+ this._messageHandler = t;
260
262
  }
261
- handleSetup(s) {
262
- const { methods: e, callbacks: n } = s;
263
- e.forEach((t) => {
264
- const o = t.split(p), a = o[0], i = o[1];
263
+ handleSetup(t) {
264
+ const { methods: e, callbacks: o } = t;
265
+ e.forEach((r) => {
266
+ const n = r.split(p), a = n[0], i = n[1];
265
267
  this[a] || (this[a] = {}), this[a][i] = (function() {
266
268
  if (!this._messageHandler) {
267
269
  console.error("MessageHandler not set");
268
270
  return;
269
271
  }
270
- return this._messageHandler.sendMessage(t, [...arguments]);
272
+ return this._messageHandler.sendMessage(r, [...arguments]);
271
273
  }).bind(this);
272
- }), n.forEach((t) => {
273
- const o = t.split(p), a = o[0], i = o[1], l = o[2];
274
+ }), o.forEach((r) => {
275
+ const n = r.split(p), a = n[0], i = n[1], l = n[2];
274
276
  this[a] || (this[a] = {}), this[a][i] || (this[a][i] = {}), this[a][i][l] = () => {
275
277
  };
276
278
  }), this.isSetupDone = !0;
277
279
  }
278
- executeMessage({ message: s, args: e }) {
279
- const n = s.split(p), t = n[0], o = n[1], a = n.length === 3 ? n[2] : null;
280
- if (a && this[t][o][a]) {
281
- const i = this[t][o][a](
280
+ executeMessage({ message: t, args: e }) {
281
+ const o = t.split(p), r = o[0], n = o[1], a = o.length === 3 ? o[2] : null;
282
+ if (a && this[r][n][a]) {
283
+ const i = this[r][n][a](
282
284
  ...e
283
285
  );
284
286
  return i instanceof Promise ? i.then((l) => ({ result: l })) : i !== void 0 ? Promise.resolve({ result: i }) : Promise.resolve({ result: null });
285
287
  }
286
- return Promise.reject('Message "' + s + '" is unkown');
288
+ return Promise.reject('Message "' + t + '" is unkown');
287
289
  }
288
- setupPlugins(s, e, n = "website") {
289
- for (const t of s)
290
- typeof t == "string" && t === "dragIn" ? this.pluginsLoaded.push(
291
- new Promise((o, a) => {
290
+ setupPlugins(t, e, o = "website") {
291
+ for (const r of t)
292
+ typeof r == "string" && r === "dragIn" ? this.pluginsLoaded.push(
293
+ new Promise((n, a) => {
292
294
  try {
293
- import("./drag-in-3CJWP_Px.mjs").then((i) => i.l).then(
295
+ import("./drag-in-Do47zdKL.mjs").then((i) => i.l).then(
294
296
  ({ DragIn: i }) => {
295
297
  const l = new i(
296
298
  this.ui,
297
299
  e,
298
- n,
300
+ o,
299
301
  this.viewName
300
302
  );
301
303
  l.init().then(() => {
302
- this.plugins.dragIn = l, o();
304
+ this.plugins.dragIn = l, n();
303
305
  }, a);
304
306
  }
305
307
  );
@@ -307,18 +309,18 @@ class A {
307
309
  a(i);
308
310
  }
309
311
  })
310
- ) : t.name && t.loader && this.pluginsLoaded.push(
311
- new Promise((o, a) => {
312
+ ) : r.name && r.loader && this.pluginsLoaded.push(
313
+ new Promise((n, a) => {
312
314
  try {
313
- t.loader().then((i) => {
315
+ r.loader().then((i) => {
314
316
  const l = new i(
315
317
  this.ui,
316
318
  e,
317
- n,
319
+ o,
318
320
  this.viewName
319
321
  );
320
322
  l.init().then(() => {
321
- this.plugins[t.name] = l, o();
323
+ this.plugins[r.name] = l, n();
322
324
  }, a);
323
325
  });
324
326
  } catch (i) {
@@ -329,28 +331,28 @@ class A {
329
331
  }
330
332
  }
331
333
  const T = () => {
332
- let r, s;
333
- return { promise: new Promise((n, t) => {
334
- r = n, s = t;
335
- }), resolve: r, reject: s };
336
- }, N = (r, s, e) => {
337
- let n = null;
338
- Object.defineProperty(r, s, {
334
+ let s, t;
335
+ return { promise: new Promise((o, r) => {
336
+ s = o, t = r;
337
+ }), resolve: s, reject: t };
338
+ }, N = (s, t, e) => {
339
+ let o = null;
340
+ Object.defineProperty(s, t, {
339
341
  get() {
340
- return n || e;
342
+ return o || e;
341
343
  },
342
- set(t) {
343
- t != null && t.mute ? n = t.value : (console.warn(
344
+ set(r) {
345
+ r != null && r.mute ? o = r.value : (console.warn(
344
346
  "You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"
345
- ), console.warn("{ mute: true, value: () => void }"), n = t);
347
+ ), console.warn("{ mute: true, value: () => void }"), o = r);
346
348
  }
347
349
  });
348
- }, v = () => window.innerHeight * 0.01 + "px", L = (r) => {
349
- r && setTimeout(
350
- () => r.style.setProperty(I, v()),
350
+ }, b = () => window.innerHeight * 0.01 + "px", L = (s) => {
351
+ s && setTimeout(
352
+ () => s.style.setProperty(S, b()),
351
353
  0
352
354
  );
353
- }, b = "rml-styles", Z = 450, I = "--rml-full-height", u = {
355
+ }, v = "rml-styles", j = 450, S = "--rml-full-height", u = {
354
356
  CONTAINER: "rml-container",
355
357
  FILL: "rml-fill",
356
358
  POSITION: "rml-pos",
@@ -358,8 +360,8 @@ const T = () => {
358
360
  ANDROID_HEIGHT: "rml-android-height",
359
361
  OVERFLOW_HIDDEN: "rml-overflow-hidden"
360
362
  }, w = /* @__PURE__ */ new Map();
361
- class ee extends A {
362
- constructor(e, n, t, o, a) {
363
+ class se extends A {
364
+ constructor(e, o, r, n, a) {
363
365
  super();
364
366
  c(this, "_waitForIframe");
365
367
  c(this, "_container");
@@ -370,76 +372,77 @@ class ee extends A {
370
372
  throw new Error(
371
373
  "Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person"
372
374
  );
373
- if (w.has(n))
375
+ if (w.has(o))
374
376
  throw new Error("There is already an instance on this DOM element");
375
- if (!!!document.getElementById(b)) {
376
- const g = t.zIndex || 9999999, h = document.createElement("style");
377
- h.type = "text/css", h.id = b;
378
- const f = "transition:all ease-in-out " + Z + "ms;", m = ["-webkit-", "-o-"].reduce(
379
- (P, D) => P += D + f,
377
+ if (!!!document.getElementById(v)) {
378
+ const g = r.zIndex || 9999999, h = document.createElement("style");
379
+ h.type = "text/css", h.id = v;
380
+ const m = "transition:all ease-in-out " + j + "ms;", f = ["-webkit-", "-o-"].reduce(
381
+ (P, D) => P += D + m,
380
382
  ""
381
- ) + f, H = v();
383
+ ) + m, H = b();
382
384
  h.innerHTML = `
383
- .${u.CONTAINER}{${I}:${H};}
385
+ .${u.CONTAINER}{${S}:${H};}
384
386
  .${u.POSITION}{position:fixed;top:0;left:0;z-index:${g};opacity:0}
385
- .${u.TRANSITION}{${m}}
387
+ .${u.TRANSITION}{${f}}
386
388
  .${u.FILL}{width:100%;height:100%;opacity:1}
387
- .${u.ANDROID_HEIGHT}{height:calc(var(${I},1vh)*100)}
389
+ .${u.ANDROID_HEIGHT}{height:calc(var(${S},1vh)*100)}
388
390
  .${u.OVERFLOW_HIDDEN}{overflow:hidden}
389
391
  `, document.head.appendChild(h);
390
392
  }
391
393
  this._executeMessage = this._executeMessage.bind(this);
392
- const l = new M(
394
+ const l = new y(
393
395
  "website",
394
396
  window,
395
397
  null,
396
398
  this._executeMessage
397
399
  );
398
- this.setMessageHandler(l), this._onResize = this._onResize.bind(this), R() && window.addEventListener("resize", this._onResize), this._container = n, this._initData = t, this._configuratorSettings = e;
400
+ this.setMessageHandler(l), this._onResize = this._onResize.bind(this), R() && window.addEventListener("resize", this._onResize), this._container = o, this._initData = r, this._configuratorSettings = e;
399
401
  const d = this._createIframe();
400
- this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe = a, this._container.appendChild(d), this._iframe = d, this.setupPlugins(o, this._iframe), w.set(n, !0);
402
+ this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe = a, this._container.appendChild(d), this._iframe = d, this.setupPlugins(n, this._iframe), w.set(o, !0);
401
403
  }
402
- static createPlanner(e, n, t, o = []) {
404
+ static createPlanner(e, o, r, n = []) {
403
405
  return this._create(
404
406
  e,
405
- n,
406
- t,
407
- o
407
+ o,
408
+ r,
409
+ n
408
410
  );
409
411
  }
410
- static async connect(e, n = []) {
411
- const t = new A();
412
- t.viewName = e;
413
- const { resolve: o, promise: a } = T(), { resolve: i, promise: l } = T(), d = ({
414
- message: f,
415
- args: m
412
+ static async connect(e, o = []) {
413
+ const r = new A();
414
+ r.viewName = e;
415
+ const { resolve: n, promise: a } = T(), { resolve: i, promise: l } = T(), d = ({
416
+ message: m,
417
+ args: f
416
418
  }) => {
417
- if (f === _.REGISTER_CUSTOM_VIEW_DONE) {
418
- o();
419
- return;
419
+ switch (m) {
420
+ case _.REGISTER_CUSTOM_VIEW_DONE:
421
+ n();
422
+ break;
423
+ case _.RETURN_METHODS:
424
+ r.handleSetup(f[0]), i();
425
+ break;
426
+ default:
427
+ if (r.isSetupDone)
428
+ return r.executeMessage({ message: m, args: f });
420
429
  }
421
- if (f === _.RETURN_METHODS) {
422
- t.handleSetup(m[0]), i();
423
- return;
424
- }
425
- if (t.isSetupDone)
426
- return t.executeMessage({ message: f, args: m });
427
- }, g = new M(
430
+ }, g = new y(
428
431
  "custom-view-" + e,
429
432
  window,
430
433
  window.parent,
431
434
  d
432
435
  );
433
- t.setMessageHandler(g);
436
+ r.setMessageHandler(g);
434
437
  const h = [e];
435
438
  return g.sendMessage(
436
439
  _.REGISTER_CUSTOM_VIEW,
437
440
  h
438
- ), await a, g.sendMessage(_.GET_METHODS, h), await l, t.setupPlugins(
439
- n,
441
+ ), await a, g.sendMessage(_.GET_METHODS, h), await l, r.setupPlugins(
442
+ o,
440
443
  document.body,
441
444
  "custom-view"
442
- ), await Promise.allSettled(t.pluginsLoaded), t;
445
+ ), await Promise.allSettled(r.pluginsLoaded), r;
443
446
  }
444
447
  /**
445
448
  * Method to create a new instance of a Roomle Configurator
@@ -447,12 +450,12 @@ class ee extends A {
447
450
  * @param container DOM container in which the configurator should be placed
448
451
  * @param initData settings with which the configurator should be started
449
452
  */
450
- static createConfigurator(e, n, t, o = []) {
453
+ static createConfigurator(e, o, r, n = []) {
451
454
  return this._create(
452
455
  e,
453
- n,
454
- t,
455
- o
456
+ o,
457
+ r,
458
+ n
456
459
  );
457
460
  }
458
461
  /**
@@ -462,12 +465,12 @@ class ee extends A {
462
465
  * @param container DOM container in which the configurator should be placed
463
466
  * @param initData settings with which the configurator should be started
464
467
  */
465
- static create(e, n, t, o) {
468
+ static create(e, o, r, n) {
466
469
  return this._create(
467
470
  e,
468
- n,
469
- t,
470
- o
471
+ o,
472
+ r,
473
+ n
471
474
  );
472
475
  }
473
476
  /**
@@ -476,32 +479,32 @@ class ee extends A {
476
479
  * @param container DOM container in which the configurator should be placed
477
480
  * @param initData settings with which the configurator should be started
478
481
  */
479
- static createViewer(e, n, t, o = []) {
482
+ static createViewer(e, o, r, n = []) {
480
483
  return this._create(
481
484
  e,
482
- n,
483
- t,
484
- o
485
+ o,
486
+ r,
487
+ n
485
488
  );
486
489
  }
487
- static async _create(e, n, t, o) {
490
+ static async _create(e, o, r, n) {
488
491
  return new Promise(async (a, i) => {
489
492
  try {
490
- const l = S(
493
+ const l = M(
491
494
  K(),
492
- Y(t)
495
+ Y(r)
493
496
  );
494
- l.featureFlags || (l.featureFlags = {}), typeof l.featureFlags.realPartList != "boolean" && (l.featureFlags.realPartList = !0), typeof l.featureFlags.globalCallbacks != "boolean" && (l.featureFlags.globalCallbacks = !0), typeof l.featureFlags.mocAr != "boolean" && (l.featureFlags.mocAr = !1);
497
+ Z(l);
495
498
  const d = await U(
496
499
  e,
497
500
  l
498
501
  );
499
- t = q(d, l);
502
+ r = q(d, l);
500
503
  const g = new this(
501
504
  d,
502
- n,
503
- t,
504
505
  o,
506
+ r,
507
+ n,
505
508
  a
506
509
  );
507
510
  return await Promise.allSettled(g.pluginsLoaded), g;
@@ -516,10 +519,10 @@ class ee extends A {
516
519
  e && this._container.removeChild(e), window.removeEventListener("resize", this._onResize);
517
520
  }
518
521
  _createIframe() {
519
- var t;
522
+ var r;
520
523
  const e = document.createElement("iframe");
521
- let n = ((t = this._configuratorSettings) == null ? void 0 : t.url) || "https://www.roomle.com/t/cp/";
522
- return this._initData.useLocalRoomle && (n = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (n = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (n = this._initData.overrideServerUrl), e.src = n, e.classList.add(u.CONTAINER), e.classList.add(u.FILL), e;
524
+ let o = ((r = this._configuratorSettings) == null ? void 0 : r.url) || "https://www.roomle.com/t/cp/";
525
+ return this._initData.useLocalRoomle && (o = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (o = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (o = this._initData.overrideServerUrl), e.src = o, e.classList.add(u.CONTAINER), e.classList.add(u.FILL), e;
523
526
  }
524
527
  _onResize() {
525
528
  L(this._iframe);
@@ -530,10 +533,10 @@ class ee extends A {
530
533
  _onBackToWebsite() {
531
534
  this._iframe.classList.remove(u.POSITION), this._iframe.classList.remove(u.ANDROID_HEIGHT), document.documentElement.classList.remove(u.OVERFLOW_HIDDEN), window.document.body.classList.remove(u.OVERFLOW_HIDDEN);
532
535
  }
533
- _executeMessage({ message: e, args: n }, t) {
534
- var o;
535
- if (t.source && t.source === ((o = this._iframe) == null ? void 0 : o.contentWindow))
536
- return e === E.REQUEST_BOOT ? this._messageHandler ? (this._messageHandler.setOutgoingMessageBus(t.source), Promise.resolve({ result: this._initData })) : (console.error("MessageHandler not set"), Promise.resolve({ error: "MessageHandler not set" })) : e === E.SETUP ? (this.handleSetup(n[0]), N(
536
+ _executeMessage({ message: e, args: o }, r) {
537
+ var n;
538
+ if (r.source && r.source === ((n = this._iframe) == null ? void 0 : n.contentWindow))
539
+ return e === E.REQUEST_BOOT ? this._messageHandler ? (this._messageHandler.setOutgoingMessageBus(r.source), Promise.resolve({ result: this._initData })) : (console.error("MessageHandler not set"), Promise.resolve({ error: "MessageHandler not set" })) : e === E.SETUP ? (this.handleSetup(o[0]), N(
537
540
  this.ui.callbacks,
538
541
  "onUseFullPage",
539
542
  this._onUseFullPage
@@ -547,9 +550,9 @@ class ee extends A {
547
550
  return;
548
551
  }
549
552
  this._messageHandler.sendMessage(E.WEBSITE_READY);
550
- }, 0), Promise.resolve({ result: null })) : this.executeMessage({ message: e, args: n });
553
+ }, 0), Promise.resolve({ result: null })) : this.executeMessage({ message: e, args: o });
551
554
  }
552
555
  }
553
556
  export {
554
- ee as default
557
+ se as default
555
558
  };