@cling-se/widget 0.19.7 → 0.19.9

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.
Files changed (128) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/{AddClientCallout-BdGevuQo.js → AddClientCallout-C400wpa7.js} +19 -19
  3. package/dist/{AnswerModal-DfjF-RVP.js → AnswerModal-C_vekdpA.js} +80 -80
  4. package/dist/{AttachmentItem-BEd3qVAo.js → AttachmentItem-CYeH1VVw.js} +14 -14
  5. package/dist/{BaseUpload-Zm4EX8ir.js → BaseUpload-DGLogqK4.js} +256 -256
  6. package/dist/{BlockMedia-ZHaA4OMV.js → BlockMedia-Hbm0GWNw.js} +33 -32
  7. package/dist/{CCallout-BlglVZrm.js → CCallout-BPCwr3uM.js} +15 -15
  8. package/dist/{CCurrencyDropdown-BzvKsm1N.js → CCurrencyDropdown-CZXWH0mA.js} +13 -13
  9. package/dist/{CDropdownItem-B5rgSee7.js → CDropdownItem-B9dja0RC.js} +11 -11
  10. package/dist/{CFormField.vue_vue_type_script_setup_true_lang-CVy64zGe.js → CFormField.vue_vue_type_script_setup_true_lang-HLxgkrxm.js} +17 -17
  11. package/dist/{CPhoneFormat-DaDNMlmK.js → CPhoneFormat-C1cjsMVZ.js} +1 -1
  12. package/dist/{CPhoneInput-BUogm59J.js → CPhoneInput-DwcIFaqz.js} +23 -23
  13. package/dist/{CPriceInput-Cd5OHMJS.js → CPriceInput-C_PfAhRb.js} +12 -12
  14. package/dist/{CSelect-CmoAbVkP.js → CSelect-D4A_clvT.js} +15 -15
  15. package/dist/{CSkeleton-BF6EYj8H.js → CSkeleton-h81Vudx0.js} +16 -16
  16. package/dist/{ClientAutocomplete-CHfp4YiV.js → ClientAutocomplete-B_R7zgvM.js} +24 -24
  17. package/dist/{ClientModal-Com23Qgc.js → ClientModal-CBJgrb_y.js} +44 -44
  18. package/dist/{ColorPicker-BzdHtZep.js → ColorPicker-a5yTVc0q.js} +66 -66
  19. package/dist/{CompanyModal-CGjSgTEJ.js → CompanyModal-sRTrUPOY.js} +18 -18
  20. package/dist/{ContentWrapper-CS-Bh4Bk.js → ContentWrapper-Cwd6t51-.js} +16 -16
  21. package/dist/{CoverBlockSettings-DDHQzLdc.js → CoverBlockSettings-8tjji9f1.js} +39 -39
  22. package/dist/{DocAnswer-Cmdsw_CW.js → DocAnswer-D1ZIH1Hn.js} +4 -4
  23. package/dist/{DocDetails-C5Vzh550.js → DocDetails-B5_hBzC-.js} +56 -56
  24. package/dist/{DocForm-DEUVV11n.js → DocForm-BKQvY0Ie.js} +821 -829
  25. package/dist/{DocFormSend-Dt7N3wCz.js → DocFormSend-z0W-xRJP.js} +11 -11
  26. package/dist/{DocLinks-C6-Er0rk.js → DocLinks-BgbDU24h.js} +6 -6
  27. package/dist/{DocModalBase-DbuJwHXi.js → DocModalBase-CNo1u8TK.js} +1 -1
  28. package/dist/{DocPrint-D_uxg7qD.js → DocPrint--UV846r0.js} +15 -15
  29. package/dist/{DocReceipt-D6LP9UAa.js → DocReceipt-BAkWIKbC.js} +23 -23
  30. package/dist/{DocSendReminder-DopLhyjz.js → DocSendReminder-Bk6IVg0R.js} +10 -10
  31. package/dist/{DocTextEditor-DeZtzbgm.js → DocTextEditor-D5zDbbXV.js} +4499 -4438
  32. package/dist/{DocTimeline-DAWZu_KT.js → DocTimeline-KG4zJJOW.js} +16 -16
  33. package/dist/{DocumentClient-kxnT6k9s.js → DocumentClient-CXSxwjOt.js} +12 -12
  34. package/dist/DocumentLayout-C-V_5p3r.js +595 -0
  35. package/dist/{DocumentLogotype-G-a7gBIC.js → DocumentLogotype-H0f7bO0E.js} +18 -18
  36. package/dist/{DocumentVoided-SG_ShMmc.js → DocumentVoided-3F7DChD4.js} +4 -4
  37. package/dist/{EmbedInput-CJL5y3Zj.js → EmbedInput-iG-cDNzZ.js} +8 -8
  38. package/dist/{EmbedSettings-B0X6A9Uy.js → EmbedSettings-DhwFGdKH.js} +12 -12
  39. package/dist/{ErrorCallout-xCSfpQWV.js → ErrorCallout-CyqQ9iRV.js} +10 -10
  40. package/dist/{FilePreviewModal-Da_pMUoO.js → FilePreviewModal-CEUhUuh4.js} +7 -7
  41. package/dist/{Flag-wXawyyMO.js → Flag-Bza5Ltob.js} +4 -4
  42. package/dist/{HeaderSettings-CD3y6-uY.js → HeaderSettings-kEbuiv0n.js} +36 -36
  43. package/dist/{ImageSelectModal-DatnXHH1.js → ImageSelectModal-MDduQIdS.js} +16 -16
  44. package/dist/{ImageUploadWrapper-CwKe3Iq7.js → ImageUploadWrapper-CKJXUAkn.js} +72 -72
  45. package/dist/{Index-BbVHxVFJ.js → Index--_tbiloB.js} +33 -33
  46. package/dist/{Index-y_AJP61r.js → Index-437smvNJ.js} +11 -11
  47. package/dist/{Index-ezY0DbcB.js → Index-8CyLDQv2.js} +5 -5
  48. package/dist/{Index-Cjg3X74T.js → Index-B1tFrOfN.js} +7 -7
  49. package/dist/{Index-Ct735UtM.js → Index-BFwz1G_7.js} +2 -2
  50. package/dist/{Index-BlownK7_.js → Index-BXqNV8F_.js} +7 -7
  51. package/dist/{Index-B53eUt7Y.js → Index-Bege0Vce.js} +15 -15
  52. package/dist/{Index-BTDQax0X.js → Index-Bg1kzWCp.js} +60 -59
  53. package/dist/{Index-9ZFW8Ka7.js → Index-C46cWm4W.js} +7 -7
  54. package/dist/{Index-C2-s62x7.js → Index-CGhWvSf9.js} +11 -11
  55. package/dist/{Index-D-gJQEAD.js → Index-CHIQWumi.js} +6 -6
  56. package/dist/{Index-CQboLS2e.js → Index-CNQhKXtr.js} +8 -8
  57. package/dist/{Index-COF0evH4.js → Index-CUDi4SEx.js} +6 -6
  58. package/dist/{Index-Bb6JZC8l.js → Index-ClA923dR.js} +11 -11
  59. package/dist/{Index-1WPEpaVr.js → Index-D2A8evjo.js} +7 -7
  60. package/dist/{Index-BvAqglwa.js → Index-D4XDugcf.js} +27 -27
  61. package/dist/{Index-GPliVrhC.js → Index-DB3keB-X.js} +7 -7
  62. package/dist/{Index-BJf4YdYB.js → Index-DQLLCnjH.js} +29 -29
  63. package/dist/{Index-Dfy0PsiW.js → Index-DUM-3B1l.js} +29 -29
  64. package/dist/{Index-Ck-_9woY.js → Index-DdZo8evS.js} +456 -461
  65. package/dist/{Index-CTrX3VRa.js → Index-Doc7K3kL.js} +5 -5
  66. package/dist/{Index-DfuzxXzD.js → Index-Dqfwe7SG.js} +2 -2
  67. package/dist/{Index-NnBwJv9v.js → Index-DtCuzght.js} +9 -9
  68. package/dist/{Index-DOeHci16.js → Index-DtDRffCY.js} +7 -7
  69. package/dist/{Index-C-EUJjuk.js → Index-DzKdZg0G.js} +2 -2
  70. package/dist/{Index-yS5OPrJJ.js → Index-DzugmOmj.js} +2 -2
  71. package/dist/{Index-DjfbgA_7.js → Index-E7OzmtR_.js} +30 -27
  72. package/dist/{Index-DkQ8_VkX.js → Index-MmvJQvLm.js} +194 -218
  73. package/dist/{Index-Dxg4gEKd.js → Index-Rb5n5XoO.js} +18 -18
  74. package/dist/{Index-DAkq_7Ws.js → Index-dTgmxz_A.js} +18 -18
  75. package/dist/{Index-Ciy9lnhS.js → Index-eJiQmHhr.js} +2 -2
  76. package/dist/Index-jQsYOOC3.js +4 -0
  77. package/dist/{Index-DzdEqsZB.js → Index-rINXTjpt.js} +16 -16
  78. package/dist/Index-zRXdiRpy.js +49 -0
  79. package/dist/{Index.vue_vue_type_script_lang-B3RoDZmC.js → Index.vue_vue_type_script_lang-B9979oeS.js} +2 -2
  80. package/dist/{InputToggleRow-D5rvQpAw.js → InputToggleRow-CO4fZnAC.js} +15 -15
  81. package/dist/{ManualPopover-Bd-GsLGT.js → ManualPopover-DT4iXoSI.js} +6 -6
  82. package/dist/{MediaWrapper-Ci0XPCcb.js → MediaWrapper-CP_1JzGI.js} +4 -4
  83. package/dist/{NotBindingText-DhndGZE3.js → NotBindingText-D9Um3Agp.js} +2 -2
  84. package/dist/{PackageGroup-4Jt9ClVO.js → PackageGroup-BtH12jVM.js} +103 -103
  85. package/dist/{PdfTerms-CGeJDJpQ.js → PdfTerms-sQh93Xit.js} +9 -9
  86. package/dist/{PdfViewer-o2vb6Fya.js → PdfViewer-DMAcTVND.js} +71 -71
  87. package/dist/{PlainHtml.vue_vue_type_script_setup_true_lang-BtnMqKcE.js → PlainHtml.vue_vue_type_script_setup_true_lang-tY-SurWr.js} +2 -2
  88. package/dist/{PriceHeader-BsObxLHK.js → PriceHeader-CG6el7O_.js} +31 -31
  89. package/dist/{SearchApi-ZczKsBb7.js → SearchApi-B39mMGKy.js} +6 -6
  90. package/dist/{SendForm-D5jqkofo.js → SendForm-F5aQPz8w.js} +780 -778
  91. package/dist/{Setup-CdZzn0qW.js → Setup-DuHU2eHC.js} +4 -4
  92. package/dist/{SmartList-B36ffGAZ.js → SmartList-myMj6QGe.js} +1 -1
  93. package/dist/{Sortable.vue_vue_type_script_setup_true_lang-Di1urzqu.js → Sortable.vue_vue_type_script_setup_true_lang-Bb2Nqdsz.js} +118 -118
  94. package/dist/{TermsSettings-CmAHVOuX.js → TermsSettings-Cb6Xms3f.js} +16 -16
  95. package/dist/{ThemeColorRow-CScTIcPB.js → ThemeColorRow-oW3xS1pa.js} +13 -13
  96. package/dist/{ToggleBinding-CVZZlpBR.js → ToggleBinding-B-F9_nAf.js} +7 -7
  97. package/dist/{UploadModal-2tXsmGMM.js → UploadModal-eBx4Vqyo.js} +19 -19
  98. package/dist/{VideoPlayerInput-BDzjZ2St.js → VideoPlayerInput-CtTe4JW4.js} +10 -10
  99. package/dist/{VideoPlayerSettings-BLAEZw4C.js → VideoPlayerSettings-Cvz5B4JX.js} +9 -9
  100. package/dist/{VideoSelectModal-iqgmg85K.js → VideoSelectModal-CXI0aN4g.js} +19 -19
  101. package/dist/{focusDrawerMixin-BmyahQiE.js → focusDrawerMixin-DlcYhFw8.js} +1 -1
  102. package/dist/{formDrawerState-B7ASfNsk.js → formDrawerState-Cf6Q5cuR.js} +1 -1
  103. package/dist/{helpers-BVP2Pul1.js → helpers-Cf9wqfZh.js} +4 -4
  104. package/dist/{index-D0Qee2OX.js → index-BSCAjn53.js} +31 -31
  105. package/dist/{index-Cd4S4J-L.js → index-BStFMzD9.js} +56 -56
  106. package/dist/{index-BDb4bM0D.js → index-BytsFarx.js} +24 -24
  107. package/dist/{index-DXNrJnEc.js → index-Co_PpOtI.js} +10 -10
  108. package/dist/{index-BH5vwOzR.js → index-DPlBYqKB.js} +9 -9
  109. package/dist/{index-B86TZXOh.js → index-DsvlNA3Q.js} +94 -94
  110. package/dist/{index-CsbYpQqP.js → index-r5v1Gv17.js} +57 -57
  111. package/dist/index.es.js +2 -2
  112. package/dist/index.umd.js +153 -158
  113. package/dist/{main-C2Q8_T2Y.js → main-BkjAGG46.js} +14298 -14373
  114. package/dist/{mapFormMixin-CjfqZnmd.js → mapFormMixin-DLFNPgNO.js} +34 -40
  115. package/dist/omit-CvOSNZN7.js +56 -0
  116. package/dist/{publicSenderState-C3ELW8Cw.js → publicSenderState-DeC1m0ps.js} +4 -4
  117. package/dist/{splitpanes-CuxtOZyV.js → splitpanes-CsJipBiG.js} +6 -6
  118. package/dist/{template-DzrGrOEa.js → template-Cvzvayl5.js} +6 -6
  119. package/dist/{tippy.esm-Bf86qEue.js → tippy.esm-JEjGtE5F.js} +273 -275
  120. package/dist/{useTermsModal-Be4HLDDm.js → useTermsModal-D2gYy-TP.js} +7 -7
  121. package/dist/{utils-a_Odlqb5.js → utils-DarTPA8c.js} +1 -1
  122. package/dist/{validation-38muBV6x.js → validation-K11g55ZB.js} +4 -4
  123. package/dist/widget.css +1 -1
  124. package/package.json +2 -2
  125. package/dist/DocumentLayout-DaVz9SGF.js +0 -1434
  126. package/dist/Index-CXjLkK_n.js +0 -49
  127. package/dist/Index-qFx0G3fC.js +0 -4
  128. package/dist/omit-DzlbtNCX.js +0 -56
@@ -1,1434 +0,0 @@
1
- import { aj as Ee, L as re, o as A, b as ie, j as qe, Y as we, _ as ke, p as gt, V as yt, cG as jt, l as et, cH as tt, c as X, w as $, G as Ve, F as $e, f as Fe, D as Ue, af as Ge, e as ne, h as zt, ad as bt, N as Qe, x as De, t as F, U as be, K as At, r as Ht, ae as Bt, at as Rt, Q as se, cI as Wt, br as Mt, bs as Nt, ca as qt, B as Ce, z as Ft, a9 as Vt, d as xe, cJ as $t, cK as Ut, ac as Gt, y as Qt, aM as Kt, cL as Yt, cx as Jt } from "./main-C2Q8_T2Y.js";
2
- import "./template-DzrGrOEa.js";
3
- import { a as Zt, C as Xt } from "./CDropdownItem-B5rgSee7.js";
4
- import "./helpers-BVP2Pul1.js";
5
- const en = (e, t, r) => {
6
- const o = e[t];
7
- return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((n, s) => {
8
- (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
9
- s.bind(
10
- null,
11
- new Error(
12
- "Unknown variable dynamic import: " + t + (t.split("/").length !== r ? ". Note that variables only represent file names one level deep." : "")
13
- )
14
- )
15
- );
16
- });
17
- }, tn = { class: "c-loading" }, nn = /* @__PURE__ */ Ee({
18
- __name: "LoadingBlock",
19
- setup(e) {
20
- const t = re(`${Math.floor(Math.random() * 56 + 25)}%`);
21
- return (r, o) => (A(), ie("div", tn, [
22
- qe("div", {
23
- style: we({ width: t.value }),
24
- class: "c-loading-title"
25
- }, null, 4),
26
- o[0] || (o[0] = qe("div", { class: "c-loading-body" }, null, -1))
27
- ]));
28
- }
29
- }), nt = /* @__PURE__ */ ke(nn, [["__scopeId", "data-v-70f204ee"]]), wt = (e) => {
30
- const t = Symbol(e);
31
- return [(n) => gt(t, n), (n) => yt(t, n), t];
32
- }, [rn, on] = wt("DocumentWidth"), [an, Xn] = wt("DocumentHeight");
33
- function sn(e) {
34
- const { width: t, height: r } = jt(e);
35
- return rn(t), an(r), { width: t, height: r };
36
- }
37
- function ln() {
38
- return on(re(window.innerWidth));
39
- }
40
- const cn = {
41
- name: "DynamicChapter",
42
- components: {
43
- DynamicChapter: et(() => Promise.resolve().then(() => dn)),
44
- LoadingBlock: nt
45
- },
46
- provide() {
47
- return this.level !== 0 ? {} : {
48
- _firstBlock: this._firstBlock,
49
- _lastBlock: this._lastBlock
50
- };
51
- },
52
- inject: {
53
- isPdf: {
54
- default: !1
55
- }
56
- },
57
- props: {
58
- componentProps: {
59
- type: Object,
60
- default: () => ({})
61
- },
62
- componentName: {
63
- type: String,
64
- required: !0
65
- },
66
- level: {
67
- type: Number,
68
- default: 0
69
- },
70
- isVisible: {
71
- type: [Boolean, Object],
72
- default: !0
73
- },
74
- _firstBlock: {
75
- type: Boolean,
76
- default: !1
77
- },
78
- _lastBlock: {
79
- type: Boolean,
80
- default: !1
81
- },
82
- children: {
83
- type: Array,
84
- default: () => []
85
- },
86
- onInput: {
87
- type: Function,
88
- default: () => {
89
- }
90
- },
91
- onRemove: {
92
- type: Function,
93
- default: () => {
94
- }
95
- },
96
- onMount: {
97
- type: Function,
98
- default: () => {
99
- }
100
- }
101
- },
102
- setup() {
103
- return { docWidth: ln() };
104
- },
105
- data() {
106
- return {
107
- component: tt(nt)
108
- };
109
- },
110
- computed: {
111
- loader() {
112
- return () => en(/* @__PURE__ */ Object.assign({ "../blocks/answer/Index.vue": () => import("./Index-BbVHxVFJ.js"), "../blocks/attachments/Index.vue": () => import("./Index-DjfbgA_7.js"), "../blocks/coverBlock/Index.vue": () => import("./Index-Dxg4gEKd.js"), "../blocks/custom/Index.vue": () => import("./Index-DkQ8_VkX.js"), "../blocks/docChapter/Index.vue": () => import("./Index-DzdEqsZB.js"), "../blocks/docChapterSub/Index.vue": () => import("./Index-CXjLkK_n.js"), "../blocks/docParties/Index.vue": () => import("./Index-Dfy0PsiW.js"), "../blocks/embed/Index.vue": () => import("./Index-ezY0DbcB.js"), "../blocks/estimatedTimeToCompleteText/Index.vue": () => import("./Index-GPliVrhC.js"), "../blocks/estimatedWorkStartAndEndAtText/Index.vue": () => import("./Index-Cjg3X74T.js"), "../blocks/extraWorkConstructionPricingList/Index.vue": () => import("./Index-9ZFW8Ka7.js"), "../blocks/extraWorkTimeImpactText/Index.vue": () => import("./Index-DOeHci16.js"), "../blocks/header/Index.vue": () => import("./Index-BTDQax0X.js"), "../blocks/multiGroupPricing/Index.vue": () => import("./Index-BlownK7_.js"), "../blocks/notBinding/Index.vue": () => import("./Index-1WPEpaVr.js"), "../blocks/packageGroup/Index.vue": () => import("./Index-CQboLS2e.js"), "../blocks/pdf/Index.vue": () => import("./Index-BJf4YdYB.js"), "../blocks/presentation/Index.vue": () => import("./Index-BvAqglwa.js"), "../blocks/terms/Index.vue": () => import("./Index-C2-s62x7.js"), "../blocks/textContent/Index.vue": () => import("./Index-NnBwJv9v.js"), "../blocks/videoPlayer/Index.vue": () => import("./Index-DAkq_7Ws.js"), "../blocks/workAddressText/Index.vue": () => import("./Index-CTrX3VRa.js") }), `../blocks/${this.componentName}/Index.vue`, 4);
113
- },
114
- isPdfPrintAndPdfBlock() {
115
- var e, t;
116
- return !!(this.isPdf && ((t = (e = this.children) == null ? void 0 : e[0]) == null ? void 0 : t.componentName) === "pdf");
117
- },
118
- isPdfBlock() {
119
- var e, t;
120
- return ((t = (e = this.children) == null ? void 0 : e[0]) == null ? void 0 : t.componentName) === "pdf";
121
- }
122
- },
123
- mounted() {
124
- this.loader().then(() => {
125
- this.component = tt(et(() => this.loader()));
126
- }).catch((e) => {
127
- console.log(e);
128
- });
129
- }
130
- };
131
- function un(e, t, r, o, n, s) {
132
- const a = ne("DynamicChapter", !0);
133
- return n.component ? (A(), X(Ge(n.component), Ue({ key: 0 }, r.componentProps, {
134
- class: r.level === 0 && [
135
- {
136
- "is-mobile": o.docWidth <= 640,
137
- "is-tablet": o.docWidth > 640 && o.docWidth <= 1024,
138
- "is-desktop": o.docWidth > 1024
139
- },
140
- r.componentProps && r.componentProps.classList ? r.componentProps.classList : ""
141
- ],
142
- "enable-spacing-x": !s.isPdfPrintAndPdfBlock,
143
- "pdf-spacing-x": s.isPdfBlock,
144
- "enable-spacing-y": !!(!s.isPdfPrintAndPdfBlock && r.isVisible),
145
- onInput: r.onInput,
146
- onRemove: r.onRemove,
147
- onVnodeMounted: t[0] || (t[0] = (u) => r.onMount(e.$el))
148
- }), {
149
- default: $(() => [
150
- r.children.length ? (A(!0), ie($e, { key: 0 }, Ve(r.children, (u, d) => (A(), X(a, {
151
- key: u.itemId + `${d}`,
152
- "component-name": u.componentName,
153
- "component-props": {
154
- ...u.props,
155
- _document: r.componentProps._document,
156
- _value: u._value,
157
- _nodeId: u.nodeId
158
- },
159
- children: u.children,
160
- level: r.level + 1,
161
- "on-input": r.onInput,
162
- "on-remove": r.onRemove,
163
- "on-mount": r.onMount
164
- }, null, 8, ["component-name", "component-props", "children", "level", "on-input", "on-remove", "on-mount"]))), 128)) : Fe("", !0)
165
- ]),
166
- _: 1
167
- }, 16, ["class", "enable-spacing-x", "pdf-spacing-x", "enable-spacing-y", "onInput", "onRemove"])) : Fe("", !0);
168
- }
169
- const xt = /* @__PURE__ */ ke(cn, [["render", un]]), dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
170
- __proto__: null,
171
- default: xt
172
- }, Symbol.toStringTag, { value: "Module" })), kt = "data-is-preview", fn = zt.google.fontsKey, hn = "https://www.googleapis.com/webfonts/v1/webfonts", pn = "https://fonts.googleapis.com/css", rt = {
173
- 100: { label: "Thin", value: "100" },
174
- 200: { label: "Extra Light", value: "200" },
175
- 300: { label: "Light", value: "300" },
176
- regular: { label: "Normal", value: "400" },
177
- 500: { label: "Medium", value: "500" },
178
- 600: { label: "Semi Bold", value: "600" },
179
- 700: { label: "Bold", value: "700" },
180
- 800: { label: "Extra Bold", value: "800" },
181
- 900: { label: "Black", value: "900" }
182
- }, St = (e) => `font-${e.replace(/\s+/g, "-").toLowerCase()}`, vn = (e, t = !1) => {
183
- const r = document.getElementById(St(e));
184
- return r !== null && r.getAttribute(kt) === t.toString();
185
- }, mn = (e, t = !1) => {
186
- const r = document.head || document.getElementsByTagName("head")[0], o = document.createElement("link");
187
- o.id = St(e), o.setAttribute("rel", "stylesheet"), o.setAttribute(kt, t.toString());
188
- let n = `${pn}?family=${e.replace(/\s/gi, "+")}`;
189
- return t ? n += `&text=${e}` : n += ":100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic", n += "&display=swap", o.setAttribute("href", n), r.appendChild(o), o;
190
- }, _t = (e, t = !1) => {
191
- e && !vn(e, t) && mn(e, t);
192
- }, Et = (e = {}) => {
193
- if (!(typeof e != "object" || !e))
194
- for (const t in e)
195
- t === "fontFamily" ? _t(e[t]) : typeof e[t] == "object" && Et(e[t]);
196
- }, Dt = /* @__PURE__ */ Ee({
197
- __name: "FontDropdownItem",
198
- props: {
199
- source: {}
200
- },
201
- setup(e) {
202
- const t = e, r = re(null), o = (a, u) => {
203
- let d = a, l = d.$options.name;
204
- for (; d && (!l || l !== u); )
205
- d = d.$parent, d && ({ name: l } = d.$options);
206
- return d || null;
207
- }, n = re({
208
- paddingRight: "calc(0.5 * var(--rem))",
209
- fontFamily: `'${t.source.family}'`
210
- }), s = At();
211
- return s && (r.value = o(s.proxy, "CDropdown")), bt(() => {
212
- _t(t.source.family, !0);
213
- }), Qe(
214
- () => t.source,
215
- (a) => {
216
- n.value.fontFamily = `'${a.family}'`;
217
- }
218
- ), (a, u) => (A(), X(be(Zt), {
219
- value: a.source,
220
- "custom-parent": r.value,
221
- class: "!truncate",
222
- style: we(n.value)
223
- }, {
224
- default: $(() => [
225
- De(F(a.source.family), 1)
226
- ]),
227
- _: 1
228
- }, 8, ["value", "custom-parent", "style"]));
229
- }
230
- }), gn = 1e3 * 60 * 60 * 24 * 14, R = Ht({
231
- list: [],
232
- fetchedAt: null,
233
- error: "",
234
- loading: !1
235
- }), yn = async (e = "popularity") => {
236
- let t = [];
237
- try {
238
- const { data: r } = await Bt.get(hn, {
239
- params: {
240
- sort: e,
241
- key: fn
242
- }
243
- });
244
- t = r.items || [];
245
- } catch (r) {
246
- R.error = r;
247
- }
248
- return t;
249
- };
250
- R.load = async () => {
251
- if (R.loading) {
252
- await R.loading;
253
- return;
254
- }
255
- (!R.fetchedAt || R.fetchedAt < Date.now() - gn) && (R.loading = new Promise(async (e) => {
256
- R.list = await yn(), R.fetchedAt = Date.now(), e(!1);
257
- }), await R.loading);
258
- };
259
- const Ct = (e = []) => (e || []).filter((t) => !!rt[t]).map((t) => rt[t]), er = async (e) => {
260
- if (!e || typeof e != "string") return {};
261
- !R.list.length && !R.error && await R.load();
262
- const { variants: t } = R.list.find((r) => r.family === e) || {};
263
- return Ct(t || []);
264
- }, bn = /* @__PURE__ */ Ee({
265
- __name: "VirtualFontsList",
266
- props: {
267
- items: {}
268
- },
269
- setup(e) {
270
- const t = e, r = re([...t.items]);
271
- Qe(
272
- () => t.items,
273
- (l) => {
274
- r.value = [...l];
275
- }
276
- );
277
- const o = Rt(), n = se(() => o.style), s = se(() => ({
278
- "overflow-y": "auto",
279
- height: "250px",
280
- width: "240px",
281
- ...n
282
- })), { list: a, containerProps: u, wrapperProps: d } = Wt(r, {
283
- itemHeight: 35
284
- });
285
- return (l, f) => (A(), ie("div", Ue(be(u), { style: s.value }), [
286
- qe("div", Mt(Nt(be(d))), [
287
- (A(!0), ie($e, null, Ve(be(a), (v) => (A(), X(Dt, {
288
- key: v.index,
289
- source: v.data
290
- }, qt({ _: 2 }, [
291
- l.$slots.footer ? {
292
- name: "footer",
293
- fn: $(() => [
294
- Ce(l.$slots, "footer")
295
- ]),
296
- key: "0"
297
- } : void 0
298
- ]), 1032, ["source"]))), 128))
299
- ], 16)
300
- ], 16));
301
- }
302
- }), wn = {
303
- name: "FontPickerDropdown",
304
- components: {
305
- CInput: Ft,
306
- CDropdown: Xt,
307
- VirtualFontsList: bn
308
- },
309
- props: {
310
- modelValue: {
311
- type: Object,
312
- default: null
313
- },
314
- height: {
315
- type: String,
316
- default: "250px"
317
- }
318
- },
319
- emits: ["update:modelValue"],
320
- data() {
321
- return {
322
- FontDropdownItem: Dt,
323
- visualQuery: "",
324
- // string visual to user
325
- activeQuery: ""
326
- // query used for filtering results, hidden behind debounce
327
- };
328
- },
329
- computed: {
330
- selectedValue: {
331
- get() {
332
- return {
333
- family: "Inter",
334
- weight: "400",
335
- ...this.modelValue
336
- };
337
- },
338
- set(e) {
339
- const { family: t, variants: r = [] } = e || {};
340
- let { weight: o = "400" } = this.modelValue || {};
341
- const n = Ct(r), s = n.map((a) => a.value);
342
- s.length && !s.includes(`${o}`) && (o = s.reduce(
343
- (a, u) => Math.abs(u - o) < Math.abs(a - o) ? u : a
344
- )), this.$emit("update:modelValue", {
345
- family: t,
346
- weight: o,
347
- options: n
348
- });
349
- }
350
- },
351
- fontsList() {
352
- const e = R.list || [];
353
- if (this.activeQuery) {
354
- const t = new RegExp(this.activeQuery, "i");
355
- return e.filter((r) => t.test(r.family));
356
- }
357
- return e;
358
- }
359
- },
360
- watch: {
361
- visualQuery: Vt(function(t) {
362
- this.activeQuery = t;
363
- }, 300)
364
- },
365
- created() {
366
- R.load();
367
- }
368
- };
369
- function xn(e, t, r, o, n, s) {
370
- const a = ne("CButton"), u = ne("CInput"), d = ne("VirtualFontsList"), l = ne("CDropdown");
371
- return A(), X(l, Ue({
372
- position: "is-bottom-left",
373
- ...e.$attrs,
374
- ...e.$props
375
- }, {
376
- ref: "dropdown",
377
- modelValue: s.selectedValue,
378
- "onUpdate:modelValue": t[1] || (t[1] = (f) => s.selectedValue = f),
379
- size: e.$attrs.size,
380
- disabled: e.$attrs.disabled,
381
- "menu-styling": {
382
- minWidth: "250px",
383
- maxWidth: "300px"
384
- },
385
- "max-height": r.height,
386
- scrollable: !0,
387
- class: "control"
388
- }), {
389
- trigger: $(() => [
390
- Ce(e.$slots, "default", {
391
- selectedFamily: s.selectedValue.family
392
- }, () => [
393
- xe(a, {
394
- style: we([{ fontFamily: s.selectedValue.family }, { width: "100%", "text-align": "left", "min-width": "7em" }]),
395
- class: "is-left"
396
- }, {
397
- default: $(() => [
398
- De(F(s.selectedValue.family), 1)
399
- ]),
400
- _: 1
401
- }, 8, ["style"])
402
- ])
403
- ]),
404
- header: $(() => [
405
- xe(u, {
406
- modelValue: n.visualQuery,
407
- "onUpdate:modelValue": t[0] || (t[0] = (f) => n.visualQuery = f),
408
- placeholder: e.$t("_common:search"),
409
- filled: "",
410
- style: { "margin-bottom": "0.25em" }
411
- }, null, 8, ["modelValue", "placeholder"])
412
- ]),
413
- default: $(() => [
414
- s.fontsList.length ? (A(), X(d, {
415
- key: 0,
416
- items: s.fontsList
417
- }, null, 8, ["items"])) : (A(), ie("div", {
418
- key: 1,
419
- style: we([{ height: "250px", width: "240px", display: "flex", "justify-content": "center", "align-items": "center" }, { height: r.height }])
420
- }, F(e.$t("_common:noResults")), 5))
421
- ]),
422
- _: 3
423
- }, 16, ["modelValue", "size", "disabled", "max-height"]);
424
- }
425
- const tr = /* @__PURE__ */ ke(wn, [["render", xn]]), Ke = $t(Ut), nr = Ke.smallerOrEqual("sm"), kn = Ke.between("md", "lg"), Sn = Ke.greaterOrEqual("lg");
426
- se(
427
- () => kn.value || Sn.value
428
- );
429
- function _n({
430
- minWidthPx: e,
431
- maxWidthPx: t,
432
- minFontSize: r,
433
- maxFontSize: o
434
- }) {
435
- const n = e, s = t, a = (o - r) / (s - n), u = -n * a + r, d = (l) => Math.round(l * 1e3) / 1e3;
436
- return `clamp(${d(r)}px, ${d(
437
- u
438
- )}px + calc(${d(a) * 100} * var(--vw, 1vw)), ${d(
439
- o
440
- )}px)`;
441
- }
442
- function En({ size: e }) {
443
- let t = e * 0.9;
444
- return e > 30 && (t = e * 0.8), e > 40 && (t = e * 0.725), e > 50 && (t = e * 0.675), _n({
445
- minWidthPx: 375,
446
- maxWidthPx: 1200,
447
- minFontSize: t,
448
- maxFontSize: e
449
- });
450
- }
451
- const Dn = ({ json: e, prefix: t = "" } = {}) => Object.keys(e || {}).map((r) => {
452
- const o = e[r], s = Object.keys(o).map((a) => {
453
- const u = a.startsWith("--") ? a : a.split(/(?=[A-Z])/).join("-").toLowerCase(), d = o[a];
454
- let l = `${u}:${d}`;
455
- return u === "font-size" && (l += `; font-size: ${En({
456
- size: parseInt(d, 10)
457
- })}`), l;
458
- }).join(";");
459
- return `${t}${r}{${s}}`;
460
- }).join(`
461
- `), Cn = {
462
- name: "DynamicStyle",
463
- props: {
464
- json: {
465
- type: Object,
466
- default: null
467
- },
468
- prefix: {
469
- type: String,
470
- default: ""
471
- }
472
- },
473
- created() {
474
- Et(this.json);
475
- },
476
- methods: {
477
- jsonToCss: Dn
478
- }
479
- };
480
- function In(e, t, r, o, n, s) {
481
- return r.json ? (A(), X(Ge("style"), { key: 0 }, {
482
- default: $(() => [
483
- De(F(s.jsonToCss({ json: r.json, prefix: r.prefix })), 1)
484
- ]),
485
- _: 1
486
- })) : Fe("", !0);
487
- }
488
- const Ln = /* @__PURE__ */ ke(Cn, [["render", In]]), Pn = /* @__PURE__ */ Ee({
489
- __name: "DocumentStyleContainer",
490
- props: {
491
- inputStyle: {}
492
- },
493
- setup(e) {
494
- const t = e, { canEdit: r, isForm: o } = yt("viewSettings", {
495
- canEdit: !1,
496
- isForm: !1
497
- }), n = Gt("container"), { width: s, height: a } = sn(n), u = se(() => ({
498
- "--vw": `${s.value / 100}px`,
499
- "--vh": `clamp(7.5px, ${a.value / 100}px, ${r ? 7.5 : 9}px)`
500
- })), d = se(
501
- () => `document-base-style-${Math.random().toString(36).substr(2, 9)}`
502
- ), l = {
503
- '[data-typography="title"]': "title",
504
- h1: "h1",
505
- h2: "h2",
506
- h3: "h3",
507
- p: "p",
508
- blockquote: "blockquote",
509
- ".chapter": "section"
510
- }, f = se(() => Object.keys(l).filter((g) => !(t.inputStyle || {})[g]).map((g) => `document-legacy-style-${l[g]}`)), v = se(
511
- () => {
512
- var g, H;
513
- return (H = (g = t.inputStyle) == null ? void 0 : g[".chapter"]) == null ? void 0 : H["--accentColor"];
514
- }
515
- );
516
- return (g, H) => (A(), ie("div", {
517
- ref_key: "container",
518
- ref: n,
519
- class: Qt([...f.value, d.value]),
520
- style: we(be(o) && u.value)
521
- }, [
522
- (A(), X(Ge("style"), null, {
523
- default: $(() => [
524
- De(" .primary-text-color { color: " + F(v.value) + " !important } .primary-background-color, quill-format ul li::before { background-color: " + F(v.value) + " !important } .primary-box-shadow-left-color { box-shadow: inset 4px 0 " + F(v.value) + " !important } .primary-border-left-color { border-left-color: " + F(v.value) + " !important } .primary-pseudo-background::after { background-color: " + F(v.value) + " !important } .primary-svg-fill { fill: " + F(v.value) + " !important } .primary-light-background { background-color: hsla(0, 0%, 0%, 0.05) !important} .primary-light-box-shadow-left-color { box-shadow: inset 4px 0 " + F(v.value ? v.value.replace(/[^,]+(?=\))/, "0.08") : "") + " !important} .quill-format ul li::before { background-color: " + F(v.value) + " !important } ", 1)
525
- ]),
526
- _: 1
527
- })),
528
- xe(Ln, {
529
- json: g.inputStyle,
530
- prefix: `.${d.value}.${d.value}.${d.value} `
531
- }, null, 8, ["json", "prefix"]),
532
- Ce(g.$slots, "default")
533
- ], 6));
534
- }
535
- });
536
- var Le = { exports: {} }, it;
537
- function It() {
538
- if (it) return Le.exports;
539
- it = 1;
540
- var e = Le.exports = {};
541
- return e.forEach = function(t, r) {
542
- for (var o = 0; o < t.length; o++) {
543
- var n = r(t[o]);
544
- if (n)
545
- return n;
546
- }
547
- }, Le.exports;
548
- }
549
- var Pe, ot;
550
- function Tn() {
551
- return ot || (ot = 1, Pe = function(e) {
552
- var t = e.stateHandler.getState;
553
- function r(a) {
554
- var u = t(a);
555
- return u && !!u.isDetectable;
556
- }
557
- function o(a) {
558
- t(a).isDetectable = !0;
559
- }
560
- function n(a) {
561
- return !!t(a).busy;
562
- }
563
- function s(a, u) {
564
- t(a).busy = !!u;
565
- }
566
- return {
567
- isDetectable: r,
568
- markAsDetectable: o,
569
- isBusy: n,
570
- markBusy: s
571
- };
572
- }), Pe;
573
- }
574
- var Te, at;
575
- function On() {
576
- return at || (at = 1, Te = function(e) {
577
- var t = {};
578
- function r(a) {
579
- var u = e.get(a);
580
- return u === void 0 ? [] : t[u] || [];
581
- }
582
- function o(a, u) {
583
- var d = e.get(a);
584
- t[d] || (t[d] = []), t[d].push(u);
585
- }
586
- function n(a, u) {
587
- for (var d = r(a), l = 0, f = d.length; l < f; ++l)
588
- if (d[l] === u) {
589
- d.splice(l, 1);
590
- break;
591
- }
592
- }
593
- function s(a) {
594
- var u = r(a);
595
- u && (u.length = 0);
596
- }
597
- return {
598
- get: r,
599
- add: o,
600
- removeListener: n,
601
- removeAllListeners: s
602
- };
603
- }), Te;
604
- }
605
- var Oe, st;
606
- function jn() {
607
- return st || (st = 1, Oe = function() {
608
- var e = 1;
609
- function t() {
610
- return e++;
611
- }
612
- return {
613
- generate: t
614
- };
615
- }), Oe;
616
- }
617
- var je, lt;
618
- function zn() {
619
- return lt || (lt = 1, je = function(e) {
620
- var t = e.idGenerator, r = e.stateHandler.getState;
621
- function o(s) {
622
- var a = r(s);
623
- return a && a.id !== void 0 ? a.id : null;
624
- }
625
- function n(s) {
626
- var a = r(s);
627
- if (!a)
628
- throw new Error("setId required the element to have a resize detection state.");
629
- var u = t.generate();
630
- return a.id = u, u;
631
- }
632
- return {
633
- get: o,
634
- set: n
635
- };
636
- }), je;
637
- }
638
- var ze, ct;
639
- function An() {
640
- return ct || (ct = 1, ze = function(e) {
641
- function t() {
642
- }
643
- var r = {
644
- log: t,
645
- warn: t,
646
- error: t
647
- };
648
- if (!e && window.console) {
649
- var o = function(n, s) {
650
- n[s] = function() {
651
- var u = console[s];
652
- if (u.apply)
653
- u.apply(console, arguments);
654
- else
655
- for (var d = 0; d < arguments.length; d++)
656
- u(arguments[d]);
657
- };
658
- };
659
- o(r, "log"), o(r, "warn"), o(r, "error");
660
- }
661
- return r;
662
- }), ze;
663
- }
664
- var Ae = { exports: {} }, ut;
665
- function Lt() {
666
- if (ut) return Ae.exports;
667
- ut = 1;
668
- var e = Ae.exports = {};
669
- return e.isIE = function(t) {
670
- function r() {
671
- var n = navigator.userAgent.toLowerCase();
672
- return n.indexOf("msie") !== -1 || n.indexOf("trident") !== -1 || n.indexOf(" edge/") !== -1;
673
- }
674
- if (!r())
675
- return !1;
676
- if (!t)
677
- return !0;
678
- var o = function() {
679
- var n, s = 3, a = document.createElement("div"), u = a.getElementsByTagName("i");
680
- do
681
- a.innerHTML = "<!--[if gt IE " + ++s + "]><i></i><![endif]-->";
682
- while (u[0]);
683
- return s > 4 ? s : n;
684
- }();
685
- return t === o;
686
- }, e.isLegacyOpera = function() {
687
- return !!window.opera;
688
- }, Ae.exports;
689
- }
690
- var He = { exports: {} }, dt;
691
- function Hn() {
692
- if (dt) return He.exports;
693
- dt = 1;
694
- var e = He.exports = {};
695
- e.getOption = t;
696
- function t(r, o, n) {
697
- var s = r[o];
698
- return s == null && n !== void 0 ? n : s;
699
- }
700
- return He.exports;
701
- }
702
- var Be, ft;
703
- function Bn() {
704
- if (ft) return Be;
705
- ft = 1;
706
- var e = Hn();
707
- Be = function(o) {
708
- o = o || {};
709
- var n = o.reporter, s = e.getOption(o, "async", !0), a = e.getOption(o, "auto", !0);
710
- a && !s && (n && n.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."), s = !0);
711
- var u = t(), d, l = !1;
712
- function f(b, P) {
713
- !l && a && s && u.size() === 0 && H(), u.add(b, P);
714
- }
715
- function v() {
716
- for (l = !0; u.size(); ) {
717
- var b = u;
718
- u = t(), b.process();
719
- }
720
- l = !1;
721
- }
722
- function g(b) {
723
- l || (b === void 0 && (b = s), d && (w(d), d = null), b ? H() : v());
724
- }
725
- function H() {
726
- d = y(v);
727
- }
728
- function w(b) {
729
- var P = clearTimeout;
730
- return P(b);
731
- }
732
- function y(b) {
733
- var P = function(B) {
734
- return setTimeout(B, 0);
735
- };
736
- return P(b);
737
- }
738
- return {
739
- add: f,
740
- force: g
741
- };
742
- };
743
- function t() {
744
- var r = {}, o = 0, n = 0, s = 0;
745
- function a(l, f) {
746
- f || (f = l, l = 0), l > n ? n = l : l < s && (s = l), r[l] || (r[l] = []), r[l].push(f), o++;
747
- }
748
- function u() {
749
- for (var l = s; l <= n; l++)
750
- for (var f = r[l], v = 0; v < f.length; v++) {
751
- var g = f[v];
752
- g();
753
- }
754
- }
755
- function d() {
756
- return o;
757
- }
758
- return {
759
- add: a,
760
- process: u,
761
- size: d
762
- };
763
- }
764
- return Be;
765
- }
766
- var Re, ht;
767
- function Rn() {
768
- if (ht) return Re;
769
- ht = 1;
770
- var e = "_erd";
771
- function t(n) {
772
- return n[e] = {}, r(n);
773
- }
774
- function r(n) {
775
- return n[e];
776
- }
777
- function o(n) {
778
- delete n[e];
779
- }
780
- return Re = {
781
- initState: t,
782
- getState: r,
783
- cleanState: o
784
- }, Re;
785
- }
786
- var We, pt;
787
- function Wn() {
788
- if (pt) return We;
789
- pt = 1;
790
- var e = Lt();
791
- return We = function(t) {
792
- t = t || {};
793
- var r = t.reporter, o = t.batchProcessor, n = t.stateHandler.getState;
794
- if (!r)
795
- throw new Error("Missing required dependency: reporter.");
796
- function s(f, v) {
797
- function g() {
798
- v(f);
799
- }
800
- if (e.isIE(8))
801
- n(f).object = {
802
- proxy: g
803
- }, f.attachEvent("onresize", g);
804
- else {
805
- var H = d(f);
806
- if (!H)
807
- throw new Error("Element is not detectable by this strategy.");
808
- H.contentDocument.defaultView.addEventListener("resize", g);
809
- }
810
- }
811
- function a(f) {
812
- var v = t.important ? " !important; " : "; ";
813
- return (f.join(v) + v).trim();
814
- }
815
- function u(f, v, g) {
816
- g || (g = v, v = f, f = null), f = f || {}, f.debug;
817
- function H(w, y) {
818
- var b = a(["display: block", "position: absolute", "top: 0", "left: 0", "width: 100%", "height: 100%", "border: none", "padding: 0", "margin: 0", "opacity: 0", "z-index: -1000", "pointer-events: none"]), P = !1, B = window.getComputedStyle(w), D = w.offsetWidth, ve = w.offsetHeight;
819
- n(w).startSize = {
820
- width: D,
821
- height: ve
822
- };
823
- function p() {
824
- function i() {
825
- if (B.position === "static") {
826
- w.style.setProperty("position", "relative", f.important ? "important" : "");
827
- var _ = function(z, I, M, E) {
828
- function V(me) {
829
- return me.replace(/[^-\d\.]/g, "");
830
- }
831
- var U = M[E];
832
- U !== "auto" && V(U) !== "0" && (z.warn("An element that is positioned static has style." + E + "=" + U + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + E + " will be set to 0. Element: ", I), I.style.setProperty(E, "0", f.important ? "important" : ""));
833
- };
834
- _(r, w, B, "top"), _(r, w, B, "right"), _(r, w, B, "bottom"), _(r, w, B, "left");
835
- }
836
- }
837
- function k() {
838
- P || i();
839
- function _(I, M) {
840
- if (!I.contentDocument) {
841
- var E = n(I);
842
- E.checkForObjectDocumentTimeoutId && window.clearTimeout(E.checkForObjectDocumentTimeoutId), E.checkForObjectDocumentTimeoutId = setTimeout(function() {
843
- E.checkForObjectDocumentTimeoutId = 0, _(I, M);
844
- }, 100);
845
- return;
846
- }
847
- M(I.contentDocument);
848
- }
849
- var z = this;
850
- _(z, function(M) {
851
- y(w);
852
- });
853
- }
854
- B.position !== "" && (i(), P = !0);
855
- var h = document.createElement("object");
856
- h.style.cssText = b, h.tabIndex = -1, h.type = "text/html", h.setAttribute("aria-hidden", "true"), h.onload = k, e.isIE() || (h.data = "about:blank"), n(w) && (w.appendChild(h), n(w).object = h, e.isIE() && (h.data = "about:blank"));
857
- }
858
- o ? o.add(p) : p();
859
- }
860
- e.isIE(8) ? g(v) : H(v, g);
861
- }
862
- function d(f) {
863
- return n(f).object;
864
- }
865
- function l(f) {
866
- if (n(f)) {
867
- var v = d(f);
868
- v && (e.isIE(8) ? f.detachEvent("onresize", v.proxy) : f.removeChild(v), n(f).checkForObjectDocumentTimeoutId && window.clearTimeout(n(f).checkForObjectDocumentTimeoutId), delete n(f).object);
869
- }
870
- }
871
- return {
872
- makeDetectable: u,
873
- addListener: s,
874
- uninstall: l
875
- };
876
- }, We;
877
- }
878
- var Me, vt;
879
- function Mn() {
880
- if (vt) return Me;
881
- vt = 1;
882
- var e = It().forEach;
883
- return Me = function(t) {
884
- t = t || {};
885
- var r = t.reporter, o = t.batchProcessor, n = t.stateHandler.getState;
886
- t.stateHandler.hasState;
887
- var s = t.idHandler;
888
- if (!o)
889
- throw new Error("Missing required dependency: batchProcessor");
890
- if (!r)
891
- throw new Error("Missing required dependency: reporter.");
892
- var a = v(), u = "erd_scroll_detection_scrollbar_style", d = "erd_scroll_detection_container";
893
- function l(p) {
894
- g(p, u, d);
895
- }
896
- l(window.document);
897
- function f(p) {
898
- var i = t.important ? " !important; " : "; ";
899
- return (p.join(i) + i).trim();
900
- }
901
- function v() {
902
- var p = 500, i = 500, k = document.createElement("div");
903
- k.style.cssText = f(["position: absolute", "width: " + p * 2 + "px", "height: " + i * 2 + "px", "visibility: hidden", "margin: 0", "padding: 0"]);
904
- var h = document.createElement("div");
905
- h.style.cssText = f(["position: absolute", "width: " + p + "px", "height: " + i + "px", "overflow: scroll", "visibility: none", "top: " + -500 * 3 + "px", "left: " + -500 * 3 + "px", "visibility: hidden", "margin: 0", "padding: 0"]), h.appendChild(k), document.body.insertBefore(h, document.body.firstChild);
906
- var _ = p - h.clientWidth, z = i - h.clientHeight;
907
- return document.body.removeChild(h), {
908
- width: _,
909
- height: z
910
- };
911
- }
912
- function g(p, i, k) {
913
- function h(M, E) {
914
- E = E || function(U) {
915
- p.head.appendChild(U);
916
- };
917
- var V = p.createElement("style");
918
- return V.innerHTML = M, V.id = i, E(V), V;
919
- }
920
- if (!p.getElementById(i)) {
921
- var _ = k + "_animation", z = k + "_animation_active", I = `/* Created by the element-resize-detector library. */
922
- `;
923
- I += "." + k + " > div::-webkit-scrollbar { " + f(["display: none"]) + ` }
924
-
925
- `, I += "." + z + " { " + f(["-webkit-animation-duration: 0.1s", "animation-duration: 0.1s", "-webkit-animation-name: " + _, "animation-name: " + _]) + ` }
926
- `, I += "@-webkit-keyframes " + _ + ` { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }
927
- `, I += "@keyframes " + _ + " { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }", h(I);
928
- }
929
- }
930
- function H(p) {
931
- p.className += " " + d + "_animation_active";
932
- }
933
- function w(p, i, k) {
934
- if (p.addEventListener)
935
- p.addEventListener(i, k);
936
- else if (p.attachEvent)
937
- p.attachEvent("on" + i, k);
938
- else
939
- return r.error("[scroll] Don't know how to add event listeners.");
940
- }
941
- function y(p, i, k) {
942
- if (p.removeEventListener)
943
- p.removeEventListener(i, k);
944
- else if (p.detachEvent)
945
- p.detachEvent("on" + i, k);
946
- else
947
- return r.error("[scroll] Don't know how to remove event listeners.");
948
- }
949
- function b(p) {
950
- return n(p).container.childNodes[0].childNodes[0].childNodes[0];
951
- }
952
- function P(p) {
953
- return n(p).container.childNodes[0].childNodes[0].childNodes[1];
954
- }
955
- function B(p, i) {
956
- var k = n(p).listeners;
957
- if (!k.push)
958
- throw new Error("Cannot add listener to an element that is not detectable.");
959
- n(p).listeners.push(i);
960
- }
961
- function D(p, i, k) {
962
- k || (k = i, i = p, p = null), p = p || {};
963
- function h() {
964
- if (p.debug) {
965
- var c = Array.prototype.slice.call(arguments);
966
- if (c.unshift(s.get(i), "Scroll: "), r.log.apply)
967
- r.log.apply(null, c);
968
- else
969
- for (var m = 0; m < c.length; m++)
970
- r.log(c[m]);
971
- }
972
- }
973
- function _(c) {
974
- function m(S) {
975
- var N = S.getRootNode && S.getRootNode().contains(S);
976
- return S === S.ownerDocument.body || S.ownerDocument.body.contains(S) || N;
977
- }
978
- return !m(c) || window.getComputedStyle(c) === null;
979
- }
980
- function z(c) {
981
- var m = n(c).container.childNodes[0], S = window.getComputedStyle(m);
982
- return !S.width || S.width.indexOf("px") === -1;
983
- }
984
- function I() {
985
- var c = window.getComputedStyle(i), m = {};
986
- return m.position = c.position, m.width = i.offsetWidth, m.height = i.offsetHeight, m.top = c.top, m.right = c.right, m.bottom = c.bottom, m.left = c.left, m.widthCSS = c.width, m.heightCSS = c.height, m;
987
- }
988
- function M() {
989
- var c = I();
990
- n(i).startSize = {
991
- width: c.width,
992
- height: c.height
993
- }, h("Element start size", n(i).startSize);
994
- }
995
- function E() {
996
- n(i).listeners = [];
997
- }
998
- function V() {
999
- if (h("storeStyle invoked."), !n(i)) {
1000
- h("Aborting because element has been uninstalled");
1001
- return;
1002
- }
1003
- var c = I();
1004
- n(i).style = c;
1005
- }
1006
- function U(c, m, S) {
1007
- n(c).lastWidth = m, n(c).lastHeight = S;
1008
- }
1009
- function me(c) {
1010
- return b(c).childNodes[0];
1011
- }
1012
- function C() {
1013
- return 2 * a.width + 1;
1014
- }
1015
- function L() {
1016
- return 2 * a.height + 1;
1017
- }
1018
- function Q(c) {
1019
- return c + 10 + C();
1020
- }
1021
- function ge(c) {
1022
- return c + 10 + L();
1023
- }
1024
- function ye(c) {
1025
- return c * 2 + C();
1026
- }
1027
- function ee(c) {
1028
- return c * 2 + L();
1029
- }
1030
- function le(c, m, S) {
1031
- var N = b(c), K = P(c), de = Q(m), fe = ge(S), W = ye(m), x = ee(S);
1032
- N.scrollLeft = de, N.scrollTop = fe, K.scrollLeft = W, K.scrollTop = x;
1033
- }
1034
- function ce() {
1035
- var c = n(i).container;
1036
- if (!c) {
1037
- c = document.createElement("div"), c.className = d, c.style.cssText = f(["visibility: hidden", "display: inline", "width: 0px", "height: 0px", "z-index: -1", "overflow: hidden", "margin: 0", "padding: 0"]), n(i).container = c, H(c), i.appendChild(c);
1038
- var m = function() {
1039
- n(i).onRendered && n(i).onRendered();
1040
- };
1041
- w(c, "animationstart", m), n(i).onAnimationStart = m;
1042
- }
1043
- return c;
1044
- }
1045
- function G() {
1046
- function c() {
1047
- var j = n(i).style;
1048
- if (j.position === "static") {
1049
- i.style.setProperty("position", "relative", p.important ? "important" : "");
1050
- var Z = function(pe, ae, Pt, _e) {
1051
- function Tt(Ot) {
1052
- return Ot.replace(/[^-\d\.]/g, "");
1053
- }
1054
- var Ie = Pt[_e];
1055
- Ie !== "auto" && Tt(Ie) !== "0" && (pe.warn("An element that is positioned static has style." + _e + "=" + Ie + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + _e + " will be set to 0. Element: ", ae), ae.style[_e] = 0);
1056
- };
1057
- Z(r, i, j, "top"), Z(r, i, j, "right"), Z(r, i, j, "bottom"), Z(r, i, j, "left");
1058
- }
1059
- }
1060
- function m(j, Z, pe, ae) {
1061
- return j = j ? j + "px" : "0", Z = Z ? Z + "px" : "0", pe = pe ? pe + "px" : "0", ae = ae ? ae + "px" : "0", ["left: " + j, "top: " + Z, "right: " + ae, "bottom: " + pe];
1062
- }
1063
- if (h("Injecting elements"), !n(i)) {
1064
- h("Aborting because element has been uninstalled");
1065
- return;
1066
- }
1067
- c();
1068
- var S = n(i).container;
1069
- S || (S = ce());
1070
- var N = a.width, K = a.height, de = f(["position: absolute", "flex: none", "overflow: hidden", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%", "left: 0px", "top: 0px"]), fe = f(["position: absolute", "flex: none", "overflow: hidden", "z-index: -1", "visibility: hidden"].concat(m(-(1 + N), -(1 + K), -K, -N))), W = f(["position: absolute", "flex: none", "overflow: scroll", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%"]), x = f(["position: absolute", "flex: none", "overflow: scroll", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%"]), q = f(["position: absolute", "left: 0", "top: 0"]), oe = f(["position: absolute", "width: 200%", "height: 200%"]), Y = document.createElement("div"), J = document.createElement("div"), he = document.createElement("div"), Ye = document.createElement("div"), Se = document.createElement("div"), Je = document.createElement("div");
1071
- Y.dir = "ltr", Y.style.cssText = de, Y.className = d, J.className = d, J.style.cssText = fe, he.style.cssText = W, Ye.style.cssText = q, Se.style.cssText = x, Je.style.cssText = oe, he.appendChild(Ye), Se.appendChild(Je), J.appendChild(he), J.appendChild(Se), Y.appendChild(J), S.appendChild(Y);
1072
- function Ze() {
1073
- var j = n(i);
1074
- j && j.onExpand ? j.onExpand() : h("Aborting expand scroll handler: element has been uninstalled");
1075
- }
1076
- function Xe() {
1077
- var j = n(i);
1078
- j && j.onShrink ? j.onShrink() : h("Aborting shrink scroll handler: element has been uninstalled");
1079
- }
1080
- w(he, "scroll", Ze), w(Se, "scroll", Xe), n(i).onExpandScroll = Ze, n(i).onShrinkScroll = Xe;
1081
- }
1082
- function te() {
1083
- function c(W, x, q) {
1084
- var oe = me(W), Y = Q(x), J = ge(q);
1085
- oe.style.setProperty("width", Y + "px", p.important ? "important" : ""), oe.style.setProperty("height", J + "px", p.important ? "important" : "");
1086
- }
1087
- function m(W) {
1088
- var x = i.offsetWidth, q = i.offsetHeight, oe = x !== n(i).lastWidth || q !== n(i).lastHeight;
1089
- h("Storing current size", x, q), U(i, x, q), o.add(0, function() {
1090
- if (oe) {
1091
- if (!n(i)) {
1092
- h("Aborting because element has been uninstalled");
1093
- return;
1094
- }
1095
- if (!S()) {
1096
- h("Aborting because element container has not been initialized");
1097
- return;
1098
- }
1099
- if (p.debug) {
1100
- var J = i.offsetWidth, he = i.offsetHeight;
1101
- (J !== x || he !== q) && r.warn(s.get(i), "Scroll: Size changed before updating detector elements.");
1102
- }
1103
- c(i, x, q);
1104
- }
1105
- }), o.add(1, function() {
1106
- if (!n(i)) {
1107
- h("Aborting because element has been uninstalled");
1108
- return;
1109
- }
1110
- if (!S()) {
1111
- h("Aborting because element container has not been initialized");
1112
- return;
1113
- }
1114
- le(i, x, q);
1115
- }), oe && W && o.add(2, function() {
1116
- if (!n(i)) {
1117
- h("Aborting because element has been uninstalled");
1118
- return;
1119
- }
1120
- if (!S()) {
1121
- h("Aborting because element container has not been initialized");
1122
- return;
1123
- }
1124
- W();
1125
- });
1126
- }
1127
- function S() {
1128
- return !!n(i).container;
1129
- }
1130
- function N() {
1131
- function W() {
1132
- return n(i).lastNotifiedWidth === void 0;
1133
- }
1134
- h("notifyListenersIfNeeded invoked");
1135
- var x = n(i);
1136
- if (W() && x.lastWidth === x.startSize.width && x.lastHeight === x.startSize.height)
1137
- return h("Not notifying: Size is the same as the start size, and there has been no notification yet.");
1138
- if (x.lastWidth === x.lastNotifiedWidth && x.lastHeight === x.lastNotifiedHeight)
1139
- return h("Not notifying: Size already notified");
1140
- h("Current size not notified, notifying..."), x.lastNotifiedWidth = x.lastWidth, x.lastNotifiedHeight = x.lastHeight, e(n(i).listeners, function(q) {
1141
- q(i);
1142
- });
1143
- }
1144
- function K() {
1145
- if (h("startanimation triggered."), z(i)) {
1146
- h("Ignoring since element is still unrendered...");
1147
- return;
1148
- }
1149
- h("Element rendered.");
1150
- var W = b(i), x = P(i);
1151
- (W.scrollLeft === 0 || W.scrollTop === 0 || x.scrollLeft === 0 || x.scrollTop === 0) && (h("Scrollbars out of sync. Updating detector elements..."), m(N));
1152
- }
1153
- function de() {
1154
- if (h("Scroll detected."), z(i)) {
1155
- h("Scroll event fired while unrendered. Ignoring...");
1156
- return;
1157
- }
1158
- m(N);
1159
- }
1160
- if (h("registerListenersAndPositionElements invoked."), !n(i)) {
1161
- h("Aborting because element has been uninstalled");
1162
- return;
1163
- }
1164
- n(i).onRendered = K, n(i).onExpand = de, n(i).onShrink = de;
1165
- var fe = n(i).style;
1166
- c(i, fe.width, fe.height);
1167
- }
1168
- function O() {
1169
- if (h("finalizeDomMutation invoked."), !n(i)) {
1170
- h("Aborting because element has been uninstalled");
1171
- return;
1172
- }
1173
- var c = n(i).style;
1174
- U(i, c.width, c.height), le(i, c.width, c.height);
1175
- }
1176
- function T() {
1177
- k(i);
1178
- }
1179
- function ue() {
1180
- h("Installing..."), E(), M(), o.add(0, V), o.add(1, G), o.add(2, te), o.add(3, O), o.add(4, T);
1181
- }
1182
- h("Making detectable..."), _(i) ? (h("Element is detached"), ce(), h("Waiting until element is attached..."), n(i).onRendered = function() {
1183
- h("Element is now attached"), ue();
1184
- }) : ue();
1185
- }
1186
- function ve(p) {
1187
- var i = n(p);
1188
- i && (i.onExpandScroll && y(b(p), "scroll", i.onExpandScroll), i.onShrinkScroll && y(P(p), "scroll", i.onShrinkScroll), i.onAnimationStart && y(i.container, "animationstart", i.onAnimationStart), i.container && p.removeChild(i.container));
1189
- }
1190
- return {
1191
- makeDetectable: D,
1192
- addListener: B,
1193
- uninstall: ve,
1194
- initDocument: l
1195
- };
1196
- }, Me;
1197
- }
1198
- var Ne, mt;
1199
- function Nn() {
1200
- if (mt) return Ne;
1201
- mt = 1;
1202
- var e = It().forEach, t = Tn(), r = On(), o = jn(), n = zn(), s = An(), a = Lt(), u = Bn(), d = Rn(), l = Wn(), f = Mn();
1203
- function v(y) {
1204
- return Array.isArray(y) || y.length !== void 0;
1205
- }
1206
- function g(y) {
1207
- if (Array.isArray(y))
1208
- return y;
1209
- var b = [];
1210
- return e(y, function(P) {
1211
- b.push(P);
1212
- }), b;
1213
- }
1214
- function H(y) {
1215
- return y && y.nodeType === 1;
1216
- }
1217
- Ne = function(y) {
1218
- y = y || {};
1219
- var b;
1220
- if (y.idHandler)
1221
- b = {
1222
- get: function(C) {
1223
- return y.idHandler.get(C, !0);
1224
- },
1225
- set: y.idHandler.set
1226
- };
1227
- else {
1228
- var P = o(), B = n({
1229
- idGenerator: P,
1230
- stateHandler: d
1231
- });
1232
- b = B;
1233
- }
1234
- var D = y.reporter;
1235
- if (!D) {
1236
- var ve = D === !1;
1237
- D = s(ve);
1238
- }
1239
- var p = w(y, "batchProcessor", u({ reporter: D })), i = {};
1240
- i.callOnAdd = !!w(y, "callOnAdd", !0), i.debug = !!w(y, "debug", !1);
1241
- var k = r(b), h = t({
1242
- stateHandler: d
1243
- }), _, z = w(y, "strategy", "object"), I = w(y, "important", !1), M = {
1244
- reporter: D,
1245
- batchProcessor: p,
1246
- stateHandler: d,
1247
- idHandler: b,
1248
- important: I
1249
- };
1250
- if (z === "scroll" && (a.isLegacyOpera() ? (D.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."), z = "object") : a.isIE(9) && (D.warn("Scroll strategy is not supported on IE9. Changing to object strategy."), z = "object")), z === "scroll")
1251
- _ = f(M);
1252
- else if (z === "object")
1253
- _ = l(M);
1254
- else
1255
- throw new Error("Invalid strategy name: " + z);
1256
- var E = {};
1257
- function V(C, L, Q) {
1258
- function ge(te) {
1259
- var O = k.get(te);
1260
- e(O, function(ue) {
1261
- ue(te);
1262
- });
1263
- }
1264
- function ye(te, O, T) {
1265
- k.add(O, T), te && T(O);
1266
- }
1267
- if (Q || (Q = L, L = C, C = {}), !L)
1268
- throw new Error("At least one element required.");
1269
- if (!Q)
1270
- throw new Error("Listener required.");
1271
- if (H(L))
1272
- L = [L];
1273
- else if (v(L))
1274
- L = g(L);
1275
- else
1276
- return D.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
1277
- var ee = 0, le = w(C, "callOnAdd", i.callOnAdd), ce = w(C, "onReady", function() {
1278
- }), G = w(C, "debug", i.debug);
1279
- e(L, function(O) {
1280
- d.getState(O) || (d.initState(O), b.set(O));
1281
- var T = b.get(O);
1282
- if (G && D.log("Attaching listener to element", T, O), !h.isDetectable(O)) {
1283
- if (G && D.log(T, "Not detectable."), h.isBusy(O)) {
1284
- G && D.log(T, "System busy making it detectable"), ye(le, O, Q), E[T] = E[T] || [], E[T].push(function() {
1285
- ee++, ee === L.length && ce();
1286
- });
1287
- return;
1288
- }
1289
- return G && D.log(T, "Making detectable..."), h.markBusy(O, !0), _.makeDetectable({ debug: G, important: I }, O, function(c) {
1290
- if (G && D.log(T, "onElementDetectable"), d.getState(c)) {
1291
- h.markAsDetectable(c), h.markBusy(c, !1), _.addListener(c, ge), ye(le, c, Q);
1292
- var m = d.getState(c);
1293
- if (m && m.startSize) {
1294
- var S = c.offsetWidth, N = c.offsetHeight;
1295
- (m.startSize.width !== S || m.startSize.height !== N) && ge(c);
1296
- }
1297
- E[T] && e(E[T], function(K) {
1298
- K();
1299
- });
1300
- } else
1301
- G && D.log(T, "Element uninstalled before being detectable.");
1302
- delete E[T], ee++, ee === L.length && ce();
1303
- });
1304
- }
1305
- G && D.log(T, "Already detecable, adding listener."), ye(le, O, Q), ee++;
1306
- }), ee === L.length && ce();
1307
- }
1308
- function U(C) {
1309
- if (!C)
1310
- return D.error("At least one element is required.");
1311
- if (H(C))
1312
- C = [C];
1313
- else if (v(C))
1314
- C = g(C);
1315
- else
1316
- return D.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
1317
- e(C, function(L) {
1318
- k.removeAllListeners(L), _.uninstall(L), d.cleanState(L);
1319
- });
1320
- }
1321
- function me(C) {
1322
- _.initDocument && _.initDocument(C);
1323
- }
1324
- return {
1325
- listenTo: V,
1326
- removeListener: k.removeListener,
1327
- removeAllListeners: k.removeAllListeners,
1328
- uninstall: U,
1329
- initDocument: me
1330
- };
1331
- };
1332
- function w(y, b, P) {
1333
- var B = y[b];
1334
- return B == null && P !== void 0 ? P : B;
1335
- }
1336
- return Ne;
1337
- }
1338
- var qn = Nn();
1339
- const Fn = /* @__PURE__ */ Kt(qn), Vn = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
1340
- __name: "WithDimensions",
1341
- props: { provideDevice: Boolean },
1342
- emits: ["width", "height", "resize"],
1343
- setup(e, { emit: t }) {
1344
- window.elementResizeDetectorMaker || (window.elementResizeDetectorMaker = Fn({
1345
- strategy: "scroll"
1346
- }));
1347
- const r = e, o = t, n = (l) => l <= 640 ? "mobile" : l <= 1024 ? "tablet" : "desktop", s = re(null), a = re(null), u = re({ device: "desktop" }), d = Yt();
1348
- return r.provideDevice && (gt("containerType", u), Qe(s, (l) => {
1349
- u.value.device = n(l);
1350
- })), bt(() => {
1351
- var v;
1352
- const l = (v = d.value) == null ? void 0 : v.nextElementSibling;
1353
- if (!l) return;
1354
- const f = () => {
1355
- s.value = l.offsetWidth, a.value = l.offsetHeight, o("width", l.offsetWidth), o("height", l.offsetHeight), o("resize");
1356
- };
1357
- window.elementResizeDetectorMaker.listenTo(l, f), s.value = l.offsetWidth, a.value = l.offsetHeight, Jt(() => {
1358
- window.elementResizeDetectorMaker.uninstall(l);
1359
- });
1360
- }), (l, f) => Ce(l.$slots, "default", {
1361
- width: s.value,
1362
- height: a.value
1363
- });
1364
- }
1365
- }), $n = {
1366
- name: "DocumentLayout",
1367
- components: {
1368
- DynamicChapter: xt,
1369
- DocumentStyleContainer: Pn,
1370
- WithDimensions: Vn
1371
- },
1372
- props: {
1373
- document: {
1374
- type: Object,
1375
- required: !0
1376
- }
1377
- },
1378
- computed: {
1379
- layout() {
1380
- var e;
1381
- return ((e = this.document) == null ? void 0 : e.readLayout) || [];
1382
- }
1383
- }
1384
- }, Un = { class: "font-family-default h-full w-full" };
1385
- function Gn(e, t, r, o, n, s) {
1386
- const a = ne("DynamicChapter"), u = ne("DocumentStyleContainer"), d = ne("WithDimensions");
1387
- return A(), ie("div", Un, [
1388
- xe(d, { "provide-device": !0 }, {
1389
- default: $(() => {
1390
- var l, f;
1391
- return [
1392
- xe(u, {
1393
- "input-style": (f = (l = r.document) == null ? void 0 : l.data) == null ? void 0 : f.css,
1394
- style: { flex: "1 0 auto" },
1395
- class: "h-full w-full"
1396
- }, {
1397
- default: $(() => [
1398
- (A(!0), ie($e, null, Ve(s.layout, (v, g) => (A(), X(a, {
1399
- key: g,
1400
- "component-name": v.componentName,
1401
- "component-props": {
1402
- ...v.props,
1403
- _document: r.document,
1404
- _value: v.value
1405
- },
1406
- children: v.children,
1407
- "_first-block": g === 0,
1408
- "_last-block": g === s.layout.length - 1
1409
- }, null, 8, ["component-name", "component-props", "children", "_first-block", "_last-block"]))), 128))
1410
- ]),
1411
- _: 1
1412
- }, 8, ["input-style"])
1413
- ];
1414
- }),
1415
- _: 1
1416
- })
1417
- ]);
1418
- }
1419
- const Qn = /* @__PURE__ */ ke($n, [["render", Gn]]), rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1420
- __proto__: null,
1421
- default: Qn
1422
- }, Symbol.toStringTag, { value: "Module" }));
1423
- export {
1424
- Qn as D,
1425
- tr as F,
1426
- Pn as _,
1427
- Vn as a,
1428
- xt as b,
1429
- rr as c,
1430
- er as g,
1431
- nr as i,
1432
- _t as l,
1433
- ln as u
1434
- };