@entur-partner/micro-frontend 2.4.3 → 2.4.5
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.
- package/dist/Payload.d.ts +1 -1
- package/dist/events.d.ts +4 -4
- package/dist/micro-frontend.cjs.development.js +265 -357
- package/dist/micro-frontend.cjs.development.js.map +1 -1
- package/dist/micro-frontend.cjs.production.min.js +1 -1
- package/dist/micro-frontend.cjs.production.min.js.map +1 -1
- package/dist/micro-frontend.esm.js +265 -357
- package/dist/micro-frontend.esm.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,351 +1,322 @@
|
|
|
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
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
6
|
-
|
|
7
20
|
_regeneratorRuntime = function () {
|
|
8
|
-
return
|
|
21
|
+
return e;
|
|
9
22
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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,
|
|
22
37
|
enumerable: !0,
|
|
23
38
|
configurable: !0,
|
|
24
39
|
writable: !0
|
|
25
|
-
}),
|
|
40
|
+
}), t[e];
|
|
26
41
|
}
|
|
27
|
-
|
|
28
42
|
try {
|
|
29
43
|
define({}, "");
|
|
30
|
-
} catch (
|
|
31
|
-
define = function (
|
|
32
|
-
return
|
|
44
|
+
} catch (t) {
|
|
45
|
+
define = function (t, e, r) {
|
|
46
|
+
return t[e] = r;
|
|
33
47
|
};
|
|
34
48
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return function (method, arg) {
|
|
43
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
44
|
-
|
|
45
|
-
if ("completed" === state) {
|
|
46
|
-
if ("throw" === method) throw arg;
|
|
47
|
-
return doneResult();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
for (context.method = method, context.arg = arg;;) {
|
|
51
|
-
var delegate = context.delegate;
|
|
52
|
-
|
|
53
|
-
if (delegate) {
|
|
54
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
55
|
-
|
|
56
|
-
if (delegateResult) {
|
|
57
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
58
|
-
return delegateResult;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
63
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
64
|
-
context.dispatchException(context.arg);
|
|
65
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
66
|
-
state = "executing";
|
|
67
|
-
var record = tryCatch(innerFn, self, context);
|
|
68
|
-
|
|
69
|
-
if ("normal" === record.type) {
|
|
70
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
71
|
-
return {
|
|
72
|
-
value: record.arg,
|
|
73
|
-
done: context.done
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
}(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;
|
|
81
56
|
}
|
|
82
|
-
|
|
83
|
-
function tryCatch(fn, obj, arg) {
|
|
57
|
+
function tryCatch(t, e, r) {
|
|
84
58
|
try {
|
|
85
59
|
return {
|
|
86
60
|
type: "normal",
|
|
87
|
-
arg:
|
|
61
|
+
arg: t.call(e, r)
|
|
88
62
|
};
|
|
89
|
-
} catch (
|
|
63
|
+
} catch (t) {
|
|
90
64
|
return {
|
|
91
65
|
type: "throw",
|
|
92
|
-
arg:
|
|
66
|
+
arg: t
|
|
93
67
|
};
|
|
94
68
|
}
|
|
95
69
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
70
|
+
e.wrap = wrap;
|
|
71
|
+
var h = "suspendedStart",
|
|
72
|
+
l = "suspendedYield",
|
|
73
|
+
f = "executing",
|
|
74
|
+
s = "completed",
|
|
75
|
+
y = {};
|
|
100
76
|
function Generator() {}
|
|
101
|
-
|
|
102
77
|
function GeneratorFunction() {}
|
|
103
|
-
|
|
104
78
|
function GeneratorFunctionPrototype() {}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
79
|
+
var p = {};
|
|
80
|
+
define(p, a, function () {
|
|
108
81
|
return this;
|
|
109
82
|
});
|
|
110
|
-
var
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
var
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
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);
|
|
119
91
|
});
|
|
120
92
|
});
|
|
121
93
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
invoke("
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
}, function (error) {
|
|
137
|
-
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);
|
|
138
108
|
});
|
|
139
109
|
}
|
|
140
|
-
|
|
141
|
-
reject(record.arg);
|
|
110
|
+
a(c.arg);
|
|
142
111
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
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();
|
|
151
121
|
}
|
|
152
|
-
|
|
153
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
154
|
-
};
|
|
122
|
+
});
|
|
155
123
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
+
};
|
|
164
134
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
+
};
|
|
173
160
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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);
|
|
169
|
+
}
|
|
170
|
+
function pushTryEntry(t) {
|
|
171
|
+
var e = {
|
|
172
|
+
tryLoc: t[0]
|
|
178
173
|
};
|
|
179
|
-
1 in
|
|
174
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
180
175
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
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;
|
|
185
179
|
}
|
|
186
|
-
|
|
187
|
-
function Context(tryLocsList) {
|
|
180
|
+
function Context(t) {
|
|
188
181
|
this.tryEntries = [{
|
|
189
182
|
tryLoc: "root"
|
|
190
|
-
}],
|
|
183
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
191
184
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (
|
|
197
|
-
if (
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
next =
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return next.value = undefined, next.done = !0, next;
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
return next.next = 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;
|
|
195
|
+
};
|
|
196
|
+
return i.next = i;
|
|
208
197
|
}
|
|
209
198
|
}
|
|
210
|
-
|
|
211
|
-
return {
|
|
212
|
-
next: doneResult
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
function doneResult() {
|
|
217
|
-
return {
|
|
218
|
-
value: undefined,
|
|
219
|
-
done: !0
|
|
220
|
-
};
|
|
199
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
221
200
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
},
|
|
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) {
|
|
229
213
|
return {
|
|
230
|
-
__await:
|
|
214
|
+
__await: t
|
|
231
215
|
};
|
|
232
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
216
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
233
217
|
return this;
|
|
234
|
-
}),
|
|
235
|
-
void 0 ===
|
|
236
|
-
var
|
|
237
|
-
return
|
|
238
|
-
return
|
|
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();
|
|
239
223
|
});
|
|
240
|
-
}, defineIteratorMethods(
|
|
224
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
241
225
|
return this;
|
|
242
|
-
}), define(
|
|
226
|
+
}), define(g, "toString", function () {
|
|
243
227
|
return "[object Generator]";
|
|
244
|
-
}),
|
|
245
|
-
var
|
|
246
|
-
|
|
247
|
-
for (var
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
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;
|
|
253
236
|
}
|
|
254
|
-
|
|
255
237
|
return next.done = !0, next;
|
|
256
238
|
};
|
|
257
|
-
},
|
|
239
|
+
}, e.values = values, Context.prototype = {
|
|
258
240
|
constructor: Context,
|
|
259
|
-
reset: function (
|
|
260
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
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);
|
|
261
243
|
},
|
|
262
244
|
stop: function () {
|
|
263
245
|
this.done = !0;
|
|
264
|
-
var
|
|
265
|
-
if ("throw" ===
|
|
246
|
+
var t = this.tryEntries[0].completion;
|
|
247
|
+
if ("throw" === t.type) throw t.arg;
|
|
266
248
|
return this.rval;
|
|
267
249
|
},
|
|
268
|
-
dispatchException: function (
|
|
269
|
-
if (this.done) throw
|
|
270
|
-
var
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
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;
|
|
274
255
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
if (
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
if (
|
|
286
|
-
if (this.prev <
|
|
287
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
288
|
-
} else if (hasCatch) {
|
|
289
|
-
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);
|
|
290
268
|
} else {
|
|
291
|
-
if (!
|
|
292
|
-
if (this.prev <
|
|
269
|
+
if (!u) throw Error("try statement without catch or finally");
|
|
270
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
293
271
|
}
|
|
294
272
|
}
|
|
295
273
|
}
|
|
296
274
|
},
|
|
297
|
-
abrupt: function (
|
|
298
|
-
for (var
|
|
299
|
-
var
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
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;
|
|
303
280
|
break;
|
|
304
281
|
}
|
|
305
282
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
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);
|
|
310
286
|
},
|
|
311
|
-
complete: function (
|
|
312
|
-
if ("throw" ===
|
|
313
|
-
return "break" ===
|
|
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;
|
|
314
290
|
},
|
|
315
|
-
finish: function (
|
|
316
|
-
for (var
|
|
317
|
-
var
|
|
318
|
-
if (
|
|
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;
|
|
319
295
|
}
|
|
320
296
|
},
|
|
321
|
-
catch: function (
|
|
322
|
-
for (var
|
|
323
|
-
var
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
var thrown = record.arg;
|
|
330
|
-
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);
|
|
331
305
|
}
|
|
332
|
-
|
|
333
|
-
return thrown;
|
|
306
|
+
return o;
|
|
334
307
|
}
|
|
335
308
|
}
|
|
336
|
-
|
|
337
|
-
throw new Error("illegal catch attempt");
|
|
309
|
+
throw Error("illegal catch attempt");
|
|
338
310
|
},
|
|
339
|
-
delegateYield: function (
|
|
311
|
+
delegateYield: function (e, r, n) {
|
|
340
312
|
return this.delegate = {
|
|
341
|
-
iterator: values(
|
|
342
|
-
resultName:
|
|
343
|
-
nextLoc:
|
|
344
|
-
}, "next" === this.method && (this.arg =
|
|
313
|
+
iterator: values(e),
|
|
314
|
+
resultName: r,
|
|
315
|
+
nextLoc: n
|
|
316
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
345
317
|
}
|
|
346
|
-
},
|
|
318
|
+
}, e;
|
|
347
319
|
}
|
|
348
|
-
|
|
349
320
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
350
321
|
try {
|
|
351
322
|
var info = gen[key](arg);
|
|
@@ -354,65 +325,53 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
354
325
|
reject(error);
|
|
355
326
|
return;
|
|
356
327
|
}
|
|
357
|
-
|
|
358
328
|
if (info.done) {
|
|
359
329
|
resolve(value);
|
|
360
330
|
} else {
|
|
361
331
|
Promise.resolve(value).then(_next, _throw);
|
|
362
332
|
}
|
|
363
333
|
}
|
|
364
|
-
|
|
365
334
|
function _asyncToGenerator(fn) {
|
|
366
335
|
return function () {
|
|
367
336
|
var self = this,
|
|
368
|
-
|
|
337
|
+
args = arguments;
|
|
369
338
|
return new Promise(function (resolve, reject) {
|
|
370
339
|
var gen = fn.apply(self, args);
|
|
371
|
-
|
|
372
340
|
function _next(value) {
|
|
373
341
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
374
342
|
}
|
|
375
|
-
|
|
376
343
|
function _throw(err) {
|
|
377
344
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
378
345
|
}
|
|
379
|
-
|
|
380
346
|
_next(undefined);
|
|
381
347
|
});
|
|
382
348
|
};
|
|
383
349
|
}
|
|
384
|
-
|
|
385
350
|
function _extends() {
|
|
386
351
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
387
352
|
for (var i = 1; i < arguments.length; i++) {
|
|
388
353
|
var source = arguments[i];
|
|
389
|
-
|
|
390
354
|
for (var key in source) {
|
|
391
355
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
392
356
|
target[key] = source[key];
|
|
393
357
|
}
|
|
394
358
|
}
|
|
395
359
|
}
|
|
396
|
-
|
|
397
360
|
return target;
|
|
398
361
|
};
|
|
399
362
|
return _extends.apply(this, arguments);
|
|
400
363
|
}
|
|
401
|
-
|
|
402
364
|
function _inheritsLoose(subClass, superClass) {
|
|
403
365
|
subClass.prototype = Object.create(superClass.prototype);
|
|
404
366
|
subClass.prototype.constructor = subClass;
|
|
405
|
-
|
|
406
367
|
_setPrototypeOf(subClass, superClass);
|
|
407
368
|
}
|
|
408
|
-
|
|
409
369
|
function _getPrototypeOf(o) {
|
|
410
370
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
411
371
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
412
372
|
};
|
|
413
373
|
return _getPrototypeOf(o);
|
|
414
374
|
}
|
|
415
|
-
|
|
416
375
|
function _setPrototypeOf(o, p) {
|
|
417
376
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
418
377
|
o.__proto__ = p;
|
|
@@ -420,61 +379,27 @@ function _setPrototypeOf(o, p) {
|
|
|
420
379
|
};
|
|
421
380
|
return _setPrototypeOf(o, p);
|
|
422
381
|
}
|
|
423
|
-
|
|
424
|
-
function _isNativeReflectConstruct() {
|
|
425
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
426
|
-
if (Reflect.construct.sham) return false;
|
|
427
|
-
if (typeof Proxy === "function") return true;
|
|
428
|
-
|
|
382
|
+
function _isNativeFunction(fn) {
|
|
429
383
|
try {
|
|
430
|
-
|
|
431
|
-
return true;
|
|
384
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
432
385
|
} catch (e) {
|
|
433
|
-
return
|
|
386
|
+
return typeof fn === "function";
|
|
434
387
|
}
|
|
435
388
|
}
|
|
436
|
-
|
|
437
|
-
function _construct(Parent, args, Class) {
|
|
438
|
-
if (_isNativeReflectConstruct()) {
|
|
439
|
-
_construct = Reflect.construct.bind();
|
|
440
|
-
} else {
|
|
441
|
-
_construct = function _construct(Parent, args, Class) {
|
|
442
|
-
var a = [null];
|
|
443
|
-
a.push.apply(a, args);
|
|
444
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
445
|
-
var instance = new Constructor();
|
|
446
|
-
if (Class) _setPrototypeOf(instance, Class.prototype);
|
|
447
|
-
return instance;
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
return _construct.apply(null, arguments);
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
function _isNativeFunction(fn) {
|
|
455
|
-
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
389
|
function _wrapNativeSuper(Class) {
|
|
459
390
|
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
460
|
-
|
|
461
391
|
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
|
462
392
|
if (Class === null || !_isNativeFunction(Class)) return Class;
|
|
463
|
-
|
|
464
393
|
if (typeof Class !== "function") {
|
|
465
394
|
throw new TypeError("Super expression must either be null or a function");
|
|
466
395
|
}
|
|
467
|
-
|
|
468
396
|
if (typeof _cache !== "undefined") {
|
|
469
397
|
if (_cache.has(Class)) return _cache.get(Class);
|
|
470
|
-
|
|
471
398
|
_cache.set(Class, Wrapper);
|
|
472
399
|
}
|
|
473
|
-
|
|
474
400
|
function Wrapper() {
|
|
475
401
|
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
|
476
402
|
}
|
|
477
|
-
|
|
478
403
|
Wrapper.prototype = Object.create(Class.prototype, {
|
|
479
404
|
constructor: {
|
|
480
405
|
value: Wrapper,
|
|
@@ -485,22 +410,18 @@ function _wrapNativeSuper(Class) {
|
|
|
485
410
|
});
|
|
486
411
|
return _setPrototypeOf(Wrapper, Class);
|
|
487
412
|
};
|
|
488
|
-
|
|
489
413
|
return _wrapNativeSuper(Class);
|
|
490
414
|
}
|
|
491
|
-
|
|
492
415
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
493
416
|
if (source == null) return {};
|
|
494
417
|
var target = {};
|
|
495
418
|
var sourceKeys = Object.keys(source);
|
|
496
419
|
var key, i;
|
|
497
|
-
|
|
498
420
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
499
421
|
key = sourceKeys[i];
|
|
500
422
|
if (excluded.indexOf(key) >= 0) continue;
|
|
501
423
|
target[key] = source[key];
|
|
502
424
|
}
|
|
503
|
-
|
|
504
425
|
return target;
|
|
505
426
|
}
|
|
506
427
|
|
|
@@ -518,31 +439,27 @@ function createUnmountEvent(detail) {
|
|
|
518
439
|
}
|
|
519
440
|
var ROUTE_CHANGE_EVENT_TYPE = '@entur-partner:after-route-change';
|
|
520
441
|
var RouteChangeEvent = /*#__PURE__*/function (_CustomEvent) {
|
|
521
|
-
_inheritsLoose(RouteChangeEvent, _CustomEvent);
|
|
522
|
-
|
|
523
442
|
function RouteChangeEvent() {
|
|
524
443
|
return _CustomEvent.apply(this, arguments) || this;
|
|
525
444
|
}
|
|
526
|
-
|
|
445
|
+
_inheritsLoose(RouteChangeEvent, _CustomEvent);
|
|
527
446
|
return RouteChangeEvent;
|
|
528
447
|
}( /*#__PURE__*/_wrapNativeSuper(CustomEvent));
|
|
529
448
|
|
|
530
449
|
function registerMicroFrontend(config) {
|
|
531
450
|
var unmount = config.unmount,
|
|
532
|
-
|
|
533
|
-
|
|
451
|
+
microFrontendId = config.microFrontendId,
|
|
452
|
+
mount = config.mount;
|
|
534
453
|
window.addEventListener(MOUNT_EVENT_TYPE, function (event) {
|
|
535
454
|
if (!event.detail.id.startsWith(microFrontendId)) {
|
|
536
455
|
return;
|
|
537
456
|
}
|
|
538
|
-
|
|
539
457
|
mount(event.detail.mountPoint, event.detail.payload, event.detail.mountPoint);
|
|
540
458
|
});
|
|
541
459
|
window.addEventListener(UNMOUNT_EVENT_TYPE, function (event) {
|
|
542
460
|
if (!event.detail.id.startsWith(microFrontendId)) {
|
|
543
461
|
return;
|
|
544
462
|
}
|
|
545
|
-
|
|
546
463
|
unmount(event.detail.mountPoint);
|
|
547
464
|
});
|
|
548
465
|
}
|
|
@@ -566,51 +483,42 @@ var useNavigate = function useNavigate() {
|
|
|
566
483
|
};
|
|
567
484
|
var AppProvider = function AppProvider(_ref) {
|
|
568
485
|
var children = _ref.children,
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
486
|
+
organisationId = _ref.organisationId,
|
|
487
|
+
getPermissions = _ref.getPermissions,
|
|
488
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
573
489
|
var _useState = useState([]),
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
490
|
+
permissions = _useState[0],
|
|
491
|
+
setPermissions = _useState[1];
|
|
577
492
|
useEffect(function () {
|
|
578
493
|
function fetchData() {
|
|
579
494
|
return _fetchData.apply(this, arguments);
|
|
580
495
|
}
|
|
581
|
-
|
|
582
496
|
function _fetchData() {
|
|
583
497
|
_fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
584
498
|
var fetchedPermissions;
|
|
585
499
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
586
|
-
while (1) {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
case 10:
|
|
605
|
-
case "end":
|
|
606
|
-
return _context.stop();
|
|
607
|
-
}
|
|
500
|
+
while (1) switch (_context.prev = _context.next) {
|
|
501
|
+
case 0:
|
|
502
|
+
_context.prev = 0;
|
|
503
|
+
_context.next = 3;
|
|
504
|
+
return getPermissions();
|
|
505
|
+
case 3:
|
|
506
|
+
fetchedPermissions = _context.sent;
|
|
507
|
+
setPermissions(fetchedPermissions);
|
|
508
|
+
_context.next = 10;
|
|
509
|
+
break;
|
|
510
|
+
case 7:
|
|
511
|
+
_context.prev = 7;
|
|
512
|
+
_context.t0 = _context["catch"](0);
|
|
513
|
+
console.error('Fetching permissions with the provided getPermissions function failed in AppProvider with the following error:', _context.t0);
|
|
514
|
+
case 10:
|
|
515
|
+
case "end":
|
|
516
|
+
return _context.stop();
|
|
608
517
|
}
|
|
609
518
|
}, _callee, null, [[0, 7]]);
|
|
610
519
|
}));
|
|
611
520
|
return _fetchData.apply(this, arguments);
|
|
612
521
|
}
|
|
613
|
-
|
|
614
522
|
fetchData();
|
|
615
523
|
}, [getPermissions]);
|
|
616
524
|
return React.createElement(AppContext.Provider, {
|