kaafil-react-uikit 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/admin/index.cjs +394 -355
- package/dist/admin/index.cjs.map +1 -1
- package/dist/admin/index.js +55 -16
- package/dist/admin/index.js.map +1 -1
- package/dist/{chunk-762SWUEG.js → chunk-4BPCKBLP.js} +3 -3
- package/dist/{chunk-762SWUEG.js.map → chunk-4BPCKBLP.js.map} +1 -1
- package/dist/{chunk-CK3L6Y43.cjs → chunk-4QMYUKW4.cjs} +10 -2
- package/dist/chunk-4QMYUKW4.cjs.map +1 -0
- package/dist/{chunk-LO3GQFQ6.cjs → chunk-53ITV6GF.cjs} +4 -4
- package/dist/{chunk-LO3GQFQ6.cjs.map → chunk-53ITV6GF.cjs.map} +1 -1
- package/dist/{chunk-IBVCH6GC.cjs → chunk-77RKNRNH.cjs} +55 -55
- package/dist/{chunk-IBVCH6GC.cjs.map → chunk-77RKNRNH.cjs.map} +1 -1
- package/dist/{chunk-DI77H7ED.cjs → chunk-AWOKWGTB.cjs} +83 -83
- package/dist/{chunk-DI77H7ED.cjs.map → chunk-AWOKWGTB.cjs.map} +1 -1
- package/dist/{chunk-EDLIJSMR.js → chunk-CJMUPBZ7.js} +5 -5
- package/dist/{chunk-EDLIJSMR.js.map → chunk-CJMUPBZ7.js.map} +1 -1
- package/dist/{chunk-ITGVRN2S.js → chunk-F6B4CDUL.js} +3 -3
- package/dist/{chunk-ITGVRN2S.js.map → chunk-F6B4CDUL.js.map} +1 -1
- package/dist/{chunk-XU7GP53M.js → chunk-F6YBM6EE.js} +3 -3
- package/dist/{chunk-XU7GP53M.js.map → chunk-F6YBM6EE.js.map} +1 -1
- package/dist/{chunk-FEJL6GKJ.js → chunk-HNENKHHJ.js} +5 -5
- package/dist/{chunk-FEJL6GKJ.js.map → chunk-HNENKHHJ.js.map} +1 -1
- package/dist/{chunk-RW6TJMRK.js → chunk-JHLPO6LZ.js} +3 -3
- package/dist/{chunk-RW6TJMRK.js.map → chunk-JHLPO6LZ.js.map} +1 -1
- package/dist/{chunk-3RZDHDEY.cjs → chunk-OOHU3ECL.cjs} +17 -17
- package/dist/{chunk-3RZDHDEY.cjs.map → chunk-OOHU3ECL.cjs.map} +1 -1
- package/dist/{chunk-3E2FN5JJ.js → chunk-PWZNUXKT.js} +3 -3
- package/dist/{chunk-3E2FN5JJ.js.map → chunk-PWZNUXKT.js.map} +1 -1
- package/dist/{chunk-6FUVFVYY.js → chunk-SEPFCHBJ.js} +10 -2
- package/dist/chunk-SEPFCHBJ.js.map +1 -0
- package/dist/chunk-V45VFRBI.cjs +12 -0
- package/dist/{chunk-62HCQWZL.cjs.map → chunk-V45VFRBI.cjs.map} +1 -1
- package/dist/{chunk-QD4Z5DRT.cjs → chunk-XPCCR7OH.cjs} +12 -12
- package/dist/{chunk-QD4Z5DRT.cjs.map → chunk-XPCCR7OH.cjs.map} +1 -1
- package/dist/{chunk-XYIOM75D.cjs → chunk-XPF737RG.cjs} +9 -9
- package/dist/{chunk-XYIOM75D.cjs.map → chunk-XPF737RG.cjs.map} +1 -1
- package/dist/core/index.cjs +107 -107
- package/dist/core/index.js +10 -10
- package/dist/manager/index.cjs +239 -239
- package/dist/manager/index.js +6 -6
- package/dist/traveller/index.cjs +35 -35
- package/dist/traveller/index.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-62HCQWZL.cjs +0 -12
- package/dist/chunk-6FUVFVYY.js.map +0 -1
- package/dist/chunk-CK3L6Y43.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk4QMYUKW4_cjs = require('./chunk-4QMYUKW4.cjs');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
|
|
6
6
|
var TICK_INTERVAL_MS = 1e3;
|
|
7
7
|
function useServerTime() {
|
|
8
|
-
const engine = react.useContext(
|
|
8
|
+
const engine = react.useContext(chunk4QMYUKW4_cjs.OfflineEngineContext);
|
|
9
9
|
const [lastServerTime, setLastServerTime] = react.useState(void 0);
|
|
10
10
|
const observedAtPerfRef = react.useRef(void 0);
|
|
11
11
|
const [, forceTick] = react.useState(0);
|
|
@@ -39,5 +39,5 @@ function useServerTime() {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
exports.useServerTime = useServerTime;
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-53ITV6GF.cjs.map
|
|
43
|
+
//# sourceMappingURL=chunk-53ITV6GF.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/hooks/useServerTime.ts"],"names":["useContext","OfflineEngineContext","useState","useRef","useEffect"],"mappings":";;;;;AA8BA,IAAM,gBAAA,GAAmB,GAAA;AAElB,SAAS,aAAA,GAA+B;AAC7C,EAAA,MAAM,MAAA,GAASA,iBAAWC,sCAAoB,CAAA;AAC9C,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAIC,eAA6B,MAAS,CAAA;AAClF,EAAA,MAAM,iBAAA,GAAoBC,aAA2B,MAAS,CAAA;AAC9D,EAAA,MAAM,GAAG,SAAS,CAAA,GAAID,eAAS,CAAC,CAAA;AAEhC,EAAAE,eAAA,CAAU,MAAM;AACd,IAAA,IAAI,WAAW,IAAA,EAAM;AACnB,MAAA;AAAA,IACF;AAKA,IAAA,MAAM,cAAc,MAAA,CAAO,MAAA,CAAO,EAAA,CAAG,kBAAA,EAAoB,CAAC,KAAA,KAAU;AASlE,MAAA,IAAI,KAAA,CAAM,eAAe,MAAA,EAAW;AAClC,QAAA;AAAA,MACF;AACA,MAAA,iBAAA,CAAkB,OAAA,GAAU,YAAY,GAAA,EAAI;AAC5C,MAAA,iBAAA,CAAkB,MAAM,UAAU,CAAA;AAAA,IACpC,CAAC,CAAA;AACD,IAAA,OAAO,WAAA;AAAA,EACT,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AAEX,EAAAA,eAAA,CAAU,MAAM;AACd,IAAA,MAAM,EAAA,GAAK,YAAY,MAAM,SAAA,CAAU,CAAC,IAAA,KAAS,IAAA,GAAO,CAAC,CAAA,EAAG,gBAAgB,CAAA;AAC5E,IAAA,OAAO,MAAM,cAAc,EAAE,CAAA;AAAA,EAC/B,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,SAAS,GAAA,GAAc;AACrB,IAAA,IAAI,cAAA,KAAmB,MAAA,IAAa,iBAAA,CAAkB,OAAA,KAAY,MAAA,EAAW;AAY3E,MAAA,MAAM,IAAI,KAAA;AAAA,QACR;AAAA,OAEF;AAAA,IACF;AACA,IAAA,MAAM,SAAA,GAAY,WAAA,CAAY,GAAA,EAAI,GAAI,iBAAA,CAAkB,OAAA;AACxD,IAAA,OAAO,IAAI,KAAK,IAAA,CAAK,KAAA,CAAM,cAAc,CAAA,GAAI,SAAS,EAAE,WAAA,EAAY;AAAA,EACtE;AAEA,EAAA,OAAO,EAAE,GAAA,EAAK,aAAA,EAAe,cAAA,EAAe;AAC9C","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/core/hooks/useServerTime.ts"],"names":["useContext","OfflineEngineContext","useState","useRef","useEffect"],"mappings":";;;;;AA8BA,IAAM,gBAAA,GAAmB,GAAA;AAElB,SAAS,aAAA,GAA+B;AAC7C,EAAA,MAAM,MAAA,GAASA,iBAAWC,sCAAoB,CAAA;AAC9C,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAIC,eAA6B,MAAS,CAAA;AAClF,EAAA,MAAM,iBAAA,GAAoBC,aAA2B,MAAS,CAAA;AAC9D,EAAA,MAAM,GAAG,SAAS,CAAA,GAAID,eAAS,CAAC,CAAA;AAEhC,EAAAE,eAAA,CAAU,MAAM;AACd,IAAA,IAAI,WAAW,IAAA,EAAM;AACnB,MAAA;AAAA,IACF;AAKA,IAAA,MAAM,cAAc,MAAA,CAAO,MAAA,CAAO,EAAA,CAAG,kBAAA,EAAoB,CAAC,KAAA,KAAU;AASlE,MAAA,IAAI,KAAA,CAAM,eAAe,MAAA,EAAW;AAClC,QAAA;AAAA,MACF;AACA,MAAA,iBAAA,CAAkB,OAAA,GAAU,YAAY,GAAA,EAAI;AAC5C,MAAA,iBAAA,CAAkB,MAAM,UAAU,CAAA;AAAA,IACpC,CAAC,CAAA;AACD,IAAA,OAAO,WAAA;AAAA,EACT,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AAEX,EAAAA,eAAA,CAAU,MAAM;AACd,IAAA,MAAM,EAAA,GAAK,YAAY,MAAM,SAAA,CAAU,CAAC,IAAA,KAAS,IAAA,GAAO,CAAC,CAAA,EAAG,gBAAgB,CAAA;AAC5E,IAAA,OAAO,MAAM,cAAc,EAAE,CAAA;AAAA,EAC/B,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,SAAS,GAAA,GAAc;AACrB,IAAA,IAAI,cAAA,KAAmB,MAAA,IAAa,iBAAA,CAAkB,OAAA,KAAY,MAAA,EAAW;AAY3E,MAAA,MAAM,IAAI,KAAA;AAAA,QACR;AAAA,OAEF;AAAA,IACF;AACA,IAAA,MAAM,SAAA,GAAY,WAAA,CAAY,GAAA,EAAI,GAAI,iBAAA,CAAkB,OAAA;AACxD,IAAA,OAAO,IAAI,KAAK,IAAA,CAAK,KAAA,CAAM,cAAc,CAAA,GAAI,SAAS,EAAE,WAAA,EAAY;AAAA,EACtE;AAEA,EAAA,OAAO,EAAE,GAAA,EAAK,aAAA,EAAe,cAAA,EAAe;AAC9C","file":"chunk-53ITV6GF.cjs","sourcesContent":["'use client';\n\n// `08-core-hooks.md §1.6`. The single place that turns the stream of\n// `meta.serverTime` stamps into a usable clock, so no composite reads\n// `meta.serverTime` off an individual response by hand.\n//\n// Hard rule #6 (\"Zero `Date.now()`/`new Date()` local getters in\n// `src/core`\") bans exactly the two calls that fabricate \"now\" from the\n// local wall clock: `Date.now()` and no-argument `new Date()`. This file\n// never calls either. Advancing a SERVER-supplied timestamp by an elapsed\n// delta necessarily needs SOME measure of \"how much local time passed\" —\n// this file measures that with `performance.now()`, a monotonic clock with\n// no relationship to wall-clock \"now\" (it cannot be read as a date, only as\n// a duration), and applies the delta with `new Date(<epoch-ms>)` /\n// `Date.parse(<iso-string>)` — both single-argument forms that operate on a\n// value already anchored to `meta.serverTime`, never on the local clock.\n\nimport { useContext, useEffect, useRef, useState } from 'react';\nimport { OfflineEngineContext } from '../internal/contexts';\n\nexport interface ServerTimeApi {\n now: () => string;\n sinceLastSync: string | undefined;\n}\n\n/** Re-renders any hook consumer often enough for a mounted countdown to look\n * live, without pretending the underlying value moved forward on its own\n * merits (`08-core-hooks.md §1.6`'s sandbox time-travel caveat: this timer\n * forces a re-render, it never advances the stamp past what the last real\n * response justified). */\nconst TICK_INTERVAL_MS = 1000;\n\nexport function useServerTime(): ServerTimeApi {\n const engine = useContext(OfflineEngineContext);\n const [lastServerTime, setLastServerTime] = useState<string | undefined>(undefined);\n const observedAtPerfRef = useRef<number | undefined>(undefined);\n const [, forceTick] = useState(0);\n\n useEffect(() => {\n if (engine === null) {\n return;\n }\n // `snapshot.updated` is the one event in `OfflineEventMap` that carries\n // `serverTime` (`kaafil-js/src/offline/events.ts`, verified this\n // session) — the engine's other five events do not, so this is the only\n // subscription this hook can build without inventing a stamp.\n const unsubscribe = engine.events.on('snapshot.updated', (event) => {\n // `serverTime` is ABSENT on a change that never involved the server —\n // an optimistic create painted while offline, or an op the host\n // discarded (`kaafil-js/src/offline/events.ts`). Those are real snapshot\n // changes and a list must repaint for them, but they carry no reading,\n // and taking `undefined` here would erase the last real one this\n // session had: `now()` would start throwing again mid-session, on a\n // device that HAS heard from the server, because the manager ticked\n // something off out of signal.\n if (event.serverTime === undefined) {\n return;\n }\n observedAtPerfRef.current = performance.now();\n setLastServerTime(event.serverTime);\n });\n return unsubscribe;\n }, [engine]);\n\n useEffect(() => {\n const id = setInterval(() => forceTick((tick) => tick + 1), TICK_INTERVAL_MS);\n return () => clearInterval(id);\n }, []);\n\n function now(): string {\n if (lastServerTime === undefined || observedAtPerfRef.current === undefined) {\n // No response has ever landed in this session yet. Fabricating a\n // value from the local wall clock is exactly what hard rule #6\n // forbids — this is the one case this hook cannot silently satisfy\n // its own non-optional return type, so it says so loudly instead.\n // CALLERS: this is a real, expected window — React runs an effect\n // (which is how this hook's own subscription above starts) strictly\n // AFTER the render that needs `now()`'s result has already committed,\n // so a component's very FIRST render can hit this throw even when\n // wired up correctly. Guard the call site, matching\n // `useStaleness.ts`'s own precedent, rather than reaching for a\n // device-clock fallback here (hard rule #6 forbids exactly that).\n throw new Error(\n 'useServerTime().now() was called before any response carrying meta.serverTime ' +\n 'had been observed — there is no server timestamp yet to advance from.',\n );\n }\n const elapsedMs = performance.now() - observedAtPerfRef.current;\n return new Date(Date.parse(lastServerTime) + elapsedMs).toISOString();\n }\n\n return { now, sinceLastSync: lastServerTime };\n}\n"]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkAWOKWGTB_cjs = require('./chunk-AWOKWGTB.cjs');
|
|
4
|
+
var chunk53ITV6GF_cjs = require('./chunk-53ITV6GF.cjs');
|
|
5
|
+
var chunk4QMYUKW4_cjs = require('./chunk-4QMYUKW4.cjs');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var client = require('kaafil-js/client');
|
|
8
8
|
var reactDom = require('react-dom');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
10
|
|
|
11
11
|
function useAgencyAdminMe() {
|
|
12
|
-
const client =
|
|
12
|
+
const client = chunk4QMYUKW4_cjs.useKaafilClient();
|
|
13
13
|
const [result, setResult] = react.useState({ status: "loading" });
|
|
14
14
|
react.useEffect(() => {
|
|
15
15
|
let cancelled = false;
|
|
@@ -31,7 +31,7 @@ function useAgencyAdminMe() {
|
|
|
31
31
|
return result;
|
|
32
32
|
}
|
|
33
33
|
function useAgencyChecklistTemplates() {
|
|
34
|
-
const client =
|
|
34
|
+
const client = chunk4QMYUKW4_cjs.useKaafilClient();
|
|
35
35
|
const [templates, setTemplates] = react.useState([]);
|
|
36
36
|
const [loaded, setLoaded] = react.useState(false);
|
|
37
37
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -91,7 +91,7 @@ function useAgencyChecklistTemplates() {
|
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
function useAgencyForms() {
|
|
94
|
-
const client =
|
|
94
|
+
const client = chunk4QMYUKW4_cjs.useKaafilClient();
|
|
95
95
|
const [forms, setForms] = react.useState([]);
|
|
96
96
|
const [loaded, setLoaded] = react.useState(false);
|
|
97
97
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -247,7 +247,7 @@ function useAgencyForms() {
|
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
249
|
function useAgencyJourneyTriggers() {
|
|
250
|
-
const client =
|
|
250
|
+
const client = chunk4QMYUKW4_cjs.useKaafilClient();
|
|
251
251
|
const [triggers, setTriggers] = react.useState([]);
|
|
252
252
|
const [loaded, setLoaded] = react.useState(false);
|
|
253
253
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -275,7 +275,7 @@ function useAgencyJourneyTriggers() {
|
|
|
275
275
|
return { triggers, loaded, lastFetchFailed, refresh, patchTrigger };
|
|
276
276
|
}
|
|
277
277
|
function useAgencyManagerProfile(managerRef) {
|
|
278
|
-
const client =
|
|
278
|
+
const client = chunk4QMYUKW4_cjs.useKaafilClient();
|
|
279
279
|
const [read, setRead] = react.useState(void 0);
|
|
280
280
|
const [readFailed, setReadFailed] = react.useState(false);
|
|
281
281
|
const refresh = react.useCallback(async () => {
|
|
@@ -293,7 +293,7 @@ function useAgencyManagerProfile(managerRef) {
|
|
|
293
293
|
return { read, readFailed, refresh };
|
|
294
294
|
}
|
|
295
295
|
function useAgencySettings() {
|
|
296
|
-
const client =
|
|
296
|
+
const client = chunk4QMYUKW4_cjs.useKaafilClient();
|
|
297
297
|
const [document2, setDocument] = react.useState(void 0);
|
|
298
298
|
const [loaded, setLoaded] = react.useState(false);
|
|
299
299
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -321,7 +321,7 @@ function useAgencySettings() {
|
|
|
321
321
|
return { document: document2, loaded, lastFetchFailed, refresh, patchSettings };
|
|
322
322
|
}
|
|
323
323
|
function useAgencyTrip(tripRef) {
|
|
324
|
-
const client =
|
|
324
|
+
const client = chunk4QMYUKW4_cjs.useKaafilClient();
|
|
325
325
|
const [read, setRead] = react.useState(void 0);
|
|
326
326
|
const [readFailed, setReadFailed] = react.useState(false);
|
|
327
327
|
const refresh = react.useCallback(async () => {
|
|
@@ -341,7 +341,7 @@ function useAgencyTrip(tripRef) {
|
|
|
341
341
|
var DEFAULT_PAGE_LIMIT = 20;
|
|
342
342
|
var GROUPED_PAGE_LIMIT = 100;
|
|
343
343
|
function useAgencyTripManifest(tripRef) {
|
|
344
|
-
const client =
|
|
344
|
+
const client = chunk4QMYUKW4_cjs.useKaafilClient();
|
|
345
345
|
const [facets, setFacets] = react.useState(void 0);
|
|
346
346
|
const mountedRef = react.useRef(true);
|
|
347
347
|
react.useEffect(() => {
|
|
@@ -372,7 +372,7 @@ function useAgencyTripManifest(tripRef) {
|
|
|
372
372
|
}
|
|
373
373
|
var DEFAULT_PAGE_LIMIT2 = 20;
|
|
374
374
|
function useAgencyTrips() {
|
|
375
|
-
const client =
|
|
375
|
+
const client = chunk4QMYUKW4_cjs.useKaafilClient();
|
|
376
376
|
const [segmentCounts, setSegmentCounts] = react.useState(
|
|
377
377
|
void 0
|
|
378
378
|
);
|
|
@@ -402,18 +402,18 @@ function useAgencyTrips() {
|
|
|
402
402
|
);
|
|
403
403
|
return { makeTripsFetch, segmentCounts };
|
|
404
404
|
}
|
|
405
|
-
var useBookingsInternal =
|
|
405
|
+
var useBookingsInternal = chunkAWOKWGTB_cjs.createDomainHook("bookings", (tripRef) => {
|
|
406
406
|
const {
|
|
407
407
|
rows: bookings,
|
|
408
408
|
syncedAt,
|
|
409
409
|
refreshLive
|
|
410
|
-
} =
|
|
410
|
+
} = chunkAWOKWGTB_cjs.useSnapshotList(tripRef, "bookings", {
|
|
411
411
|
live: async (liveClient, ref) => {
|
|
412
412
|
const response = await liveClient.bookings.list({ tripRef: ref });
|
|
413
413
|
return { rows: [...response], syncedAt: response.meta.serverTime };
|
|
414
414
|
}
|
|
415
415
|
});
|
|
416
|
-
const vouchersMutation =
|
|
416
|
+
const vouchersMutation = chunk4QMYUKW4_cjs.useOfflineMutation({
|
|
417
417
|
tripRef,
|
|
418
418
|
enqueue: (engine, input) => engine.enqueue({
|
|
419
419
|
tripRef,
|
|
@@ -450,10 +450,10 @@ function useBookings(tripRef) {
|
|
|
450
450
|
return useBookingsInternal(tripRef);
|
|
451
451
|
}
|
|
452
452
|
function useCapabilityStatuses(tripRef) {
|
|
453
|
-
const { rows, loaded } =
|
|
453
|
+
const { rows, loaded } = chunk4QMYUKW4_cjs.useCapabilityRows(tripRef);
|
|
454
454
|
const statuses = react.useMemo(() => {
|
|
455
455
|
const map = /* @__PURE__ */ new Map();
|
|
456
|
-
for (const row of rows) map.set(row.capability,
|
|
456
|
+
for (const row of rows) map.set(row.capability, chunk4QMYUKW4_cjs.deriveCapabilityTriple(row).status);
|
|
457
457
|
return map;
|
|
458
458
|
}, [rows]);
|
|
459
459
|
return { statuses, loaded };
|
|
@@ -471,8 +471,8 @@ var DirectoriesWriteError = class _DirectoriesWriteError extends Error {
|
|
|
471
471
|
}
|
|
472
472
|
};
|
|
473
473
|
function useDirectories(agencyRef) {
|
|
474
|
-
const client =
|
|
475
|
-
|
|
474
|
+
const client = chunk4QMYUKW4_cjs.useKaafilClient();
|
|
475
|
+
chunk53ITV6GF_cjs.useServerTime();
|
|
476
476
|
const makeManagersFetch = react.useCallback(
|
|
477
477
|
(filters) => async (cursor) => {
|
|
478
478
|
const page = await client.agencies.managers.listPage({
|
|
@@ -519,7 +519,7 @@ function useDirectories(agencyRef) {
|
|
|
519
519
|
isLead: input.isLead
|
|
520
520
|
});
|
|
521
521
|
} catch (error) {
|
|
522
|
-
throw new DirectoriesWriteError(
|
|
522
|
+
throw new DirectoriesWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
523
523
|
}
|
|
524
524
|
},
|
|
525
525
|
[client]
|
|
@@ -534,7 +534,7 @@ function useDirectories(agencyRef) {
|
|
|
534
534
|
...input.isLead === void 0 ? {} : { isLead: input.isLead }
|
|
535
535
|
});
|
|
536
536
|
} catch (error) {
|
|
537
|
-
throw new DirectoriesWriteError(
|
|
537
|
+
throw new DirectoriesWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
538
538
|
}
|
|
539
539
|
},
|
|
540
540
|
[client]
|
|
@@ -547,7 +547,7 @@ function useDirectories(agencyRef) {
|
|
|
547
547
|
managerRef: input.managerRef
|
|
548
548
|
});
|
|
549
549
|
} catch (error) {
|
|
550
|
-
throw new DirectoriesWriteError(
|
|
550
|
+
throw new DirectoriesWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
551
551
|
}
|
|
552
552
|
},
|
|
553
553
|
[client]
|
|
@@ -582,7 +582,7 @@ function useDirectories(agencyRef) {
|
|
|
582
582
|
if (error instanceof DirectoriesWriteError) {
|
|
583
583
|
throw error;
|
|
584
584
|
}
|
|
585
|
-
throw new DirectoriesWriteError(
|
|
585
|
+
throw new DirectoriesWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
586
586
|
}
|
|
587
587
|
},
|
|
588
588
|
[client]
|
|
@@ -598,7 +598,7 @@ function useDirectories(agencyRef) {
|
|
|
598
598
|
externalTravellerId: input.externalTravellerId
|
|
599
599
|
});
|
|
600
600
|
} catch (error) {
|
|
601
|
-
throw new DirectoriesWriteError(
|
|
601
|
+
throw new DirectoriesWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
602
602
|
}
|
|
603
603
|
},
|
|
604
604
|
[client]
|
|
@@ -611,7 +611,7 @@ function useDirectories(agencyRef) {
|
|
|
611
611
|
travellerRef: input.travellerRef
|
|
612
612
|
});
|
|
613
613
|
} catch (error) {
|
|
614
|
-
throw new DirectoriesWriteError(
|
|
614
|
+
throw new DirectoriesWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
615
615
|
}
|
|
616
616
|
},
|
|
617
617
|
[client]
|
|
@@ -626,7 +626,7 @@ function useDirectories(agencyRef) {
|
|
|
626
626
|
travellerRefs: [...input.travellerRefs]
|
|
627
627
|
});
|
|
628
628
|
} catch (error) {
|
|
629
|
-
throw new DirectoriesWriteError(
|
|
629
|
+
throw new DirectoriesWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
630
630
|
}
|
|
631
631
|
},
|
|
632
632
|
[client]
|
|
@@ -643,7 +643,7 @@ function useDirectories(agencyRef) {
|
|
|
643
643
|
...input.travellerRefs !== void 0 ? { travellerRefs: [...input.travellerRefs] } : {}
|
|
644
644
|
});
|
|
645
645
|
} catch (error) {
|
|
646
|
-
throw new DirectoriesWriteError(
|
|
646
|
+
throw new DirectoriesWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
647
647
|
}
|
|
648
648
|
},
|
|
649
649
|
[client]
|
|
@@ -653,7 +653,7 @@ function useDirectories(agencyRef) {
|
|
|
653
653
|
try {
|
|
654
654
|
await client.trips.parties.remove({ tripRef: input.tripRef, partyId: input.partyId });
|
|
655
655
|
} catch (error) {
|
|
656
|
-
throw new DirectoriesWriteError(
|
|
656
|
+
throw new DirectoriesWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
657
657
|
}
|
|
658
658
|
},
|
|
659
659
|
[client]
|
|
@@ -667,7 +667,7 @@ function useDirectories(agencyRef) {
|
|
|
667
667
|
body: input.body
|
|
668
668
|
});
|
|
669
669
|
} catch (error) {
|
|
670
|
-
throw new DirectoriesWriteError(
|
|
670
|
+
throw new DirectoriesWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
671
671
|
}
|
|
672
672
|
},
|
|
673
673
|
[client]
|
|
@@ -714,7 +714,7 @@ function usePaginatedList(fetch, options) {
|
|
|
714
714
|
setPageIndex(index);
|
|
715
715
|
setError(void 0);
|
|
716
716
|
} catch (caught) {
|
|
717
|
-
setError(
|
|
717
|
+
setError(chunkAWOKWGTB_cjs.classifyError(caught));
|
|
718
718
|
setHasNext(false);
|
|
719
719
|
} finally {
|
|
720
720
|
setSettled(true);
|
|
@@ -773,7 +773,7 @@ var ShareLinkWriteError = class extends Error {
|
|
|
773
773
|
}
|
|
774
774
|
};
|
|
775
775
|
function useShareLinks(tripRef, travellerRef) {
|
|
776
|
-
const client =
|
|
776
|
+
const client = chunk4QMYUKW4_cjs.useKaafilClient();
|
|
777
777
|
const [links, setLinks] = react.useState(void 0);
|
|
778
778
|
const [readFailed, setReadFailed] = react.useState(false);
|
|
779
779
|
const refresh = react.useCallback(async () => {
|
|
@@ -804,7 +804,7 @@ function useShareLinks(tripRef, travellerRef) {
|
|
|
804
804
|
await refresh();
|
|
805
805
|
return minted;
|
|
806
806
|
} catch (error) {
|
|
807
|
-
throw new ShareLinkWriteError(
|
|
807
|
+
throw new ShareLinkWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
808
808
|
}
|
|
809
809
|
},
|
|
810
810
|
[client, tripRef, refresh]
|
|
@@ -815,7 +815,7 @@ function useShareLinks(tripRef, travellerRef) {
|
|
|
815
815
|
await client.shareTokens.revoke({ id });
|
|
816
816
|
await refresh();
|
|
817
817
|
} catch (error) {
|
|
818
|
-
throw new ShareLinkWriteError(
|
|
818
|
+
throw new ShareLinkWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
819
819
|
}
|
|
820
820
|
},
|
|
821
821
|
[client, refresh]
|
|
@@ -831,7 +831,7 @@ function useShareLinks(tripRef, travellerRef) {
|
|
|
831
831
|
});
|
|
832
832
|
await refresh();
|
|
833
833
|
} catch (error) {
|
|
834
|
-
throw new ShareLinkWriteError(
|
|
834
|
+
throw new ShareLinkWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
835
835
|
}
|
|
836
836
|
},
|
|
837
837
|
[client, refresh]
|
|
@@ -843,7 +843,7 @@ function useShareLinks(tripRef, travellerRef) {
|
|
|
843
843
|
await refresh();
|
|
844
844
|
return minted;
|
|
845
845
|
} catch (error) {
|
|
846
|
-
throw new ShareLinkWriteError(
|
|
846
|
+
throw new ShareLinkWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
847
847
|
}
|
|
848
848
|
},
|
|
849
849
|
[client, refresh]
|
|
@@ -854,7 +854,7 @@ function useShareLinks(tripRef, travellerRef) {
|
|
|
854
854
|
const response = await client.shareTokens.reveal({ id });
|
|
855
855
|
return response.token;
|
|
856
856
|
} catch (error) {
|
|
857
|
-
throw new ShareLinkWriteError(
|
|
857
|
+
throw new ShareLinkWriteError(chunkAWOKWGTB_cjs.classifyError(error));
|
|
858
858
|
}
|
|
859
859
|
},
|
|
860
860
|
[client]
|
|
@@ -862,7 +862,7 @@ function useShareLinks(tripRef, travellerRef) {
|
|
|
862
862
|
return { links, readFailed, refresh, mint, revoke, patch, regenerate, reveal };
|
|
863
863
|
}
|
|
864
864
|
function useTravellerFormResponses(tripRef, travellerRef) {
|
|
865
|
-
const client =
|
|
865
|
+
const client = chunk4QMYUKW4_cjs.useKaafilClient();
|
|
866
866
|
const [responses, setResponses] = react.useState(
|
|
867
867
|
void 0
|
|
868
868
|
);
|
|
@@ -917,7 +917,7 @@ function ShadowIsolationBoundary({
|
|
|
917
917
|
}
|
|
918
918
|
function useDeskMinimumWidthWarning(rootRef, frame) {
|
|
919
919
|
react.useEffect(() => {
|
|
920
|
-
if (frame !== "desk" || !
|
|
920
|
+
if (frame !== "desk" || !chunk4QMYUKW4_cjs.isDevelopment() || typeof ResizeObserver === "undefined") {
|
|
921
921
|
return;
|
|
922
922
|
}
|
|
923
923
|
const node = rootRef.current;
|
|
@@ -943,7 +943,7 @@ function useDeskMinimumWidthWarning(rootRef, frame) {
|
|
|
943
943
|
}
|
|
944
944
|
function useUnfilledConnectivitySlotWarning(frame, connectivitySlot) {
|
|
945
945
|
react.useEffect(() => {
|
|
946
|
-
if (frame === "field" && connectivitySlot === void 0 &&
|
|
946
|
+
if (frame === "field" && connectivitySlot === void 0 && chunk4QMYUKW4_cjs.isDevelopment()) {
|
|
947
947
|
console.warn(
|
|
948
948
|
`kaafil-react-uikit: AppShell's "field" frame has no connectivitySlot filled \u2014 the permanently-visible connectivity/sync region this frame reserves is empty (01-app-shell.md, briefing \xA727.2).`
|
|
949
949
|
);
|
|
@@ -992,7 +992,7 @@ function AppShell({
|
|
|
992
992
|
className: "kf-root",
|
|
993
993
|
"data-kf-isolation": "shadow",
|
|
994
994
|
...dataAttributes,
|
|
995
|
-
style:
|
|
995
|
+
style: chunk4QMYUKW4_cjs.tokenStyle(style),
|
|
996
996
|
children: /* @__PURE__ */ jsxRuntime.jsx(ShadowIsolationBoundary, { className: "kf-app-shell__shadow-host", children: content })
|
|
997
997
|
}
|
|
998
998
|
);
|
|
@@ -1004,7 +1004,7 @@ function AppShell({
|
|
|
1004
1004
|
className: "kf-root",
|
|
1005
1005
|
"data-kf-isolation": "scoped",
|
|
1006
1006
|
...dataAttributes,
|
|
1007
|
-
style:
|
|
1007
|
+
style: chunk4QMYUKW4_cjs.tokenStyle(style),
|
|
1008
1008
|
children: content
|
|
1009
1009
|
}
|
|
1010
1010
|
);
|
|
@@ -1023,10 +1023,10 @@ function ConfigShell({ seedConfig = {}, children }) {
|
|
|
1023
1023
|
}),
|
|
1024
1024
|
[seedConfig.agency, seedConfig.tenant]
|
|
1025
1025
|
);
|
|
1026
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1026
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunk4QMYUKW4_cjs.ConfigContext.Provider, { value, children });
|
|
1027
1027
|
}
|
|
1028
1028
|
function classifyForFallback(error) {
|
|
1029
|
-
const classification =
|
|
1029
|
+
const classification = chunkAWOKWGTB_cjs.classifyError(error);
|
|
1030
1030
|
if (classification.code === "RESOURCE_NOT_FOUND") {
|
|
1031
1031
|
return { classification: "isolation", code: classification.code };
|
|
1032
1032
|
}
|
|
@@ -1083,9 +1083,9 @@ function OfflineShell({
|
|
|
1083
1083
|
scope,
|
|
1084
1084
|
children
|
|
1085
1085
|
}) {
|
|
1086
|
-
const client = react.useContext(
|
|
1087
|
-
const persona =
|
|
1088
|
-
const session =
|
|
1086
|
+
const client = react.useContext(chunk4QMYUKW4_cjs.KaafilClientContext);
|
|
1087
|
+
const persona = chunk4QMYUKW4_cjs.usePersona();
|
|
1088
|
+
const session = chunk4QMYUKW4_cjs.useSession();
|
|
1089
1089
|
const reportExpired = react.useContext(SessionExpiryBridgeContext);
|
|
1090
1090
|
const [engine, setEngine] = react.useState(null);
|
|
1091
1091
|
const engineRef = react.useRef(null);
|
|
@@ -1135,7 +1135,7 @@ function OfflineShell({
|
|
|
1135
1135
|
}
|
|
1136
1136
|
};
|
|
1137
1137
|
}, [client, derivedScope, session.status, persona, reportExpired]);
|
|
1138
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1138
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunk4QMYUKW4_cjs.OfflineEngineContext.Provider, { value: engine, children });
|
|
1139
1139
|
}
|
|
1140
1140
|
|
|
1141
1141
|
// src/core/shells/internal/jwtKind.ts
|
|
@@ -1255,14 +1255,14 @@ function SessionShell(props) {
|
|
|
1255
1255
|
}, [environment, accessTokenDep, refreshTokenDep, agencyRefDep, shareTokenDep]);
|
|
1256
1256
|
if (state === null) {
|
|
1257
1257
|
return /* @__PURE__ */ jsxRuntime.jsx(SessionExpiryBridgeContext.Provider, { value: reportExpired, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1258
|
-
|
|
1258
|
+
chunk4QMYUKW4_cjs.SessionContext.Provider,
|
|
1259
1259
|
{
|
|
1260
1260
|
value: { status: "opening", persona: "manager", agencyRef: void 0, environment },
|
|
1261
1261
|
children
|
|
1262
1262
|
}
|
|
1263
1263
|
) });
|
|
1264
1264
|
}
|
|
1265
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SessionExpiryBridgeContext.Provider, { value: reportExpired, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1265
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SessionExpiryBridgeContext.Provider, { value: reportExpired, children: /* @__PURE__ */ jsxRuntime.jsx(chunk4QMYUKW4_cjs.KaafilClientContext.Provider, { value: state.client, children: /* @__PURE__ */ jsxRuntime.jsx(chunk4QMYUKW4_cjs.SessionContext.Provider, { value: state.session, children }) }) });
|
|
1266
1266
|
}
|
|
1267
1267
|
function emit(onEvent, event) {
|
|
1268
1268
|
if (onEvent === void 0) {
|
|
@@ -1274,8 +1274,8 @@ function emit(onEvent, event) {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
1276
1276
|
function TelemetryShell({ onEvent, children }) {
|
|
1277
|
-
const session =
|
|
1278
|
-
const serverTime =
|
|
1277
|
+
const session = chunk4QMYUKW4_cjs.useSession();
|
|
1278
|
+
const serverTime = chunk53ITV6GF_cjs.useServerTime();
|
|
1279
1279
|
const previousStatusRef = react.useRef(void 0);
|
|
1280
1280
|
react.useEffect(() => {
|
|
1281
1281
|
const previousStatus = previousStatusRef.current;
|
|
@@ -1354,7 +1354,7 @@ function KaafilUIKitProvider(props) {
|
|
|
1354
1354
|
...credential
|
|
1355
1355
|
} = props;
|
|
1356
1356
|
const inner = /* @__PURE__ */ jsxRuntime.jsx(BuildShareUrlContext.Provider, { value: buildShareUrl ?? null, children: /* @__PURE__ */ jsxRuntime.jsx(DefaultCapabilityViewsContext.Provider, { value: defaultCapabilityViews ?? {}, children: /* @__PURE__ */ jsxRuntime.jsx(ConfigShell, { seedConfig, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1357
|
-
|
|
1357
|
+
chunk4QMYUKW4_cjs.BrandShell,
|
|
1358
1358
|
{
|
|
1359
1359
|
appName: brand?.appName,
|
|
1360
1360
|
logo: brand?.logo,
|
|
@@ -1364,7 +1364,7 @@ function KaafilUIKitProvider(props) {
|
|
|
1364
1364
|
children: /* @__PURE__ */ jsxRuntime.jsx(TelemetryShell, { onEvent, children })
|
|
1365
1365
|
}
|
|
1366
1366
|
) }) }) });
|
|
1367
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ErrorShell, { children: /* @__PURE__ */ jsxRuntime.jsx(ThemeShell, { theme, density, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1367
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ErrorShell, { children: /* @__PURE__ */ jsxRuntime.jsx(ThemeShell, { theme, density, children: /* @__PURE__ */ jsxRuntime.jsx(chunk4QMYUKW4_cjs.I18nShell, { locale, children: /* @__PURE__ */ jsxRuntime.jsx(AppShell, { isolation, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1368
1368
|
SessionShell,
|
|
1369
1369
|
{
|
|
1370
1370
|
...credential,
|
|
@@ -1496,5 +1496,5 @@ exports.useDirectories = useDirectories;
|
|
|
1496
1496
|
exports.usePaginatedList = usePaginatedList;
|
|
1497
1497
|
exports.useShareLinks = useShareLinks;
|
|
1498
1498
|
exports.useTravellerFormResponses = useTravellerFormResponses;
|
|
1499
|
-
//# sourceMappingURL=chunk-
|
|
1500
|
-
//# sourceMappingURL=chunk-
|
|
1499
|
+
//# sourceMappingURL=chunk-77RKNRNH.cjs.map
|
|
1500
|
+
//# sourceMappingURL=chunk-77RKNRNH.cjs.map
|