@ryuzaki13/react-foundation-lib 2.26.0 → 2.28.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/dist/analytical-table/index.js +1 -1
- package/dist/browser-notifications/browserNotificationTypes.d.ts +23 -0
- package/dist/browser-notifications/browserNotificationTypes.d.ts.map +1 -0
- package/dist/browser-notifications/createBrowserNotificationPresenter.d.ts +7 -0
- package/dist/browser-notifications/createBrowserNotificationPresenter.d.ts.map +1 -0
- package/dist/browser-notifications/index.d.ts +3 -0
- package/dist/browser-notifications/index.d.ts.map +1 -0
- package/dist/browser-notifications/index.js +64 -0
- package/dist/browser-notifications/index.js.map +1 -0
- package/dist/chunks/{dom-Dbq_09-K.js → dom-BK22UmgF.js} +72 -51
- package/dist/chunks/dom-BK22UmgF.js.map +1 -0
- package/dist/chunks/{formatters-DVqfmx3V.js → formatters-B_NcT2pe.js} +2 -2
- package/dist/chunks/{formatters-DVqfmx3V.js.map → formatters-B_NcT2pe.js.map} +1 -1
- package/dist/chunks/media-WK38KtMl.js +191 -0
- package/dist/chunks/media-WK38KtMl.js.map +1 -0
- package/dist/chunks/{query-client-Dj_zNE22.js → query-client-uQEbemFc.js} +2 -2
- package/dist/chunks/{query-client-Dj_zNE22.js.map → query-client-uQEbemFc.js.map} +1 -1
- package/dist/chunks/uuid-CUJPAbRY.js +13 -0
- package/dist/chunks/uuid-CUJPAbRY.js.map +1 -0
- package/dist/crypto/index.js +18 -27
- package/dist/crypto/index.js.map +1 -1
- package/dist/dom/index.d.ts +1 -0
- package/dist/dom/index.d.ts.map +1 -1
- package/dist/dom/index.js +2 -2
- package/dist/dom/installFaviconOverride.d.ts +6 -0
- package/dist/dom/installFaviconOverride.d.ts.map +1 -0
- package/dist/error-report/index.js +14 -13
- package/dist/error-report/index.js.map +1 -1
- package/dist/excel/index.js +1 -1
- package/dist/formatters/index.js +1 -1
- package/dist/formulas/formatTableFormulaExpression.d.ts +9 -0
- package/dist/formulas/formatTableFormulaExpression.d.ts.map +1 -0
- package/dist/formulas/index.d.ts +1 -0
- package/dist/formulas/index.d.ts.map +1 -1
- package/dist/formulas/index.js +17 -9
- package/dist/formulas/index.js.map +1 -1
- package/dist/formulas/types.d.ts +2 -0
- package/dist/formulas/types.d.ts.map +1 -1
- package/dist/media/createNotificationTonePlayer.d.ts +7 -0
- package/dist/media/createNotificationTonePlayer.d.ts.map +1 -0
- package/dist/media/index.d.ts +2 -0
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +2 -148
- package/dist/media/notificationToneTypes.d.ts +13 -0
- package/dist/media/notificationToneTypes.d.ts.map +1 -0
- package/dist/query-client/index.js +1 -1
- package/dist/session-storage/index.js +1 -1
- package/dist/three-scene/index.js +1 -1
- package/package.json +5 -1
- package/src/browser-notifications/README.md +21 -0
- package/src/formulas/README.mdx +32 -1
- package/dist/chunks/dom-Dbq_09-K.js.map +0 -1
- package/dist/media/index.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ct as e, dt as t, ft as n, lt as r, mt as i, ot as a, pt as o, st as s } from "../chunks/formatters-
|
|
1
|
+
import { ct as e, dt as t, ft as n, lt as r, mt as i, ot as a, pt as o, st as s } from "../chunks/formatters-B_NcT2pe.js";
|
|
2
2
|
import { a as c, y as l } from "../chunks/array-D-_yMMUK.js";
|
|
3
3
|
import { compileTableFormula as u } from "../formulas/index.js";
|
|
4
4
|
import { stableStringify as d } from "../utils/index.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Состояние системного разрешения; unsupported не подменяется отказом пользователя. */
|
|
2
|
+
export type BrowserNotificationPermission = NotificationPermission | "unsupported";
|
|
3
|
+
export type BrowserNotificationRequest = Readonly<{
|
|
4
|
+
title: string;
|
|
5
|
+
body: string;
|
|
6
|
+
tag: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
/** Только same-origin URL; service worker приложения обрабатывает notificationclick. */
|
|
9
|
+
url: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type BrowserNotificationPresenter = Readonly<{
|
|
12
|
+
permission: () => BrowserNotificationPermission;
|
|
13
|
+
/** Вызывать непосредственно из пользовательского события, а не из effect. */
|
|
14
|
+
requestPermission: () => Promise<BrowserNotificationPermission>;
|
|
15
|
+
/** Disposer действует сразу, включая незавершённый showNotification. */
|
|
16
|
+
show: (request: BrowserNotificationRequest) => () => void;
|
|
17
|
+
dispose: () => void;
|
|
18
|
+
}>;
|
|
19
|
+
export type BrowserNotificationPresenterOptions = Readonly<{
|
|
20
|
+
onOpen: (url: string) => void;
|
|
21
|
+
onError: (error: unknown) => void;
|
|
22
|
+
}>;
|
|
23
|
+
//# sourceMappingURL=browserNotificationTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browserNotificationTypes.d.ts","sourceRoot":"","sources":["../../src/browser-notifications/browserNotificationTypes.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,MAAM,MAAM,6BAA6B,GAAG,sBAAsB,GAAG,aAAa,CAAC;AAEnF,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,GAAG,EAAE,MAAM,CAAC;CACZ,CAAC,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAAC;IACnD,UAAU,EAAE,MAAM,6BAA6B,CAAC;IAChD,6EAA6E;IAC7E,iBAAiB,EAAE,MAAM,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAChE,wEAAwE;IACxE,IAAI,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,MAAM,IAAI,CAAC;IAC1D,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,mCAAmC,GAAG,QAAQ,CAAC;IAC1D,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type BrowserNotificationPresenter, type BrowserNotificationPresenterOptions } from "./browserNotificationTypes";
|
|
2
|
+
/**
|
|
3
|
+
* Без I/O до команды. Предпочитает действующий SW для мобильных браузеров,
|
|
4
|
+
* но не регистрирует новый worker и не ожидает бесконечно navigator.ready.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createBrowserNotificationPresenter({ onOpen, onError }: BrowserNotificationPresenterOptions): BrowserNotificationPresenter;
|
|
7
|
+
//# sourceMappingURL=createBrowserNotificationPresenter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createBrowserNotificationPresenter.d.ts","sourceRoot":"","sources":["../../src/browser-notifications/createBrowserNotificationPresenter.ts"],"names":[],"mappings":"AAGA,OAAO,EAEN,KAAK,4BAA4B,EACjC,KAAK,mCAAmC,EACxC,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,mCAAmC,GAAG,4BAA4B,CA8EzI"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { createBrowserNotificationPresenter } from "./createBrowserNotificationPresenter";
|
|
2
|
+
export { type BrowserNotificationPermission, type BrowserNotificationPresenter, type BrowserNotificationPresenterOptions, type BrowserNotificationRequest } from "./browserNotificationTypes";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser-notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EACN,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,mCAAmC,EACxC,KAAK,0BAA0B,EAC/B,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { i as e } from "../chunks/isRecord-DXDTW-jA.js";
|
|
2
|
+
import { t } from "../chunks/uuid-CUJPAbRY.js";
|
|
3
|
+
//#region src/browser-notifications/createBrowserNotificationPresenter.ts
|
|
4
|
+
function n({ onOpen: n, onError: r }) {
|
|
5
|
+
let i = /* @__PURE__ */ new Set(), a = !1, o = () => typeof window < "u" && window.isSecureContext && typeof Notification < "u" ? Notification.permission : "unsupported";
|
|
6
|
+
return {
|
|
7
|
+
permission: o,
|
|
8
|
+
async requestPermission() {
|
|
9
|
+
let e = o();
|
|
10
|
+
if (a || e !== "default") return e;
|
|
11
|
+
try {
|
|
12
|
+
return await Notification.requestPermission();
|
|
13
|
+
} catch (e) {
|
|
14
|
+
return r(e), o();
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
show(s) {
|
|
18
|
+
if (a || o() !== "granted") return () => void 0;
|
|
19
|
+
let c = new URL(s.url, window.location.href);
|
|
20
|
+
if (c.origin !== window.location.origin) throw Error("URL уведомления должен принадлежать текущему origin.");
|
|
21
|
+
let l = !1, u = t(), d = () => void 0, f = () => {
|
|
22
|
+
l || (l = !0, i.delete(f), d());
|
|
23
|
+
};
|
|
24
|
+
return i.add(f), (async () => {
|
|
25
|
+
let t = "serviceWorker" in navigator ? await navigator.serviceWorker.getRegistration() : void 0;
|
|
26
|
+
if (l || a || o() !== "granted") return;
|
|
27
|
+
let i = {
|
|
28
|
+
body: s.body,
|
|
29
|
+
tag: s.tag,
|
|
30
|
+
icon: s.icon,
|
|
31
|
+
data: {
|
|
32
|
+
url: c.href,
|
|
33
|
+
publicationId: u
|
|
34
|
+
},
|
|
35
|
+
silent: !0
|
|
36
|
+
};
|
|
37
|
+
if (t?.active) {
|
|
38
|
+
await t.showNotification(s.title, i);
|
|
39
|
+
let n = (await t.getNotifications({ tag: s.tag })).filter((t) => e(t.data) && t.data.publicationId === u);
|
|
40
|
+
d = () => {
|
|
41
|
+
for (let e of n) e.close();
|
|
42
|
+
}, (l || a) && d();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let p = new Notification(s.title, i);
|
|
46
|
+
d = () => p.close(), p.addEventListener("click", () => {
|
|
47
|
+
l || a || (f(), window.focus(), n(c.href));
|
|
48
|
+
}), p.addEventListener("error", () => {
|
|
49
|
+
!l && !a && r(/* @__PURE__ */ Error("Браузер не смог показать системное уведомление."));
|
|
50
|
+
});
|
|
51
|
+
})().catch((e) => {
|
|
52
|
+
!l && !a && r(e), f();
|
|
53
|
+
}), f;
|
|
54
|
+
},
|
|
55
|
+
dispose() {
|
|
56
|
+
a = !0;
|
|
57
|
+
for (let e of [...i]) e();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { n as createBrowserNotificationPresenter };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/browser-notifications/createBrowserNotificationPresenter.ts"],"sourcesContent":["import { uuidv4 } from \"../crypto/uuid\";\nimport { isRecord } from \"../validators/isRecord\";\n\nimport {\n\ttype BrowserNotificationPermission,\n\ttype BrowserNotificationPresenter,\n\ttype BrowserNotificationPresenterOptions\n} from \"./browserNotificationTypes\";\n\n/**\n * Без I/O до команды. Предпочитает действующий SW для мобильных браузеров,\n * но не регистрирует новый worker и не ожидает бесконечно navigator.ready.\n */\nexport function createBrowserNotificationPresenter({ onOpen, onError }: BrowserNotificationPresenterOptions): BrowserNotificationPresenter {\n\tconst releases = new Set<() => void>();\n\tlet disposed = false;\n\tconst permission = (): BrowserNotificationPermission =>\n\t\ttypeof window !== \"undefined\" && window.isSecureContext && typeof Notification !== \"undefined\"\n\t\t\t? Notification.permission\n\t\t\t: \"unsupported\";\n\treturn {\n\t\tpermission,\n\t\tasync requestPermission() {\n\t\t\tconst current = permission();\n\t\t\tif (disposed || current !== \"default\") return current;\n\t\t\ttry {\n\t\t\t\treturn await Notification.requestPermission();\n\t\t\t} catch (error: unknown) {\n\t\t\t\tonError(error);\n\t\t\t\treturn permission();\n\t\t\t}\n\t\t},\n\t\tshow(request) {\n\t\t\tif (disposed || permission() !== \"granted\") return () => undefined;\n\t\t\tconst url = new URL(request.url, window.location.href);\n\t\t\tif (url.origin !== window.location.origin) throw new Error(\"URL уведомления должен принадлежать текущему origin.\");\n\t\t\tlet released = false;\n\t\t\tconst publicationId = uuidv4();\n\t\t\tlet close = () => undefined as void;\n\t\t\tconst release = () => {\n\t\t\t\tif (released) return;\n\t\t\t\treleased = true;\n\t\t\t\treleases.delete(release);\n\t\t\t\tclose();\n\t\t\t};\n\t\t\treleases.add(release);\n\t\t\tconst deliver = async () => {\n\t\t\t\tconst registration = \"serviceWorker\" in navigator ? await navigator.serviceWorker.getRegistration() : undefined;\n\t\t\t\tif (released || disposed || permission() !== \"granted\") return;\n\t\t\t\tconst options: NotificationOptions = {\n\t\t\t\t\tbody: request.body,\n\t\t\t\t\ttag: request.tag,\n\t\t\t\t\ticon: request.icon,\n\t\t\t\t\tdata: { url: url.href, publicationId },\n\t\t\t\t\t// Звуком управляет вызывающий сценарий; ОС не должна удваивать собственный сигнал.\n\t\t\t\t\tsilent: true\n\t\t\t\t};\n\t\t\t\tif (registration?.active) {\n\t\t\t\t\tawait registration.showNotification(request.title, options);\n\t\t\t\t\tconst notifications = (await registration.getNotifications({ tag: request.tag })).filter(\n\t\t\t\t\t\t(notification) => isRecord(notification.data) && notification.data.publicationId === publicationId\n\t\t\t\t\t);\n\t\t\t\t\tclose = () => {\n\t\t\t\t\t\tfor (const notification of notifications) notification.close();\n\t\t\t\t\t};\n\t\t\t\t\tif (released || disposed) close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst notification = new Notification(request.title, options);\n\t\t\t\tclose = () => notification.close();\n\t\t\t\tnotification.addEventListener(\"click\", () => {\n\t\t\t\t\tif (released || disposed) return;\n\t\t\t\t\trelease();\n\t\t\t\t\twindow.focus();\n\t\t\t\t\tonOpen(url.href);\n\t\t\t\t});\n\t\t\t\tnotification.addEventListener(\"error\", () => {\n\t\t\t\t\tif (!released && !disposed) onError(new Error(\"Браузер не смог показать системное уведомление.\"));\n\t\t\t\t});\n\t\t\t};\n\t\t\tvoid deliver().catch((error: unknown) => {\n\t\t\t\tif (!released && !disposed) onError(error);\n\t\t\t\trelease();\n\t\t\t});\n\t\t\treturn release;\n\t\t},\n\t\tdispose() {\n\t\t\tdisposed = true;\n\t\t\tfor (const release of [...releases]) release();\n\t\t}\n\t};\n}\n"],"mappings":";;;AAaA,SAAgB,EAAmC,EAAE,WAAQ,cAA8E;CAC1I,IAAM,oBAAW,IAAI,IAAgB,GACjC,IAAW,IACT,UACL,OAAO,SAAW,OAAe,OAAO,mBAAmB,OAAO,eAAiB,MAChF,aAAa,aACb;CACJ,OAAO;EACN;EACA,MAAM,oBAAoB;GACzB,IAAM,IAAU,EAAW;GAC3B,IAAI,KAAY,MAAY,WAAW,OAAO;GAC9C,IAAI;IACH,OAAO,MAAM,aAAa,kBAAkB;GAC7C,SAAS,GAAgB;IAExB,OADA,EAAQ,CAAK,GACN,EAAW;GACnB;EACD;EACA,KAAK,GAAS;GACb,IAAI,KAAY,EAAW,MAAM,WAAW,aAAa,KAAA;GACzD,IAAM,IAAM,IAAI,IAAI,EAAQ,KAAK,OAAO,SAAS,IAAI;GACrD,IAAI,EAAI,WAAW,OAAO,SAAS,QAAQ,MAAU,MAAM,sDAAsD;GACjH,IAAI,IAAW,IACT,IAAgB,EAAO,GACzB,UAAc,KAAA,GACZ,UAAgB;IACjB,MACJ,IAAW,IACX,EAAS,OAAO,CAAO,GACvB,EAAM;GACP;GAwCA,OAvCA,EAAS,IAAI,CAAO,IAmCpB,YAlC4B;IAC3B,IAAM,IAAe,mBAAmB,YAAY,MAAM,UAAU,cAAc,gBAAgB,IAAI,KAAA;IACtG,IAAI,KAAY,KAAY,EAAW,MAAM,WAAW;IACxD,IAAM,IAA+B;KACpC,MAAM,EAAQ;KACd,KAAK,EAAQ;KACb,MAAM,EAAQ;KACd,MAAM;MAAE,KAAK,EAAI;MAAM;KAAc;KAErC,QAAQ;IACT;IACA,IAAI,GAAc,QAAQ;KACzB,MAAM,EAAa,iBAAiB,EAAQ,OAAO,CAAO;KAC1D,IAAM,KAAiB,MAAM,EAAa,iBAAiB,EAAE,KAAK,EAAQ,IAAI,CAAC,EAAA,CAAG,QAChF,MAAiB,EAAS,EAAa,IAAI,KAAK,EAAa,KAAK,kBAAkB,CACtF;KAIA,AAHA,UAAc;MACb,KAAK,IAAM,KAAgB,GAAe,EAAa,MAAM;KAC9D,IACI,KAAY,MAAU,EAAM;KAChC;IACD;IACA,IAAM,IAAe,IAAI,aAAa,EAAQ,OAAO,CAAO;IAQ5D,AAPA,UAAc,EAAa,MAAM,GACjC,EAAa,iBAAiB,eAAe;KACxC,KAAY,MAChB,EAAQ,GACR,OAAO,MAAM,GACb,EAAO,EAAI,IAAI;IAChB,CAAC,GACD,EAAa,iBAAiB,eAAe;KAC5C,AAAI,CAAC,KAAY,CAAC,KAAU,EAAQ,gBAAI,MAAM,iDAAiD,CAAC;IACjG,CAAC;GACF,EACK,CAAQ,CAAC,CAAC,OAAO,MAAmB;IAExC,AADI,CAAC,KAAY,CAAC,KAAU,EAAQ,CAAK,GACzC,EAAQ;GACT,CAAC,GACM;EACR;EACA,UAAU;GACT,IAAW;GACX,KAAK,IAAM,KAAW,CAAC,GAAG,CAAQ,GAAG,EAAQ;EAC9C;CACD;AACD"}
|
|
@@ -13,8 +13,29 @@ function s(e, t) {
|
|
|
13
13
|
o(e, new Blob([JSON.stringify(t, null, 2)], { type: "application/json;charset=utf-8" }));
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
16
|
+
//#region src/dom/installFaviconOverride.ts
|
|
17
|
+
function c(e, t) {
|
|
18
|
+
let n = [...e.querySelectorAll("link[rel=\"icon\"]")], r = n.map((e) => ({
|
|
19
|
+
icon: e,
|
|
20
|
+
href: e.getAttribute("href"),
|
|
21
|
+
type: e.getAttribute("type"),
|
|
22
|
+
sizes: e.getAttribute("sizes")
|
|
23
|
+
}));
|
|
24
|
+
for (let e of n) e.setAttribute("href", t), e.setAttribute("type", "image/svg+xml"), e.setAttribute("sizes", "any");
|
|
25
|
+
return () => {
|
|
26
|
+
for (let e of r) if (e.icon.getAttribute("href") === t) for (let t of [
|
|
27
|
+
"href",
|
|
28
|
+
"type",
|
|
29
|
+
"sizes"
|
|
30
|
+
]) {
|
|
31
|
+
let n = e[t];
|
|
32
|
+
n === null ? e.icon.removeAttribute(t) : e.icon.setAttribute(t, n);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
16
37
|
//#region src/dom/getOrCreatePortalRoot.ts
|
|
17
|
-
function
|
|
38
|
+
function l(e) {
|
|
18
39
|
if (typeof document > "u") return null;
|
|
19
40
|
let t = document.getElementById(e);
|
|
20
41
|
if (t instanceof HTMLElement) return t;
|
|
@@ -23,7 +44,7 @@ function c(e) {
|
|
|
23
44
|
}
|
|
24
45
|
//#endregion
|
|
25
46
|
//#region src/dom/observeElementResize.ts
|
|
26
|
-
function
|
|
47
|
+
function u(e, t) {
|
|
27
48
|
if (typeof ResizeObserver > "u") return () => void 0;
|
|
28
49
|
let n = !0, r = new ResizeObserver((r) => {
|
|
29
50
|
n && r.some((t) => t.target === e) && t();
|
|
@@ -34,15 +55,15 @@ function l(e, t) {
|
|
|
34
55
|
}
|
|
35
56
|
//#endregion
|
|
36
57
|
//#region src/dom/scroll-anchor/captureScrollAnchor.ts
|
|
37
|
-
var
|
|
38
|
-
function
|
|
58
|
+
var d = /* @__PURE__ */ new WeakMap();
|
|
59
|
+
function f(e, t) {
|
|
39
60
|
if (!e?.isConnected || !t?.isConnected || e === t || !e.contains(t)) return null;
|
|
40
|
-
|
|
61
|
+
d.get(e)?.release();
|
|
41
62
|
let n = t.getBoundingClientRect().top - e.getBoundingClientRect().top - e.clientTop + e.scrollTop, r = e.style.getPropertyValue("overflow-anchor"), i = e.style.getPropertyPriority("overflow-anchor"), a = !0;
|
|
42
63
|
e.style.setProperty("overflow-anchor", "none", "important");
|
|
43
64
|
let o = e.style.getPropertyValue("overflow-anchor"), s = e.style.getPropertyPriority("overflow-anchor"), c = () => e.style.getPropertyValue("overflow-anchor") === o && e.style.getPropertyPriority("overflow-anchor") === s, l = {
|
|
44
65
|
release() {
|
|
45
|
-
a && (a = !1,
|
|
66
|
+
a && (a = !1, d.delete(e), c() && (r ? e.style.setProperty("overflow-anchor", r, i) : e.style.removeProperty("overflow-anchor")));
|
|
46
67
|
},
|
|
47
68
|
restore() {
|
|
48
69
|
if (!a) return !1;
|
|
@@ -58,11 +79,11 @@ function d(e, t) {
|
|
|
58
79
|
}
|
|
59
80
|
}
|
|
60
81
|
};
|
|
61
|
-
return
|
|
82
|
+
return d.set(e, l), l;
|
|
62
83
|
}
|
|
63
84
|
//#endregion
|
|
64
85
|
//#region src/dom/useClickOutside.ts
|
|
65
|
-
function
|
|
86
|
+
function p(t, n) {
|
|
66
87
|
e(() => {
|
|
67
88
|
let e = (e) => {
|
|
68
89
|
if (Array.isArray(t)) {
|
|
@@ -76,7 +97,7 @@ function f(t, n) {
|
|
|
76
97
|
}
|
|
77
98
|
//#endregion
|
|
78
99
|
//#region src/dom/useElementHeightObserver.ts
|
|
79
|
-
function
|
|
100
|
+
function m(e) {
|
|
80
101
|
let [t, r] = i(0);
|
|
81
102
|
return n(() => {
|
|
82
103
|
let t = e.current;
|
|
@@ -90,7 +111,7 @@ function p(e) {
|
|
|
90
111
|
}
|
|
91
112
|
//#endregion
|
|
92
113
|
//#region src/dom/useEscapeDismiss.ts
|
|
93
|
-
function
|
|
114
|
+
function h({ active: n, onDismiss: r, enabled: i = !0, documentTarget: a, containerRef: o }) {
|
|
94
115
|
let s = t(() => r());
|
|
95
116
|
e(() => {
|
|
96
117
|
if (!n || !i) return;
|
|
@@ -111,9 +132,9 @@ function m({ active: n, onDismiss: r, enabled: i = !0, documentTarget: a, contai
|
|
|
111
132
|
}
|
|
112
133
|
//#endregion
|
|
113
134
|
//#region src/dom/useOverlayFocus.ts
|
|
114
|
-
var
|
|
115
|
-
function
|
|
116
|
-
let l = r(null), u = c ?? l, d = r(null), f = t((e) => Array.from(e.querySelectorAll(
|
|
135
|
+
var g = "button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable=\"true\"]:not([tabindex=\"-1\"]), [contenteditable=\"\"]:not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"]):not([disabled])";
|
|
136
|
+
function _({ active: n, trapFocus: i = !1, restoreFocus: a = !0, initialFocus: o = "auto", restoreFocusTarget: s, containerRef: c }) {
|
|
137
|
+
let l = r(null), u = c ?? l, d = r(null), f = t((e) => Array.from(e.querySelectorAll(g)).filter((e) => !e.hasAttribute("aria-hidden"))), p = t((e) => {
|
|
117
138
|
if (o === "container") return e;
|
|
118
139
|
if (typeof o == "function") return o(e) ?? e;
|
|
119
140
|
let t = f(e);
|
|
@@ -157,7 +178,7 @@ function g({ active: n, trapFocus: i = !1, restoreFocus: a = !0, initialFocus: o
|
|
|
157
178
|
}
|
|
158
179
|
//#endregion
|
|
159
180
|
//#region src/dom/useFocusTrap.ts
|
|
160
|
-
var
|
|
181
|
+
var v = (e) => _({
|
|
161
182
|
active: e,
|
|
162
183
|
trapFocus: !0,
|
|
163
184
|
restoreFocus: !0,
|
|
@@ -165,7 +186,7 @@ var _ = (e) => g({
|
|
|
165
186
|
});
|
|
166
187
|
//#endregion
|
|
167
188
|
//#region src/dom/useIntersectionObserver.ts
|
|
168
|
-
function
|
|
189
|
+
function y(t, n) {
|
|
169
190
|
let [r, a] = i(!1);
|
|
170
191
|
return e(() => {
|
|
171
192
|
let e = t.current;
|
|
@@ -180,7 +201,7 @@ function v(t, n) {
|
|
|
180
201
|
}
|
|
181
202
|
//#endregion
|
|
182
203
|
//#region src/dom/useIsTouchDevice.ts
|
|
183
|
-
var
|
|
204
|
+
var b = () => {
|
|
184
205
|
let [t, n] = i(!1);
|
|
185
206
|
return e(() => {
|
|
186
207
|
let e = () => {
|
|
@@ -194,7 +215,7 @@ var y = () => {
|
|
|
194
215
|
};
|
|
195
216
|
//#endregion
|
|
196
217
|
//#region src/dom/document-scroll/canConsumeVerticalTouchScroll.ts
|
|
197
|
-
function
|
|
218
|
+
function x(e, t, n) {
|
|
198
219
|
let r = e.defaultView;
|
|
199
220
|
if (!r) return !0;
|
|
200
221
|
for (let i of t) {
|
|
@@ -211,7 +232,7 @@ function b(e, t, n) {
|
|
|
211
232
|
}
|
|
212
233
|
//#endregion
|
|
213
234
|
//#region src/dom/document-scroll/isNativeTouchInteraction.ts
|
|
214
|
-
function
|
|
235
|
+
function S(e, t) {
|
|
215
236
|
let n = e.defaultView;
|
|
216
237
|
if (!n) return !0;
|
|
217
238
|
let r = !1, i;
|
|
@@ -230,11 +251,11 @@ function x(e, t) {
|
|
|
230
251
|
}
|
|
231
252
|
//#endregion
|
|
232
253
|
//#region src/dom/document-scroll/attachDocumentTouchScrollGuard.ts
|
|
233
|
-
function
|
|
254
|
+
function C(e) {
|
|
234
255
|
let t = e.defaultView, n = null, r = !1, i = (i) => {
|
|
235
256
|
if (r) return;
|
|
236
257
|
let a = i.touches[0], o = i.composedPath();
|
|
237
|
-
if (i.touches.length !== 1 || !a || (t?.visualViewport?.scale ?? 1) > 1 ||
|
|
258
|
+
if (i.touches.length !== 1 || !a || (t?.visualViewport?.scale ?? 1) > 1 || S(e, o)) {
|
|
238
259
|
r = !0, n = null;
|
|
239
260
|
return;
|
|
240
261
|
}
|
|
@@ -257,11 +278,11 @@ function S(e) {
|
|
|
257
278
|
x: a.clientX,
|
|
258
279
|
y: a.clientY,
|
|
259
280
|
path: c
|
|
260
|
-
},
|
|
281
|
+
}, S(e, c)) {
|
|
261
282
|
r = !0;
|
|
262
283
|
return;
|
|
263
284
|
}
|
|
264
|
-
!i.cancelable || i.defaultPrevented || !u || Math.abs(l) >= Math.abs(u) ||
|
|
285
|
+
!i.cancelable || i.defaultPrevented || !u || Math.abs(l) >= Math.abs(u) || x(e, c, u) || i.preventDefault();
|
|
265
286
|
}, o = (e) => {
|
|
266
287
|
e.touches.length > 0 || (n = null, r = !1);
|
|
267
288
|
};
|
|
@@ -283,28 +304,28 @@ function S(e) {
|
|
|
283
304
|
}
|
|
284
305
|
//#endregion
|
|
285
306
|
//#region src/dom/document-scroll/acquireDocumentScrollLock.ts
|
|
286
|
-
var
|
|
287
|
-
function
|
|
307
|
+
var w = /* @__PURE__ */ new WeakMap();
|
|
308
|
+
function T(e, t) {
|
|
288
309
|
return t.map((t) => ({
|
|
289
310
|
name: t,
|
|
290
311
|
value: e.getPropertyValue(t),
|
|
291
312
|
priority: e.getPropertyPriority(t)
|
|
292
313
|
}));
|
|
293
314
|
}
|
|
294
|
-
function
|
|
315
|
+
function E(e, t) {
|
|
295
316
|
for (let { name: n } of t) e.removeProperty(n);
|
|
296
317
|
for (let { name: n, value: r, priority: i } of t) r && e.setProperty(n, r, i);
|
|
297
318
|
}
|
|
298
|
-
function
|
|
319
|
+
function D(e, t) {
|
|
299
320
|
let n = e.defaultView, r = e.body;
|
|
300
321
|
if (!n || !r) return () => void 0;
|
|
301
|
-
let i =
|
|
322
|
+
let i = w.get(e);
|
|
302
323
|
if (!i) {
|
|
303
|
-
let t = e.documentElement.style, a = r.style, o =
|
|
324
|
+
let t = e.documentElement.style, a = r.style, o = T(t, [
|
|
304
325
|
"overflow",
|
|
305
326
|
"overflow-x",
|
|
306
327
|
"overflow-y"
|
|
307
|
-
]), s =
|
|
328
|
+
]), s = T(a, [
|
|
308
329
|
"position",
|
|
309
330
|
"top",
|
|
310
331
|
"left",
|
|
@@ -314,35 +335,35 @@ function E(e, t) {
|
|
|
314
335
|
"overflow-y",
|
|
315
336
|
"box-sizing",
|
|
316
337
|
"padding-right"
|
|
317
|
-
]), c =
|
|
338
|
+
]), c = T(a, ["padding-right"]), l = n.scrollX, u = n.scrollY, d = Math.max(0, n.innerWidth - e.documentElement.clientWidth), f = Number.parseFloat(n.getComputedStyle(r).paddingRight) || 0, p = /* @__PURE__ */ new Map();
|
|
318
339
|
t.setProperty("overflow", "hidden"), a.setProperty("position", "fixed"), a.setProperty("top", `${-u}px`), a.setProperty("left", `${-l}px`), a.setProperty("width", "100%"), a.setProperty("overflow", "hidden"), a.setProperty("box-sizing", "border-box");
|
|
319
|
-
let m =
|
|
340
|
+
let m = C(e);
|
|
320
341
|
i = {
|
|
321
342
|
leases: p,
|
|
322
343
|
updateCompensation: () => {
|
|
323
|
-
d > 0 && [...p.values()].some(Boolean) ? a.setProperty("padding-right", `${f + d}px`) :
|
|
344
|
+
d > 0 && [...p.values()].some(Boolean) ? a.setProperty("padding-right", `${f + d}px`) : E(a, c);
|
|
324
345
|
},
|
|
325
346
|
restore: () => {
|
|
326
|
-
m(),
|
|
347
|
+
m(), E(t, o), E(a, s), n.scrollTo({
|
|
327
348
|
left: l,
|
|
328
349
|
top: u,
|
|
329
350
|
behavior: "instant"
|
|
330
351
|
});
|
|
331
352
|
}
|
|
332
|
-
},
|
|
353
|
+
}, w.set(e, i);
|
|
333
354
|
}
|
|
334
355
|
let a = Symbol();
|
|
335
356
|
return i.leases.set(a, t), i.updateCompensation(), () => {
|
|
336
|
-
i.leases.delete(a) && (i.leases.size > 0 ? i.updateCompensation() : (
|
|
357
|
+
i.leases.delete(a) && (i.leases.size > 0 ? i.updateCompensation() : (w.delete(e), i.restore()));
|
|
337
358
|
};
|
|
338
359
|
}
|
|
339
360
|
//#endregion
|
|
340
361
|
//#region src/dom/useDocumentScrollLock.ts
|
|
341
|
-
function
|
|
362
|
+
function O({ active: t, documentTarget: n, compensateScrollbar: r = !1 }) {
|
|
342
363
|
e(() => {
|
|
343
364
|
if (!t) return;
|
|
344
365
|
let e = n === void 0 ? typeof document > "u" ? null : document : n;
|
|
345
|
-
if (e) return
|
|
366
|
+
if (e) return D(e, r);
|
|
346
367
|
}, [
|
|
347
368
|
t,
|
|
348
369
|
n,
|
|
@@ -351,16 +372,16 @@ function D({ active: t, documentTarget: n, compensateScrollbar: r = !1 }) {
|
|
|
351
372
|
}
|
|
352
373
|
//#endregion
|
|
353
374
|
//#region src/dom/visual-viewport/attachVisualViewportFrame.ts
|
|
354
|
-
var
|
|
375
|
+
var k = [
|
|
355
376
|
"--visual-viewport-top",
|
|
356
377
|
"--visual-viewport-left",
|
|
357
378
|
"--visual-viewport-width",
|
|
358
379
|
"--visual-viewport-height"
|
|
359
|
-
],
|
|
360
|
-
function
|
|
380
|
+
], A = /* @__PURE__ */ new WeakMap();
|
|
381
|
+
function j(e) {
|
|
361
382
|
let t = e.ownerDocument.defaultView;
|
|
362
383
|
if (!t) return () => void 0;
|
|
363
|
-
let n = t.visualViewport, r = e.style, i =
|
|
384
|
+
let n = t.visualViewport, r = e.style, i = k.map((e) => ({
|
|
364
385
|
name: e,
|
|
365
386
|
value: r.getPropertyValue(e),
|
|
366
387
|
priority: r.getPropertyPriority(e)
|
|
@@ -377,7 +398,7 @@ function A(e) {
|
|
|
377
398
|
t.innerWidth,
|
|
378
399
|
t.innerHeight
|
|
379
400
|
];
|
|
380
|
-
|
|
401
|
+
k.forEach((t, n) => {
|
|
381
402
|
let o = `${Number.isFinite(e[n]) ? e[n] : i[n]}px`;
|
|
382
403
|
a.get(t) !== o && (r.setProperty(t, o), a.set(t, o));
|
|
383
404
|
});
|
|
@@ -389,25 +410,25 @@ function A(e) {
|
|
|
389
410
|
for (let { name: e, value: t, priority: n } of i) r.getPropertyValue(e) !== a.get(e) || r.getPropertyPriority(e) || (t ? r.setProperty(e, t, n) : r.removeProperty(e));
|
|
390
411
|
};
|
|
391
412
|
}
|
|
392
|
-
function
|
|
393
|
-
let t =
|
|
413
|
+
function M(e) {
|
|
414
|
+
let t = A.get(e);
|
|
394
415
|
t || (t = {
|
|
395
416
|
leases: /* @__PURE__ */ new Set(),
|
|
396
|
-
detach:
|
|
397
|
-
},
|
|
417
|
+
detach: j(e)
|
|
418
|
+
}, A.set(e, t));
|
|
398
419
|
let n = Symbol();
|
|
399
420
|
return t.leases.add(n), () => {
|
|
400
|
-
!t.leases.delete(n) || t.leases.size > 0 || (
|
|
421
|
+
!t.leases.delete(n) || t.leases.size > 0 || (A.delete(e), t.detach());
|
|
401
422
|
};
|
|
402
423
|
}
|
|
403
424
|
//#endregion
|
|
404
425
|
//#region src/dom/useVisualViewportFrame.ts
|
|
405
|
-
function
|
|
426
|
+
function N({ active: t, containerRef: n }) {
|
|
406
427
|
e(() => {
|
|
407
428
|
if (!t || typeof window > "u") return;
|
|
408
429
|
let e = 0, r, i = () => {
|
|
409
430
|
let t = n.current;
|
|
410
|
-
t ? r =
|
|
431
|
+
t ? r = M(t) : e = window.requestAnimationFrame(i);
|
|
411
432
|
};
|
|
412
433
|
return i(), () => {
|
|
413
434
|
window.cancelAnimationFrame(e), r?.();
|
|
@@ -415,6 +436,6 @@ function M({ active: t, containerRef: n }) {
|
|
|
415
436
|
}, [t, n]);
|
|
416
437
|
}
|
|
417
438
|
//#endregion
|
|
418
|
-
export {
|
|
439
|
+
export { v as a, m as c, u as d, l as f, a as g, s as h, y as i, p as l, o as m, O as n, _ as o, c as p, b as r, h as s, N as t, f as u };
|
|
419
440
|
|
|
420
|
-
//# sourceMappingURL=dom-
|
|
441
|
+
//# sourceMappingURL=dom-BK22UmgF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom-BK22UmgF.js","names":[],"sources":["../../src/dom/downloadFile.ts","../../src/dom/installFaviconOverride.ts","../../src/dom/getOrCreatePortalRoot.ts","../../src/dom/observeElementResize.ts","../../src/dom/scroll-anchor/captureScrollAnchor.ts","../../src/dom/useClickOutside.ts","../../src/dom/useElementHeightObserver.ts","../../src/dom/useEscapeDismiss.ts","../../src/dom/useOverlayFocus.ts","../../src/dom/useFocusTrap.ts","../../src/dom/useIntersectionObserver.ts","../../src/dom/useIsTouchDevice.ts","../../src/dom/document-scroll/canConsumeVerticalTouchScroll.ts","../../src/dom/document-scroll/isNativeTouchInteraction.ts","../../src/dom/document-scroll/attachDocumentTouchScrollGuard.ts","../../src/dom/document-scroll/acquireDocumentScrollLock.ts","../../src/dom/useDocumentScrollLock.ts","../../src/dom/visual-viewport/attachVisualViewportFrame.ts","../../src/dom/useVisualViewportFrame.ts"],"sourcesContent":["export function downloadFileFromObjectURL(filename: string, objectUrl: string) {\n\tconst link = document.createElement(\"a\");\n\n\tlink.href = objectUrl;\n\tlink.download = filename;\n\tlink.click();\n\n\twindow.setTimeout(() => {\n\t\twindow.URL.revokeObjectURL(objectUrl);\n\t}, 0);\n}\n\nexport function downloadFileFromBlob(filename: string, blob: Blob) {\n\tconst objectUrl = window.URL.createObjectURL(blob);\n\tdownloadFileFromObjectURL(filename, objectUrl);\n}\n\nexport function downloadFileFromJson(filename: string, payload: unknown) {\n\tconst blob = new Blob([JSON.stringify(payload, null, 2)], { type: \"application/json;charset=utf-8\" });\n\tdownloadFileFromBlob(filename, blob);\n}\n","/**\n * Временный SVG favicon с симметричным восстановлением атрибутов. Сохраняет\n * media исходных links; не меняет Apple/mask icons и не удаляет чужие узлы head.\n */\nexport function installFaviconOverride(document: Document, href: string): () => void {\n\tconst icons = [...document.querySelectorAll<HTMLLinkElement>('link[rel=\"icon\"]')];\n\tconst snapshots = icons.map((icon) => ({\n\t\ticon,\n\t\thref: icon.getAttribute(\"href\"),\n\t\ttype: icon.getAttribute(\"type\"),\n\t\tsizes: icon.getAttribute(\"sizes\")\n\t}));\n\tfor (const icon of icons) {\n\t\ticon.setAttribute(\"href\", href);\n\t\ticon.setAttribute(\"type\", \"image/svg+xml\");\n\t\ticon.setAttribute(\"sizes\", \"any\");\n\t}\n\treturn () => {\n\t\tfor (const snapshot of snapshots) {\n\t\t\tif (snapshot.icon.getAttribute(\"href\") !== href) continue;\n\t\t\tfor (const attribute of [\"href\", \"type\", \"sizes\"] as const) {\n\t\t\t\tconst value = snapshot[attribute];\n\t\t\t\tif (value === null) snapshot.icon.removeAttribute(attribute);\n\t\t\t\telse snapshot.icon.setAttribute(attribute, value);\n\t\t\t}\n\t\t}\n\t};\n}\n","export function getOrCreatePortalRoot(id: string): HTMLElement | null {\n\tif (typeof document === \"undefined\") {\n\t\treturn null;\n\t}\n\n\tconst existingElement = document.getElementById(id);\n\tif (existingElement instanceof HTMLElement) {\n\t\treturn existingElement;\n\t}\n\n\tconst portalRoot = document.createElement(\"div\");\n\tportalRoot.id = id;\n\tdocument.body.append(portalRoot);\n\n\treturn portalRoot;\n}\n","/**\n * Наблюдает изменение одного DOM-контейнера без React state. Callback вызывается\n * в batched delivery ResizeObserver, поэтому дополнительный animation frame не нужен.\n * Возвращённый cleanup отключает observer и игнорирует уже поставленную delivery.\n */\nexport function observeElementResize(element: HTMLElement, onResize: () => void): () => void {\n\tif (typeof ResizeObserver === \"undefined\") return () => undefined;\n\tlet active = true;\n\tconst observer = new ResizeObserver((entries) => {\n\t\tif (active && entries.some((entry) => entry.target === element)) onResize();\n\t});\n\tobserver.observe(element);\n\treturn () => {\n\t\tif (!active) return;\n\t\tactive = false;\n\t\tobserver.disconnect();\n\t};\n}\n","import { type CapturedScrollAnchor } from \"./scrollAnchorTypes\";\n\n// Один scroll host не может одновременно компенсировать один и тот же prepend дважды.\nconst activeAnchors = new WeakMap<HTMLElement, CapturedScrollAnchor>();\n\n/**\n * Захватывает позицию сохраняемого элемента перед изменением обычного вертикального списка.\n * Вызывать только на browser event/effect boundary; restore — после DOM commit, release — при отмене.\n * Новый захват того же viewport завершает предыдущий без прокрутки.\n */\nexport function captureScrollAnchor(viewport: HTMLElement | null, anchor: HTMLElement | null): CapturedScrollAnchor | null {\n\tif (!viewport?.isConnected || !anchor?.isConnected || viewport === anchor || !viewport.contains(anchor)) return null;\n\n\tactiveAnchors.get(viewport)?.release();\n\tconst initialOffset =\n\t\tanchor.getBoundingClientRect().top - viewport.getBoundingClientRect().top - viewport.clientTop + viewport.scrollTop;\n\tconst initialStyle = viewport.style.getPropertyValue(\"overflow-anchor\");\n\tconst initialPriority = viewport.style.getPropertyPriority(\"overflow-anchor\");\n\tlet active = true;\n\n\t// Native anchoring иначе успеет компенсировать prepend до restore и приведёт к двойному сдвигу.\n\tviewport.style.setProperty(\"overflow-anchor\", \"none\", \"important\");\n\t// В браузере без этого CSS-свойства native anchoring тоже отсутствует: сравниваем фактически принятый стиль.\n\tconst ownedStyle = viewport.style.getPropertyValue(\"overflow-anchor\");\n\tconst ownedPriority = viewport.style.getPropertyPriority(\"overflow-anchor\");\n\tconst ownsStyle = () =>\n\t\tviewport.style.getPropertyValue(\"overflow-anchor\") === ownedStyle &&\n\t\tviewport.style.getPropertyPriority(\"overflow-anchor\") === ownedPriority;\n\n\tconst operation: CapturedScrollAnchor = {\n\t\trelease() {\n\t\t\tif (!active) return;\n\t\t\tactive = false;\n\t\t\tactiveAnchors.delete(viewport);\n\t\t\t// Не затираем новое решение host, если он сам изменил свойство во время ожидания.\n\t\t\tif (!ownsStyle()) return;\n\t\t\tif (initialStyle) viewport.style.setProperty(\"overflow-anchor\", initialStyle, initialPriority);\n\t\t\telse viewport.style.removeProperty(\"overflow-anchor\");\n\t\t},\n\t\trestore() {\n\t\t\tif (!active) return false;\n\t\t\ttry {\n\t\t\t\tif (!viewport.isConnected || !anchor.isConnected || !viewport.contains(anchor) || !ownsStyle()) return false;\n\t\t\t\tconst currentOffset =\n\t\t\t\t\tanchor.getBoundingClientRect().top - viewport.getBoundingClientRect().top - viewport.clientTop + viewport.scrollTop;\n\t\t\t\tconst delta = currentOffset - initialOffset;\n\t\t\t\t// Content-space delta не отменяет ручную прокрутку между запросом и commit.\n\t\t\t\t// Instant не наследует CSS smooth; горизонтальная позиция остаётся неизменной.\n\t\t\t\tif (delta !== 0) viewport.scrollBy({ top: delta, behavior: \"instant\" });\n\t\t\t\treturn true;\n\t\t\t} finally {\n\t\t\t\toperation.release();\n\t\t\t}\n\t\t}\n\t};\n\tactiveAnchors.set(viewport, operation);\n\treturn operation;\n}\n","import { RefObject, useEffect } from \"react\";\n\nexport function useClickOutside(ref: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[], handler: () => void) {\n\tuseEffect(() => {\n\t\tconst handleClickOutside = (event: MouseEvent) => {\n\t\t\tif (Array.isArray(ref)) {\n\t\t\t\tlet isOutside = true;\n\t\t\t\tfor (const r of ref) {\n\t\t\t\t\tif (r.current && r.current.contains(event.target as Node)) {\n\t\t\t\t\t\tisOutside = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isOutside) {\n\t\t\t\t\thandler();\n\t\t\t\t}\n\t\t\t} else if (ref.current && !ref.current.contains(event.target as Node)) {\n\t\t\t\thandler();\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener(\"mousedown\", handleClickOutside);\n\t\treturn () => document.removeEventListener(\"mousedown\", handleClickOutside);\n\t}, [ref, handler]);\n}\n","import { type RefObject, useLayoutEffect, useState } from \"react\";\n\nexport function useElementHeightObserver<TElement extends HTMLElement>(elementRef: RefObject<TElement | null>) {\n\tconst [height, setHeight] = useState(0);\n\n\tuseLayoutEffect(() => {\n\t\tconst element = elementRef.current;\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst observer = new ResizeObserver((entries) => {\n\t\t\tconst nextHeight = entries[0]?.contentRect.height ?? element.getBoundingClientRect().height;\n\t\t\tsetHeight(nextHeight);\n\t\t});\n\t\tobserver.observe(element);\n\n\t\treturn () => observer.disconnect();\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps, react-hooks/refs\n\t}, [elementRef.current]);\n\n\treturn height;\n}\n","import { RefObject, useEffect, useEffectEvent } from \"react\";\n\ninterface UseEscapeDismissOptions {\n\tactive: boolean;\n\tonDismiss: () => void;\n\tenabled?: boolean;\n\tdocumentTarget?: Document | null;\n\tcontainerRef?: RefObject<HTMLElement | null>;\n}\n\n/**\n * Подписывает overlay на закрытие по клавише Escape.\n */\nexport function useEscapeDismiss({ active, onDismiss, enabled = true, documentTarget, containerRef }: UseEscapeDismissOptions) {\n\tconst dismiss = useEffectEvent(() => onDismiss());\n\n\tuseEffect(() => {\n\t\tif (!active || !enabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst targetDocument = documentTarget ?? (typeof document === \"undefined\" ? null : document);\n\t\tif (!targetDocument) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst handleKeyDown = (event: KeyboardEvent) => {\n\t\t\tif (event.key !== \"Escape\" /*|| event.defaultPrevented*/) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst activeElement = targetDocument.activeElement;\n\t\t\tconst container = containerRef?.current;\n\t\t\tif (container && activeElement instanceof Node && activeElement !== container && !container.contains(activeElement)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tevent.preventDefault();\n\t\t\tdismiss();\n\t\t};\n\n\t\ttargetDocument.addEventListener(\"keydown\", handleKeyDown, true);\n\t\treturn () => targetDocument.removeEventListener(\"keydown\", handleKeyDown, true);\n\t}, [active, enabled, documentTarget, containerRef]);\n}\n","import { RefObject, useEffect, useEffectEvent, useRef } from \"react\";\n\nconst focusableElementsSelector =\n\t'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable=\"true\"]:not([tabindex=\"-1\"]), [contenteditable=\"\"]:not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"]):not([disabled])';\n\nexport interface UseOverlayFocusOptions<T extends HTMLElement> {\n\tactive: boolean;\n\ttrapFocus?: boolean;\n\trestoreFocus?: boolean;\n\tinitialFocus?: \"auto\" | \"container\" | ((container: T) => HTMLElement | null | undefined);\n\trestoreFocusTarget?: () => HTMLElement | null | undefined;\n\tcontainerRef?: RefObject<T | null>;\n}\n\n/**\n * Возвращает ref overlay-контейнера и управляет начальными/возвратными переходами фокуса.\n * Открытие и закрытие не прокручивают документ: портал может получить фокус\n * до завершения позиционирования. Пользовательский Tab по-прежнему раскрывает\n * выбранный элемент в прокручиваемом содержимом overlay.\n */\nexport function useOverlayFocus<T extends HTMLElement>({\n\tactive,\n\ttrapFocus = false,\n\trestoreFocus = true,\n\tinitialFocus = \"auto\",\n\trestoreFocusTarget,\n\tcontainerRef\n}: UseOverlayFocusOptions<T>) {\n\tconst internalOverlayRef = useRef<T | null>(null);\n\tconst overlayRef = containerRef ?? internalOverlayRef;\n\tconst previousActiveElementRef = useRef<HTMLElement | null>(null);\n\n\t/**\n\t * Собирает фокусируемые элементы overlay в актуальном DOM-порядке.\n\t */\n\tconst getFocusableElements = useEffectEvent((container: T) =>\n\t\tArray.from(container.querySelectorAll<HTMLElement>(focusableElementsSelector)).filter(\n\t\t\t(element) => !element.hasAttribute(\"aria-hidden\")\n\t\t)\n\t);\n\n\t/**\n\t * Вычисляет стартовый фокус при открытии overlay.\n\t */\n\tconst resolveInitialFocus = useEffectEvent((container: T) => {\n\t\tif (initialFocus === \"container\") {\n\t\t\treturn container;\n\t\t}\n\n\t\tif (typeof initialFocus === \"function\") {\n\t\t\treturn initialFocus(container) ?? container;\n\t\t}\n\n\t\tconst focusableElements = getFocusableElements(container);\n\t\treturn (\n\t\t\tfocusableElements.find((element) => element.hasAttribute(\"autofocus\") || element.hasAttribute(\"autoFocus\")) ??\n\t\t\tfocusableElements[0] ??\n\t\t\tcontainer\n\t\t);\n\t});\n\n\t/**\n\t * Вычисляет элемент, которому нужно вернуть фокус после закрытия overlay.\n\t */\n\tconst resolveRestoreFocusTarget = useEffectEvent(() => restoreFocusTarget?.() ?? previousActiveElementRef.current);\n\n\tuseEffect(() => {\n\t\tif (!active) {\n\t\t\treturn;\n\t\t}\n\n\t\tpreviousActiveElementRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n\t\tlet overlayElement: T | null = null;\n\t\tlet rafId = 0;\n\n\t\t/**\n\t\t * Цикл откладывает инициализацию, пока ref контейнера не будет привязан к DOM.\n\t\t */\n\t\tconst attachOverlay = () => {\n\t\t\toverlayElement = overlayRef.current;\n\t\t\tif (!overlayElement) {\n\t\t\t\trafId = window.requestAnimationFrame(attachOverlay);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst focusTarget = resolveInitialFocus(overlayElement);\n\t\t\tif (focusTarget instanceof HTMLElement && focusTarget.isConnected) {\n\t\t\t\tfocusTarget.focus({ preventScroll: true });\n\t\t\t}\n\n\t\t\tif (trapFocus) {\n\t\t\t\toverlayElement.addEventListener(\"keydown\", handleTabKey);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Зацикливает Tab внутри overlay, пока он открыт как модальный слой.\n\t\t */\n\t\tconst handleTabKey = (event: KeyboardEvent) => {\n\t\t\tif (!trapFocus || event.key !== \"Tab\" || !overlayElement) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst focusableElements = getFocusableElements(overlayElement);\n\t\t\tif (focusableElements.length === 0) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\toverlayElement.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst firstElement = focusableElements[0];\n\t\t\tconst lastElement = focusableElements[focusableElements.length - 1];\n\t\t\tconst activeElement = document.activeElement;\n\n\t\t\tif (event.shiftKey) {\n\t\t\t\tif (activeElement === firstElement || activeElement === overlayElement) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tlastElement.focus();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (activeElement === lastElement) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tfirstElement.focus();\n\t\t\t}\n\t\t};\n\n\t\tattachOverlay();\n\n\t\treturn () => {\n\t\t\twindow.cancelAnimationFrame(rafId);\n\t\t\tif (trapFocus && overlayElement) {\n\t\t\t\toverlayElement.removeEventListener(\"keydown\", handleTabKey);\n\t\t\t}\n\n\t\t\tif (!restoreFocus) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst restoreTarget = resolveRestoreFocusTarget();\n\t\t\tif (restoreTarget?.isConnected) {\n\t\t\t\trestoreTarget.focus({ preventScroll: true });\n\t\t\t}\n\t\t};\n\t}, [active, trapFocus, restoreFocus, overlayRef]);\n\n\treturn overlayRef;\n}\n","import { useOverlayFocus } from \"./useOverlayFocus\";\n\n/**\n * Совместимый wrapper для overlay с фокус-ловушкой.\n */\nexport const useFocusTrap = (isOpen: boolean) => {\n\treturn useOverlayFocus<HTMLDivElement>({ active: isOpen, trapFocus: true, restoreFocus: true, initialFocus: \"auto\" });\n};\n","import { useEffect, useState } from \"react\";\n\nexport function useIntersectionObserver(ref: React.RefObject<Element | null>, options?: IntersectionObserverInit) {\n\tconst [isIntersecting, setIsIntersecting] = useState(false);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tif (!el) return;\n\n\t\tconst observer = new IntersectionObserver(([entry]) => {\n\t\t\tsetIsIntersecting(entry.isIntersecting);\n\t\t}, options);\n\n\t\tobserver.observe(el);\n\n\t\treturn () => {\n\t\t\tif (el) {\n\t\t\t\tobserver.unobserve(el);\n\t\t\t}\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [options, ref]); // не забыть, что ref.current может меняться\n\n\treturn { isIntersecting };\n}\n","import { useEffect, useState } from \"react\";\n\nexport const useIsTouchDevice = () => {\n\tconst [isTouchDevice, setIsTouchDevice] = useState(false);\n\n\tuseEffect(() => {\n\t\tconst checkTouchDevice = () => {\n\t\t\tconst isTouch = window.matchMedia(\"(pointer: coarse)\").matches || \"ontouchstart\" in window || navigator.maxTouchPoints > 0;\n\t\t\tsetIsTouchDevice(isTouch);\n\t\t};\n\n\t\tcheckTouchDevice();\n\n\t\t// Обработчик для изменений в типе устройства\n\t\twindow.addEventListener(\"resize\", checkTouchDevice);\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener(\"resize\", checkTouchDevice);\n\t\t};\n\t}, []);\n\n\treturn isTouchDevice;\n};\n","/** Проверяет обычную вложенную scroll-цепочку; корневой документ не является разрешённым host. */\nexport function canConsumeVerticalTouchScroll(documentTarget: Document, path: readonly EventTarget[], deltaY: number): boolean {\n\tconst view = documentTarget.defaultView;\n\tif (!view) return true;\n\tfor (const entry of path) {\n\t\tif (entry === documentTarget.body || entry === documentTarget.documentElement) break;\n\t\tif (!(entry instanceof view.Element) || !entry.isConnected) continue;\n\t\tconst style = view.getComputedStyle(entry);\n\t\tif (!/^(auto|scroll|overlay)$/.test(style.overflowY)) continue;\n\t\t// Reverse/writing-mode layout имеет другую систему координат. В этом patch\n\t\t// не подменяем её предположением 0..max и не реализуем собственную scroll physics.\n\t\tif (style.flexDirection === \"column-reverse\" || (style.writingMode && style.writingMode !== \"horizontal-tb\")) return true;\n\t\tconst maximum = Math.max(0, entry.scrollHeight - entry.clientHeight);\n\t\tconst top = Math.max(0, Math.min(maximum, entry.scrollTop));\n\t\t// scrollTop дробный, а scrollHeight/clientHeight округлены: 1 CSS px\n\t\t// допуска перекрывает ложный остаток на физически достигнутом краю.\n\t\tif (deltaY > 0 ? maximum - top > 1 : top > 1) return true;\n\t\t// На краю contain/none движение не должно переходить к следующему ancestor.\n\t\tif (/^(contain|none)$/.test(style.overscrollBehaviorY)) return false;\n\t}\n\treturn false;\n}\n","/** Редактирование/выделение остаются у браузера: перехват move способен сорвать drag каретки. */\nexport function isNativeTouchInteraction(documentTarget: Document, path: readonly EventTarget[]): boolean {\n\tconst view = documentTarget.defaultView;\n\tif (!view) return true;\n\tlet editableBoundarySeen = false;\n\tlet target: Element | undefined;\n\tfor (const entry of path) {\n\t\tif (!(entry instanceof view.Element)) continue;\n\t\ttarget ??= entry;\n\t\tif (entry.matches(\"input:not(:disabled), textarea:not(:disabled), select:not(:disabled), audio[controls], video[controls]\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (editableBoundarySeen) continue;\n\t\tconst editable = entry.getAttribute(\"contenteditable\")?.toLowerCase();\n\t\tif (editable === \"\" || editable === \"true\" || editable === \"plaintext-only\") return true;\n\t\tif (editable === \"false\") editableBoundarySeen = true;\n\t}\n\tconst selection = documentTarget.getSelection();\n\t// Чужое выделение не отключает защиту заголовка/фона на всей странице.\n\tif (!target || !selection || selection.isCollapsed) return false;\n\tfor (let index = 0; index < selection.rangeCount; index += 1) {\n\t\tif (selection.getRangeAt(index).intersectsNode(target)) return true;\n\t}\n\treturn false;\n}\n","import { canConsumeVerticalTouchScroll } from \"./canConsumeVerticalTouchScroll\";\nimport { isNativeTouchInteraction } from \"./isNativeTouchInteraction\";\n\ntype TouchScrollObservation = Readonly<{\n\tidentifier: number;\n\tx: number;\n\ty: number;\n\tpath: readonly EventTarget[];\n}>;\n\n/**\n * Safari может передать вертикальный pan корню при открытой клавиатуре даже\n * с fixed body. Страхуем пустую область/достигнутый край, не имитируя скроллинг.\n * Один listener set живёт ровно столько же, сколько общий document lock.\n */\nexport function attachDocumentTouchScrollGuard(documentTarget: Document): () => void {\n\tconst view = documentTarget.defaultView;\n\tlet observation: TouchScrollObservation | null = null;\n\tlet bypassGesture = false;\n\n\tconst onStart = (event: TouchEvent): void => {\n\t\t// После pinch даже оставшийся один палец принадлежит тому же native gesture.\n\t\tif (bypassGesture) return;\n\t\tconst touch = event.touches[0];\n\t\tconst path = event.composedPath();\n\t\tif (\n\t\t\tevent.touches.length !== 1 ||\n\t\t\t!touch ||\n\t\t\t(view?.visualViewport?.scale ?? 1) > 1 ||\n\t\t\tisNativeTouchInteraction(documentTarget, path)\n\t\t) {\n\t\t\tbypassGesture = true;\n\t\t\tobservation = null;\n\t\t\treturn;\n\t\t}\n\t\tobservation = { identifier: touch.identifier, x: touch.clientX, y: touch.clientY, path };\n\t};\n\n\tconst onMove = (event: TouchEvent): void => {\n\t\tif (bypassGesture || !observation) return;\n\t\tconst touch = event.touches[0];\n\t\tif (event.touches.length !== 1 || !touch || touch.identifier !== observation.identifier || (view?.visualViewport?.scale ?? 1) > 1) {\n\t\t\tbypassGesture = true;\n\t\t\tobservation = null;\n\t\t\treturn;\n\t\t}\n\t\tconst { x, y, path } = observation;\n\t\tconst deltaX = x - touch.clientX;\n\t\tconst deltaY = y - touch.clientY;\n\t\tobservation = { identifier: touch.identifier, x: touch.clientX, y: touch.clientY, path };\n\t\tif (isNativeTouchInteraction(documentTarget, path)) {\n\t\t\tbypassGesture = true;\n\t\t\treturn;\n\t\t}\n\t\t// Горизонтальные жесты, wheel и touchstart остаются без изменений.\n\t\tif (!event.cancelable || event.defaultPrevented || !deltaY || Math.abs(deltaX) >= Math.abs(deltaY)) return;\n\t\tif (!canConsumeVerticalTouchScroll(documentTarget, path, deltaY)) event.preventDefault();\n\t};\n\n\tconst onEnd = (event: TouchEvent): void => {\n\t\tif (event.touches.length > 0) return;\n\t\tobservation = null;\n\t\tbypassGesture = false;\n\t};\n\n\tdocumentTarget.addEventListener(\"touchstart\", onStart, { capture: true, passive: true });\n\tdocumentTarget.addEventListener(\"touchmove\", onMove, { capture: true, passive: false });\n\tdocumentTarget.addEventListener(\"touchend\", onEnd, { capture: true, passive: true });\n\tdocumentTarget.addEventListener(\"touchcancel\", onEnd, { capture: true, passive: true });\n\treturn () => {\n\t\tdocumentTarget.removeEventListener(\"touchstart\", onStart, true);\n\t\tdocumentTarget.removeEventListener(\"touchmove\", onMove, true);\n\t\tdocumentTarget.removeEventListener(\"touchend\", onEnd, true);\n\t\tdocumentTarget.removeEventListener(\"touchcancel\", onEnd, true);\n\t\tobservation = null;\n\t};\n}\n","import { attachDocumentTouchScrollGuard } from \"./attachDocumentTouchScrollGuard\";\n\ntype InlineProperty = Readonly<{ name: string; value: string; priority: string }>;\n\ntype DocumentScrollLock = Readonly<{\n\tleases: Map<symbol, boolean>;\n\tupdateCompensation: () => void;\n\trestore: () => void;\n}>;\n\nconst locks = new WeakMap<Document, DocumentScrollLock>();\n\n/** Снимок ограничен принадлежащими lock свойствами, остальные inline-правки не затрагиваются. */\nfunction captureProperties(style: CSSStyleDeclaration, names: readonly string[]): readonly InlineProperty[] {\n\treturn names.map((name) => ({ name, value: style.getPropertyValue(name), priority: style.getPropertyPriority(name) }));\n}\n\nfunction restoreProperties(style: CSSStyleDeclaration, properties: readonly InlineProperty[]): void {\n\t// Сначала снимаем весь принадлежащий нам shorthand/longhand набор: иначе позднее\n\t// удаление пустого longhand может отменить только что восстановленный shorthand.\n\tfor (const { name } of properties) style.removeProperty(name);\n\tfor (const { name, value, priority } of properties) {\n\t\tif (value) style.setProperty(name, value, priority);\n\t}\n}\n\n/** Один владелец body/html на документ предотвращает преждевременный unlock вложенных overlays. */\nexport function acquireDocumentScrollLock(documentTarget: Document, compensateScrollbar: boolean): () => void {\n\tconst view = documentTarget.defaultView;\n\tconst body = documentTarget.body;\n\tif (!view || !body) return () => undefined;\n\n\tlet lock = locks.get(documentTarget);\n\tif (!lock) {\n\t\tconst rootStyle = documentTarget.documentElement.style;\n\t\tconst bodyStyle = body.style;\n\t\tconst rootProperties = captureProperties(rootStyle, [\"overflow\", \"overflow-x\", \"overflow-y\"]);\n\t\tconst bodyProperties = captureProperties(bodyStyle, [\n\t\t\t\"position\",\n\t\t\t\"top\",\n\t\t\t\"left\",\n\t\t\t\"width\",\n\t\t\t\"overflow\",\n\t\t\t\"overflow-x\",\n\t\t\t\"overflow-y\",\n\t\t\t\"box-sizing\",\n\t\t\t\"padding-right\"\n\t\t]);\n\t\tconst originalPadding = captureProperties(bodyStyle, [\"padding-right\"]);\n\t\tconst scrollX = view.scrollX;\n\t\tconst scrollY = view.scrollY;\n\t\tconst scrollbarWidth = Math.max(0, view.innerWidth - documentTarget.documentElement.clientWidth);\n\t\tconst computedPadding = Number.parseFloat(view.getComputedStyle(body).paddingRight) || 0;\n\t\tconst leases = new Map<symbol, boolean>();\n\n\t\t// Fixed body нужен и при iOS visual-viewport pan: одного overflow hidden недостаточно.\n\t\trootStyle.setProperty(\"overflow\", \"hidden\");\n\t\tbodyStyle.setProperty(\"position\", \"fixed\");\n\t\tbodyStyle.setProperty(\"top\", `${-scrollY}px`);\n\t\tbodyStyle.setProperty(\"left\", `${-scrollX}px`);\n\t\tbodyStyle.setProperty(\"width\", \"100%\");\n\t\tbodyStyle.setProperty(\"overflow\", \"hidden\");\n\t\tbodyStyle.setProperty(\"box-sizing\", \"border-box\");\n\t\tconst releaseTouchGuard = attachDocumentTouchScrollGuard(documentTarget);\n\n\t\tlock = {\n\t\t\tleases,\n\t\t\tupdateCompensation: () => {\n\t\t\t\tif (scrollbarWidth > 0 && [...leases.values()].some(Boolean)) {\n\t\t\t\t\tbodyStyle.setProperty(\"padding-right\", `${computedPadding + scrollbarWidth}px`);\n\t\t\t\t} else restoreProperties(bodyStyle, originalPadding);\n\t\t\t},\n\t\t\trestore: () => {\n\t\t\t\treleaseTouchGuard();\n\t\t\t\trestoreProperties(rootStyle, rootProperties);\n\t\t\t\trestoreProperties(bodyStyle, bodyProperties);\n\t\t\t\tview.scrollTo({ left: scrollX, top: scrollY, behavior: \"instant\" });\n\t\t\t}\n\t\t};\n\t\tlocks.set(documentTarget, lock);\n\t}\n\n\tconst lease = Symbol();\n\tlock.leases.set(lease, compensateScrollbar);\n\tlock.updateCompensation();\n\treturn () => {\n\t\tif (!lock.leases.delete(lease)) return;\n\t\tif (lock.leases.size > 0) lock.updateCompensation();\n\t\telse {\n\t\t\tlocks.delete(documentTarget);\n\t\t\tlock.restore();\n\t\t}\n\t};\n}\n","import { useEffect } from \"react\";\n\nimport { acquireDocumentScrollLock } from \"./document-scroll/acquireDocumentScrollLock\";\nimport { type UseDocumentScrollLockOptions } from \"./document-scroll/documentScrollLockTypes\";\n\n/** Блокирует фоновую прокрутку до освобождения последнего потребителя; не управляет focus/inert. */\nexport function useDocumentScrollLock({ active, documentTarget, compensateScrollbar = false }: UseDocumentScrollLockOptions): void {\n\tuseEffect(() => {\n\t\tif (!active) return;\n\t\tconst target = documentTarget === undefined ? (typeof document === \"undefined\" ? null : document) : documentTarget;\n\t\tif (!target) return;\n\t\treturn acquireDocumentScrollLock(target, compensateScrollbar);\n\t}, [active, documentTarget, compensateScrollbar]);\n}\n","const properties = [\"--visual-viewport-top\", \"--visual-viewport-left\", \"--visual-viewport-width\", \"--visual-viewport-height\"] as const;\n\nconst attachments = new WeakMap<HTMLElement, { leases: Set<symbol>; detach: () => void }>();\n\n/** Подписка меняет CSS-переменные конкретной поверхности, не вызывает React render на каждом pan. */\nfunction createVisualViewportFrame(container: HTMLElement): () => void {\n\tconst view = container.ownerDocument.defaultView;\n\tif (!view) return () => undefined;\n\tconst viewport = view.visualViewport;\n\tconst style = container.style;\n\tconst previous = properties.map((name) => ({ name, value: style.getPropertyValue(name), priority: style.getPropertyPriority(name) }));\n\tconst ownedValues = new Map<string, string>();\n\tlet frame = 0;\n\n\tconst update = (): void => {\n\t\tframe = 0;\n\t\tconst bounds = [\n\t\t\tviewport?.offsetTop ?? 0,\n\t\t\tviewport?.offsetLeft ?? 0,\n\t\t\tviewport?.width ?? view.innerWidth,\n\t\t\tviewport?.height ?? view.innerHeight\n\t\t];\n\t\tconst fallback = [0, 0, view.innerWidth, view.innerHeight];\n\t\tproperties.forEach((name, index) => {\n\t\t\tconst value = `${Number.isFinite(bounds[index]) ? bounds[index] : fallback[index]}px`;\n\t\t\tif (ownedValues.get(name) === value) return;\n\t\t\tstyle.setProperty(name, value);\n\t\t\townedValues.set(name, value);\n\t\t});\n\t};\n\n\tconst schedule = (): void => {\n\t\tif (!frame) frame = view.requestAnimationFrame(update);\n\t};\n\n\tupdate();\n\tviewport?.addEventListener(\"resize\", schedule);\n\tviewport?.addEventListener(\"scroll\", schedule);\n\tview.addEventListener(\"resize\", schedule);\n\treturn () => {\n\t\tview.cancelAnimationFrame(frame);\n\t\tviewport?.removeEventListener(\"resize\", schedule);\n\t\tviewport?.removeEventListener(\"scroll\", schedule);\n\t\tview.removeEventListener(\"resize\", schedule);\n\t\tfor (const { name, value, priority } of previous) {\n\t\t\t// Не затираем новое значение, если внешний owner уже забрал это CSS-свойство.\n\t\t\tif (style.getPropertyValue(name) !== ownedValues.get(name) || style.getPropertyPriority(name)) continue;\n\t\t\tif (value) style.setProperty(name, value, priority);\n\t\t\telse style.removeProperty(name);\n\t\t}\n\t};\n}\n\n/** Несколько модалок могут разделять portal-root; его frame снимается только последним owner. */\nexport function attachVisualViewportFrame(container: HTMLElement): () => void {\n\tlet attachment = attachments.get(container);\n\tif (!attachment) {\n\t\tattachment = { leases: new Set(), detach: createVisualViewportFrame(container) };\n\t\tattachments.set(container, attachment);\n\t}\n\tconst lease = Symbol();\n\tattachment.leases.add(lease);\n\treturn () => {\n\t\tif (!attachment.leases.delete(lease) || attachment.leases.size > 0) return;\n\t\tattachments.delete(container);\n\t\tattachment.detach();\n\t};\n}\n","import { useEffect } from \"react\";\n\nimport { attachVisualViewportFrame } from \"./visual-viewport/attachVisualViewportFrame\";\nimport { type UseVisualViewportFrameOptions } from \"./visual-viewport/visualViewportFrameTypes\";\n\n/** CSS frame использует реальные visualViewport размеры без отмены pinch zoom; SSR оставляет CSS fallback. */\nexport function useVisualViewportFrame({ active, containerRef }: UseVisualViewportFrameOptions): void {\n\tuseEffect(() => {\n\t\tif (!active || typeof window === \"undefined\") return;\n\t\tlet frame = 0;\n\t\tlet detach: (() => void) | undefined;\n\t\t// Portal может установить ref позже родительского effect; ожидание завершается при cleanup.\n\t\tconst attach = () => {\n\t\t\tconst container = containerRef.current;\n\t\t\tif (container) detach = attachVisualViewportFrame(container);\n\t\t\telse frame = window.requestAnimationFrame(attach);\n\t\t};\n\t\tattach();\n\t\treturn () => {\n\t\t\twindow.cancelAnimationFrame(frame);\n\t\t\tdetach?.();\n\t\t};\n\t}, [active, containerRef]);\n}\n"],"mappings":";;AAAA,SAAgB,EAA0B,GAAkB,GAAmB;CAC9E,IAAM,IAAO,SAAS,cAAc,GAAG;CAMvC,AAJA,EAAK,OAAO,GACZ,EAAK,WAAW,GAChB,EAAK,MAAM,GAEX,OAAO,iBAAiB;EACvB,OAAO,IAAI,gBAAgB,CAAS;CACrC,GAAG,CAAC;AACL;AAEA,SAAgB,EAAqB,GAAkB,GA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ACjD;EAEA,OADA,EAAO,SACM;GAEZ,AADA,OAAO,qBAAqB,CAAK,GACjC,IAAS;EACV;CACD,GAAG,CAAC,GAAQ,CAAY,CAAC;AAC1B"}
|
|
@@ -5,7 +5,7 @@ import { It as a, Mn as o, _t as s, ln as c, mn as l, vn as u } from "./odata-se
|
|
|
5
5
|
import { S as d, _ as f, c as ee, d as p, g as m, n as te, o as ne, p as re, t as h, v as ie } from "./validate-C8cQm_9m.js";
|
|
6
6
|
import { t as ae } from "./string-comparison-BKT7PXmq.js";
|
|
7
7
|
import { isSafe as oe } from "../validators/index.js";
|
|
8
|
-
import {
|
|
8
|
+
import { t as se } from "./uuid-CUJPAbRY.js";
|
|
9
9
|
//#region src/formatters/strings/formatRussianPlural.ts
|
|
10
10
|
var ce = new Intl.PluralRules("ru-RU");
|
|
11
11
|
function g(e, t) {
|
|
@@ -1212,4 +1212,4 @@ function Gn(e, t) {
|
|
|
1212
1212
|
//#endregion
|
|
1213
1213
|
export { L as $, Pt as A, w as At, Dt as B, he as Bt, X as C, Ve as Ct, zt as D, Ie as Dt, Rt as E, Ue as Et, Tt as F, Ke as Ft, H as G, de as Gt, V as H, me as Ht, B as I, ze as It, At as J, g as Jt, kt as K, ue as Kt, wt as L, qe as Lt, Ft as M, Le as Mt, It as N, Ge as Nt, G as O, We as Ot, Mt as P, Re as Pt, F as Q, W as R, Oe as Rt, Kt as S, Ne as St, Ht as T, Fe as Tt, Et as U, pe as Ut, U as V, ge as Vt, jt as W, fe as Wt, gt as X, I as Y, dt as Z, Ut as _, Ze as _t, Vn as a, ct as at, Gt as b, Je as bt, Dn as c, tt as ct, ln as d, j as dt, ft as et, Z as f, N as ft, Xt as g, k as gt, Zt as h, nt as ht, Bn as i, lt as it, Nt as j, Be as jt, Lt as k, He as kt, En as l, A as lt, rn as m, Qe as mt, Un as n, pt as nt, Hn as o, P as ot, an as p, $e as pt, z as q, le as qt, Wn as r, st as rt, Mn as s, et as st, Gn as t, mt as tt, Cn as u, M as ut, Y as v, Xe as vt, Vt as w, Pe as wt, J as x, C as xt, Wt as y, Ye as yt, Ot as z, y as zt };
|
|
1214
1214
|
|
|
1215
|
-
//# sourceMappingURL=formatters-
|
|
1215
|
+
//# sourceMappingURL=formatters-B_NcT2pe.js.map
|