lyb-pixi-js 1.10.8 → 1.10.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ import { Container } from "pixi.js";
2
+ /** @description 当前容器在父容器居中 */
3
+ export declare const libContainerCenter: (parent: Container, item: Container, centerType?: "x" | "y" | "xy") => void;
@@ -0,0 +1,10 @@
1
+ /** @description 当前容器在父容器居中 */
2
+ export const libContainerCenter = (parent, item, centerType = "xy") => {
3
+ const xy = centerType === "xy";
4
+ if (centerType === "x" || xy) {
5
+ item.x = parent.width / 2 - item.width / 2;
6
+ }
7
+ if (centerType === "y" || xy) {
8
+ item.y = parent.height / 2 - item.height / 2;
9
+ }
10
+ };
@@ -0,0 +1,7 @@
1
+ import { Container } from "pixi.js";
2
+ /** @description 列表居中
3
+ * @param parent 父容器
4
+ * @param items 子元素数组
5
+ * @param direction 方向数组,"x"表示水平,"y"表示垂直
6
+ */
7
+ export declare const libPixiHVCenter: (parent: Container, items: Container[], direction: ("x" | "y")[]) => void;
@@ -0,0 +1,14 @@
1
+ /** @description 列表居中
2
+ * @param parent 父容器
3
+ * @param items 子元素数组
4
+ * @param direction 方向数组,"x"表示水平,"y"表示垂直
5
+ */
6
+ export const libPixiHVCenter = (parent, items, direction) => {
7
+ items.forEach((item) => {
8
+ direction.forEach((d) => {
9
+ item[d] =
10
+ parent[d === "x" ? "width" : "height"] / 2 -
11
+ item[d === "x" ? "width" : "height"] / 2;
12
+ });
13
+ });
14
+ };
@@ -4,6 +4,5 @@ import { Container } from "pixi.js";
4
4
  * @param items 要排列的元素数组。
5
5
  * @param gap 元素之间的间隔,可以是固定间隔或自定义的间隔数组。
6
6
  * @param direction 排列方向,"x"表示水平,"y"表示垂直,默认为水平。
7
- * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibArrangeLinear-间隔布局
8
7
  */
9
- export declare const LibArrangeLinear: (items: Container[], gap: number | number[], direction?: "x" | "y") => void;
8
+ export declare const libPixiHVGap: (items: Container[], gap: number | number[], direction?: "x" | "y") => void;
@@ -3,9 +3,8 @@
3
3
  * @param items 要排列的元素数组。
4
4
  * @param gap 元素之间的间隔,可以是固定间隔或自定义的间隔数组。
5
5
  * @param direction 排列方向,"x"表示水平,"y"表示垂直,默认为水平。
6
- * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibArrangeLinear-间隔布局
7
6
  */
8
- export const LibArrangeLinear = (items, gap, direction = "x") => {
7
+ export const libPixiHVGap = (items, gap, direction = "x") => {
9
8
  if (Array.isArray(gap)) {
10
9
  if (gap.length !== items.length - 1) {
11
10
  console.error(new Error("间隔的数组长度只能等于元素数组长度-1"));
@@ -14,9 +13,7 @@ export const LibArrangeLinear = (items, gap, direction = "x") => {
14
13
  }
15
14
  let lastPosition = 0;
16
15
  items.forEach((item, index) => {
17
- const position = index === 0
18
- ? 0
19
- : lastPosition + (Array.isArray(gap) ? gap[index - 1] : gap);
16
+ const position = index === 0 ? 0 : lastPosition + (Array.isArray(gap) ? gap[index - 1] : gap);
20
17
  if (direction === "x") {
21
18
  item.x = position;
22
19
  lastPosition = item.x + item.width;
package/libPixiJs.d.ts CHANGED
@@ -241,4 +241,19 @@ export declare const Utils: {
241
241
  * @param payload 事件携带数据
242
242
  */
243
243
  LibPixiEmitContainerEvent: (container: import("pixi.js").Container, event: string, payload?: any) => void;
244
+ /** @description 当前容器在父容器居中 */
245
+ libContainerCenter: (parent: import("pixi.js").Container, item: import("pixi.js").Container, centerType?: "x" | "y" | "xy") => void;
246
+ /** @description 列表居中
247
+ * @param parent 父容器
248
+ * @param items 子元素数组
249
+ * @param direction 方向数组,"x"表示水平,"y"表示垂直
250
+ */
251
+ libPixiHVCenter: (parent: import("pixi.js").Container, items: import("pixi.js").Container[], direction: ("x" | "y")[]) => void;
252
+ /**
253
+ * @description 按照指定方向(水平或垂直)排列元素,支持固定间隔或自定义每个间隔。
254
+ * @param items 要排列的元素数组。
255
+ * @param gap 元素之间的间隔,可以是固定间隔或自定义的间隔数组。
256
+ * @param direction 排列方向,"x"表示水平,"y"表示垂直,默认为水平。
257
+ */
258
+ libPixiHVGap: (items: import("pixi.js").Container[], gap: number | number[], direction?: "x" | "y") => void;
244
259
  };
package/libPixiJs.js CHANGED
@@ -41,6 +41,9 @@ import { LibPixiSlide } from "./Components/Custom/LibPixiSlide";
41
41
  import { LibPixiEmitContainerEvent } from "./Utils/LibPixiEmitContainerEvent";
42
42
  import { LibPixiLabelValue } from "./Components/Custom/LibPixiLabelValue";
43
43
  import { LibPixiPuzzleBg } from "./Components/Custom/LibPixiPuzzleBg";
44
+ import { libContainerCenter } from "./Utils/LibContainerCenter";
45
+ import { libPixiHVCenter } from "./Utils/LibPixiHVCenter";
46
+ import { libPixiHVGap } from "./Utils/LibPixiHVGap";
44
47
  /** @description 组件 */
45
48
  export const Components = {
46
49
  Base: {
@@ -256,4 +259,19 @@ export const Utils = {
256
259
  * @param payload 事件携带数据
257
260
  */
258
261
  LibPixiEmitContainerEvent,
262
+ /** @description 当前容器在父容器居中 */
263
+ libContainerCenter,
264
+ /** @description 列表居中
265
+ * @param parent 父容器
266
+ * @param items 子元素数组
267
+ * @param direction 方向数组,"x"表示水平,"y"表示垂直
268
+ */
269
+ libPixiHVCenter,
270
+ /**
271
+ * @description 按照指定方向(水平或垂直)排列元素,支持固定间隔或自定义每个间隔。
272
+ * @param items 要排列的元素数组。
273
+ * @param gap 元素之间的间隔,可以是固定间隔或自定义的间隔数组。
274
+ * @param direction 排列方向,"x"表示水平,"y"表示垂直,默认为水平。
275
+ */
276
+ libPixiHVGap,
259
277
  };
package/lyb-pixi.js CHANGED
@@ -1315,7 +1315,7 @@
1315
1315
  var ys = arrObjKeys(obj, inspect2);
1316
1316
  var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
1317
1317
  var protoTag = obj instanceof Object ? "" : "null prototype";
1318
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
1318
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
1319
1319
  var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
1320
1320
  var tag2 = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
1321
1321
  if (ys.length === 0) {
@@ -1336,26 +1336,29 @@
1336
1336
  function quote(s2) {
1337
1337
  return $replace$1.call(String(s2), /"/g, """);
1338
1338
  }
1339
+ function canTrustToString(obj) {
1340
+ return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
1341
+ }
1339
1342
  function isArray$3(obj) {
1340
- return toStr(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1343
+ return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
1341
1344
  }
1342
1345
  function isDate(obj) {
1343
- return toStr(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1346
+ return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
1344
1347
  }
1345
1348
  function isRegExp$1(obj) {
1346
- return toStr(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1349
+ return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
1347
1350
  }
1348
1351
  function isError(obj) {
1349
- return toStr(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1352
+ return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
1350
1353
  }
1351
1354
  function isString(obj) {
1352
- return toStr(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1355
+ return toStr$1(obj) === "[object String]" && canTrustToString(obj);
1353
1356
  }
1354
1357
  function isNumber(obj) {
1355
- return toStr(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1358
+ return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
1356
1359
  }
1357
1360
  function isBoolean(obj) {
1358
- return toStr(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1361
+ return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
1359
1362
  }
1360
1363
  function isSymbol(obj) {
1361
1364
  if (hasShammedSymbols) {
@@ -1391,7 +1394,7 @@
1391
1394
  function has$3(obj, key) {
1392
1395
  return hasOwn$1.call(obj, key);
1393
1396
  }
1394
- function toStr(obj) {
1397
+ function toStr$1(obj) {
1395
1398
  return objectToString.call(obj);
1396
1399
  }
1397
1400
  function nameOf(f2) {
@@ -1700,7 +1703,7 @@
1700
1703
  var uri = URIError;
1701
1704
  var abs$2 = Math.abs;
1702
1705
  var floor$2 = Math.floor;
1703
- var max$2 = Math.max;
1706
+ var max$3 = Math.max;
1704
1707
  var min$2 = Math.min;
1705
1708
  var pow$2 = Math.pow;
1706
1709
  var round$3 = Math.round;
@@ -1833,93 +1836,77 @@
1833
1836
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
1834
1837
  return Object_getPrototypeOf;
1835
1838
  }
1836
- var implementation;
1837
- var hasRequiredImplementation;
1838
- function requireImplementation() {
1839
- if (hasRequiredImplementation)
1840
- return implementation;
1841
- hasRequiredImplementation = 1;
1842
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
1843
- var toStr2 = Object.prototype.toString;
1844
- var max2 = Math.max;
1845
- var funcType = "[object Function]";
1846
- var concatty = function concatty2(a2, b2) {
1847
- var arr = [];
1848
- for (var i2 = 0; i2 < a2.length; i2 += 1) {
1849
- arr[i2] = a2[i2];
1850
- }
1851
- for (var j2 = 0; j2 < b2.length; j2 += 1) {
1852
- arr[j2 + a2.length] = b2[j2];
1853
- }
1854
- return arr;
1855
- };
1856
- var slicy = function slicy2(arrLike, offset) {
1857
- var arr = [];
1858
- for (var i2 = offset || 0, j2 = 0; i2 < arrLike.length; i2 += 1, j2 += 1) {
1859
- arr[j2] = arrLike[i2];
1860
- }
1861
- return arr;
1862
- };
1863
- var joiny = function(arr, joiner) {
1864
- var str = "";
1865
- for (var i2 = 0; i2 < arr.length; i2 += 1) {
1866
- str += arr[i2];
1867
- if (i2 + 1 < arr.length) {
1868
- str += joiner;
1869
- }
1839
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
1840
+ var toStr = Object.prototype.toString;
1841
+ var max$2 = Math.max;
1842
+ var funcType = "[object Function]";
1843
+ var concatty = function concatty2(a2, b2) {
1844
+ var arr = [];
1845
+ for (var i2 = 0; i2 < a2.length; i2 += 1) {
1846
+ arr[i2] = a2[i2];
1847
+ }
1848
+ for (var j2 = 0; j2 < b2.length; j2 += 1) {
1849
+ arr[j2 + a2.length] = b2[j2];
1850
+ }
1851
+ return arr;
1852
+ };
1853
+ var slicy = function slicy2(arrLike, offset) {
1854
+ var arr = [];
1855
+ for (var i2 = offset || 0, j2 = 0; i2 < arrLike.length; i2 += 1, j2 += 1) {
1856
+ arr[j2] = arrLike[i2];
1857
+ }
1858
+ return arr;
1859
+ };
1860
+ var joiny = function(arr, joiner) {
1861
+ var str = "";
1862
+ for (var i2 = 0; i2 < arr.length; i2 += 1) {
1863
+ str += arr[i2];
1864
+ if (i2 + 1 < arr.length) {
1865
+ str += joiner;
1870
1866
  }
1871
- return str;
1872
- };
1873
- implementation = function bind2(that) {
1874
- var target = this;
1875
- if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
1876
- throw new TypeError(ERROR_MESSAGE + target);
1877
- }
1878
- var args = slicy(arguments, 1);
1879
- var bound;
1880
- var binder = function() {
1881
- if (this instanceof bound) {
1882
- var result = target.apply(
1883
- this,
1884
- concatty(args, arguments)
1885
- );
1886
- if (Object(result) === result) {
1887
- return result;
1888
- }
1889
- return this;
1890
- }
1891
- return target.apply(
1892
- that,
1867
+ }
1868
+ return str;
1869
+ };
1870
+ var implementation$1 = function bind2(that) {
1871
+ var target = this;
1872
+ if (typeof target !== "function" || toStr.apply(target) !== funcType) {
1873
+ throw new TypeError(ERROR_MESSAGE + target);
1874
+ }
1875
+ var args = slicy(arguments, 1);
1876
+ var bound;
1877
+ var binder = function() {
1878
+ if (this instanceof bound) {
1879
+ var result = target.apply(
1880
+ this,
1893
1881
  concatty(args, arguments)
1894
1882
  );
1895
- };
1896
- var boundLength = max2(0, target.length - args.length);
1897
- var boundArgs = [];
1898
- for (var i2 = 0; i2 < boundLength; i2++) {
1899
- boundArgs[i2] = "$" + i2;
1900
- }
1901
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
1902
- if (target.prototype) {
1903
- var Empty = function Empty2() {
1904
- };
1905
- Empty.prototype = target.prototype;
1906
- bound.prototype = new Empty();
1907
- Empty.prototype = null;
1883
+ if (Object(result) === result) {
1884
+ return result;
1885
+ }
1886
+ return this;
1908
1887
  }
1909
- return bound;
1888
+ return target.apply(
1889
+ that,
1890
+ concatty(args, arguments)
1891
+ );
1910
1892
  };
1911
- return implementation;
1912
- }
1913
- var functionBind;
1914
- var hasRequiredFunctionBind;
1915
- function requireFunctionBind() {
1916
- if (hasRequiredFunctionBind)
1917
- return functionBind;
1918
- hasRequiredFunctionBind = 1;
1919
- var implementation2 = requireImplementation();
1920
- functionBind = Function.prototype.bind || implementation2;
1921
- return functionBind;
1922
- }
1893
+ var boundLength = max$2(0, target.length - args.length);
1894
+ var boundArgs = [];
1895
+ for (var i2 = 0; i2 < boundLength; i2++) {
1896
+ boundArgs[i2] = "$" + i2;
1897
+ }
1898
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
1899
+ if (target.prototype) {
1900
+ var Empty = function Empty2() {
1901
+ };
1902
+ Empty.prototype = target.prototype;
1903
+ bound.prototype = new Empty();
1904
+ Empty.prototype = null;
1905
+ }
1906
+ return bound;
1907
+ };
1908
+ var implementation = implementation$1;
1909
+ var functionBind = Function.prototype.bind || implementation;
1923
1910
  var functionCall;
1924
1911
  var hasRequiredFunctionCall;
1925
1912
  function requireFunctionCall() {
@@ -1939,12 +1926,12 @@
1939
1926
  return functionApply;
1940
1927
  }
1941
1928
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
1942
- var bind$2 = requireFunctionBind();
1929
+ var bind$2 = functionBind;
1943
1930
  var $apply$1 = requireFunctionApply();
1944
1931
  var $call$2 = requireFunctionCall();
1945
1932
  var $reflectApply = reflectApply;
1946
1933
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
1947
- var bind$1 = requireFunctionBind();
1934
+ var bind$1 = functionBind;
1948
1935
  var $TypeError$4 = type;
1949
1936
  var $call$1 = requireFunctionCall();
1950
1937
  var $actualApply = actualApply;
@@ -2015,7 +2002,7 @@
2015
2002
  hasRequiredHasown = 1;
2016
2003
  var call = Function.prototype.call;
2017
2004
  var $hasOwn = Object.prototype.hasOwnProperty;
2018
- var bind2 = requireFunctionBind();
2005
+ var bind2 = functionBind;
2019
2006
  hasown = bind2.call(call, $hasOwn);
2020
2007
  return hasown;
2021
2008
  }
@@ -2030,7 +2017,7 @@
2030
2017
  var $URIError = uri;
2031
2018
  var abs$1 = abs$2;
2032
2019
  var floor$1 = floor$2;
2033
- var max$1 = max$2;
2020
+ var max$1 = max$3;
2034
2021
  var min$1 = min$2;
2035
2022
  var pow$1 = pow$2;
2036
2023
  var round$2 = round$3;
@@ -2093,6 +2080,7 @@
2093
2080
  "%eval%": eval,
2094
2081
  // eslint-disable-line no-eval
2095
2082
  "%EvalError%": $EvalError,
2083
+ "%Float16Array%": typeof Float16Array === "undefined" ? undefined$1 : Float16Array,
2096
2084
  "%Float32Array%": typeof Float32Array === "undefined" ? undefined$1 : Float32Array,
2097
2085
  "%Float64Array%": typeof Float64Array === "undefined" ? undefined$1 : Float64Array,
2098
2086
  "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined$1 : FinalizationRegistry,
@@ -2234,7 +2222,7 @@
2234
2222
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
2235
2223
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
2236
2224
  };
2237
- var bind = requireFunctionBind();
2225
+ var bind = functionBind;
2238
2226
  var hasOwn = requireHasown();
2239
2227
  var $concat = bind.call($call, Array.prototype.concat);
2240
2228
  var $spliceApply = bind.call($apply, Array.prototype.splice);
@@ -2346,11 +2334,14 @@
2346
2334
  var $indexOf = callBindBasic([GetIntrinsic$2("%String.prototype.indexOf%")]);
2347
2335
  var callBound$2 = function callBoundIntrinsic(name, allowMissing) {
2348
2336
  var intrinsic = (
2349
- /** @type {Parameters<typeof callBindBasic>[0][0]} */
2337
+ /** @type {(this: unknown, ...args: unknown[]) => unknown} */
2350
2338
  GetIntrinsic$2(name, !!allowMissing)
2351
2339
  );
2352
2340
  if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
2353
- return callBindBasic([intrinsic]);
2341
+ return callBindBasic(
2342
+ /** @type {const} */
2343
+ [intrinsic]
2344
+ );
2354
2345
  }
2355
2346
  return intrinsic;
2356
2347
  };
@@ -10971,7 +10962,7 @@ void main(void)
10971
10962
  */
10972
10963
  run(options) {
10973
10964
  const { renderer } = this;
10974
- renderer.runners.init.emit(renderer.options), options.hello && console.log(`PixiJS 7.4.2 - ${renderer.rendererLogId} - https://pixijs.com`), renderer.resize(renderer.screen.width, renderer.screen.height);
10965
+ renderer.runners.init.emit(renderer.options), options.hello && console.log(`PixiJS 7.4.3 - ${renderer.rendererLogId} - https://pixijs.com`), renderer.resize(renderer.screen.width, renderer.screen.height);
10975
10966
  }
10976
10967
  destroy() {
10977
10968
  }
@@ -18222,7 +18213,8 @@ void main()
18222
18213
  if (keys.forEach((key2) => {
18223
18214
  this._cacheMap.set(key2, cachedAssets);
18224
18215
  }), cacheKeys.forEach((key2) => {
18225
- this._cache.has(key2) && this._cache.get(key2) !== value && console.warn("[Cache] already has key:", key2), this._cache.set(key2, cacheableAssets[key2]);
18216
+ const val = cacheableAssets ? cacheableAssets[key2] : value;
18217
+ this._cache.has(key2) && this._cache.get(key2) !== val && console.warn("[Cache] already has key:", key2), this._cache.set(key2, cacheableAssets[key2]);
18226
18218
  }), value instanceof Texture) {
18227
18219
  const texture = value;
18228
18220
  keys.forEach((key2) => {
@@ -25738,12 +25730,11 @@ void main(void)\r
25738
25730
  subClass.__proto__ = superClass;
25739
25731
  }
25740
25732
  /*!
25741
- * GSAP 3.12.5
25733
+ * GSAP 3.13.0
25742
25734
  * https://gsap.com
25743
25735
  *
25744
- * @license Copyright 2008-2024, GreenSock. All rights reserved.
25745
- * Subject to the terms at https://gsap.com/standard-license or for
25746
- * Club GSAP members, the agreement issued with that membership.
25736
+ * @license Copyright 2008-2025, GreenSock. All rights reserved.
25737
+ * Subject to the terms at https://gsap.com/standard-license
25747
25738
  * @author: Jack Doyle, jack@greensock.com
25748
25739
  */
25749
25740
  var _config = {
@@ -25834,9 +25825,11 @@ void main(void)\r
25834
25825
  tween = a2[i2];
25835
25826
  tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0);
25836
25827
  }
25828
+ }, _isRevertWorthy = function _isRevertWorthy2(animation) {
25829
+ return !!(animation._initted || animation._startAt || animation.add);
25837
25830
  }, _lazySafeRender = function _lazySafeRender2(animation, time, suppressEvents, force) {
25838
25831
  _lazyTweens.length && !_reverting$1 && _lazyRender();
25839
- animation.render(time, suppressEvents, force || _reverting$1 && time < 0 && (animation._initted || animation._startAt));
25832
+ animation.render(time, suppressEvents, force || !!(_reverting$1 && time < 0 && _isRevertWorthy(animation)));
25840
25833
  _lazyTweens.length && !_reverting$1 && _lazyRender();
25841
25834
  }, _numericIfPossible = function _numericIfPossible2(value) {
25842
25835
  var n2 = parseFloat(value);
@@ -25959,7 +25952,7 @@ void main(void)\r
25959
25952
  }, _elapsedCycleDuration = function _elapsedCycleDuration2(animation) {
25960
25953
  return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0;
25961
25954
  }, _animationCycle = function _animationCycle2(tTime, cycleDuration) {
25962
- var whole = Math.floor(tTime /= cycleDuration);
25955
+ var whole = Math.floor(tTime = _roundPrecise(tTime / cycleDuration));
25963
25956
  return tTime && whole === tTime ? whole - 1 : whole;
25964
25957
  }, _parentToChildTotalTime = function _parentToChildTotalTime2(parentTime, child) {
25965
25958
  return (parentTime - child._start) * child._ts + (child._ts >= 0 ? 0 : child._dirty ? child.totalDuration() : child._tDur);
@@ -26740,7 +26733,7 @@ void main(void)\r
26740
26733
  }, easeOut);
26741
26734
  })(7.5625, 2.75);
26742
26735
  _insertEase("Expo", function(p2) {
26743
- return p2 ? Math.pow(2, 10 * (p2 - 1)) : 0;
26736
+ return Math.pow(2, 10 * (p2 - 1)) * p2 + p2 * p2 * p2 * p2 * p2 * p2 * (1 - p2);
26744
26737
  });
26745
26738
  _insertEase("Circ", function(p2) {
26746
26739
  return -(_sqrt(1 - p2 * p2) - 1);
@@ -26837,7 +26830,7 @@ void main(void)\r
26837
26830
  return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time;
26838
26831
  };
26839
26832
  _proto.totalProgress = function totalProgress(value, suppressEvents) {
26840
- return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.rawTime() > 0 ? 1 : 0;
26833
+ return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.rawTime() >= 0 && this._initted ? 1 : 0;
26841
26834
  };
26842
26835
  _proto.progress = function progress(value, suppressEvents) {
26843
26836
  return arguments.length ? this.totalTime(this.duration() * (this._yoyo && !(this.iteration() & 1) ? 1 - value : value) + _elapsedCycleDuration(this), suppressEvents) : this.duration() ? Math.min(1, this._time / this._dur) : this.rawTime() > 0 ? 1 : 0;
@@ -26856,7 +26849,7 @@ void main(void)\r
26856
26849
  var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime;
26857
26850
  this._rts = +value || 0;
26858
26851
  this._ts = this._ps || value === -_tinyNum ? 0 : this._rts;
26859
- this.totalTime(_clamp(-Math.abs(this._delay), this._tDur, tTime), suppressEvents !== false);
26852
+ this.totalTime(_clamp(-Math.abs(this._delay), this.totalDuration(), tTime), suppressEvents !== false);
26860
26853
  _setEnd(this);
26861
26854
  return _recacheAncestors(this);
26862
26855
  };
@@ -26899,7 +26892,7 @@ void main(void)\r
26899
26892
  }
26900
26893
  var prevIsReverting = _reverting$1;
26901
26894
  _reverting$1 = config2;
26902
- if (this._initted || this._startAt) {
26895
+ if (_isRevertWorthy(this)) {
26903
26896
  this.timeline && this.timeline.revert(config2);
26904
26897
  this.totalTime(-0.01, config2.suppressEvents);
26905
26898
  }
@@ -26942,7 +26935,9 @@ void main(void)\r
26942
26935
  return this.totalTime(_parsePosition(this, position), _isNotFalse(suppressEvents));
26943
26936
  };
26944
26937
  _proto.restart = function restart(includeDelay, suppressEvents) {
26945
- return this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents));
26938
+ this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents));
26939
+ this._dur || (this._zTime = -_tinyNum);
26940
+ return this;
26946
26941
  };
26947
26942
  _proto.play = function play(from, suppressEvents) {
26948
26943
  from != null && this.seek(from, suppressEvents);
@@ -27119,8 +27114,9 @@ void main(void)\r
27119
27114
  iteration = this._repeat;
27120
27115
  time = dur;
27121
27116
  } else {
27122
- iteration = ~~(tTime / cycleDuration);
27123
- if (iteration && iteration === tTime / cycleDuration) {
27117
+ prevIteration = _roundPrecise(tTime / cycleDuration);
27118
+ iteration = ~~prevIteration;
27119
+ if (iteration && iteration === prevIteration) {
27124
27120
  time = dur;
27125
27121
  iteration--;
27126
27122
  }
@@ -27174,7 +27170,7 @@ void main(void)\r
27174
27170
  this._zTime = totalTime;
27175
27171
  prevTime = 0;
27176
27172
  }
27177
- if (!prevTime && time && !suppressEvents && !iteration) {
27173
+ if (!prevTime && tTime && !suppressEvents && !prevIteration) {
27178
27174
  _callback(this, "onStart");
27179
27175
  if (this._tTime !== tTime) {
27180
27176
  return this;
@@ -27206,7 +27202,7 @@ void main(void)\r
27206
27202
  if (child.parent !== this) {
27207
27203
  return this.render(totalTime, suppressEvents, force);
27208
27204
  }
27209
- child.render(child._ts > 0 ? (adjustedTime - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (adjustedTime - child._start) * child._ts, suppressEvents, force || _reverting$1 && (child._initted || child._startAt));
27205
+ child.render(child._ts > 0 ? (adjustedTime - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (adjustedTime - child._start) * child._ts, suppressEvents, force || _reverting$1 && _isRevertWorthy(child));
27210
27206
  if (time !== this._time || !this._ts && !prevPaused) {
27211
27207
  pauseTween = 0;
27212
27208
  next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum);
@@ -27303,7 +27299,7 @@ void main(void)\r
27303
27299
  if (_isFunction(child)) {
27304
27300
  return this.killTweensOf(child);
27305
27301
  }
27306
- _removeLinkedListItem(this, child);
27302
+ child.parent === this && _removeLinkedListItem(this, child);
27307
27303
  if (child === this._recent) {
27308
27304
  this._recent = this._last;
27309
27305
  }
@@ -27905,7 +27901,7 @@ void main(void)\r
27905
27901
  var prevTime = this._time, tDur = this._tDur, dur = this._dur, isNegative = totalTime < 0, tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime, time, pt, iteration, cycleDuration, prevIteration, isYoyo, ratio, timeline, yoyoEase;
27906
27902
  if (!dur) {
27907
27903
  _renderZeroDurationTween(this, totalTime, suppressEvents, force);
27908
- } else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative) {
27904
+ } else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative || this._lazy) {
27909
27905
  time = tTime;
27910
27906
  timeline = this.timeline;
27911
27907
  if (this._repeat) {
@@ -27918,12 +27914,14 @@ void main(void)\r
27918
27914
  iteration = this._repeat;
27919
27915
  time = dur;
27920
27916
  } else {
27921
- iteration = ~~(tTime / cycleDuration);
27922
- if (iteration && iteration === _roundPrecise(tTime / cycleDuration)) {
27917
+ prevIteration = _roundPrecise(tTime / cycleDuration);
27918
+ iteration = ~~prevIteration;
27919
+ if (iteration && iteration === prevIteration) {
27923
27920
  time = dur;
27924
27921
  iteration--;
27922
+ } else if (time > dur) {
27923
+ time = dur;
27925
27924
  }
27926
- time > dur && (time = dur);
27927
27925
  }
27928
27926
  isYoyo = this._yoyo && iteration & 1;
27929
27927
  if (isYoyo) {
@@ -27937,7 +27935,7 @@ void main(void)\r
27937
27935
  }
27938
27936
  if (iteration !== prevIteration) {
27939
27937
  timeline && this._yEase && _propagateYoyoEase(timeline, isYoyo);
27940
- if (this.vars.repeatRefresh && !isYoyo && !this._lock && this._time !== cycleDuration && this._initted) {
27938
+ if (this.vars.repeatRefresh && !isYoyo && !this._lock && time !== cycleDuration && this._initted) {
27941
27939
  this._lock = force = 1;
27942
27940
  this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0;
27943
27941
  }
@@ -27965,7 +27963,7 @@ void main(void)\r
27965
27963
  if (this._from) {
27966
27964
  this.ratio = ratio = 1 - ratio;
27967
27965
  }
27968
- if (time && !prevTime && !suppressEvents && !iteration) {
27966
+ if (!prevTime && tTime && !suppressEvents && !prevIteration) {
27969
27967
  _callback(this, "onStart");
27970
27968
  if (this._tTime !== tTime) {
27971
27969
  return this;
@@ -28022,7 +28020,8 @@ void main(void)\r
28022
28020
  }
28023
28021
  if (!targets && (!vars || vars === "all")) {
28024
28022
  this._lazy = this._pt = 0;
28025
- return this.parent ? _interrupt(this) : this;
28023
+ this.parent ? _interrupt(this) : this.scrollTrigger && this.scrollTrigger.kill(!!_reverting$1);
28024
+ return this;
28026
28025
  }
28027
28026
  if (this.timeline) {
28028
28027
  var tDur = this.timeline.totalDuration();
@@ -28469,8 +28468,8 @@ void main(void)\r
28469
28468
  };
28470
28469
  },
28471
28470
  quickTo: function quickTo(target, property, vars) {
28472
- var _merge2;
28473
- var tween = gsap.to(target, _merge((_merge2 = {}, _merge2[property] = "+=0.1", _merge2.paused = true, _merge2), vars || {})), func = function func2(value, start, startIsRelative) {
28471
+ var _setDefaults2;
28472
+ var tween = gsap.to(target, _setDefaults((_setDefaults2 = {}, _setDefaults2[property] = "+=0.1", _setDefaults2.paused = true, _setDefaults2.stagger = 0, _setDefaults2), vars || {})), func = function func2(value, start, startIsRelative) {
28474
28473
  return tween.resetTo(property, value, start, startIsRelative);
28475
28474
  };
28476
28475
  func.tween = tween;
@@ -28632,6 +28631,7 @@ void main(void)\r
28632
28631
  }, _buildModifierPlugin = function _buildModifierPlugin2(name, modifier) {
28633
28632
  return {
28634
28633
  name,
28634
+ headless: 1,
28635
28635
  rawVars: 1,
28636
28636
  //don't pre-process function-based values or "random()" strings.
28637
28637
  init: function init2(target, vars, tween) {
@@ -28678,6 +28678,7 @@ void main(void)\r
28678
28678
  }
28679
28679
  }, {
28680
28680
  name: "endArray",
28681
+ headless: 1,
28681
28682
  init: function init2(target, value) {
28682
28683
  var i2 = value.length;
28683
28684
  while (i2--) {
@@ -28685,7 +28686,7 @@ void main(void)\r
28685
28686
  }
28686
28687
  }
28687
28688
  }, _buildModifierPlugin("roundProps", _roundModifier), _buildModifierPlugin("modifiers"), _buildModifierPlugin("snap", snap)) || _gsap;
28688
- Tween.version = Timeline$1.version = gsap.version = "3.12.5";
28689
+ Tween.version = Timeline$1.version = gsap.version = "3.13.0";
28689
28690
  _coreReady = 1;
28690
28691
  _windowExists$1() && _wake();
28691
28692
  _easeMap.Power0;
@@ -28707,12 +28708,11 @@ void main(void)\r
28707
28708
  _easeMap.Expo;
28708
28709
  _easeMap.Circ;
28709
28710
  /*!
28710
- * CSSPlugin 3.12.5
28711
+ * CSSPlugin 3.13.0
28711
28712
  * https://gsap.com
28712
28713
  *
28713
- * Copyright 2008-2024, GreenSock. All rights reserved.
28714
- * Subject to the terms at https://gsap.com/standard-license or for
28715
- * Club GSAP members, the agreement issued with that membership.
28714
+ * Copyright 2008-2025, GreenSock. All rights reserved.
28715
+ * Subject to the terms at https://gsap.com/standard-license
28716
28716
  * @author: Jack Doyle, jack@greensock.com
28717
28717
  */
28718
28718
  var _win, _doc, _docElement, _pluginInitted, _tempDiv, _recentSetterPlugin, _reverting, _windowExists = function _windowExists2() {
@@ -28785,7 +28785,13 @@ void main(void)\r
28785
28785
  }, _revertStyle = function _revertStyle2() {
28786
28786
  var props = this.props, target = this.target, style = target.style, cache = target._gsap, i2, p2;
28787
28787
  for (i2 = 0; i2 < props.length; i2 += 3) {
28788
- props[i2 + 1] ? target[props[i2]] = props[i2 + 2] : props[i2 + 2] ? style[props[i2]] = props[i2 + 2] : style.removeProperty(props[i2].substr(0, 2) === "--" ? props[i2] : props[i2].replace(_capsExp, "-$1").toLowerCase());
28788
+ if (!props[i2 + 1]) {
28789
+ props[i2 + 2] ? style[props[i2]] = props[i2 + 2] : style.removeProperty(props[i2].substr(0, 2) === "--" ? props[i2] : props[i2].replace(_capsExp, "-$1").toLowerCase());
28790
+ } else if (props[i2 + 1] === 2) {
28791
+ target[props[i2]](props[i2 + 2]);
28792
+ } else {
28793
+ target[props[i2]] = props[i2 + 2];
28794
+ }
28789
28795
  }
28790
28796
  if (this.tfm) {
28791
28797
  for (p2 in this.tfm) {
@@ -28814,7 +28820,7 @@ void main(void)\r
28814
28820
  save: _saveStyle
28815
28821
  };
28816
28822
  target._gsap || gsap.core.getCache(target);
28817
- properties && properties.split(",").forEach(function(p2) {
28823
+ properties && target.style && target.nodeType && properties.split(",").forEach(function(p2) {
28818
28824
  return saver.save(p2);
28819
28825
  });
28820
28826
  return saver;
@@ -28849,30 +28855,17 @@ void main(void)\r
28849
28855
  _reverting = gsap.core.reverting;
28850
28856
  _pluginInitted = 1;
28851
28857
  }
28852
- }, _getBBoxHack = function _getBBoxHack2(swapIfPossible) {
28853
- var svg = _createElement("svg", this.ownerSVGElement && this.ownerSVGElement.getAttribute("xmlns") || "http://www.w3.org/2000/svg"), oldParent = this.parentNode, oldSibling = this.nextSibling, oldCSS = this.style.cssText, bbox;
28858
+ }, _getReparentedCloneBBox = function _getReparentedCloneBBox2(target) {
28859
+ var owner = target.ownerSVGElement, svg = _createElement("svg", owner && owner.getAttribute("xmlns") || "http://www.w3.org/2000/svg"), clone2 = target.cloneNode(true), bbox;
28860
+ clone2.style.display = "block";
28861
+ svg.appendChild(clone2);
28854
28862
  _docElement.appendChild(svg);
28855
- svg.appendChild(this);
28856
- this.style.display = "block";
28857
- if (swapIfPossible) {
28858
- try {
28859
- bbox = this.getBBox();
28860
- this._gsapBBox = this.getBBox;
28861
- this.getBBox = _getBBoxHack2;
28862
- } catch (e2) {
28863
- }
28864
- } else if (this._gsapBBox) {
28865
- bbox = this._gsapBBox();
28866
- }
28867
- if (oldParent) {
28868
- if (oldSibling) {
28869
- oldParent.insertBefore(this, oldSibling);
28870
- } else {
28871
- oldParent.appendChild(this);
28872
- }
28863
+ try {
28864
+ bbox = clone2.getBBox();
28865
+ } catch (e2) {
28873
28866
  }
28867
+ svg.removeChild(clone2);
28874
28868
  _docElement.removeChild(svg);
28875
- this.style.cssText = oldCSS;
28876
28869
  return bbox;
28877
28870
  }, _getAttributeFallbacks = function _getAttributeFallbacks2(target, attributesArray) {
28878
28871
  var i2 = attributesArray.length;
@@ -28882,13 +28875,14 @@ void main(void)\r
28882
28875
  }
28883
28876
  }
28884
28877
  }, _getBBox = function _getBBox2(target) {
28885
- var bounds;
28878
+ var bounds, cloned;
28886
28879
  try {
28887
28880
  bounds = target.getBBox();
28888
28881
  } catch (error) {
28889
- bounds = _getBBoxHack.call(target, true);
28882
+ bounds = _getReparentedCloneBBox(target);
28883
+ cloned = 1;
28890
28884
  }
28891
- bounds && (bounds.width || bounds.height) || target.getBBox === _getBBoxHack || (bounds = _getBBoxHack.call(target, true));
28885
+ bounds && (bounds.width || bounds.height) || cloned || (bounds = _getReparentedCloneBBox(target));
28892
28886
  return bounds && !bounds.width && !bounds.x && !bounds.y ? {
28893
28887
  x: +_getAttributeFallbacks(target, ["x", "cx", "x1"]) || 0,
28894
28888
  y: +_getAttributeFallbacks(target, ["y", "cy", "y1"]) || 0,
@@ -28939,7 +28933,7 @@ void main(void)\r
28939
28933
  return _round(toPercent ? curValue / px * amount : curValue / 100 * px);
28940
28934
  }
28941
28935
  style[horizontal ? "width" : "height"] = amount + (toPixels ? curUnit : unit);
28942
- parent = ~property.indexOf("adius") || unit === "em" && target.appendChild && !isRootSVG ? target : target.parentNode;
28936
+ parent = unit !== "rem" && ~property.indexOf("adius") || unit === "em" && target.appendChild && !isRootSVG ? target : target.parentNode;
28943
28937
  if (isSVG) {
28944
28938
  parent = (target.ownerSVGElement || {}).parentNode;
28945
28939
  }
@@ -29004,6 +28998,9 @@ void main(void)\r
29004
28998
  pt.e = end;
29005
28999
  start += "";
29006
29000
  end += "";
29001
+ if (end.substring(0, 6) === "var(--") {
29002
+ end = _getComputedProperty(target, end.substring(4, end.indexOf(")")));
29003
+ }
29007
29004
  if (end === "auto") {
29008
29005
  startValue = target.style[prop];
29009
29006
  target.style[prop] = end;
@@ -29097,6 +29094,7 @@ void main(void)\r
29097
29094
  _removeProperty(target, _transformProp);
29098
29095
  if (cache) {
29099
29096
  cache.svg && target.removeAttribute("transform");
29097
+ style.scale = style.rotate = style.translate = "none";
29100
29098
  _parseTransform(target, 1);
29101
29099
  cache.uncache = 1;
29102
29100
  _removeIndependentTransforms(style);
@@ -29192,7 +29190,7 @@ void main(void)\r
29192
29190
  temp = style.display;
29193
29191
  style.display = "block";
29194
29192
  parent = target.parentNode;
29195
- if (!parent || !target.offsetParent) {
29193
+ if (!parent || !target.offsetParent && !target.getBoundingClientRect().width) {
29196
29194
  addedToDOM = 1;
29197
29195
  nextSibling = target.nextElementSibling;
29198
29196
  _docElement.appendChild(target);
@@ -29628,6 +29626,10 @@ void main(void)\r
29628
29626
  isTransformRelated = p2 in _transformProps;
29629
29627
  if (isTransformRelated) {
29630
29628
  this.styles.save(p2);
29629
+ if (type2 === "string" && endValue.substring(0, 6) === "var(--") {
29630
+ endValue = _getComputedProperty(target, endValue.substring(4, endValue.indexOf(")")));
29631
+ endNum = parseFloat(endValue);
29632
+ }
29631
29633
  if (!transformPropTween) {
29632
29634
  cache = target._gsap;
29633
29635
  cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform);
@@ -29691,7 +29693,7 @@ void main(void)\r
29691
29693
  } else {
29692
29694
  _tweenComplexCSSString.call(this, target, p2, startValue, relative ? relative + endValue : endValue);
29693
29695
  }
29694
- isTransformRelated || (p2 in style ? inlineProps.push(p2, 0, style[p2]) : inlineProps.push(p2, 1, startValue || target[p2]));
29696
+ isTransformRelated || (p2 in style ? inlineProps.push(p2, 0, style[p2]) : typeof target[p2] === "function" ? inlineProps.push(p2, 2, target[p2]()) : inlineProps.push(p2, 1, startValue || target[p2]));
29695
29697
  props.push(p2);
29696
29698
  }
29697
29699
  }
@@ -32898,7 +32900,11 @@ void main(void)\r
32898
32900
  /**
32899
32901
  * past Spine.globalDelayLimit
32900
32902
  */
32901
- GLOBAL_DELAY_LIMIT: 0
32903
+ GLOBAL_DELAY_LIMIT: 0,
32904
+ /**
32905
+ * shows error in console if atlas page loading somehow failed
32906
+ */
32907
+ REPORT_TEXTURE_LOADER_ERROR: true
32902
32908
  };
32903
32909
  const tempRgb = [0, 0, 0];
32904
32910
  class SpineSprite extends Sprite {
@@ -33293,6 +33299,9 @@ void main(void)\r
33293
33299
  * @private
33294
33300
  */
33295
33301
  createMesh(slot, attachment) {
33302
+ if (!attachment.region && attachment.sequence) {
33303
+ attachment.sequence.apply(slot, attachment);
33304
+ }
33296
33305
  let region = attachment.region;
33297
33306
  if (slot.hackAttachment === attachment) {
33298
33307
  region = slot.hackRegion;
@@ -40000,9 +40009,16 @@ void main(void)\r
40000
40009
  };
40001
40010
  const makeSpineTextureAtlasLoaderFunctionFromPixiLoaderObject = (loader, atlasBasePath, imageMetadata) => {
40002
40011
  return async (pageName, textureLoadedCallback) => {
40003
- const url = path.normalize([...atlasBasePath.split(path.sep), pageName].join(path.sep));
40004
- const texture = await loader.load({ src: url, data: imageMetadata });
40005
- textureLoadedCallback(texture.baseTexture);
40012
+ try {
40013
+ const url = path.normalize([...atlasBasePath.split(path.sep), pageName].join(path.sep));
40014
+ const texture = await loader.load({ src: url, data: imageMetadata });
40015
+ textureLoadedCallback(texture.baseTexture);
40016
+ } catch (e2) {
40017
+ {
40018
+ console.error("Spine: error in texture loader", e2);
40019
+ }
40020
+ textureLoadedCallback(null);
40021
+ }
40006
40022
  };
40007
40023
  };
40008
40024
  extensions$2.add(spineTextureAtlasLoader);
@@ -55420,10 +55436,10 @@ void main(void){
55420
55436
  }
55421
55437
  }
55422
55438
  /*!
55423
- * decimal.js v10.4.3
55439
+ * decimal.js v10.5.0
55424
55440
  * An arbitrary-precision Decimal type for JavaScript.
55425
55441
  * https://github.com/MikeMcl/decimal.js
55426
- * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
55442
+ * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
55427
55443
  * MIT Licence
55428
55444
  */
55429
55445
  var EXP_LIMIT = 9e15, MAX_DIGITS = 1e9, NUMERALS = "0123456789abcdef", LN10 = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", PI = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", DEFAULTS = {
@@ -55692,7 +55708,7 @@ void main(void){
55692
55708
  return divide(x2.sinh(), x2.cosh(), Ctor.precision = pr, Ctor.rounding = rm);
55693
55709
  };
55694
55710
  P.inverseCosine = P.acos = function() {
55695
- var halfPi, x2 = this, Ctor = x2.constructor, k2 = x2.abs().cmp(1), pr = Ctor.precision, rm = Ctor.rounding;
55711
+ var x2 = this, Ctor = x2.constructor, k2 = x2.abs().cmp(1), pr = Ctor.precision, rm = Ctor.rounding;
55696
55712
  if (k2 !== -1) {
55697
55713
  return k2 === 0 ? x2.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0) : new Ctor(NaN);
55698
55714
  }
@@ -55700,11 +55716,10 @@ void main(void){
55700
55716
  return getPi(Ctor, pr + 4, rm).times(0.5);
55701
55717
  Ctor.precision = pr + 6;
55702
55718
  Ctor.rounding = 1;
55703
- x2 = x2.asin();
55704
- halfPi = getPi(Ctor, pr + 4, rm).times(0.5);
55719
+ x2 = new Ctor(1).minus(x2).div(x2.plus(1)).sqrt().atan();
55705
55720
  Ctor.precision = pr;
55706
55721
  Ctor.rounding = rm;
55707
- return halfPi.minus(x2);
55722
+ return x2.times(2);
55708
55723
  };
55709
55724
  P.inverseHyperbolicCosine = P.acosh = function() {
55710
55725
  var pr, rm, x2 = this, Ctor = x2.constructor;
@@ -56916,14 +56931,16 @@ void main(void){
56916
56931
  function isOdd(n2) {
56917
56932
  return n2.d[n2.d.length - 1] & 1;
56918
56933
  }
56919
- function maxOrMin(Ctor, args, ltgt) {
56920
- var y2, x2 = new Ctor(args[0]), i2 = 0;
56934
+ function maxOrMin(Ctor, args, n2) {
56935
+ var k2, y2, x2 = new Ctor(args[0]), i2 = 0;
56921
56936
  for (; ++i2 < args.length; ) {
56922
56937
  y2 = new Ctor(args[i2]);
56923
56938
  if (!y2.s) {
56924
56939
  x2 = y2;
56925
56940
  break;
56926
- } else if (x2[ltgt](y2)) {
56941
+ }
56942
+ k2 = x2.cmp(y2);
56943
+ if (k2 === n2 || k2 === 0 && x2.s === n2) {
56927
56944
  x2 = y2;
56928
56945
  }
56929
56946
  }
@@ -57504,7 +57521,8 @@ void main(void){
57504
57521
  x2.d = [v2];
57505
57522
  }
57506
57523
  return;
57507
- } else if (v2 * 0 !== 0) {
57524
+ }
57525
+ if (v2 * 0 !== 0) {
57508
57526
  if (!v2)
57509
57527
  x2.s = NaN;
57510
57528
  x2.e = NaN;
@@ -57512,18 +57530,28 @@ void main(void){
57512
57530
  return;
57513
57531
  }
57514
57532
  return parseDecimal(x2, v2.toString());
57515
- } else if (t2 !== "string") {
57516
- throw Error(invalidArgument + v2);
57517
57533
  }
57518
- if ((i3 = v2.charCodeAt(0)) === 45) {
57519
- v2 = v2.slice(1);
57520
- x2.s = -1;
57521
- } else {
57522
- if (i3 === 43)
57534
+ if (t2 === "string") {
57535
+ if ((i3 = v2.charCodeAt(0)) === 45) {
57523
57536
  v2 = v2.slice(1);
57524
- x2.s = 1;
57537
+ x2.s = -1;
57538
+ } else {
57539
+ if (i3 === 43)
57540
+ v2 = v2.slice(1);
57541
+ x2.s = 1;
57542
+ }
57543
+ return isDecimal.test(v2) ? parseDecimal(x2, v2) : parseOther(x2, v2);
57525
57544
  }
57526
- return isDecimal.test(v2) ? parseDecimal(x2, v2) : parseOther(x2, v2);
57545
+ if (t2 === "bigint") {
57546
+ if (v2 < 0) {
57547
+ v2 = -v2;
57548
+ x2.s = -1;
57549
+ } else {
57550
+ x2.s = 1;
57551
+ }
57552
+ return parseDecimal(x2, v2.toString());
57553
+ }
57554
+ throw Error(invalidArgument + v2);
57527
57555
  }
57528
57556
  Decimal2.prototype = P;
57529
57557
  Decimal2.ROUND_UP = 0;
@@ -57633,10 +57661,10 @@ void main(void){
57633
57661
  return new this(x2).log(10);
57634
57662
  }
57635
57663
  function max() {
57636
- return maxOrMin(this, arguments, "lt");
57664
+ return maxOrMin(this, arguments, -1);
57637
57665
  }
57638
57666
  function min() {
57639
- return maxOrMin(this, arguments, "gt");
57667
+ return maxOrMin(this, arguments, 1);
57640
57668
  }
57641
57669
  function mod(x2, y2) {
57642
57670
  return new this(x2).mod(y2);
@@ -57760,7 +57788,7 @@ void main(void){
57760
57788
  }
57761
57789
  };
57762
57790
  const result = calc[operator](new Decimal(num1), new Decimal(num2));
57763
- return Number(result.toFixed(point));
57791
+ return Number(result.toFixed(point, Decimal.ROUND_DOWN));
57764
57792
  };
57765
57793
  class LibPixiPuzzleBg extends Container {
57766
57794
  constructor() {
@@ -57794,6 +57822,41 @@ void main(void){
57794
57822
  });
57795
57823
  }
57796
57824
  }
57825
+ const libContainerCenter = (parent, item, centerType = "xy") => {
57826
+ const xy = centerType === "xy";
57827
+ if (centerType === "x" || xy) {
57828
+ item.x = parent.width / 2 - item.width / 2;
57829
+ }
57830
+ if (centerType === "y" || xy) {
57831
+ item.y = parent.height / 2 - item.height / 2;
57832
+ }
57833
+ };
57834
+ const libPixiHVCenter = (parent, items, direction) => {
57835
+ items.forEach((item) => {
57836
+ direction.forEach((d2) => {
57837
+ item[d2] = parent[d2 === "x" ? "width" : "height"] / 2 - item[d2 === "x" ? "width" : "height"] / 2;
57838
+ });
57839
+ });
57840
+ };
57841
+ const libPixiHVGap = (items, gap, direction = "x") => {
57842
+ if (Array.isArray(gap)) {
57843
+ if (gap.length !== items.length - 1) {
57844
+ console.error(new Error("间隔的数组长度只能等于元素数组长度-1"));
57845
+ return;
57846
+ }
57847
+ }
57848
+ let lastPosition = 0;
57849
+ items.forEach((item, index) => {
57850
+ const position = index === 0 ? 0 : lastPosition + (Array.isArray(gap) ? gap[index - 1] : gap);
57851
+ if (direction === "x") {
57852
+ item.x = position;
57853
+ lastPosition = item.x + item.width;
57854
+ } else {
57855
+ item.y = position;
57856
+ lastPosition = item.y + item.height;
57857
+ }
57858
+ });
57859
+ };
57797
57860
  const Components = {
57798
57861
  Base: {
57799
57862
  /** @description 自定义位图文本
@@ -58006,7 +58069,22 @@ void main(void){
58006
58069
  * @param event 事件名称
58007
58070
  * @param payload 事件携带数据
58008
58071
  */
58009
- LibPixiEmitContainerEvent
58072
+ LibPixiEmitContainerEvent,
58073
+ /** @description 当前容器在父容器居中 */
58074
+ libContainerCenter,
58075
+ /** @description 列表居中
58076
+ * @param parent 父容器
58077
+ * @param items 子元素数组
58078
+ * @param direction 方向数组,"x"表示水平,"y"表示垂直
58079
+ */
58080
+ libPixiHVCenter,
58081
+ /**
58082
+ * @description 按照指定方向(水平或垂直)排列元素,支持固定间隔或自定义每个间隔。
58083
+ * @param items 要排列的元素数组。
58084
+ * @param gap 元素之间的间隔,可以是固定间隔或自定义的间隔数组。
58085
+ * @param direction 排列方向,"x"表示水平,"y"表示垂直,默认为水平。
58086
+ */
58087
+ libPixiHVGap
58010
58088
  };
58011
58089
  const LibPixiJs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
58012
58090
  __proto__: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lyb-pixi-js",
3
- "version": "1.10.8",
3
+ "version": "1.10.9",
4
4
  "description": "自用Pixi.JS方法库",
5
5
  "license": "ISC",
6
6
  "exports": {
@@ -1,7 +0,0 @@
1
- import { Container } from "pixi.js";
2
- /** @description 触发后代监听
3
- * @param container 容器
4
- * @param event 事件名称
5
- * @param payload 事件携带数据
6
- */
7
- export declare const LibEmitContainerEvent: (container: Container, event: string, payload?: any) => void;
@@ -1,13 +0,0 @@
1
- /** @description 触发后代监听
2
- * @param container 容器
3
- * @param event 事件名称
4
- * @param payload 事件携带数据
5
- */
6
- export const LibEmitContainerEvent = (container, event, payload) => {
7
- container.children.forEach((child) => {
8
- child.emit(event, payload);
9
- if ("children" in child) {
10
- LibEmitContainerEvent(child, event, payload);
11
- }
12
- });
13
- };