@entur-partner/micro-frontend 2.4.4 → 2.4.7

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,296 +1,321 @@
1
1
  import React, { useContext, useState, useEffect } from 'react';
2
2
  import { assertIsDefined } from '@entur-partner/util';
3
3
 
4
+ function _construct(t, e, r) {
5
+ if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
6
+ var o = [null];
7
+ o.push.apply(o, e);
8
+ var p = new (t.bind.apply(t, o))();
9
+ return r && _setPrototypeOf(p, r.prototype), p;
10
+ }
11
+ function _isNativeReflectConstruct() {
12
+ try {
13
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
14
+ } catch (t) {}
15
+ return (_isNativeReflectConstruct = function () {
16
+ return !!t;
17
+ })();
18
+ }
4
19
  function _regeneratorRuntime() {
5
20
  _regeneratorRuntime = function () {
6
- return exports;
21
+ return e;
7
22
  };
8
- var exports = {},
9
- Op = Object.prototype,
10
- hasOwn = Op.hasOwnProperty,
11
- $Symbol = "function" == typeof Symbol ? Symbol : {},
12
- iteratorSymbol = $Symbol.iterator || "@@iterator",
13
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
14
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
15
- function define(obj, key, value) {
16
- return Object.defineProperty(obj, key, {
17
- value: value,
23
+ var t,
24
+ e = {},
25
+ r = Object.prototype,
26
+ n = r.hasOwnProperty,
27
+ o = Object.defineProperty || function (t, e, r) {
28
+ t[e] = r.value;
29
+ },
30
+ i = "function" == typeof Symbol ? Symbol : {},
31
+ a = i.iterator || "@@iterator",
32
+ c = i.asyncIterator || "@@asyncIterator",
33
+ u = i.toStringTag || "@@toStringTag";
34
+ function define(t, e, r) {
35
+ return Object.defineProperty(t, e, {
36
+ value: r,
18
37
  enumerable: !0,
19
38
  configurable: !0,
20
39
  writable: !0
21
- }), obj[key];
40
+ }), t[e];
22
41
  }
23
42
  try {
24
43
  define({}, "");
25
- } catch (err) {
26
- define = function (obj, key, value) {
27
- return obj[key] = value;
44
+ } catch (t) {
45
+ define = function (t, e, r) {
46
+ return t[e] = r;
28
47
  };
29
48
  }
30
- function wrap(innerFn, outerFn, self, tryLocsList) {
31
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
32
- generator = Object.create(protoGenerator.prototype),
33
- context = new Context(tryLocsList || []);
34
- return generator._invoke = function (innerFn, self, context) {
35
- var state = "suspendedStart";
36
- return function (method, arg) {
37
- if ("executing" === state) throw new Error("Generator is already running");
38
- if ("completed" === state) {
39
- if ("throw" === method) throw arg;
40
- return doneResult();
41
- }
42
- for (context.method = method, context.arg = arg;;) {
43
- var delegate = context.delegate;
44
- if (delegate) {
45
- var delegateResult = maybeInvokeDelegate(delegate, context);
46
- if (delegateResult) {
47
- if (delegateResult === ContinueSentinel) continue;
48
- return delegateResult;
49
- }
50
- }
51
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
52
- if ("suspendedStart" === state) throw state = "completed", context.arg;
53
- context.dispatchException(context.arg);
54
- } else "return" === context.method && context.abrupt("return", context.arg);
55
- state = "executing";
56
- var record = tryCatch(innerFn, self, context);
57
- if ("normal" === record.type) {
58
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
59
- return {
60
- value: record.arg,
61
- done: context.done
62
- };
63
- }
64
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
65
- }
66
- };
67
- }(innerFn, self, context), generator;
49
+ function wrap(t, e, r, n) {
50
+ var i = e && e.prototype instanceof Generator ? e : Generator,
51
+ a = Object.create(i.prototype),
52
+ c = new Context(n || []);
53
+ return o(a, "_invoke", {
54
+ value: makeInvokeMethod(t, r, c)
55
+ }), a;
68
56
  }
69
- function tryCatch(fn, obj, arg) {
57
+ function tryCatch(t, e, r) {
70
58
  try {
71
59
  return {
72
60
  type: "normal",
73
- arg: fn.call(obj, arg)
61
+ arg: t.call(e, r)
74
62
  };
75
- } catch (err) {
63
+ } catch (t) {
76
64
  return {
77
65
  type: "throw",
78
- arg: err
66
+ arg: t
79
67
  };
80
68
  }
81
69
  }
82
- exports.wrap = wrap;
83
- var ContinueSentinel = {};
70
+ e.wrap = wrap;
71
+ var h = "suspendedStart",
72
+ l = "suspendedYield",
73
+ f = "executing",
74
+ s = "completed",
75
+ y = {};
84
76
  function Generator() {}
85
77
  function GeneratorFunction() {}
86
78
  function GeneratorFunctionPrototype() {}
87
- var IteratorPrototype = {};
88
- define(IteratorPrototype, iteratorSymbol, function () {
79
+ var p = {};
80
+ define(p, a, function () {
89
81
  return this;
90
82
  });
91
- var getProto = Object.getPrototypeOf,
92
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
93
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
94
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
95
- function defineIteratorMethods(prototype) {
96
- ["next", "throw", "return"].forEach(function (method) {
97
- define(prototype, method, function (arg) {
98
- return this._invoke(method, arg);
83
+ var d = Object.getPrototypeOf,
84
+ v = d && d(d(values([])));
85
+ v && v !== r && n.call(v, a) && (p = v);
86
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
87
+ function defineIteratorMethods(t) {
88
+ ["next", "throw", "return"].forEach(function (e) {
89
+ define(t, e, function (t) {
90
+ return this._invoke(e, t);
99
91
  });
100
92
  });
101
93
  }
102
- function AsyncIterator(generator, PromiseImpl) {
103
- function invoke(method, arg, resolve, reject) {
104
- var record = tryCatch(generator[method], generator, arg);
105
- if ("throw" !== record.type) {
106
- var result = record.arg,
107
- value = result.value;
108
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
109
- invoke("next", value, resolve, reject);
110
- }, function (err) {
111
- invoke("throw", err, resolve, reject);
112
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
113
- result.value = unwrapped, resolve(result);
114
- }, function (error) {
115
- return invoke("throw", error, resolve, reject);
94
+ function AsyncIterator(t, e) {
95
+ function invoke(r, o, i, a) {
96
+ var c = tryCatch(t[r], t, o);
97
+ if ("throw" !== c.type) {
98
+ var u = c.arg,
99
+ h = u.value;
100
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
101
+ invoke("next", t, i, a);
102
+ }, function (t) {
103
+ invoke("throw", t, i, a);
104
+ }) : e.resolve(h).then(function (t) {
105
+ u.value = t, i(u);
106
+ }, function (t) {
107
+ return invoke("throw", t, i, a);
116
108
  });
117
109
  }
118
- reject(record.arg);
110
+ a(c.arg);
119
111
  }
120
- var previousPromise;
121
- this._invoke = function (method, arg) {
122
- function callInvokeWithMethodAndArg() {
123
- return new PromiseImpl(function (resolve, reject) {
124
- invoke(method, arg, resolve, reject);
125
- });
112
+ var r;
113
+ o(this, "_invoke", {
114
+ value: function (t, n) {
115
+ function callInvokeWithMethodAndArg() {
116
+ return new e(function (e, r) {
117
+ invoke(t, n, e, r);
118
+ });
119
+ }
120
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
126
121
  }
127
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
128
- };
122
+ });
129
123
  }
130
- function maybeInvokeDelegate(delegate, context) {
131
- var method = delegate.iterator[context.method];
132
- if (undefined === method) {
133
- if (context.delegate = null, "throw" === context.method) {
134
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
135
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
124
+ function makeInvokeMethod(e, r, n) {
125
+ var o = h;
126
+ return function (i, a) {
127
+ if (o === f) throw Error("Generator is already running");
128
+ if (o === s) {
129
+ if ("throw" === i) throw a;
130
+ return {
131
+ value: t,
132
+ done: !0
133
+ };
136
134
  }
137
- return ContinueSentinel;
138
- }
139
- var record = tryCatch(method, delegate.iterator, context.arg);
140
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
141
- var info = record.arg;
142
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
135
+ for (n.method = i, n.arg = a;;) {
136
+ var c = n.delegate;
137
+ if (c) {
138
+ var u = maybeInvokeDelegate(c, n);
139
+ if (u) {
140
+ if (u === y) continue;
141
+ return u;
142
+ }
143
+ }
144
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
145
+ if (o === h) throw o = s, n.arg;
146
+ n.dispatchException(n.arg);
147
+ } else "return" === n.method && n.abrupt("return", n.arg);
148
+ o = f;
149
+ var p = tryCatch(e, r, n);
150
+ if ("normal" === p.type) {
151
+ if (o = n.done ? s : l, p.arg === y) continue;
152
+ return {
153
+ value: p.arg,
154
+ done: n.done
155
+ };
156
+ }
157
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
158
+ }
159
+ };
160
+ }
161
+ function maybeInvokeDelegate(e, r) {
162
+ var n = r.method,
163
+ o = e.iterator[n];
164
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
165
+ var i = tryCatch(o, e.iterator, r.arg);
166
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
167
+ var a = i.arg;
168
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
143
169
  }
144
- function pushTryEntry(locs) {
145
- var entry = {
146
- tryLoc: locs[0]
170
+ function pushTryEntry(t) {
171
+ var e = {
172
+ tryLoc: t[0]
147
173
  };
148
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
174
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
149
175
  }
150
- function resetTryEntry(entry) {
151
- var record = entry.completion || {};
152
- record.type = "normal", delete record.arg, entry.completion = record;
176
+ function resetTryEntry(t) {
177
+ var e = t.completion || {};
178
+ e.type = "normal", delete e.arg, t.completion = e;
153
179
  }
154
- function Context(tryLocsList) {
180
+ function Context(t) {
155
181
  this.tryEntries = [{
156
182
  tryLoc: "root"
157
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
183
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
158
184
  }
159
- function values(iterable) {
160
- if (iterable) {
161
- var iteratorMethod = iterable[iteratorSymbol];
162
- if (iteratorMethod) return iteratorMethod.call(iterable);
163
- if ("function" == typeof iterable.next) return iterable;
164
- if (!isNaN(iterable.length)) {
165
- var i = -1,
166
- next = function next() {
167
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
168
- return next.value = undefined, next.done = !0, next;
185
+ function values(e) {
186
+ if (e || "" === e) {
187
+ var r = e[a];
188
+ if (r) return r.call(e);
189
+ if ("function" == typeof e.next) return e;
190
+ if (!isNaN(e.length)) {
191
+ var o = -1,
192
+ i = function next() {
193
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
194
+ return next.value = t, next.done = !0, next;
169
195
  };
170
- return next.next = next;
196
+ return i.next = i;
171
197
  }
172
198
  }
173
- return {
174
- next: doneResult
175
- };
199
+ throw new TypeError(typeof e + " is not iterable");
176
200
  }
177
- function doneResult() {
201
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
202
+ value: GeneratorFunctionPrototype,
203
+ configurable: !0
204
+ }), o(GeneratorFunctionPrototype, "constructor", {
205
+ value: GeneratorFunction,
206
+ configurable: !0
207
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
208
+ var e = "function" == typeof t && t.constructor;
209
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
210
+ }, e.mark = function (t) {
211
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
212
+ }, e.awrap = function (t) {
178
213
  return {
179
- value: undefined,
180
- done: !0
214
+ __await: t
181
215
  };
182
- }
183
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
184
- var ctor = "function" == typeof genFun && genFun.constructor;
185
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
186
- }, exports.mark = function (genFun) {
187
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
188
- }, exports.awrap = function (arg) {
189
- return {
190
- __await: arg
191
- };
192
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
216
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
193
217
  return this;
194
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
195
- void 0 === PromiseImpl && (PromiseImpl = Promise);
196
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
197
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
198
- return result.done ? result.value : iter.next();
218
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
219
+ void 0 === i && (i = Promise);
220
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
221
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
222
+ return t.done ? t.value : a.next();
199
223
  });
200
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
224
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
201
225
  return this;
202
- }), define(Gp, "toString", function () {
226
+ }), define(g, "toString", function () {
203
227
  return "[object Generator]";
204
- }), exports.keys = function (object) {
205
- var keys = [];
206
- for (var key in object) keys.push(key);
207
- return keys.reverse(), function next() {
208
- for (; keys.length;) {
209
- var key = keys.pop();
210
- if (key in object) return next.value = key, next.done = !1, next;
228
+ }), e.keys = function (t) {
229
+ var e = Object(t),
230
+ r = [];
231
+ for (var n in e) r.push(n);
232
+ return r.reverse(), function next() {
233
+ for (; r.length;) {
234
+ var t = r.pop();
235
+ if (t in e) return next.value = t, next.done = !1, next;
211
236
  }
212
237
  return next.done = !0, next;
213
238
  };
214
- }, exports.values = values, Context.prototype = {
239
+ }, e.values = values, Context.prototype = {
215
240
  constructor: Context,
216
- reset: function (skipTempReset) {
217
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
241
+ reset: function (e) {
242
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
218
243
  },
219
244
  stop: function () {
220
245
  this.done = !0;
221
- var rootRecord = this.tryEntries[0].completion;
222
- if ("throw" === rootRecord.type) throw rootRecord.arg;
246
+ var t = this.tryEntries[0].completion;
247
+ if ("throw" === t.type) throw t.arg;
223
248
  return this.rval;
224
249
  },
225
- dispatchException: function (exception) {
226
- if (this.done) throw exception;
227
- var context = this;
228
- function handle(loc, caught) {
229
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
250
+ dispatchException: function (e) {
251
+ if (this.done) throw e;
252
+ var r = this;
253
+ function handle(n, o) {
254
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
230
255
  }
231
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
232
- var entry = this.tryEntries[i],
233
- record = entry.completion;
234
- if ("root" === entry.tryLoc) return handle("end");
235
- if (entry.tryLoc <= this.prev) {
236
- var hasCatch = hasOwn.call(entry, "catchLoc"),
237
- hasFinally = hasOwn.call(entry, "finallyLoc");
238
- if (hasCatch && hasFinally) {
239
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
240
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
241
- } else if (hasCatch) {
242
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
256
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
257
+ var i = this.tryEntries[o],
258
+ a = i.completion;
259
+ if ("root" === i.tryLoc) return handle("end");
260
+ if (i.tryLoc <= this.prev) {
261
+ var c = n.call(i, "catchLoc"),
262
+ u = n.call(i, "finallyLoc");
263
+ if (c && u) {
264
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
265
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
266
+ } else if (c) {
267
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
243
268
  } else {
244
- if (!hasFinally) throw new Error("try statement without catch or finally");
245
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
269
+ if (!u) throw Error("try statement without catch or finally");
270
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
246
271
  }
247
272
  }
248
273
  }
249
274
  },
250
- abrupt: function (type, arg) {
251
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
252
- var entry = this.tryEntries[i];
253
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
254
- var finallyEntry = entry;
275
+ abrupt: function (t, e) {
276
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
277
+ var o = this.tryEntries[r];
278
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
279
+ var i = o;
255
280
  break;
256
281
  }
257
282
  }
258
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
259
- var record = finallyEntry ? finallyEntry.completion : {};
260
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
283
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
284
+ var a = i ? i.completion : {};
285
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
261
286
  },
262
- complete: function (record, afterLoc) {
263
- if ("throw" === record.type) throw record.arg;
264
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
287
+ complete: function (t, e) {
288
+ if ("throw" === t.type) throw t.arg;
289
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
265
290
  },
266
- finish: function (finallyLoc) {
267
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
268
- var entry = this.tryEntries[i];
269
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
291
+ finish: function (t) {
292
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
293
+ var r = this.tryEntries[e];
294
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
270
295
  }
271
296
  },
272
- catch: function (tryLoc) {
273
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
274
- var entry = this.tryEntries[i];
275
- if (entry.tryLoc === tryLoc) {
276
- var record = entry.completion;
277
- if ("throw" === record.type) {
278
- var thrown = record.arg;
279
- resetTryEntry(entry);
297
+ catch: function (t) {
298
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
299
+ var r = this.tryEntries[e];
300
+ if (r.tryLoc === t) {
301
+ var n = r.completion;
302
+ if ("throw" === n.type) {
303
+ var o = n.arg;
304
+ resetTryEntry(r);
280
305
  }
281
- return thrown;
306
+ return o;
282
307
  }
283
308
  }
284
- throw new Error("illegal catch attempt");
309
+ throw Error("illegal catch attempt");
285
310
  },
286
- delegateYield: function (iterable, resultName, nextLoc) {
311
+ delegateYield: function (e, r, n) {
287
312
  return this.delegate = {
288
- iterator: values(iterable),
289
- resultName: resultName,
290
- nextLoc: nextLoc
291
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
313
+ iterator: values(e),
314
+ resultName: r,
315
+ nextLoc: n
316
+ }, "next" === this.method && (this.arg = t), y;
292
317
  }
293
- }, exports;
318
+ }, e;
294
319
  }
295
320
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
296
321
  try {
@@ -354,34 +379,12 @@ function _setPrototypeOf(o, p) {
354
379
  };
355
380
  return _setPrototypeOf(o, p);
356
381
  }
357
- function _isNativeReflectConstruct() {
358
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
359
- if (Reflect.construct.sham) return false;
360
- if (typeof Proxy === "function") return true;
382
+ function _isNativeFunction(fn) {
361
383
  try {
362
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
363
- return true;
384
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
364
385
  } catch (e) {
365
- return false;
366
- }
367
- }
368
- function _construct(Parent, args, Class) {
369
- if (_isNativeReflectConstruct()) {
370
- _construct = Reflect.construct.bind();
371
- } else {
372
- _construct = function _construct(Parent, args, Class) {
373
- var a = [null];
374
- a.push.apply(a, args);
375
- var Constructor = Function.bind.apply(Parent, a);
376
- var instance = new Constructor();
377
- if (Class) _setPrototypeOf(instance, Class.prototype);
378
- return instance;
379
- };
386
+ return typeof fn === "function";
380
387
  }
381
- return _construct.apply(null, arguments);
382
- }
383
- function _isNativeFunction(fn) {
384
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
385
388
  }
386
389
  function _wrapNativeSuper(Class) {
387
390
  var _cache = typeof Map === "function" ? new Map() : undefined;
@@ -436,10 +439,10 @@ function createUnmountEvent(detail) {
436
439
  }
437
440
  var ROUTE_CHANGE_EVENT_TYPE = '@entur-partner:after-route-change';
438
441
  var RouteChangeEvent = /*#__PURE__*/function (_CustomEvent) {
439
- _inheritsLoose(RouteChangeEvent, _CustomEvent);
440
442
  function RouteChangeEvent() {
441
443
  return _CustomEvent.apply(this, arguments) || this;
442
444
  }
445
+ _inheritsLoose(RouteChangeEvent, _CustomEvent);
443
446
  return RouteChangeEvent;
444
447
  }( /*#__PURE__*/_wrapNativeSuper(CustomEvent));
445
448
 
@@ -1 +1 @@
1
- {"version":3,"file":"micro-frontend.esm.js","sources":["../src/events.ts","../src/registerMicroFrontend.tsx","../src/AppProvider.tsx"],"sourcesContent":["import { MicroFrontendPayload } from './Payload';\n\ntype MountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n payload: MicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = '@entur-partner:mount';\nexport const UNMOUNT_EVENT_TYPE = '@entur-partner:unmount';\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n return new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n return new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = '@entur-partner:after-route-change';\n\nexport type RouteAction = 'PUSH' | 'POP' | 'REPLACE';\n\ntype RouteChangeEventDetail = {\n location: Location;\n action: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n","/*global EventListener*/\nimport { MicroFrontendPayload } from './Payload';\nimport {\n MountEvent,\n UnmountEvent,\n MOUNT_EVENT_TYPE,\n UNMOUNT_EVENT_TYPE,\n} from './events';\n\ninterface Config {\n microFrontendId: string;\n mount: (\n mountPoint: HTMLDivElement,\n payload: MicroFrontendPayload,\n deprecatedMountPoint: HTMLDivElement\n ) => void;\n unmount: (mountPoint: HTMLDivElement) => void;\n}\n\nexport function registerMicroFrontend(config: Config): void {\n const { unmount, microFrontendId, mount } = config;\n\n window.addEventListener(MOUNT_EVENT_TYPE, ((event: MountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n mount(\n event.detail.mountPoint,\n event.detail.payload,\n event.detail.mountPoint\n );\n }) as EventListener);\n\n window.addEventListener(UNMOUNT_EVENT_TYPE, ((event: UnmountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n unmount(event.detail.mountPoint);\n }) as EventListener);\n}\n","import React, { FC, ReactNode, useContext, useEffect, useState } from 'react';\nimport { assertIsDefined } from '@entur-partner/util';\nimport { Permission } from '@entur-partner/permission-client-node';\n\nimport { User } from './User';\n\ninterface AppContextType {\n getToken: () => Promise<string>;\n user: User;\n logout?: () => void;\n activeOrgId: number;\n navigate: (path: string) => void;\n}\n\nexport const AppContext = React.createContext<AppContextType | undefined>(\n undefined\n);\n\nexport const useUser = () => {\n const context = useContext(AppContext);\n assertIsDefined(context);\n return context.user;\n};\n\nexport const useActiveOrgId = () => {\n const context = useContext(AppContext);\n assertIsDefined(context);\n return context.activeOrgId;\n};\n\nexport interface AppProviderProps {\n children: ReactNode;\n getToken: () => Promise<string>;\n user: User;\n getPermissions: () => Promise<Permission[]>;\n organisationId: string;\n navigate: (path: string) => void;\n}\n\nexport const useNavigate = () => {\n const context = useContext(AppContext);\n assertIsDefined(context);\n return context.navigate;\n};\n\nexport const AppProvider: FC<AppProviderProps> = ({\n children,\n organisationId,\n getPermissions,\n ...rest\n}) => {\n const [permissions, setPermissions] = useState<Permission[]>([]);\n\n useEffect(() => {\n async function fetchData() {\n try {\n const fetchedPermissions = await getPermissions();\n setPermissions(fetchedPermissions);\n } catch (error) {\n console.error(\n 'Fetching permissions with the provided getPermissions function failed in AppProvider with the following error:',\n error\n );\n }\n }\n\n fetchData();\n }, [getPermissions]);\n\n return (\n <AppContext.Provider\n value={{\n ...rest,\n user: { ...rest.user, permissions: permissions },\n activeOrgId: Number(organisationId),\n }}\n >\n {children}\n </AppContext.Provider>\n );\n};\n"],"names":["MOUNT_EVENT_TYPE","UNMOUNT_EVENT_TYPE","createMountEvent","detail","CustomEvent","createUnmountEvent","ROUTE_CHANGE_EVENT_TYPE","RouteChangeEvent","_CustomEvent","_inheritsLoose","apply","arguments","_wrapNativeSuper","registerMicroFrontend","config","unmount","microFrontendId","mount","window","addEventListener","event","id","startsWith","mountPoint","payload","AppContext","React","createContext","undefined","useUser","context","useContext","assertIsDefined","user","useActiveOrgId","activeOrgId","useNavigate","navigate","AppProvider","_ref","children","organisationId","getPermissions","rest","_objectWithoutPropertiesLoose","_excluded","_useState","useState","permissions","setPermissions","useEffect","fetchData","_fetchData","_asyncToGenerator","_regeneratorRuntime","mark","_callee","fetchedPermissions","wrap","_callee$","_context","prev","next","sent","t0","console","error","stop","createElement","Provider","value","_extends","Number"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,IAAMA,gBAAgB,GAAG,uBAAsB;AAC/C,IAAMC,kBAAkB,GAAG,yBAAwB;AAKpD,SAAUC,gBAAgBA,CAACC,MAAwB,EAAA;AACvD,EAAA,OAAO,IAAIC,WAAW,CAAmBJ,gBAAgB,EAAE;AAAEG,IAAAA,MAAM,EAANA,MAAAA;AAAQ,GAAA,CAAC,CAAA;AACxE,CAAA;AAEM,SAAUE,kBAAkBA,CAACF,MAA0B,EAAA;AAC3D,EAAA,OAAO,IAAIC,WAAW,CAAqBH,kBAAkB,EAAE;AAAEE,IAAAA,MAAM,EAANA,MAAAA;AAAQ,GAAA,CAAC,CAAA;AAC5E,CAAA;AAEO,IAAMG,uBAAuB,GAAG,oCAAmC;AAS7DC,IAAAA,gBAAiB,0BAAAC,YAAA,EAAA;EAA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AC4C,QAAQ,EAAA;IAClBC,KAAK,EAAAC,QAAA,CAAA,EAAA,EACA5B,IAAI,EAAA;AACPV,MAAAA,IAAI,EAAAsC,QAAA,CAAO5B,EAAAA,EAAAA,IAAI,CAACV,IAAI,EAAA;AAAEe,QAAAA,WAAW,EAAEA,WAAAA;OAAa,CAAA;MAChDb,WAAW,EAAEqC,MAAM,CAAC/B,cAAc,CAAA;AAAC,KAAA,CAAA;GAGpC,EAAAD,QAAQ,CACW,CAAA;AAE1B;;;;"}
1
+ {"version":3,"file":"micro-frontend.esm.js","sources":["../src/events.ts","../src/registerMicroFrontend.tsx","../src/AppProvider.tsx"],"sourcesContent":["import { MicroFrontendPayload } from './Payload';\n\ntype MountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n payload: MicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = '@entur-partner:mount';\nexport const UNMOUNT_EVENT_TYPE = '@entur-partner:unmount';\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n return new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n return new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = '@entur-partner:after-route-change';\n\nexport type RouteAction = 'PUSH' | 'POP' | 'REPLACE';\n\ntype RouteChangeEventDetail = {\n location: Location;\n action: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n","/*global EventListener*/\nimport { MicroFrontendPayload } from './Payload';\nimport {\n MountEvent,\n UnmountEvent,\n MOUNT_EVENT_TYPE,\n UNMOUNT_EVENT_TYPE,\n} from './events';\n\ninterface Config {\n microFrontendId: string;\n mount: (\n mountPoint: HTMLDivElement,\n payload: MicroFrontendPayload,\n deprecatedMountPoint: HTMLDivElement\n ) => void;\n unmount: (mountPoint: HTMLDivElement) => void;\n}\n\nexport function registerMicroFrontend(config: Config): void {\n const { unmount, microFrontendId, mount } = config;\n\n window.addEventListener(MOUNT_EVENT_TYPE, ((event: MountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n mount(\n event.detail.mountPoint,\n event.detail.payload,\n event.detail.mountPoint\n );\n }) as EventListener);\n\n window.addEventListener(UNMOUNT_EVENT_TYPE, ((event: UnmountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n unmount(event.detail.mountPoint);\n }) as EventListener);\n}\n","import React, { FC, ReactNode, useContext, useEffect, useState } from 'react';\nimport { assertIsDefined } from '@entur-partner/util';\nimport { Permission } from '@entur-partner/permission-client-node';\n\nimport { User } from './User';\n\ninterface AppContextType {\n getToken: () => Promise<string>;\n user: User;\n logout?: () => void;\n activeOrgId: number;\n navigate: (path: string) => void;\n}\n\nexport const AppContext = React.createContext<AppContextType | undefined>(\n undefined\n);\n\nexport const useUser = () => {\n const context = useContext(AppContext);\n assertIsDefined(context);\n return context.user;\n};\n\nexport const useActiveOrgId = () => {\n const context = useContext(AppContext);\n assertIsDefined(context);\n return context.activeOrgId;\n};\n\nexport interface AppProviderProps {\n children: ReactNode;\n getToken: () => Promise<string>;\n user: User;\n getPermissions: () => Promise<Permission[]>;\n organisationId: string;\n navigate: (path: string) => void;\n}\n\nexport const useNavigate = () => {\n const context = useContext(AppContext);\n assertIsDefined(context);\n return context.navigate;\n};\n\nexport const AppProvider: FC<AppProviderProps> = ({\n children,\n organisationId,\n getPermissions,\n ...rest\n}) => {\n const [permissions, setPermissions] = useState<Permission[]>([]);\n\n useEffect(() => {\n async function fetchData() {\n try {\n const fetchedPermissions = await getPermissions();\n setPermissions(fetchedPermissions);\n } catch (error) {\n console.error(\n 'Fetching permissions with the provided getPermissions function failed in AppProvider with the following error:',\n error\n );\n }\n }\n\n fetchData();\n }, [getPermissions]);\n\n return (\n <AppContext.Provider\n value={{\n ...rest,\n user: { ...rest.user, permissions: permissions },\n activeOrgId: Number(organisationId),\n }}\n >\n {children}\n </AppContext.Provider>\n );\n};\n"],"names":["MOUNT_EVENT_TYPE","UNMOUNT_EVENT_TYPE","createMountEvent","detail","CustomEvent","createUnmountEvent","ROUTE_CHANGE_EVENT_TYPE","RouteChangeEvent","_CustomEvent","apply","arguments","_inheritsLoose","_wrapNativeSuper","registerMicroFrontend","config","unmount","microFrontendId","mount","window","addEventListener","event","id","startsWith","mountPoint","payload","AppContext","React","createContext","undefined","useUser","context","useContext","assertIsDefined","user","useActiveOrgId","activeOrgId","useNavigate","navigate","AppProvider","_ref","children","organisationId","getPermissions","rest","_objectWithoutPropertiesLoose","_excluded","_useState","useState","permissions","setPermissions","useEffect","fetchData","_fetchData","_asyncToGenerator","_regeneratorRuntime","mark","_callee","fetchedPermissions","wrap","_callee$","_context","prev","next","sent","t0","console","error","stop","createElement","Provider","value","_extends","Number"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,IAAMA,gBAAgB,GAAG,uBAAsB;AAC/C,IAAMC,kBA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