kaafil-react-uikit 0.1.0-beta.1 → 0.1.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/README.md +12 -6
- package/dist/admin/index.cjs +343 -343
- package/dist/admin/index.cjs.map +1 -1
- package/dist/admin/index.js +6 -6
- package/dist/admin/index.js.map +1 -1
- package/dist/{chunk-VHTSTUCJ.cjs → chunk-2MWTLYVP.cjs} +17 -114
- package/dist/chunk-2MWTLYVP.cjs.map +1 -0
- package/dist/{chunk-6FPAGGFL.js → chunk-2SRBJ4H7.js} +13 -6
- package/dist/chunk-2SRBJ4H7.js.map +1 -0
- package/dist/{chunk-UYJ6LIWP.js → chunk-7WXE5SUS.js} +3 -3
- package/dist/{chunk-UYJ6LIWP.js.map → chunk-7WXE5SUS.js.map} +1 -1
- package/dist/{chunk-YDGR7JSY.js → chunk-CURTZGHY.js} +16 -11
- package/dist/chunk-CURTZGHY.js.map +1 -0
- package/dist/{chunk-WUAFL77X.js → chunk-E42K6UMM.js} +7 -101
- package/dist/chunk-E42K6UMM.js.map +1 -0
- package/dist/{chunk-UUGMNP27.js → chunk-FFXGZZGJ.js} +5 -5
- package/dist/{chunk-UUGMNP27.js.map → chunk-FFXGZZGJ.js.map} +1 -1
- package/dist/{chunk-XI7MK4Y7.js → chunk-JMWXQTE3.js} +3 -3
- package/dist/{chunk-XI7MK4Y7.js.map → chunk-JMWXQTE3.js.map} +1 -1
- package/dist/{chunk-PJRZCOFF.cjs → chunk-M2D6CZK2.cjs} +37 -37
- package/dist/{chunk-PJRZCOFF.cjs.map → chunk-M2D6CZK2.cjs.map} +1 -1
- package/dist/{chunk-ACVU55PZ.cjs → chunk-PCDEJHWL.cjs} +12 -12
- package/dist/{chunk-ACVU55PZ.cjs.map → chunk-PCDEJHWL.cjs.map} +1 -1
- package/dist/chunk-PDQVVJCS.js +105 -0
- package/dist/chunk-PDQVVJCS.js.map +1 -0
- package/dist/{chunk-IIPQ4JNC.js → chunk-PYETPKTT.js} +3 -3
- package/dist/{chunk-IIPQ4JNC.js.map → chunk-PYETPKTT.js.map} +1 -1
- package/dist/{chunk-QHUDOVKW.cjs → chunk-TF3GCIDK.cjs} +21 -16
- package/dist/chunk-TF3GCIDK.cjs.map +1 -0
- package/dist/{chunk-EM7JV3D7.cjs → chunk-V36WWMTF.cjs} +13 -6
- package/dist/chunk-V36WWMTF.cjs.map +1 -0
- package/dist/{chunk-PTQ2CJKE.cjs → chunk-W5PG3IUJ.cjs} +4 -4
- package/dist/{chunk-PTQ2CJKE.cjs.map → chunk-W5PG3IUJ.cjs.map} +1 -1
- package/dist/{chunk-LL243STJ.cjs → chunk-WS2DKREI.cjs} +79 -79
- package/dist/{chunk-LL243STJ.cjs.map → chunk-WS2DKREI.cjs.map} +1 -1
- package/dist/chunk-YHOQRKDJ.cjs +110 -0
- package/dist/chunk-YHOQRKDJ.cjs.map +1 -0
- package/dist/core/index.cjs +126 -120
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +19 -13
- package/dist/core/index.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/manager/index.cjs +278 -283
- package/dist/manager/index.cjs.map +1 -1
- package/dist/manager/index.js +48 -52
- package/dist/manager/index.js.map +1 -1
- package/dist/traveller/index.cjs +35 -35
- package/dist/traveller/index.js +5 -5
- package/package.json +4 -3
- package/dist/chunk-6FPAGGFL.js.map +0 -1
- package/dist/chunk-EM7JV3D7.cjs.map +0 -1
- package/dist/chunk-PZKXLQSU.js +0 -10
- package/dist/chunk-PZKXLQSU.js.map +0 -1
- package/dist/chunk-QHUDOVKW.cjs.map +0 -1
- package/dist/chunk-TOBZFADB.cjs +0 -12
- package/dist/chunk-TOBZFADB.cjs.map +0 -1
- package/dist/chunk-VHTSTUCJ.cjs.map +0 -1
- package/dist/chunk-WUAFL77X.js.map +0 -1
- package/dist/chunk-YDGR7JSY.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkV36WWMTF_cjs = require('./chunk-V36WWMTF.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(chunkV36WWMTF_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);
|
|
@@ -36,5 +36,5 @@ function useServerTime() {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
exports.useServerTime = useServerTime;
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-W5PG3IUJ.cjs.map
|
|
40
|
+
//# sourceMappingURL=chunk-W5PG3IUJ.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;AAClE,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;AAClE,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-W5PG3IUJ.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 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,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkV36WWMTF_cjs = require('./chunk-V36WWMTF.cjs');
|
|
4
4
|
var client = require('kaafil-js/client');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
|
|
@@ -99,8 +99,8 @@ function ensureTripPulled(engine, tripRef) {
|
|
|
99
99
|
|
|
100
100
|
// src/core/hooks/useSnapshotList.ts
|
|
101
101
|
function useSnapshotList(tripRef, listName, options) {
|
|
102
|
-
const engine = react.useContext(
|
|
103
|
-
const client = react.useContext(
|
|
102
|
+
const engine = react.useContext(chunkV36WWMTF_cjs.OfflineEngineContext);
|
|
103
|
+
const client = react.useContext(chunkV36WWMTF_cjs.KaafilClientContext);
|
|
104
104
|
const [rows, setRows] = react.useState(
|
|
105
105
|
() => engine === null ? [] : engine.snapshot.list(tripRef, listName)
|
|
106
106
|
);
|
|
@@ -161,15 +161,15 @@ function useSnapshotList(tripRef, listName, options) {
|
|
|
161
161
|
// src/core/internal/createDomainHook.ts
|
|
162
162
|
function createDomainHook(moduleKey, build) {
|
|
163
163
|
return function useDomainHook(tripRef) {
|
|
164
|
-
const { rows, loaded } =
|
|
164
|
+
const { rows, loaded } = chunkV36WWMTF_cjs.useCapabilityRows(tripRef);
|
|
165
165
|
const ready = build(tripRef);
|
|
166
166
|
if (!loaded) {
|
|
167
167
|
return { status: "loading" };
|
|
168
168
|
}
|
|
169
169
|
const row = rows.find((candidate) => candidate.capability === moduleKey);
|
|
170
|
-
const triple = row === void 0 ?
|
|
170
|
+
const triple = row === void 0 ? chunkV36WWMTF_cjs.UNKNOWN_CAPABILITY_TRIPLE : chunkV36WWMTF_cjs.deriveCapabilityTriple(row);
|
|
171
171
|
if (triple.status !== "lit") {
|
|
172
|
-
const reason =
|
|
172
|
+
const reason = chunkV36WWMTF_cjs.darkReasonFor(triple);
|
|
173
173
|
return { status: "dark", reason };
|
|
174
174
|
}
|
|
175
175
|
return { status: "ready", ...ready };
|
|
@@ -178,8 +178,8 @@ function createDomainHook(moduleKey, build) {
|
|
|
178
178
|
|
|
179
179
|
// src/core/hooks/useChecklists.ts
|
|
180
180
|
var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
181
|
-
const client$1 =
|
|
182
|
-
const engine = react.useContext(
|
|
181
|
+
const client$1 = chunkV36WWMTF_cjs.useKaafilClient();
|
|
182
|
+
const engine = react.useContext(chunkV36WWMTF_cjs.OfflineEngineContext);
|
|
183
183
|
const { rows: snapshotItems, syncedAt } = useSnapshotList(
|
|
184
184
|
tripRef,
|
|
185
185
|
"checklist"
|
|
@@ -227,7 +227,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
227
227
|
void refreshAggregate();
|
|
228
228
|
});
|
|
229
229
|
}, [engine, refreshAggregate]);
|
|
230
|
-
const addItemMutation =
|
|
230
|
+
const addItemMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
231
231
|
tripRef,
|
|
232
232
|
enqueue: (engine2, input) => engine2.enqueue({
|
|
233
233
|
tripRef,
|
|
@@ -246,7 +246,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
246
246
|
// lane for exactly that reason.
|
|
247
247
|
direct: (liveClient, input) => liveClient.checklists.items.add({ tripRef, ...input })
|
|
248
248
|
});
|
|
249
|
-
const patchItemMutation =
|
|
249
|
+
const patchItemMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
250
250
|
tripRef,
|
|
251
251
|
enqueue: (engine2, input) => {
|
|
252
252
|
const { itemId, version, ...body } = input;
|
|
@@ -261,7 +261,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
261
261
|
},
|
|
262
262
|
direct: (liveClient, input) => liveClient.checklists.items.patch({ tripRef, ...input })
|
|
263
263
|
});
|
|
264
|
-
const removeItemMutation =
|
|
264
|
+
const removeItemMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
265
265
|
tripRef,
|
|
266
266
|
enqueue: (engine2, input) => {
|
|
267
267
|
const { itemId, version } = input;
|
|
@@ -275,7 +275,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
275
275
|
},
|
|
276
276
|
direct: (liveClient, input) => liveClient.checklists.items.remove({ tripRef, ...input })
|
|
277
277
|
});
|
|
278
|
-
const toggleItemMutation =
|
|
278
|
+
const toggleItemMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
279
279
|
tripRef,
|
|
280
280
|
enqueue: (engine2, input) => {
|
|
281
281
|
const { itemId, ...body } = input;
|
|
@@ -291,7 +291,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
291
291
|
},
|
|
292
292
|
direct: (liveClient, input) => liveClient.checklists.items.toggle({ tripRef, ...input })
|
|
293
293
|
});
|
|
294
|
-
const pullTemplateMutation =
|
|
294
|
+
const pullTemplateMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
295
295
|
tripRef,
|
|
296
296
|
enqueue: (engine2, input) => engine2.enqueue({
|
|
297
297
|
tripRef,
|
|
@@ -398,7 +398,7 @@ function useChecklists(tripRef) {
|
|
|
398
398
|
return useChecklistsInternal(tripRef);
|
|
399
399
|
}
|
|
400
400
|
var useCloseoutInternal = createDomainHook("closing-day", (tripRef) => {
|
|
401
|
-
const client =
|
|
401
|
+
const client = chunkV36WWMTF_cjs.useKaafilClient();
|
|
402
402
|
const [aggregate, setAggregate] = react.useState(void 0);
|
|
403
403
|
const [loaded, setLoaded] = react.useState(false);
|
|
404
404
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -470,7 +470,7 @@ function useCloseout(tripRef) {
|
|
|
470
470
|
return useCloseoutInternal(tripRef);
|
|
471
471
|
}
|
|
472
472
|
var useCollectionsInternal = createDomainHook("collections", (tripRef) => {
|
|
473
|
-
const client$1 =
|
|
473
|
+
const client$1 = chunkV36WWMTF_cjs.useKaafilClient();
|
|
474
474
|
const {
|
|
475
475
|
rows: collections,
|
|
476
476
|
syncedAt,
|
|
@@ -507,7 +507,7 @@ var useCollectionsInternal = createDomainHook("collections", (tripRef) => {
|
|
|
507
507
|
react.useEffect(() => {
|
|
508
508
|
void refreshEligible(eligibleStatus);
|
|
509
509
|
}, [refreshEligible, eligibleStatus]);
|
|
510
|
-
const recordMutation =
|
|
510
|
+
const recordMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
511
511
|
tripRef,
|
|
512
512
|
enqueue: (engine, input) => engine.enqueue({
|
|
513
513
|
tripRef,
|
|
@@ -534,7 +534,7 @@ var useCollectionsInternal = createDomainHook("collections", (tripRef) => {
|
|
|
534
534
|
},
|
|
535
535
|
[recordMutate, refreshEligible]
|
|
536
536
|
);
|
|
537
|
-
const voidMutation =
|
|
537
|
+
const voidMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
538
538
|
tripRef,
|
|
539
539
|
enqueue: (engine, input) => {
|
|
540
540
|
const { collectionId, version, ...body } = input;
|
|
@@ -578,7 +578,7 @@ function useCollections(tripRef) {
|
|
|
578
578
|
return useCollectionsInternal(tripRef);
|
|
579
579
|
}
|
|
580
580
|
var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
581
|
-
const client$1 =
|
|
581
|
+
const client$1 = chunkV36WWMTF_cjs.useKaafilClient();
|
|
582
582
|
const {
|
|
583
583
|
rows: expenses,
|
|
584
584
|
syncedAt,
|
|
@@ -607,7 +607,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
607
607
|
react.useEffect(() => {
|
|
608
608
|
void refreshTotals();
|
|
609
609
|
}, [refreshTotals]);
|
|
610
|
-
const logMutation =
|
|
610
|
+
const logMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
611
611
|
tripRef,
|
|
612
612
|
enqueue: (engine, input) => engine.enqueue({
|
|
613
613
|
tripRef,
|
|
@@ -628,7 +628,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
628
628
|
// reimbursement, and an admin has no business standing in for them.
|
|
629
629
|
direct: (liveClient, input) => liveClient.expenses.log({ tripRef, ...input })
|
|
630
630
|
});
|
|
631
|
-
const linkReceiptMutation =
|
|
631
|
+
const linkReceiptMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
632
632
|
tripRef,
|
|
633
633
|
enqueue: (engine, input) => {
|
|
634
634
|
const { expenseId, ...body } = input;
|
|
@@ -651,7 +651,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
651
651
|
// Widening it would mean either breaking rule #4 or making the key
|
|
652
652
|
// optional on the wire, neither of which belongs in a UIKit pass.
|
|
653
653
|
});
|
|
654
|
-
const voidMutation =
|
|
654
|
+
const voidMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
655
655
|
tripRef,
|
|
656
656
|
enqueue: (engine, input) => {
|
|
657
657
|
const { expenseId, version, ...body } = input;
|
|
@@ -666,7 +666,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
666
666
|
},
|
|
667
667
|
direct: (liveClient, input) => liveClient.expenses.void({ tripRef, ...input })
|
|
668
668
|
});
|
|
669
|
-
const submitClaimMutation =
|
|
669
|
+
const submitClaimMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
670
670
|
tripRef,
|
|
671
671
|
enqueue: (engine, input) => {
|
|
672
672
|
const { expenseId } = input;
|
|
@@ -679,7 +679,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
679
679
|
});
|
|
680
680
|
}
|
|
681
681
|
});
|
|
682
|
-
const withdrawClaimMutation =
|
|
682
|
+
const withdrawClaimMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
683
683
|
tripRef,
|
|
684
684
|
enqueue: (engine, input) => {
|
|
685
685
|
const { expenseId, version } = input;
|
|
@@ -721,7 +721,7 @@ function useExpenses(tripRef) {
|
|
|
721
721
|
}
|
|
722
722
|
var DEFAULT_MAX_ATTEMPTS = 3;
|
|
723
723
|
function useFiles(context) {
|
|
724
|
-
const client =
|
|
724
|
+
const client = chunkV36WWMTF_cjs.useKaafilClient();
|
|
725
725
|
const { tripRef } = context;
|
|
726
726
|
const request = react.useCallback(
|
|
727
727
|
(input) => client.files.request({ ...input, tripRef }),
|
|
@@ -793,7 +793,7 @@ function useFiles(context) {
|
|
|
793
793
|
return { request, confirm, meta, url, list, managerView, upload };
|
|
794
794
|
}
|
|
795
795
|
var useFloatInternal = createDomainHook("float", (tripRef) => {
|
|
796
|
-
const client$1 =
|
|
796
|
+
const client$1 = chunkV36WWMTF_cjs.useKaafilClient();
|
|
797
797
|
const { rows: movements, syncedAt } = useSnapshotList(tripRef, "float");
|
|
798
798
|
const [summaryRows, setSummaryRows] = react.useState([]);
|
|
799
799
|
const [summaryLoaded, setSummaryLoaded] = react.useState(false);
|
|
@@ -813,7 +813,7 @@ var useFloatInternal = createDomainHook("float", (tripRef) => {
|
|
|
813
813
|
react.useEffect(() => {
|
|
814
814
|
void refreshSummary();
|
|
815
815
|
}, [refreshSummary]);
|
|
816
|
-
const issueMutation =
|
|
816
|
+
const issueMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
817
817
|
tripRef,
|
|
818
818
|
enqueue: (engine, input) => engine.enqueue({
|
|
819
819
|
tripRef,
|
|
@@ -831,7 +831,7 @@ var useFloatInternal = createDomainHook("float", (tripRef) => {
|
|
|
831
831
|
// transport at all.
|
|
832
832
|
direct: (liveClient, input) => liveClient.float.issue({ tripRef, ...input })
|
|
833
833
|
});
|
|
834
|
-
const returnMutation =
|
|
834
|
+
const returnMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
835
835
|
tripRef,
|
|
836
836
|
enqueue: (engine, input) => engine.enqueue({
|
|
837
837
|
tripRef,
|
|
@@ -842,7 +842,7 @@ var useFloatInternal = createDomainHook("float", (tripRef) => {
|
|
|
842
842
|
}),
|
|
843
843
|
direct: (liveClient, input) => liveClient.float.return({ tripRef, ...input })
|
|
844
844
|
});
|
|
845
|
-
const adjustMutation =
|
|
845
|
+
const adjustMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
846
846
|
tripRef,
|
|
847
847
|
enqueue: (engine, input) => engine.enqueue({
|
|
848
848
|
tripRef,
|
|
@@ -905,8 +905,8 @@ function useFloat(tripRef) {
|
|
|
905
905
|
}
|
|
906
906
|
var FORM_FIELD_KIND_SINGLE_BOOLEAN = "CHECKBOX";
|
|
907
907
|
var useFormsInternal = createDomainHook("forms", (tripRef) => {
|
|
908
|
-
const client$1 =
|
|
909
|
-
const engine = react.useContext(
|
|
908
|
+
const client$1 = chunkV36WWMTF_cjs.useKaafilClient();
|
|
909
|
+
const engine = react.useContext(chunkV36WWMTF_cjs.OfflineEngineContext);
|
|
910
910
|
const [forms, setForms] = react.useState([]);
|
|
911
911
|
const [syncedAt, setSyncedAt] = react.useState(void 0);
|
|
912
912
|
const refreshForms = react.useCallback(async () => {
|
|
@@ -951,7 +951,7 @@ var useFormsInternal = createDomainHook("forms", (tripRef) => {
|
|
|
951
951
|
},
|
|
952
952
|
[client$1, tripRef]
|
|
953
953
|
);
|
|
954
|
-
const submitMutation =
|
|
954
|
+
const submitMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
955
955
|
tripRef,
|
|
956
956
|
enqueue: (engine2, input) => {
|
|
957
957
|
const { formId, ...body } = input;
|
|
@@ -1121,7 +1121,7 @@ function isLiveItineraryItem(row) {
|
|
|
1121
1121
|
return !("_tombstone" in row);
|
|
1122
1122
|
}
|
|
1123
1123
|
function useItinerary(tripRef) {
|
|
1124
|
-
const client$1 =
|
|
1124
|
+
const client$1 = chunkV36WWMTF_cjs.useKaafilClient();
|
|
1125
1125
|
const [trip, setTrip] = react.useState(void 0);
|
|
1126
1126
|
const [initialDayIso, setInitialDayIso] = react.useState(void 0);
|
|
1127
1127
|
const [canAddItems, setCanAddItems] = react.useState(false);
|
|
@@ -1166,7 +1166,7 @@ function useItinerary(tripRef) {
|
|
|
1166
1166
|
},
|
|
1167
1167
|
[client$1, tripRef]
|
|
1168
1168
|
);
|
|
1169
|
-
const patchDayMutation =
|
|
1169
|
+
const patchDayMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1170
1170
|
tripRef,
|
|
1171
1171
|
enqueue: (engine, input) => {
|
|
1172
1172
|
const { dayIndex, version, ...body } = input;
|
|
@@ -1190,7 +1190,7 @@ function useItinerary(tripRef) {
|
|
|
1190
1190
|
},
|
|
1191
1191
|
[patchDayMutate, refresh]
|
|
1192
1192
|
);
|
|
1193
|
-
const addItemMutation =
|
|
1193
|
+
const addItemMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1194
1194
|
tripRef,
|
|
1195
1195
|
enqueue: (engine, input) => engine.enqueue({
|
|
1196
1196
|
tripRef,
|
|
@@ -1210,7 +1210,7 @@ function useItinerary(tripRef) {
|
|
|
1210
1210
|
},
|
|
1211
1211
|
[addItemMutate, refresh]
|
|
1212
1212
|
);
|
|
1213
|
-
const patchItemMutation =
|
|
1213
|
+
const patchItemMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1214
1214
|
tripRef,
|
|
1215
1215
|
enqueue: (engine, input) => {
|
|
1216
1216
|
const { itemId, version, ...body } = input;
|
|
@@ -1234,7 +1234,7 @@ function useItinerary(tripRef) {
|
|
|
1234
1234
|
},
|
|
1235
1235
|
[patchItemMutate, refresh]
|
|
1236
1236
|
);
|
|
1237
|
-
const removeItemMutation =
|
|
1237
|
+
const removeItemMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1238
1238
|
tripRef,
|
|
1239
1239
|
enqueue: (engine, input) => {
|
|
1240
1240
|
const { itemId, version } = input;
|
|
@@ -1257,7 +1257,7 @@ function useItinerary(tripRef) {
|
|
|
1257
1257
|
},
|
|
1258
1258
|
[removeItemMutate, refresh]
|
|
1259
1259
|
);
|
|
1260
|
-
const reorderItemMutation =
|
|
1260
|
+
const reorderItemMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1261
1261
|
tripRef,
|
|
1262
1262
|
enqueue: (engine, input) => {
|
|
1263
1263
|
const { itemId, ...body } = input;
|
|
@@ -1310,12 +1310,12 @@ function useItinerary(tripRef) {
|
|
|
1310
1310
|
};
|
|
1311
1311
|
}
|
|
1312
1312
|
function useManagers(tripRef) {
|
|
1313
|
-
const client =
|
|
1314
|
-
const persona =
|
|
1313
|
+
const client = chunkV36WWMTF_cjs.useKaafilClient();
|
|
1314
|
+
const persona = chunkV36WWMTF_cjs.usePersona();
|
|
1315
1315
|
const [result, setResult] = react.useState({ status: "loading" });
|
|
1316
1316
|
react.useEffect(() => {
|
|
1317
1317
|
if (persona === "share") {
|
|
1318
|
-
if (
|
|
1318
|
+
if (chunkV36WWMTF_cjs.isDevelopment()) {
|
|
1319
1319
|
throw new Error(
|
|
1320
1320
|
"useManagers() was called from a share session \u2014 it is manager/agencyAdmin only."
|
|
1321
1321
|
);
|
|
@@ -1340,7 +1340,7 @@ function useManagers(tripRef) {
|
|
|
1340
1340
|
return result;
|
|
1341
1341
|
}
|
|
1342
1342
|
function useManagerToday(tripRef) {
|
|
1343
|
-
const client =
|
|
1343
|
+
const client = chunkV36WWMTF_cjs.useKaafilClient();
|
|
1344
1344
|
const [result, setResult] = react.useState({ status: "loading" });
|
|
1345
1345
|
react.useEffect(() => {
|
|
1346
1346
|
let cancelled = false;
|
|
@@ -1366,7 +1366,7 @@ function isLiveParty(row) {
|
|
|
1366
1366
|
return !("_tombstone" in row);
|
|
1367
1367
|
}
|
|
1368
1368
|
function useParties(tripRef) {
|
|
1369
|
-
const client$1 =
|
|
1369
|
+
const client$1 = chunkV36WWMTF_cjs.useKaafilClient();
|
|
1370
1370
|
const [rows, setRows] = react.useState([]);
|
|
1371
1371
|
const [listLoaded, setListLoaded] = react.useState(false);
|
|
1372
1372
|
const [listFetchFailed, setListFetchFailed] = react.useState(false);
|
|
@@ -1406,7 +1406,7 @@ function useParties(tripRef) {
|
|
|
1406
1406
|
react.useEffect(() => {
|
|
1407
1407
|
void refreshRoster();
|
|
1408
1408
|
}, [refreshRoster]);
|
|
1409
|
-
const addMutation =
|
|
1409
|
+
const addMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1410
1410
|
tripRef,
|
|
1411
1411
|
enqueue: (engine, input) => engine.enqueue({
|
|
1412
1412
|
tripRef,
|
|
@@ -1416,7 +1416,7 @@ function useParties(tripRef) {
|
|
|
1416
1416
|
body: input
|
|
1417
1417
|
})
|
|
1418
1418
|
});
|
|
1419
|
-
const patchMutation =
|
|
1419
|
+
const patchMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1420
1420
|
tripRef,
|
|
1421
1421
|
enqueue: (engine, input) => {
|
|
1422
1422
|
const { partyId, version, ...body } = input;
|
|
@@ -1430,7 +1430,7 @@ function useParties(tripRef) {
|
|
|
1430
1430
|
});
|
|
1431
1431
|
}
|
|
1432
1432
|
});
|
|
1433
|
-
const removeMutation =
|
|
1433
|
+
const removeMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1434
1434
|
tripRef,
|
|
1435
1435
|
enqueue: (engine, input) => {
|
|
1436
1436
|
const { partyId } = input;
|
|
@@ -1507,7 +1507,7 @@ function useParties(tripRef) {
|
|
|
1507
1507
|
};
|
|
1508
1508
|
}
|
|
1509
1509
|
var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
1510
|
-
const client$1 =
|
|
1510
|
+
const client$1 = chunkV36WWMTF_cjs.useKaafilClient();
|
|
1511
1511
|
const {
|
|
1512
1512
|
rows: stops,
|
|
1513
1513
|
syncedAt,
|
|
@@ -1518,7 +1518,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1518
1518
|
return { rows: response, syncedAt: response.meta.serverTime };
|
|
1519
1519
|
}
|
|
1520
1520
|
});
|
|
1521
|
-
const createMutation =
|
|
1521
|
+
const createMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1522
1522
|
tripRef,
|
|
1523
1523
|
enqueue: (engine, input) => engine.enqueue({
|
|
1524
1524
|
tripRef,
|
|
@@ -1537,7 +1537,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1537
1537
|
// before it left the process. See this file's own persona note.
|
|
1538
1538
|
direct: (liveClient, input) => liveClient.pickups.create({ tripRef, ...input })
|
|
1539
1539
|
});
|
|
1540
|
-
const patchMutation =
|
|
1540
|
+
const patchMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1541
1541
|
tripRef,
|
|
1542
1542
|
enqueue: (engine, input) => {
|
|
1543
1543
|
const { pointId, version, ...body } = input;
|
|
@@ -1552,7 +1552,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1552
1552
|
},
|
|
1553
1553
|
direct: (liveClient, input) => liveClient.pickups.patch({ tripRef, ...input })
|
|
1554
1554
|
});
|
|
1555
|
-
const removeMutation =
|
|
1555
|
+
const removeMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1556
1556
|
tripRef,
|
|
1557
1557
|
enqueue: (engine, input) => {
|
|
1558
1558
|
const { pointId, version, force } = input;
|
|
@@ -1567,7 +1567,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1567
1567
|
},
|
|
1568
1568
|
direct: (liveClient, input) => liveClient.pickups.remove({ tripRef, ...input })
|
|
1569
1569
|
});
|
|
1570
|
-
const reorderMutation =
|
|
1570
|
+
const reorderMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1571
1571
|
tripRef,
|
|
1572
1572
|
enqueue: (engine, input) => engine.enqueue({
|
|
1573
1573
|
tripRef,
|
|
@@ -1578,7 +1578,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1578
1578
|
}),
|
|
1579
1579
|
direct: (liveClient, input) => liveClient.pickups.reorder({ tripRef, ...input })
|
|
1580
1580
|
});
|
|
1581
|
-
const assignMutation =
|
|
1581
|
+
const assignMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1582
1582
|
tripRef,
|
|
1583
1583
|
enqueue: (engine, input) => {
|
|
1584
1584
|
const { pointId, ...body } = input;
|
|
@@ -1592,7 +1592,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1592
1592
|
},
|
|
1593
1593
|
direct: (liveClient, input) => liveClient.pickups.assign({ tripRef, ...input })
|
|
1594
1594
|
});
|
|
1595
|
-
const boardMutation =
|
|
1595
|
+
const boardMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1596
1596
|
tripRef,
|
|
1597
1597
|
enqueue: (engine, input) => {
|
|
1598
1598
|
const { pointId, ...body } = input;
|
|
@@ -1605,7 +1605,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1605
1605
|
});
|
|
1606
1606
|
}
|
|
1607
1607
|
});
|
|
1608
|
-
const correctBoardStatusMutation =
|
|
1608
|
+
const correctBoardStatusMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1609
1609
|
tripRef,
|
|
1610
1610
|
enqueue: (engine, input) => {
|
|
1611
1611
|
const { pointId, travellerId, ...body } = input;
|
|
@@ -1622,7 +1622,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1622
1622
|
// still get none, because they are `managerAuth`-only.
|
|
1623
1623
|
direct: (liveClient, input) => liveClient.pickups.correctBoardStatus({ tripRef, ...input })
|
|
1624
1624
|
});
|
|
1625
|
-
const closeMutation =
|
|
1625
|
+
const closeMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1626
1626
|
tripRef,
|
|
1627
1627
|
enqueue: (engine, input) => {
|
|
1628
1628
|
const { pointId, ...body } = input;
|
|
@@ -1635,7 +1635,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1635
1635
|
});
|
|
1636
1636
|
}
|
|
1637
1637
|
});
|
|
1638
|
-
const reopenMutation =
|
|
1638
|
+
const reopenMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1639
1639
|
tripRef,
|
|
1640
1640
|
enqueue: (engine, input) => {
|
|
1641
1641
|
const { pointId } = input;
|
|
@@ -1676,7 +1676,7 @@ function usePickups(tripRef) {
|
|
|
1676
1676
|
return usePickupsInternal(tripRef);
|
|
1677
1677
|
}
|
|
1678
1678
|
var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
1679
|
-
const client$1 =
|
|
1679
|
+
const client$1 = chunkV36WWMTF_cjs.useKaafilClient();
|
|
1680
1680
|
const {
|
|
1681
1681
|
rows: rooms,
|
|
1682
1682
|
syncedAt: roomsSyncedAt,
|
|
@@ -1700,7 +1700,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1700
1700
|
const refreshLive = react.useCallback(async () => {
|
|
1701
1701
|
await Promise.all([refreshRoomsLive(), refreshWindowsLive()]);
|
|
1702
1702
|
}, [refreshRoomsLive, refreshWindowsLive]);
|
|
1703
|
-
const assignMutation =
|
|
1703
|
+
const assignMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1704
1704
|
tripRef,
|
|
1705
1705
|
enqueue: (engine, input) => engine.enqueue({
|
|
1706
1706
|
tripRef,
|
|
@@ -1755,7 +1755,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1755
1755
|
},
|
|
1756
1756
|
[assignMutate, refreshUnassignedPool]
|
|
1757
1757
|
);
|
|
1758
|
-
const createWindowMutation =
|
|
1758
|
+
const createWindowMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1759
1759
|
tripRef,
|
|
1760
1760
|
enqueue: (engine, input) => engine.enqueue({
|
|
1761
1761
|
tripRef,
|
|
@@ -1766,7 +1766,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1766
1766
|
}),
|
|
1767
1767
|
direct: (liveClient, input) => liveClient.rooming.stayWindows.create({ tripRef, ...input })
|
|
1768
1768
|
});
|
|
1769
|
-
const patchWindowMutation =
|
|
1769
|
+
const patchWindowMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1770
1770
|
tripRef,
|
|
1771
1771
|
enqueue: (engine, input) => {
|
|
1772
1772
|
const { windowId, version, ...body } = input;
|
|
@@ -1781,7 +1781,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1781
1781
|
},
|
|
1782
1782
|
direct: (liveClient, input) => liveClient.rooming.stayWindows.patch({ tripRef, ...input })
|
|
1783
1783
|
});
|
|
1784
|
-
const removeWindowMutation =
|
|
1784
|
+
const removeWindowMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1785
1785
|
tripRef,
|
|
1786
1786
|
enqueue: (engine, input) => {
|
|
1787
1787
|
const { windowId, version, force } = input;
|
|
@@ -1796,7 +1796,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1796
1796
|
},
|
|
1797
1797
|
direct: (liveClient, input) => liveClient.rooming.stayWindows.remove({ tripRef, ...input })
|
|
1798
1798
|
});
|
|
1799
|
-
const createRoomMutation =
|
|
1799
|
+
const createRoomMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1800
1800
|
tripRef,
|
|
1801
1801
|
enqueue: (engine, input) => engine.enqueue({
|
|
1802
1802
|
tripRef,
|
|
@@ -1807,7 +1807,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1807
1807
|
}),
|
|
1808
1808
|
direct: (liveClient, input) => liveClient.rooming.rooms.create({ tripRef, ...input })
|
|
1809
1809
|
});
|
|
1810
|
-
const patchRoomMutation =
|
|
1810
|
+
const patchRoomMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1811
1811
|
tripRef,
|
|
1812
1812
|
enqueue: (engine, input) => {
|
|
1813
1813
|
const { roomId, version, ...body } = input;
|
|
@@ -1822,7 +1822,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1822
1822
|
},
|
|
1823
1823
|
direct: (liveClient, input) => liveClient.rooming.rooms.patch({ tripRef, ...input })
|
|
1824
1824
|
});
|
|
1825
|
-
const removeRoomMutation =
|
|
1825
|
+
const removeRoomMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1826
1826
|
tripRef,
|
|
1827
1827
|
enqueue: (engine, input) => {
|
|
1828
1828
|
const { roomId, version, force } = input;
|
|
@@ -1868,7 +1868,7 @@ function useRooming(tripRef) {
|
|
|
1868
1868
|
return useRoomingInternal(tripRef);
|
|
1869
1869
|
}
|
|
1870
1870
|
var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
1871
|
-
const client$1 =
|
|
1871
|
+
const client$1 = chunkV36WWMTF_cjs.useKaafilClient();
|
|
1872
1872
|
const {
|
|
1873
1873
|
rows: vehicles,
|
|
1874
1874
|
syncedAt,
|
|
@@ -1879,7 +1879,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
1879
1879
|
return { rows: response.vehicles, syncedAt: response.meta.serverTime };
|
|
1880
1880
|
}
|
|
1881
1881
|
});
|
|
1882
|
-
const assignMutation =
|
|
1882
|
+
const assignMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1883
1883
|
tripRef,
|
|
1884
1884
|
enqueue: (engine, input) => engine.enqueue({
|
|
1885
1885
|
tripRef,
|
|
@@ -1927,7 +1927,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
1927
1927
|
},
|
|
1928
1928
|
[assignMutate, refreshUnassignedPool]
|
|
1929
1929
|
);
|
|
1930
|
-
const createVehicleMutation =
|
|
1930
|
+
const createVehicleMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1931
1931
|
tripRef,
|
|
1932
1932
|
enqueue: (engine, input) => engine.enqueue({
|
|
1933
1933
|
tripRef,
|
|
@@ -1938,7 +1938,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
1938
1938
|
}),
|
|
1939
1939
|
direct: (liveClient, input) => liveClient.seating.vehicles.create({ tripRef, ...input })
|
|
1940
1940
|
});
|
|
1941
|
-
const patchVehicleMutation =
|
|
1941
|
+
const patchVehicleMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1942
1942
|
tripRef,
|
|
1943
1943
|
enqueue: (engine, input) => {
|
|
1944
1944
|
const { vehicleId, version, ...body } = input;
|
|
@@ -1953,7 +1953,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
1953
1953
|
},
|
|
1954
1954
|
direct: (liveClient, input) => liveClient.seating.vehicles.patch({ tripRef, ...input })
|
|
1955
1955
|
});
|
|
1956
|
-
const removeVehicleMutation =
|
|
1956
|
+
const removeVehicleMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1957
1957
|
tripRef,
|
|
1958
1958
|
enqueue: (engine, input) => {
|
|
1959
1959
|
const { vehicleId, version } = input;
|
|
@@ -1995,7 +1995,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
1995
1995
|
},
|
|
1996
1996
|
[patchVehicleMutate, vehicles]
|
|
1997
1997
|
);
|
|
1998
|
-
const linkManagerMutation =
|
|
1998
|
+
const linkManagerMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
1999
1999
|
tripRef,
|
|
2000
2000
|
enqueue: (engine, input) => {
|
|
2001
2001
|
const { vehicleId, ...body } = input;
|
|
@@ -2009,7 +2009,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
2009
2009
|
},
|
|
2010
2010
|
direct: (liveClient, input) => liveClient.seating.vehicles.manager.link({ tripRef, ...input })
|
|
2011
2011
|
});
|
|
2012
|
-
const unlinkManagerMutation =
|
|
2012
|
+
const unlinkManagerMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
2013
2013
|
tripRef,
|
|
2014
2014
|
enqueue: (engine, input) => {
|
|
2015
2015
|
const { vehicleId, version } = input;
|
|
@@ -2052,7 +2052,7 @@ function useSeating(tripRef) {
|
|
|
2052
2052
|
return useSeatingInternal(tripRef);
|
|
2053
2053
|
}
|
|
2054
2054
|
function useTravellerProfile(tripRef, travellerRef) {
|
|
2055
|
-
const client$1 =
|
|
2055
|
+
const client$1 = chunkV36WWMTF_cjs.useKaafilClient();
|
|
2056
2056
|
const [read, setRead] = react.useState(void 0);
|
|
2057
2057
|
const [readFailed, setReadFailed] = react.useState(false);
|
|
2058
2058
|
const refresh = react.useCallback(async () => {
|
|
@@ -2067,8 +2067,8 @@ function useTravellerProfile(tripRef, travellerRef) {
|
|
|
2067
2067
|
react.useEffect(() => {
|
|
2068
2068
|
void refresh();
|
|
2069
2069
|
}, [refresh]);
|
|
2070
|
-
|
|
2071
|
-
const noteMutation =
|
|
2070
|
+
chunkV36WWMTF_cjs.useOfflineEvent("sync.drained", refresh);
|
|
2071
|
+
const noteMutation = chunkV36WWMTF_cjs.useOfflineMutation({
|
|
2072
2072
|
tripRef,
|
|
2073
2073
|
enqueue: (engine, input) => engine.enqueue({
|
|
2074
2074
|
tripRef,
|
|
@@ -2090,8 +2090,8 @@ function useTravellerProfile(tripRef, travellerRef) {
|
|
|
2090
2090
|
return { read, readFailed, refresh, addNote };
|
|
2091
2091
|
}
|
|
2092
2092
|
function useVendors(tripRef, agencyRef) {
|
|
2093
|
-
const client =
|
|
2094
|
-
const { rows, loaded: capabilitiesLoaded } =
|
|
2093
|
+
const client = chunkV36WWMTF_cjs.useKaafilClient();
|
|
2094
|
+
const { rows, loaded: capabilitiesLoaded } = chunkV36WWMTF_cjs.useCapabilityRows(tripRef);
|
|
2095
2095
|
const [vendors, setVendors] = react.useState([]);
|
|
2096
2096
|
const [listLoaded, setListLoaded] = react.useState(false);
|
|
2097
2097
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -2120,9 +2120,9 @@ function useVendors(tripRef, agencyRef) {
|
|
|
2120
2120
|
return { status: "loading" };
|
|
2121
2121
|
}
|
|
2122
2122
|
const row = rows.find((candidate) => candidate.capability === "vendors");
|
|
2123
|
-
const triple = row === void 0 ?
|
|
2123
|
+
const triple = row === void 0 ? chunkV36WWMTF_cjs.UNKNOWN_CAPABILITY_TRIPLE : chunkV36WWMTF_cjs.deriveCapabilityTriple(row);
|
|
2124
2124
|
if (triple.status !== "lit") {
|
|
2125
|
-
const reason =
|
|
2125
|
+
const reason = chunkV36WWMTF_cjs.darkReasonFor(triple);
|
|
2126
2126
|
return { status: "dark", reason };
|
|
2127
2127
|
}
|
|
2128
2128
|
if (!listLoaded && lastFetchFailed) {
|
|
@@ -2191,5 +2191,5 @@ exports.useSeating = useSeating;
|
|
|
2191
2191
|
exports.useSnapshotList = useSnapshotList;
|
|
2192
2192
|
exports.useTravellerProfile = useTravellerProfile;
|
|
2193
2193
|
exports.useVendors = useVendors;
|
|
2194
|
-
//# sourceMappingURL=chunk-
|
|
2195
|
-
//# sourceMappingURL=chunk-
|
|
2194
|
+
//# sourceMappingURL=chunk-WS2DKREI.cjs.map
|
|
2195
|
+
//# sourceMappingURL=chunk-WS2DKREI.cjs.map
|