@famibee/skynovel 1.65.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/README.md +3 -3
  2. package/dist/Button.js +131 -163
  3. package/dist/Button.js.map +1 -1
  4. package/dist/CallStack.js +19 -22
  5. package/dist/CallStack.js.map +1 -1
  6. package/dist/CmnInterface.js +91 -0
  7. package/dist/CmnInterface.js.map +1 -0
  8. package/dist/CmnLib.js +94 -0
  9. package/dist/CmnLib.js.map +1 -0
  10. package/dist/Config.js +26 -0
  11. package/dist/Config.js.map +1 -0
  12. package/dist/ConfigBase.js +152 -0
  13. package/dist/ConfigBase.js.map +1 -0
  14. package/dist/DebugMng.js +89 -102
  15. package/dist/DebugMng.js.map +1 -1
  16. package/dist/EventListenerCtn.js +21 -0
  17. package/dist/EventListenerCtn.js.map +1 -0
  18. package/dist/EventMng.js +1435 -1577
  19. package/dist/EventMng.js.map +1 -1
  20. package/dist/Grammar.js +194 -0
  21. package/dist/Grammar.js.map +1 -0
  22. package/dist/GrpLayer.js +163 -195
  23. package/dist/GrpLayer.js.map +1 -1
  24. package/dist/Layer.js +260 -0
  25. package/dist/Layer.js.map +1 -0
  26. package/dist/LayerMng.js +810 -991
  27. package/dist/LayerMng.js.map +1 -1
  28. package/dist/Main.js +144 -393
  29. package/dist/Main.js.map +1 -1
  30. package/dist/PropParser.js +936 -834
  31. package/dist/PropParser.js.map +1 -1
  32. package/dist/Reading.js +918 -786
  33. package/dist/Reading.js.map +1 -1
  34. package/dist/RubySpliter.js +59 -92
  35. package/dist/RubySpliter.js.map +1 -1
  36. package/dist/ScriptIterator.js +805 -1034
  37. package/dist/ScriptIterator.js.map +1 -1
  38. package/dist/SndBuf.js +1097 -1332
  39. package/dist/SndBuf.js.map +1 -1
  40. package/dist/SoundMng.js +124 -135
  41. package/dist/SoundMng.js.map +1 -1
  42. package/dist/SpritesMng.js +220 -232
  43. package/dist/SpritesMng.js.map +1 -1
  44. package/dist/SysBase.js +1729 -0
  45. package/dist/SysBase.js.map +1 -0
  46. package/dist/TxtLayer.js +1212 -1397
  47. package/dist/TxtLayer.js.map +1 -1
  48. package/dist/Variable.js +398 -466
  49. package/dist/Variable.js.map +1 -1
  50. package/dist/chunk.js +18 -0
  51. package/dist/gamepad.js +723 -511
  52. package/dist/gamepad.js.map +1 -1
  53. package/dist/pixi.js +13422 -0
  54. package/dist/pixi.js.map +1 -0
  55. package/dist/platform.js +424 -369
  56. package/dist/platform.js.map +1 -1
  57. package/dist/sn/AnalyzeTagArg.d.ts +1 -1
  58. package/dist/sn/AnalyzeTagArg.d.ts.map +1 -1
  59. package/dist/sn/CmnInterface.d.ts +3 -1
  60. package/dist/sn/CmnInterface.d.ts.map +1 -1
  61. package/dist/sn/CmnLib.d.ts.map +1 -1
  62. package/dist/sn/CmnTween.d.ts +3 -3
  63. package/dist/sn/CmnTween.d.ts.map +1 -1
  64. package/dist/sn/EventMng.d.ts.map +1 -1
  65. package/dist/sn/Grammar.d.ts +1 -1
  66. package/dist/sn/Grammar.d.ts.map +1 -1
  67. package/dist/sn/PropParser.d.ts +2 -2
  68. package/dist/sn/PropParser.d.ts.map +1 -1
  69. package/dist/sn/Reading.d.ts +6 -0
  70. package/dist/sn/Reading.d.ts.map +1 -1
  71. package/dist/sn/ScriptIterator.d.ts.map +1 -1
  72. package/dist/sn/SndBuf.d.ts +27 -16
  73. package/dist/sn/SndBuf.d.ts.map +1 -1
  74. package/dist/sn/SoundMng.d.ts +4 -1
  75. package/dist/sn/SoundMng.d.ts.map +1 -1
  76. package/dist/sn/SysBase.d.ts.map +1 -1
  77. package/dist/sn/TxtStage.d.ts +2 -1
  78. package/dist/sn/TxtStage.d.ts.map +1 -1
  79. package/dist/test/ValTest.d.ts +1 -1
  80. package/dist/test/ValTest.d.ts.map +1 -1
  81. package/dist/web.js +653 -8
  82. package/dist/web.js.map +1 -1
  83. package/dist_app/Button.js +131 -163
  84. package/dist_app/Button.js.map +1 -1
  85. package/dist_app/CallStack.js +19 -22
  86. package/dist_app/CallStack.js.map +1 -1
  87. package/dist_app/CmnInterface.js +91 -0
  88. package/dist_app/CmnInterface.js.map +1 -0
  89. package/dist_app/CmnLib.js +94 -0
  90. package/dist_app/CmnLib.js.map +1 -0
  91. package/dist_app/Config.js +26 -0
  92. package/dist_app/Config.js.map +1 -0
  93. package/dist_app/ConfigBase.js +152 -0
  94. package/dist_app/ConfigBase.js.map +1 -0
  95. package/dist_app/DebugMng.js +92 -0
  96. package/dist_app/DebugMng.js.map +1 -0
  97. package/dist_app/EventListenerCtn.js +21 -0
  98. package/dist_app/EventListenerCtn.js.map +1 -0
  99. package/dist_app/EventMng.js +1435 -1577
  100. package/dist_app/EventMng.js.map +1 -1
  101. package/dist_app/Grammar.js +194 -0
  102. package/dist_app/Grammar.js.map +1 -0
  103. package/dist_app/GrpLayer.js +163 -195
  104. package/dist_app/GrpLayer.js.map +1 -1
  105. package/dist_app/Layer.js +260 -0
  106. package/dist_app/Layer.js.map +1 -0
  107. package/dist_app/LayerMng.js +810 -991
  108. package/dist_app/LayerMng.js.map +1 -1
  109. package/dist_app/Main.js +144 -392
  110. package/dist_app/Main.js.map +1 -1
  111. package/dist_app/PropParser.js +936 -834
  112. package/dist_app/PropParser.js.map +1 -1
  113. package/dist_app/Reading.js +918 -786
  114. package/dist_app/Reading.js.map +1 -1
  115. package/dist_app/RubySpliter.js +59 -92
  116. package/dist_app/RubySpliter.js.map +1 -1
  117. package/dist_app/ScriptIterator.js +805 -1033
  118. package/dist_app/ScriptIterator.js.map +1 -1
  119. package/dist_app/SndBuf.js +1097 -1332
  120. package/dist_app/SndBuf.js.map +1 -1
  121. package/dist_app/SoundMng.js +124 -135
  122. package/dist_app/SoundMng.js.map +1 -1
  123. package/dist_app/SpritesMng.js +220 -231
  124. package/dist_app/SpritesMng.js.map +1 -1
  125. package/dist_app/SysBase.js +1729 -0
  126. package/dist_app/SysBase.js.map +1 -0
  127. package/dist_app/TxtLayer.js +1212 -1396
  128. package/dist_app/TxtLayer.js.map +1 -1
  129. package/dist_app/Variable.js +398 -466
  130. package/dist_app/Variable.js.map +1 -1
  131. package/dist_app/app.js +211 -8
  132. package/dist_app/app.js.map +1 -1
  133. package/dist_app/appMain.js +20 -21
  134. package/dist_app/appMain.js.map +1 -1
  135. package/dist_app/chunk.js +18 -0
  136. package/dist_app/gamepad.js +723 -511
  137. package/dist_app/gamepad.js.map +1 -1
  138. package/dist_app/pixi.js +11181 -0
  139. package/dist_app/pixi.js.map +1 -0
  140. package/dist_app/platform.js +424 -369
  141. package/dist_app/platform.js.map +1 -1
  142. package/dist_app/preload.js +2 -2
  143. package/dist_app/preload.js.map +1 -1
  144. package/dist_app/sn/AnalyzeTagArg.d.ts +1 -1
  145. package/dist_app/sn/AnalyzeTagArg.d.ts.map +1 -1
  146. package/dist_app/sn/CmnInterface.d.ts +3 -1
  147. package/dist_app/sn/CmnInterface.d.ts.map +1 -1
  148. package/dist_app/sn/CmnLib.d.ts.map +1 -1
  149. package/dist_app/sn/CmnTween.d.ts +3 -3
  150. package/dist_app/sn/CmnTween.d.ts.map +1 -1
  151. package/dist_app/sn/EventMng.d.ts.map +1 -1
  152. package/dist_app/sn/Grammar.d.ts +1 -1
  153. package/dist_app/sn/Grammar.d.ts.map +1 -1
  154. package/dist_app/sn/PropParser.d.ts +2 -2
  155. package/dist_app/sn/PropParser.d.ts.map +1 -1
  156. package/dist_app/sn/Reading.d.ts +6 -0
  157. package/dist_app/sn/Reading.d.ts.map +1 -1
  158. package/dist_app/sn/ScriptIterator.d.ts.map +1 -1
  159. package/dist_app/sn/SndBuf.d.ts +27 -16
  160. package/dist_app/sn/SndBuf.d.ts.map +1 -1
  161. package/dist_app/sn/SoundMng.d.ts +4 -1
  162. package/dist_app/sn/SoundMng.d.ts.map +1 -1
  163. package/dist_app/sn/SysBase.d.ts.map +1 -1
  164. package/dist_app/sn/TxtStage.d.ts +2 -1
  165. package/dist_app/sn/TxtStage.d.ts.map +1 -1
  166. package/dist_app/test/ValTest.d.ts +1 -1
  167. package/dist_app/test/ValTest.d.ts.map +1 -1
  168. package/package.json +23 -13
  169. package/dist/CmnTween.js +0 -1005
  170. package/dist/CmnTween.js.map +0 -1
  171. package/dist/web2.js +0 -21644
  172. package/dist/web2.js.map +0 -1
  173. package/dist_app/CmnTween.js +0 -1005
  174. package/dist_app/CmnTween.js.map +0 -1
  175. package/dist_app/app2.js +0 -18547
  176. package/dist_app/app2.js.map +0 -1
@@ -1,1005 +0,0 @@
1
- import { a as _, I as B, H as A, E as q, e as y, o as H, k as M } from "./app2.js";
2
- var h = Object.freeze({
3
- Linear: Object.freeze({
4
- None: function(e) {
5
- return e;
6
- },
7
- In: function(e) {
8
- return e;
9
- },
10
- Out: function(e) {
11
- return e;
12
- },
13
- InOut: function(e) {
14
- return e;
15
- }
16
- }),
17
- Quadratic: Object.freeze({
18
- In: function(e) {
19
- return e * e;
20
- },
21
- Out: function(e) {
22
- return e * (2 - e);
23
- },
24
- InOut: function(e) {
25
- return (e *= 2) < 1 ? 0.5 * e * e : -0.5 * (--e * (e - 2) - 1);
26
- }
27
- }),
28
- Cubic: Object.freeze({
29
- In: function(e) {
30
- return e * e * e;
31
- },
32
- Out: function(e) {
33
- return --e * e * e + 1;
34
- },
35
- InOut: function(e) {
36
- return (e *= 2) < 1 ? 0.5 * e * e * e : 0.5 * ((e -= 2) * e * e + 2);
37
- }
38
- }),
39
- Quartic: Object.freeze({
40
- In: function(e) {
41
- return e * e * e * e;
42
- },
43
- Out: function(e) {
44
- return 1 - --e * e * e * e;
45
- },
46
- InOut: function(e) {
47
- return (e *= 2) < 1 ? 0.5 * e * e * e * e : -0.5 * ((e -= 2) * e * e * e - 2);
48
- }
49
- }),
50
- Quintic: Object.freeze({
51
- In: function(e) {
52
- return e * e * e * e * e;
53
- },
54
- Out: function(e) {
55
- return --e * e * e * e * e + 1;
56
- },
57
- InOut: function(e) {
58
- return (e *= 2) < 1 ? 0.5 * e * e * e * e * e : 0.5 * ((e -= 2) * e * e * e * e + 2);
59
- }
60
- }),
61
- Sinusoidal: Object.freeze({
62
- In: function(e) {
63
- return 1 - Math.sin((1 - e) * Math.PI / 2);
64
- },
65
- Out: function(e) {
66
- return Math.sin(e * Math.PI / 2);
67
- },
68
- InOut: function(e) {
69
- return 0.5 * (1 - Math.sin(Math.PI * (0.5 - e)));
70
- }
71
- }),
72
- Exponential: Object.freeze({
73
- In: function(e) {
74
- return e === 0 ? 0 : Math.pow(1024, e - 1);
75
- },
76
- Out: function(e) {
77
- return e === 1 ? 1 : 1 - Math.pow(2, -10 * e);
78
- },
79
- InOut: function(e) {
80
- return e === 0 ? 0 : e === 1 ? 1 : (e *= 2) < 1 ? 0.5 * Math.pow(1024, e - 1) : 0.5 * (-Math.pow(2, -10 * (e - 1)) + 2);
81
- }
82
- }),
83
- Circular: Object.freeze({
84
- In: function(e) {
85
- return 1 - Math.sqrt(1 - e * e);
86
- },
87
- Out: function(e) {
88
- return Math.sqrt(1 - --e * e);
89
- },
90
- InOut: function(e) {
91
- return (e *= 2) < 1 ? -0.5 * (Math.sqrt(1 - e * e) - 1) : 0.5 * (Math.sqrt(1 - (e -= 2) * e) + 1);
92
- }
93
- }),
94
- Elastic: Object.freeze({
95
- In: function(e) {
96
- return e === 0 ? 0 : e === 1 ? 1 : -Math.pow(2, 10 * (e - 1)) * Math.sin((e - 1.1) * 5 * Math.PI);
97
- },
98
- Out: function(e) {
99
- return e === 0 ? 0 : e === 1 ? 1 : Math.pow(2, -10 * e) * Math.sin((e - 0.1) * 5 * Math.PI) + 1;
100
- },
101
- InOut: function(e) {
102
- return e === 0 ? 0 : e === 1 ? 1 : (e *= 2, e < 1 ? -0.5 * Math.pow(2, 10 * (e - 1)) * Math.sin((e - 1.1) * 5 * Math.PI) : 0.5 * Math.pow(2, -10 * (e - 1)) * Math.sin((e - 1.1) * 5 * Math.PI) + 1);
103
- }
104
- }),
105
- Back: Object.freeze({
106
- In: function(e) {
107
- var t = 1.70158;
108
- return e === 1 ? 1 : e * e * ((t + 1) * e - t);
109
- },
110
- Out: function(e) {
111
- var t = 1.70158;
112
- return e === 0 ? 0 : --e * e * ((t + 1) * e + t) + 1;
113
- },
114
- InOut: function(e) {
115
- var t = 2.5949095;
116
- return (e *= 2) < 1 ? 0.5 * (e * e * ((t + 1) * e - t)) : 0.5 * ((e -= 2) * e * ((t + 1) * e + t) + 2);
117
- }
118
- }),
119
- Bounce: Object.freeze({
120
- In: function(e) {
121
- return 1 - h.Bounce.Out(1 - e);
122
- },
123
- Out: function(e) {
124
- return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + 0.75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + 0.9375 : 7.5625 * (e -= 2.625 / 2.75) * e + 0.984375;
125
- },
126
- InOut: function(e) {
127
- return e < 0.5 ? h.Bounce.In(e * 2) * 0.5 : h.Bounce.Out(e * 2 - 1) * 0.5 + 0.5;
128
- }
129
- }),
130
- generatePow: function(e) {
131
- return e === void 0 && (e = 4), e = e < Number.EPSILON ? Number.EPSILON : e, e = e > 1e4 ? 1e4 : e, {
132
- In: function(t) {
133
- return Math.pow(t, e);
134
- },
135
- Out: function(t) {
136
- return 1 - Math.pow(1 - t, e);
137
- },
138
- InOut: function(t) {
139
- return t < 0.5 ? Math.pow(t * 2, e) / 2 : (1 - Math.pow(2 - t * 2, e)) / 2 + 0.5;
140
- }
141
- };
142
- }
143
- }), x = function() {
144
- return performance.now();
145
- }, Q = (
146
- /** @class */
147
- function() {
148
- function e() {
149
- for (var t = [], i = 0; i < arguments.length; i++)
150
- t[i] = arguments[i];
151
- this._tweens = {}, this._tweensAddedDuringUpdate = {}, this.add.apply(this, t);
152
- }
153
- return e.prototype.getAll = function() {
154
- var t = this;
155
- return Object.keys(this._tweens).map(function(i) {
156
- return t._tweens[i];
157
- });
158
- }, e.prototype.removeAll = function() {
159
- this._tweens = {};
160
- }, e.prototype.add = function() {
161
- for (var t, i = [], s = 0; s < arguments.length; s++)
162
- i[s] = arguments[s];
163
- for (var n = 0, o = i; n < o.length; n++) {
164
- var a = o[n];
165
- (t = a._group) === null || t === void 0 || t.remove(a), a._group = this, this._tweens[a.getId()] = a, this._tweensAddedDuringUpdate[a.getId()] = a;
166
- }
167
- }, e.prototype.remove = function() {
168
- for (var t = [], i = 0; i < arguments.length; i++)
169
- t[i] = arguments[i];
170
- for (var s = 0, n = t; s < n.length; s++) {
171
- var o = n[s];
172
- o._group = void 0, delete this._tweens[o.getId()], delete this._tweensAddedDuringUpdate[o.getId()];
173
- }
174
- }, e.prototype.allStopped = function() {
175
- return this.getAll().every(function(t) {
176
- return !t.isPlaying();
177
- });
178
- }, e.prototype.update = function(t, i) {
179
- t === void 0 && (t = x()), i === void 0 && (i = !0);
180
- var s = Object.keys(this._tweens);
181
- if (s.length !== 0)
182
- for (; s.length > 0; ) {
183
- this._tweensAddedDuringUpdate = {};
184
- for (var n = 0; n < s.length; n++) {
185
- var o = this._tweens[s[n]], a = !i;
186
- o && o.update(t, a) === !1 && !i && this.remove(o);
187
- }
188
- s = Object.keys(this._tweensAddedDuringUpdate);
189
- }
190
- }, e;
191
- }()
192
- ), j = {
193
- Linear: function(e, t) {
194
- var i = e.length - 1, s = i * t, n = Math.floor(s), o = j.Utils.Linear;
195
- return t < 0 ? o(e[0], e[1], s) : t > 1 ? o(e[i], e[i - 1], i - s) : o(e[n], e[n + 1 > i ? i : n + 1], s - n);
196
- },
197
- Utils: {
198
- Linear: function(e, t, i) {
199
- return (t - e) * i + e;
200
- }
201
- }
202
- }, V = (
203
- /** @class */
204
- function() {
205
- function e() {
206
- }
207
- return e.nextId = function() {
208
- return e._nextId++;
209
- }, e._nextId = 0, e;
210
- }()
211
- ), R = new Q(), m = (
212
- /** @class */
213
- function() {
214
- function e(t, i) {
215
- this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = h.Linear.None, this._interpolationFunction = j.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = V.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1, this._object = t, typeof i == "object" ? (this._group = i, i.add(this)) : i === !0 && (this._group = R, R.add(this));
216
- }
217
- return e.prototype.getId = function() {
218
- return this._id;
219
- }, e.prototype.isPlaying = function() {
220
- return this._isPlaying;
221
- }, e.prototype.isPaused = function() {
222
- return this._isPaused;
223
- }, e.prototype.getDuration = function() {
224
- return this._duration;
225
- }, e.prototype.to = function(t, i) {
226
- if (i === void 0 && (i = 1e3), this._isPlaying)
227
- throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");
228
- return this._valuesEnd = t, this._propertiesAreSetUp = !1, this._duration = i < 0 ? 0 : i, this;
229
- }, e.prototype.duration = function(t) {
230
- return t === void 0 && (t = 1e3), this._duration = t < 0 ? 0 : t, this;
231
- }, e.prototype.dynamic = function(t) {
232
- return t === void 0 && (t = !1), this._isDynamic = t, this;
233
- }, e.prototype.start = function(t, i) {
234
- if (t === void 0 && (t = x()), i === void 0 && (i = !1), this._isPlaying)
235
- return this;
236
- if (this._repeat = this._initialRepeat, this._reversed) {
237
- this._reversed = !1;
238
- for (var s in this._valuesStartRepeat)
239
- this._swapEndStartRepeatValues(s), this._valuesStart[s] = this._valuesStartRepeat[s];
240
- }
241
- if (this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = t, this._startTime += this._delayTime, !this._propertiesAreSetUp || i) {
242
- if (this._propertiesAreSetUp = !0, !this._isDynamic) {
243
- var n = {};
244
- for (var o in this._valuesEnd)
245
- n[o] = this._valuesEnd[o];
246
- this._valuesEnd = n;
247
- }
248
- this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat, i);
249
- }
250
- return this;
251
- }, e.prototype.startFromCurrentValues = function(t) {
252
- return this.start(t, !0);
253
- }, e.prototype._setupProperties = function(t, i, s, n, o) {
254
- for (var a in s) {
255
- var l = t[a], g = Array.isArray(l), d = g ? "array" : typeof l, u = !g && Array.isArray(s[a]);
256
- if (!(d === "undefined" || d === "function")) {
257
- if (u) {
258
- var f = s[a];
259
- if (f.length === 0)
260
- continue;
261
- for (var w = [l], b = 0, v = f.length; b < v; b += 1) {
262
- var I = this._handleRelativeValue(l, f[b]);
263
- if (isNaN(I)) {
264
- u = !1, console.warn("Found invalid interpolation list. Skipping.");
265
- break;
266
- }
267
- w.push(I);
268
- }
269
- u && (s[a] = w);
270
- }
271
- if ((d === "object" || g) && l && !u) {
272
- i[a] = g ? [] : {};
273
- var S = l;
274
- for (var P in S)
275
- i[a][P] = S[P];
276
- n[a] = g ? [] : {};
277
- var f = s[a];
278
- if (!this._isDynamic) {
279
- var O = {};
280
- for (var P in f)
281
- O[P] = f[P];
282
- s[a] = f = O;
283
- }
284
- this._setupProperties(S, i[a], f, n[a], o);
285
- } else
286
- (typeof i[a] > "u" || o) && (i[a] = l), g || (i[a] *= 1), u ? n[a] = s[a].slice().reverse() : n[a] = i[a] || 0;
287
- }
288
- }
289
- }, e.prototype.stop = function() {
290
- return this._isChainStopped || (this._isChainStopped = !0, this.stopChainedTweens()), this._isPlaying ? (this._isPlaying = !1, this._isPaused = !1, this._onStopCallback && this._onStopCallback(this._object), this) : this;
291
- }, e.prototype.end = function() {
292
- return this._goToEnd = !0, this.update(this._startTime + this._duration), this;
293
- }, e.prototype.pause = function(t) {
294
- return t === void 0 && (t = x()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = t, this);
295
- }, e.prototype.resume = function(t) {
296
- return t === void 0 && (t = x()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += t - this._pauseStart, this._pauseStart = 0, this);
297
- }, e.prototype.stopChainedTweens = function() {
298
- for (var t = 0, i = this._chainedTweens.length; t < i; t++)
299
- this._chainedTweens[t].stop();
300
- return this;
301
- }, e.prototype.group = function(t) {
302
- return t ? (t.add(this), this) : (console.warn("tween.group() without args has been removed, use group.add(tween) instead."), this);
303
- }, e.prototype.remove = function() {
304
- var t;
305
- return (t = this._group) === null || t === void 0 || t.remove(this), this;
306
- }, e.prototype.delay = function(t) {
307
- return t === void 0 && (t = 0), this._delayTime = t, this;
308
- }, e.prototype.repeat = function(t) {
309
- return t === void 0 && (t = 0), this._initialRepeat = t, this._repeat = t, this;
310
- }, e.prototype.repeatDelay = function(t) {
311
- return this._repeatDelayTime = t, this;
312
- }, e.prototype.yoyo = function(t) {
313
- return t === void 0 && (t = !1), this._yoyo = t, this;
314
- }, e.prototype.easing = function(t) {
315
- return t === void 0 && (t = h.Linear.None), this._easingFunction = t, this;
316
- }, e.prototype.interpolation = function(t) {
317
- return t === void 0 && (t = j.Linear), this._interpolationFunction = t, this;
318
- }, e.prototype.chain = function() {
319
- for (var t = [], i = 0; i < arguments.length; i++)
320
- t[i] = arguments[i];
321
- return this._chainedTweens = t, this;
322
- }, e.prototype.onStart = function(t) {
323
- return this._onStartCallback = t, this;
324
- }, e.prototype.onEveryStart = function(t) {
325
- return this._onEveryStartCallback = t, this;
326
- }, e.prototype.onUpdate = function(t) {
327
- return this._onUpdateCallback = t, this;
328
- }, e.prototype.onRepeat = function(t) {
329
- return this._onRepeatCallback = t, this;
330
- }, e.prototype.onComplete = function(t) {
331
- return this._onCompleteCallback = t, this;
332
- }, e.prototype.onStop = function(t) {
333
- return this._onStopCallback = t, this;
334
- }, e.prototype.update = function(t, i) {
335
- var s = this, n;
336
- if (t === void 0 && (t = x()), i === void 0 && (i = e.autoStartOnUpdate), this._isPaused)
337
- return !0;
338
- var o;
339
- if (!this._goToEnd && !this._isPlaying)
340
- if (i)
341
- this.start(t, !0);
342
- else
343
- return !1;
344
- if (this._goToEnd = !1, t < this._startTime)
345
- return !0;
346
- this._onStartCallbackFired === !1 && (this._onStartCallback && this._onStartCallback(this._object), this._onStartCallbackFired = !0), this._onEveryStartCallbackFired === !1 && (this._onEveryStartCallback && this._onEveryStartCallback(this._object), this._onEveryStartCallbackFired = !0);
347
- var a = t - this._startTime, l = this._duration + ((n = this._repeatDelayTime) !== null && n !== void 0 ? n : this._delayTime), g = this._duration + this._repeat * l, d = function() {
348
- if (s._duration === 0 || a > g)
349
- return 1;
350
- var I = Math.trunc(a / l), S = a - I * l, P = Math.min(S / s._duration, 1);
351
- return P === 0 && a === s._duration ? 1 : P;
352
- }, u = d(), f = this._easingFunction(u);
353
- if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, f), this._onUpdateCallback && this._onUpdateCallback(this._object, u), this._duration === 0 || a >= this._duration)
354
- if (this._repeat > 0) {
355
- var w = Math.min(Math.trunc((a - this._duration) / l) + 1, this._repeat);
356
- isFinite(this._repeat) && (this._repeat -= w);
357
- for (o in this._valuesStartRepeat)
358
- !this._yoyo && typeof this._valuesEnd[o] == "string" && (this._valuesStartRepeat[o] = // eslint-disable-next-line
359
- // @ts-ignore FIXME?
360
- this._valuesStartRepeat[o] + parseFloat(this._valuesEnd[o])), this._yoyo && this._swapEndStartRepeatValues(o), this._valuesStart[o] = this._valuesStartRepeat[o];
361
- return this._yoyo && (this._reversed = !this._reversed), this._startTime += l * w, this._onRepeatCallback && this._onRepeatCallback(this._object), this._onEveryStartCallbackFired = !1, !0;
362
- } else {
363
- this._onCompleteCallback && this._onCompleteCallback(this._object);
364
- for (var b = 0, v = this._chainedTweens.length; b < v; b++)
365
- this._chainedTweens[b].start(this._startTime + this._duration, !1);
366
- return this._isPlaying = !1, !1;
367
- }
368
- return !0;
369
- }, e.prototype._updateProperties = function(t, i, s, n) {
370
- for (var o in s)
371
- if (i[o] !== void 0) {
372
- var a = i[o] || 0, l = s[o], g = Array.isArray(t[o]), d = Array.isArray(l), u = !g && d;
373
- u ? t[o] = this._interpolationFunction(l, n) : typeof l == "object" && l ? this._updateProperties(t[o], a, l, n) : (l = this._handleRelativeValue(a, l), typeof l == "number" && (t[o] = a + (l - a) * n));
374
- }
375
- }, e.prototype._handleRelativeValue = function(t, i) {
376
- return typeof i != "string" ? i : i.charAt(0) === "+" || i.charAt(0) === "-" ? t + parseFloat(i) : parseFloat(i);
377
- }, e.prototype._swapEndStartRepeatValues = function(t) {
378
- var i = this._valuesStartRepeat[t], s = this._valuesEnd[t];
379
- typeof s == "string" ? this._valuesStartRepeat[t] = this._valuesStartRepeat[t] + parseFloat(s) : this._valuesStartRepeat[t] = this._valuesEnd[t], this._valuesEnd[t] = i;
380
- }, e.autoStartOnUpdate = !1, e;
381
- }()
382
- );
383
- V.nextId;
384
- var k = R;
385
- k.getAll.bind(k);
386
- k.removeAll.bind(k);
387
- k.add.bind(k);
388
- k.remove.bind(k);
389
- k.update.bind(k);
390
- class r {
391
- static #e = new Q();
392
- static init() {
393
- p.addGrp(r.#e);
394
- }
395
- static #s;
396
- static get rs() {
397
- return this.#s;
398
- }
399
- constructor() {
400
- r.#s = this;
401
- }
402
- static #t = {};
403
- static #i = {};
404
- static setEvt2Fnc(t, i, s) {
405
- t ? this.#i[i] = s : this.#t[i] = s;
406
- }
407
- static getEvt2Fnc = (t) => this.#t[t] ?? this.#i[t];
408
- static clear_eventer(t, i, s) {
409
- if (!t.startsWith("dom=")) return;
410
- const n = i ? this.#i[s] : this.#t[s];
411
- n && this.getHtmlElmList(t).el.forEach((o) => o.removeEventListener("click", n)), i ? delete this.#i[s] : delete this.#t[s];
412
- }
413
- static popLocalEvts() {
414
- const t = this.#t;
415
- return this.#t = {}, t;
416
- }
417
- static pushLocalEvts(t) {
418
- this.#t = t;
419
- }
420
- static clear_event(t) {
421
- const i = y(t, "global", !1), s = i ? this.#i : this.#t;
422
- for (const [n, o] of Object.entries(s))
423
- n.startsWith("dom=") && this.getHtmlElmList(n).el.forEach((a) => a.removeEventListener("click", o));
424
- return i ? this.#i = {} : this.#t = {}, !1;
425
- }
426
- static getHtmlElmList(t) {
427
- const i = t.indexOf(":");
428
- let s = "";
429
- if (i >= 0) {
430
- const n = t.slice(4, i), o = `const.sn.frm.${n}`;
431
- if (!c.val.getVal(`tmp:${o}`, 0)) throw `HTML【${n}】が読み込まれていません`;
432
- const a = document.getElementById(n);
433
- if (!a) throw `HTML【${n}】の要素(id=${n})がありません`;
434
- const l = a.contentWindow;
435
- return s = t.slice(i + 1), { el: l.document.querySelectorAll(s), id: n, sel: s };
436
- }
437
- return s = t.slice(4), { el: document.querySelectorAll(s), id: "", sel: s };
438
- }
439
- // 予約イベントの発生待ち
440
- static waitRsvEvent(t, i) {
441
- c.val.saveKidoku(), i ? this.#t.click = this.#t.enter = this.#t.arrowdown = // hTag.event({key:'downwheel', breakout: fnc});
442
- this.#t["wheel.y>0"] = () => i() : (delete this.#t.click, delete this.#t.enter, delete this.#t.arrowdown, delete this.#t["wheel.y>0"]), this.getEvt2Fnc = t ? (s) => this.#t[s] ?? this.#i[s] : (s) => this.#t[s], c.scrItr.noticeWait(), _.debugLog && console.log("🎍 wait event... %o", {
443
- local: Object.keys(this.#t),
444
- global: Object.keys(this.#i)
445
- });
446
- }
447
- static waitRsvEvent4Paging() {
448
- if (this.waitRsvEvent(!0), this.aKeysAtPaging.length === 0) {
449
- this.getEvt2Fnc = (i) => this.#t[i] ?? this.#i[i];
450
- return;
451
- }
452
- const t = {};
453
- for (const i of this.aKeysAtPaging) {
454
- const s = this.#i[i];
455
- s && (t[i] = s);
456
- }
457
- this.getEvt2Fnc = (i) => this.#t[i] ?? t[i];
458
- }
459
- fire(t, i) {
460
- const s = t.toLowerCase();
461
- switch (s) {
462
- case "click":
463
- case "rightclick":
464
- // 右クリックメニューに入って出られない
465
- case "middleclick":
466
- // 〃
467
- case "enter":
468
- case "arrowdown":
469
- if (c.evtMng.isSkipping) break;
470
- if (!r.isFirstFire()) return;
471
- break;
472
- }
473
- if (s === "enter") {
474
- const o = c.fcs.getFocus();
475
- if (o instanceof H) {
476
- o.emit(B, new PointerEvent(B));
477
- return;
478
- }
479
- }
480
- const n = r.getEvt2Fnc(s);
481
- n && (i.stopImmediatePropagation?.(), !(!s.startsWith("dom=") && c.layMng.clickTxtLay()) && n(i));
482
- }
483
- get skip_enabled() {
484
- return c.skip_enabled;
485
- }
486
- isWait = !1;
487
- // イベント複数発生回避(ボタンとステージクリックなど)
488
- static #n = !1;
489
- static isFirstFire() {
490
- return r.#n ? !1 : (r.#n = !0, !0);
491
- }
492
- static resetFired() {
493
- r.#n = !1;
494
- }
495
- static aPage;
496
- static lenPage = 0;
497
- static posPage = 0;
498
- static styPaging;
499
- static INI_STYPAGE = "color: yellow; text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000;";
500
- static aKeysAtPaging = [];
501
- static recodePage(t = !1) {
502
- if (!c.val.getVal("save:sn.doRecLog")) return;
503
- const { fn: i, idx: s } = c.scrItr.nowScrIdx(), n = `${String(s - 1)}:` + i;
504
- if (this.aPage.findIndex((l) => l.key === n) > -1) return;
505
- _.debugLog && console.log(`📜 %crecodePage === week:${String(t)} lenPage:${String(this.lenPage)} len:${String(this.aPage.length)} POP:${String(this.aPage.at(-1)?.week)}`, "color:#3B0;"), this.aPage.at(-1)?.week && this.aPage.pop();
506
- const { max_len: o } = c.cfg.oCfg.log, a = c.scrItr.nowMark();
507
- a.hSave["const.sn.sLog"] = "[]", this.aPage.push({
508
- key: n,
509
- week: t,
510
- fn: c.val.getVal("save:const.sn.scriptFn", i),
511
- index: c.val.getVal("save:const.sn.scriptIdx", 0),
512
- mark: a
513
- }) > o && (this.aPage = this.aPage.slice(-o)), this.lenPage = this.aPage.length, _.debugLog && (console.log(` %clenPage:${String(this.lenPage)} (base=${a.hPages.base.fore.sBkFn} 0=${a.hPages[0].fore.sBkFn} mes=${String(
514
- /color: \w+;/.exec((a.hPages.mes?.fore).txs.cssText)
515
- )})%c mark:%o`, "color:#3B0;", "", a), console.table(this.aPage)), c.val.setVal_Nochk("sys", "const.sn.aPageLog", JSON.stringify(this.aPage));
516
- }
517
- static playbackPage(t, i) {
518
- this.aPage = JSON.parse(t), this.lenPage = this.aPage.length, this.posPage >= this.lenPage && (this.posPage = this.lenPage - 1), this.styPaging = i;
519
- }
520
- beginProc() {
521
- new K();
522
- }
523
- endProc() {
524
- new T();
525
- }
526
- // タグ処理
527
- l(t) {
528
- if (!c.tagL_enabled) return !1;
529
- if (r.recodePage(!0), c.auto_enabled)
530
- return t.time = Number(c.val.getVal(`sys:sn.auto.msecLineWait${c.scrItr.isKidoku ? "_Kidoku" : ""}`)), this.wait(t);
531
- if (c.skip_enabled) {
532
- if (!c.skip_all && !c.scrItr.isNextKidoku)
533
- c.cancelAutoSkip();
534
- else if ("ps".includes(String(c.val.getVal("sys:sn.skip.mode"))))
535
- return t.time = 50, this.wait(t);
536
- }
537
- return y(t, "visible", !0) && (c.layMng.breakLine(t), c.goTxt()), new $(t), !0;
538
- }
539
- p(t) {
540
- if (r.recodePage(), c.auto_enabled)
541
- return t.time = Number(c.val.getVal(`sys:sn.auto.msecPageWait${c.scrItr.isKidoku ? "_Kidoku" : ""}`)), this.wait(t);
542
- if (c.skip_enabled) {
543
- if (!c.skip_all && !c.scrItr.isNextKidoku)
544
- c.cancelAutoSkip();
545
- else if (String(c.val.getVal("sys:sn.skip.mode")) === "s")
546
- return t.time = 50, this.wait(t);
547
- }
548
- return y(t, "visible", !0) && (c.layMng.breakPage(t), c.goTxt()), new $(t), !0;
549
- }
550
- s(t) {
551
- return r.recodePage(), c.cancelAutoSkip(), new $(t), !0;
552
- }
553
- wait(t) {
554
- const i = M(t, "time", NaN);
555
- if (c.skip_enabled)
556
- return !c.skip_all && !c.scrItr.isNextKidoku && c.cancelAutoSkip(), !1;
557
- const s = new m({}), n = "wait", o = () => {
558
- r.#e.remove(s), c.notifyEndProc(n);
559
- };
560
- s.to({}, i).onComplete(o).start(), r.#e.add(s);
561
- const a = y(t, "canskip", !0);
562
- return c.beginProc(n, o, !0, a ? o : void 0), !0;
563
- }
564
- page(t) {
565
- if (!("clear" in t || "to" in t || "style" in t)) throw "clear,style,to いずれかは必須です";
566
- const { key: i, style: s } = t;
567
- return i && (r.aKeysAtPaging = i.split(",")), s ? (r.styPaging = s, c.val.setVal_Nochk("save", "const.sn.styPaging", s), !1) : (y(t, "clear", !1) && (r.aPage = [], r.lenPage = 0, r.posPage = 0, c.val.setVal_Nochk("sys", "const.sn.aPageLog", "[]"), c.val.setVal_Nochk("save", "const.sn.styPaging", r.INI_STYPAGE)), !1);
568
- }
569
- static destroy() {
570
- this.#t = {}, this.#i = {}, this.aPage = [], this.lenPage = 0, this.posPage = 0;
571
- }
572
- }
573
- class T extends r {
574
- constructor() {
575
- super(), _.debugLog && console.log("📖 => %cReadingState_go", "color:#3B0;"), c.main.resume();
576
- }
577
- fire(t, i) {
578
- }
579
- // システムボタンなど無効化
580
- }
581
- class K extends r {
582
- constructor() {
583
- super(), _.debugLog && console.log("📖 => %cReadingState_proc", "color:#3B0;");
584
- }
585
- fire(t, i) {
586
- }
587
- // システムボタンなど無効化
588
- }
589
- class $ extends r {
590
- constructor(t) {
591
- super(), _.debugLog && console.log("📖 => %cReadingState_wait", "color:#3B0;");
592
- let i = () => {
593
- };
594
- const s = y(t, "global", !0);
595
- switch (t[":タグ名"]) {
596
- case "wait":
597
- return;
598
- // 予約イベント待ち【しない】
599
- case "s":
600
- r.waitRsvEvent(s);
601
- return;
602
- case "p":
603
- i = () => {
604
- y(t, "er", !1) && c.hTag.er(t), c.sndMng.clearCache(), new T();
605
- };
606
- break;
607
- default:
608
- i = () => new T();
609
- }
610
- r.waitRsvEvent(s, i);
611
- }
612
- isWait = !0;
613
- page(t) {
614
- const i = super.page(t), { to: s } = t;
615
- if (!s) return i;
616
- if (r.lenPage < 2) return !1;
617
- switch (s) {
618
- case "oldest":
619
- t.to = "prev", r.posPage = 1;
620
- break;
621
- case "newest":
622
- case "prev":
623
- t.to = "prev", r.posPage = r.lenPage - 1;
624
- break;
625
- // case 'next': // スルー
626
- default:
627
- return !1;
628
- }
629
- return W.go(t);
630
- }
631
- }
632
- class W extends r {
633
- constructor() {
634
- super(), _.debugLog && console.log("📖 => %cReadingState_page", "color:#3B0;"), c.val.setVal_Nochk("tmp", "const.sn.isPaging", !0);
635
- }
636
- static go(t) {
637
- return new W().page(t);
638
- }
639
- #e = !0;
640
- get skip_enabled() {
641
- return this.#e;
642
- }
643
- isWait = !1;
644
- beginProc() {
645
- c.main.stop();
646
- }
647
- endProc() {
648
- c.main.resume();
649
- }
650
- // タグ処理
651
- l(t) {
652
- return this.#e ? r.posPage === r.lenPage - 1 ? (this.#s(), new T().l(t)) : (y(t, "visible", !0) && c.layMng.breakLine(t), c.layMng.setAllStyle2TxtLay(r.styPaging), c.goTxt(), r.aPage[r.posPage]?.week ? (r.waitRsvEvent4Paging(), !0) : !1) : super.l(t);
653
- }
654
- p(t) {
655
- return this.#e ? r.posPage === r.lenPage - 1 ? (this.#s(), new T().p(t)) : (y(t, "visible", !0) && c.layMng.breakPage(t), c.layMng.setAllStyle2TxtLay(r.styPaging), c.goTxt(), r.waitRsvEvent4Paging(), !0) : super.p(t);
656
- }
657
- s(t) {
658
- return new $(t), !0;
659
- }
660
- wait() {
661
- return !1;
662
- }
663
- page(t) {
664
- const { to: i, style: s, clear: n } = t;
665
- if (s || n) return !1;
666
- switch (_.debugLog && console.log(`📜 %cpage() pos:${String(r.posPage)}%c len:${String(r.lenPage)} to:${String(i)}`, "color:#3B0;", ""), i) {
667
- case "oldest":
668
- if (r.posPage === 0) return !1;
669
- r.posPage = 0;
670
- break;
671
- case "prev":
672
- if (r.posPage === 0) return !1;
673
- --r.posPage;
674
- break;
675
- case "next":
676
- if (r.posPage === r.lenPage - 1) return !1;
677
- ++r.posPage;
678
- break;
679
- case "newest":
680
- if (r.posPage === r.lenPage - 1) return !1;
681
- r.posPage = r.lenPage - 1;
682
- break;
683
- case "exit":
684
- r.posPage = r.lenPage - 1;
685
- break;
686
- case "load":
687
- r.lenPage = r.posPage + 1, r.aPage = r.aPage.slice(0, r.lenPage), this.#s();
688
- break;
689
- default:
690
- throw `属性to「${String(i)}」は異常です`;
691
- }
692
- r.posPage === r.lenPage - 1 && this.#s();
693
- const o = r.aPage[r.posPage];
694
- if (!o) throw `posPage異常:${String(r.posPage)}`;
695
- const { fn: a, index: l, mark: g } = o;
696
- if (_.debugLog) {
697
- const d = c.scrItr.nowMark(), { week: u } = r.aPage[r.posPage] ?? { week: !1 };
698
- console.log(` -- fn:${a} i:${String(l)} pos:${String(r.posPage)} (base=%c${(d.hPages.base?.fore).sBkFn}%c 0=%c${(d.hPages[0]?.fore).sBkFn}%c mes=%c${String(
699
- /color: \w+;/.exec((d.hPages.mes?.fore).txs.cssText)
700
- )}%c) week:${String(u)} A:${String(
701
- r.posPage === r.lenPage - 1
702
- )}
703
- styPaging=%c${r.styPaging}%c
704
- mark:%o`, "background-color:#3B0; color:#000;", "", "background-color:#B4F; color:#000;", "", "color:#B68;", "", r.styPaging, "", g);
705
- }
706
- return c.scrItr.loadFromMark({ fn: a, index: l }, g);
707
- }
708
- #s() {
709
- c.val.setVal_Nochk("tmp", "const.sn.isPaging", !1), this.#e = !1;
710
- }
711
- }
712
- class c {
713
- static beginProc(t, i, s = !0, n) {
714
- if (_.debugLog && console.log(`📖.beginProc id:%c${t}%c onNotify:${String(i)} endProc:${String(s)} onClickSkip:${String(n)}`, "color:#3B0;", ""), this.#e(), this.#i = t, i) {
715
- const { promise: o, resolve: a } = Promise.withResolvers();
716
- o.then((l) => {
717
- _.debugLog && console.log(`📖.callBack id:%c${l}%c`, "color:#3B0;", ""), i(), s ? this.endProc(l) : this.#e();
718
- }), this.#t = a;
719
- }
720
- if (n) {
721
- const o = () => {
722
- this.cancelAutoSkip(), n(), s && this.endProc(t);
723
- };
724
- this.#s.add(this.main.cvs, B, (a) => {
725
- a.stopPropagation(), o();
726
- }), this.#s.add(document, A, (a) => {
727
- a.isComposing || (a.stopPropagation(), o());
728
- }), this.procWheel4wle(this.#s, o);
729
- }
730
- r.rs.beginProc();
731
- }
732
- static #e() {
733
- this.#i = "", this.#t = () => {
734
- }, this.#s.clear();
735
- }
736
- static #s = new q();
737
- static #t = () => {
738
- };
739
- static notifyEndProc(t) {
740
- _.debugLog && console.log(`📖.notifyEndProc id:%c${t}%c=${String(this.#i === t)}`, "color:#3B0;", ""), this.#i === t && this.#t(t);
741
- }
742
- static endProc(t) {
743
- _.debugLog && console.log(`📖.endProc id:%c${t}%c=${String(this.#i === t)}`, "color:#3B0;", ""), this.#i === t && (r.rs.endProc(), this.#e());
744
- }
745
- static #i = "";
746
- static get procID() {
747
- return `RP_${this.scrItr.scriptFn}:${String(this.scrItr.idxToken)}_`;
748
- }
749
- static fire(t, i, s = !1) {
750
- s && this.cancelAutoSkip(), r.rs.fire(t, i);
751
- }
752
- static get isSkipping() {
753
- return r.rs.skip_enabled;
754
- }
755
- static get isWait() {
756
- return r.rs.isWait;
757
- }
758
- // 予約イベントの発生待ち中か
759
- static tagL_enabled = !0;
760
- // 頁末まで一気に読み進むか(l無視)
761
- static skip_all = !1;
762
- // falseなら既読のみをスキップ
763
- static skip_enabled = !1;
764
- // 次の選択肢(/未読)まで進むが有効か
765
- static auto_enabled = !1;
766
- // 自動読みすすみモードかどうか
767
- static cfg;
768
- static hTag;
769
- static main;
770
- static val;
771
- static scrItr;
772
- static layMng;
773
- static goTxt = () => {
774
- };
775
- static get needGoTxt() {
776
- return this.layMng.needGoTxt;
777
- }
778
- static evtMng;
779
- static sndMng;
780
- static procWheel4wle;
781
- static fcs;
782
- static init(t, i, s, n, o, a, l, g, d) {
783
- this.cfg = t, this.hTag = i, this.main = s, this.val = n, this.scrItr = o, this.layMng = a, this.goTxt = () => a.goTxt(), this.evtMng = l, this.sndMng = g, this.procWheel4wle = d, n.defTmp("sn.tagL.enabled", () => this.tagL_enabled), n.defValTrg("tmp:sn.tagL.enabled", (u, f) => {
784
- this.tagL_enabled = String(f) !== "false";
785
- }), n.defTmp("sn.skip.all", () => this.skip_all), n.defValTrg("tmp:sn.skip.all", (u, f) => {
786
- this.skip_all = String(f) !== "false";
787
- }), n.defTmp("sn.skip.enabled", () => this.skip_enabled), n.defValTrg("tmp:sn.skip.enabled", (u, f) => {
788
- this.skip_enabled = String(f) !== "false";
789
- }), n.defTmp("sn.auto.enabled", () => this.auto_enabled), n.defValTrg("tmp:sn.auto.enabled", (u, f) => {
790
- this.auto_enabled = String(f) !== "false";
791
- }), i.l = (u) => r.rs.l(u), i.p = (u) => r.rs.p(u), i.s = (u) => r.rs.s(u), i.wait = (u) => r.rs.wait(u), i.waitclick = (u) => r.rs.s(u), i.page = (u) => r.rs.page(u), r.init(), new K(), i.jump({ fn: "main" });
792
- }
793
- static setFcs(t) {
794
- this.fcs = t;
795
- }
796
- static cancelAutoSkip() {
797
- this.tagL_enabled || (this.tagL_enabled = !0, this.val.setVal_Nochk("tmp", "sn.tagL.enabled", !0)), this.skip_enabled && (this.skip_enabled = !1, this.val.setVal_Nochk("tmp", "sn.skip.enabled", !1)), this.auto_enabled && (this.auto_enabled = !1, this.val.setVal_Nochk("tmp", "sn.auto.enabled", !1));
798
- }
799
- }
800
- const N = `trans
801
- `, G = "tsy nm:";
802
- class p {
803
- static #e = {};
804
- static #s;
805
- static init(t) {
806
- p.#e = {}, p.#s = t, p.addGrp(p.#i);
807
- function i(s) {
808
- for (const n of p.#n) n.update(s);
809
- p.#t(i);
810
- }
811
- p.#t(i);
812
- }
813
- static #t = (t) => requestAnimationFrame(t);
814
- static #i = new Q();
815
- static #n = [];
816
- static addGrp(t) {
817
- p.#n.push(t);
818
- }
819
- static destroy() {
820
- p.#t = () => 0, p.stopAllTw();
821
- }
822
- // トゥイーン全停止
823
- static stopAllTw() {
824
- p.#e = {};
825
- for (const t of p.#n) t.removeAll();
826
- p.#n = [];
827
- }
828
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
829
- static setTwProp(t, i) {
830
- const s = M(i, "repeat", 1);
831
- return t.delay(M(i, "delay", 0)).easing(this.ease(i.ease)).repeat(s > 0 ? s - 1 : 1 / 0).yoyo(y(i, "yoyo", !1));
832
- }
833
- static #a = {
834
- "Back.In": (t) => h.Back.In(t),
835
- "Back.InOut": (t) => h.Back.InOut(t),
836
- "Back.Out": (t) => h.Back.Out(t),
837
- "Bounce.In": (t) => h.Bounce.In(t),
838
- "Bounce.InOut": (t) => h.Bounce.InOut(t),
839
- "Bounce.Out": (t) => h.Bounce.Out(t),
840
- "Circular.In": (t) => h.Circular.In(t),
841
- "Circular.InOut": (t) => h.Circular.InOut(t),
842
- "Circular.Out": (t) => h.Circular.Out(t),
843
- "Cubic.In": (t) => h.Cubic.In(t),
844
- "Cubic.InOut": (t) => h.Cubic.InOut(t),
845
- "Cubic.Out": (t) => h.Cubic.Out(t),
846
- "Elastic.In": (t) => h.Elastic.In(t),
847
- "Elastic.InOut": (t) => h.Elastic.InOut(t),
848
- "Elastic.Out": (t) => h.Elastic.Out(t),
849
- "Exponential.In": (t) => h.Exponential.In(t),
850
- "Exponential.InOut": (t) => h.Exponential.InOut(t),
851
- "Exponential.Out": (t) => h.Exponential.Out(t),
852
- "Linear.None": (t) => h.Linear.None(t),
853
- "Quadratic.In": (t) => h.Quadratic.In(t),
854
- "Quadratic.InOut": (t) => h.Quadratic.InOut(t),
855
- "Quadratic.Out": (t) => h.Quadratic.Out(t),
856
- "Quartic.In": (t) => h.Quartic.In(t),
857
- "Quartic.InOut": (t) => h.Quartic.InOut(t),
858
- "Quartic.Out": (t) => h.Quartic.Out(t),
859
- "Quintic.In": (t) => h.Quintic.In(t),
860
- "Quintic.InOut": (t) => h.Quintic.InOut(t),
861
- "Quintic.Out": (t) => h.Quintic.Out(t),
862
- "Sinusoidal.In": (t) => h.Sinusoidal.In(t),
863
- "Sinusoidal.InOut": (t) => h.Sinusoidal.InOut(t),
864
- "Sinusoidal.Out": (t) => h.Sinusoidal.Out(t)
865
- };
866
- static ease(t) {
867
- if (!t) return (s) => h.Linear.None(s);
868
- const i = this.#a[t];
869
- if (!i) throw "異常なease指定です";
870
- return i;
871
- }
872
- static aLayerPrpNm = [
873
- "alpha",
874
- "height",
875
- "rotation",
876
- // rotationX〜Z、scaleZ、zは設定すると
877
- "scale_x",
878
- // 三次元方向の拡大縮小ルーチンが働き画像がぼやけるので
879
- "scale_y",
880
- // backlayで設定しない方針
881
- "pivot_x",
882
- "pivot_y",
883
- "width",
884
- "x",
885
- "y"
886
- ];
887
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
888
- static cnvTweenArg(t, i) {
889
- const s = {};
890
- for (const n of p.aLayerPrpNm) {
891
- const o = t[n];
892
- if (!o) continue;
893
- const a = String(o), l = a.startsWith("="), g = l ? a.slice(1) : a;
894
- if (!g) continue;
895
- const [d = "0", u] = g.split(","), f = s[n] = parseFloat(d);
896
- u && (s[n] += Math.round(
897
- Math.random() * (parseFloat(u) - f + 1)
898
- )), l && (s[n] += parseFloat(i[n]));
899
- }
900
- return s;
901
- }
902
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
903
- static tween(t, i, s, n, o, a, l, g = !0) {
904
- const d = this.#s.isSkipping ? 0 : M(i, "time", NaN), u = new m(s).to(n, d).onUpdate((v) => o(v));
905
- this.setTwProp(u, i), this.#e[t] = { tw: u, onEnd: l }, p.#i.add(u);
906
- const { path: f } = i;
907
- let w = u;
908
- if (f) {
909
- _.debugLog && console.group(`🍝 [${i[":タグ名"] ?? ""}] path=${f}= start(${String(s.x)},${String(s.y)},${String(s.alpha)})`);
910
- for (const { groups: v } of f.matchAll(this.#o)) {
911
- const { x: I, x2: S, y: P, y2: O, o: C, o2: D, json: L } = v;
912
- let E = {};
913
- if (L) try {
914
- E = JSON.parse(L);
915
- } catch (z) {
916
- console.error(`🍝 json=${L} ` + String(z));
917
- continue;
918
- }
919
- else
920
- (I ?? S) && (E.x = I ?? S), (P ?? O) && (E.y = P ?? O), (C ?? D) && (E.alpha = Number(C ?? D));
921
- const U = this.cnvTweenArg(E, s);
922
- _.debugLog && console.info(`🍝 ${L ?? `{x:${String(I)} y:${String(P)} o:${String(C)}}`} => hTo:${JSON.stringify(U)}`);
923
- const F = new m(s).to(U, d);
924
- this.setTwProp(F, i), w.chain(F), w = F;
925
- }
926
- _.debugLog && console.groupEnd();
927
- }
928
- w.onComplete(() => {
929
- const v = this.#e[t];
930
- v?.tw && (delete this.#e[t], v.tw = void 0, u.stop(), v.onEnd?.(), a(), c.notifyEndProc(G + t));
931
- });
932
- const { chain: b } = i;
933
- if (b) {
934
- const v = this.#e[b];
935
- if (!v?.tw) throw `${b}は存在しない・または終了したトゥイーンです`;
936
- delete v.onEnd, v.tw.chain(u);
937
- } else g && u.start();
938
- return u;
939
- }
940
- // 11 match 301 step (0.1ms) PCRE2 https://regex101.com/r/reinpq/1
941
- // List ${x}${x2}/${y}${y2}/${o}${o2}=${json}\n
942
- /*
943
- \(\s*
944
- (?: (?<x>[-=\d\.]+) | (['"]) (?<x2>.*?) \2 )?
945
- (?:
946
- \s*,\s*
947
- (?: (?<y>[-=\d\.]+) | (['"]) (?<y2>.*?) \5 )?
948
- (?:
949
- \s*,\s*
950
- (?: (?<o>[-=\d\.]+) | (['"]) (?<o2>.*?) \8 )
951
- )?
952
- )?
953
- |
954
- (?<json>\{[^{}]*})
955
- */
956
- static #o = /\(\s*(?:(?<x>[-=\d.]+)|(['"])(?<x2>.*?)\2)?(?:\s*,\s*(?:(?<y>[-=\d.]+)|(['"])(?<y2>.*?)\5)?(?:\s*,\s*(?:(?<o>[-=\d.]+)|(['"])(?<o2>.*?)\8))?)?|(?<json>\{[^{}]*})/g;
957
- // トランス終了待ち
958
- static wt(t) {
959
- if (!this.#e[N]?.tw) return !1;
960
- const s = () => this.stopEndTrans();
961
- return c.beginProc(N, s, !0, s), !0;
962
- }
963
- // レイヤのトランジションの停止
964
- static stopEndTrans() {
965
- this.#e[N]?.tw?.stop().end();
966
- }
967
- // stop()とend()は別
968
- // トゥイーン終了待ち
969
- static wait_tsy(t) {
970
- const i = this.#r(t), s = this.#e[i];
971
- if (!s?.tw) return !1;
972
- const n = () => s.tw?.end();
973
- return c.beginProc(G + i, n, !0, n), !0;
974
- }
975
- static #r(t) {
976
- const { layer: i = "", id: s, name: n } = t, o = s ? `frm
977
- ${s}` : n ?? i;
978
- if (!o) throw "トゥイーンが指定されていません";
979
- return o;
980
- }
981
- // トゥイーン中断
982
- static stop_tsy(t) {
983
- const i = this.#r(t);
984
- return this.#e[i]?.tw?.stop().end(), !1;
985
- }
986
- // 一時停止
987
- static pause_tsy(t) {
988
- const i = this.#r(t);
989
- return this.#e[i]?.tw?.pause(), !1;
990
- }
991
- // 一時停止再開
992
- static resume_tsy(t) {
993
- const i = this.#r(t);
994
- return this.#e[i]?.tw?.resume(), !1;
995
- }
996
- }
997
- export {
998
- p as C,
999
- Q as G,
1000
- r as R,
1001
- m as T,
1002
- c as a,
1003
- N as b
1004
- };
1005
- //# sourceMappingURL=CmnTween.js.map