@farm.js/core 0.1.26 → 0.1.28
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/agent-runtime.d.mts +8 -9
- package/dist/agent-runtime.d.ts +8 -9
- package/dist/api/client.cjs +5 -7
- package/dist/api/client.d.mts +5 -5
- package/dist/api/client.d.ts +5 -5
- package/dist/api/client.mjs +4 -6
- package/dist/api/route-manager.cjs +12 -10
- package/dist/api/route-manager.d.mts +7 -8
- package/dist/api/route-manager.d.ts +7 -8
- package/dist/api/route-manager.mjs +11 -9
- package/dist/api/runtime.cjs +15 -8
- package/dist/api/runtime.d.mts +36 -3
- package/dist/api/runtime.d.ts +36 -3
- package/dist/api/runtime.mjs +14 -7
- package/dist/{api-client-Cx54IR5g.d.mts → api-client-BjMmY8OD.d.mts} +2 -3
- package/dist/{api-client-DykpaKcY.d.ts → api-client-CyFtZFJ4.d.ts} +2 -3
- package/dist/api.cjs +16 -14
- package/dist/api.d.mts +9 -10
- package/dist/api.d.ts +9 -10
- package/dist/api.mjs +16 -14
- package/dist/{app-29vG5tmY.d.mts → app-DSSq6wiN.d.mts} +3 -4
- package/dist/{app-Cx71s_PT.d.ts → app-M8nVWvNU.d.ts} +3 -4
- package/dist/app-markdown.cjs +10 -4
- package/dist/app-markdown.d.mts +9 -10
- package/dist/app-markdown.d.ts +9 -10
- package/dist/app-markdown.mjs +9 -3
- package/dist/cache-invalidation-BD0z_lfu.d.mts +4 -0
- package/dist/cache-invalidation-BD0z_lfu.d.ts +4 -0
- package/dist/cache.cjs +6 -4
- package/dist/cache.d.mts +11 -6
- package/dist/cache.d.ts +11 -6
- package/dist/cache.mjs +7 -5
- package/dist/{chunk-OFKG57MZ.mjs → chunk-2CNBR3EB.mjs} +2 -2
- package/dist/{chunk-JM5GQL4H.mjs → chunk-2DLN6HG4.mjs} +1 -1
- package/dist/{chunk-UUYF3CHN.mjs → chunk-2N5PX3LS.mjs} +2 -2
- package/dist/{chunk-H6G5INWM.cjs → chunk-2SDO73HK.cjs} +14 -156
- package/dist/{chunk-3TQWUUNP.cjs → chunk-3LUF2PE2.cjs} +10 -5
- package/dist/{chunk-SYGGPS4A.mjs → chunk-4IEPYMHF.mjs} +3 -3
- package/dist/{chunk-WD5PNSOB.mjs → chunk-4V7GIE2U.mjs} +6 -4
- package/dist/{chunk-2CT6XUNO.cjs → chunk-55ZY4ZA7.cjs} +4 -4
- package/dist/chunk-5MKEDGLD.cjs +53 -0
- package/dist/{chunk-I7PUUDGY.cjs → chunk-63H6BKXG.cjs} +2 -2
- package/dist/{chunk-FG5H2VCJ.mjs → chunk-6ZCMSZ5U.mjs} +2 -2
- package/dist/{chunk-ZMN3H73H.cjs → chunk-75DYEVXI.cjs} +13 -11
- package/dist/{chunk-QJ4D3UKJ.cjs → chunk-A672WZEG.cjs} +4 -4
- package/dist/{chunk-IXTFU4PL.cjs → chunk-BJPBQNIE.cjs} +14 -14
- package/dist/{chunk-QGG336NI.mjs → chunk-BXFWA23T.mjs} +2 -2
- package/dist/chunk-CNOQY6Z7.mjs +156 -0
- package/dist/{chunk-DW34V5SM.cjs → chunk-CTV2TTNP.cjs} +4 -4
- package/dist/{chunk-OAVTUMJP.cjs → chunk-D4JE5NNV.cjs} +12 -12
- package/dist/{chunk-KLSSO6YD.mjs → chunk-E76XC6ZG.mjs} +2 -2
- package/dist/{chunk-G3HRIVEY.cjs → chunk-ES4B2IXW.cjs} +2 -2
- package/dist/{chunk-W2HZKYES.cjs → chunk-EWZ3XHKQ.cjs} +2 -2
- package/dist/{chunk-BD2U4ZL6.cjs → chunk-EXLKRR4U.cjs} +10 -10
- package/dist/{chunk-SZ4LYNUX.cjs → chunk-F52CDFJM.cjs} +89 -83
- package/dist/{chunk-ARXCHQLX.mjs → chunk-FB3H4INL.mjs} +4 -4
- package/dist/{chunk-QPPQHB6X.mjs → chunk-FVCSLZWT.mjs} +19 -13
- package/dist/{chunk-WD4YXVLV.mjs → chunk-GZYH4OER.mjs} +1 -1
- package/dist/{chunk-DX4VKYAJ.cjs → chunk-I26CZYPV.cjs} +6 -4
- package/dist/{chunk-3TQG7CGC.cjs → chunk-ID6OVSLH.cjs} +164 -129
- package/dist/{chunk-F6SJAKFJ.mjs → chunk-IV6CQY7O.mjs} +12 -154
- package/dist/{chunk-6D242YGO.mjs → chunk-JATSG2ZO.mjs} +1 -1
- package/dist/{chunk-U74A3P2P.cjs → chunk-JLRDISQL.cjs} +7 -7
- package/dist/{chunk-H7CJRJ4L.cjs → chunk-JUFRXDTK.cjs} +18 -18
- package/dist/{chunk-OOIL3BWR.mjs → chunk-K3YEZLSY.mjs} +65 -8
- package/dist/{chunk-Y4YWHNKU.cjs → chunk-KH7BN726.cjs} +9 -9
- package/dist/{chunk-WFPRVVF2.cjs → chunk-KOQ555NR.cjs} +22 -14
- package/dist/{chunk-VZWO3XVL.mjs → chunk-KXGDXYUC.mjs} +3 -3
- package/dist/{chunk-3IL5UC5I.cjs → chunk-KZLND3D2.cjs} +2 -2
- package/dist/{chunk-QLXEYIAW.cjs → chunk-MH24QDVJ.cjs} +13 -13
- package/dist/{chunk-TKDY6AJP.mjs → chunk-MKMBQSNQ.mjs} +1 -1
- package/dist/{chunk-OCE65DDM.mjs → chunk-MNUGPHLN.mjs} +1 -1
- package/dist/{chunk-74RZNRY6.mjs → chunk-NVBS5WSZ.mjs} +1 -1
- package/dist/chunk-NYJMY3JA.cjs +156 -0
- package/dist/{chunk-VVJCWBIE.mjs → chunk-O3DTUAX2.mjs} +2 -2
- package/dist/chunk-O6XNAMBV.mjs +53 -0
- package/dist/{chunk-YAOX43YI.cjs → chunk-PZNCMPJF.cjs} +5 -5
- package/dist/{chunk-YMUH2BLR.mjs → chunk-PZPDGOU5.mjs} +14 -6
- package/dist/{chunk-52SH7TKB.mjs → chunk-QG5HNS7P.mjs} +2 -2
- package/dist/{chunk-CEYUWDWA.mjs → chunk-QZCT2CQ4.mjs} +10 -5
- package/dist/{chunk-RAI7NULA.mjs → chunk-REGFZJEJ.mjs} +1 -1
- package/dist/{chunk-QMV4QELL.mjs → chunk-S5GDHOE4.mjs} +4 -2
- package/dist/{chunk-CRQPYWLK.cjs → chunk-SORB3MAR.cjs} +14 -14
- package/dist/{chunk-DU2CASV6.mjs → chunk-T7HQ3I4C.mjs} +1 -1
- package/dist/{chunk-RCYINC4A.cjs → chunk-TII23GJC.cjs} +3 -3
- package/dist/{chunk-PPIW3MH6.mjs → chunk-UX2DD2VK.mjs} +1 -1
- package/dist/{chunk-I4J452B7.cjs → chunk-VHJGDMCG.cjs} +3 -3
- package/dist/{chunk-3WSWXPYM.cjs → chunk-VQXDC5UV.cjs} +4 -4
- package/dist/{chunk-B6ZCT36X.cjs → chunk-WNLBF77X.cjs} +4 -4
- package/dist/{chunk-GDUYXFIS.mjs → chunk-X7WVQMIB.mjs} +4 -4
- package/dist/{chunk-5SPPCN5J.mjs → chunk-XNPDONUH.mjs} +1 -1
- package/dist/{chunk-QIH2HD6H.cjs → chunk-XSPGWQWA.cjs} +86 -29
- package/dist/{chunk-ALIFMS4A.cjs → chunk-Y7GW7J46.cjs} +1 -1
- package/dist/{chunk-L6V3P73N.mjs → chunk-YDQZGSDS.mjs} +5 -5
- package/dist/{chunk-C3VRMB6H.cjs → chunk-ZCU4NZ3M.cjs} +6 -6
- package/dist/{chunk-UXQXGB5A.mjs → chunk-ZRIE4KMG.mjs} +63 -28
- package/dist/{client-plugins-B8RPJnot.d.mts → client-plugins-CgYNY7jF.d.mts} +1656 -1477
- package/dist/{client-plugins-bPBf4haK.d.ts → client-plugins-Fl9Og3yB.d.ts} +1656 -1477
- package/dist/client-plugins.d.mts +8 -9
- package/dist/client-plugins.d.ts +8 -9
- package/dist/client.cjs +12 -13
- package/dist/client.d.mts +10 -11
- package/dist/client.d.ts +10 -11
- package/dist/client.mjs +11 -12
- package/dist/config.d.mts +8 -9
- package/dist/config.d.ts +8 -9
- package/dist/{devtools-5D4ZDRPR.mjs → devtools-3E7ZANMZ.mjs} +7 -4
- package/dist/{devtools-QZJEUOJW.cjs → devtools-5AREISIA.cjs} +8 -5
- package/dist/docs.cjs +10 -7
- package/dist/docs.mjs +9 -6
- package/dist/{endpoint-1zA994xL.d.ts → endpoint-CA-TNX60.d.ts} +1 -1
- package/dist/{endpoint-DAc96i93.d.mts → endpoint-CCHFqyTE.d.mts} +1 -1
- package/dist/index.cjs +58 -55
- package/dist/index.d.mts +17 -18
- package/dist/index.d.ts +17 -18
- package/dist/index.mjs +69 -66
- package/dist/{integration-api-BbaiokCC.d.ts → integration-api-0y4FXJpC.d.mts} +128 -1
- package/dist/{integration-api-BbaiokCC.d.mts → integration-api-BPJo5oXb.d.ts} +128 -1
- package/dist/integrations.d.mts +8 -9
- package/dist/integrations.d.ts +8 -9
- package/dist/internal/app-markdown-runtime.cjs +9 -3
- package/dist/internal/app-markdown-runtime.d.mts +9 -9
- package/dist/internal/app-markdown-runtime.d.ts +9 -9
- package/dist/internal/app-markdown-runtime.mjs +8 -2
- package/dist/internal/build-runtime.cjs +26 -24
- package/dist/internal/build-runtime.d.mts +10 -11
- package/dist/internal/build-runtime.d.ts +10 -11
- package/dist/internal/build-runtime.mjs +25 -23
- package/dist/internal/cli-runtime.cjs +16 -12
- package/dist/internal/cli-runtime.mjs +15 -11
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +5 -1
- package/dist/internal/client-runtime.d.mts +1 -0
- package/dist/internal/client-runtime.d.ts +1 -0
- package/dist/internal/client-runtime.mjs +4 -0
- package/dist/internal/compression-runtime.d.mts +8 -9
- package/dist/internal/compression-runtime.d.ts +8 -9
- package/dist/internal/config-runtime.cjs +8 -5
- package/dist/internal/config-runtime.d.mts +9 -10
- package/dist/internal/config-runtime.d.ts +9 -10
- package/dist/internal/config-runtime.mjs +7 -4
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +20 -16
- package/dist/internal/production-runtime.d.mts +13 -14
- package/dist/internal/production-runtime.d.ts +13 -14
- package/dist/internal/production-runtime.mjs +20 -16
- package/dist/markdown.cjs +8 -2
- package/dist/markdown.d.mts +36 -153
- package/dist/markdown.d.ts +36 -153
- package/dist/markdown.mjs +7 -1
- package/dist/{metadata-C3na4CBj.d.mts → metadata-B0X-qtcQ.d.mts} +1 -1
- package/dist/{metadata-CzBP4Mfp.d.ts → metadata-BdDKgd7K.d.ts} +1 -1
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.d.mts +9 -10
- package/dist/middleware.d.ts +9 -10
- package/dist/middleware.mjs +3 -3
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +10 -11
- package/dist/navigation.d.ts +10 -11
- package/dist/navigation.mjs +4 -4
- package/dist/{nitro-ZKLGOTVY.mjs → nitro-NAKCRVHX.mjs} +4 -3
- package/dist/{nitro-KQDU7CFE.cjs → nitro-VYDZGYFY.cjs} +4 -3
- package/dist/plugin.cjs +26 -21
- package/dist/plugin.d.mts +9 -10
- package/dist/plugin.d.ts +9 -10
- package/dist/plugin.mjs +26 -21
- package/dist/{production-runtime-DP94hPGe.d.mts → production-runtime-BjgFgDIg.d.mts} +1 -1
- package/dist/{production-runtime-CYg4wM4E.d.ts → production-runtime-Dx_qMA3t.d.ts} +1 -1
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan-Bl6Fzg5z.d.ts → render-plan-B41EWmBb.d.ts} +1 -1
- package/dist/{render-plan-CKAJg0jC.d.mts → render-plan-_1TAWODt.d.mts} +1 -1
- package/dist/renderer-client.cjs +13 -14
- package/dist/renderer-client.d.mts +6 -7
- package/dist/renderer-client.d.ts +6 -7
- package/dist/renderer-client.mjs +6 -7
- package/dist/{request-CrBCcPZZ.d.mts → request-BhE4luLv.d.mts} +1 -1
- package/dist/{request-CR-Bp1Px.d.ts → request-Dbf3G0zM.d.ts} +1 -1
- package/dist/request.d.mts +9 -10
- package/dist/request.d.ts +9 -10
- package/dist/{route-rendering-CZH5FegB.d.ts → route-rendering-Z7PveTZE.d.ts} +1 -1
- package/dist/{route-rendering-C1NAHo-C.d.mts → route-rendering-zzfx_GHf.d.mts} +1 -1
- package/dist/{router-B57eDJ3u.d.mts → router-BatNMsa1.d.mts} +1 -1
- package/dist/{router-Cg_kD3Bd.d.ts → router-DtNRhQl3.d.ts} +1 -1
- package/dist/routes.cjs +6 -5
- package/dist/routes.d.mts +6 -7
- package/dist/routes.d.ts +6 -7
- package/dist/routes.mjs +5 -4
- package/dist/server-fn-client.d.mts +4 -4
- package/dist/server-fn-client.d.ts +4 -4
- package/dist/server-fn.cjs +6 -5
- package/dist/server-fn.d.mts +2 -1
- package/dist/server-fn.d.ts +2 -1
- package/dist/server-fn.mjs +5 -4
- package/dist/server-plugins.d.mts +8 -9
- package/dist/server-plugins.d.ts +8 -9
- package/dist/server-query-client.cjs +5 -7
- package/dist/server-query-client.d.mts +2 -1
- package/dist/server-query-client.d.ts +2 -1
- package/dist/server-query-client.mjs +4 -6
- package/dist/server-query.cjs +7 -6
- package/dist/server-query.d.mts +2 -1
- package/dist/server-query.d.ts +2 -1
- package/dist/server-query.mjs +6 -5
- package/dist/server.cjs +235 -131
- package/dist/server.d.mts +14 -15
- package/dist/server.d.ts +14 -15
- package/dist/server.mjs +222 -118
- package/dist/{spa-router-BstQUO6Q.d.ts → spa-router-BE3bwU-J.d.ts} +2 -2
- package/dist/{spa-router-DTdbuinx.d.mts → spa-router-DQOnHZVj.d.mts} +2 -2
- package/dist/testing.cjs +17 -15
- package/dist/testing.d.mts +7 -8
- package/dist/testing.d.ts +7 -8
- package/dist/testing.mjs +14 -12
- package/dist/{utils-CS3ZLnEJ.d.mts → utils-DLK1ERNl.d.mts} +1 -1
- package/dist/{utils-D3rdsIvM.d.ts → utils-u7ZBSWAK.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +22 -20
- package/dist/vite.d.mts +8 -9
- package/dist/vite.d.ts +8 -9
- package/dist/vite.mjs +21 -19
- package/package.json +1 -1
- package/dist/route-B0XrsrFk.d.mts +0 -128
- package/dist/route-DOEpbyWZ.d.ts +0 -128
- package/dist/{chunk-YOYF2E4U.mjs → chunk-LNZ7JZUS.mjs} +0 -0
- package/dist/{chunk-N4RLRSWW.cjs → chunk-SUIBNSNO.cjs} +0 -0
- package/dist/{chunk-TIKNUAU7.mjs → chunk-VUMAE7NC.mjs} +3 -3
- package/dist/{chunk-WM6HL7E7.cjs → chunk-ZHVYQL3H.cjs} +2 -2
|
@@ -9,10 +9,12 @@ import {
|
|
|
9
9
|
normalizeFarmRouteRuntimeConfig
|
|
10
10
|
} from "./chunk-2J7W2WND.mjs";
|
|
11
11
|
import {
|
|
12
|
-
createFarmCacheKey,
|
|
13
12
|
createRouteDataCacheTag,
|
|
14
13
|
getFarmDataCache
|
|
15
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IV6CQY7O.mjs";
|
|
15
|
+
import {
|
|
16
|
+
createFarmCacheKey
|
|
17
|
+
} from "./chunk-CNOQY6Z7.mjs";
|
|
16
18
|
import {
|
|
17
19
|
__name
|
|
18
20
|
} from "./chunk-LPEX4YW6.mjs";
|
|
@@ -7,7 +7,7 @@ var _chunkSU7MH53Pcjs = require('./chunk-SU7MH53P.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkWNLBF77Xcjs = require('./chunk-WNLBF77X.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunk5OVTOKGHcjs = require('./chunk-5OVTOKGH.cjs');
|
|
@@ -52,7 +52,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, shouldBlockUnload, "shouldBlockUnload");
|
|
|
52
52
|
function navigateViaRouter(href, basePath, replace, options = {}) {
|
|
53
53
|
if (typeof window === "undefined") return;
|
|
54
54
|
const url = _chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, href, basePath);
|
|
55
|
-
const spaRouter =
|
|
55
|
+
const spaRouter = _chunkWNLBF77Xcjs.getInstalledFarmSPARouter.call(void 0, );
|
|
56
56
|
if (spaRouter) {
|
|
57
57
|
void spaRouter.navigate(url, {
|
|
58
58
|
replace,
|
|
@@ -65,7 +65,7 @@ function navigateViaRouter(href, basePath, replace, options = {}) {
|
|
|
65
65
|
} else {
|
|
66
66
|
window.history.pushState(null, "", url);
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
_chunkWNLBF77Xcjs.notifyHistoryChange.call(void 0, "url-search");
|
|
69
69
|
}
|
|
70
70
|
_chunkS3JO3N4Hcjs.__name.call(void 0, navigateViaRouter, "navigateViaRouter");
|
|
71
71
|
function useRouter(options = {}) {
|
|
@@ -85,7 +85,7 @@ function useRouter(options = {}) {
|
|
|
85
85
|
setState(readRouterState(basePath, routeMatcher));
|
|
86
86
|
}, "handlePopState");
|
|
87
87
|
handlePopState();
|
|
88
|
-
const unsubscribe =
|
|
88
|
+
const unsubscribe = _chunkWNLBF77Xcjs.subscribeHistoryChange.call(void 0, handlePopState);
|
|
89
89
|
return unsubscribe;
|
|
90
90
|
}, [basePath, routeMatcher]);
|
|
91
91
|
const push = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (href, navigateOptions) => {
|
|
@@ -96,11 +96,11 @@ function useRouter(options = {}) {
|
|
|
96
96
|
}, "replace");
|
|
97
97
|
const pushState = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pageState, href) => {
|
|
98
98
|
if (typeof window === "undefined") return;
|
|
99
|
-
|
|
99
|
+
_chunkWNLBF77Xcjs.getRouter.call(void 0, ).pushState(pageState, resolveClientHref(href, basePath));
|
|
100
100
|
}, "pushState");
|
|
101
101
|
const replaceState = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pageState, href) => {
|
|
102
102
|
if (typeof window === "undefined") return;
|
|
103
|
-
|
|
103
|
+
_chunkWNLBF77Xcjs.getRouter.call(void 0, ).replaceState(pageState, resolveClientHref(href, basePath));
|
|
104
104
|
}, "replaceState");
|
|
105
105
|
const back = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
|
|
106
106
|
if (typeof window !== "undefined") {
|
|
@@ -124,25 +124,25 @@ function useRouter(options = {}) {
|
|
|
124
124
|
}
|
|
125
125
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useRouter, "useRouter");
|
|
126
126
|
function usePageState() {
|
|
127
|
-
const [state, setState] = _react.useState.call(void 0, () =>
|
|
127
|
+
const [state, setState] = _react.useState.call(void 0, () => _chunkWNLBF77Xcjs.readPageState.call(void 0, ));
|
|
128
128
|
_react.useEffect.call(void 0, () => {
|
|
129
129
|
if (typeof window === "undefined") return;
|
|
130
130
|
const handlePopState = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
|
|
131
|
-
setState(
|
|
131
|
+
setState(_chunkWNLBF77Xcjs.readPageState.call(void 0, ));
|
|
132
132
|
}, "handlePopState");
|
|
133
133
|
handlePopState();
|
|
134
|
-
return
|
|
134
|
+
return _chunkWNLBF77Xcjs.subscribeHistoryChange.call(void 0, handlePopState);
|
|
135
135
|
}, []);
|
|
136
136
|
return state;
|
|
137
137
|
}
|
|
138
138
|
_chunkS3JO3N4Hcjs.__name.call(void 0, usePageState, "usePageState");
|
|
139
139
|
function useNavigation() {
|
|
140
140
|
const [state, setState] = _react.useState.call(void 0,
|
|
141
|
-
() =>
|
|
141
|
+
() => _chunkWNLBF77Xcjs.getRouter.call(void 0, ).getNavigationState()
|
|
142
142
|
);
|
|
143
143
|
_react.useEffect.call(void 0, () => {
|
|
144
144
|
if (typeof window === "undefined") return;
|
|
145
|
-
return
|
|
145
|
+
return _chunkWNLBF77Xcjs.getRouter.call(void 0, ).subscribeNavigation(setState);
|
|
146
146
|
}, []);
|
|
147
147
|
return state;
|
|
148
148
|
}
|
|
@@ -155,7 +155,7 @@ function useBlocker(options) {
|
|
|
155
155
|
if (typeof window === "undefined" || !active) {
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return _chunkWNLBF77Xcjs.getRouter.call(void 0, ).addBlocker(
|
|
159
159
|
async (context) => {
|
|
160
160
|
const current = optionsRef.current;
|
|
161
161
|
const when = typeof current.when === "function" ? current.when(context) : current.when;
|
|
@@ -179,7 +179,7 @@ function useScrollRestoration(key) {
|
|
|
179
179
|
_react.useEffect.call(void 0, () => {
|
|
180
180
|
const element = ref.current;
|
|
181
181
|
if (!element) return;
|
|
182
|
-
return
|
|
182
|
+
return _chunkWNLBF77Xcjs.getRouter.call(void 0, ).registerScrollElement(key, element);
|
|
183
183
|
}, [key]);
|
|
184
184
|
return ref;
|
|
185
185
|
}
|
|
@@ -201,7 +201,7 @@ function readRouterState(basePath, routeMatcher) {
|
|
|
201
201
|
pathname,
|
|
202
202
|
searchParams: url.searchParams,
|
|
203
203
|
params: _optionalChain([routeMatcher, 'optionalAccess', _5 => _5.match, 'call', _6 => _6(routePathname), 'optionalAccess', _7 => _7.params]) || {},
|
|
204
|
-
pageState: typeof window === "undefined" ? null :
|
|
204
|
+
pageState: typeof window === "undefined" ? null : _chunkWNLBF77Xcjs.readPageState.call(void 0, )
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
207
|
_chunkS3JO3N4Hcjs.__name.call(void 0, readRouterState, "readRouterState");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkXSPGWQWAcjs = require('./chunk-XSPGWQWA.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -116,7 +116,7 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
116
116
|
}
|
|
117
117
|
const url = new URL(options.request.url);
|
|
118
118
|
const hasMarkdownExtension = url.pathname.toLowerCase().endsWith(".md");
|
|
119
|
-
if (!hasMarkdownExtension && !
|
|
119
|
+
if (!hasMarkdownExtension && !_chunkXSPGWQWAcjs.requestAcceptsMarkdown.call(void 0, options.request.headers.get("accept"))) {
|
|
120
120
|
return null;
|
|
121
121
|
}
|
|
122
122
|
const targetPathname = normalizeFarmMarkdownRoutePath(url.pathname);
|
|
@@ -134,7 +134,7 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
134
134
|
if (!hasMarkdownExtension) {
|
|
135
135
|
headers.set("Vary", "Accept");
|
|
136
136
|
}
|
|
137
|
-
return
|
|
137
|
+
return _chunkXSPGWQWAcjs.createFarmMarkdownViewResponse.call(void 0, {
|
|
138
138
|
request: options.request,
|
|
139
139
|
requestUrl: url,
|
|
140
140
|
markdown: source.source,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk2SDO73HKcjs = require('./chunk-2SDO73HK.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkARJWXNQLcjs = require('./chunk-ARJWXNQL.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -220,7 +220,7 @@ async function applyEndpointInvalidations(declaration, context, result) {
|
|
|
220
220
|
"Endpoint invalidates must resolve to an array of { key }, { path }, or { tag } targets"
|
|
221
221
|
);
|
|
222
222
|
}
|
|
223
|
-
return
|
|
223
|
+
return _chunk2SDO73HKcjs.applyFarmCacheInvalidationTargets.call(void 0, targets);
|
|
224
224
|
}
|
|
225
225
|
_chunkS3JO3N4Hcjs.__name.call(void 0, applyEndpointInvalidations, "applyEndpointInvalidations");
|
|
226
226
|
function createInitialEndpointContext(value) {
|
|
@@ -15,7 +15,7 @@ var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
|
|
|
15
15
|
var _chunkHREOKQWTcjs = require('./chunk-HREOKQWT.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkXSPGWQWAcjs = require('./chunk-XSPGWQWA.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
var _chunkEM6SBQKMcjs = require('./chunk-EM6SBQKM.cjs');
|
|
@@ -1181,11 +1181,11 @@ function shouldReturnMarkdown(request) {
|
|
|
1181
1181
|
if (url.pathname.endsWith(".md")) return true;
|
|
1182
1182
|
const accept = request.headers.get("accept");
|
|
1183
1183
|
const markdown = Math.max(
|
|
1184
|
-
|
|
1185
|
-
|
|
1184
|
+
_chunkXSPGWQWAcjs.farmAcceptQuality.call(void 0, accept, "text/markdown"),
|
|
1185
|
+
_chunkXSPGWQWAcjs.farmAcceptQuality.call(void 0, accept, "text/plain")
|
|
1186
1186
|
);
|
|
1187
1187
|
if (markdown <= 0) return false;
|
|
1188
|
-
return markdown >=
|
|
1188
|
+
return markdown >= _chunkXSPGWQWAcjs.farmAcceptQuality.call(void 0, accept, "text/html", { wildcards: true });
|
|
1189
1189
|
}
|
|
1190
1190
|
_chunkS3JO3N4Hcjs.__name.call(void 0, shouldReturnMarkdown, "shouldReturnMarkdown");
|
|
1191
1191
|
function escapeAttribute(value) {
|
|
@@ -16,7 +16,7 @@ var _chunkJ7FSKED3cjs = require('./chunk-J7FSKED3.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunk3LUF2PE2cjs = require('./chunk-3LUF2PE2.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
@@ -30,7 +30,7 @@ var _chunkQBK2AA4Ucjs = require('./chunk-QBK2AA4U.cjs');
|
|
|
30
30
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
31
31
|
|
|
32
32
|
// src/client/metadata-reconciler.ts
|
|
33
|
-
var MANAGED_ATTRIBUTE =
|
|
33
|
+
var MANAGED_ATTRIBUTE = _chunk3LUF2PE2cjs.FARM_METADATA_ATTRIBUTE;
|
|
34
34
|
var OWNED_SELECTORS = [
|
|
35
35
|
'meta[name="description"]',
|
|
36
36
|
'meta[name="keywords"]',
|
|
@@ -65,8 +65,8 @@ function removeAll(selector) {
|
|
|
65
65
|
}
|
|
66
66
|
_chunkS3JO3N4Hcjs.__name.call(void 0, removeAll, "removeAll");
|
|
67
67
|
function applyFarmMetadataToDocument(metadata, pathname) {
|
|
68
|
-
document.title =
|
|
69
|
-
const rendered =
|
|
68
|
+
document.title = _chunk3LUF2PE2cjs.resolveMetadataTitle.call(void 0, _optionalChain([metadata, 'optionalAccess', _ => _.title])) || "Farm.js App";
|
|
69
|
+
const rendered = _chunk3LUF2PE2cjs.renderMetadataHead.call(void 0, metadata, { pathname });
|
|
70
70
|
const template = document.createElement("template");
|
|
71
71
|
template.innerHTML = rendered.tags;
|
|
72
72
|
removeAll(OWNED_SELECTORS);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isEndpointFailure,
|
|
3
3
|
resolvePluginRoutes
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4IEPYMHF.mjs";
|
|
5
5
|
import {
|
|
6
6
|
registerAPIRouteShape
|
|
7
7
|
} from "./chunk-W3B4PKAW.mjs";
|
|
8
|
-
import {
|
|
9
|
-
resolveFarmAPICanonicalPathname
|
|
10
|
-
} from "./chunk-I6XDAKWQ.mjs";
|
|
11
8
|
import {
|
|
12
9
|
omitFarmResponseBody
|
|
13
10
|
} from "./chunk-5WI2S4CO.mjs";
|
|
11
|
+
import {
|
|
12
|
+
resolveFarmAPICanonicalPathname
|
|
13
|
+
} from "./chunk-I6XDAKWQ.mjs";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_FARM_SERVER_BODY_SIZE_LIMIT,
|
|
16
16
|
bufferFarmRequestBody,
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
var _chunkJ63ZH5OQcjs = require('./chunk-J63ZH5OQ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunk5MKEDGLDcjs = require('./chunk-5MKEDGLD.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
6
12
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
7
13
|
|
|
8
14
|
// src/markdown-view.ts
|
|
@@ -276,8 +282,14 @@ function ifNoneMatchIncludes(header, etag) {
|
|
|
276
282
|
_chunkS3JO3N4Hcjs.__name.call(void 0, ifNoneMatchIncludes, "ifNoneMatchIncludes");
|
|
277
283
|
function createFarmMarkdownViewResponse(options) {
|
|
278
284
|
const url = _nullishCoalesce(options.requestUrl, () => ( new URL(options.request.url)));
|
|
279
|
-
const view = url.searchParams.has("actions") ? selectFarmPageActionsView(options.markdownPath, _nullishCoalesce(options.actions, () => ( [])), options.headers) : selectFarmMarkdownView(options.markdown, url.searchParams, options.markdownPath);
|
|
280
|
-
|
|
285
|
+
const view = options.status >= 400 ? { status: options.status, body: options.markdown } : url.searchParams.has("actions") ? selectFarmPageActionsView(options.markdownPath, _nullishCoalesce(options.actions, () => ( [])), options.headers) : selectFarmMarkdownView(options.markdown, url.searchParams, options.markdownPath);
|
|
286
|
+
let status = view.status === 200 ? options.status : view.status;
|
|
287
|
+
const ifMatch = options.request.headers.get("if-match");
|
|
288
|
+
const preconditionFailed = status >= 200 && status < 300 && ifMatch !== null && ifMatch.trim() !== "*";
|
|
289
|
+
if (preconditionFailed) {
|
|
290
|
+
status = 412;
|
|
291
|
+
options.headers.set("Cache-Control", "no-store");
|
|
292
|
+
}
|
|
281
293
|
_chunkJ63ZH5OQcjs.emitFarmAgentRead.call(void 0, options.request, "markdown", status, readMarkdownViewName(url.searchParams));
|
|
282
294
|
for (const [name, value] of Object.entries(_nullishCoalesce(view.headers, () => ( {}))))
|
|
283
295
|
options.headers.append(name, value);
|
|
@@ -286,7 +298,7 @@ function createFarmMarkdownViewResponse(options) {
|
|
|
286
298
|
if (status === 200 && ifNoneMatchIncludes(options.request.headers.get("if-none-match"), etag)) {
|
|
287
299
|
return new Response(null, { status: 304, headers: options.headers });
|
|
288
300
|
}
|
|
289
|
-
return new Response(options.request.method === "HEAD" ? null : view.body, {
|
|
301
|
+
return new Response(preconditionFailed || options.request.method === "HEAD" ? null : view.body, {
|
|
290
302
|
status,
|
|
291
303
|
headers: options.headers
|
|
292
304
|
});
|
|
@@ -374,27 +386,53 @@ async function createMarkdownMirrorResponse(options) {
|
|
|
374
386
|
for (const name of FARM_MARKDOWN_VIEW_PARAMS) pageUrl.searchParams.delete(name);
|
|
375
387
|
const headers = new Headers(options.request.headers);
|
|
376
388
|
headers.set("accept", "text/html");
|
|
389
|
+
headers.delete("if-match");
|
|
390
|
+
headers.delete("if-unmodified-since");
|
|
391
|
+
headers.delete("if-none-match");
|
|
392
|
+
headers.delete("if-modified-since");
|
|
393
|
+
headers.delete("range");
|
|
394
|
+
headers.delete("if-range");
|
|
377
395
|
const pageResponse = await options.renderPage(
|
|
378
396
|
new Request(pageUrl, {
|
|
379
397
|
method: "GET",
|
|
380
|
-
headers
|
|
398
|
+
headers,
|
|
399
|
+
signal: options.request.signal
|
|
381
400
|
})
|
|
382
401
|
);
|
|
402
|
+
if (pageResponse.status === 204 || pageResponse.status === 205 || pageResponse.status === 304) {
|
|
403
|
+
return pageResponse;
|
|
404
|
+
}
|
|
383
405
|
const redirects = pageResponse.status >= 300 && pageResponse.status < 400 && pageResponse.headers.has("location");
|
|
384
406
|
if (redirects || !isHtmlResponse(pageResponse)) {
|
|
385
|
-
|
|
407
|
+
const accessResponse = createMarkdownAccessResponse(
|
|
386
408
|
pageResponse,
|
|
387
409
|
target.pathname,
|
|
388
410
|
pageUrl,
|
|
389
411
|
options.request.method === "HEAD"
|
|
390
412
|
);
|
|
413
|
+
if (accessResponse || options.request.method === "HEAD") {
|
|
414
|
+
void _optionalChain([pageResponse, 'access', _11 => _11.body, 'optionalAccess', _12 => _12.cancel, 'call', _13 => _13(), 'access', _14 => _14.catch, 'call', _15 => _15(() => {
|
|
415
|
+
})]);
|
|
416
|
+
return _nullishCoalesce(accessResponse, () => ( new Response(null, {
|
|
417
|
+
status: pageResponse.status,
|
|
418
|
+
statusText: pageResponse.statusText,
|
|
419
|
+
headers: pageResponse.headers
|
|
420
|
+
})));
|
|
421
|
+
}
|
|
422
|
+
return pageResponse;
|
|
391
423
|
}
|
|
392
424
|
const html = await pageResponse.text();
|
|
393
425
|
const markdownPath = target.pathname === "/" ? "/index.md" : `${target.pathname}.md`;
|
|
394
|
-
const actions = extractFarmPageActions(html, pageUrl);
|
|
426
|
+
const actions = pageResponse.status >= 400 ? [] : extractFarmPageActions(html, pageUrl);
|
|
427
|
+
for (const form of actions) {
|
|
428
|
+
if (!_optionalChain([form, 'access', _16 => _16.action, 'optionalAccess', _17 => _17.startsWith, 'call', _18 => _18("/")])) continue;
|
|
429
|
+
const pathname = new URL(form.action, pageUrl.origin).pathname;
|
|
430
|
+
const tool = _nullishCoalesce(_chunk5MKEDGLDcjs._findFarmMCPEndpointTool.call(void 0, form.method, pathname, options.apiServerBasePath), () => ( _chunk5MKEDGLDcjs._findFarmMCPEndpointTool.call(void 0, form.method, _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, pathname), options.apiServerBasePath)));
|
|
431
|
+
if (tool) form.tool = tool;
|
|
432
|
+
}
|
|
395
433
|
const markdown = htmlToMarkdown(html, {
|
|
396
|
-
title: _optionalChain([target, 'access',
|
|
397
|
-
includeMetadata: _nullishCoalesce(_optionalChain([options, 'access',
|
|
434
|
+
title: _optionalChain([target, 'access', _19 => _19.route, 'optionalAccess', _20 => _20.title]),
|
|
435
|
+
includeMetadata: _nullishCoalesce(_optionalChain([options, 'access', _21 => _21.config, 'optionalAccess', _22 => _22.includeMetadata]), () => ( true)),
|
|
398
436
|
sourcePath: target.pathname,
|
|
399
437
|
actionsPath: actions.length > 0 ? `${markdownPath}?actions` : void 0
|
|
400
438
|
});
|
|
@@ -406,17 +444,21 @@ async function createMarkdownMirrorResponse(options) {
|
|
|
406
444
|
if (!hasMarkdownExtension) {
|
|
407
445
|
headersOut.set("Vary", "Accept");
|
|
408
446
|
}
|
|
409
|
-
for (const token of _nullishCoalesce(_optionalChain([pageResponse, 'access',
|
|
447
|
+
for (const token of _nullishCoalesce(_optionalChain([pageResponse, 'access', _23 => _23.headers, 'access', _24 => _24.get, 'call', _25 => _25("vary"), 'optionalAccess', _26 => _26.split, 'call', _27 => _27(",")]), () => ( []))) {
|
|
410
448
|
const name = token.trim();
|
|
411
449
|
if (name && name.toLowerCase() !== "accept") appendHeaderToken(headersOut, "Vary", name);
|
|
412
450
|
}
|
|
413
451
|
const pageCacheControl = pageResponse.headers.get("cache-control");
|
|
414
|
-
const cache = _nullishCoalesce(_nullishCoalesce(_optionalChain([target, 'access',
|
|
452
|
+
const cache = _nullishCoalesce(_nullishCoalesce(_optionalChain([target, 'access', _28 => _28.route, 'optionalAccess', _29 => _29.cache]), () => ( _optionalChain([options, 'access', _30 => _30.config, 'optionalAccess', _31 => _31.cache]))), () => ( false));
|
|
415
453
|
headersOut.set(
|
|
416
454
|
"Cache-Control",
|
|
417
455
|
pageCacheControl && isPrivateCacheControl(pageCacheControl) ? pageCacheControl : createMarkdownCacheHeader(cache)
|
|
418
456
|
);
|
|
419
|
-
|
|
457
|
+
preserveMarkdownResponseCookies(pageResponse.headers, headersOut);
|
|
458
|
+
if (pageResponse.status >= 400) {
|
|
459
|
+
preserveMarkdownResponseControlHeaders(pageResponse.headers, headersOut);
|
|
460
|
+
}
|
|
461
|
+
const robots = [pageResponse.headers.get("x-robots-tag"), readHtmlMetaContent(html, "robots")].filter((value) => Boolean(_optionalChain([value, 'optionalAccess', _32 => _32.trim, 'call', _33 => _33()]))).join(", ");
|
|
420
462
|
if (robots) headersOut.set("X-Robots-Tag", robots);
|
|
421
463
|
const canonical = readHtmlCanonicalHref(html);
|
|
422
464
|
if (canonical) {
|
|
@@ -445,6 +487,8 @@ function createMarkdownAccessResponse(pageResponse, pathname, pageUrl, head) {
|
|
|
445
487
|
"Cache-Control": "no-store",
|
|
446
488
|
"X-Farm-Markdown-Route": pathname
|
|
447
489
|
});
|
|
490
|
+
preserveMarkdownResponseCookies(pageResponse.headers, headers);
|
|
491
|
+
preserveMarkdownResponseControlHeaders(pageResponse.headers, headers);
|
|
448
492
|
let body;
|
|
449
493
|
if (redirect) {
|
|
450
494
|
let target;
|
|
@@ -459,8 +503,6 @@ function createMarkdownAccessResponse(pageResponse, pathname, pageUrl, head) {
|
|
|
459
503
|
\`${pathname}\` redirects to [${target}](${target}). The page may require signing in.
|
|
460
504
|
`;
|
|
461
505
|
} else {
|
|
462
|
-
const authenticate = pageResponse.headers.get("www-authenticate");
|
|
463
|
-
if (authenticate) headers.set("WWW-Authenticate", authenticate);
|
|
464
506
|
body = pageResponse.status === 401 ? `# Sign-in required
|
|
465
507
|
|
|
466
508
|
\`${pathname}\` requires signing in.
|
|
@@ -472,6 +514,21 @@ This account cannot read \`${pathname}\`.
|
|
|
472
514
|
return new Response(head ? null : body, { status: pageResponse.status, headers });
|
|
473
515
|
}
|
|
474
516
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createMarkdownAccessResponse, "createMarkdownAccessResponse");
|
|
517
|
+
function preserveMarkdownResponseControlHeaders(source, target) {
|
|
518
|
+
for (const name of ["WWW-Authenticate", "Proxy-Authenticate", "Retry-After", "Allow"]) {
|
|
519
|
+
const value = source.get(name);
|
|
520
|
+
if (value !== null) target.set(name, value);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, preserveMarkdownResponseControlHeaders, "preserveMarkdownResponseControlHeaders");
|
|
524
|
+
function preserveMarkdownResponseCookies(source, target) {
|
|
525
|
+
const getSetCookie = source.getSetCookie;
|
|
526
|
+
const cookies = typeof getSetCookie === "function" ? getSetCookie.call(source) : source.has("set-cookie") ? [source.get("set-cookie")] : [];
|
|
527
|
+
if (cookies.length === 0) return;
|
|
528
|
+
for (const cookie of cookies) target.append("Set-Cookie", cookie);
|
|
529
|
+
target.set("Cache-Control", "private, no-store");
|
|
530
|
+
}
|
|
531
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, preserveMarkdownResponseCookies, "preserveMarkdownResponseCookies");
|
|
475
532
|
function applyMarkdownNegotiationHeaders(response, options) {
|
|
476
533
|
if (!isHtmlResponse(response)) {
|
|
477
534
|
return response;
|
|
@@ -673,7 +730,7 @@ function getFarmMarkdownAlternatePath(config, pathname) {
|
|
|
673
730
|
}
|
|
674
731
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getFarmMarkdownAlternatePath, "getFarmMarkdownAlternatePath");
|
|
675
732
|
function isFarmMarkdownMirrorExposed(config, pathname) {
|
|
676
|
-
if (!_optionalChain([config, 'optionalAccess',
|
|
733
|
+
if (!_optionalChain([config, 'optionalAccess', _34 => _34.enabled])) return false;
|
|
677
734
|
return config.expose === true || findExposedMarkdownRoute(config, pathname) !== null;
|
|
678
735
|
}
|
|
679
736
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmMarkdownMirrorExposed, "isFarmMarkdownMirrorExposed");
|
|
@@ -766,7 +823,7 @@ function extractHtmlBody(html) {
|
|
|
766
823
|
const body = rootMatch ? rootMatch[1] : bodyMatch ? bodyMatch[1] : html;
|
|
767
824
|
const main = extractFirstElementContent(body, ["main"]);
|
|
768
825
|
if (main !== void 0) return main;
|
|
769
|
-
const articles = _nullishCoalesce(_optionalChain([body, 'access',
|
|
826
|
+
const articles = _nullishCoalesce(_optionalChain([body, 'access', _35 => _35.match, 'call', _36 => _36(/<article\b/gi), 'optionalAccess', _37 => _37.length]), () => ( 0));
|
|
770
827
|
return articles === 1 ? _nullishCoalesce(extractFirstElementContent(body, ["article"]), () => ( body)) : body;
|
|
771
828
|
}
|
|
772
829
|
_chunkS3JO3N4Hcjs.__name.call(void 0, extractHtmlBody, "extractHtmlBody");
|
|
@@ -782,7 +839,7 @@ function extractFirstElementContent(html, tagNames) {
|
|
|
782
839
|
_chunkS3JO3N4Hcjs.__name.call(void 0, extractFirstElementContent, "extractFirstElementContent");
|
|
783
840
|
function readHtmlMetaContent(html, name) {
|
|
784
841
|
for (const match of html.matchAll(/<meta\b([^>]*)>/gi)) {
|
|
785
|
-
if (_optionalChain([readHtmlAttribute, 'call',
|
|
842
|
+
if (_optionalChain([readHtmlAttribute, 'call', _38 => _38(match[1], "name"), 'optionalAccess', _39 => _39.toLowerCase, 'call', _40 => _40()]) === name) {
|
|
786
843
|
return readHtmlAttribute(match[1], "content");
|
|
787
844
|
}
|
|
788
845
|
}
|
|
@@ -791,8 +848,8 @@ function readHtmlMetaContent(html, name) {
|
|
|
791
848
|
_chunkS3JO3N4Hcjs.__name.call(void 0, readHtmlMetaContent, "readHtmlMetaContent");
|
|
792
849
|
function readHtmlCanonicalHref(html) {
|
|
793
850
|
for (const match of html.matchAll(/<link\b([^>]*)>/gi)) {
|
|
794
|
-
const rel = _optionalChain([readHtmlAttribute, 'call',
|
|
795
|
-
if (_optionalChain([rel, 'optionalAccess',
|
|
851
|
+
const rel = _optionalChain([readHtmlAttribute, 'call', _41 => _41(match[1], "rel"), 'optionalAccess', _42 => _42.toLowerCase, 'call', _43 => _43(), 'access', _44 => _44.split, 'call', _45 => _45(/\s+/)]);
|
|
852
|
+
if (_optionalChain([rel, 'optionalAccess', _46 => _46.includes, 'call', _47 => _47("canonical")])) return readHtmlAttribute(match[1], "href");
|
|
796
853
|
}
|
|
797
854
|
return void 0;
|
|
798
855
|
}
|
|
@@ -819,7 +876,7 @@ function extractFarmPageActions(html, pageUrl) {
|
|
|
819
876
|
}
|
|
820
877
|
_chunkS3JO3N4Hcjs.__name.call(void 0, extractFarmPageActions, "extractFarmPageActions");
|
|
821
878
|
function readPageForm(attributes, content, pageUrl, labelsFor) {
|
|
822
|
-
const method = _optionalChain([readDecodedAttribute, 'call',
|
|
879
|
+
const method = _optionalChain([readDecodedAttribute, 'call', _48 => _48(attributes, "method"), 'optionalAccess', _49 => _49.trim, 'call', _50 => _50(), 'access', _51 => _51.toLowerCase, 'call', _52 => _52()]);
|
|
823
880
|
if (method === "dialog") return void 0;
|
|
824
881
|
const target = resolveFormTarget(readDecodedAttribute(attributes, "action"), pageUrl);
|
|
825
882
|
const form = {
|
|
@@ -829,11 +886,11 @@ function readPageForm(attributes, content, pageUrl, labelsFor) {
|
|
|
829
886
|
submit: []
|
|
830
887
|
};
|
|
831
888
|
const name = _nullishCoalesce(_nullishCoalesce(readDecodedAttribute(attributes, "aria-label"), () => ( readDecodedAttribute(attributes, "name"))), () => ( readDecodedAttribute(attributes, "id")));
|
|
832
|
-
if (_optionalChain([name, 'optionalAccess',
|
|
889
|
+
if (_optionalChain([name, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()])) form.name = name.trim();
|
|
833
890
|
if (target) form.action = target;
|
|
834
891
|
else form.requiresJavaScript = true;
|
|
835
892
|
if (form.method === "POST") {
|
|
836
|
-
const enctype = _optionalChain([readDecodedAttribute, 'call',
|
|
893
|
+
const enctype = _optionalChain([readDecodedAttribute, 'call', _55 => _55(attributes, "enctype"), 'optionalAccess', _56 => _56.trim, 'call', _57 => _57(), 'access', _58 => _58.toLowerCase, 'call', _59 => _59()]);
|
|
837
894
|
form.enctype = enctype && FORM_ENCTYPES.has(enctype) ? enctype : "application/x-www-form-urlencoded";
|
|
838
895
|
}
|
|
839
896
|
const wrappingLabels = [...content.matchAll(/<label\b[^>]*>([\s\S]*?)<\/label>/gi)].map(
|
|
@@ -844,13 +901,13 @@ function readPageForm(attributes, content, pageUrl, labelsFor) {
|
|
|
844
901
|
})
|
|
845
902
|
);
|
|
846
903
|
const labelOf = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (controlAttributes, index) => {
|
|
847
|
-
const aria = _optionalChain([readDecodedAttribute, 'call',
|
|
904
|
+
const aria = _optionalChain([readDecodedAttribute, 'call', _60 => _60(controlAttributes, "aria-label"), 'optionalAccess', _61 => _61.trim, 'call', _62 => _62()]);
|
|
848
905
|
if (aria) return aria;
|
|
849
906
|
const id = readDecodedAttribute(controlAttributes, "id");
|
|
850
907
|
const forLabel = id ? labelsFor.get(id) : void 0;
|
|
851
908
|
if (forLabel) return forLabel;
|
|
852
909
|
const wrapping = wrappingLabels.find((label) => label.start < index && index < label.end);
|
|
853
|
-
return _optionalChain([wrapping, 'optionalAccess',
|
|
910
|
+
return _optionalChain([wrapping, 'optionalAccess', _63 => _63.text]) || void 0;
|
|
854
911
|
}, "labelOf");
|
|
855
912
|
const groups = /* @__PURE__ */ new Map();
|
|
856
913
|
const controls = /<(input)\b([^>]*)>|<(select|textarea|button)\b([^>]*)>([\s\S]*?)<\/\3>/gi;
|
|
@@ -861,7 +918,7 @@ function readPageForm(attributes, content, pageUrl, labelsFor) {
|
|
|
861
918
|
if (hasHtmlAttribute(controlAttributes, "disabled")) continue;
|
|
862
919
|
const label = labelOf(controlAttributes, match.index);
|
|
863
920
|
const fieldName = readDecodedAttribute(controlAttributes, "name");
|
|
864
|
-
const typeAttribute = _optionalChain([readDecodedAttribute, 'call',
|
|
921
|
+
const typeAttribute = _optionalChain([readDecodedAttribute, 'call', _64 => _64(controlAttributes, "type"), 'optionalAccess', _65 => _65.trim, 'call', _66 => _66(), 'access', _67 => _67.toLowerCase, 'call', _68 => _68()]);
|
|
865
922
|
const type = tag === "input" ? _nullishCoalesce(typeAttribute, () => ( "text")) : tag === "button" ? _nullishCoalesce(typeAttribute, () => ( "submit")) : tag;
|
|
866
923
|
if (tag === "button" && !["button", "reset"].includes(type) || tag === "input" && (type === "submit" || type === "image")) {
|
|
867
924
|
const submit = {
|
|
@@ -875,7 +932,7 @@ function readPageForm(attributes, content, pageUrl, labelsFor) {
|
|
|
875
932
|
const resolved = resolveFormTarget(formAction, pageUrl);
|
|
876
933
|
if (resolved) submit.action = resolved;
|
|
877
934
|
}
|
|
878
|
-
const formMethod = _optionalChain([readDecodedAttribute, 'call',
|
|
935
|
+
const formMethod = _optionalChain([readDecodedAttribute, 'call', _69 => _69(controlAttributes, "formmethod"), 'optionalAccess', _70 => _70.toLowerCase, 'call', _71 => _71()]);
|
|
879
936
|
if (formMethod === "get" || formMethod === "post") submit.method = formMethod.toUpperCase();
|
|
880
937
|
form.submit.push(submit);
|
|
881
938
|
continue;
|
|
@@ -954,7 +1011,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, readPageForm, "readPageForm");
|
|
|
954
1011
|
function resolveFormTarget(action, pageUrl) {
|
|
955
1012
|
let target;
|
|
956
1013
|
try {
|
|
957
|
-
target = new URL(_optionalChain([action, 'optionalAccess',
|
|
1014
|
+
target = new URL(_optionalChain([action, 'optionalAccess', _72 => _72.trim, 'call', _73 => _73()]) || pageUrl.href, pageUrl);
|
|
958
1015
|
} catch (e4) {
|
|
959
1016
|
return void 0;
|
|
960
1017
|
}
|
|
@@ -986,7 +1043,7 @@ function readHtmlAttribute(attributes, name) {
|
|
|
986
1043
|
_chunkS3JO3N4Hcjs.__name.call(void 0, readHtmlAttribute, "readHtmlAttribute");
|
|
987
1044
|
function readCodeLanguage(attributesList) {
|
|
988
1045
|
for (const attributes of attributesList) {
|
|
989
|
-
const language = _nullishCoalesce(_nullishCoalesce(readHtmlAttribute(attributes, "data-language"), () => ( readHtmlAttribute(attributes, "data-lang"))), () => ( _optionalChain([readHtmlAttribute, 'call',
|
|
1046
|
+
const language = _nullishCoalesce(_nullishCoalesce(readHtmlAttribute(attributes, "data-language"), () => ( readHtmlAttribute(attributes, "data-lang"))), () => ( _optionalChain([readHtmlAttribute, 'call', _74 => _74(attributes, "class"), 'optionalAccess', _75 => _75.match, 'call', _76 => _76(/(?:^|\s)lang(?:uage)?-(\S+)/), 'optionalAccess', _77 => _77[1]])));
|
|
990
1047
|
if (language && /^[\w#+.-]+$/.test(language)) return language;
|
|
991
1048
|
}
|
|
992
1049
|
return void 0;
|
|
@@ -1099,7 +1156,7 @@ function matchClosingTags(html) {
|
|
|
1099
1156
|
while (match = tags.exec(html)) {
|
|
1100
1157
|
const name = match[2].toLowerCase();
|
|
1101
1158
|
if (match[1]) {
|
|
1102
|
-
const start = _optionalChain([open, 'access',
|
|
1159
|
+
const start = _optionalChain([open, 'access', _78 => _78.get, 'call', _79 => _79(name), 'optionalAccess', _80 => _80.pop, 'call', _81 => _81()]);
|
|
1103
1160
|
if (start !== void 0) closes.set(start, match.index + match[0].length);
|
|
1104
1161
|
} else if (!VOID_TAGS.has(name) && !isSelfClosingTag(match[0])) {
|
|
1105
1162
|
let starts = open.get(name);
|
|
@@ -1134,7 +1191,7 @@ function resolveStreamedBoundaries(html, { boundaries, placeholders }) {
|
|
|
1134
1191
|
let cursor = 0;
|
|
1135
1192
|
let match;
|
|
1136
1193
|
while (match = openingTag.exec(html)) {
|
|
1137
|
-
const id = _optionalChain([/\sid="([^"]*)"/, 'access',
|
|
1194
|
+
const id = _optionalChain([/\sid="([^"]*)"/, 'access', _82 => _82.exec, 'call', _83 => _83(match[2]), 'optionalAccess', _84 => _84[1]]);
|
|
1138
1195
|
if (!id || !wanted.has(id) || segments.has(id)) continue;
|
|
1139
1196
|
const close = closingTags.get(match.index);
|
|
1140
1197
|
if (close === void 0) continue;
|
|
@@ -7,22 +7,22 @@ import {
|
|
|
7
7
|
FarmClientDataCache,
|
|
8
8
|
getFarmClientDataCache,
|
|
9
9
|
normalizeFarmClientCacheKey
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XNPDONUH.mjs";
|
|
11
11
|
import {
|
|
12
12
|
createClientCancellation
|
|
13
13
|
} from "./chunk-QVYLBY73.mjs";
|
|
14
14
|
import {
|
|
15
15
|
resolveAPIRequestRuntime
|
|
16
16
|
} from "./chunk-G4MWPDSE.mjs";
|
|
17
|
-
import {
|
|
18
|
-
matchAPIRoute,
|
|
19
|
-
parseDynamicSegment
|
|
20
|
-
} from "./chunk-O7BH5O46.mjs";
|
|
21
17
|
import {
|
|
22
18
|
isFarmAPIStream,
|
|
23
19
|
isJSONStreamResponse,
|
|
24
20
|
readJSONStream
|
|
25
21
|
} from "./chunk-EMLAPBEM.mjs";
|
|
22
|
+
import {
|
|
23
|
+
matchAPIRoute,
|
|
24
|
+
parseDynamicSegment
|
|
25
|
+
} from "./chunk-O7BH5O46.mjs";
|
|
26
26
|
import {
|
|
27
27
|
getFarmAPIBaseURL,
|
|
28
28
|
resolveFarmAPIRequestURL
|