boreal-ui 0.0.26 → 0.0.27
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/core/{Footer-CcSbV-IP.js → Footer-CPg_4j5r.js} +2 -2
- package/dist/core/{Footer-CcSbV-IP.js.map → Footer-CPg_4j5r.js.map} +1 -1
- package/dist/core/{Footer-C0xaMboS.cjs → Footer-kLL_3Qc-.cjs} +2 -2
- package/dist/core/{Footer-C0xaMboS.cjs.map → Footer-kLL_3Qc-.cjs.map} +1 -1
- package/dist/core/Footer.cjs.js +1 -1
- package/dist/core/Footer.js +1 -1
- package/dist/{next/ThemeContext-Bo0vLczy.js → core/ThemeContext-B-z-faEj.js} +30 -30
- package/dist/core/ThemeContext-B-z-faEj.js.map +1 -0
- package/dist/core/{ThemeContext-CtZXUeeU.cjs → ThemeContext-CtNdJ7LK.cjs} +29 -29
- package/dist/core/ThemeContext-CtNdJ7LK.cjs.map +1 -0
- package/dist/core/ThemeProvider.cjs.js +1 -1
- package/dist/core/ThemeProvider.js +1 -1
- package/dist/core/index.cjs.js +2 -2
- package/dist/core/index.js +2 -2
- package/dist/next/{Avatar-B3eTb_Xz.js → Avatar-CKByQz4V.js} +3 -3
- package/dist/next/{Avatar-B3eTb_Xz.js.map → Avatar-CKByQz4V.js.map} +1 -1
- package/dist/next/{Avatar-BX8mh_3b.cjs → Avatar-Cd_TqEqJ.cjs} +3 -3
- package/dist/next/{Avatar-BX8mh_3b.cjs.map → Avatar-Cd_TqEqJ.cjs.map} +1 -1
- package/dist/next/Avatar.cjs.js +1 -1
- package/dist/next/Avatar.js +1 -1
- package/dist/next/{Breadcrumbs-BM-yj_kq.js → Breadcrumbs-CsQGqIFq.js} +3 -3
- package/dist/next/{Breadcrumbs-BM-yj_kq.js.map → Breadcrumbs-CsQGqIFq.js.map} +1 -1
- package/dist/next/{Breadcrumbs-7MNPobUi.cjs → Breadcrumbs-pw9Ow6LT.cjs} +3 -3
- package/dist/next/{Breadcrumbs-7MNPobUi.cjs.map → Breadcrumbs-pw9Ow6LT.cjs.map} +1 -1
- package/dist/next/Breadcrumbs.cjs.js +1 -1
- package/dist/next/Breadcrumbs.js +1 -1
- package/dist/next/{Button-G1PFBSqU.cjs → Button-CksDHAGT.cjs} +2 -2
- package/dist/next/{Button-G1PFBSqU.cjs.map → Button-CksDHAGT.cjs.map} +1 -1
- package/dist/next/{Button-ClWB5gZW.js → Button-DUYFGciR.js} +2 -2
- package/dist/next/{Button-ClWB5gZW.js.map → Button-DUYFGciR.js.map} +1 -1
- package/dist/next/Button.cjs.js +1 -1
- package/dist/next/Button.js +1 -1
- package/dist/next/{Card-B_USybKk.js → Card-DFKVGnWo.js} +4 -4
- package/dist/next/{Card-B_USybKk.js.map → Card-DFKVGnWo.js.map} +1 -1
- package/dist/next/{Card-Bg9EknRD.cjs → Card-HHvgocCd.cjs} +4 -4
- package/dist/next/{Card-Bg9EknRD.cjs.map → Card-HHvgocCd.cjs.map} +1 -1
- package/dist/next/Card.cjs.js +1 -1
- package/dist/next/Card.js +1 -1
- package/dist/next/{Chip-DoRB7LBO.cjs → Chip-CPe_ATTn.cjs} +2 -2
- package/dist/next/{Chip-DoRB7LBO.cjs.map → Chip-CPe_ATTn.cjs.map} +1 -1
- package/dist/next/{Chip-CMP-naRw.js → Chip-DngJ3Nsm.js} +2 -2
- package/dist/next/{Chip-CMP-naRw.js.map → Chip-DngJ3Nsm.js.map} +1 -1
- package/dist/next/Chip.cjs.js +1 -1
- package/dist/next/Chip.js +1 -1
- package/dist/next/{CommandPalette-DjR2pE5m.cjs → CommandPalette-BExinZ-y.cjs} +2 -2
- package/dist/next/{CommandPalette-DjR2pE5m.cjs.map → CommandPalette-BExinZ-y.cjs.map} +1 -1
- package/dist/next/{CommandPalette-BaJ9KSob.js → CommandPalette-BKamGmgu.js} +2 -2
- package/dist/next/{CommandPalette-BaJ9KSob.js.map → CommandPalette-BKamGmgu.js.map} +1 -1
- package/dist/next/CommandPalette.cjs.js +1 -1
- package/dist/next/CommandPalette.js +1 -1
- package/dist/next/{Dropdown-CzQhdSD7.js → Dropdown-B2xAwrlF.js} +2 -2
- package/dist/next/{Dropdown-CzQhdSD7.js.map → Dropdown-B2xAwrlF.js.map} +1 -1
- package/dist/next/{Dropdown-BHd5BuCB.cjs → Dropdown-COJxJqzC.cjs} +2 -2
- package/dist/next/{Dropdown-BHd5BuCB.cjs.map → Dropdown-COJxJqzC.cjs.map} +1 -1
- package/dist/next/Dropdown.cjs.js +1 -1
- package/dist/next/Dropdown.js +1 -1
- package/dist/next/{EmptyState-BbuuFZCb.js → EmptyState-DeYWnFaJ.js} +2 -2
- package/dist/next/{EmptyState-BbuuFZCb.js.map → EmptyState-DeYWnFaJ.js.map} +1 -1
- package/dist/next/{EmptyState-edgOQ6GW.cjs → EmptyState-DepuL2N8.cjs} +2 -2
- package/dist/next/{EmptyState-edgOQ6GW.cjs.map → EmptyState-DepuL2N8.cjs.map} +1 -1
- package/dist/next/EmptyState.cjs.js +1 -1
- package/dist/next/EmptyState.js +1 -1
- package/dist/next/{FileUpload-D7qdf0y5.js → FileUpload-C91Pd8t7.js} +3 -3
- package/dist/next/{FileUpload-D7qdf0y5.js.map → FileUpload-C91Pd8t7.js.map} +1 -1
- package/dist/next/{FileUpload-BeTvsLw-.cjs → FileUpload-tiwkr7n-.cjs} +3 -3
- package/dist/next/{FileUpload-BeTvsLw-.cjs.map → FileUpload-tiwkr7n-.cjs.map} +1 -1
- package/dist/next/FileUpload.cjs.js +1 -1
- package/dist/next/FileUpload.js +1 -1
- package/dist/next/{Footer-CQhcAscy.cjs → Footer-BkA5H1MS.cjs} +5 -5
- package/dist/next/{Footer-CQhcAscy.cjs.map → Footer-BkA5H1MS.cjs.map} +1 -1
- package/dist/next/{Footer-Rshwlhwo.js → Footer-BvTet1LG.js} +5 -5
- package/dist/next/{Footer-Rshwlhwo.js.map → Footer-BvTet1LG.js.map} +1 -1
- package/dist/next/Footer.cjs.js +1 -1
- package/dist/next/Footer.js +1 -1
- package/dist/next/{IconButton-Dk8EDf4Z.js → IconButton-BjZZm2hJ.js} +2 -2
- package/dist/next/{IconButton-Dk8EDf4Z.js.map → IconButton-BjZZm2hJ.js.map} +1 -1
- package/dist/next/{IconButton-SZdNlqIZ.cjs → IconButton-DvfiteNA.cjs} +2 -2
- package/dist/next/{IconButton-SZdNlqIZ.cjs.map → IconButton-DvfiteNA.cjs.map} +1 -1
- package/dist/next/IconButton.cjs.js +1 -1
- package/dist/next/IconButton.js +1 -1
- package/dist/next/{MessagePopUp-D6QdsrUO.cjs → MessagePopUp-8Jk_jkt_.cjs} +3 -3
- package/dist/next/{MessagePopUp-D6QdsrUO.cjs.map → MessagePopUp-8Jk_jkt_.cjs.map} +1 -1
- package/dist/next/{MessagePopUp-DEbsvN19.js → MessagePopUp-DCP7uPnZ.js} +3 -3
- package/dist/next/{MessagePopUp-DEbsvN19.js.map → MessagePopUp-DCP7uPnZ.js.map} +1 -1
- package/dist/next/MessagePopUp.cjs.js +1 -1
- package/dist/next/MessagePopUp.js +1 -1
- package/dist/next/{Modal-BmAYw3X9.cjs → Modal-C2aLpohd.cjs} +2 -2
- package/dist/next/{Modal-BmAYw3X9.cjs.map → Modal-C2aLpohd.cjs.map} +1 -1
- package/dist/next/{Modal-BOaNai97.js → Modal-DFnJUiOY.js} +2 -2
- package/dist/next/{Modal-BOaNai97.js.map → Modal-DFnJUiOY.js.map} +1 -1
- package/dist/next/Modal.cjs.js +1 -1
- package/dist/next/Modal.js +1 -1
- package/dist/next/{NavBar-CO4v6_28.cjs → NavBar-CqPh60CY.cjs} +3 -3
- package/dist/next/{NavBar-CO4v6_28.cjs.map → NavBar-CqPh60CY.cjs.map} +1 -1
- package/dist/next/{NavBar-CKo-nom2.js → NavBar-CtpkmbXJ.js} +3 -3
- package/dist/next/{NavBar-CKo-nom2.js.map → NavBar-CtpkmbXJ.js.map} +1 -1
- package/dist/next/NavBar.cjs.js +1 -1
- package/dist/next/NavBar.js +1 -1
- package/dist/next/{NotificationCenter-BIuJj-PB.cjs → NotificationCenter-ChaO0Xu5.cjs} +3 -3
- package/dist/next/{NotificationCenter-BIuJj-PB.cjs.map → NotificationCenter-ChaO0Xu5.cjs.map} +1 -1
- package/dist/next/{NotificationCenter-DCE8DuOm.js → NotificationCenter-ySBsv_F4.js} +3 -3
- package/dist/next/{NotificationCenter-DCE8DuOm.js.map → NotificationCenter-ySBsv_F4.js.map} +1 -1
- package/dist/next/NotificationCenter.cjs.js +1 -1
- package/dist/next/NotificationCenter.js +1 -1
- package/dist/next/{Pager-DiZtB-Df.js → Pager-BYY7KOKU.js} +3 -3
- package/dist/next/{Pager-DiZtB-Df.js.map → Pager-BYY7KOKU.js.map} +1 -1
- package/dist/next/{Pager-BADOS4cm.cjs → Pager-Bbbq04I_.cjs} +3 -3
- package/dist/next/{Pager-BADOS4cm.cjs.map → Pager-Bbbq04I_.cjs.map} +1 -1
- package/dist/next/Pager.cjs.js +1 -1
- package/dist/next/Pager.js +1 -1
- package/dist/next/{Sidebar-R1NSvWHu.js → Sidebar-CB2Lm-J-.js} +3 -3
- package/dist/next/{Sidebar-R1NSvWHu.js.map → Sidebar-CB2Lm-J-.js.map} +1 -1
- package/dist/next/{Sidebar-C_zefcbg.cjs → Sidebar-hBHcsbrg.cjs} +3 -3
- package/dist/next/{Sidebar-C_zefcbg.cjs.map → Sidebar-hBHcsbrg.cjs.map} +1 -1
- package/dist/next/Sidebar.cjs.js +1 -1
- package/dist/next/Sidebar.js +1 -1
- package/dist/next/{Stepper-C_qUO4sd.cjs → Stepper-DOdGXz4_.cjs} +2 -2
- package/dist/next/{Stepper-C_qUO4sd.cjs.map → Stepper-DOdGXz4_.cjs.map} +1 -1
- package/dist/next/{Stepper-De9foUOK.js → Stepper-tDpx2gnl.js} +2 -2
- package/dist/next/{Stepper-De9foUOK.js.map → Stepper-tDpx2gnl.js.map} +1 -1
- package/dist/next/Stepper.cjs.js +1 -1
- package/dist/next/Stepper.js +1 -1
- package/dist/next/{TagInput-B_VOR8-r.js → TagInput-BqNnh1L9.js} +3 -3
- package/dist/next/{TagInput-B_VOR8-r.js.map → TagInput-BqNnh1L9.js.map} +1 -1
- package/dist/next/{TagInput-BVng78ON.cjs → TagInput-DUD9_g1b.cjs} +3 -3
- package/dist/next/{TagInput-BVng78ON.cjs.map → TagInput-DUD9_g1b.cjs.map} +1 -1
- package/dist/next/TagInput.cjs.js +1 -1
- package/dist/next/TagInput.js +1 -1
- package/dist/next/{TextInput-B00XEBiM.js → TextInput-BQPtN14M.js} +2 -2
- package/dist/next/{TextInput-B00XEBiM.js.map → TextInput-BQPtN14M.js.map} +1 -1
- package/dist/next/{TextInput-D0rdRASC.cjs → TextInput-k8U0_lSm.cjs} +2 -2
- package/dist/next/{TextInput-D0rdRASC.cjs.map → TextInput-k8U0_lSm.cjs.map} +1 -1
- package/dist/next/TextInput.cjs.js +1 -1
- package/dist/next/TextInput.js +1 -1
- package/dist/{core/ThemeContext-Bo0vLczy.js → next/ThemeContext-B-z-faEj.js} +30 -30
- package/dist/next/ThemeContext-B-z-faEj.js.map +1 -0
- package/dist/next/{ThemeContext-BNR3_OIq.cjs → ThemeContext-BHzkqvlv.cjs} +29 -29
- package/dist/next/ThemeContext-BHzkqvlv.cjs.map +1 -0
- package/dist/next/ThemeInitScript-CIctCIv1.js +385 -0
- package/dist/next/ThemeInitScript-CIctCIv1.js.map +1 -0
- package/dist/next/ThemeInitScript-DqO2SVvW.cjs +384 -0
- package/dist/next/ThemeInitScript-DqO2SVvW.cjs.map +1 -0
- package/dist/next/ThemeInitScript.cjs.js +4 -0
- package/dist/next/ThemeInitScript.cjs.js.map +1 -0
- package/dist/next/ThemeInitScript.js +5 -0
- package/dist/next/ThemeInitScript.js.map +1 -0
- package/dist/next/ThemeProvider.cjs.js +1 -1
- package/dist/next/ThemeProvider.js +1 -1
- package/dist/next/{Toolbar-DleUmVkR.cjs → Toolbar-Bu_meSGb.cjs} +2 -2
- package/dist/next/{Toolbar-DleUmVkR.cjs.map → Toolbar-Bu_meSGb.cjs.map} +1 -1
- package/dist/next/{Toolbar-Dme9QqMY.js → Toolbar-Dd6pf5wP.js} +2 -2
- package/dist/next/{Toolbar-Dme9QqMY.js.map → Toolbar-Dd6pf5wP.js.map} +1 -1
- package/dist/next/Toolbar.cjs.js +1 -1
- package/dist/next/Toolbar.js +1 -1
- package/dist/next/head-manager-context.shared-runtime-7_8Oqhy0.js +30 -0
- package/dist/next/head-manager-context.shared-runtime-7_8Oqhy0.js.map +1 -0
- package/dist/next/head-manager-context.shared-runtime-Cgj8ROpJ.cjs +29 -0
- package/dist/next/head-manager-context.shared-runtime-Cgj8ROpJ.cjs.map +1 -0
- package/dist/next/{image-VX9Ty9NQ.cjs → image-MEZ6sESv.cjs} +13 -35
- package/dist/next/image-MEZ6sESv.cjs.map +1 -0
- package/dist/next/{image-CEz9QtOW.js → image-h6PDRhrT.js} +4 -26
- package/dist/next/image-h6PDRhrT.js.map +1 -0
- package/dist/next/index.cjs.js +24 -22
- package/dist/next/index.cjs.js.map +1 -1
- package/dist/next/index.js +38 -36
- package/dist/next/index.js.map +1 -1
- package/dist/next/{link-Bik5xH00.js → link-BY93bHEw.js} +9 -92
- package/dist/next/link-BY93bHEw.js.map +1 -0
- package/dist/next/{link-hxAaLm0Q.cjs → link-Dyf-9ObB.cjs} +10 -93
- package/dist/next/link-Dyf-9ObB.cjs.map +1 -0
- package/dist/next/{navigation-m012syo9.cjs → navigation-CcfNESvg.cjs} +5 -4
- package/dist/next/{navigation-m012syo9.cjs.map → navigation-CcfNESvg.cjs.map} +1 -1
- package/dist/next/{navigation-DTwYCgCL.js → navigation-ChnNGxEG.js} +3 -2
- package/dist/next/{navigation-DTwYCgCL.js.map → navigation-ChnNGxEG.js.map} +1 -1
- package/dist/next/request-idle-callback-B3JHNaij.js +88 -0
- package/dist/next/request-idle-callback-B3JHNaij.js.map +1 -0
- package/dist/next/request-idle-callback-BIq6SiN0.cjs +87 -0
- package/dist/next/request-idle-callback-BIq6SiN0.cjs.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/context/ThemeContext.d.ts +3 -1
- package/dist/types/context/ThemeContext.d.ts.map +1 -1
- package/dist/types/context/ThemeContext.types.d.ts +6 -0
- package/dist/types/context/ThemeContext.types.d.ts.map +1 -1
- package/dist/types/context/ThemeInitScript.d.ts +3 -0
- package/dist/types/context/ThemeInitScript.d.ts.map +1 -0
- package/dist/types/index.next.d.ts +1 -0
- package/dist/types/index.next.d.ts.map +1 -1
- package/package.json +6 -1
- package/dist/core/ThemeContext-Bo0vLczy.js.map +0 -1
- package/dist/core/ThemeContext-CtZXUeeU.cjs.map +0 -1
- package/dist/next/ThemeContext-BNR3_OIq.cjs.map +0 -1
- package/dist/next/ThemeContext-Bo0vLczy.js.map +0 -1
- package/dist/next/image-CEz9QtOW.js.map +0 -1
- package/dist/next/image-VX9Ty9NQ.cjs.map +0 -1
- package/dist/next/link-Bik5xH00.js.map +0 -1
- package/dist/next/link-hxAaLm0Q.cjs.map +0 -1
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import require$$2, { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { r as requireRequestIdleCallback, a as _interop_require_wildcard, _ as _interop_require_default, g as getDefaultExportFromCjs } from "./request-idle-callback-B3JHNaij.js";
|
|
3
|
+
import ReactDOM from "react-dom";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { r as requireHeadManagerContext_sharedRuntime } from "./head-manager-context.shared-runtime-7_8Oqhy0.js";
|
|
6
|
+
var script$1 = { exports: {} };
|
|
7
|
+
var setAttributesFromProps = { exports: {} };
|
|
8
|
+
var hasRequiredSetAttributesFromProps;
|
|
9
|
+
function requireSetAttributesFromProps() {
|
|
10
|
+
if (hasRequiredSetAttributesFromProps) return setAttributesFromProps.exports;
|
|
11
|
+
hasRequiredSetAttributesFromProps = 1;
|
|
12
|
+
(function(module, exports) {
|
|
13
|
+
Object.defineProperty(exports, "__esModule", {
|
|
14
|
+
value: true
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "setAttributesFromProps", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function() {
|
|
19
|
+
return setAttributesFromProps2;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const DOMAttributeNames = {
|
|
23
|
+
acceptCharset: "accept-charset",
|
|
24
|
+
className: "class",
|
|
25
|
+
htmlFor: "for",
|
|
26
|
+
httpEquiv: "http-equiv",
|
|
27
|
+
noModule: "noModule"
|
|
28
|
+
};
|
|
29
|
+
const ignoreProps = [
|
|
30
|
+
"onLoad",
|
|
31
|
+
"onReady",
|
|
32
|
+
"dangerouslySetInnerHTML",
|
|
33
|
+
"children",
|
|
34
|
+
"onError",
|
|
35
|
+
"strategy",
|
|
36
|
+
"stylesheets"
|
|
37
|
+
];
|
|
38
|
+
function isBooleanScriptAttribute(attr) {
|
|
39
|
+
return [
|
|
40
|
+
"async",
|
|
41
|
+
"defer",
|
|
42
|
+
"noModule"
|
|
43
|
+
].includes(attr);
|
|
44
|
+
}
|
|
45
|
+
function setAttributesFromProps2(el, props) {
|
|
46
|
+
for (const [p, value] of Object.entries(props)) {
|
|
47
|
+
if (!props.hasOwnProperty(p)) continue;
|
|
48
|
+
if (ignoreProps.includes(p)) continue;
|
|
49
|
+
if (value === void 0) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
const attr = DOMAttributeNames[p] || p.toLowerCase();
|
|
53
|
+
if (el.tagName === "SCRIPT" && isBooleanScriptAttribute(attr)) {
|
|
54
|
+
el[attr] = !!value;
|
|
55
|
+
} else {
|
|
56
|
+
el.setAttribute(attr, String(value));
|
|
57
|
+
}
|
|
58
|
+
if (value === false || el.tagName === "SCRIPT" && isBooleanScriptAttribute(attr) && (!value || value === "false")) {
|
|
59
|
+
el.setAttribute(attr, "");
|
|
60
|
+
el.removeAttribute(attr);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
65
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
66
|
+
Object.assign(exports.default, exports);
|
|
67
|
+
module.exports = exports.default;
|
|
68
|
+
}
|
|
69
|
+
})(setAttributesFromProps, setAttributesFromProps.exports);
|
|
70
|
+
return setAttributesFromProps.exports;
|
|
71
|
+
}
|
|
72
|
+
(function(module, exports) {
|
|
73
|
+
"use client";
|
|
74
|
+
Object.defineProperty(exports, "__esModule", {
|
|
75
|
+
value: true
|
|
76
|
+
});
|
|
77
|
+
function _export(target, all) {
|
|
78
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: all[name]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
_export(exports, {
|
|
84
|
+
default: function() {
|
|
85
|
+
return _default;
|
|
86
|
+
},
|
|
87
|
+
handleClientScriptLoad: function() {
|
|
88
|
+
return handleClientScriptLoad;
|
|
89
|
+
},
|
|
90
|
+
initScriptLoader: function() {
|
|
91
|
+
return initScriptLoader;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const _interop_require_default$1 = _interop_require_default;
|
|
95
|
+
const _interop_require_wildcard$1 = _interop_require_wildcard;
|
|
96
|
+
const _jsxruntime = require$$2;
|
|
97
|
+
const _reactdom = /* @__PURE__ */ _interop_require_default$1._(ReactDOM);
|
|
98
|
+
const _react = /* @__PURE__ */ _interop_require_wildcard$1._(React);
|
|
99
|
+
const _headmanagercontextsharedruntime = requireHeadManagerContext_sharedRuntime();
|
|
100
|
+
const _setattributesfromprops = requireSetAttributesFromProps();
|
|
101
|
+
const _requestidlecallback = requireRequestIdleCallback();
|
|
102
|
+
const ScriptCache = /* @__PURE__ */ new Map();
|
|
103
|
+
const LoadCache = /* @__PURE__ */ new Set();
|
|
104
|
+
const insertStylesheets = (stylesheets) => {
|
|
105
|
+
if (_reactdom.default.preinit) {
|
|
106
|
+
stylesheets.forEach((stylesheet) => {
|
|
107
|
+
_reactdom.default.preinit(stylesheet, {
|
|
108
|
+
as: "style"
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (typeof window !== "undefined") {
|
|
114
|
+
let head = document.head;
|
|
115
|
+
stylesheets.forEach((stylesheet) => {
|
|
116
|
+
let link = document.createElement("link");
|
|
117
|
+
link.type = "text/css";
|
|
118
|
+
link.rel = "stylesheet";
|
|
119
|
+
link.href = stylesheet;
|
|
120
|
+
head.appendChild(link);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const loadScript = (props) => {
|
|
125
|
+
const { src, id, onLoad = () => {
|
|
126
|
+
}, onReady = null, dangerouslySetInnerHTML, children = "", strategy = "afterInteractive", onError, stylesheets } = props;
|
|
127
|
+
const cacheKey = id || src;
|
|
128
|
+
if (cacheKey && LoadCache.has(cacheKey)) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (ScriptCache.has(src)) {
|
|
132
|
+
LoadCache.add(cacheKey);
|
|
133
|
+
ScriptCache.get(src).then(onLoad, onError);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const afterLoad = () => {
|
|
137
|
+
if (onReady) {
|
|
138
|
+
onReady();
|
|
139
|
+
}
|
|
140
|
+
LoadCache.add(cacheKey);
|
|
141
|
+
};
|
|
142
|
+
const el = document.createElement("script");
|
|
143
|
+
const loadPromise = new Promise((resolve, reject) => {
|
|
144
|
+
el.addEventListener("load", function(e) {
|
|
145
|
+
resolve();
|
|
146
|
+
if (onLoad) {
|
|
147
|
+
onLoad.call(this, e);
|
|
148
|
+
}
|
|
149
|
+
afterLoad();
|
|
150
|
+
});
|
|
151
|
+
el.addEventListener("error", function(e) {
|
|
152
|
+
reject(e);
|
|
153
|
+
});
|
|
154
|
+
}).catch(function(e) {
|
|
155
|
+
if (onError) {
|
|
156
|
+
onError(e);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
if (dangerouslySetInnerHTML) {
|
|
160
|
+
el.innerHTML = dangerouslySetInnerHTML.__html || "";
|
|
161
|
+
afterLoad();
|
|
162
|
+
} else if (children) {
|
|
163
|
+
el.textContent = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
|
|
164
|
+
afterLoad();
|
|
165
|
+
} else if (src) {
|
|
166
|
+
el.src = src;
|
|
167
|
+
ScriptCache.set(src, loadPromise);
|
|
168
|
+
}
|
|
169
|
+
(0, _setattributesfromprops.setAttributesFromProps)(el, props);
|
|
170
|
+
if (strategy === "worker") {
|
|
171
|
+
el.setAttribute("type", "text/partytown");
|
|
172
|
+
}
|
|
173
|
+
el.setAttribute("data-nscript", strategy);
|
|
174
|
+
if (stylesheets) {
|
|
175
|
+
insertStylesheets(stylesheets);
|
|
176
|
+
}
|
|
177
|
+
document.body.appendChild(el);
|
|
178
|
+
};
|
|
179
|
+
function handleClientScriptLoad(props) {
|
|
180
|
+
const { strategy = "afterInteractive" } = props;
|
|
181
|
+
if (strategy === "lazyOnload") {
|
|
182
|
+
window.addEventListener("load", () => {
|
|
183
|
+
(0, _requestidlecallback.requestIdleCallback)(() => loadScript(props));
|
|
184
|
+
});
|
|
185
|
+
} else {
|
|
186
|
+
loadScript(props);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function loadLazyScript(props) {
|
|
190
|
+
if (document.readyState === "complete") {
|
|
191
|
+
(0, _requestidlecallback.requestIdleCallback)(() => loadScript(props));
|
|
192
|
+
} else {
|
|
193
|
+
window.addEventListener("load", () => {
|
|
194
|
+
(0, _requestidlecallback.requestIdleCallback)(() => loadScript(props));
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function addBeforeInteractiveToCache() {
|
|
199
|
+
const scripts = [
|
|
200
|
+
...document.querySelectorAll('[data-nscript="beforeInteractive"]'),
|
|
201
|
+
...document.querySelectorAll('[data-nscript="beforePageRender"]')
|
|
202
|
+
];
|
|
203
|
+
scripts.forEach((script2) => {
|
|
204
|
+
const cacheKey = script2.id || script2.getAttribute("src");
|
|
205
|
+
LoadCache.add(cacheKey);
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
function initScriptLoader(scriptLoaderItems) {
|
|
209
|
+
scriptLoaderItems.forEach(handleClientScriptLoad);
|
|
210
|
+
addBeforeInteractiveToCache();
|
|
211
|
+
}
|
|
212
|
+
function Script2(props) {
|
|
213
|
+
const { id, src = "", onLoad = () => {
|
|
214
|
+
}, onReady = null, strategy = "afterInteractive", onError, stylesheets, ...restProps } = props;
|
|
215
|
+
let { updateScripts, scripts, getIsSsr, appDir, nonce } = (0, _react.useContext)(_headmanagercontextsharedruntime.HeadManagerContext);
|
|
216
|
+
nonce = restProps.nonce || nonce;
|
|
217
|
+
const hasOnReadyEffectCalled = (0, _react.useRef)(false);
|
|
218
|
+
(0, _react.useEffect)(() => {
|
|
219
|
+
const cacheKey = id || src;
|
|
220
|
+
if (!hasOnReadyEffectCalled.current) {
|
|
221
|
+
if (onReady && cacheKey && LoadCache.has(cacheKey)) {
|
|
222
|
+
onReady();
|
|
223
|
+
}
|
|
224
|
+
hasOnReadyEffectCalled.current = true;
|
|
225
|
+
}
|
|
226
|
+
}, [
|
|
227
|
+
onReady,
|
|
228
|
+
id,
|
|
229
|
+
src
|
|
230
|
+
]);
|
|
231
|
+
const hasLoadScriptEffectCalled = (0, _react.useRef)(false);
|
|
232
|
+
(0, _react.useEffect)(() => {
|
|
233
|
+
if (!hasLoadScriptEffectCalled.current) {
|
|
234
|
+
if (strategy === "afterInteractive") {
|
|
235
|
+
loadScript(props);
|
|
236
|
+
} else if (strategy === "lazyOnload") {
|
|
237
|
+
loadLazyScript(props);
|
|
238
|
+
}
|
|
239
|
+
hasLoadScriptEffectCalled.current = true;
|
|
240
|
+
}
|
|
241
|
+
}, [
|
|
242
|
+
props,
|
|
243
|
+
strategy
|
|
244
|
+
]);
|
|
245
|
+
if (strategy === "beforeInteractive" || strategy === "worker") {
|
|
246
|
+
if (updateScripts) {
|
|
247
|
+
scripts[strategy] = (scripts[strategy] || []).concat([
|
|
248
|
+
{
|
|
249
|
+
id,
|
|
250
|
+
src,
|
|
251
|
+
onLoad,
|
|
252
|
+
onReady,
|
|
253
|
+
onError,
|
|
254
|
+
...restProps,
|
|
255
|
+
nonce
|
|
256
|
+
}
|
|
257
|
+
]);
|
|
258
|
+
updateScripts(scripts);
|
|
259
|
+
} else if (getIsSsr && getIsSsr()) {
|
|
260
|
+
LoadCache.add(id || src);
|
|
261
|
+
} else if (getIsSsr && !getIsSsr()) {
|
|
262
|
+
loadScript({
|
|
263
|
+
...props,
|
|
264
|
+
nonce
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
if (appDir) {
|
|
269
|
+
if (stylesheets) {
|
|
270
|
+
stylesheets.forEach((styleSrc) => {
|
|
271
|
+
_reactdom.default.preinit(styleSrc, {
|
|
272
|
+
as: "style"
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
if (strategy === "beforeInteractive") {
|
|
277
|
+
if (!src) {
|
|
278
|
+
if (restProps.dangerouslySetInnerHTML) {
|
|
279
|
+
restProps.children = restProps.dangerouslySetInnerHTML.__html;
|
|
280
|
+
delete restProps.dangerouslySetInnerHTML;
|
|
281
|
+
}
|
|
282
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)("script", {
|
|
283
|
+
nonce,
|
|
284
|
+
dangerouslySetInnerHTML: {
|
|
285
|
+
__html: "(self.__next_s=self.__next_s||[]).push(" + JSON.stringify([
|
|
286
|
+
0,
|
|
287
|
+
{
|
|
288
|
+
...restProps,
|
|
289
|
+
id
|
|
290
|
+
}
|
|
291
|
+
]) + ")"
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
} else {
|
|
295
|
+
_reactdom.default.preload(src, restProps.integrity ? {
|
|
296
|
+
as: "script",
|
|
297
|
+
integrity: restProps.integrity,
|
|
298
|
+
nonce,
|
|
299
|
+
crossOrigin: restProps.crossOrigin
|
|
300
|
+
} : {
|
|
301
|
+
as: "script",
|
|
302
|
+
nonce,
|
|
303
|
+
crossOrigin: restProps.crossOrigin
|
|
304
|
+
});
|
|
305
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)("script", {
|
|
306
|
+
nonce,
|
|
307
|
+
dangerouslySetInnerHTML: {
|
|
308
|
+
__html: "(self.__next_s=self.__next_s||[]).push(" + JSON.stringify([
|
|
309
|
+
src,
|
|
310
|
+
{
|
|
311
|
+
...restProps,
|
|
312
|
+
id
|
|
313
|
+
}
|
|
314
|
+
]) + ")"
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
} else if (strategy === "afterInteractive") {
|
|
319
|
+
if (src) {
|
|
320
|
+
_reactdom.default.preload(src, restProps.integrity ? {
|
|
321
|
+
as: "script",
|
|
322
|
+
integrity: restProps.integrity,
|
|
323
|
+
nonce,
|
|
324
|
+
crossOrigin: restProps.crossOrigin
|
|
325
|
+
} : {
|
|
326
|
+
as: "script",
|
|
327
|
+
nonce,
|
|
328
|
+
crossOrigin: restProps.crossOrigin
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
Object.defineProperty(Script2, "__nextScript", {
|
|
336
|
+
value: true
|
|
337
|
+
});
|
|
338
|
+
const _default = Script2;
|
|
339
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
340
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
341
|
+
Object.assign(exports.default, exports);
|
|
342
|
+
module.exports = exports.default;
|
|
343
|
+
}
|
|
344
|
+
})(script$1, script$1.exports);
|
|
345
|
+
var scriptExports = script$1.exports;
|
|
346
|
+
var script = scriptExports;
|
|
347
|
+
const Script = /* @__PURE__ */ getDefaultExportFromCjs(script);
|
|
348
|
+
function ThemeInitScript({
|
|
349
|
+
storageKeyScheme = "boreal:selectedScheme",
|
|
350
|
+
storageKeyVars = "boreal:cssVars",
|
|
351
|
+
dataAttr = "data-scheme",
|
|
352
|
+
readyAttr = "data-theme-ready"
|
|
353
|
+
}) {
|
|
354
|
+
const code = `
|
|
355
|
+
(function(){
|
|
356
|
+
try {
|
|
357
|
+
var docEl = document.documentElement;
|
|
358
|
+
// 1) Apply CSS vars if we cached them
|
|
359
|
+
var raw = localStorage.getItem(${JSON.stringify(storageKeyVars)});
|
|
360
|
+
if (raw) {
|
|
361
|
+
try {
|
|
362
|
+
var vars = JSON.parse(raw);
|
|
363
|
+
for (var k in vars) {
|
|
364
|
+
if (Object.prototype.hasOwnProperty.call(vars, k)) {
|
|
365
|
+
docEl.style.setProperty(k, vars[k]);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
} catch (e) { /* ignore parse errors */ }
|
|
369
|
+
}
|
|
370
|
+
// 2) Apply selected scheme data-attr for any scheme-driven CSS
|
|
371
|
+
var idx = localStorage.getItem(${JSON.stringify(storageKeyScheme)});
|
|
372
|
+
if (idx != null) {
|
|
373
|
+
docEl.setAttribute(${JSON.stringify(dataAttr)}, String(idx));
|
|
374
|
+
}
|
|
375
|
+
// 3) Mark as ready so you can fade in content if you want
|
|
376
|
+
docEl.setAttribute(${JSON.stringify(readyAttr)}, "true");
|
|
377
|
+
} catch (e) { /* no-op */ }
|
|
378
|
+
})();
|
|
379
|
+
`.trim();
|
|
380
|
+
return /* @__PURE__ */ jsx(Script, { id: "boreal-theme-init", strategy: "beforeInteractive", children: code });
|
|
381
|
+
}
|
|
382
|
+
export {
|
|
383
|
+
ThemeInitScript as T
|
|
384
|
+
};
|
|
385
|
+
//# sourceMappingURL=ThemeInitScript-CIctCIv1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeInitScript-CIctCIv1.js","sources":["../../node_modules/next/dist/client/set-attributes-from-props.js","../../node_modules/next/dist/client/script.js","../../node_modules/next/script.js","../../src/context/ThemeInitScript.tsx"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"setAttributesFromProps\", {\n enumerable: true,\n get: function() {\n return setAttributesFromProps;\n }\n});\nconst DOMAttributeNames = {\n acceptCharset: 'accept-charset',\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n noModule: 'noModule'\n};\nconst ignoreProps = [\n 'onLoad',\n 'onReady',\n 'dangerouslySetInnerHTML',\n 'children',\n 'onError',\n 'strategy',\n 'stylesheets'\n];\nfunction isBooleanScriptAttribute(attr) {\n return [\n 'async',\n 'defer',\n 'noModule'\n ].includes(attr);\n}\nfunction setAttributesFromProps(el, props) {\n for (const [p, value] of Object.entries(props)){\n if (!props.hasOwnProperty(p)) continue;\n if (ignoreProps.includes(p)) continue;\n // we don't render undefined props to the DOM\n if (value === undefined) {\n continue;\n }\n const attr = DOMAttributeNames[p] || p.toLowerCase();\n if (el.tagName === 'SCRIPT' && isBooleanScriptAttribute(attr)) {\n // Correctly assign boolean script attributes\n // https://github.com/vercel/next.js/pull/20748\n ;\n el[attr] = !!value;\n } else {\n el.setAttribute(attr, String(value));\n }\n // Remove falsy non-zero boolean attributes so they are correctly interpreted\n // (e.g. if we set them to false, this coerces to the string \"false\", which the browser interprets as true)\n if (value === false || el.tagName === 'SCRIPT' && isBooleanScriptAttribute(attr) && (!value || value === 'false')) {\n // Call setAttribute before, as we need to set and unset the attribute to override force async:\n // https://html.spec.whatwg.org/multipage/scripting.html#script-force-async\n el.setAttribute(attr, '');\n el.removeAttribute(attr);\n }\n }\n}\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=set-attributes-from-props.js.map","'use client';\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n default: null,\n handleClientScriptLoad: null,\n initScriptLoader: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n default: function() {\n return _default;\n },\n handleClientScriptLoad: function() {\n return handleClientScriptLoad;\n },\n initScriptLoader: function() {\n return initScriptLoader;\n }\n});\nconst _interop_require_default = require(\"@swc/helpers/_/_interop_require_default\");\nconst _interop_require_wildcard = require(\"@swc/helpers/_/_interop_require_wildcard\");\nconst _jsxruntime = require(\"react/jsx-runtime\");\nconst _reactdom = /*#__PURE__*/ _interop_require_default._(require(\"react-dom\"));\nconst _react = /*#__PURE__*/ _interop_require_wildcard._(require(\"react\"));\nconst _headmanagercontextsharedruntime = require(\"../shared/lib/head-manager-context.shared-runtime\");\nconst _setattributesfromprops = require(\"./set-attributes-from-props\");\nconst _requestidlecallback = require(\"./request-idle-callback\");\nconst ScriptCache = new Map();\nconst LoadCache = new Set();\nconst insertStylesheets = (stylesheets)=>{\n // Case 1: Styles for afterInteractive/lazyOnload with appDir injected via handleClientScriptLoad\n //\n // Using ReactDOM.preinit to feature detect appDir and inject styles\n // Stylesheets might have already been loaded if initialized with Script component\n // Re-inject styles here to handle scripts loaded via handleClientScriptLoad\n // ReactDOM.preinit handles dedup and ensures the styles are loaded only once\n if (_reactdom.default.preinit) {\n stylesheets.forEach((stylesheet)=>{\n _reactdom.default.preinit(stylesheet, {\n as: 'style'\n });\n });\n return;\n }\n // Case 2: Styles for afterInteractive/lazyOnload with pages injected via handleClientScriptLoad\n //\n // We use this function to load styles when appdir is not detected\n // TODO: Use React float APIs to load styles once available for pages dir\n if (typeof window !== 'undefined') {\n let head = document.head;\n stylesheets.forEach((stylesheet)=>{\n let link = document.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = stylesheet;\n head.appendChild(link);\n });\n }\n};\nconst loadScript = (props)=>{\n const { src, id, onLoad = ()=>{}, onReady = null, dangerouslySetInnerHTML, children = '', strategy = 'afterInteractive', onError, stylesheets } = props;\n const cacheKey = id || src;\n // Script has already loaded\n if (cacheKey && LoadCache.has(cacheKey)) {\n return;\n }\n // Contents of this script are already loading/loaded\n if (ScriptCache.has(src)) {\n LoadCache.add(cacheKey);\n // It is possible that multiple `next/script` components all have same \"src\", but has different \"onLoad\"\n // This is to make sure the same remote script will only load once, but \"onLoad\" are executed in order\n ScriptCache.get(src).then(onLoad, onError);\n return;\n }\n /** Execute after the script first loaded */ const afterLoad = ()=>{\n // Run onReady for the first time after load event\n if (onReady) {\n onReady();\n }\n // add cacheKey to LoadCache when load successfully\n LoadCache.add(cacheKey);\n };\n const el = document.createElement('script');\n const loadPromise = new Promise((resolve, reject)=>{\n el.addEventListener('load', function(e) {\n resolve();\n if (onLoad) {\n onLoad.call(this, e);\n }\n afterLoad();\n });\n el.addEventListener('error', function(e) {\n reject(e);\n });\n }).catch(function(e) {\n if (onError) {\n onError(e);\n }\n });\n if (dangerouslySetInnerHTML) {\n // Casting since lib.dom.d.ts doesn't have TrustedHTML yet.\n el.innerHTML = dangerouslySetInnerHTML.__html || '';\n afterLoad();\n } else if (children) {\n el.textContent = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';\n afterLoad();\n } else if (src) {\n el.src = src;\n // do not add cacheKey into LoadCache for remote script here\n // cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)\n ScriptCache.set(src, loadPromise);\n }\n (0, _setattributesfromprops.setAttributesFromProps)(el, props);\n if (strategy === 'worker') {\n el.setAttribute('type', 'text/partytown');\n }\n el.setAttribute('data-nscript', strategy);\n // Load styles associated with this script\n if (stylesheets) {\n insertStylesheets(stylesheets);\n }\n document.body.appendChild(el);\n};\nfunction handleClientScriptLoad(props) {\n const { strategy = 'afterInteractive' } = props;\n if (strategy === 'lazyOnload') {\n window.addEventListener('load', ()=>{\n (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));\n });\n } else {\n loadScript(props);\n }\n}\nfunction loadLazyScript(props) {\n if (document.readyState === 'complete') {\n (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));\n } else {\n window.addEventListener('load', ()=>{\n (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));\n });\n }\n}\nfunction addBeforeInteractiveToCache() {\n const scripts = [\n ...document.querySelectorAll('[data-nscript=\"beforeInteractive\"]'),\n ...document.querySelectorAll('[data-nscript=\"beforePageRender\"]')\n ];\n scripts.forEach((script)=>{\n const cacheKey = script.id || script.getAttribute('src');\n LoadCache.add(cacheKey);\n });\n}\nfunction initScriptLoader(scriptLoaderItems) {\n scriptLoaderItems.forEach(handleClientScriptLoad);\n addBeforeInteractiveToCache();\n}\n/**\n * Load a third-party scripts in an optimized way.\n *\n * Read more: [Next.js Docs: `next/script`](https://nextjs.org/docs/app/api-reference/components/script)\n */ function Script(props) {\n const { id, src = '', onLoad = ()=>{}, onReady = null, strategy = 'afterInteractive', onError, stylesheets, ...restProps } = props;\n // Context is available only during SSR\n let { updateScripts, scripts, getIsSsr, appDir, nonce } = (0, _react.useContext)(_headmanagercontextsharedruntime.HeadManagerContext);\n // if a nonce is explicitly passed to the script tag, favor that over the automatic handling\n nonce = restProps.nonce || nonce;\n /**\n * - First mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache)\n * onReady is skipped, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. hasLoadScriptEffectCalled.current is false, loadScript executes\n * Once the script is loaded, the onLoad and onReady will be called by then\n * [If strict mode is enabled / is wrapped in <OffScreen /> component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n *\n * - Second mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache)\n * onReady is called, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. The script is already loaded, loadScript bails out\n * [If strict mode is enabled / is wrapped in <OffScreen /> component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n */ const hasOnReadyEffectCalled = (0, _react.useRef)(false);\n (0, _react.useEffect)(()=>{\n const cacheKey = id || src;\n if (!hasOnReadyEffectCalled.current) {\n // Run onReady if script has loaded before but component is re-mounted\n if (onReady && cacheKey && LoadCache.has(cacheKey)) {\n onReady();\n }\n hasOnReadyEffectCalled.current = true;\n }\n }, [\n onReady,\n id,\n src\n ]);\n const hasLoadScriptEffectCalled = (0, _react.useRef)(false);\n (0, _react.useEffect)(()=>{\n if (!hasLoadScriptEffectCalled.current) {\n if (strategy === 'afterInteractive') {\n loadScript(props);\n } else if (strategy === 'lazyOnload') {\n loadLazyScript(props);\n }\n hasLoadScriptEffectCalled.current = true;\n }\n }, [\n props,\n strategy\n ]);\n if (strategy === 'beforeInteractive' || strategy === 'worker') {\n if (updateScripts) {\n scripts[strategy] = (scripts[strategy] || []).concat([\n {\n id,\n src,\n onLoad,\n onReady,\n onError,\n ...restProps,\n nonce\n }\n ]);\n updateScripts(scripts);\n } else if (getIsSsr && getIsSsr()) {\n // Script has already loaded during SSR\n LoadCache.add(id || src);\n } else if (getIsSsr && !getIsSsr()) {\n loadScript({\n ...props,\n nonce\n });\n }\n }\n // For the app directory, we need React Float to preload these scripts.\n if (appDir) {\n // Injecting stylesheets here handles beforeInteractive and worker scripts correctly\n // For other strategies injecting here ensures correct stylesheet order\n // ReactDOM.preinit handles loading the styles in the correct order,\n // also ensures the stylesheet is loaded only once and in a consistent manner\n //\n // Case 1: Styles for beforeInteractive/worker with appDir - handled here\n // Case 2: Styles for beforeInteractive/worker with pages dir - Not handled yet\n // Case 3: Styles for afterInteractive/lazyOnload with appDir - handled here\n // Case 4: Styles for afterInteractive/lazyOnload with pages dir - handled in insertStylesheets function\n if (stylesheets) {\n stylesheets.forEach((styleSrc)=>{\n _reactdom.default.preinit(styleSrc, {\n as: 'style'\n });\n });\n }\n // Before interactive scripts need to be loaded by Next.js' runtime instead\n // of native <script> tags, because they no longer have `defer`.\n if (strategy === 'beforeInteractive') {\n if (!src) {\n // For inlined scripts, we put the content in `children`.\n if (restProps.dangerouslySetInnerHTML) {\n // Casting since lib.dom.d.ts doesn't have TrustedHTML yet.\n restProps.children = restProps.dangerouslySetInnerHTML.__html;\n delete restProps.dangerouslySetInnerHTML;\n }\n return /*#__PURE__*/ (0, _jsxruntime.jsx)(\"script\", {\n nonce: nonce,\n dangerouslySetInnerHTML: {\n __html: \"(self.__next_s=self.__next_s||[]).push(\" + JSON.stringify([\n 0,\n {\n ...restProps,\n id\n }\n ]) + \")\"\n }\n });\n } else {\n // @ts-ignore\n _reactdom.default.preload(src, restProps.integrity ? {\n as: 'script',\n integrity: restProps.integrity,\n nonce,\n crossOrigin: restProps.crossOrigin\n } : {\n as: 'script',\n nonce,\n crossOrigin: restProps.crossOrigin\n });\n return /*#__PURE__*/ (0, _jsxruntime.jsx)(\"script\", {\n nonce: nonce,\n dangerouslySetInnerHTML: {\n __html: \"(self.__next_s=self.__next_s||[]).push(\" + JSON.stringify([\n src,\n {\n ...restProps,\n id\n }\n ]) + \")\"\n }\n });\n }\n } else if (strategy === 'afterInteractive') {\n if (src) {\n // @ts-ignore\n _reactdom.default.preload(src, restProps.integrity ? {\n as: 'script',\n integrity: restProps.integrity,\n nonce,\n crossOrigin: restProps.crossOrigin\n } : {\n as: 'script',\n nonce,\n crossOrigin: restProps.crossOrigin\n });\n }\n }\n }\n return null;\n}\nObject.defineProperty(Script, '__nextScript', {\n value: true\n});\nconst _default = Script;\n\nif ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', { value: true });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n}\n\n//# sourceMappingURL=script.js.map","module.exports = require('./dist/client/script')\n","\"use client\";\r\n\r\nimport Script from \"next/script\";\r\nimport { ThemeInitScriptProps } from \"./ThemeContext.types\";\r\n\r\nexport default function ThemeInitScript({\r\n storageKeyScheme = \"boreal:selectedScheme\",\r\n storageKeyVars = \"boreal:cssVars\",\r\n dataAttr = \"data-scheme\",\r\n readyAttr = \"data-theme-ready\",\r\n}: ThemeInitScriptProps) {\r\n const code = `\r\n (function(){\r\n try {\r\n var docEl = document.documentElement;\r\n // 1) Apply CSS vars if we cached them\r\n var raw = localStorage.getItem(${JSON.stringify(storageKeyVars)});\r\n if (raw) {\r\n try {\r\n var vars = JSON.parse(raw);\r\n for (var k in vars) {\r\n if (Object.prototype.hasOwnProperty.call(vars, k)) {\r\n docEl.style.setProperty(k, vars[k]);\r\n }\r\n }\r\n } catch (e) { /* ignore parse errors */ }\r\n }\r\n // 2) Apply selected scheme data-attr for any scheme-driven CSS\r\n var idx = localStorage.getItem(${JSON.stringify(storageKeyScheme)});\r\n if (idx != null) {\r\n docEl.setAttribute(${JSON.stringify(dataAttr)}, String(idx));\r\n }\r\n // 3) Mark as ready so you can fade in content if you want\r\n docEl.setAttribute(${JSON.stringify(readyAttr)}, \"true\");\r\n } catch (e) { /* no-op */ }\r\n })();\r\n `.trim();\r\n\r\n return (\r\n <Script id=\"boreal-theme-init\" strategy=\"beforeInteractive\">\r\n {code}\r\n </Script>\r\n );\r\n}\r\n"],"names":["setAttributesFromProps","_interop_require_default","require$$0","_interop_require_wildcard","require$$1","require$$3","require$$4","require$$5","require$$6","require$$7","script","Script"],"mappings":";;;;;;;;;;;;AACA,WAAO,eAAc,SAAU,cAAc;AAAA,MACzC,OAAO;AAAA,IACX,CAAC;AACD,WAAO,eAAe,SAAS,0BAA0B;AAAA,MACrD,YAAY;AAAA,MACZ,KAAK,WAAW;A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