@famibee/skynovel 1.64.8 → 1.64.10

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 (219) hide show
  1. package/README.md +1 -1
  2. package/dist/Button.js +162 -0
  3. package/dist/Button.js.map +1 -0
  4. package/dist/CallStack.js.map +1 -1
  5. package/dist/CmnTween.js +201 -0
  6. package/dist/CmnTween.js.map +1 -0
  7. package/dist/DebugMng.js +105 -0
  8. package/dist/DebugMng.js.map +1 -0
  9. package/dist/EventMng.js +40 -39
  10. package/dist/EventMng.js.map +1 -1
  11. package/dist/GrpLayer.js +192 -0
  12. package/dist/GrpLayer.js.map +1 -0
  13. package/dist/LayerMng.js +483 -2422
  14. package/dist/LayerMng.js.map +1 -1
  15. package/dist/Main.js +394 -0
  16. package/dist/Main.js.map +1 -0
  17. package/dist/PropParser.js +1 -1
  18. package/dist/PropParser.js.map +1 -1
  19. package/dist/Reading.js +11 -11
  20. package/dist/Reading.js.map +1 -1
  21. package/dist/RubySpliter.js +90 -0
  22. package/dist/RubySpliter.js.map +1 -0
  23. package/dist/ScriptIterator.js +263 -353
  24. package/dist/ScriptIterator.js.map +1 -1
  25. package/dist/SndBuf.js +746 -949
  26. package/dist/SndBuf.js.map +1 -1
  27. package/dist/SoundMng.js +1 -1
  28. package/dist/SoundMng.js.map +1 -1
  29. package/dist/SpritesMng.js +229 -0
  30. package/dist/SpritesMng.js.map +1 -0
  31. package/dist/TxtLayer.js +1402 -0
  32. package/dist/TxtLayer.js.map +1 -0
  33. package/dist/Variable.js +157 -164
  34. package/dist/Variable.js.map +1 -1
  35. package/dist/app.d.ts +4 -4
  36. package/dist/app.d.ts.map +1 -1
  37. package/dist/appMain.d.ts.map +1 -1
  38. package/dist/appMain_cmn.d.ts.map +1 -1
  39. package/dist/index.d.ts +0 -1
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/platform.js +369 -0
  42. package/dist/platform.js.map +1 -0
  43. package/dist/sn/Button.d.ts +2 -2
  44. package/dist/sn/CallStack.d.ts +2 -2
  45. package/dist/sn/CmnInterface.d.ts +39 -41
  46. package/dist/sn/CmnInterface.d.ts.map +1 -1
  47. package/dist/sn/CmnLib.d.ts +11 -7
  48. package/dist/sn/CmnLib.d.ts.map +1 -1
  49. package/dist/sn/CmnTween.d.ts +9 -9
  50. package/dist/sn/Config.d.ts.map +1 -1
  51. package/dist/sn/ConfigBase.d.ts +16 -17
  52. package/dist/sn/ConfigBase.d.ts.map +1 -1
  53. package/dist/sn/DebugMng.d.ts +2 -2
  54. package/dist/sn/DebugMng.d.ts.map +1 -1
  55. package/dist/sn/DesignCast.d.ts +9 -9
  56. package/dist/sn/DesignCast.d.ts.map +1 -1
  57. package/dist/sn/EventMng.d.ts +4 -4
  58. package/dist/sn/EventMng.d.ts.map +1 -1
  59. package/dist/sn/FrameMng.d.ts +5 -5
  60. package/dist/sn/FrameMng.d.ts.map +1 -1
  61. package/dist/sn/Grammar.d.ts +124 -124
  62. package/dist/sn/Grammar.d.ts.map +1 -1
  63. package/dist/sn/GrpLayer.d.ts +7 -7
  64. package/dist/sn/GrpLayer.d.ts.map +1 -1
  65. package/dist/sn/Hyphenation.d.ts +2 -2
  66. package/dist/sn/Layer.d.ts +10 -10
  67. package/dist/sn/LayerMng.d.ts +7 -8
  68. package/dist/sn/LayerMng.d.ts.map +1 -1
  69. package/dist/sn/Log.d.ts +3 -3
  70. package/dist/sn/Log.d.ts.map +1 -1
  71. package/dist/sn/Main.d.ts +6 -5
  72. package/dist/sn/Main.d.ts.map +1 -1
  73. package/dist/sn/Pages.d.ts +8 -8
  74. package/dist/sn/Pages.d.ts.map +1 -1
  75. package/dist/sn/PropParser.d.ts +3 -3
  76. package/dist/sn/PropParser.d.ts.map +1 -1
  77. package/dist/sn/Reading.d.ts +12 -12
  78. package/dist/sn/Reading.d.ts.map +1 -1
  79. package/dist/sn/RubySpliter.d.ts +4 -4
  80. package/dist/sn/RubySpliter.d.ts.map +1 -1
  81. package/dist/sn/ScriptIterator.d.ts +5 -6
  82. package/dist/sn/ScriptIterator.d.ts.map +1 -1
  83. package/dist/sn/SndBuf.d.ts +12 -12
  84. package/dist/sn/SndBuf.d.ts.map +1 -1
  85. package/dist/sn/SoundMng.d.ts +4 -4
  86. package/dist/sn/SoundMng.d.ts.map +1 -1
  87. package/dist/sn/SpritesMng.d.ts +5 -5
  88. package/dist/sn/SpritesMng.d.ts.map +1 -1
  89. package/dist/sn/SysApp.d.ts +13 -10
  90. package/dist/sn/SysApp.d.ts.map +1 -1
  91. package/dist/sn/SysBase.d.ts +33 -32
  92. package/dist/sn/SysBase.d.ts.map +1 -1
  93. package/dist/sn/SysWeb.d.ts +7 -11
  94. package/dist/sn/SysWeb.d.ts.map +1 -1
  95. package/dist/sn/TxtLayer.d.ts +10 -8
  96. package/dist/sn/TxtLayer.d.ts.map +1 -1
  97. package/dist/sn/TxtStage.d.ts +5 -5
  98. package/dist/sn/TxtStage.d.ts.map +1 -1
  99. package/dist/sn/Variable.d.ts +9 -8
  100. package/dist/sn/Variable.d.ts.map +1 -1
  101. package/dist/test/SysTest.d.ts +2 -2
  102. package/dist/test/ValTest.d.ts +4 -4
  103. package/dist/test/ValTest.d.ts.map +1 -1
  104. package/dist/web.d.ts +4 -4
  105. package/dist/web.d.ts.map +1 -1
  106. package/dist/web.js +3 -3
  107. package/dist/web2.js +6959 -8339
  108. package/dist/web2.js.map +1 -1
  109. package/dist_app/Button.js +162 -0
  110. package/dist_app/Button.js.map +1 -0
  111. package/dist_app/CallStack.js.map +1 -1
  112. package/dist_app/CmnTween.js +201 -0
  113. package/dist_app/CmnTween.js.map +1 -0
  114. package/dist_app/EventMng.js +40 -39
  115. package/dist_app/EventMng.js.map +1 -1
  116. package/dist_app/GrpLayer.js +192 -0
  117. package/dist_app/GrpLayer.js.map +1 -0
  118. package/dist_app/LayerMng.js +483 -2422
  119. package/dist_app/LayerMng.js.map +1 -1
  120. package/dist_app/Main.js +393 -0
  121. package/dist_app/Main.js.map +1 -0
  122. package/dist_app/PropParser.js.map +1 -1
  123. package/dist_app/Reading.js +19 -19
  124. package/dist_app/Reading.js.map +1 -1
  125. package/dist_app/RubySpliter.js +90 -0
  126. package/dist_app/RubySpliter.js.map +1 -0
  127. package/dist_app/ScriptIterator.js +216 -307
  128. package/dist_app/ScriptIterator.js.map +1 -1
  129. package/dist_app/SndBuf.js +746 -949
  130. package/dist_app/SndBuf.js.map +1 -1
  131. package/dist_app/SoundMng.js +1 -1
  132. package/dist_app/SoundMng.js.map +1 -1
  133. package/dist_app/SpritesMng.js +228 -0
  134. package/dist_app/SpritesMng.js.map +1 -0
  135. package/dist_app/TxtLayer.js +1401 -0
  136. package/dist_app/TxtLayer.js.map +1 -0
  137. package/dist_app/Variable.js +157 -164
  138. package/dist_app/Variable.js.map +1 -1
  139. package/dist_app/app.d.ts +4 -4
  140. package/dist_app/app.d.ts.map +1 -1
  141. package/dist_app/app.js +2 -2
  142. package/dist_app/app2.js +3075 -4351
  143. package/dist_app/app2.js.map +1 -1
  144. package/dist_app/appMain.d.ts.map +1 -1
  145. package/dist_app/appMain.js +18 -18
  146. package/dist_app/appMain.js.map +1 -1
  147. package/dist_app/appMain_cmn.d.ts.map +1 -1
  148. package/dist_app/index.d.ts +0 -1
  149. package/dist_app/index.d.ts.map +1 -1
  150. package/dist_app/platform.js +369 -0
  151. package/dist_app/platform.js.map +1 -0
  152. package/dist_app/sn/Button.d.ts +2 -2
  153. package/dist_app/sn/CallStack.d.ts +2 -2
  154. package/dist_app/sn/CmnInterface.d.ts +39 -41
  155. package/dist_app/sn/CmnInterface.d.ts.map +1 -1
  156. package/dist_app/sn/CmnLib.d.ts +11 -7
  157. package/dist_app/sn/CmnLib.d.ts.map +1 -1
  158. package/dist_app/sn/CmnTween.d.ts +9 -9
  159. package/dist_app/sn/Config.d.ts.map +1 -1
  160. package/dist_app/sn/ConfigBase.d.ts +16 -17
  161. package/dist_app/sn/ConfigBase.d.ts.map +1 -1
  162. package/dist_app/sn/DebugMng.d.ts +2 -2
  163. package/dist_app/sn/DebugMng.d.ts.map +1 -1
  164. package/dist_app/sn/DesignCast.d.ts +9 -9
  165. package/dist_app/sn/DesignCast.d.ts.map +1 -1
  166. package/dist_app/sn/EventMng.d.ts +4 -4
  167. package/dist_app/sn/EventMng.d.ts.map +1 -1
  168. package/dist_app/sn/FrameMng.d.ts +5 -5
  169. package/dist_app/sn/FrameMng.d.ts.map +1 -1
  170. package/dist_app/sn/Grammar.d.ts +124 -124
  171. package/dist_app/sn/Grammar.d.ts.map +1 -1
  172. package/dist_app/sn/GrpLayer.d.ts +7 -7
  173. package/dist_app/sn/GrpLayer.d.ts.map +1 -1
  174. package/dist_app/sn/Hyphenation.d.ts +2 -2
  175. package/dist_app/sn/Layer.d.ts +10 -10
  176. package/dist_app/sn/LayerMng.d.ts +7 -8
  177. package/dist_app/sn/LayerMng.d.ts.map +1 -1
  178. package/dist_app/sn/Log.d.ts +3 -3
  179. package/dist_app/sn/Log.d.ts.map +1 -1
  180. package/dist_app/sn/Main.d.ts +6 -5
  181. package/dist_app/sn/Main.d.ts.map +1 -1
  182. package/dist_app/sn/Pages.d.ts +8 -8
  183. package/dist_app/sn/Pages.d.ts.map +1 -1
  184. package/dist_app/sn/PropParser.d.ts +3 -3
  185. package/dist_app/sn/PropParser.d.ts.map +1 -1
  186. package/dist_app/sn/Reading.d.ts +12 -12
  187. package/dist_app/sn/Reading.d.ts.map +1 -1
  188. package/dist_app/sn/RubySpliter.d.ts +4 -4
  189. package/dist_app/sn/RubySpliter.d.ts.map +1 -1
  190. package/dist_app/sn/ScriptIterator.d.ts +5 -6
  191. package/dist_app/sn/ScriptIterator.d.ts.map +1 -1
  192. package/dist_app/sn/SndBuf.d.ts +12 -12
  193. package/dist_app/sn/SndBuf.d.ts.map +1 -1
  194. package/dist_app/sn/SoundMng.d.ts +4 -4
  195. package/dist_app/sn/SoundMng.d.ts.map +1 -1
  196. package/dist_app/sn/SpritesMng.d.ts +5 -5
  197. package/dist_app/sn/SpritesMng.d.ts.map +1 -1
  198. package/dist_app/sn/SysApp.d.ts +13 -10
  199. package/dist_app/sn/SysApp.d.ts.map +1 -1
  200. package/dist_app/sn/SysBase.d.ts +33 -32
  201. package/dist_app/sn/SysBase.d.ts.map +1 -1
  202. package/dist_app/sn/SysWeb.d.ts +7 -11
  203. package/dist_app/sn/SysWeb.d.ts.map +1 -1
  204. package/dist_app/sn/TxtLayer.d.ts +10 -8
  205. package/dist_app/sn/TxtLayer.d.ts.map +1 -1
  206. package/dist_app/sn/TxtStage.d.ts +5 -5
  207. package/dist_app/sn/TxtStage.d.ts.map +1 -1
  208. package/dist_app/sn/Variable.d.ts +9 -8
  209. package/dist_app/sn/Variable.d.ts.map +1 -1
  210. package/dist_app/test/SysTest.d.ts +2 -2
  211. package/dist_app/test/ValTest.d.ts +4 -4
  212. package/dist_app/test/ValTest.d.ts.map +1 -1
  213. package/dist_app/web.d.ts +4 -4
  214. package/dist_app/web.d.ts.map +1 -1
  215. package/package.json +7 -7
  216. package/dist/sn/SysNode.d.ts +0 -15
  217. package/dist/sn/SysNode.d.ts.map +0 -1
  218. package/dist_app/sn/SysNode.d.ts +0 -15
  219. package/dist_app/sn/SysNode.d.ts.map +0 -1
package/dist/LayerMng.js CHANGED
@@ -1,25 +1,30 @@
1
- import { e as R, T as ct, L as Q, B as St, m as Z, o as D, i as bt, p as J, D as it, q as Rt, R as Y, A as gt, r as j, s as H, d as w, E as kt, g as S, t as tt, C as W, G as U, u as V, v as Tt, n as dt, w as Pt, x as Ft, h as ot, y as vt, z as Ot, F as Bt, P as It, H as _t, I as Vt, J as jt } from "./web2.js";
2
- import { C as B, T as xt, b as A } from "./SndBuf.js";
3
- import { a as F, T as Dt } from "./Reading.js";
4
- import { R as wt, a as pt } from "./ScriptIterator.js";
5
- class et {
6
- constructor(t, e, s, i, n, a, o, r) {
7
- this.cls = e, this.hArg = n, this.sys = a, this.val = o, this.ret = r;
8
- const c = a.hFactoryCls[e];
9
- if (!c) throw `属性 class【${e}】が不正です`;
10
- const f = c(), l = c();
11
- f.layname = l.layname = t;
1
+ import { e as w, S as H, L as F, n as D, l as v, a as x, p as A, G, q as U, E as tt, f as et, r as st, t as it, v as B, w as at, x as q, y as nt, F as rt, u as W, z as Y } from "./web2.js";
2
+ import { C as _, T as J, a as P } from "./CmnTween.js";
3
+ import { G as X, D as K } from "./GrpLayer.js";
4
+ import { S as I } from "./SpritesMng.js";
5
+ import { T as $, a as ot } from "./TxtLayer.js";
6
+ import { R as ct } from "./RubySpliter.js";
7
+ import { P as lt, b as Q } from "./Main.js";
8
+ import { a as C } from "./Reading.js";
9
+ import { Button as Z } from "./Button.js";
10
+ class R {
11
+ constructor(t, e, s, i, n, o, r, l) {
12
+ this.cls = e, this.hArg = n, this.sys = o, this.val = r, this.ret = l;
13
+ const f = o.hFactoryCls[e];
14
+ if (!f) throw `属性 class【${e}】が不正です`;
15
+ const d = f(), h = f();
16
+ d.layname = h.layname = t;
12
17
  const p = n[":id_tag"] = `layer:${t} cls:${e} page:`;
13
- f.ctn.name = f.name = p + "A", l.ctn.name = l.name = p + "B", s.addChild(f.ctn), i.addChild(l.ctn), R(n, "visible", !0), R(n, "visible", !0), r.isWait = f.lay(n) || l.lay(n), this.#s = { fore: f, back: l }, i.visible = !1;
14
- const d = `const.sn.lay.${t}`;
15
- o.setVal_Nochk("tmp", d, !0), o.defTmp(d + ".fore.alpha", () => this.#s.fore.alpha), o.defTmp(d + ".back.alpha", () => this.#s.back.alpha), o.defTmp(d + ".fore.height", () => this.#s.fore.height), o.defTmp(d + ".back.height", () => this.#s.back.height), o.defTmp(d + ".fore.visible", () => this.#s.fore.ctn.visible), o.defTmp(d + ".back.visible", () => this.#s.back.ctn.visible), o.defTmp(d + ".fore.width", () => this.#s.fore.width), o.defTmp(d + ".back.width", () => this.#s.back.width), o.defTmp(d + ".fore.x", () => this.#s.fore.x), o.defTmp(d + ".back.x", () => this.#s.back.x), o.defTmp(d + ".fore.y", () => this.#s.fore.y), o.defTmp(d + ".back.y", () => this.#s.back.y);
18
+ d.ctn.name = d.name = p + "A", h.ctn.name = h.name = p + "B", s.addChild(d.ctn), i.addChild(h.ctn), w(n, "visible", !0), w(n, "visible", !0), l.isWait = d.lay(n) || h.lay(n), this.#e = { fore: d, back: h }, i.visible = !1;
19
+ const c = `const.sn.lay.${t}`;
20
+ r.setVal_Nochk("tmp", c, !0), r.defTmp(c + ".fore.alpha", () => this.#e.fore.alpha), r.defTmp(c + ".back.alpha", () => this.#e.back.alpha), r.defTmp(c + ".fore.height", () => this.#e.fore.height), r.defTmp(c + ".back.height", () => this.#e.back.height), r.defTmp(c + ".fore.visible", () => this.#e.fore.ctn.visible), r.defTmp(c + ".back.visible", () => this.#e.back.ctn.visible), r.defTmp(c + ".fore.width", () => this.#e.fore.width), r.defTmp(c + ".back.width", () => this.#e.back.width), r.defTmp(c + ".fore.x", () => this.#e.fore.x), r.defTmp(c + ".back.x", () => this.#e.back.x), r.defTmp(c + ".fore.y", () => this.#e.fore.y), r.defTmp(c + ".back.y", () => this.#e.back.y);
16
21
  }
17
- #s;
22
+ #e;
18
23
  destroy() {
19
- this.#s.fore.destroy(), this.#s.back.destroy();
24
+ this.#e.fore.destroy(), this.#e.back.destroy();
20
25
  }
21
26
  lay = (t) => this.getPage(t).lay(t);
22
- getPage = (t) => et.argChk_page(t, "fore") !== "back" ? this.#s.fore : this.#s.back;
27
+ getPage = (t) => R.argChk_page(t, "fore") !== "back" ? this.#e.fore : this.#e.back;
23
28
  static argChk_page(t, e) {
24
29
  const s = t.page ?? e;
25
30
  if (s === "fore" || s === "back")
@@ -27,2077 +32,143 @@ class et {
27
32
  throw Error("属性 page【" + s + "】が不正です");
28
33
  }
29
34
  get fore() {
30
- return this.#s.fore;
35
+ return this.#e.fore;
31
36
  }
32
37
  get back() {
33
- return this.#s.back;
38
+ return this.#e.back;
34
39
  }
35
40
  transPage(t) {
36
- [this.#s.back, this.#s.fore] = [this.#s.fore, this.#s.back], this.#s.back.copy(this.#s.fore, t);
41
+ [this.#e.back, this.#e.fore] = [this.#e.fore, this.#e.back], this.#e.back.copy(this.#e.fore, t);
37
42
  }
38
43
  }
39
- class ut {
40
- // static readonly #alzTagArg = new AnalyzeTagArg;
41
- constructor(t, e = !1) {
42
- this.bg_col = t, this.isLay = e;
43
- }
44
- static init(t, e, s, i, n, a) {
45
- }
46
- static cvsResizeDesign() {
47
- }
48
- destroy() {
49
- }
50
- gethArg() {
51
- return this.hArg;
52
- }
53
- hArg = {};
54
- sethArg(t) {
55
- this.hArg = t;
56
- }
57
- setOther(t) {
58
- }
59
- adopt(t) {
60
- }
61
- static enterMode() {
62
- }
63
- static allHide() {
64
- }
65
- set visible(t) {
66
- }
67
- static leaveMode() {
68
- }
69
- cvsResize() {
70
- }
71
- make() {
72
- }
73
- static replaceToken(t) {
74
- }
75
- }
76
- class Ht extends ut {
77
- constructor(t, e) {
78
- super("#29e", !0);
79
- }
80
- setSp(t) {
81
- }
82
- }
83
- class m {
84
- constructor(t = "", e, s = () => {
85
- }, i = () => {
86
- }) {
87
- this.csvFn = t, this.ctn = e, this.fncFirstComp = s, this.fncAllComp = i, t && (this.#u = e ? (n) => {
88
- e.addChild(n), this.#c.push(n);
89
- } : () => {
90
- }, this.ret = m.#x(
91
- t,
92
- (n) => this.fncFirstComp(n),
93
- // 差し替え考慮
94
- (n) => this.fncAllComp(n),
95
- // 差し替え考慮
96
- (n) => this.#u(n)
97
- // 差し替え考慮
98
- ));
99
- }
100
- static #s;
101
- static #e;
102
- static #n;
103
- static #r;
104
- static init(t, e, s, i, n) {
105
- m.#s = t, m.#e = e, m.#n = s, m.#r = i, s.arg.crypto && (m.#f = (o, r, c) => m.#a(o, r, c), m.#o = (o, r, c) => m.#I(o, r, c));
106
- const a = () => {
107
- const o = m.#l * m.#t;
108
- for (const r of Object.values(m.#w)) r.volume = o;
109
- };
110
- n.setNoticeChgVolume(
111
- (o) => {
112
- m.#l = o, a();
113
- },
114
- (o) => {
115
- m.#t = o, a();
116
- }
117
- );
118
- }
119
- static #t = 1;
120
- static #l = 1;
121
- static #p;
122
- static setEvtMng(t) {
123
- m.#p = t;
124
- }
125
- ret = !1;
126
- #u;
127
- #c = [];
128
- destroy() {
129
- this.fncFirstComp = () => {
130
- }, this.fncAllComp = () => {
131
- }, this.#u = (t) => t.destroy();
132
- for (const t of this.#c)
133
- m.stopVideo(t.name), t.parent?.removeChild(t), t.destroy();
134
- this.#c = [];
135
- }
136
- static destroy() {
137
- m.#i = {}, m.#d = {}, m.#w = {};
138
- }
139
- //static #ldrHFn: {[fn: string]: 1} = {};
140
- static #x(t, e, s, i) {
141
- if (!t) return !1;
142
- let n = !1;
143
- if (t.startsWith("data:")) {
144
- const l = () => {
145
- const p = j.from(t);
146
- i(p), e(p), s(n);
147
- };
148
- return t in ct ? l() : (n = !0, new Q().add(t, t).load(l)), n;
149
- }
150
- const a = [], o = new Q(), r = t.split(","), c = r.length;
151
- for (let l = 0; l < c; ++l) {
152
- const p = r[l];
153
- if (!p) throw "face属性に空要素が含まれます";
154
- const { dx: d, dy: h, blendmode: u, fn: x } = m.#i[p] ?? {
155
- fn: p,
156
- dx: 0,
157
- dy: 0,
158
- blendmode: St.NORMAL
159
- }, v = l === 0 ? e : (E) => {
160
- E.transform && (E.x = d, E.y = h, E.blendMode = u);
161
- };
162
- if (a.push({ fn: x, fnc: v }), x in m.#d || x in ct || x in Q.shared.resources) continue;
163
- n = !0;
164
- const y = m.#s.searchPath(x, Z.SP_GSM), b = this.#n.arg.crypto ? { xhrType: y.endsWith(".json") ? D.XHR_RESPONSE_TYPE.TEXT : D.XHR_RESPONSE_TYPE.BUFFER } : {};
165
- o.add({ ...b, name: x, url: y });
166
- }
167
- const f = (l, p) => {
168
- for (const { fn: d, fnc: h } of a) {
169
- const u = m.#k(d, p);
170
- u.name = d, i(u), h(u);
171
- }
172
- s(n);
173
- };
174
- return n ? o.use((l, p) => {
175
- try {
176
- if (l.extension === "json") {
177
- this.#n.dec("json", l.data).then((d) => m.#o(d, l, p));
178
- return;
179
- }
180
- this.#n.decAB(l.data).then((d) => m.#f(d, l, p));
181
- } catch (d) {
182
- const h = `画像/動画ロード失敗です fn:${l.name} ${String(d)}`;
183
- m.#p.isSkipping ? console.warn(h) : console.error("%c" + h, "color:#FF3300;");
184
- }
185
- }).load(f) : queueMicrotask(() => f(0, {})), n;
186
- }
187
- static #i = {};
188
- static #d = {};
189
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
190
- static #f = (t, { type: e, name: s, data: i }, n) => {
191
- switch (e) {
192
- case D.TYPE.VIDEO: {
193
- const a = i;
194
- a.volume = m.#l, m.#w[s] = m.#g(a);
195
- }
196
- }
197
- n();
198
- };
199
- static #y(t) {
200
- const e = /([^\d]+)\d+\.(\w+)/.exec(t[0] ?? "");
201
- if (!e) return [];
202
- const [, s = "", i = ""] = e, n = s.length, a = -i.length - 1;
203
- return t.sort((o, r) => bt(o.slice(n, a)) > bt(r.slice(n, a)) ? 1 : -1);
204
- }
205
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
206
- static #a(t, e, s) {
207
- if (e.data = t, e.extension !== "bin" && s(), t instanceof HTMLImageElement) {
208
- J.fromLoader(t, e.url, e.name).then((i) => {
209
- e.texture = i, e.type = D.TYPE.IMAGE;
210
- });
211
- return;
212
- }
213
- t instanceof HTMLVideoElement && (t.volume = m.#l, m.#w[e.name] = m.#g(t), e.type = D.TYPE.VIDEO), s();
214
- }
215
- static #g(t) {
216
- return m.#e.getVal("const.sn.needClick2Play") && (it.trace_beforeNew(`[lay系] ${it.strPos()}未クリック状態で動画を自動再生します。音声はミュートされます`, "W"), t.muted = !0), t.setAttribute("playsinline", ""), t;
217
- }
218
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
219
- static #o = (t, { type: e, spritesheet: s, name: i, data: n }, a) => {
220
- switch (e) {
221
- case D.TYPE.JSON: {
222
- const o = s._frameKeys;
223
- m.#y(o), m.#d[i] = {
224
- aTex: o.map((r) => J.from(r)),
225
- meta: n.meta
226
- };
227
- }
228
- }
229
- a();
230
- };
231
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
232
- static #I(t, e, s) {
233
- const { meta: i, frames: n } = e.data = JSON.parse(t);
234
- if (e.type = D.TYPE.JSON, !i?.image) {
235
- s();
236
- return;
237
- }
238
- const a = Rt(i.image), o = m.#s.searchPath(a, Z.SP_GSM);
239
- new Q().use((r, c) => {
240
- this.#n.decAB(r.data).then((f) => {
241
- r.data = f, f instanceof HTMLImageElement && (r.type = D.TYPE.IMAGE, URL.revokeObjectURL(f.src)), c();
242
- }).catch((f) => this.#r.errScript(`画像/動画ロード失敗です dec2res4Cripto fn:${r.name} ${String(f)}`, !1));
243
- }).add({ name: a, url: o, xhrType: D.XHR_RESPONSE_TYPE.BUFFER }).load((r, c) => {
244
- for (const { data: f } of Object.values(r.resources)) {
245
- const { baseTexture: l } = J.from(f), p = Object.values(n);
246
- m.#d[e.name] = {
247
- aTex: p.map(({ frame: { x: d, y: h, w: u, h: x } }) => new J(
248
- l,
249
- new Y(d, h, u, x)
250
- )),
251
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
252
- meta: i
253
- };
254
- }
255
- s();
256
- });
257
- }
258
- static #k(t, e) {
259
- const s = m.#d[t];
260
- if (s) {
261
- const a = new gt(s.aTex);
262
- return a.animationSpeed = s.meta.animationSpeed ?? 1, a.play(), a;
263
- }
264
- if (t in ct) return j.from(t);
265
- const i = m.#w[t];
266
- if (i) return j.from(i);
267
- const n = e[t];
268
- return n ? new j(n.texture) : new j();
269
- }
270
- static #w = {};
271
- static getHFn2VElm(t) {
272
- return m.#w[t];
273
- }
274
- static wv(t) {
275
- const { fn: e } = t;
276
- if (!e) throw "fnは必須です";
277
- const s = m.#w[e];
278
- if (!s || s.loop) return !1;
279
- if (m.#p.isSkipping || s.ended)
280
- return m.stopVideo(e), !1;
281
- const i = "wv fn:" + e, n = R(t, "stop", !0), a = () => {
282
- n && m.stopVideo(e);
283
- };
284
- return F.beginProc(i, a, !0, a), s.addEventListener("ended", () => F.notifyEndProc(i), { once: !0, passive: !0 }), !0;
285
- }
286
- static stopVideo(t) {
287
- const e = m.#w[t];
288
- e && (delete m.#w[t], e.pause(), e.currentTime = e.duration);
289
- }
290
- static add_face(t) {
291
- const { name: e } = t;
292
- if (!e) throw "nameは必須です";
293
- if (e in m.#i) throw "一つのname(" + e + ")に対して同じ画像を複数割り当てられません";
294
- const { fn: s = e } = t;
295
- return m.#i[e] = {
296
- fn: s,
297
- dx: w(t, "dx", 0),
298
- dy: w(t, "dy", 0),
299
- blendmode: H.getBlendmodeNum(t.blendmode ?? "")
300
- }, !1;
301
- }
302
- // static clearFace2Name(): void {SpritesMng.hFace = {}}
303
- }
304
- class L extends H {
305
- static #s = new kt();
306
- static #e;
307
- static init(t, e, s, i, n, a) {
308
- L.#e = s, m.init(e, a, i, t, n);
309
- }
310
- static destroy() {
311
- L.#s.clear(), m.destroy();
312
- }
313
- #n = new Ht(this.ctn, this);
314
- constructor() {
315
- super(), S.isDbg && (this.#r = (t) => this.#n.setSp(t), this.cvsResize = () => {
316
- super.cvsResize(), this.#n.cvsResize();
317
- });
318
- }
319
- #r = () => {
320
- };
321
- #t = "";
322
- #l = "";
323
- #p = "";
324
- lay = (t) => {
325
- const e = F.procID + `GrpLayer lay name:${this.name_}`, s = this.#u(t, (i) => {
326
- i && F.endProc(e);
327
- });
328
- return s && F.beginProc(e), s;
329
- };
330
- #u(t, e) {
331
- const { fn: s, face: i = "" } = t;
332
- if (this.#n.sethArg(t), !s)
333
- return super.lay(t), this.ctn.children.length > 0 && this.setPos(t), this.#l = "", this.#t = this.#p = i, e(!1), !1;
334
- const n = "fn" in t, a = "face" in t;
335
- return this.clearLay({ clear_filter: R(t, "clear_filter", !0) }), n && (this.#l = s), a && (this.#p = i), super.lay(t), t.dx = 0, t.dy = 0, this.#c.destroy(), this.#c = new m(
336
- this.#t = s + (i ? "," + i : ""),
337
- this.ctn,
338
- (o) => {
339
- ("width" in t || "height" in t) && (o.width = w(t, "width", 0), o.height = w(t, "height", 0)), this.#x = o.width, this.#i = o.height, H.setXY(o, t, this.ctn, !0), H.setBlendmode(this.ctn, t), this.#r(o);
340
- },
341
- (o) => e(o)
342
- ), this.#c.ret;
343
- }
344
- #c = new m();
345
- #x = 0;
346
- #i = 0;
347
- get width() {
348
- return this.#x;
349
- }
350
- get height() {
351
- return this.#i;
352
- }
353
- renderStart() {
354
- this.#f = new j(this.#d), this.#f.visible = !1, this.ctn.addChildAt(this.#f, 0), this.#f.position.set(-this.ctn.x, -this.ctn.y);
355
- let t = () => {
356
- const e = this.ctn.alpha;
357
- this.ctn.alpha = 1;
358
- for (const s of this.ctn.children) s.visible = !0;
359
- this.#f.visible = !1, L.#e.renderer.render(this.ctn, { renderTexture: this.#d }), this.ctn.alpha = e;
360
- for (const s of this.ctn.children) s.visible = !1;
361
- };
362
- if (!this.containMovement) {
363
- const e = t;
364
- t = () => {
365
- t = () => {
366
- }, e();
367
- };
368
- }
369
- this.#y = () => {
370
- t(), this.#f.visible = !0;
371
- }, L.#e.ticker.add(this.#y);
372
- }
373
- #d = tt.create({
374
- width: S.stageW,
375
- height: S.stageH
376
- });
377
- #f = new j();
378
- #y = () => {
379
- };
380
- renderEnd() {
381
- L.#e.ticker.remove(this.#y), this.ctn.removeChild(this.#f);
382
- for (const t of this.ctn.children) t.visible = !0;
383
- this.#f.destroy(!0), this.#d = tt.create({
384
- width: S.stageW,
385
- height: S.stageH
386
- });
387
- }
388
- setPos(t) {
389
- H.setXY(
390
- this.ctn.children[0] ?? this.ctn,
391
- t,
392
- this.ctn,
393
- !0
394
- );
395
- }
396
- // アニメ・動画を含むか
397
- get containMovement() {
398
- if (this.#t === "") return !1;
399
- const t = this.ctn.children;
400
- return this.#t.split(",").some(
401
- (e, s) => t[s] instanceof gt || m.getHFn2VElm(e)
402
- );
403
- }
404
- clearLay(t) {
405
- super.clearLay(t), this.#c.destroy(), this.#l = "", this.#p = "", this.#t = "";
406
- }
407
- record = () => ({
408
- ...super.record(),
409
- sBkFn: this.#l,
410
- sBkFace: this.#p
411
- // idc_hArg : this.#idc.gethArg(),
412
- });
413
- playback(t, e) {
414
- if (super.playback(t, e), t.sBkFn === "" && t.sBkFace === "") {
415
- this.#l = "", this.#p = "";
416
- return;
417
- }
418
- e.push(new Promise((s) => this.#u(
419
- { fn: t.sBkFn, face: t.sBkFace, left: t.x, top: t.y, alpha: t.alpha, blendmode: H.getNum2Blendmode(t.blendMode), rotation: t.rotation, scale_x: t.scale_x, scale_y: t.scale_y },
420
- (i) => {
421
- this.ctn.position.set(t.x, t.y), s();
422
- }
423
- // Layer.setXY()の後に再度移動
424
- )));
425
- }
426
- makeDesignCast(t) {
427
- this.ctn.visible && t(this.#n);
428
- }
429
- //makeDesignCastChildren(_gdc: IMakeDesignCast) {}
430
- cvsResize() {
431
- super.cvsResize();
432
- }
433
- showDesignCast() {
434
- this.#n.visible = !0;
435
- }
436
- //showDesignCastChildren() {}
437
- dump = () => super.dump() + `, "pic":"${this.#t}"`;
438
- }
439
- const st = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ!?!?‼⁉・ーゝゞヽヾ々", rt = "[({〈「『【〔“〝", ht = "─‥…", ft = st, $t = new RegExp(`[${st}]`), Wt = new RegExp(`[${rt}]`), zt = new RegExp(`[${ht}]`), Lt = $t;
440
- class Jt {
441
- #s = st;
442
- #e = rt;
443
- #n = ht;
444
- #r = ft;
445
- get 行頭禁則() {
446
- return this.#s;
447
- }
448
- get 行末禁則() {
449
- return this.#e;
450
- }
451
- get 分割禁止() {
452
- return this.#n;
453
- }
454
- get ぶら下げ() {
455
- return this.#r;
456
- }
457
- #t = $t;
458
- #l = Wt;
459
- #p = zt;
460
- #u = Lt;
461
- break_fixed = !1;
462
- break_fixed_left = 0;
463
- break_fixed_top = 0;
464
- bura = !1;
465
- lay(t) {
466
- t.kinsoku_sol && (this.#s = t.kinsoku_sol, this.#t = new RegExp(`[${this.#s}]`)), t.kinsoku_eol && (this.#e = t.kinsoku_eol, this.#c(), this.#l = new RegExp(`[${this.#e}]`)), t.kinsoku_dns && (this.#n = t.kinsoku_dns, this.#x(), this.#p = new RegExp(`[${this.#n}]`)), t.kinsoku_bura && (this.#r = t.kinsoku_bura, this.#c(), this.#x(), this.#u = new RegExp(`[${this.#r}]`)), "bura" in t && (this.bura = R(t, "bura", !1)), this.break_fixed = R(t, "break_fixed", this.break_fixed), this.break_fixed_left = w(t, "break_fixed_left", this.break_fixed_left), this.break_fixed_top = w(t, "break_fixed_top", this.break_fixed_top);
467
- }
468
- // 禁則の競合(ぶら下げ と 行末禁則 の両方に含まれる文字があってはならない)
469
- #c() {
470
- const t = this.#e.length, e = this.#r.length;
471
- if (t < e)
472
- for (let s = 0; s < t; ++s) {
473
- const i = this.#e[s];
474
- if (this.#r.includes(i)) throw `禁則の競合があります。文字 ${i} がぶら下げ と 行末禁則 の両方に含まれます`;
475
- }
476
- else
477
- for (let s = 0; s < e; ++s) {
478
- const i = this.#r[s];
479
- if (this.#e.includes(i)) throw `禁則の競合があります。文字 ${i} がぶら下げ と 行末禁則 の両方に含まれます`;
480
- }
481
- }
482
- // 禁則の競合(ぶら下げ と 分割禁止 の両方に含まれる文字があってはならない)
483
- #x() {
484
- const t = this.#n.length, e = this.#r.length;
485
- if (t < e)
486
- for (let s = 0; s < t; ++s) {
487
- const i = this.#n[s];
488
- if (this.#r.includes(i)) throw `禁則の競合があります。文字 ${i} がぶら下げ と 分割禁止 の両方に含まれます`;
489
- }
490
- else
491
- for (let s = 0; s < e; ++s) {
492
- const i = this.#r[s];
493
- if (this.#n.includes(i)) throw `禁則の競合があります。文字 ${i} がぶら下げ と 分割禁止 の両方に含まれます`;
494
- }
495
- }
496
- reNew(t) {
497
- t.#i(this.#s, this.#e, this.#n, this.#r), t.break_fixed = this.break_fixed, t.break_fixed_left = this.break_fixed_left, t.break_fixed_top = this.break_fixed_top, t.bura = this.bura;
498
- }
499
- #i(t, e, s, i) {
500
- this.#s !== t && (this.#s = t, this.#t = new RegExp(`[${t}]`)), this.#e !== e && (this.#e = e, this.#l = new RegExp(`[${e}]`)), this.#n !== s && (this.#n = s, this.#p = new RegExp(`[${s}]`)), this.#r !== i && (this.#r = i, this.#u = new RegExp(`[${i}]`));
501
- }
502
- record() {
503
- const t = {
504
- break_fixed: this.break_fixed,
505
- break_fixed_left: this.break_fixed_left,
506
- break_fixed_top: this.break_fixed_top,
507
- bura: this.bura
508
- };
509
- return this.#s === st && (t.行頭禁則 = this.#s), this.#e === rt && (t.行末禁則 = this.#e), this.#n === ht && (t.分割禁止 = this.#n), this.#r === ft && (t.ぶら下げ = this.#r), t;
510
- }
511
- playback(t) {
512
- t && (this.#i(
513
- t.行頭禁則 ?? st,
514
- t.行末禁則 ?? rt,
515
- t.分割禁止 ?? ht,
516
- t.ぶら下げ ?? ft
517
- ), this.break_fixed = t.break_fixed, this.break_fixed_left = t.break_fixed_left, this.break_fixed_top = t.break_fixed_top, this.bura = t.bura);
518
- }
519
- hyph(t, e, s, i, n) {
520
- let a, o = 0, r = 2, c = (f) => (c = () => !1, i === f ? (i > 0 && (t.innerHTML = n.replaceAll('class="sn_ch"', 'class="sn_ch sn_ch_in_default"')), !0) : f < 2);
521
- do {
522
- if (a = this.#f(t, e), o = a.length, c(o)) break;
523
- let f = -1 / 0;
524
- for (; r < o; ++r) {
525
- const { elm: l, rect: p, ch: d } = a[r];
526
- if (l.tagName === "RT") continue;
527
- const h = s ? p.y : p.x;
528
- if (f <= h || l.previousElementSibling?.tagName === "SPAN" && l.previousElementSibling?.innerHTML.includes("<br>") || l.parentElement?.previousElementSibling?.tagName === "SPAN" && l.parentElement?.previousElementSibling?.innerHTML.includes("<br>")) {
529
- f = h, this.break_fixed || (this.break_fixed_left = p.x, this.break_fixed_top = p.y);
530
- continue;
531
- }
532
- const u = this.#d(a, r), { elm: x, rect: v, ch: y } = a[u];
533
- if (!this.break_fixed) {
534
- this.break_fixed_left = v.x, this.break_fixed_top = v.y;
535
- const N = globalThis.getComputedStyle(x), O = parseFloat(N.fontSize);
536
- s ? this.break_fixed_top += O : this.break_fixed_left += O;
537
- }
538
- f = -1 / 0;
539
- const b = r, { cont: E, ins: _ } = this.bura ? this.hyph_alg_bura(a, u, y, r) : this.hyph_alg(a, u, y, r, d);
540
- if (r = _, E) continue;
541
- const T = a[r].elm, $ = T.parentElement, k = document.createElement("br");
542
- if ($.classList.contains("sn_tx")) $.insertBefore(k, T);
543
- else {
544
- const N = $.parentElement;
545
- N.classList.contains("sn_ch") ? N.parentElement.insertBefore(k, N) : N.insertBefore(k, $);
546
- }
547
- r += 2, r < b && (r = b), o = -1;
548
- break;
549
- }
550
- } while (o < 0);
551
- return [a, o];
552
- }
553
- // 一つ前の要素を探す(ルビ対応)
554
- #d(t, e) {
555
- const s = e - 1, { elm: i } = t[s];
556
- return i.tagName !== "RT" ? s - (i.style.textCombineUpright === "all" ? Array.from(i.textContent).length - 1 : 0) : s - Array.from(i.textContent).length;
557
- }
558
- #f(t, e) {
559
- const s = [];
560
- if (t.nodeType !== t.TEXT_NODE) return Array.from(t.childNodes).map((o) => this.#f(o, e)).flat();
561
- const i = t.ownerDocument.createRange();
562
- i.selectNodeContents(t);
563
- let n = 0;
564
- const a = i.endOffset;
565
- for (; n < a; ) {
566
- i.setStart(t, n), i.setEnd(t, ++n);
567
- const o = i.toString();
568
- s.push({
569
- ch: o,
570
- rect: e(i, o),
571
- elm: i.startContainer.parentElement
572
- });
573
- }
574
- return i.detach(), s;
575
- }
576
- /**
577
- * 抽象化した禁則処理アルゴリズム
578
- * @method hyph_alg
579
- * @param {IChRect[]} a - 文章の抽象化配列
580
- * @param {number} p_i - 処理要素の一つ前の添字
581
- * @param {string} p_ch - 処理要素の一つ前の文字
582
- * @param {number} i - 処理要素の添字
583
- * @param {string} ch - 処理要素の文字
584
- * @return {Object} result 戻り値
585
- * @return {boolean} result.cont - true: 呼び元で改行挿入せず continue
586
- * @return {number} result.ins - 手前に改行を挿入すべき要素の添字
587
- */
588
- hyph_alg(t, e, s, i, n) {
589
- let a = i;
590
- if (!this.#l.test(s)) {
591
- if (this.#t.test(n))
592
- for (; (a = this.#d(t, a)) >= 0 && this.#t.test(t[a].ch); )
593
- ;
594
- else if (!(s === n && this.#p.test(s))) return { cont: !0, ins: a + 1 };
595
- }
596
- for (a = e; (a = this.#d(t, a)) >= 0 && this.#l.test(t[a].ch); )
597
- ;
598
- return { cont: !1, ins: a + 1 };
599
- }
600
- /**
601
- * 抽象化した禁則処理アルゴリズム
602
- * @method hyph_alg
603
- * @param {IChRect[]} a - 文章の抽象化配列
604
- * @param {number} p_i - 処理要素の一つ前の添字
605
- * @param {string} p_ch - 処理要素の一つ前の文字
606
- * @param {number} i - 処理要素の添字
607
- * @return {Object} result 戻り値
608
- * @return {boolean} result.cont - true: 呼び元で改行挿入せず continue
609
- * @return {number} result.ins - 手前に改行を挿入すべき要素の添字
610
- */
611
- hyph_alg_bura(t, e, s, i) {
612
- const n = this.#d(t, e), { ch: a } = t[n];
613
- if (this.#u.test(a) || this.#t.test(a)) {
614
- let r = e;
615
- (this.#u.test(s) || this.#t.test(s)) && ++r;
616
- const c = this.#d(t, r), { ch: f } = t[c], { ch: l } = t[r];
617
- if (f === l && this.#p.test(l)) return { cont: !1, ins: c };
618
- if (!this.#l.test(f)) return { cont: !1, ins: r };
619
- r = c;
620
- do
621
- if (!this.#l.test(t[r].ch)) break;
622
- while ((r = this.#d(t, r)) >= 0);
623
- return { cont: !1, ins: r + 1 };
624
- }
625
- const o = this.#d(t, n);
626
- if (i >= 3) {
627
- const { ch: r } = t[o];
628
- if (this.#p.test(a) && r === a)
629
- return { cont: !1, ins: o };
630
- if (this.#l.test(r)) {
631
- let c = o;
632
- for (; (c = this.#d(t, c)) >= 0 && this.#l.test(t[c].ch); )
633
- ;
634
- return { cont: !1, ins: c + 1 };
635
- }
636
- }
637
- return { cont: !1, ins: n };
638
- }
639
- }
640
- function Ut(q, t, e, s, i, n = !0) {
641
- const a = {
642
- escape: (y) => y.replaceAll(/([.*+?^${}()|[\]/\\])/g, "\\$1"),
643
- mimeType: (y) => {
644
- const b = l(y).toLowerCase();
645
- return o()[b] || "";
646
- },
647
- dataAsUrl: u,
648
- isDataUrl: p,
649
- resolveUrl: d,
650
- getAndEncode: h,
651
- asArray: (y) => {
652
- const b = [], E = y.length;
653
- for (let _ = 0; _ < E; ++_) b.push(y[_]);
654
- return b;
655
- }
656
- };
657
- function o() {
658
- const y = "application/font-woff", b = "image/jpeg";
659
- return {
660
- woff: y,
661
- woff2: y,
662
- ttf: "application/font-truetype",
663
- eot: "application/vnd.ms-fontobject",
664
- png: "image/png",
665
- jpg: b,
666
- jpeg: b,
667
- gif: "image/gif",
668
- tiff: "image/tiff",
669
- svg: "image/svg+xml"
670
- };
671
- }
672
- const r = x(), c = v();
673
- function f(y) {
674
- return c.resolveAll().then((b) => {
675
- const E = document.createElement("style");
676
- return y.appendChild(E), E.appendChild(document.createTextNode(b)), y;
677
- });
678
- }
679
- function l(y) {
680
- return /\.([^./]*?)$/g.exec(y)?.[1] ?? "";
681
- }
682
- function p(y) {
683
- return y.search(/^(data:)/) !== -1;
684
- }
685
- function d(y, b) {
686
- const E = document.implementation.createHTMLDocument(), _ = E.createElement("base");
687
- E.head.appendChild(_);
688
- const T = E.createElement("a");
689
- return E.body.appendChild(T), _.href = b, T.href = y, T.href;
690
- }
691
- function h(y) {
692
- return new Promise(function(E) {
693
- const _ = new XMLHttpRequest();
694
- _.onreadystatechange = T, _.ontimeout = $, _.responseType = "blob", _.timeout = 3e4, _.open("GET", y, !0), _.send();
695
- function T() {
696
- if (_.readyState !== 4) return;
697
- if (_.status !== 200) {
698
- k("cannot fetch resource: " + y + ", status: " + _.status);
699
- return;
700
- }
701
- const N = new FileReader();
702
- N.onloadend = function() {
703
- const O = N.result.toString().split(/,/)[1];
704
- E(O);
705
- }, N.readAsDataURL(_.response);
706
- }
707
- function $() {
708
- k("timeout of 30000ms occured while fetching resource: " + y);
709
- }
710
- function k(N) {
711
- console.error(N), E("");
712
- }
713
- });
714
- }
715
- function u(y, b) {
716
- return "data:" + b + ";base64," + y;
717
- }
718
- function x() {
719
- const y = /url\(['"]?([^'"]+?)['"]?\)/g;
720
- return {
721
- inlineAll: T,
722
- shouldProcess: b
723
- };
724
- function b($) {
725
- return $.search(y) !== -1;
726
- }
727
- function E($) {
728
- const k = [];
729
- let N;
730
- for (; N = y.exec($); )
731
- k.push(N[1]);
732
- return k.filter(function(O) {
733
- return !a.isDataUrl(O);
734
- });
735
- }
736
- function _($, k, N, O) {
737
- return Promise.resolve(k).then((I) => N ? a.resolveUrl(I, N) : I).then(O || a.getAndEncode).then((I) => a.dataAsUrl(I, a.mimeType(k))).then((I) => $.replace(M(k), "$1" + I + "$3"));
738
- function M(I) {
739
- return new RegExp(`(url\\(['"]?)(` + a.escape(I) + `)(['"]?\\))`, "g");
740
- }
741
- }
742
- function T($, k, N) {
743
- if (O()) return Promise.resolve($);
744
- return Promise.resolve($).then(E).then((M) => {
745
- let I = Promise.resolve($);
746
- for (const K of M) I = I.then((lt) => _(lt, K, k, N));
747
- return I;
748
- });
749
- function O() {
750
- return !b($);
751
- }
752
- }
753
- }
754
- function v() {
755
- return {
756
- resolveAll: y,
757
- impl: { readAll: b }
758
- };
759
- function y() {
760
- return b().then((E) => Promise.allSettled(
761
- E.map((_) => _.resolve())
762
- )).then((E) => E.join(`
763
- `));
764
- }
765
- function b() {
766
- return Promise.resolve(a.asArray(document.styleSheets)).then(_).then(E).then(($) => $.map(T));
767
- function E($) {
768
- return $.filter((k) => k.type === CSSRule.FONT_FACE_RULE).filter((k) => r.shouldProcess(k.style.getPropertyValue("src")));
769
- }
770
- function _($) {
771
- const k = [];
772
- for (const N of $)
773
- try {
774
- if (N.href) continue;
775
- a.asArray(N.cssRules || []).forEach(k.push.bind(k));
776
- } catch (O) {
777
- console.error("Error while reading CSS rules from " + N.href, String(O));
778
- }
779
- return k;
780
- }
781
- function T($) {
782
- return {
783
- resolve: function() {
784
- const N = ($.parentStyleSheet || {}).href;
785
- return r.inlineAll($.cssText, N);
786
- },
787
- src() {
788
- return $.style.getPropertyValue("src");
789
- }
790
- };
791
- }
792
- }
793
- }
794
- Promise.resolve(t).then((y) => {
795
- const b = y.cloneNode(!0);
796
- return b.style.padding = "0px", b.style.paddingRight = s + "px", b.style.paddingTop = i + "px", b.style.left = "0px", b.style.top = "0px", b.style.width = e.$width - e.pad_left - e.pad_right + "px", b.style.height = e.$height - e.pad_top - e.pad_bottom + "px", t.hidden = n, b;
797
- }).then(f).then((y) => {
798
- y.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
799
- const b = new Image();
800
- return b.src = `data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="${e.$width}px" height="${e.$height}px"><foreignObject x="0" y="0" width="100%" height="100%">${new XMLSerializer().serializeToString(y).replaceAll("#", "%23").replaceAll(`
801
- `, "%0A")}</foreignObject></svg>`, new Promise((E) => {
802
- b.onload = () => E(b);
803
- });
804
- }).then((y) => new Promise((b) => setTimeout(() => b(y), 100))).then((y) => {
805
- const b = document.createElement("canvas");
806
- b.width = e.$width, b.height = e.$height, b.getContext("2d").drawImage(y, 0, 0), q(J.from(b));
807
- }).catch((y) => it.myTrace(`goTxt() = ${y}`));
808
- }
809
- class g extends W {
810
- constructor(t, e, s) {
811
- super(), this.ctn = t, this.canFocus = e, this.sys = s, this.#t.classList.add("sn_tx"), this.#t.style.position = "absolute", g.#e.view.parentElement.appendChild(this.#t), this.addChild(this.#l), this.addChild(this.#p), this.#p.name = "grpDbgMasume";
812
- const i = S.debugLog ? ({ ch: n, rect: { x: a, y: o, width: r, height: c } }) => console.log(`🍌 masume ch:${n} x:${a} y:${o} w:${r} h:${c}`) : () => {
813
- };
814
- this.#x = g.#s.oCfg.debug.masume ? (n) => {
815
- i(n);
816
- const { x: a, y: o, width: r, height: c } = n.rect;
817
- this.#p.beginFill(6737151, 0.5).lineStyle(2, 16724736, 1).drawRect(a, o, r, c).endFill();
818
- } : () => {
819
- }, this.noticeCompTxt = s.isApp && g.#s.oCfg.debug.dumpHtm ? () => {
820
- F.notifyEndProc(wt);
821
- const n = this.#t.innerHTML;
822
- if (n === "") return;
823
- const { fn: a, ln: o } = g.#r.nowScrFnLn(), r = `dumpHtm ${t.name.slice(0, -7).replaceAll(":", "=")}(fn=${a} line=${String(o)})`;
824
- s.outputFile(
825
- s.path_downloads + r + ".htm",
826
- `<!doctype html><html><head><meta charset=utf-8><title>${r}</title>
827
- <h1>${r}</h1>${n.replaceAll(/ class="sn_ch"|animation-delay: \d+ms; ?| data-add="{&quot;ch_in_style&quot;:&quot;default&quot;, &quot;ch_out_style&quot;:&quot;default&quot;}"/g, "").replaceAll(' style=""', "").replaceAll(/(<\/?ruby>)/g, `
828
- $1
829
- `).replaceAll(/<(br|\/span)>/g, `<$1>
830
- `)}`
831
- );
832
- } : () => F.notifyEndProc(wt);
833
- }
834
- static #s;
835
- static #e;
836
- static init(t, e) {
837
- g.#s = t, g.#e = e;
838
- }
839
- static #n;
840
- static #r;
841
- static setEvtMng(t, e) {
842
- g.#n = t, g.#r = e;
843
- }
844
- static destroy() {
845
- g.#F = /* @__PURE__ */ Object.create(null), g.#j = /* @__PURE__ */ Object.create(null), g.delBreak();
846
- }
847
- #t = document.createElement("span");
848
- // サンプリング元
849
- #l = new W();
850
- // サンプリング先
851
- #p = new U();
852
- static #u = {
853
- "background-color": 0,
854
- "border-bottom-width": 0,
855
- "border-left-width": 0,
856
- "border-right-width": 0,
857
- "border-top-width": 0,
858
- "margin-bottom": 0,
859
- "margin-left": 0,
860
- "margin-right": 0,
861
- "margin-top": 0
862
- };
863
- #c = new Jt();
864
- noticeCompTxt = () => {
865
- };
866
- #x;
867
- // readonly #idc :TxtLayDesignCast;
868
- // readonly #idcCh = new TxtLayPadDesignCast(this);
869
- #i = {
870
- fontsize: 24,
871
- $width: 0,
872
- // レイヤサイズであり、背景色(画像)サイズ
873
- $height: 0,
874
- pad_left: 0,
875
- // paddingLeft(レイヤサイズの内側のスペーサー)
876
- pad_right: 0,
877
- // paddingRight
878
- pad_top: 0,
879
- // paddingTop
880
- pad_bottom: 0
881
- // paddingBottom
882
- };
883
- lay(t) {
884
- const e = this.#t.style;
885
- if ("style" in t)
886
- if (t.style) {
887
- const s = document.createElement("span");
888
- s.style.cssText = t.style;
889
- const i = s.style.length;
890
- for (let n = 0; n < i; ++n) {
891
- const a = s.style[n];
892
- if (a in g.#u) {
893
- it.myTrace(`${String(a)}は指定できません`, "W");
894
- continue;
895
- }
896
- e[a] = s.style[a];
897
- }
898
- !s.style.opacity && "alpha" in t && (e.opacity = String(this.ctn.alpha));
899
- } else this.#t.style.cssText = "";
900
- else "alpha" in t && (e.opacity = String(this.ctn.alpha));
901
- if ("width" in t && (e.width = String(t.width ?? "0") + "px"), "height" in t && (e.height = String(t.height ?? "0") + "px"), "pl" in t && (e.paddingLeft = String(t.pl ?? "0") + "px"), "pr" in t && (e.paddingRight = String(t.pr ?? "0") + "px"), "pt" in t && (e.paddingTop = String(t.pt ?? "0") + "px"), "pb" in t && (e.paddingBottom = String(t.pb ?? "0") + "px"), this.#c.lay(t), this.#f(), this.#y = this.ctn.position.x, e.transformOrigin = `${this.ctn.pivot.x}px ${this.ctn.pivot.y}px`, this.cvsResize(), e.display = this.ctn.visible ? "inline" : "none", ":redraw" in t && this.#w > 0) {
902
- const s = [
903
- this.#t.innerHTML.replaceAll(/(animation-delay: )\d+ms/g, "$10ms"),
904
- `<span class='sn_ch' data-add='{"ch_in_style":"default"}'>&emsp;</span>`
905
- ];
906
- this.#_(), this.goTxt(s, !0);
907
- }
908
- }
909
- // oxlint-disable-next-line no-unused-private-class-members
910
- #d = 0;
911
- // 「g」などで下が欠ける問題対策
912
- #f() {
913
- const t = this.#t.style, e = parseFloat(t.fontSize || "0");
914
- this.#i.fontsize = e, this.#i.pad_left = parseFloat(t.paddingLeft || "0"), this.#i.pad_right = parseFloat(t.paddingRight || "0"), this.#i.pad_top = parseFloat(t.paddingTop || "0"), this.#i.pad_bottom = parseFloat(t.paddingBottom || "0"), this.#i.$width = parseFloat(t.width || "0"), this.#i.$height = parseFloat(t.height || "0"), this.position.set(this.#i.pad_left, this.#i.pad_top), this.#a = t.writingMode === "vertical-rl", this.#g = 0, this.#o = 0;
915
- const s = t.lineHeight ?? "0";
916
- this.#d = this.#a ? 0 : (s.endsWith("px") ? parseFloat(s) : e * parseFloat(s) - e) / 2;
917
- }
918
- cvsResize() {
919
- const t = this.#t.style, e = this.sys.cvsScale;
920
- t.left = `${this.sys.ofsLeft4elm + this.#y * e}px`, t.top = `${this.sys.ofsTop4elm + this.ctn.position.y * e}px`, t.transform = `rotate(${this.ctn.angle}deg) scale(${this.ctn.scale.x * e}, ${this.ctn.scale.y * e})`;
921
- }
922
- #y = 0;
923
- #a = !1;
924
- get tategaki() {
925
- return this.#a;
926
- }
927
- #g = 0;
928
- #o = 0;
929
- get infTL() {
930
- return this.#i;
931
- }
932
- get getWidth() {
933
- return this.#i.$width;
934
- }
935
- get getHeight() {
936
- return this.#i.$height;
937
- }
938
- setMySize(t, e) {
939
- this.#i.$width = t, this.#i.$height = e, this.#t.style.width = String(this.#i.$width) + "px", this.#t.style.height = String(this.#i.$height) + "px";
940
- }
941
- #I = [];
942
- // FIFO実行バッファ
943
- goTxt(t, e) {
944
- const s = () => this.#h(t, e);
945
- this.#I.push(s) === 1 && s();
946
- }
947
- #k = [];
948
- #w = 0;
949
- static #v = "<span class='sn_ch sn_ch_last'>&emsp;</span>";
950
- #h(t, e) {
951
- g.#H.visible = !1;
952
- let s = this.#k.length, i = "";
953
- if (s === 0) {
954
- if (g.#s.oCfg.debug.masume && (S.debugLog && console.log(`🍌 masume ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
955
- this.name} v:${this.visible} l:${this.x} t:${this.y} a:${this.alpha} pl:${this.#i.pad_left} pr:${this.#i.pad_right} pt:${this.#i.pad_top} pb:${this.#i.pad_bottom} w:${this.#i.$width} h:${this.#i.$height}`), this.#p.clear().beginFill(3407616, 0.2).lineStyle(1, 3407616, 1).drawRect(-this.#i.pad_left, -this.#i.pad_top, this.#i.$width, this.#i.$height).endFill().beginFill(13311, 0.2).lineStyle(2, 13311, 1).drawRect(
956
- 0,
957
- 0,
958
- this.#i.$width - this.#i.pad_left - this.#i.pad_right,
959
- this.#i.$height - this.#i.pad_top - this.#i.pad_bottom
960
- ).endFill()), this.#t.innerHTML = [...t].join("").replaceAll(/[\n\t]/g, "") + g.#v, !this.#c.break_fixed) {
961
- const u = globalThis.getComputedStyle(this.#t), x = parseFloat(u.fontSize);
962
- this.#a ? (this.#c.break_fixed_left = (this.#i.$width - this.#i.pad_left - this.#i.pad_right - x * 1.5) * this.sys.cvsScale, this.#c.break_fixed_top = 0) : (this.#c.break_fixed_left = 0, this.#c.break_fixed_top = x / 2 * this.sys.cvsScale);
963
- }
964
- } else
965
- i = this.#t.innerHTML, --s, this.#t.getElementsByClassName("sn_ch_last").item(0)?.remove(), this.#t.querySelectorAll(":scope > br").forEach((u) => u.remove()), this.#t.insertAdjacentHTML(
966
- "beforeend",
967
- t.slice(this.#w).join("").replaceAll(/[\n\t]/g, "") + g.#v
968
- // 末尾改行削除挙動対策
969
- );
970
- this.#t.querySelectorAll(".sn_ch:has(> ruby)").forEach((u) => {
971
- u.style.background = "";
972
- }), this.#w = t.length;
973
- const n = this.sys.cvsScale, a = this.#t.getBoundingClientRect(), o = a.left + this.#i.pad_left, r = a.top + this.#i.pad_top;
974
- let c;
975
- if (n === 1) c = (u, x) => {
976
- const v = u.getBoundingClientRect();
977
- return new Y(
978
- v.left - o,
979
- v.top - r,
980
- v.width,
981
- v.height + ("gjqy".includes(x) ? this.#d : 0)
982
- );
983
- };
984
- else {
985
- const u = this.sys.ofsPadLeft_Dom2PIXI + a.left * (1 - n), x = this.sys.ofsPadTop_Dom2PIXI + a.top * (1 - n);
986
- c = (v, y) => {
987
- const b = v.getBoundingClientRect();
988
- return new Y(
989
- (b.left - u) / n - o,
990
- (b.top - x) / n - r,
991
- b.width / n,
992
- (b.height + ("gjqy".includes(y) ? this.#d : 0)) / n
993
- );
994
- };
995
- }
996
- const [f, l] = this.#c.hyph(this.#t, c, this.#a, s, i);
997
- this.#k = f;
998
- const p = B.ease(this.#$);
999
- for (let u = s; u < l; ++u) {
1000
- const x = this.#k[u], { elm: { dataset: v, parentElement: y }, rect: b } = x, E = JSON.parse(v.arg ?? '{"delay": 0}'), _ = JSON.parse(v.add ?? "{}"), T = g.#F[_.ch_in_style];
1001
- if (this.#x(x), v.cmd === "grp") {
1002
- const $ = new W();
1003
- this.#l.addChild($), new m(E.pic, $, (k) => {
1004
- this.#E($, E, _, b, p, T ?? {}), $.parent || $.removeChild(k);
1005
- });
1006
- }
1007
- if (v.lnk) {
1008
- const $ = y.closest("[data-arg]"), k = JSON.parse($.dataset.arg ?? "{}");
1009
- k.key = `lnk=[${String(u)}] ` + this.name;
1010
- const N = new j();
1011
- this.#E(N, k, _, b, p, T ?? {});
1012
- const O = k.style ?? "", M = O + (k.style_hover ?? ""), I = O + (k.style_clicked ?? ""), K = k.r_style ?? "", lt = K + (k.r_style_hover ?? ""), Ct = K + (k.r_style_clicked ?? ""), yt = Array.from($.getElementsByTagName("rt"));
1013
- for (const at of yt) at.dataset.st_r_bk = at.style.cssText;
1014
- const Et = $.style.cssText, nt = (at, Nt) => {
1015
- $.style.cssText = Et + at;
1016
- for (const mt of yt) mt.style.cssText = mt.dataset.st_r_bk + Nt;
1017
- };
1018
- R(k, "enabled", !0) ? g.#n.button(
1019
- k,
1020
- N,
1021
- () => nt(O, K),
1022
- () => this.canFocus() ? (nt(M, lt), !0) : !1,
1023
- () => nt(I, Ct)
1024
- ) : nt(
1025
- O + (k.style_disable ?? "color: gray;"),
1026
- K + (k.r_style_disable ?? "color: gray;")
1027
- ), this.#l.addChild(N);
1028
- }
1029
- }
1030
- const d = Array.from(this.#t.getElementsByClassName("sn_ch_yet"));
1031
- this.#b = () => {
1032
- this.#b = () => !1;
1033
- for (const x of d) x.className = "sn_ch";
1034
- g.#H.position.set(
1035
- this.#c.break_fixed_left,
1036
- this.#c.break_fixed_top
1037
- ), g.#H.visible = !0, this.noticeCompTxt();
1038
- const u = this.#I.shift();
1039
- return this.#I.length > 0 && u(), !0;
1040
- };
1041
- for (const u of d) u.className = u.className.replace("sn_ch_yet sn", "go");
1042
- s > 0 && ++s;
1043
- let h;
1044
- for (let u = l - 2; u >= 0; --u) {
1045
- const { elm: x } = this.#k[u];
1046
- if (x.tagName === "SPAN") {
1047
- h = x.parentElement?.tagName === "RUBY" ? x.parentElement.parentElement ?? x : x;
1048
- break;
1049
- }
1050
- }
1051
- if (!h || e || s === l) {
1052
- this.#b();
1053
- return;
1054
- }
1055
- h.addEventListener("animationend", () => this.#b(), { once: !0 });
1056
- }
1057
- #b = () => !1;
1058
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1059
- #E(t, e, s, i, n, a) {
1060
- t.alpha = 0, e.x && (i.x = e.x.startsWith("=") ? i.x + parseInt(e.x.slice(1)) : parseInt(e.x)), e.y && (i.y = e.y.startsWith("=") ? i.y + parseInt(e.y.slice(1)) : parseInt(e.y)), e.width && (i.width = parseInt(e.width)), e.height && (i.height = parseInt(e.height)), e.wait && (a.wait = e.wait), t.width = i.width, t.height = i.height, a.x ? t.position.set(
1061
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
1062
- a.x.startsWith("=") ? i.x + t.width * a.nx : a.nx,
1063
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
1064
- a.y.startsWith("=") ? i.y + t.height * a.ny : a.ny
1065
- ) : t.position.set(i.x, i.y);
1066
- const o = {
1067
- sp: t,
1068
- tw: new Dt(t).to({ alpha: 1, x: i.x, y: i.y, width: i.width, height: i.height, angle: 0 }, a.wait ?? 0).easing(n).delay((s.wait ?? 0) + (e.delay ?? 0)).onComplete(() => {
1069
- o.tw = void 0;
1070
- }).start()
1071
- };
1072
- this.#V.push(o);
1073
- }
1074
- #V = [];
1075
- skipChIn() {
1076
- let t = this.#b();
1077
- for (const e of this.#V)
1078
- e.tw && (e.tw.stop().end(), t = !0);
1079
- return this.#V = [], t;
1080
- }
1081
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
1082
- static #F = /* @__PURE__ */ Object.create(null);
1083
- static #z = /[{\s.,*{]/;
1084
- // https://regex101.com/r/APC91I/1
1085
- static initChStyle() {
1086
- g.#F = /* @__PURE__ */ Object.create(null), g.#j = /* @__PURE__ */ Object.create(null);
1087
- }
1088
- static getChInStyle(t) {
1089
- return g.#F[t];
1090
- }
1091
- static ch_in_style(t) {
1092
- const { name: e } = t;
1093
- if (!e) throw "nameは必須です";
1094
- if (g.#z.test(e)) throw `name【${e}】に使えない文字が含まれます`;
1095
- if (e in g.#F) throw `name【${e}】はすでにあります`;
1096
- const s = String(t.x ?? "=0"), i = String(t.y ?? "=0");
1097
- return g.#F[e] = {
1098
- wait: w(t, "wait", 500),
1099
- // アニメ・FI時間
1100
- alpha: w(t, "alpha", 0),
1101
- x: s,
1102
- // 初期x値
1103
- y: i,
1104
- // [tsy]と同様に絶対・相対指定可能
1105
- // {x:500} X位置を500に
1106
- // {x:'=500'} 現在のX位置に+500加算した位置
1107
- // {x:'=-500'} 現在のX位置に-500加算した位置
1108
- // {x:'250,500'} +250から+500までの間でランダムな値をX位置に
1109
- // {x:'=250,500'} +250から+500までの間でランダムな値を現在のX位置に加算
1110
- nx: parseFloat(s.at(0) === "=" ? s.slice(1) : s),
1111
- ny: parseFloat(i.at(0) === "=" ? i.slice(1) : i),
1112
- scale_x: w(t, "scale_x", 1),
1113
- scale_y: w(t, "scale_y", 1),
1114
- rotate: w(t, "rotate", 0),
1115
- join: R(t, "join", !0),
1116
- // 文字を順番に出すか(true)同時か(false)
1117
- ease: t.ease ?? "ease-out"
1118
- };
1119
- }
1120
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
1121
- static #j = /* @__PURE__ */ Object.create(null);
1122
- static getChOutStyle(t) {
1123
- return g.#j[t];
1124
- }
1125
- static ch_out_style(t) {
1126
- const { name: e } = t;
1127
- if (!e) throw "nameは必須です";
1128
- if (g.#z.test(e)) throw `name【${e}】に使えない文字が含まれます`;
1129
- if (e in g.#j) throw `name【${e}】はすでにあります`;
1130
- const s = String(t.x ?? "=0"), i = String(t.y ?? "=0");
1131
- return g.#j[e] = {
1132
- wait: w(t, "wait", 500),
1133
- // アニメ・FI時間
1134
- alpha: w(t, "alpha", 0),
1135
- x: s,
1136
- // 初期x値
1137
- y: i,
1138
- // [tsy]と同様に絶対・相対指定可能
1139
- // {x:500} X位置を500に
1140
- // {x:'=500'} 現在のX位置に+500加算した位置
1141
- // {x:'=-500'} 現在のX位置に-500加算した位置
1142
- // {x:'250,500'} +250から+500までの間でランダムな値をX位置に
1143
- // {x:'=250,500'} +250から+500までの間でランダムな値を現在のX位置に加算
1144
- nx: parseFloat(s.at(0) === "=" ? s.slice(1) : s),
1145
- ny: parseFloat(i.at(0) === "=" ? i.slice(1) : i),
1146
- scale_x: w(t, "scale_x", 1),
1147
- scale_y: w(t, "scale_y", 1),
1148
- rotate: w(t, "rotate", 0),
1149
- join: R(t, "join", !1),
1150
- // 文字を順番に出すか(true)同時か(false)
1151
- ease: t.ease ?? "ease-out"
1152
- };
1153
- }
1154
- static #H = new W();
1155
- static #O = new m();
1156
- dispBreak(t) {
1157
- g.delBreak();
1158
- const e = g.#H;
1159
- e.visible = !1, this.addChild(e), g.#O.destroy(), g.#O = new m(t.pic, e, (s) => {
1160
- e.parent ? (s.x = w(t, "x", 0), s.y = w(t, "y", 0), s.width = w(t, "width", this.#i.fontsize), s.height = w(t, "height", this.#i.fontsize)) : e.removeChild(s);
1161
- });
1162
- }
1163
- static delBreak() {
1164
- const t = g.#H;
1165
- t.parent?.removeChild(t), g.#O.destroy();
1166
- }
1167
- #$ = "Quadratic.Out";
1168
- #N = "Quadratic.Out";
1169
- #_() {
1170
- this.#p.clear(), this.#k = [], this.#w = 0, this.#I = [], this.skipChIn();
1171
- const t = this.#t.cloneNode(!0);
1172
- t.textContent = "";
1173
- const e = this.#t, s = Array.from(e.getElementsByClassName("sn_ch"));
1174
- e.parentElement.insertBefore(t, e);
1175
- let i = 0;
1176
- s.forEach((a) => {
1177
- const o = JSON.parse(
1178
- a.dataset.add ?? // 通常文字
1179
- a.children[0]?.getAttribute("data-add") ?? // ルビ
1180
- a.children[0]?.children[0]?.getAttribute("data-add") ?? "{}"
1181
- // 縦中横
1182
- );
1183
- if (!o.ch_out_style) return;
1184
- const r = g.#j[o.ch_out_style];
1185
- if (r) {
1186
- if (r.wait === 0) {
1187
- a.style.display = "none";
1188
- return;
1189
- }
1190
- i += r.wait, r.join || (a.style.animationDelay = "0ms"), a.classList.add(`go_ch_out_${String(o.ch_out_style)}`);
1191
- }
1192
- });
1193
- const n = () => {
1194
- e.parentElement.removeChild(e);
1195
- for (const a of this.#l.removeChildren())
1196
- a instanceof W && g.#n.unButton(a), a.destroy();
1197
- };
1198
- i === 0 ? (this.#t.textContent = "", n()) : e.lastElementChild?.addEventListener("animationend", n, { once: !0 }), this.#t = t;
1199
- }
1200
- reNew() {
1201
- this.#_();
1202
- const t = new g(this.ctn, () => this.canFocus(), this.sys);
1203
- return t.#i = this.#i, t.#t.style.cssText = this.#t.style.cssText, t.#y = this.#y, t.name = this.name, t.#f(), t.#W = this.#W, t.#$ = this.#$, t.#N = this.#N, this.#c.reNew(t.#c), this.destroy(), t;
1204
- }
1205
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1206
- #W = void 0;
1207
- // 文字にかけるフィルター
1208
- record() {
1209
- return {
1210
- infTL: this.#i,
1211
- cssText: this.#t.style.cssText,
1212
- left: this.#y,
1213
- // idc_hArg : this.#idc.gethArg(),
1214
- ch_filter: this.#W,
1215
- fi_easing: this.#$,
1216
- fo_easing: this.#N,
1217
- hyph: this.#c.record()
1218
- };
1219
- }
1220
- playback(t) {
1221
- this.#i = t.infTL, this.position.set(this.#i.pad_left, this.#i.pad_top), this.#t.style.cssText = t.cssText, this.#y = t.left, this.#f(), this.#W = t.ch_filter, this.#$ = t.fi_easing, this.#N = t.fo_easing, this.#c.playback(t.hyph);
1222
- }
1223
- get cssText() {
1224
- return this.#t.style.cssText;
1225
- }
1226
- set cssText(t) {
1227
- this.#t.style.cssText = t;
1228
- }
1229
- #m = void 0;
1230
- snapshot(t, e) {
1231
- Ut((s) => {
1232
- this.#m = j.from(s), this.#a && (this.#m.x += S.stageW - (this.#y + this.#i.$width)), this.#m.y -= this.#o, this.#m.texture.frame = new Y(
1233
- 0,
1234
- 0,
1235
- Math.min(this.#m.width, this.#i.$width - this.#y),
1236
- Math.min(this.#m.height, this.#i.$height)
1237
- ), this.#l.addChild(this.#m), t.render(this.#m, { clear: !1 }), e();
1238
- }, this.#t, this.#i, this.#g, this.#o, !1);
1239
- }
1240
- snapshot_end() {
1241
- this.#m && (this.#l.removeChild(this.#m), this.#m = void 0);
1242
- }
1243
- makeDesignCast(t) {
1244
- }
1245
- showDesignCast() {
1246
- }
1247
- // showDesignCast() {this.#idc.visible = true; this.#idcCh.visible = true}
1248
- dump() {
1249
- const t = [], e = this.#t.style, s = e.length;
1250
- for (let i = 0; i < s; ++i) {
1251
- const n = e[i];
1252
- t.push(`"${String(n)}":"${e[n].replaceAll(/(["\\])/g, "\\$1")}"`);
1253
- }
1254
- return `"txt":"${this.#t.textContent.replaceAll(/(["\\])/g, "\\$1")}", "style":{${t.join(",")}}`;
1255
- }
1256
- destroy() {
1257
- g.delBreak(), this.#t.parentElement.removeChild(this.#t), this.removeChild(this.#l), this.removeChild(this.#p), super.destroy();
1258
- }
1259
- }
1260
- class z extends W {
1261
- constructor(t, e, s, i) {
1262
- if (super(), this.hArg = t, this.evtMng = e, this.resolve = s, this.canFocus = i, this.#t = {
1263
- type: "pic",
1264
- enabled: R(t, "enabled", !0),
1265
- x: this.x = V(t.left ?? 0),
1266
- y: this.y = V(t.top ?? 0),
1267
- rotation: this.angle = w(t, "rotation", this.angle),
1268
- // flash : rotation is in degrees.
1269
- // pixijs: rotation is in radians, angle is in degrees.
1270
- pivot_x: this.pivot.x = w(t, "pivot_x", this.pivot.x),
1271
- pivot_y: this.pivot.y = w(t, "pivot_y", this.pivot.y),
1272
- scale_x: this.scale.x = w(t, "scale_x", this.scale.x),
1273
- scale_y: this.scale.y = w(t, "scale_y", this.scale.y),
1274
- alpha: 1,
1275
- text: "",
1276
- b_pic: "",
1277
- width: 0,
1278
- height: 0
1279
- }, this.getBtnBounds = () => (this.#n.x = this.#t.x, this.#n.y = this.#t.y, this.#n), this.#t.enabled && e.button(t, this, () => this.normal(), () => this.#p(), () => this.#u()), t.pic) {
1280
- this.#t.type = "pic", this.#r = new m(
1281
- t.pic,
1282
- this,
1283
- (l) => {
1284
- this.#c(l), this.#n.width = l.width * this.#t.scale_x, this.#n.height = l.height * this.#t.scale_y;
1285
- },
1286
- (l) => s()
1287
- );
1288
- return;
1289
- }
1290
- if (!t.text) throw "textまたはpic属性は必須です";
1291
- const n = w(t, "height", 30), a = new Tt({
1292
- align: "center",
1293
- dropShadow: !0,
1294
- dropShadowAlpha: 0.7,
1295
- dropShadowColor: "white",
1296
- dropShadowBlur: 7,
1297
- dropShadowDistance: 0,
1298
- fill: this.#t.enabled ? "black" : "gray",
1299
- fontFamily: z.fontFamily,
1300
- fontSize: n,
1301
- padding: 5
1302
- });
1303
- if (t.style) try {
1304
- const l = JSON.parse(t.style);
1305
- for (const [p, d] of Object.entries(l)) a[p] = d;
1306
- this.#t = { ...this.#t, ...l };
1307
- } catch (l) {
1308
- throw l instanceof SyntaxError ? new Error(dt(t, "style", l.message)) : "fn:Button.ts style";
1309
- }
1310
- const o = new Pt(t.text ?? "", a);
1311
- o.alpha = w(t, "alpha", o.alpha), o.width = w(t, "width", 100), o.height = t.height = n, this.setText = (l) => {
1312
- o.text = l;
1313
- }, this.#t = {
1314
- ...this.#t,
1315
- type: "text",
1316
- // dump用
1317
- alpha: o.alpha,
1318
- text: o.text,
1319
- width: o.width,
1320
- height: o.height
1321
- };
1322
- let r = !1;
1323
- if (this.#t.width = this.width, this.#t.height = this.height, t.b_pic && (this.#t.b_pic = t.b_pic, this.#r = new m(
1324
- t.b_pic,
1325
- this,
1326
- (l) => {
1327
- this.#l(l, o), this.#t.width = this.width, this.#t.height = this.height, o.name = JSON.stringify(this.#t);
1328
- },
1329
- (l) => {
1330
- H.setBlendmode(this, t), l && s();
1331
- }
1332
- ), r = this.#r.ret), o.name = JSON.stringify(this.#t), this.addChild(o), this.#n.width = o.width, this.#n.height = o.height, t.b_pic || H.setBlendmode(this, t), z.#s(this, o), !this.#t.enabled) {
1333
- r || s();
1334
- return;
1335
- }
1336
- const c = a.clone();
1337
- if (t.style_hover) try {
1338
- const l = JSON.parse(t.style_hover);
1339
- for (const [p, d] of Object.entries(l)) c[p] = d;
1340
- } catch (l) {
1341
- throw l instanceof SyntaxError ? new Error(dt(t, "style_hover", l.message)) : "fn:Button.ts style_hover";
1342
- }
1343
- else c.fill = "white";
1344
- const f = c.clone();
1345
- if (t.style_clicked) try {
1346
- const l = JSON.parse(t.style_clicked);
1347
- for (const [p, d] of Object.entries(l)) f[p] = d;
1348
- } catch (l) {
1349
- throw l instanceof SyntaxError ? new Error(dt(t, "style_clicked", l.message)) : "fn:Button.ts style_clicked";
1350
- }
1351
- else f.dropShadow = !1;
1352
- this.normal = () => {
1353
- o.style = a;
1354
- }, this.#p = () => i() ? (o.style = c, !0) : !1, this.#u = () => {
1355
- o.style = f;
1356
- }, r || s();
1357
- }
1358
- static fontFamily = "'Hiragino Sans', 'Hiragino Kaku Gothic ProN', '游ゴシック Medium', meiryo, sans-serif";
1359
- static #s = (t, e) => {
1360
- };
1361
- static #e = (t, e, s, i) => {
1362
- };
1363
- static init(t) {
1364
- t.oCfg.debug.masume && (z.#s = (e, s) => e.addChild(
1365
- new U().beginFill(8926088, 0.2).lineStyle(1, 8926088, 1).drawRect(s.x, s.y, s.width, s.height).endFill()
1366
- ), z.#e = (e, s, i, n) => e.addChild(
1367
- new U().beginFill(8926088, 0.2).lineStyle(1, 8926088, 1).drawRect(s.x, s.y, i, n).endFill()
1368
- ));
1369
- }
1370
- setText(t) {
1371
- }
1372
- getBtnBounds = () => this.#n;
1373
- // 文字ボタンは背景画像を含まない位置指定なので、その当たり判定用
1374
- #n = new Y();
1375
- #r = new m();
1376
- // #idc : DesignCast;
1377
- #t;
1378
- destroy() {
1379
- this.evtMng.unButton(this), this.#r.destroy(), super.destroy();
1380
- }
1381
- makeDesignCast(t) {
1382
- }
1383
- showDesignCast() {
1384
- }
1385
- // showDesignCast() {this.#idc.visible = true}
1386
- cvsResize() {
1387
- }
1388
- #l(t, e) {
1389
- this.setChildIndex(t, 0), t.alpha = e.alpha, t.setTransform(
1390
- e.x,
1391
- e.y,
1392
- 1,
1393
- 1,
1394
- e.rotation,
1395
- 0,
1396
- 0,
1397
- (t.width - e.width) / 2,
1398
- (t.height - e.height) / 2
1399
- ), t.name = e.name;
1400
- }
1401
- normal = () => {
1402
- };
1403
- #p = () => !1;
1404
- #u = () => {
1405
- };
1406
- #c(t) {
1407
- this.#t.alpha = t.alpha = w(this.hArg, "alpha", t.alpha);
1408
- const e = t.width / 3, s = this.#t.enabled ? e : t.width, i = t.height, n = t.texture.baseTexture, a = new J(n, new Y(0, 0, e, i)), o = new J(n, new Y(e, 0, e, i)), r = new J(n, new Y(e * 2, 0, e, i)), c = () => {
1409
- t.texture = a;
1410
- };
1411
- this.#t.enabled && c(), this.normal = c, this.#p = () => this.canFocus() ? (t.texture = r, !0) : !1, this.#u = () => {
1412
- t.texture = o;
1413
- }, "width" in this.hArg ? (this.#t.width = V(this.hArg.width), this.scale.x *= this.#t.width / s) : this.#t.width = s, "height" in this.hArg ? (this.#t.height = V(this.hArg.height), this.scale.y *= this.#t.height / i) : this.#t.height = i, t.name = JSON.stringify(this.#t), z.#e(this, t, s, i);
1414
- }
1415
- }
1416
- class P extends H {
1417
- static #s;
1418
- static #e;
1419
- static #n;
1420
- static #r;
1421
- static init(t, e, s, i, n, a) {
1422
- this.#s = t, g.init(t, a), this.#e = s, this.#r = i, this.#n = n, s.setDoRecProc((o) => this.chgDoRec(o)), e.autowc = (o) => this.#i(o), e.autowc({ enabled: !1, text: "", time: 0 }), e.ch_in_style = (o) => this.#t(o), e.ch_out_style = (o) => this.#l(o), g.initChStyle(), Ft(), ot(
1423
- t.matchPath(".+", Z.FONT).flatMap((o) => Object.values(o).map((r) => `
1424
- @font-face {
1425
- font-family: '${r}';
1426
- src: url('${this.#s.searchPath(String(r), Z.FONT)}');
1427
- }
1428
- `)).join("") + `
1429
- .sn_tx {
1430
- pointer-events: none;
1431
- user-select: none;
1432
- -webkit-touch-callout: none;
1433
- box-sizing: border-box;
1434
- }
1435
- .sn_ch {
1436
- position: relative;
1437
- display: inline-block;
1438
- }
1439
- `
1440
- // 「sn_ch」と「sn_ch_in_〜」の中身が重複しているが、これは必須
1441
- ), this.#t({
1442
- name: "default",
1443
- wait: 500,
1444
- alpha: 0,
1445
- x: "=0.3",
1446
- y: "=0",
1447
- scale_x: 1,
1448
- scale_y: 1,
1449
- rotate: 0,
1450
- join: !0,
1451
- ease: "ease-out"
1452
- }), this.#l({
1453
- name: "default",
1454
- wait: 0,
1455
- alpha: 0,
1456
- x: "=0",
1457
- y: "=0",
1458
- scale_x: 1,
1459
- scale_y: 1,
1460
- rotate: 0,
1461
- join: !1,
1462
- ease: "ease-out"
1463
- });
1464
- }
1465
- // 文字出現演出
1466
- static #t(t) {
1467
- const e = g.ch_in_style(t), s = e.x.startsWith("=") ? `${e.nx * 100}%` : `${e.nx}px`, i = e.y.startsWith("=") ? `${e.ny * 100}%` : `${e.ny}px`, { name: n } = t;
1468
- return ot(`
1469
- .sn_ch_in_${n} {
1470
- position: relative;
1471
- display: inline-block;
1472
- }
1473
- .go_ch_in_${n} {
1474
- opacity: ${e.alpha};
1475
- position: relative;
1476
- display: inline-block;
1477
- animation: sn_ch_in_${n} ${e.wait}ms ${e.ease} 0s both;
1478
- }
1479
- @keyframes sn_ch_in_${n} {
1480
- from {transform: rotate(${e.rotate}deg) scale(${e.scale_x}, ${e.scale_y}) translate(${s}, ${i})}
1481
- to {opacity: 1; transform: none;}
1482
- }
1483
- `), !1;
1484
- }
1485
- // 文字消去演出
1486
- static #l(t) {
1487
- const e = g.ch_out_style(t), s = e.x.startsWith("=") ? `${e.nx * 100}%` : `${e.nx}px`, i = e.y.startsWith("=") ? `${e.ny * 100}%` : `${e.ny}px`, { name: n } = t;
1488
- return ot(`
1489
- .go_ch_out_${n} {
1490
- position: relative;
1491
- display: inline-block;
1492
- animation: go_ch_out_${n} ${e.wait}ms ${e.ease} 0s both;
1493
- }
1494
- @keyframes go_ch_out_${n} {
1495
- to {
1496
- opacity: ${e.alpha};
1497
- transform: rotate(${e.rotate}deg) scale(${e.scale_x}, ${e.scale_y}) translate(${s}, ${i});
1498
- }
1499
- `), !1;
1500
- }
1501
- static #p;
1502
- static #u;
1503
- static setEvtMng(t, e, s) {
1504
- this.#p = t, this.#u = e, g.setEvtMng(t, s);
1505
- }
1506
- // 文字ごとのウェイト
1507
- static #c = !1;
1508
- static #x = {};
1509
- static #i(t) {
1510
- this.#c = R(t, "enabled", this.#c), this.#e.setVal_Nochk("save", "const.sn.autowc.enabled", this.#c);
1511
- const { text: e } = t;
1512
- if ("text" in t != "time" in t) throw "[autowc] textとtimeは同時指定必須です";
1513
- if (this.#e.setVal_Nochk("save", "const.sn.autowc.text", e), !e)
1514
- return this.#e.setVal_Nochk("save", "const.sn.autowc.time", ""), !1;
1515
- const s = e.length;
1516
- if (this.#c && s === 0) throw '[autowc] enabled === false かつ text === "" は許されません';
1517
- const i = String(t.time).split(",");
1518
- if (i.length !== s) throw "[autowc] text文字数とtimeに記述された待ち時間(コンマ区切り)は同数にして下さい";
1519
- this.#x = {};
1520
- for (let n = 0; n < s; ++n) this.#x[e[n]] = V(i[n]);
1521
- return this.#e.setVal_Nochk("save", "const.sn.autowc.time", t.time), !1;
1522
- }
1523
- // バック
1524
- #d = 0;
1525
- #f = 0;
1526
- #y = !1;
1527
- #a = void 0;
1528
- #g = "";
1529
- // 背景画像無し(=単色塗り)
1530
- // 文字表示
1531
- #o = new g(this.ctn, () => this.canFocus(), P.#u);
1532
- #I = new pt();
1533
- #k = document.createElement("span");
1534
- // cssチェック・保存用
1535
- static #w = {
1536
- "text-align": 0,
1537
- "text-align-last": 0,
1538
- height: 0,
1539
- width: 0,
1540
- "padding-left": 0,
1541
- "padding-right": 0,
1542
- "padding-top": 0,
1543
- "padding-bottom": 0
1544
- };
1545
- #v = new W();
1546
- constructor() {
1547
- super(), this.ctn.addChild(this.#o), this.#I.init(this.#Q), this.ctn.addChild(this.#v), this.#v.name = "cntBtn", this.lay({ style: `width: ${S.stageW}px; height: ${S.stageH}px; font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', '游ゴシック Medium', meiryo, sans-serif; color: white; font-size: 24px; line-height: 1.5; padding: 16px;`, in_style: "default", out_style: "default", back_clear: "true" });
1548
- }
1549
- destroy() {
1550
- this.#a && (this.ctn.removeChild(this.#a).destroy(), this.#a = void 0), P.#r.pagebreak(), this.#o.destroy();
1551
- }
1552
- static destroy() {
1553
- this.#c = !1, this.#x = {}, this.#W = (t) => t;
1554
- }
1555
- set name(t) {
1556
- this.name_ = t, this.#o.name = t;
1557
- }
1558
- get name() {
1559
- return this.name_;
1560
- }
1561
- // getは継承しないらしい
1562
- cvsResize() {
1563
- this.#o.cvsResize();
1564
- }
1565
- cvsResizeChildren() {
1566
- for (const t of this.#v.children) t.cvsResize();
1567
- }
1568
- procSetX(t) {
1569
- this.#o.lay({ x: t });
1570
- }
1571
- procSetY(t) {
1572
- this.#o.lay({ y: t });
1573
- }
1574
- lay(t) {
1575
- if (super.lay(t), H.setXY(this.ctn, t, this.ctn), t[":id_tag"] = this.name_.slice(0, -7), pt.setting(t), this.#H(t), this.#o.lay(t), "r_align" in t && (this.#S = t.r_align ?? ""), this.#m = S.isSafari ? this.#o.tategaki ? (i, n) => `text-align: start; height: ${n}em; padding-top: ${i}; padding-bottom: ${i};` : (i, n) => `text-align: start; width: ${n}em; padding-left: ${i}; padding-right: ${i};` : this.#o.tategaki ? (i) => `text-align: justify; text-align-last: justify; padding-top: ${i}; padding-bottom: ${i};` : (i) => `text-align: justify; text-align-last: justify; padding-left: ${i}; padding-right: ${i};`, S.isFirefox && (this.#L = this.#M), "r_style" in t)
1576
- if (t.r_style) {
1577
- const i = document.createElement("span");
1578
- i.style.cssText = t.r_style;
1579
- const n = i.style.length, a = this.#k.style;
1580
- for (let o = 0; o < n; ++o) {
1581
- const r = i.style[o];
1582
- if (r in P.#w) {
1583
- it.myTrace(`${r}は指定できません`, "W");
1584
- continue;
1585
- }
1586
- const c = i.style[r];
1587
- c && (a[r] = c);
1588
- }
1589
- } else this.#k.style.cssText = "";
1590
- if ("alpha" in t) for (const i of this.#v.children) i.alpha = this.ctn.alpha;
1591
- this.#h(t), this.#V(t);
1592
- const e = F.procID + `TxtLayer lay name:${this.name_}`, s = this.#j(t, (i) => {
1593
- i && F.endProc(e);
1594
- });
1595
- return s && F.beginProc(e), s;
1596
- }
1597
- #h(t) {
1598
- const { in_style: e } = t;
1599
- if (!e) return;
1600
- const s = g.getChInStyle(e);
1601
- if (!s) throw `存在しないin_style【${e}】です`;
1602
- this.#b = e, this.#E = s.join;
1603
- }
1604
- #b = "";
1605
- #E = !0;
1606
- get width() {
1607
- return this.#o.getWidth;
1608
- }
1609
- get height() {
1610
- return this.#o.getHeight;
1611
- }
1612
- #V(t) {
1613
- const { out_style: e } = t;
1614
- if (!e) return;
1615
- if (!g.getChOutStyle(e)) throw `存在しないout_style【${e}】です`;
1616
- this.#F = e;
1617
- }
1618
- #F = "";
1619
- #z = new m();
1620
- #j(t, e) {
1621
- if ("back_clear" in t)
1622
- return R(t, "back_clear", !1) && (this.#d = 0, this.#f = 0, this.#y = !1, this.#g = ""), e(!1), !1;
1623
- this.#f = w(t, "b_alpha", this.#f), this.#y = R(t, "b_alpha_isfixed", this.#y);
1624
- const s = (this.#y ? 1 : Number(P.#e.getVal("sys:TextLayer.Back.Alpha"))) * this.#f;
1625
- if (t.b_pic) {
1626
- if (this.#g !== t.b_pic)
1627
- return this.#g = t.b_pic, this.#a && (this.ctn.removeChild(this.#a), this.#a.destroy()), this.#z = new m(this.#g, this.ctn, (i) => {
1628
- this.#a = i, i.name = "back(pic)", i.visible = s > 0, i.alpha = s, this.#o.setMySize(i.width, i.height), this.ctn.setChildIndex(i, 0), e(!0);
1629
- }), this.#z.ret;
1630
- } else "b_color" in t && (this.#d = vt(t, "b_color", 0), this.#a && (this.ctn.removeChild(this.#a), this.#a.destroy()), this.#g = "", this.ctn.addChildAt(
1631
- (this.#a = new U()).beginFill(this.#d, s).lineStyle(void 0).drawRect(0, 0, this.#o.getWidth, this.#o.getHeight).endFill(),
1632
- 0
1633
- ), this.#a.name = "back(color)");
1634
- return this.#a && (this.#a.visible = s > 0, this.#a.alpha = s), e(!1), !1;
1635
- }
1636
- chgBackAlpha(t) {
1637
- const e = this.#y ? this.#f : t * this.#f;
1638
- this.#a instanceof U && (this.#a && (this.ctn.removeChild(this.#a), this.#a.destroy()), this.ctn.addChildAt(
1639
- (this.#a = new U()).beginFill(this.#d, e).lineStyle(void 0).drawRect(0, 0, this.#o.getWidth, this.#o.getHeight).endFill(),
1640
- 0
1641
- ), this.#a.name = "back(color)"), this.#a && (this.#a.visible = e > 0, this.#a.alpha = e);
1642
- }
1643
- #H(t) {
1644
- "noffs" in t && (this.#N = t.noffs ?? "", this.#_ = new RegExp(`[ ${this.#N}]`)), "ffs" in t && (this.#O ??= "", this.#$ = this.#O === "" ? () => "" : (e) => this.#_.test(e) ? "" : ` font-feature-settings: ${this.#O};`);
1645
- }
1646
- #O = "";
1647
- #$ = (t) => "";
1648
- #N = "";
1649
- // eslint-disable-next-line no-irregular-whitespace
1650
- #_ = /[ ]/;
1651
- // Safariが全体に「font-feature-settings」した後、特定文字の「font-feature-settings: initial;」を受け付けてくれないのでわざわざ一つずつ指定
1652
- static chgDoRec(t) {
1653
- this.#W = t ? (e) => e : (e) => `<span class='offrec'>${e}</span>`;
1654
- }
1655
- static #W = (t) => t;
1656
- isCur = !1;
1657
- #m = () => "";
1658
- #L = (t, e, s, i = "") => {
1659
- if (!s) return ` style='${i}'`;
1660
- const n = t.length * 2;
1661
- if (n - e.length < 0) return ` style='text-align: ${s}; ${i}'`;
1662
- let a = "";
1663
- switch (s) {
1664
- case "justify":
1665
- a = this.#m("0", n);
1666
- break;
1667
- case "121":
1668
- a = this.#m(`calc(${(n - e.length) / (e.length * 2)}em)`, n);
1669
- break;
1670
- case "even":
1671
- a = this.#m(`calc(${(n - e.length) / (e.length + 1)}em)`, n);
1672
- break;
1673
- case "1ruby":
1674
- a = this.#m("1em", n);
1675
- break;
1676
- default:
1677
- a = `text-align: ${s};`;
1678
- }
1679
- return ` style='${a} ${i}'`;
1680
- };
1681
- #S = "";
1682
- #M(t, e, s, i = "") {
1683
- if (!s) return ` style='${i}'`;
1684
- const n = t.length * 2;
1685
- if (n - e.length < 0) return ` style='text-align: ${s}; ${i}'`;
1686
- let a = "";
1687
- switch (s) {
1688
- case "left":
1689
- a = "ruby-align: start;";
1690
- break;
1691
- case "center":
1692
- a = "ruby-align: center;";
1693
- break;
1694
- case "right":
1695
- a = "ruby-align: start;";
1696
- break;
1697
- case "justify":
1698
- a = "ruby-align: space-between;";
1699
- break;
1700
- case "121":
1701
- a = "ruby-align: space-around;";
1702
- break;
1703
- case "even":
1704
- {
1705
- const o = (n - e.length) / (e.length + 1);
1706
- a = "ruby-align: space-between; " + (this.#o.tategaki ? `padding-top: ${o}em; padding-bottom: ${o}em;` : `padding-left: ${o}em; padding-right: ${o}em;`);
1707
- }
1708
- break;
1709
- case "1ruby":
1710
- a = "ruby-align: space-between; " + (this.#o.tategaki ? "padding-top: 1em; padding-bottom: 1em;" : "padding-left: 1em; padding-right: 1em;");
1711
- break;
1712
- default:
1713
- a = `text-align: ${s};`;
1714
- }
1715
- return ` style='${a} ${i}'`;
1716
- }
1717
- tagCh(t) {
1718
- this.#I.putTxt(t);
1719
- }
1720
- #R = !1;
1721
- get needGoTxt() {
1722
- return this.#R;
1723
- }
1724
- #Q = (t, e) => {
1725
- let s = e;
1726
- P.#s.oCfg.debug.putCh && console.log(`🖊 文字表示 text:\`${t}\`(${t.charCodeAt(0).toString(16)}) ruby:\`${s}\` name:\`${this.name_}\``);
1727
- const i = s.split("|");
1728
- let n = "";
1729
- const [a, ...o] = i, r = o.join("|");
1730
- switch (i.length) {
1731
- case 1:
1732
- if (this.#R = !0, t === `
1733
- `) {
1734
- this.#B ? (this.#B = !1, n = "<ruby>&emsp;<rt>&emsp;</rt></ruby><br/>") : n = "<br/>";
1735
- break;
1736
- }
1737
- this.#B && (this.#B = !1, s === "" && (s = "&emsp;")), n = this.#Y(t, s, this.#S);
1738
- break;
1739
- default:
1740
- switch (a) {
1741
- // ルビ揃え指定と同時シリーズ
1742
- case "start":
1743
- // 初期値
1744
- case "left":
1745
- //(肩付き)先頭親文字から、ルビ間は密着
1746
- case "center":
1747
- //(中付き)センター合わせ、〃
1748
- case "right":
1749
- //(右/下揃え)末尾親文字から、〃
1750
- case "justify":
1751
- //(両端揃え)先頭から末尾親文字間に、ルビ間は均等にあける
1752
- case "121":
1753
- //(1-2-1(JIS))ルビの前後を比率1、ルビ間を比率2であける
1754
- case "even":
1755
- //(均等アキ)ルビの前後、ルビ間も均等にあける
1756
- case "1ruby":
1757
- this.#B = !1, this.#R = !0, n = this.#Y(t, r, a);
1758
- break;
1759
- case "gotxt":
1760
- this.#X(), this.#R ? (this.isCur && P.#r.recText(
1761
- this.#C.join("").replace(/^<ruby>&emsp;<rt>&emsp;<\/rt><\/ruby>(<br\/>)+/, "").replaceAll(/style='(anim\S+ [^;]+;\s*)+/g, "style='").replaceAll(/( style=''| data-(add|arg|cmd)='[^']+'|\n+|\t+)/g, "").replaceAll(/class='sn_ch[^']+/g, "class='sn_ch").replaceAll("display: none;", "").replaceAll("class='offrec'", "style='display: none;'")
1762
- ), this.#o.goTxt(this.#C, this.#J === 0), this.#R = !1, this.#J = 0) : this.isCur && this.#o.noticeCompTxt();
1763
- return;
1764
- // breakではない
1765
- case "add":
1766
- {
1767
- const c = JSON.parse(r), { style: f = "", wait: l = null } = c, { cl: p, sty: d } = this.#U(!0, l ? V(l) : null);
1768
- this.#C.push(`<span${p} style='${d} display: inline; ${f}'>`), delete c.style, this.#P(c);
1769
- }
1770
- return;
1771
- // breakではない
1772
- case "add_close":
1773
- this.#C.push("</span>"), this.#X();
1774
- return;
1775
- // breakではない
1776
- case "grp":
1777
- this.#R = !0;
1778
- {
1779
- const c = JSON.parse(r);
1780
- if (c.id ??= String(this.#C.length), c.id === "break") {
1781
- this.#o.dispBreak(c);
1782
- return;
1783
- }
1784
- this.#B = !1, c.delay = this.#J, c.r ??= "", c.style ??= "", c.r_style ??= "";
1785
- const { r: f, wait: l = null, r_style: p } = c, { cl: d, sty: h, lnk: u } = this.#U(!0, l ? V(l) : null);
1786
- n = `<span${d} style='${h} ${c.style}'><ruby><span data-cmd='grp' data-arg='${JSON.stringify(c)}'${u} style='${h} display: inline;'>&emsp;</span><rt${u}${this.#L(
1787
- " ",
1788
- f,
1789
- this.#S,
1790
- this.#k.style.cssText + (this.#T.at(-1)?.o.r_style ?? "") + p
1791
- )}>${c.r}</rt></ruby></span>`;
1792
- }
1793
- break;
1794
- case "tcy":
1795
- this.#B = !1, this.#R = !0;
1796
- {
1797
- const { t: c = "", r: f = "", wait: l = null, style: p = "", r_style: d = "" } = JSON.parse(r);
1798
- P.#e.doRecLog() && (this.#q += t + (s ? `《${s}》` : ""), this.#D += c);
1799
- const h = S.isSafari ? f.replaceAll(/[A-Za-z0-9]/g, (y) => String.fromCharCode(y.charCodeAt(0) + 65248)) : f, { cl: u, sty: x, lnk: v } = this.#U(!0, l ? V(l) : null);
1800
- n = `<span${u} style='${x}${this.#$(c)} ${p}'><ruby><span${v} style='${x} display: inline; text-combine-upright: all;'>${c}</span><rt${v}${this.#L(
1801
- c,
1802
- h,
1803
- this.#S,
1804
- this.#k.style.cssText + (this.#T.at(-1)?.o.r_style ?? "") + d
1805
- )}>${h}</rt></ruby></span>`;
1806
- }
1807
- break;
1808
- case "del":
1809
- g.delBreak();
1810
- return;
1811
- // breakではない
1812
- case "span":
1813
- this.#R = !0, this.#K(JSON.parse(r));
1814
- return;
1815
- // breakではない
1816
- case "link":
1817
- this.#R = !0;
1818
- {
1819
- const c = JSON.parse(r);
1820
- c[":link"] = " data-lnk='@'";
1821
- const { cl: f, sty: l, curpos: p } = this.#U(!1, c.wait ? V(c.wait) : null);
1822
- this.#C.push(`<span${f} style='${l} display: inline; ${c.style ?? ""}' ${p} data-arg='${r}'>`), delete c.style, this.#K(c);
1823
- }
1824
- return;
1825
- // breakではない
1826
- case "endlink":
1827
- this.#R = !0, this.#C.push("</span>"), this.#X();
1828
- return;
1829
- // breakではない
1830
- default:
1831
- this.#R = !0, n = this.#Y(t, s, this.#S);
1832
- }
1833
- break;
1834
- }
1835
- this.#C.push(P.#W(n));
1836
- };
1837
- #Y(t, e, s) {
1838
- const i = t === " " ? "&nbsp;" : t === " " ? "&emsp;" : t;
1839
- P.#e.doRecLog() && (this.#q += i + (e ? `《${e}》` : ""), t !== " " && (this.#D += t));
1840
- const { cl: n, sty: a, lnk: o } = this.#U(!0, null, t);
1841
- return e ? `<span${n} style='${a} ${this.#$(t)}'><ruby>${// 文字個別に出現させるため以下にも ${cl} が必要
1842
- Array.from(t).map((r, c) => `<span${n}${o} style='${c > 0 ? this.#U(!0, null, t).sty : a} display: inline;'>${r === " " ? "&nbsp;" : r === " " ? "&emsp;" : r}</span>`).join("")}<rt${o}${this.#L(
1843
- t,
1844
- e,
1845
- s,
1846
- this.#k.style.cssText + (this.#T.at(-1)?.o.r_style ?? "")
1847
- )}>${e}</rt></ruby></span>` : `<span${n} style='${a} ${this.#$(t)}'${o}>${i}</span>`;
1848
- }
1849
- #U(t, e, s = `
1850
- `) {
1851
- const i = this.#E ? e ?? this.#T.at(0)?.o.wait ?? (P.#c ? P.#x[s.at(0) ?? ""] ?? 0 : G.msecChWait) : 0;
1852
- P.#p.isSkipping ? this.#J = 0 : t && this.#E && (this.#J += V(i));
1853
- const n = `data-add='{"ch_in_style":"${this.#b}", "ch_out_style":"${this.#F}"}'`;
1854
- return {
1855
- cl: ` class='sn_ch sn_ch_yet sn_ch_in_${this.#b}'`,
1856
- // TxtStage.goTxt()はこれ単位で文字出現させる
1857
- sty: `animation-delay: ${this.#J}ms;${this.#T.at(-1)?.o.style ?? ""}`,
1858
- // TxtStage.goTxt()はこれ単位で文字出現させる
1859
- lnk: (this.#T.at(0)?.o[":link"] ?? "") + " " + n,
1860
- curpos: n
1861
- };
1862
- }
1863
- #J = 0;
1864
- #B = !0;
1865
- #C = [];
1866
- #T = [];
1867
- #P(t) {
1868
- this.#T.push({
1869
- o: t,
1870
- r_align: this.#S,
1871
- ch_in_style: this.#b,
1872
- ch_out_style: this.#F
1873
- }), t.r_align && (this.#S = t.r_align), this.#h(t), this.#V(t);
1874
- }
1875
- #X() {
1876
- const t = this.#T.pop();
1877
- t && (this.#S = t.r_align, this.#h({ in_style: t.ch_in_style }), this.#V({ out_style: t.ch_out_style }));
1878
- }
1879
- #K(t) {
1880
- const e = this.#T.at(-1);
1881
- if (!e) {
1882
- this.#P(t);
1883
- return;
1884
- }
1885
- e.o = { ...e.o, ...t }, !t.style && !t.r_style && (e.o.style = "", e.o.r_style = ""), t.r_align && (this.#S = t.r_align), this.#h(t), this.#V(t);
1886
- }
1887
- click = () => !this.ctn.interactiveChildren || !this.ctn.visible ? !1 : this.#o.skipChIn();
1888
- clearText() {
1889
- this.ctn.addChild(this.#o = this.#o.reNew()), this.#J = 0, this.#B = !0, this.#C = [], this.#q = "", this.#D = "", P.#r.pagebreak();
1890
- }
1891
- #q = "";
1892
- #D = "";
1893
- get pageText() {
1894
- return this.#q.replace("《&emsp;》", "");
1895
- }
1896
- get pagePlainText() {
1897
- return this.#D;
1898
- }
1899
- get enabled() {
1900
- return this.ctn.interactiveChildren;
1901
- }
1902
- set enabled(t) {
1903
- this.ctn.interactiveChildren = t;
1904
- }
1905
- addButton = (t) => new Promise((e) => {
1906
- t.key = `btn=[${this.#v.children.length}] ` + this.name_, t[":id_tag"] = t.key.slice(0, -7), R(t, "hint_tate", this.#o.tategaki);
1907
- const s = new z(t, P.#p, () => e(), () => this.canFocus());
1908
- s.name = JSON.stringify(t).replaceAll('"', "'"), this.#v.addChild(s);
1909
- });
1910
- canFocus() {
1911
- return (this.ctn.interactiveChildren ?? !1) && this.ctn.visible && P.#n(this);
1912
- }
1913
- clearLay(t) {
1914
- super.clearLay(t), this.clearText();
1915
- for (const e of this.#v.removeChildren()) e.destroy();
1916
- }
1917
- record = () => ({
1918
- ...super.record(),
1919
- enabled: this.enabled,
1920
- r_cssText: this.#k.style.cssText,
1921
- r_align: this.#S,
1922
- // バック
1923
- b_do: this.#a === void 0 ? void 0 : this.#a instanceof j ? "Sprite" : "Graphics",
1924
- b_pic: this.#g,
1925
- b_color: this.#d,
1926
- b_alpha: this.#f,
1927
- b_alpha_isfixed: this.#y,
1928
- ffs: this.#O,
1929
- txs: this.#o.record(),
1930
- strNoFFS: this.#N,
1931
- btns: this.#v.children.map((t) => t.name)
1932
- });
1933
- playback(t, e) {
1934
- super.playback(t, e), this.enabled = t.enabled, this.#k.style.cssText = t.r_cssText, this.#S = t.r_align, this.cvsResize(), this.#H(t), this.#o.playback(t.txs), this.#f = t.b_alpha, this.#y = t.b_alpha_isfixed, e.push(
1935
- new Promise((s) => {
1936
- const i = t.b_do ? t.b_do === "Sprite" ? { b_pic: t.b_pic } : { b_color: t.b_color } : { b_pic: "" };
1937
- i.b_alpha = t.b_alpha, i.b_alpha_isfixed = t.b_alpha_isfixed, this.#j(i, (n) => {
1938
- n && s();
1939
- }) || s();
1940
- }),
1941
- ...t.btns.map((s) => this.addButton(JSON.parse(s.replaceAll("'", '"')))).flat()
1942
- );
1943
- }
1944
- get cssText() {
1945
- return this.#o.cssText;
1946
- }
1947
- set cssText(t) {
1948
- this.#o.cssText = t;
1949
- }
1950
- snapshot(t, e) {
1951
- t.render(this.ctn, { clear: !1 }), this.#o.snapshot(t, e);
1952
- }
1953
- snapshot_end() {
1954
- this.#o.snapshot_end();
1955
- }
1956
- makeDesignCast(t) {
1957
- this.ctn.visible && this.#o.makeDesignCast(t);
1958
- }
1959
- makeDesignCastChildren(t) {
1960
- if (this.ctn.visible)
1961
- for (const e of this.#v.children) e.makeDesignCast(t);
1962
- }
1963
- showDesignCast() {
1964
- this.#o.showDesignCast();
1965
- }
1966
- showDesignCastChildren() {
1967
- for (const t of this.#v.children) t.showDesignCast();
1968
- }
1969
- dump() {
1970
- return this.#Q("", "gotxt|"), super.dump() + `, "enabled":"${this.enabled}", ${this.#o.dump()}, "b_pic":"${this.#g}", "b_color":"${this.#d}", "b_alpha":${this.#f}, "b_alpha_isfixed":"${this.#y}", "width":${this.#o.getWidth}, "height":${this.#o.getHeight}, "pixi_obj":[${this.ctn.children.map((t) => `{"class":"${t instanceof j ? "Sprite" : t instanceof U ? "Graphics" : t instanceof W ? "Container" : "?"}", "name":"${t.name}", "alpha":${t.alpha}, "x":${t.x}, "y":${t.y}, "visible":"${t.visible}"}`).join(",")}], "button":[${this.#v.children.map((t) => t.children[0]?.name ?? "{}").join(",")}]`;
1971
- }
1972
- }
1973
- class C {
44
+ class u {
1974
45
  constructor(t, e, s) {
1975
- this.appPixi = e, this.val = s, t.add_frame = (i) => this.#p(i), t.let_frame = (i) => this.#f(i), t.set_frame = (i) => this.#y(i), t.frame = (i) => this.#g(i), t.tsy_frame = (i) => this.#o(i);
46
+ this.appPixi = e, this.val = s, t.add_frame = (i) => this.#x(i), t.let_frame = (i) => this.#d(i), t.set_frame = (i) => this.#N(i), t.frame = (i) => this.#S(i), t.tsy_frame = (i) => this.#w(i);
1976
47
  }
1977
- static #s;
1978
48
  static #e;
1979
- static #n;
49
+ static #t;
50
+ static #i;
1980
51
  static init(t, e, s) {
1981
- C.#s = t, C.#e = e, C.#n = s;
52
+ u.#e = t, u.#t = e, u.#i = s;
1982
53
  }
1983
- #r;
54
+ #o;
1984
55
  setEvtMng(t) {
1985
- this.#r = t;
56
+ this.#o = t;
1986
57
  }
1987
58
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
1988
- #t = /* @__PURE__ */ Object.create(null);
59
+ #c = /* @__PURE__ */ Object.create(null);
1989
60
  destroy() {
1990
- for (const t of Object.values(this.#t)) t.parentElement.removeChild(t);
1991
- this.#t = /* @__PURE__ */ Object.create(null);
61
+ for (const t of Object.values(this.#c)) t.parentElement.removeChild(t);
62
+ this.#c = /* @__PURE__ */ Object.create(null);
1992
63
  }
1993
64
  hideAllFrame() {
1994
- for (const [t, { style: e }] of Object.entries(this.#t))
65
+ for (const [t, { style: e }] of Object.entries(this.#c))
1995
66
  this.#l[t] = e.display !== "none", e.display = "none";
1996
67
  }
1997
68
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
1998
69
  #l = /* @__PURE__ */ Object.create(null);
1999
70
  restoreAllFrame() {
2000
71
  for (const [t, e] of Object.entries(this.#l)) {
2001
- const s = this.#t[t];
72
+ const s = this.#c[t];
2002
73
  s && (s.style.display = e ? "inline" : "none");
2003
74
  }
2004
75
  this.#l = /* @__PURE__ */ Object.create(null);
2005
76
  }
2006
77
  // HTMLフレーム
2007
78
  // フレーム追加
2008
- #p(t) {
2009
- const { id: e, src: s, alpha: i = 1, scale_x: n = 1, scale_y: a = 1, rotate: o = 0 } = t;
79
+ #x(t) {
80
+ const { id: e, src: s, alpha: i = 1, scale_x: n = 1, scale_y: o = 1, rotate: r = 0 } = t;
2010
81
  if (!e) throw "idは必須です";
2011
82
  if (!s) throw "srcは必須です";
2012
- const r = "const.sn.frm." + e;
2013
- if (this.val.getVal(`tmp:${r}`)) throw `frame【${e}】はすでにあります`;
2014
- const c = R(t, "visible", !0), f = t.b_color ? ` background-color: ${t.b_color};` : "", l = this.#c(t);
2015
- C.#n.cvs.insertAdjacentHTML("beforebegin", `<iframe id="${e}" style="opacity: ${i}; ${f} position: absolute; left:${C.#e.ofsLeft4elm + l.x * C.#e.cvsScale}px; top: ${C.#e.ofsTop4elm + l.y * C.#e.cvsScale}px; z-index: 1; border: 0px; overflow: hidden; display: ${c ? "inline" : "none"}; transform: scale(${n}, ${a}) rotate(${o}deg);" width="${l.width * C.#e.cvsScale}" height="${l.height * C.#e.cvsScale}"></iframe>`);
2016
- const p = F.procID + `add_frame id:${e}`;
2017
- F.beginProc(p);
2018
- const d = C.#s.searchPath(s, Z.HTML), h = new Q().add({ name: s, url: d, xhrType: D.XHR_RESPONSE_TYPE.TEXT });
2019
- return C.#e.arg.crypto && h.use(
83
+ const l = "const.sn.frm." + e;
84
+ if (this.val.getVal(`tmp:${l}`)) throw `frame【${e}】はすでにあります`;
85
+ const f = w(t, "visible", !0), d = t.b_color ? ` background-color: ${t.b_color};` : "", h = this.#b(t);
86
+ u.#i.cvs.insertAdjacentHTML("beforebegin", `<iframe id="${e}" style="opacity: ${i}; ${d} position: absolute; left:${u.#t.ofsLeft4elm + h.x * u.#t.cvsScale}px; top: ${u.#t.ofsTop4elm + h.y * u.#t.cvsScale}px; z-index: 1; border: 0px; overflow: hidden; display: ${f ? "inline" : "none"}; transform: scale(${n}, ${o}) rotate(${r}deg);" width="${h.width * u.#t.cvsScale}" height="${h.height * u.#t.cvsScale}"></iframe>`);
87
+ const p = C.procID + `add_frame id:${e}`;
88
+ C.beginProc(p);
89
+ const c = u.#e.searchPath(s, H.HTML), a = new F().add({ name: s, url: c, xhrType: D.XHR_RESPONSE_TYPE.TEXT });
90
+ return u.#t.arg.crypto && a.use(
2020
91
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
2021
- (u, x) => void C.#e.dec(u.extension, u.data).then((v) => {
2022
- u.data = v, x();
2023
- }).catch((v) => {
2024
- C.#n.errScript(`[add_frame]Html ロード失敗です src:${u.name} ${v}`, !1), x();
92
+ (y, k) => void u.#t.dec(y.extension, y.data).then((b) => {
93
+ y.data = b, k();
94
+ }).catch((b) => {
95
+ u.#i.errScript(`[add_frame]Html ロード失敗です src:${y.name} ${b}`, !1), k();
2025
96
  })
2026
- ), h.load((u, x) => {
2027
- const v = document.getElementById(e);
2028
- this.#t[e] = v, this.#u[e] = !1;
2029
- const y = d.lastIndexOf("/") + 1, b = d.slice(0, y), E = b.slice(0, y);
2030
- v.srcdoc = String(x[s]?.data).replace("sn_repRes();", "").replaceAll(
97
+ ), a.load((y, k) => {
98
+ const b = document.getElementById(e);
99
+ this.#c[e] = b, this.#y[e] = !1;
100
+ const g = c.lastIndexOf("/") + 1, S = c.slice(0, g), j = S.slice(0, g);
101
+ b.srcdoc = String(k[s]?.data).replace("sn_repRes();", "").replaceAll(
2031
102
  /\s(?:src|href)=(["'])(\S+?)\1/g,
2032
103
  // 【\s】が大事、data-src弾く
2033
- (_, T, $) => $.startsWith("../") ? E + _.slice(3) : _.replace("./", "").replace(T, T + b)
2034
- ), v.srcdoc.includes("true/*WEBP*/;") && (v.srcdoc = v.srcdoc.replaceAll(
104
+ (m, N, L) => L.startsWith("../") ? j + m.slice(3) : m.replace("./", "").replace(N, N + S)
105
+ ), b.srcdoc.includes("true/*WEBP*/;") && (b.srcdoc = b.srcdoc.replaceAll(
2035
106
  /data-src="(.+?\.)(?:jpe?g|png)/g,
2036
- (_, T) => `data-src="${T}webp`
2037
- )), v.onload = () => {
2038
- F.endProc(p), this.val.setVal_Nochk("tmp", r, !0), this.val.setVal_Nochk("tmp", r + ".alpha", i), this.val.setVal_Nochk("tmp", r + ".x", l.x), this.val.setVal_Nochk("tmp", r + ".y", l.y), this.val.setVal_Nochk("tmp", r + ".scale_x", n), this.val.setVal_Nochk("tmp", r + ".scale_y", a), this.val.setVal_Nochk("tmp", r + ".rotate", o), this.val.setVal_Nochk("tmp", r + ".width", l.width), this.val.setVal_Nochk("tmp", r + ".height", l.height), this.val.setVal_Nochk("tmp", r + ".visible", c);
2039
- const _ = v.contentWindow;
2040
- this.#r.resvFlameEvent(_.document.body), _.sn_repRes?.((T) => C.#x(T.dataset.src ?? "", T));
107
+ (m, N) => `data-src="${N}webp`
108
+ )), b.onload = () => {
109
+ C.endProc(p), this.val.setVal_Nochk("tmp", l, !0), this.val.setVal_Nochk("tmp", l + ".alpha", i), this.val.setVal_Nochk("tmp", l + ".x", h.x), this.val.setVal_Nochk("tmp", l + ".y", h.y), this.val.setVal_Nochk("tmp", l + ".scale_x", n), this.val.setVal_Nochk("tmp", l + ".scale_y", o), this.val.setVal_Nochk("tmp", l + ".rotate", r), this.val.setVal_Nochk("tmp", l + ".width", h.width), this.val.setVal_Nochk("tmp", l + ".height", h.height), this.val.setVal_Nochk("tmp", l + ".visible", f);
110
+ const m = b.contentWindow;
111
+ this.#o.resvFlameEvent(m.document.body), m.sn_repRes?.((N) => u.#_(N.dataset.src ?? "", N));
2041
112
  };
2042
113
  }), !0;
2043
114
  }
2044
- #u = {};
115
+ #y = {};
2045
116
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2046
117
  getFrmDisabled(t) {
2047
- return this.#u[t];
118
+ return this.#y[t];
2048
119
  }
2049
- #c(t) {
2050
- const e = { ...t }, s = C.#e.resolution;
120
+ #b(t) {
121
+ const e = { ...t };
2051
122
  return new DOMRect(
2052
- w(e, "x", 0) * s,
2053
- w(e, "y", 0) * s,
2054
- w(e, "width", S.stageW) * s,
2055
- w(e, "height", S.stageH) * s
123
+ v(e, "x", 0),
124
+ v(e, "y", 0),
125
+ v(e, "width", x.stageW),
126
+ v(e, "height", x.stageH)
2056
127
  );
2057
128
  }
2058
- static #x(t, e, s) {
2059
- const i = this.#d[t];
129
+ static #_(t, e, s) {
130
+ const i = this.#f[t];
2060
131
  if (i) {
2061
132
  e.src = i, s && (e.onload = () => s(e));
2062
133
  return;
2063
134
  }
2064
- const n = this.#i[t];
135
+ const n = this.#m[t];
2065
136
  if (n) {
2066
137
  n.push(e);
2067
138
  return;
2068
139
  }
2069
- this.#i[t] = [e];
2070
- const [a = "", o = ""] = t.split("?"), r = C.#s.searchPath(a, Z.SP_GSM), c = new Q().add({ name: t, url: r, xhrType: D.XHR_RESPONSE_TYPE.BUFFER });
2071
- C.#e.use4ViteElectron(t, r, c, C.#n) || C.#e.arg.crypto && r.endsWith(".bin") && c.use((f, l) => {
2072
- if (f.extension !== "bin") {
2073
- l();
140
+ this.#m[t] = [e];
141
+ const [o = "", r = ""] = t.split("?"), l = u.#e.searchPath(o, H.SP_GSM), f = new F().add({ name: t, url: l, xhrType: D.XHR_RESPONSE_TYPE.BUFFER });
142
+ u.#t.use4ViteElectron(t, l, f, u.#i) || u.#t.arg.crypto && l.endsWith(".bin") && f.use((d, h) => {
143
+ if (d.extension !== "bin") {
144
+ h();
2074
145
  return;
2075
146
  }
2076
- C.#e.decAB(f.data).then((p) => {
2077
- f.data = p, p instanceof HTMLImageElement && (f.type = D.TYPE.IMAGE), l();
147
+ u.#t.decAB(d.data).then((p) => {
148
+ d.data = p, p instanceof HTMLImageElement && (d.type = D.TYPE.IMAGE), h();
2078
149
  }).catch((p) => {
2079
- C.#n.errScript(`FrameMng loadPic ロード失敗です fn:${f.name} ${p}`, !1), l();
150
+ u.#i.errScript(`FrameMng loadPic ロード失敗です fn:${d.name} ${p}`, !1), h();
2080
151
  });
2081
- }), c.load((f, l) => {
2082
- for (const [p, { data: { src: d } }] of Object.entries(l)) {
2083
- const h = this.#d[p] = d + // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
2084
- (d.startsWith("blob:") || d.startsWith("data:") ? "" : o ? "?" + o : ""), u = this.#i[p];
2085
- if (u) for (const x of u)
2086
- x.src = h, s && (x.onload = () => s(x));
2087
- delete this.#i[p];
152
+ }), f.load((d, h) => {
153
+ for (const [p, { data: { src: c } }] of Object.entries(h)) {
154
+ const a = this.#f[p] = c + // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
155
+ (c.startsWith("blob:") || c.startsWith("data:") ? "" : r ? "?" + r : ""), y = this.#m[p];
156
+ if (y) for (const k of y)
157
+ k.src = a, s && (k.onload = () => s(k));
158
+ delete this.#m[p];
2088
159
  }
2089
160
  });
2090
161
  }
2091
- static #i = {};
2092
- static #d = {};
162
+ static #m = {};
163
+ static #f = {};
2093
164
  cvsResize() {
2094
- for (const [t, e] of Object.entries(this.#t)) {
2095
- const s = "const.sn.frm." + t, i = Number(this.val.getVal(s + ".x")), n = Number(this.val.getVal(s + ".y")), a = Number(this.val.getVal(s + ".width")), o = Number(this.val.getVal(s + ".height"));
2096
- e.style.left = `${C.#e.ofsLeft4elm + i * C.#e.cvsScale}px`, e.style.top = `${C.#e.ofsTop4elm + n * C.#e.cvsScale}px`, e.width = String(a * C.#e.cvsScale), e.height = String(o * C.#e.cvsScale);
165
+ for (const [t, e] of Object.entries(this.#c)) {
166
+ const s = "const.sn.frm." + t, i = Number(this.val.getVal(s + ".x")), n = Number(this.val.getVal(s + ".y")), o = Number(this.val.getVal(s + ".width")), r = Number(this.val.getVal(s + ".height"));
167
+ e.style.left = `${u.#t.ofsLeft4elm + i * u.#t.cvsScale}px`, e.style.top = `${u.#t.ofsTop4elm + n * u.#t.cvsScale}px`, e.width = String(o * u.#t.cvsScale), e.height = String(r * u.#t.cvsScale);
2097
168
  }
2098
169
  }
2099
170
  // フレーム変数を取得
2100
- #f(t) {
171
+ #d(t) {
2101
172
  const { id: e, var_name: s } = t;
2102
173
  if (!e) throw "idは必須です";
2103
174
  const i = document.getElementById(e);
@@ -2105,33 +176,33 @@ class C {
2105
176
  const n = "const.sn.frm." + e;
2106
177
  if (!this.val.getVal(`tmp:${n}`)) throw `frame【${e}】が読み込まれていません`;
2107
178
  if (!s) throw "var_nameは必須です";
2108
- const a = i.contentWindow;
2109
- if (!Object.hasOwn(a, s)) throw `frame【${e}】に変数/関数【${s}】がありません。変数は var付きにして下さい`;
2110
- const o = a[s];
179
+ const o = i.contentWindow;
180
+ if (!Object.hasOwn(o, s)) throw `frame【${e}】に変数/関数【${s}】がありません。変数は var付きにして下さい`;
181
+ const r = o[s];
2111
182
  return this.val.setVal_Nochk(
2112
183
  "tmp",
2113
184
  n + "." + s,
2114
185
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call
2115
- R(t, "function", !1) ? o() : o
186
+ w(t, "function", !1) ? r() : r
2116
187
  ), !1;
2117
188
  }
2118
189
  // フレーム変数に設定
2119
- #y(t) {
190
+ #N(t) {
2120
191
  const { id: e, var_name: s, text: i } = t;
2121
192
  if (!e) throw "idは必須です";
2122
193
  const n = document.getElementById(e);
2123
194
  if (!n) throw `id【${e}】はフレームではありません`;
2124
- const a = "const.sn.frm." + e;
2125
- if (!this.val.getVal(`tmp:${a}`)) throw `frame【${e}】が読み込まれていません`;
195
+ const o = "const.sn.frm." + e;
196
+ if (!this.val.getVal(`tmp:${o}`)) throw `frame【${e}】が読み込まれていません`;
2126
197
  if (!s) throw "var_nameは必須です";
2127
198
  if (!i) throw "textは必須です";
2128
- this.val.setVal_Nochk("tmp", a + "." + s, i);
2129
- const o = n.contentWindow;
2130
- return o[s] = i, !1;
199
+ this.val.setVal_Nochk("tmp", o + "." + s, i);
200
+ const r = n.contentWindow;
201
+ return r[s] = i, !1;
2131
202
  }
2132
203
  // フレームに設定
2133
- #a = 1;
2134
- #g(t) {
204
+ #n = 1;
205
+ #S(t) {
2135
206
  const { id: e } = t;
2136
207
  if (!e) throw "idは必須です";
2137
208
  const s = document.getElementById(e);
@@ -2139,90 +210,90 @@ class C {
2139
210
  const i = "const.sn.frm." + e;
2140
211
  if (!this.val.getVal("tmp:" + i)) throw `frame【${e}】が読み込まれていません`;
2141
212
  const n = s.style;
2142
- if (R(t, "float", !1) ? n.zIndex = `${++this.#a}` : "index" in t ? n.zIndex = `${w(t, "index", 0)}` : t.dive && (n.zIndex = `-${++this.#a}`), "alpha" in t) {
2143
- const o = n.opacity = String(t.alpha);
2144
- this.val.setVal_Nochk("tmp", i + ".alpha", o);
213
+ if (w(t, "float", !1) ? n.zIndex = `${++this.#n}` : "index" in t ? n.zIndex = `${v(t, "index", 0)}` : t.dive && (n.zIndex = `-${++this.#n}`), "alpha" in t) {
214
+ const r = n.opacity = String(t.alpha);
215
+ this.val.setVal_Nochk("tmp", i + ".alpha", r);
2145
216
  }
2146
- const a = this.#c(t);
2147
- if (("x" in t || "y" in t) && (n.left = `${C.#e.ofsLeft4elm + a.x * C.#e.cvsScale}px`, n.top = `${C.#e.ofsTop4elm + a.y * C.#e.cvsScale}px`, this.val.setVal_Nochk("tmp", i + ".x", a.x), this.val.setVal_Nochk("tmp", i + ".y", a.y)), "scale_x" in t || "scale_y" in t || "rotate" in t) {
2148
- const o = w(t, "scale_x", 1), r = w(t, "scale_y", 1), c = w(t, "rotate", 0);
2149
- n.transform = `scale(${o}, ${r}) rotate(${c}deg)`, this.val.setVal_Nochk("tmp", i + ".scale_x", o), this.val.setVal_Nochk("tmp", i + ".scale_y", r), this.val.setVal_Nochk("tmp", i + ".rotate", c);
217
+ const o = this.#b(t);
218
+ if (("x" in t || "y" in t) && (n.left = `${u.#t.ofsLeft4elm + o.x * u.#t.cvsScale}px`, n.top = `${u.#t.ofsTop4elm + o.y * u.#t.cvsScale}px`, this.val.setVal_Nochk("tmp", i + ".x", o.x), this.val.setVal_Nochk("tmp", i + ".y", o.y)), "scale_x" in t || "scale_y" in t || "rotate" in t) {
219
+ const r = v(t, "scale_x", 1), l = v(t, "scale_y", 1), f = v(t, "rotate", 0);
220
+ n.transform = `scale(${r}, ${l}) rotate(${f}deg)`, this.val.setVal_Nochk("tmp", i + ".scale_x", r), this.val.setVal_Nochk("tmp", i + ".scale_y", l), this.val.setVal_Nochk("tmp", i + ".rotate", f);
2150
221
  }
2151
- if ("width" in t && (s.width = String(a.width * C.#e.cvsScale), this.val.setVal_Nochk("tmp", i + ".width", a.width)), "height" in t && (s.height = String(a.height * C.#e.cvsScale), this.val.setVal_Nochk("tmp", i + ".height", a.height)), "visible" in t) {
2152
- const o = R(t, "visible", !0);
2153
- n.display = o ? "inline" : "none", this.val.setVal_Nochk("tmp", i + ".visible", o);
222
+ if ("width" in t && (s.width = String(o.width * u.#t.cvsScale), this.val.setVal_Nochk("tmp", i + ".width", o.width)), "height" in t && (s.height = String(o.height * u.#t.cvsScale), this.val.setVal_Nochk("tmp", i + ".height", o.height)), "visible" in t) {
223
+ const r = w(t, "visible", !0);
224
+ n.display = r ? "inline" : "none", this.val.setVal_Nochk("tmp", i + ".visible", r);
2154
225
  }
2155
226
  if ("b_color" in t && (n.backgroundColor = t.b_color), "disabled" in t) {
2156
- const o = this.#u[e] = R(t, "disabled", !0), r = s.contentDocument.body;
2157
- for (const c of [
2158
- ...Array.from(r.getElementsByTagName("input")),
2159
- ...Array.from(r.getElementsByTagName("select"))
2160
- ]) c.disabled = o;
227
+ const r = this.#y[e] = w(t, "disabled", !0), l = s.contentDocument.body;
228
+ for (const f of [
229
+ ...Array.from(l.getElementsByTagName("input")),
230
+ ...Array.from(l.getElementsByTagName("select"))
231
+ ]) f.disabled = r;
2161
232
  }
2162
233
  return !1;
2163
234
  }
2164
235
  // フレームをトゥイーン開始
2165
- #o(t) {
2166
- const { id: e, alpha: s, x: i, y: n, scale_x: a, scale_y: o, rotate: r, width: c, height: f } = t;
236
+ #w(t) {
237
+ const { id: e, alpha: s, x: i, y: n, scale_x: o, scale_y: r, rotate: l, width: f, height: d } = t;
2167
238
  if (!e) throw "idは必須です";
2168
- const l = document.getElementById(e);
2169
- if (!l) throw `id【${e}】はフレームではありません`;
239
+ const h = document.getElementById(e);
240
+ if (!h) throw `id【${e}】はフレームではありません`;
2170
241
  const p = "const.sn.frm." + e;
2171
242
  if (!this.val.getVal(`tmp:${p}`, 0)) throw `frame【${e}】が読み込まれていません`;
2172
- const d = {};
2173
- s && (d.a = Number(l.style.opacity)), (i || n || a || o || r) && (d.x = Number(this.val.getVal(`tmp:${p}.x`)), d.y = Number(this.val.getVal(`tmp:${p}.y`)), d.sx = Number(this.val.getVal(`tmp:${p}.scale_x`)), d.sy = Number(this.val.getVal(`tmp:${p}.scale_y`)), d.r = Number(this.val.getVal(`tmp:${p}.rotate`))), c && (d.w = Number(this.val.getVal(`tmp:${p}.width`))), f && (d.h = Number(this.val.getVal(`tmp:${p}.height`)));
2174
- const h = B.cnvTweenArg(t, d);
2175
- let u = () => {
243
+ const c = {};
244
+ s && (c.a = Number(h.style.opacity)), (i || n || o || r || l) && (c.x = Number(this.val.getVal(`tmp:${p}.x`)), c.y = Number(this.val.getVal(`tmp:${p}.y`)), c.sx = Number(this.val.getVal(`tmp:${p}.scale_x`)), c.sy = Number(this.val.getVal(`tmp:${p}.scale_y`)), c.r = Number(this.val.getVal(`tmp:${p}.rotate`))), f && (c.w = Number(this.val.getVal(`tmp:${p}.width`))), d && (c.h = Number(this.val.getVal(`tmp:${p}.height`)));
245
+ const a = _.cnvTweenArg(t, c);
246
+ let y = () => {
2176
247
  };
2177
- s && (w(h, "alpha", 0), u = () => {
2178
- l.style.opacity = String(d.a), this.val.setVal_Nochk("tmp", "alpha", d.a);
248
+ s && (v(a, "alpha", 0), y = () => {
249
+ h.style.opacity = String(c.a), this.val.setVal_Nochk("tmp", "alpha", c.a);
2179
250
  });
2180
- let x = () => {
251
+ let k = () => {
2181
252
  };
2182
- const v = this.#c(h);
2183
- (i || n || a || o || r) && (v.x, v.y, w(h, "scale_x", 1), w(h, "scale_y", 1), w(h, "rotate", 0), x = () => {
2184
- l.style.left = `${// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2185
- C.#e.ofsLeft4elm + d.x * C.#e.cvsScale} px`, l.style.top = `${// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2186
- C.#e.ofsTop4elm + d.y * C.#e.cvsScale} px`, l.style.transform = `scale(${d.sx}, ${d.sy}) rotate(${d.r}deg)`, this.val.setVal_Nochk("tmp", p + ".x", d.x), this.val.setVal_Nochk("tmp", p + ".y", d.y), this.val.setVal_Nochk("tmp", p + ".scale_x", d.sx), this.val.setVal_Nochk("tmp", p + ".scale_y", d.sy), this.val.setVal_Nochk("tmp", p + ".rotate", d.r);
253
+ const b = this.#b(a);
254
+ (i || n || o || r || l) && (b.x, b.y, v(a, "scale_x", 1), v(a, "scale_y", 1), v(a, "rotate", 0), k = () => {
255
+ h.style.left = `${// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
256
+ u.#t.ofsLeft4elm + c.x * u.#t.cvsScale} px`, h.style.top = `${// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
257
+ u.#t.ofsTop4elm + c.y * u.#t.cvsScale} px`, h.style.transform = `scale(${c.sx}, ${c.sy}) rotate(${c.r}deg)`, this.val.setVal_Nochk("tmp", p + ".x", c.x), this.val.setVal_Nochk("tmp", p + ".y", c.y), this.val.setVal_Nochk("tmp", p + ".scale_x", c.sx), this.val.setVal_Nochk("tmp", p + ".scale_y", c.sy), this.val.setVal_Nochk("tmp", p + ".rotate", c.r);
2187
258
  });
2188
- let y = () => {
259
+ let g = () => {
2189
260
  };
2190
- c && (v.width, y = () => {
2191
- l.width = `${d.w * C.#e.cvsScale} px`, this.val.setVal_Nochk("tmp", p + ".width", d.w);
261
+ f && (b.width, g = () => {
262
+ h.width = `${c.w * u.#t.cvsScale} px`, this.val.setVal_Nochk("tmp", p + ".width", c.w);
2192
263
  });
2193
- let b = () => {
264
+ let S = () => {
2194
265
  };
2195
- return f && (v.height, b = () => {
2196
- l.height = `${d.h * C.#e.cvsScale} px`, this.val.setVal_Nochk("tmp", p + ".height", d.h);
2197
- }), this.appPixi.stage.interactive = !1, B.tween(`frm
2198
- ${e}`, t, d, B.cnvTweenArg(t, d), () => {
2199
- u(), x(), y(), b();
266
+ return d && (b.height, S = () => {
267
+ h.height = `${c.h * u.#t.cvsScale} px`, this.val.setVal_Nochk("tmp", p + ".height", c.h);
268
+ }), this.appPixi.stage.interactive = !1, _.tween(`frm
269
+ ${e}`, t, c, _.cnvTweenArg(t, c), () => {
270
+ y(), k(), g(), S();
2200
271
  }, () => {
2201
272
  this.appPixi.stage.interactive = !0;
2202
273
  }, () => {
2203
274
  }), !1;
2204
275
  }
2205
276
  }
2206
- class Gt {
277
+ class ht {
2207
278
  // 🍚
2208
279
  constructor(t, e, s) {
2209
- this.oCfg = t, this.hTag = e, this.val = s, e.rec_ch = (i) => this.#n(i), e.rec_r = (i) => this.#r(i), e.reset_rec = (i) => this.#t(i), s.defTmp("const.sn.log.json", () => {
2210
- this.#s.text = // 🌾
2211
- this.#s.text.replaceAll("</span><span class='sn_ch'>", "");
2212
- const i = [...this.#e, this.#s];
280
+ this.oCfg = t, this.hTag = e, this.val = s, e.rec_ch = (i) => this.#i(i), e.rec_r = (i) => this.#o(i), e.reset_rec = (i) => this.#c(i), s.defTmp("const.sn.log.json", () => {
281
+ this.#e.text = // 🌾
282
+ this.#e.text.replaceAll("</span><span class='sn_ch'>", "");
283
+ const i = [...this.#t, this.#e];
2213
284
  return JSON.stringify(i);
2214
285
  }), this.recText("");
2215
286
  }
2216
- #s = { text: "" };
287
+ #e = { text: "" };
2217
288
  // 🌾
2218
- #e = [];
289
+ #t = [];
2219
290
  // [ch] からコールされる
2220
291
  // [ch] // 文字を追加する
2221
292
  // recText(text: string) コール
2222
293
  // 🌾this.#LastLog = {text}; // 置換でよい
2223
294
  // 🍊save:const.sn.sLog = 🦀const.sn.log.json // これを起動したい
2224
295
  recText(t) {
2225
- this.#s.text = t, this.val.setVal_Nochk(
296
+ this.#e.text = t, this.val.setVal_Nochk(
2226
297
  "save",
2227
298
  "const.sn.sLog",
2228
299
  // 🍊 リプレイ時の回復用
@@ -2232,8 +303,8 @@ class Gt {
2232
303
  }
2233
304
  //MARK: 履歴書き込み
2234
305
  // 🌾this.#LastLog = {...hArg, text: 🌾this.#LastLog.text};
2235
- #n(t) {
2236
- return this.#s = { ...t, text: this.#s.text }, t.text ? (t.record = !0, t.style ??= "", t.style += "display: none;", t.wait = 0, this.hTag.ch(t)) : (this.val.setVal_Nochk(
306
+ #i(t) {
307
+ return this.#e = { ...t, text: this.#e.text }, t.text ? (t.record = !0, t.style ??= "", t.style += "display: none;", t.wait = 0, this.hTag.ch(t)) : (this.val.setVal_Nochk(
2237
308
  "save",
2238
309
  "const.sn.sLog",
2239
310
  // 🍊 リプレイ時の回復用
@@ -2242,124 +313,124 @@ class Gt {
2242
313
  ), !1);
2243
314
  }
2244
315
  //MARK: 履歴改行
2245
- #r(t) {
2246
- return this.#n({ ...t, text: "[r]" });
316
+ #o(t) {
317
+ return this.#i({ ...t, text: "[r]" });
2247
318
  }
2248
319
  //MARK: 履歴リセット
2249
320
  // 以下をクリア。text で置き換え値を設定できる
2250
321
  // 🌾this.#LastLog = {text: hArg.text ?? ''};
2251
322
  // 🍚this.#aLog = []
2252
323
  // 🍊save:const.sn.sLog= hArg.text ?[{text:"${hArg.text}"}] : []
2253
- #t(t) {
2254
- return this.#e = [], t.text ??= "", this.#s = { text: t.text }, this.val.setVal_Nochk("save", "const.sn.sLog", JSON.stringify([this.#s])), !1;
324
+ #c(t) {
325
+ return this.#t = [], t.text ??= "", this.#e = { text: t.text }, this.val.setVal_Nochk("save", "const.sn.sLog", JSON.stringify([this.#e])), !1;
2255
326
  }
2256
327
  //MARK: 履歴改ページ
2257
328
  pagebreak() {
2258
- this.#s.text = // 🌾
2259
- this.#s.text.replaceAll("</span><span class='sn_ch'>", ""), this.#s.text && (this.#e.push(this.#s) > this.oCfg.log.max_len && (this.#e = this.#e.slice(-this.oCfg.log.max_len)), this.#s = { text: "" });
329
+ this.#e.text = // 🌾
330
+ this.#e.text.replaceAll("</span><span class='sn_ch'>", ""), this.#e.text && (this.#t.push(this.#e) > this.oCfg.log.max_len && (this.#t = this.#t.slice(-this.oCfg.log.max_len)), this.#e = { text: "" });
2260
331
  }
2261
332
  //MARK: 履歴回復
2262
333
  // save:const.sn.sLog からの復帰
2263
334
  playback() {
2264
- this.#e = JSON.parse(String(this.val.getVal("save:const.sn.sLog"))), this.#s = { text: "" };
335
+ this.#t = JSON.parse(String(this.val.getVal("save:const.sn.sLog"))), this.#e = { text: "" };
2265
336
  }
2266
337
  }
2267
- function X(q) {
2268
- return encodeURIComponent(JSON.stringify(q));
338
+ function V(O) {
339
+ return encodeURIComponent(JSON.stringify(O));
2269
340
  }
2270
- class G {
341
+ class M {
2271
342
  //MARK: コンストラクタ
2272
- constructor(t, e, s, i, n, a, o, r, c) {
2273
- this.cfg = t, this.hTag = e, this.appPixi = s, this.val = i, this.main = n, this.scrItr = a, this.sys = o;
2274
- const f = () => {
2275
- if (o.cvsResize(), this.cvsResizeDesign(), this.#x) for (const h of this.#b)
2276
- this.#h[h].fore.cvsResizeChildren();
2277
- else for (const h of this.#b)
2278
- this.#h[h].fore.cvsResize();
2279
- this.#r.cvsResize(), this.#f.cvsResize();
2280
- };
2281
- if (S.isMobile)
2282
- this.#p.add(globalThis, "orientationchange", f, { passive: !0 });
343
+ constructor(t, e, s, i, n, o, r, l, f) {
344
+ this.cfg = t, this.hTag = e, this.appPixi = s, this.val = i, this.main = n, this.scrItr = o, this.sys = r;
345
+ const d = () => {
346
+ if (r.cvsResize(), this.cvsResizeDesign(), this.#_) for (const a of this.#r)
347
+ this.#s[a].fore.cvsResizeChildren();
348
+ else for (const a of this.#r)
349
+ this.#s[a].fore.cvsResize();
350
+ this.#o.cvsResize(), this.#d.cvsResize();
351
+ };
352
+ if (x.isMobile)
353
+ this.#x.add(globalThis, "orientationchange", d, { passive: !0 });
2283
354
  else {
2284
- let h;
2285
- this.#p.add(globalThis, "resize", () => {
2286
- h || (h = setTimeout(() => {
2287
- h = void 0, f();
355
+ let a;
356
+ this.#x.add(globalThis, "resize", () => {
357
+ a || (a = setTimeout(() => {
358
+ a = void 0, d();
2288
359
  }, 1e3 / 60 * 10));
2289
360
  }, { passive: !0 });
2290
361
  }
2291
- o.cvsResize(), this.#l = new Gt(this.cfg.oCfg, e, i), P.init(t, e, i, this.#l, (h) => this.#h[h.layname].fore === h, s), L.init(n, t, s, o, r, i), C.init(t, o, n), z.init(t), this.#r = new C(e, s, i), o.hFactoryCls.grp = () => new L(), o.hFactoryCls.txt = () => new P(), e.loadplugin = (h) => this.#w(h), e.snapshot = (h) => this.#g(h), this.#o = this.sys.isApp ? (h, u, x, v, y) => this.#I(h, u, x, v, y) : (h, u, x, v, y) => this.#k(h, u, x, v, y), e.add_lay = (h) => this.#v(h), e.clear_lay = (h) => this.#j(h), e.finish_trans = () => !1, e.lay = (h) => this.#F(h), e.trans = (h) => this.#W(h), e.wt = (h) => B.wt(h), e.quake = (h) => this.#M(h), e.stop_quake = e.finish_trans, e.wq = e.wt, e.pause_tsy = (h) => B.pause_tsy(h), e.resume_tsy = (h) => B.resume_tsy(h), e.stop_tsy = (h) => B.stop_tsy(h), e.tsy = (h) => this.#R(h), e.wait_tsy = (h) => B.wait_tsy(h), e.add_filter = (h) => this.#Q(h), e.clear_filter = (h) => this.#U(h), e.enable_filter = (h) => this.#J(h), e.ch = (h) => this.#T(h), e.clear_text = (h) => this.#A(h), e.current = (h) => this.#K(h), e.endlink = (h) => this.#tt(h), e.er = (h) => this.#et(h), e.graph = (h) => this.#st(h), e.link = (h) => this.#it(h), e.r = (h) => this.#nt(h), e.ruby2 = (h) => this.#at(h), e.span = (h) => this.#ot(h), e.tcy = (h) => this.#rt(h), e.add_face = (h) => m.add_face(h), e.wv = (h) => m.wv(h), e.dump_lay = (h) => this.#ht(h), e.enable_event = (h) => this.#lt(h), e.button = (h) => this.#ct(h), t.existsBreakline && (this.breakLine = (h) => {
2292
- delete h.visible, h.id = "break", h.pic = "breakline", this.#a("grp|" + X(h));
2293
- }), t.existsBreakpage && (this.breakPage = (h) => {
2294
- delete h.visible, h.id = "break", h.pic = "breakpage", this.#a("grp|" + X(h));
2295
- }), this.#t = Ot(String(t.oCfg.init.bg_color));
2296
- const l = new U();
2297
- l.beginFill(this.#t).lineStyle(0, this.#t).drawRect(0, 0, S.stageW, S.stageH).endFill(), this.#e.addChild(l.clone()), this.#n.addChild(l), this.#n.visible = !1, this.#e.name = "page:A", this.#n.name = "page:B", this.#s = s.stage, this.#s.addChild(this.#n), this.#s.addChild(this.#e), this.#s.addChild(this.#$), this.#s.addChild(this.#_), this.#s.name = "stage";
2298
- const p = (h, u) => {
2299
- this.#y(Number(u));
362
+ r.cvsResize(), this.#l = new ht(this.cfg.oCfg, e, i), $.init(t, e, i, this.#l, (a) => this.#s[a.layname].fore === a, s), X.init(n, t, s, r, l, i), u.init(t, r, n), this.#o = new u(e, s, i), e.loadplugin = (a) => this.#O(a), e.snapshot = (a) => this.#S(a), this.#w = this.sys.isApp ? (a, y, k, b, g) => this.#B(a, y, k, b, g) : (a, y, k, b, g) => this.#W(a, y, k, b, g), e.add_lay = (a) => this.#j(a), e.clear_lay = (a) => this.#H(a), e.finish_trans = () => !1, e.lay = (a) => this.#z(a), e.trans = (a) => this.#G(a), e.wt = (a) => _.wt(a), e.quake = (a) => this.#q(a), e.stop_quake = e.finish_trans, e.wq = e.wt, e.pause_tsy = (a) => _.pause_tsy(a), e.resume_tsy = (a) => _.resume_tsy(a), e.stop_tsy = (a) => _.stop_tsy(a), e.tsy = (a) => this.#Y(a), e.wait_tsy = (a) => _.wait_tsy(a), e.add_filter = (a) => this.#J(a), e.clear_filter = (a) => this.#X(a), e.enable_filter = (a) => this.#K(a), e.ch = (a) => this.#I(a), e.clear_text = (a) => this.#M(a), e.current = (a) => this.#D(a), e.endlink = (a) => this.#A(a), e.er = (a) => this.#tt(a), e.graph = (a) => this.#et(a), e.link = (a) => this.#st(a), e.r = (a) => this.#it(a), e.ruby2 = (a) => this.#at(a), e.span = (a) => this.#nt(a), e.tcy = (a) => this.#rt(a), e.add_face = (a) => I.add_face(a), e.wv = (a) => I.wv(a), e.dump_lay = (a) => this.#ot(a), e.enable_event = (a) => this.#ct(a), e.button = (a) => this.#lt(a), t.existsBreakline && (this.breakLine = (a) => {
363
+ delete a.visible, a.id = "break", a.pic = "breakline", this.#n("grp|" + V(a));
364
+ }), t.existsBreakpage && (this.breakPage = (a) => {
365
+ delete a.visible, a.id = "break", a.pic = "breakpage", this.#n("grp|" + V(a));
366
+ }), this.#c = A(String(t.oCfg.init.bg_color));
367
+ const h = new G();
368
+ h.beginFill(this.#c).lineStyle(0, this.#c).drawRect(0, 0, x.stageW, x.stageH).endFill(), this.#t.addChild(h.clone()), this.#i.addChild(h), this.#i.visible = !1, this.#t.name = "page:A", this.#i.name = "page:B", this.#e = s.stage, this.#e.addChild(this.#i), this.#e.addChild(this.#t), this.#e.addChild(this.#T), this.#e.addChild(this.#a), this.#e.name = "stage";
369
+ const p = (a, y) => {
370
+ this.#N(Number(y));
2300
371
  };
2301
372
  p("", i.getVal("sys:TextLayer.Back.Alpha", 1)), i.defValTrg("sys:TextLayer.Back.Alpha", p);
2302
- const d = (h, u) => {
2303
- z.fontFamily = u;
373
+ const c = (a, y) => {
374
+ Z.fontFamily = y;
2304
375
  };
2305
- d("", i.getVal("tmp:sn.button.fontFamily", z.fontFamily)), i.defValTrg("tmp:sn.button.fontFamily", d), i.defTmp("const.sn.last_page_text", () => this.currentTxtlayFore?.pageText ?? ""), i.defTmp("const.sn.last_page_plain_text", () => this.currentTxtlayFore?.pagePlainText ?? ""), S.isDbg && (ut.init(s, o, a, c, t, this.#h), this.cvsResizeDesign = () => ut.cvsResizeDesign(), o.addHook((h, u) => {
2306
- this.#u[h]?.(h, u) && delete this.#u[h];
376
+ c("", i.getVal("tmp:sn.button.fontFamily", Z.fontFamily)), i.defValTrg("tmp:sn.button.fontFamily", c), i.defTmp("const.sn.last_page_text", () => this.currentTxtlayFore?.pageText ?? ""), i.defTmp("const.sn.last_page_plain_text", () => this.currentTxtlayFore?.pagePlainText ?? ""), x.isDbg && (K.init(s, r, o, f, t, this.#s), this.cvsResizeDesign = () => K.cvsResizeDesign(), r.addHook((a, y) => {
377
+ this.#y[a]?.(a, y) && delete this.#y[a];
2307
378
  }));
2308
379
  }
2309
- #s;
2310
- #e = new W();
2311
- #n = new W();
2312
- #r;
2313
- #t;
380
+ #e;
381
+ #t = new U();
382
+ #i = new U();
383
+ #o;
384
+ #c;
2314
385
  #l;
2315
- #p = new kt();
386
+ #x = new tt();
2316
387
  cvsResizeDesign() {
2317
388
  }
2318
- #u = {
389
+ #y = {
2319
390
  attach: (t) => !1,
2320
391
  continue: (t) => !1,
2321
392
  disconnect: (t) => !1,
2322
393
  _enterDesign: (t) => {
2323
- for (const e of this.#b) {
2324
- const s = this.#h[e].fore;
394
+ for (const e of this.#r) {
395
+ const s = this.#s[e].fore;
2325
396
  s.makeDesignCastChildren((i) => i.make()), s.makeDesignCast((i) => i.make());
2326
397
  }
2327
- return this.#i(this.#E), !1;
398
+ return this.#m(this.#v), !1;
2328
399
  },
2329
400
  _replaceToken: (t, e) => !1,
2330
401
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
2331
- _selectNode: (t, e) => (this.#i(e.node), !1)
402
+ _selectNode: (t, e) => (this.#m(e.node), !1)
2332
403
  };
2333
- #c = "";
2334
- #x = "";
2335
- #i(t) {
2336
- [this.#c = "", this.#x = ""] = t.split("/");
2337
- const e = this.#h[this.#c];
2338
- e && (this.#x ? e.fore.showDesignCastChildren() : e.fore.showDesignCast());
2339
- }
2340
- getFrmDisabled = (t) => this.#r.getFrmDisabled(t);
2341
- #d = void 0;
404
+ #b = "";
405
+ #_ = "";
406
+ #m(t) {
407
+ [this.#b = "", this.#_ = ""] = t.split("/");
408
+ const e = this.#s[this.#b];
409
+ e && (this.#_ ? e.fore.showDesignCastChildren() : e.fore.showDesignCast());
410
+ }
411
+ getFrmDisabled = (t) => this.#o.getFrmDisabled(t);
412
+ #f = void 0;
2342
413
  cover(t, e = 0) {
2343
- this.#d && (this.#s.removeChild(this.#d), this.#d.destroy(), this.#d = void 0), t && this.#s.addChild(
2344
- (this.#d = new U()).beginFill(e).lineStyle(0, e).drawRect(0, 0, S.stageW, S.stageH).endFill()
414
+ this.#f && (this.#e.removeChild(this.#f), this.#f.destroy(), this.#f = void 0), t && this.#e.addChild(
415
+ (this.#f = new G()).beginFill(e).lineStyle(0, e).drawRect(0, 0, x.stageW, x.stageH).endFill()
2345
416
  );
2346
417
  }
2347
- #f;
418
+ #d;
2348
419
  setEvtMng(t) {
2349
- this.#f = t, this.#r.setEvtMng(t), m.setEvtMng(t), B.init(t, this.appPixi);
420
+ this.#d = t, this.#o.setEvtMng(t), I.setEvtMng(t), _.init(t, this.appPixi);
2350
421
  }
2351
422
  destroy() {
2352
- for (const t of Object.values(this.#h)) t.destroy();
2353
- this.#p.clear(), L.destroy(), pt.destroy(), g.destroy(), P.destroy(), this.#r.destroy(), B.destroy(), G.#C = 10;
423
+ for (const t of Object.values(this.#s)) t.destroy();
424
+ this.#x.clear(), X.destroy(), ct.destroy(), ot.destroy(), $.destroy(), this.#o.destroy(), _.destroy(), $.msecChWait = 10;
2354
425
  }
2355
426
  // 既存の全文字レイヤの実際のバック不透明度、を再計算
2356
- #y(t) {
2357
- for (const e of this.#b) {
2358
- const { fore: s, back: i } = this.#h[e];
2359
- s instanceof P && (s.chgBackAlpha(t), i.chgBackAlpha(t));
427
+ #N(t) {
428
+ for (const e of this.#r) {
429
+ const { fore: s, back: i } = this.#s[e];
430
+ s instanceof $ && (s.chgBackAlpha(t), i.chgBackAlpha(t));
2360
431
  }
2361
432
  }
2362
- #a = (t, e = this.currentTxtlayForeNeedErr, s = !0) => e.tagCh("|&emsp;《" + t + "》");
433
+ #n = (t, e = this.currentTxtlayForeNeedErr, s = !0) => e.tagCh("|&emsp;《" + t + "》");
2363
434
  goTxt = () => {
2364
435
  };
2365
436
  get needGoTxt() {
@@ -2370,130 +441,130 @@ class G {
2370
441
  breakPage = (t) => {
2371
442
  };
2372
443
  clearBreak() {
2373
- this.currentTxtlayFore && (this.clearBreak = () => this.#a("del|break"), this.clearBreak());
444
+ this.currentTxtlayFore && (this.clearBreak = () => this.#n("del|break"), this.clearBreak());
2374
445
  }
2375
446
  clickTxtLay() {
2376
- return this.currentTxtlayFore ? this.#b.map((t) => this.#h[t].fore).some((t) => t instanceof P && t.click()) : !1;
447
+ return this.currentTxtlayFore ? this.#r.map((t) => this.#s[t].fore).some((t) => t instanceof $ && t.click()) : !1;
2377
448
  }
2378
449
  // // システム
2379
450
  //MARK: スナップショット
2380
- #g(t) {
2381
- const e = Bt("-", "_", "", "_"), s = t.fn ? t.fn.startsWith(It) ? t.fn : `${_t + t.fn + e}.png` : `${_t}snapshot${e}.png`, i = this.cfg.searchPath(s), n = w(t, "width", S.stageW), a = w(t, "height", S.stageH);
2382
- return this.#o(t, i, n, a, `snapshot dt:${e}`);
451
+ #S(t) {
452
+ const e = et("-", "_", "", "_"), s = t.fn ? t.fn.startsWith(lt) ? t.fn : `${Q + t.fn + e}.png` : `${Q}snapshot${e}.png`, i = this.cfg.searchPath(s), n = v(t, "width", x.stageW), o = v(t, "height", x.stageH);
453
+ return this.#w(t, i, n, o, `snapshot dt:${e}`);
2383
454
  }
2384
- #o = () => !1;
2385
- #I({ layer: t }, e, s, i, n) {
2386
- if (this.#r.hideAllFrame(), F.beginProc(n), !t)
455
+ #w = () => !1;
456
+ #B({ layer: t }, e, s, i, n) {
457
+ if (this.#o.hideAllFrame(), C.beginProc(n), !t)
2387
458
  return this.sys.capturePage(e, s, i, () => {
2388
- this.#r.restoreAllFrame(), F.endProc(n);
459
+ this.#o.restoreAllFrame(), C.endProc(n);
2389
460
  }), !0;
2390
- const a = this.#b.map((o) => {
2391
- const { ctn: r } = this.#h[o].fore, c = [r, r.visible];
2392
- return r.visible = !1, c;
461
+ const o = this.#r.map((r) => {
462
+ const { ctn: l } = this.#s[r].fore, f = [l, l.visible];
463
+ return l.visible = !1, f;
2393
464
  });
2394
- for (const o of this.#m(t)) this.#h[o].fore.ctn.visible = !0;
465
+ for (const r of this.#p(t)) this.#s[r].fore.ctn.visible = !0;
2395
466
  return this.sys.capturePage(e, s, i, () => {
2396
- for (const [o, r] of a) o.visible = r;
2397
- this.#r.restoreAllFrame(), F.endProc(n);
467
+ for (const [r, l] of o) r.visible = l;
468
+ this.#o.restoreAllFrame(), C.endProc(n);
2398
469
  }), !0;
2399
470
  }
2400
- #k(t, e, s, i, n) {
2401
- F.beginProc(n);
2402
- const a = vt(t, "b_color", this.#t), o = Vt({
471
+ #W(t, e, s, i, n) {
472
+ C.beginProc(n);
473
+ const o = st(t, "b_color", this.#c), r = it({
2403
474
  width: s,
2404
475
  height: i,
2405
- backgroundAlpha: a > 16777216 && e.endsWith(".png") ? 0 : 1,
2406
- antialias: R(t, "smoothing", !1),
476
+ backgroundAlpha: o > 16777216 && e.endsWith(".png") ? 0 : 1,
477
+ antialias: w(t, "smoothing", !1),
2407
478
  preserveDrawingBuffer: !0,
2408
- backgroundColor: a & 16777215,
479
+ backgroundColor: o & 16777215,
2409
480
  autoDensity: !0
2410
- }), r = t.page !== "back" ? "fore" : "back", { layer: c } = t;
481
+ }), l = t.page !== "back" ? "fore" : "back", { layer: f } = t;
2411
482
  return Promise.allSettled(
2412
- this.#m(c).map((f) => new Promise(
2413
- (l) => this.#h[f][r].snapshot(o, l)
483
+ this.#p(f).map((d) => new Promise(
484
+ (h) => this.#s[d][l].snapshot(r, h)
2414
485
  ))
2415
486
  ).then(async () => {
2416
- const f = tt.create({ width: o.width, height: o.height });
2417
- o.render(this.#s, { renderTexture: f }), await this.sys.savePic(
487
+ const d = B.create({ width: r.width, height: r.height });
488
+ r.render(this.#e, { renderTexture: d }), await this.sys.savePic(
2418
489
  e,
2419
490
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
2420
- o.plugins.extract.base64(f)
2421
- ), f.destroy();
2422
- for (const l of this.#m(c)) this.#h[l][r].snapshot_end();
2423
- o.destroy(!0), F.endProc(n);
491
+ r.plugins.extract.base64(d)
492
+ ), d.destroy();
493
+ for (const h of this.#p(f)) this.#s[h][l].snapshot_end();
494
+ r.destroy(!0), C.endProc(n);
2424
495
  }), !0;
2425
496
  }
2426
497
  //MARK: プラグインの読み込み
2427
- #w(t) {
498
+ #O(t) {
2428
499
  const { fn: e } = t;
2429
500
  if (!e) throw "fnは必須です";
2430
501
  if (!e.endsWith(".css")) throw "サポートされない拡張子です";
2431
- const s = R(t, "join", !0), i = F.procID + `loadplugin fn:${e}`;
2432
- return s && F.beginProc(i), (async () => {
502
+ const s = w(t, "join", !0), i = C.procID + `loadplugin fn:${e}`;
503
+ return s && C.beginProc(i), (async () => {
2433
504
  const n = await fetch(e);
2434
505
  if (!n.ok) throw new Error("Network response was not ok.");
2435
- ot(await n.text()), s && F.endProc(i);
506
+ at(await n.text()), s && C.endProc(i);
2436
507
  })(), s;
2437
508
  }
2438
509
  // // レイヤ共通
2439
510
  //MARK: レイヤを追加する
2440
- #v(t) {
511
+ #j(t) {
2441
512
  const { layer: e, class: s } = t;
2442
513
  if (!e) throw "layerは必須です";
2443
514
  if (e.includes(",")) throw "layer名に「,」は使えません";
2444
- if (e in this.#h) throw `layer【${e}】はすでにあります`;
515
+ if (e in this.#s) throw `layer【${e}】はすでにあります`;
2445
516
  if (!s) throw "clsは必須です";
2446
517
  const i = { isWait: !1 };
2447
- switch (this.#h[e] = new et(e, s, this.#e, this.#n, t, this.sys, this.val, i), this.#b.push(e), s) {
518
+ switch (this.#s[e] = new R(e, s, this.#t, this.#i, t, this.sys, this.val, i), this.#r.push(e), s) {
2448
519
  case "txt":
2449
- this.#E || (this.#Z = () => {
2450
- }, this.#P = (n) => this.#X(n), this.#K = (n) => this.#q(n), this.hTag.current({ layer: e }), this.goTxt = () => {
2451
- this.#f.isSkipping ? G.#C = 0 : this.setNormalChWait();
2452
- for (const n of this.#b) {
2453
- const a = this.#h[n].fore;
2454
- a instanceof P && this.#a("gotxt|", a, !1);
520
+ this.#v || (this.#$ = () => {
521
+ }, this.#h = (n) => this.#Q(n), this.#D = (n) => this.#Z(n), this.hTag.current({ layer: e }), this.goTxt = () => {
522
+ this.#d.isSkipping ? $.msecChWait = 0 : this.setNormalChWait();
523
+ for (const n of this.#r) {
524
+ const o = this.#s[n].fore;
525
+ o instanceof $ && this.#n("gotxt|", o, !1);
2455
526
  }
2456
527
  }), this.val.setVal_Nochk("save", "const.sn.layer." + e + ".enabled", !0);
2457
528
  break;
2458
529
  case "grp":
2459
- if (this.#V) break;
2460
- this.#V = e;
530
+ if (this.#E) break;
531
+ this.#E = e;
2461
532
  break;
2462
533
  }
2463
534
  return this.scrItr.recodeDesign(t), i.isWait;
2464
535
  }
2465
- #h = {
536
+ #s = {
2466
537
  /* empty */
2467
538
  };
2468
539
  // しおりLoad時再読込
2469
- #b = [];
540
+ #r = [];
2470
541
  // 最適化用・重なり順つき全レイヤ名
542
+ #v = "";
2471
543
  #E = "";
2472
- #V = "";
2473
- #F(t) {
2474
- const e = this.#G(t), s = this.#h[e], i = s.back.ctn, n = s.fore.ctn;
2475
- if (R(t, "float", !1))
2476
- this.#n.setChildIndex(i, this.#n.children.length - 1), this.#e.setChildIndex(n, this.#e.children.length - 1), this.#z();
544
+ #z(t) {
545
+ const e = this.#u(t), s = this.#s[e], i = s.back.ctn, n = s.fore.ctn;
546
+ if (w(t, "float", !1))
547
+ this.#i.setChildIndex(i, this.#i.children.length - 1), this.#t.setChildIndex(n, this.#t.children.length - 1), this.#V();
2477
548
  else if (t.index)
2478
- w(t, "index", 0) && (this.#n.setChildIndex(i, t.index), this.#e.setChildIndex(n, t.index), this.#z());
549
+ v(t, "index", 0) && (this.#i.setChildIndex(i, t.index), this.#t.setChildIndex(n, t.index), this.#V());
2479
550
  else if (t.dive) {
2480
- const { dive: a } = t;
2481
- let o = 0;
2482
- if (e === a) throw "[lay] 属性 layerとdiveが同じ【" + a + "】です";
2483
- const r = this.#h[a];
2484
- if (!r) throw "[lay] 属性 dive【" + a + "】が不正です。レイヤーがありません";
2485
- const c = r.back, f = r.fore, l = this.#n.getChildIndex(c.ctn), p = this.#e.getChildIndex(f.ctn);
2486
- o = l < p ? l : p, o > this.#n.getChildIndex(i) && --o, this.#e.setChildIndex(n, o), this.#n.setChildIndex(i, o), this.#z();
551
+ const { dive: o } = t;
552
+ let r = 0;
553
+ if (e === o) throw "[lay] 属性 layerとdiveが同じ【" + o + "】です";
554
+ const l = this.#s[o];
555
+ if (!l) throw "[lay] 属性 dive【" + o + "】が不正です。レイヤーがありません";
556
+ const f = l.back, d = l.fore, h = this.#i.getChildIndex(f.ctn), p = this.#t.getChildIndex(d.ctn);
557
+ r = h < p ? h : p, r > this.#i.getChildIndex(i) && --r, this.#t.setChildIndex(n, r), this.#i.setChildIndex(i, r), this.#V();
2487
558
  }
2488
559
  return t[":id_tag"] = s.fore.name.slice(0, -7), this.scrItr.recodeDesign(t), s.lay(t);
2489
560
  }
2490
- #z() {
2491
- this.#b = this.#S();
561
+ #V() {
562
+ this.#r = this.#U();
2492
563
  }
2493
564
  //MARK: レイヤ設定の消去
2494
- #j(t) {
2495
- return this.#L(t, (e) => {
2496
- const s = this.#h[this.#G({ layer: e })];
565
+ #H(t) {
566
+ return this.#C(t, (e) => {
567
+ const s = this.#s[this.#u({ layer: e })];
2497
568
  if (t.page === "both") {
2498
569
  s.fore.clearLay(t), s.back.clearLay(t);
2499
570
  return;
@@ -2503,7 +574,7 @@ class G {
2503
574
  }
2504
575
  //===================================================
2505
576
  //MARK: WebGL フラグメントシェーダー GLSL
2506
- static #H = (
577
+ static #F = (
2507
578
  /* glsl */
2508
579
  `
2509
580
  precision mediump float;
@@ -2545,183 +616,183 @@ void main() {
2545
616
  ★GLSL : don't use "if"|Nobu note.com/nobuhirosaijo/n/n606a3f5d8e89
2546
617
  > if文はあまり使わない方がいいらしい (処理負荷が高い)
2547
618
  */
2548
- #O = tt.create({
2549
- width: S.stageW,
2550
- height: S.stageH
619
+ #L = B.create({
620
+ width: x.stageW,
621
+ height: x.stageH
2551
622
  });
2552
- #$ = new j(this.#O);
2553
- #N = tt.create({
2554
- width: S.stageW,
2555
- height: S.stageH
623
+ #T = new q(this.#L);
624
+ #g = B.create({
625
+ width: x.stageW,
626
+ height: x.stageH
2556
627
  });
2557
- #_ = new j(this.#N);
628
+ #a = new q(this.#g);
2558
629
  //MARK: ページ裏表を交換
2559
- #W(t) {
2560
- const { layer: e } = t, s = /* @__PURE__ */ new Set(), i = this.#m(e).map((_) => (s.add(_), this.#h[_].fore)), n = () => {
2561
- [this.#e, this.#n] = [this.#n, this.#e];
2562
- const _ = [];
2563
- for (const [T, $] of Object.entries(this.#h)) {
2564
- if (s.has(T)) {
2565
- $.transPage(_);
630
+ #G(t) {
631
+ const { layer: e } = t, s = /* @__PURE__ */ new Set(), i = this.#p(e).map((m) => (s.add(m), this.#s[m].fore)), n = () => {
632
+ [this.#t, this.#i] = [this.#i, this.#t];
633
+ const m = [];
634
+ for (const [N, L] of Object.entries(this.#s)) {
635
+ if (s.has(N)) {
636
+ L.transPage(m);
2566
637
  continue;
2567
638
  }
2568
- const { fore: { ctn: k }, back: { ctn: N } } = $, O = this.#e.getChildIndex(N);
2569
- this.#e.removeChild(N), this.#n.removeChild(k), this.#e.addChildAt(k, O), this.#n.addChildAt(N, O);
639
+ const { fore: { ctn: T }, back: { ctn: E } } = L, z = this.#t.getChildIndex(E);
640
+ this.#t.removeChild(E), this.#i.removeChild(T), this.#t.addChildAt(T, z), this.#i.addChildAt(E, z);
2570
641
  }
2571
- Promise.allSettled(_).then(() => {
2572
- this.#e.visible = !0, this.#n.visible = !1, this.#$.visible = !1, this.#_.visible = !1, F.notifyEndProc(xt + A);
642
+ Promise.allSettled(m).then(() => {
643
+ this.#t.visible = !0, this.#i.visible = !1, this.#T.visible = !1, this.#a.visible = !1, C.notifyEndProc(J + P);
2573
644
  });
2574
645
  };
2575
- if (this.#_.filters = [], this.#_.alpha = 1, w(t, "time", 0) === 0 || this.#f.isSkipping)
2576
- return F.beginProc(xt + A, () => {
646
+ if (this.#a.filters = [], this.#a.alpha = 1, v(t, "time", 0) === 0 || this.#d.isSkipping)
647
+ return C.beginProc(J + P, () => {
2577
648
  }), queueMicrotask(() => n()), !0;
2578
- const o = [], r = this.#b.map((_) => {
2579
- const { fore: T, back: $ } = this.#h[_], k = s.has(_) ? $ : T;
2580
- return k.ctn.visible && o.push(k.ctn), k;
2581
- }), { ticker: c, renderer: f } = this.appPixi;
2582
- f.render(this.#n, { renderTexture: this.#O });
2583
- let l = () => {
2584
- for (const _ of o) f.render(
2585
- _,
2586
- { renderTexture: this.#O, clear: !1 }
649
+ const r = [], l = this.#r.map((m) => {
650
+ const { fore: N, back: L } = this.#s[m], T = s.has(m) ? L : N;
651
+ return T.ctn.visible && r.push(T.ctn), T;
652
+ }), { ticker: f, renderer: d } = this.appPixi;
653
+ d.render(this.#i, { renderTexture: this.#L });
654
+ let h = () => {
655
+ for (const m of r) d.render(
656
+ m,
657
+ { renderTexture: this.#L, clear: !1 }
2587
658
  );
2588
659
  };
2589
- if (!r.some((_) => _.containMovement)) {
2590
- const _ = l;
2591
- l = () => {
2592
- l = () => {
2593
- }, _();
660
+ if (!l.some((m) => m.containMovement)) {
661
+ const m = h;
662
+ h = () => {
663
+ h = () => {
664
+ }, m();
2594
665
  };
2595
666
  }
2596
- const p = () => f.render(this.#e, { renderTexture: this.#N });
667
+ const p = () => d.render(this.#t, { renderTexture: this.#g });
2597
668
  p();
2598
- let d = () => {
2599
- this.#e.visible = !0, p(), this.#e.visible = !1;
2600
- };
2601
- if (!i.some((_) => _.containMovement)) {
2602
- const _ = d;
2603
- d = () => {
2604
- d = () => {
2605
- }, _();
669
+ let c = () => {
670
+ this.#t.visible = !0, p(), this.#t.visible = !1;
671
+ };
672
+ if (!i.some((m) => m.containMovement)) {
673
+ const m = c;
674
+ c = () => {
675
+ c = () => {
676
+ }, m();
2606
677
  };
2607
678
  }
2608
- const h = () => {
2609
- l(), this.#$.visible = !0, d(), this.#_.visible = !0;
2610
- }, { glsl: u, rule: x } = t, v = () => {
2611
- c.remove(h), n();
2612
- };
2613
- if (!u && !x)
2614
- return B.tween(A, t, this.#_, { alpha: 0 }, () => {
2615
- }, v, () => {
2616
- }), c.add(h), !1;
2617
- const y = {
2618
- rule: J.EMPTY,
2619
- vague: w(t, "vague", 0.04),
679
+ const a = () => {
680
+ h(), this.#T.visible = !0, c(), this.#a.visible = !0;
681
+ }, { glsl: y, rule: k } = t, b = () => {
682
+ f.remove(a), n();
683
+ };
684
+ if (!y && !k)
685
+ return _.tween(P, t, this.#a, { alpha: 0 }, () => {
686
+ }, b, () => {
687
+ }), f.add(a), !1;
688
+ const g = {
689
+ rule: nt.EMPTY,
690
+ vague: v(t, "vague", 0.04),
2620
691
  tick: 0
2621
692
  };
2622
- this.#_.filters = [new jt(
693
+ this.#a.filters = [new rt(
2623
694
  void 0,
2624
- u ?? G.#H,
2625
- y
695
+ y ?? M.#F,
696
+ g
2626
697
  )];
2627
- const b = B.tween(A, t, y, { tick: 1 }, () => {
2628
- }, v, () => {
2629
- }, !x);
2630
- return x ? new m(x, void 0, (_) => {
2631
- y.rule = _.texture, _.destroy(), b.start(), c.add(h);
2632
- }, (_) => {
2633
- _ && this.main.resume();
2634
- }).ret : (c.add(h), !1);
2635
- }
2636
- #m(t = "") {
2637
- return t ? t.split(",") : this.#b;
2638
- }
2639
- #L(t, e) {
2640
- const s = this.#m(t.layer);
698
+ const S = _.tween(P, t, g, { tick: 1 }, () => {
699
+ }, b, () => {
700
+ }, !k);
701
+ return k ? new I(k, void 0, (m) => {
702
+ g.rule = m.texture, m.destroy(), S.start(), f.add(a);
703
+ }, (m) => {
704
+ m && this.main.resume();
705
+ }).ret : (f.add(a), !1);
706
+ }
707
+ #p(t = "") {
708
+ return t ? t.split(",") : this.#r;
709
+ }
710
+ #C(t, e) {
711
+ const s = this.#p(t.layer);
2641
712
  for (const i of s) {
2642
- const n = this.#h[i];
713
+ const n = this.#s[i];
2643
714
  if (!n) throw `存在しないlayer【${i}】です`;
2644
715
  e(i, n);
2645
716
  }
2646
717
  return s;
2647
718
  }
2648
- #S(t = "") {
2649
- return this.#m(t).sort((e, s) => {
2650
- const i = this.#e.getChildIndex(this.#h[e].fore.ctn), n = this.#e.getChildIndex(this.#h[s].fore.ctn);
719
+ #U(t = "") {
720
+ return this.#p(t).sort((e, s) => {
721
+ const i = this.#t.getChildIndex(this.#s[e].fore.ctn), n = this.#t.getChildIndex(this.#s[s].fore.ctn);
2651
722
  return i < n ? -1 : i > n ? 1 : 0;
2652
723
  });
2653
724
  }
2654
725
  setAllStyle2TxtLay(t) {
2655
- for (const e of this.#b) {
2656
- const s = this.#h[e].fore;
2657
- s instanceof P && s.lay({ style: t });
726
+ for (const e of this.#r) {
727
+ const s = this.#s[e].fore;
728
+ s instanceof $ && s.lay({ style: t });
2658
729
  }
2659
730
  }
2660
731
  //MARK: 画面を揺らす
2661
- #M(t) {
2662
- if (w(t, "time", NaN) === 0) return !1;
2663
- const e = this.#m(t.layer).map((f) => this.#h[f].fore.ctn), { renderer: s, ticker: i } = this.appPixi;
2664
- this.#N.resize(S.stageW, S.stageH);
732
+ #q(t) {
733
+ if (v(t, "time", NaN) === 0) return !1;
734
+ const e = this.#p(t.layer).map((d) => this.#s[d].fore.ctn), { renderer: s, ticker: i } = this.appPixi;
735
+ this.#g.resize(x.stageW, x.stageH);
2665
736
  const n = () => {
2666
- this.#e.visible = !0;
2667
- for (const f of e) s.render(
2668
- f,
2669
- { renderTexture: this.#N, clear: !1 }
737
+ this.#t.visible = !0;
738
+ for (const d of e) s.render(
739
+ d,
740
+ { renderTexture: this.#g, clear: !1 }
2670
741
  );
2671
- this.#e.visible = !1;
742
+ this.#t.visible = !1;
2672
743
  };
2673
- this.#_.visible = !0, this.#_.alpha = 1;
2674
- const a = V(w(t, "hmax", 10)), o = V(w(t, "vmax", 10)), r = a === 0 ? () => {
744
+ this.#a.visible = !0, this.#a.alpha = 1;
745
+ const o = W(v(t, "hmax", 10)), r = W(v(t, "vmax", 10)), l = o === 0 ? () => {
2675
746
  } : () => {
2676
- this.#_.x = Math.round(Math.random() * a * 2) - a;
2677
- }, c = o === 0 ? () => {
747
+ this.#a.x = Math.round(Math.random() * o * 2) - o;
748
+ }, f = r === 0 ? () => {
2678
749
  } : () => {
2679
- this.#_.y = Math.round(Math.random() * o * 2) - o;
750
+ this.#a.y = Math.round(Math.random() * r * 2) - r;
2680
751
  };
2681
- return this.#_.filters = [], B.tween(A, t, this.#_, { x: 0, y: 0 }, () => {
2682
- r(), c();
752
+ return this.#a.filters = [], _.tween(P, t, this.#a, { x: 0, y: 0 }, () => {
753
+ l(), f();
2683
754
  }, () => {
2684
- i.remove(n), this.#e.visible = !0, this.#_.visible = !1, this.#_.x = 0, this.#_.y = 0;
755
+ i.remove(n), this.#t.visible = !0, this.#a.visible = !1, this.#a.x = 0, this.#a.y = 0;
2685
756
  }, () => {
2686
757
  }), i.add(n), !1;
2687
758
  }
2688
759
  //MARK: トゥイーン開始
2689
- #R(t) {
760
+ #Y(t) {
2690
761
  const { layer: e, render: s, name: i } = t;
2691
762
  if (!e) throw "layerは必須です";
2692
- const n = this.#h[this.#G(t)], a = n.fore;
2693
- let o = () => {
763
+ const n = this.#s[this.#u(t)], o = n.fore;
764
+ let r = () => {
2694
765
  };
2695
- s && !this.#f.isSkipping && (a.renderStart(), o = () => a.renderEnd());
2696
- const r = B.cnvTweenArg(t, a), c = R(t, "arrive", !1), f = R(t, "backlay", !1), l = n.back.ctn;
2697
- return B.tween(i ?? e, t, a, B.cnvTweenArg(t, a), () => {
2698
- }, o, () => {
2699
- if (c && Object.assign(a, r), f) for (const p of Object.keys(B.hMemberCnt)) l[p] = a[p];
2700
- }), "filter" in t && (a.ctn.filters = [H.bldFilters(t)], a.aFltHArg = [t]), !1;
766
+ s && !this.#d.isSkipping && (o.renderStart(), r = () => o.renderEnd());
767
+ const l = _.cnvTweenArg(t, o), f = w(t, "arrive", !1), d = w(t, "backlay", !1), h = n.back.ctn;
768
+ return _.tween(i ?? e, t, o, _.cnvTweenArg(t, o), () => {
769
+ }, r, () => {
770
+ if (f && Object.assign(o, l), d) for (const p of Object.keys(_.hMemberCnt)) h[p] = o[p];
771
+ }), "filter" in t && (o.ctn.filters = [Y.bldFilters(t)], o.aFltHArg = [t]), !1;
2701
772
  }
2702
773
  //MARK: フィルター追加
2703
- #Q(t) {
2704
- return this.#L(t, (e) => {
2705
- const s = this.#h[this.#G({ layer: e })];
774
+ #J(t) {
775
+ return this.#C(t, (e) => {
776
+ const s = this.#s[this.#u({ layer: e })];
2706
777
  if (t.page === "both") {
2707
- this.#Y(s.fore, t), this.#Y(s.back, t);
778
+ this.#P(s.fore, t), this.#P(s.back, t);
2708
779
  return;
2709
780
  }
2710
781
  const i = s.getPage(t);
2711
- this.#Y(i, t);
782
+ this.#P(i, t);
2712
783
  }), !1;
2713
784
  }
2714
- #Y(t, e) {
785
+ #P(t, e) {
2715
786
  const s = t.ctn;
2716
- s.filters ??= [], s.filters = [...s.filters, H.bldFilters(e)], t.aFltHArg.push(e);
787
+ s.filters ??= [], s.filters = [...s.filters, Y.bldFilters(e)], t.aFltHArg.push(e);
2717
788
  }
2718
789
  //MARK: フィルター全削除
2719
- #U(t) {
2720
- return this.#L(t, (e) => {
2721
- const s = this.#h[this.#G({ layer: e })];
790
+ #X(t) {
791
+ return this.#C(t, (e) => {
792
+ const s = this.#s[this.#u({ layer: e })];
2722
793
  if (t.page === "both") {
2723
- const n = s.fore, a = s.back;
2724
- n.ctn.filters = null, a.ctn.filters = null, n.aFltHArg = [], a.aFltHArg = [];
794
+ const n = s.fore, o = s.back;
795
+ n.ctn.filters = null, o.ctn.filters = null, n.aFltHArg = [], o.aFltHArg = [];
2725
796
  return;
2726
797
  }
2727
798
  const i = s.getPage(t);
@@ -2729,112 +800,108 @@ void main() {
2729
800
  }), !1;
2730
801
  }
2731
802
  //MARK: フィルター個別切替
2732
- #J(t) {
2733
- return this.#L(t, (e) => {
2734
- const s = this.#h[this.#G({ layer: e })];
803
+ #K(t) {
804
+ return this.#C(t, (e) => {
805
+ const s = this.#s[this.#u({ layer: e })];
2735
806
  if (t.page === "both") {
2736
- this.#B(s.fore, t), this.#B(s.back, t);
807
+ this.#R(s.fore, t), this.#R(s.back, t);
2737
808
  return;
2738
809
  }
2739
810
  const i = s.getPage(t);
2740
- this.#B(i, t);
811
+ this.#R(i, t);
2741
812
  }), !1;
2742
813
  }
2743
- #B(t, e) {
814
+ #R(t, e) {
2744
815
  const s = t.ctn;
2745
816
  if (!s.filters) throw "フィルターがありません";
2746
- const i = V(w(e, "index", 0)), n = s.filters.length;
817
+ const i = W(v(e, "index", 0)), n = s.filters.length;
2747
818
  if (n <= i) throw `フィルターの個数(${String(n)})を越えています`;
2748
- t.aFltHArg[i].enabled = s.filters[i].enabled = R(e, "enabled", !0);
819
+ t.aFltHArg[i].enabled = s.filters[i].enabled = w(e, "enabled", !0);
2749
820
  }
2750
821
  // // 文字・文字レイヤ
2751
- static #C = 10;
2752
- static get msecChWait() {
2753
- return G.#C;
2754
- }
2755
822
  //MARK: 文字を追加する
2756
- #T(t) {
823
+ #I(t) {
2757
824
  const { text: e } = t;
2758
825
  if (!e) throw "textは必須です";
2759
- const s = this.#P(t);
2760
- delete t.text, this.setNormalChWait(), this.#f.isSkipping ? t.wait = 0 : "wait" in t && w(t, "wait", NaN), this.#a("add|" + X(t), s);
2761
- const i = R(t, "record", !0), n = this.val.doRecLog();
826
+ const s = this.#h(t);
827
+ delete t.text, this.setNormalChWait(), this.#d.isSkipping ? t.wait = 0 : "wait" in t && v(t, "wait", NaN), this.#n("add|" + V(t), s);
828
+ const i = w(t, "record", !0), n = this.val.doRecLog();
2762
829
  return i || this.val.setVal_Nochk("save", "sn.doRecLog", i), s.tagCh(e.replaceAll("[r]", `
2763
- `)), this.val.setVal_Nochk("save", "sn.doRecLog", n), this.#a("add_close|", s), !1;
830
+ `)), this.val.setVal_Nochk("save", "sn.doRecLog", n), this.#n("add_close|", s), !1;
2764
831
  }
2765
- #P = (t) => {
2766
- throw this.#Z(), 0;
832
+ #h = (t) => {
833
+ throw this.#$(), 0;
2767
834
  };
2768
- #X(t) {
2769
- const e = this.#G(t, this.#E), i = this.#h[e].getPage(t);
2770
- if (!(i instanceof P)) throw e + "はTxtLayerではありません";
835
+ #Q(t) {
836
+ const e = this.#u(t, this.#v), i = this.#s[e].getPage(t);
837
+ if (!(i instanceof $)) throw e + "はTxtLayerではありません";
2771
838
  return i;
2772
839
  }
2773
840
  setNormalChWait() {
2774
- G.#C = this.scrItr.normalWait;
841
+ $.msecChWait = this.scrItr.normalWait;
2775
842
  }
2776
843
  //MARK: 操作対象のメッセージレイヤの指定
2777
- #K = (t) => {
2778
- throw this.#Z(), 0;
844
+ #D = (t) => {
845
+ throw this.#$(), 0;
2779
846
  };
2780
- #q(t) {
847
+ #Z(t) {
2781
848
  const { layer: e } = t;
2782
849
  if (!e) throw "[current] layerは必須です";
2783
- const s = this.#h[e];
2784
- if (!s || !(s.getPage(t) instanceof P)) throw `${e}はTxtLayerではありません`;
2785
- this.#D = s, this.#l.pagebreak(), this.#E = e, this.val.setVal_Nochk("save", "const.sn.mesLayer", e);
2786
- for (const i of this.#b) {
2787
- const { fore: n, back: a } = this.#h[i];
2788
- n instanceof P && (n.isCur = a.isCur = i === e);
850
+ const s = this.#s[e];
851
+ if (!s || !(s.getPage(t) instanceof $)) throw `${e}はTxtLayerではありません`;
852
+ this.#k = s, this.#l.pagebreak(), this.#v = e, this.val.setVal_Nochk("save", "const.sn.mesLayer", e);
853
+ for (const i of this.#r) {
854
+ const { fore: n, back: o } = this.#s[i];
855
+ n instanceof $ && (n.isCur = o.isCur = i === e);
2789
856
  }
2790
857
  return !1;
2791
858
  }
2792
859
  get currentTxtlayForeNeedErr() {
2793
- return this.#Z(), this.currentTxtlayFore;
860
+ return this.#$(), this.currentTxtlayFore;
2794
861
  }
2795
862
  get currentTxtlayFore() {
2796
- return this.#D ? this.#D.fore : null;
863
+ return this.#k ? this.#k.fore : null;
2797
864
  }
2798
- #D = void 0;
865
+ #k = void 0;
2799
866
  // カレントテキストレイヤ
2800
- #Z = () => {
867
+ #$ = () => {
2801
868
  throw "文字レイヤーがありません。文字表示や操作する前に、[add_lay layer=(レイヤ名) class=txt]で文字レイヤを追加して下さい";
2802
869
  };
2803
- #G(t, e = "") {
870
+ #u(t, e = "") {
2804
871
  const s = t.layer ?? e;
2805
872
  if (s.includes(",")) throw "layer名に「,」は使えません";
2806
- if (!(s in this.#h)) throw "属性 layer【" + s + "】が不正です。レイヤーがありません";
873
+ if (!(s in this.#s)) throw "属性 layer【" + s + "】が不正です。レイヤーがありません";
2807
874
  return t.layer = s, s;
2808
875
  }
2809
876
  recPagebreak() {
2810
877
  this.#l.pagebreak();
2811
878
  }
2812
879
  //MARK: 文字消去
2813
- #A(t) {
2814
- const e = this.#P(t);
2815
- return t.layer === this.#E && t.page === "fore" && this.#l.pagebreak(), e.clearText(), !1;
880
+ #M(t) {
881
+ const e = this.#h(t);
882
+ return t.layer === this.#v && t.page === "fore" && this.#l.pagebreak(), e.clearText(), !1;
2816
883
  }
2817
884
  //MARK: ハイパーリンクの終了
2818
- #tt(t) {
2819
- return this.#a("endlink|", this.#P(t)), !1;
885
+ #A(t) {
886
+ return this.#n("endlink|", this.#h(t)), !1;
2820
887
  }
2821
888
  //MARK: ページ両面の文字消去
2822
- #et(t) {
2823
- return R(t, "rec_page_break", !0) && this.#l.pagebreak(), this.#D && (this.#D.fore.clearLay(t), this.#D.back.clearLay(t)), !1;
889
+ #tt(t) {
890
+ return w(t, "rec_page_break", !0) && this.#l.pagebreak(), this.#k && (this.#k.fore.clearLay(t), this.#k.back.clearLay(t)), !1;
2824
891
  }
2825
892
  //MARK: インライン画像表示
2826
- #st(t) {
893
+ #et(t) {
2827
894
  if (!t.pic) throw "[graph] picは必須です";
2828
- return this.#a("grp|" + X(t), this.#P(t)), !1;
895
+ return this.#n("grp|" + V(t), this.#h(t)), !1;
2829
896
  }
2830
897
  //MARK: ハイパーリンク
2831
- #it(t) {
898
+ #st(t) {
2832
899
  if (!t.fn && !t.label && !t.url) throw "fn,label,url いずれかは必須です";
2833
- return t.fn ??= this.scrItr.scriptFn, t.style ??= "background-color: rgba(255,0,0,0.5);", t.style_hover ??= "background-color: rgba(255,0,0,0.9);", t.style_clicked ??= t.style, this.#a("link|" + X(t), this.#P(t)), !1;
900
+ return t.fn ??= this.scrItr.scriptFn, t.style ??= "background-color: rgba(255,0,0,0.5);", t.style_hover ??= "background-color: rgba(255,0,0,0.9);", t.style_clicked ??= t.style, this.#n("link|" + V(t), this.#h(t)), !1;
2834
901
  }
2835
902
  //MARK: 改行
2836
- #nt(t) {
2837
- return this.#T({ ...t, text: `
903
+ #it(t) {
904
+ return this.#I({ ...t, text: `
2838
905
  ` });
2839
906
  }
2840
907
  //MARK: 文字列と複数ルビの追加
@@ -2842,26 +909,26 @@ void main() {
2842
909
  const { t: e, r: s } = t;
2843
910
  if (!e) throw "[ruby2] tは必須です";
2844
911
  if (!s) throw "[ruby2] rは必須です";
2845
- return t.text = "|" + encodeURIComponent(e) + "《" + encodeURIComponent(s) + "》", delete t.t, delete t.r, this.#T(t);
912
+ return t.text = "|" + encodeURIComponent(e) + "《" + encodeURIComponent(s) + "》", delete t.t, delete t.r, this.#I(t);
2846
913
  }
2847
914
  //MARK: インラインスタイル設定
2848
- #ot(t) {
2849
- return this.#a("span|" + X(t), this.#P(t)), !1;
915
+ #nt(t) {
916
+ return this.#n("span|" + V(t), this.#h(t)), !1;
2850
917
  }
2851
918
  //MARK: tcy縦中横を表示する
2852
919
  #rt(t) {
2853
920
  if (!t.t) throw "[tcy] tは必須です";
2854
- return this.#a("tcy|" + X(t), this.#P(t)), !1;
921
+ return this.#n("tcy|" + V(t), this.#h(t)), !1;
2855
922
  }
2856
923
  //MARK: レイヤのダンプ
2857
- #ht({ layer: t }) {
924
+ #ot({ layer: t }) {
2858
925
  console.group("🥟 [dump_lay]");
2859
- for (const e of this.#m(t)) {
2860
- const { fore: s, back: i } = this.#h[e];
926
+ for (const e of this.#p(t)) {
927
+ const { fore: s, back: i } = this.#s[e];
2861
928
  try {
2862
929
  console.info(
2863
930
  `%c${s.name.slice(0, -7)} %o`,
2864
- `color:#${S.isDarkMode ? "49F" : "05A"};`,
931
+ `color:#${x.isDarkMode ? "49F" : "05A"};`,
2865
932
  JSON.parse(`{"back":{${i.dump()}}, "fore":{${s.dump()}}}`)
2866
933
  );
2867
934
  } catch (n) {
@@ -2871,19 +938,19 @@ void main() {
2871
938
  return console.groupEnd(), !1;
2872
939
  }
2873
940
  //MARK: イベント有無の切替
2874
- #lt(t) {
2875
- const e = this.#G(t, this.#E), s = R(t, "enabled", !0);
2876
- return this.#P(t).enabled = s, this.val.setVal_Nochk("save", "const.sn.layer." + e + ".enabled", s), !1;
941
+ #ct(t) {
942
+ const e = this.#u(t, this.#v), s = w(t, "enabled", !0);
943
+ return this.#h(t).enabled = s, this.val.setVal_Nochk("save", "const.sn.layer." + e + ".enabled", s), !1;
2877
944
  }
2878
945
  //MARK: ボタンを表示
2879
- #ct(t) {
2880
- return et.argChk_page(t, "back"), t.fn ??= this.scrItr.scriptFn, this.#P(t).addButton(t), this.scrItr.recodeDesign(t), !1;
946
+ #lt(t) {
947
+ return R.argChk_page(t, "back"), t.fn ??= this.scrItr.scriptFn, this.#h(t).addButton(t), this.scrItr.recodeDesign(t), !1;
2881
948
  }
2882
949
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2883
950
  record() {
2884
951
  const t = {};
2885
- for (const e of this.#b) {
2886
- const s = this.#h[e];
952
+ for (const e of this.#r) {
953
+ const s = this.#s[e];
2887
954
  t[e] = {
2888
955
  cls: s.cls,
2889
956
  fore: s.fore.record(),
@@ -2895,30 +962,24 @@ void main() {
2895
962
  playback(t) {
2896
963
  this.#l.playback();
2897
964
  const e = [], s = [];
2898
- for (const [n, { fore: a, fore: { idx: o }, back: r, cls: c }] of Object.entries(t)) {
2899
- s.push({ ln: n, idx: o });
2900
- const f = this.#h[n] ??= new et(n, c, this.#e, this.#n, {}, this.sys, this.val, { isWait: !1 });
2901
- f.fore.playback(a, e), f.back.playback(r, e);
965
+ for (const [n, { fore: o, fore: { idx: r }, back: l, cls: f }] of Object.entries(t)) {
966
+ s.push({ ln: n, idx: r });
967
+ const d = this.#s[n] ??= new R(n, f, this.#t, this.#i, {}, this.sys, this.val, { isWait: !1 });
968
+ d.fore.playback(o, e), d.back.playback(l, e);
2902
969
  }
2903
- const i = this.#e.children.length;
970
+ const i = this.#t.children.length;
2904
971
  return e.push(new Promise((n) => {
2905
- for (const { ln: a, idx: o } of s.sort(({ idx: r }, { idx: c }) => r === c ? 0 : r < c ? -1 : 1)) {
2906
- const r = this.#h[a];
2907
- if (!r) continue;
2908
- const c = i > o ? o : i - 1, { fore: f, back: l } = r;
2909
- this.#e.setChildIndex(f.ctn, c), this.#n.setChildIndex(l.ctn, c);
972
+ for (const { ln: o, idx: r } of s.sort(({ idx: l }, { idx: f }) => l === f ? 0 : l < f ? -1 : 1)) {
973
+ const l = this.#s[o];
974
+ if (!l) continue;
975
+ const f = i > r ? r : i - 1, { fore: d, back: h } = l;
976
+ this.#t.setChildIndex(d.ctn, f), this.#i.setChildIndex(h.ctn, f);
2910
977
  }
2911
978
  n();
2912
979
  })), e;
2913
980
  }
2914
981
  }
2915
- const Zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2916
- __proto__: null,
2917
- LayerMng: G
2918
- }, Symbol.toStringTag, { value: "Module" }));
2919
982
  export {
2920
- z as B,
2921
- Zt as L,
2922
- P as T
983
+ M as LayerMng
2923
984
  };
2924
985
  //# sourceMappingURL=LayerMng.js.map