canvasengine 2.0.0-rc.3 → 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.
package/dist/index.js CHANGED
@@ -4257,7 +4257,16 @@ function ao(e) {
4257
4257
  });
4258
4258
  }
4259
4259
  function oo(e) {
4260
- return ao(e);
4260
+ let { color: t, border: n } = Q(e, { border: null });
4261
+ return to({
4262
+ draw: (e, r, i, a) => {
4263
+ let { x: o, y: s } = no(a, r, i);
4264
+ e.ellipse(o + r / 2, s + i / 2, r / 2, i / 2);
4265
+ let c = ro(n);
4266
+ c && e.stroke(c), e.fill(ro(t));
4267
+ },
4268
+ ...e
4269
+ });
4261
4270
  }
4262
4271
  function so(e) {
4263
4272
  let { color: t, border: n } = Q(e, {
@@ -6155,7 +6164,7 @@ var fs = /* @__PURE__ */ pe((/* @__PURE__ */ ue(((e) => {
6155
6164
  this.time += e ?? 1, this.time >= s.time && this.frameIndex++;
6156
6165
  }
6157
6166
  applyHitboxAnchor(e, t, n) {
6158
- if (!this.hitbox || !e || !t) return;
6167
+ if (!this.hitbox || !e || !t || !this.anchor) return;
6159
6168
  let r = (typeof n == "number" ? n : n?.height) ?? t, i = Math.max(0, (t - r) / 2), a = this.clamp((e - this.hitbox.w) / 2 / e), o = this.clamp((t - this.hitbox.h - i) / t), s = this.clamp(a + this.hitbox.w / 2 / e), c = this.clamp(o + this.hitbox.h / 2 / t), l = this.clamp((t - i) / t), u = a, d = o;
6160
6169
  switch (this.hitbox.anchorMode ?? "top-left") {
6161
6170
  case "center":
@@ -6209,7 +6218,7 @@ function _s(e) {
6209
6218
  timeupdate: null,
6210
6219
  volumechange: null,
6211
6220
  waiting: null
6212
- }, n = N(null), { play: r, loop: i, muted: a } = Ku(e)({
6221
+ }, n = N(null), { play: r, loop: i, muted: a } = Xu(e)({
6213
6222
  play: {
6214
6223
  type: Boolean,
6215
6224
  default: !0
@@ -6226,7 +6235,7 @@ function _s(e) {
6226
6235
  return I(() => {
6227
6236
  let e = n(), t = r();
6228
6237
  e && t !== void 0 && (t ? e.play() : e.pause()), e && i() && (e.loop = i()), e && a() && (e.muted = a());
6229
- }), zu(() => () => {
6238
+ }), Vu(() => () => {
6230
6239
  for (let e in t) t[e] && n().removeEventListener(e, t[e]);
6231
6240
  }), Z(gs, {
6232
6241
  ...e,
@@ -13548,7 +13557,7 @@ var Eu = (e) => V("DOMSprite", e), J = /* @__PURE__ */ function(e) {
13548
13557
  return e.Normal = "normal", e.Hover = "hover", e.Pressed = "pressed", e.Disabled = "disabled", e;
13549
13558
  }({});
13550
13559
  function Du(e) {
13551
- let t = N(J.Normal), n = N(!1), r = N(!1), { text: i, disabled: a, width: o, height: s, style: c, shape: l, controlName: u } = Ku(e)({
13560
+ let t = N(J.Normal), n = N(!1), r = N(!1), { text: i, disabled: a, width: o, height: s, style: c, shape: l, controlName: u } = Xu(e)({
13552
13561
  text: {
13553
13562
  type: String,
13554
13563
  default: ""
@@ -14103,15 +14112,24 @@ A("focusNavigation", class extends k {
14103
14112
  return this.focusedElementSignal;
14104
14113
  }
14105
14114
  });
14106
- var Au = (e) => V("Navigation", e), ju = Au, Mu = "__canvasEngineHotProps", Nu = "__canvasEngineUpdateHotProps", Pu = "__canvasEngineDefinePropsSignals", Fu = null, Iu = null, Lu = null, Ru = () => {
14115
+ var Au = (e) => V("Navigation", e), ju = Au, Mu = "__canvasEngineHotProps", Nu = "__canvasEngineUpdateHotProps", Pu = "__canvasEngineDefinePropsSignals", Fu = null, Iu = null, Lu = null, Ru = (e) => {
14116
+ let t = e?.__canvasEngineCallableSignalValue;
14117
+ return t ? t() : P(e) ? e() : e;
14118
+ }, zu = (e, t) => {
14119
+ let n = e[Pu], r = t[Pu];
14120
+ !n || !r || Object.entries(r).forEach(([e, t]) => {
14121
+ let r = n[e];
14122
+ r && typeof r.set == "function" && r.set(Ru(t));
14123
+ });
14124
+ }, Bu = () => {
14107
14125
  let e = globalThis;
14108
14126
  return e.__CANVAS_ENGINE_HOT_COMPONENTS__ ||= /* @__PURE__ */ new Map(), e.__CANVAS_ENGINE_HOT_COMPONENTS__;
14109
14127
  };
14110
- function zu(e) {
14128
+ function Vu(e) {
14111
14129
  Lu?.(e);
14112
14130
  }
14113
- function Bu(e) {
14114
- zu((t) => {
14131
+ function Hu(e) {
14132
+ Vu((t) => {
14115
14133
  let { context: n } = t.props, r;
14116
14134
  return n.tick && (r = n.tick.observable.subscribe(({ value: n }) => {
14117
14135
  z(t) || e(n, t);
@@ -14120,15 +14138,15 @@ function Bu(e) {
14120
14138
  };
14121
14139
  });
14122
14140
  }
14123
- function Vu(e, t = {}, n) {
14141
+ function Uu(e, t = {}, n) {
14124
14142
  n[0] instanceof Array && (n = n[0]);
14125
14143
  let r;
14126
- return r = Array.isArray(e) ? e.length === 1 ? e[0] : Vu(eo, {}, e) : "tag" in e || e instanceof T ? e : Hu(e, {
14144
+ return r = Array.isArray(e) ? e.length === 1 ? e[0] : Uu(eo, {}, e) : "tag" in e || e instanceof T ? e : Wu(e, {
14127
14145
  ...t,
14128
14146
  children: n
14129
14147
  }), r ||= {}, t?.dependencies && (r.props = r.props || {}, r.props.dependencies = t.dependencies), r;
14130
14148
  }
14131
- function Hu(e, t) {
14149
+ function Wu(e, t) {
14132
14150
  let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = null;
14133
14151
  Fu = (e) => {
14134
14152
  n.add(e);
@@ -14153,8 +14171,8 @@ function Hu(e, t) {
14153
14171
  o(e), e?.props?.isRoot && r.forEach((t) => t(e));
14154
14172
  }) : a instanceof T ? (a.effectSubscriptions = [...Array.from(n), ...a.effectSubscriptions ?? []], a.effectMounts = [...Array.from(r), ...a.effectMounts ?? []], i && (a[Pu] = i)) : o(a), a;
14155
14173
  }
14156
- function Uu(e, t) {
14157
- let n = Ru(), r = n.get(e);
14174
+ function Gu(e, t) {
14175
+ let n = Bu(), r = n.get(e);
14158
14176
  return r ? (r.component = t, r.updates.next()) : (r = {
14159
14177
  component: t,
14160
14178
  updates: new ct()
@@ -14163,11 +14181,11 @@ function Uu(e, t) {
14163
14181
  let i = !1, a = null, o = (e, t) => {
14164
14182
  if (e.tag !== t.tag) return !1;
14165
14183
  let n = { ...t.props };
14166
- return e.props.context && (n.context = e.props.context), e.props.children && !t.props.children && (n.children = e.props.children), e.props = n, e.propObservables = t.propObservables, e.componentInstance.onUpdate?.(n), Object.entries(e.directives).forEach(([t, r]) => {
14184
+ return e.props.context && (n.context = e.props.context), e.props.children && !t.props.children && (n.children = e.props.children), zu(e, t), e.props = n, e.propObservables = t.propObservables, e.componentInstance.onUpdate?.(n), Object.entries(e.directives).forEach(([t, r]) => {
14167
14185
  t in n && r.onUpdate?.(n[t], e);
14168
14186
  }), t.propSubscriptions?.forEach((e) => e.unsubscribe()), t.effectSubscriptions?.forEach((e) => e.unsubscribe()), t.effectUnmounts?.forEach((e) => e?.()), !0;
14169
14187
  }, s = (n = !1) => {
14170
- let s = Hu(r.component, t), c = (t) => {
14188
+ let s = Wu(r.component, t), c = (t) => {
14171
14189
  if (!i) {
14172
14190
  if (n && a && t && o(a, t)) {
14173
14191
  e.next({ elements: [a] });
@@ -14190,12 +14208,12 @@ function Uu(e, t) {
14190
14208
  }), r.wrapper;
14191
14209
  }
14192
14210
  function Z(e, t = {}, ...n) {
14193
- return t?.dependencies ? !t.dependencies.some(vn) && t.dependencies.every((e) => P(e) ? e() !== void 0 : e !== void 0) ? Vu(e, t, n) : new T((r) => {
14211
+ return t?.dependencies ? !t.dependencies.some(vn) && t.dependencies.every((e) => P(e) ? e() !== void 0 : e !== void 0) ? Uu(e, t, n) : new T((r) => {
14194
14212
  Wa(t.dependencies).then(() => {
14195
- let i = Vu(e, t, n);
14213
+ let i = Uu(e, t, n);
14196
14214
  r.next(i);
14197
14215
  });
14198
- }) : Vu(e, t, n);
14216
+ }) : Uu(e, t, n);
14199
14217
  }
14200
14218
  //#endregion
14201
14219
  //#region src/hooks/useProps.ts
@@ -14208,37 +14226,53 @@ var Q = (e, t = {}) => {
14208
14226
  }
14209
14227
  for (let e in t) e in n || (n[e] = Ma(t[e]) ? N(t[e]) : t[e]);
14210
14228
  return n;
14211
- }, Wu = (e) => P(e) ? e : N(e), Gu = (e) => {
14229
+ }, Ku = "__canvasEngineCallableSignalValue", qu = (e) => {
14230
+ let t = N(e), n = (...e) => t()(...e);
14231
+ return n[Ku] = t, n.set = t.set, n.freeze = t.freeze, n.unfreeze = t.unfreeze, n.mutate = t.mutate, n.update = t.update, n.observable = t.observable, n._subject = t._subject, Object.defineProperty(n, "_isFrozen", {
14232
+ get: () => t._isFrozen,
14233
+ set: (e) => {
14234
+ t._isFrozen = e;
14235
+ }
14236
+ }), n;
14237
+ }, Ju = (e) => P(e) || kl(e) ? e : typeof e == "function" ? qu(e) : N(e), Yu = (e) => {
14212
14238
  let t = {};
14213
- for (let n in e) t[n] = Wu(e[n]);
14239
+ for (let n in e) t[n] = Ju(e[n]);
14214
14240
  return t;
14215
- }, Ku = (e) => (t) => {
14241
+ }, Xu = (e) => (t) => {
14216
14242
  let n = P(e) ? e() : e, r = {};
14217
14243
  for (let e in t) {
14218
14244
  let i = t[e], a = n[e], o;
14219
- if (typeof i == "function") qu(e, a, [i]), o = a;
14220
- else if (Array.isArray(i)) qu(e, a, i), o = a;
14245
+ if (typeof i == "function") ed(e, a, [i]), o = a;
14246
+ else if (Array.isArray(i)) ed(e, a, i), o = a;
14221
14247
  else if (i && typeof i == "object") {
14222
14248
  if (i.required && a === void 0) throw Error(`Missing required prop: ${e}`);
14223
- if (i.type && qu(e, a, Array.isArray(i.type) ? i.type : [i.type]), i.validator && !i.validator(a, n)) throw Error(`Invalid prop: custom validation failed for prop "${e}"`);
14249
+ if (i.type && ed(e, a, Array.isArray(i.type) ? i.type : [i.type]), i.validator && !i.validator(a, n)) throw Error(`Invalid prop: custom validation failed for prop "${e}"`);
14224
14250
  o = a === void 0 && "default" in i ? typeof i.default == "function" ? i.default(n) : i.default : a;
14225
14251
  }
14226
- r[e] = Wu(o);
14252
+ r[e] = Ju(o);
14227
14253
  }
14228
14254
  let i = {
14229
- ...Gu(n),
14255
+ ...Yu(n),
14230
14256
  ...r
14231
14257
  };
14232
14258
  return Iu?.(i), i;
14233
- };
14234
- function qu(e, t, n) {
14259
+ }, Zu = (e) => P(e) ? e() : e ?? {}, Qu = (e) => e?.[Ku] ? e : P(e) ? e() : e, $u = (e) => () => new Proxy({}, { get(t, n) {
14260
+ if (typeof n == "string") return (...t) => {
14261
+ let r = Qu(Zu(e)[n]);
14262
+ if (r != null) {
14263
+ if (typeof r != "function") throw Error(`Invalid emit handler: "${n}" must be a function`);
14264
+ return r(...t);
14265
+ }
14266
+ };
14267
+ } });
14268
+ function ed(e, t, n) {
14235
14269
  if (t == null) return;
14236
14270
  let r = P(t) ? t() : t;
14237
14271
  if (!n.some((e) => e === Number ? typeof r == "number" : e === String ? typeof r == "string" : e === Boolean ? typeof r == "boolean" : e === Function ? typeof r == "function" : e === Object ? typeof r == "object" : e === Array ? Array.isArray(r) : e === null ? r === null : r instanceof e)) throw Error(`Invalid prop: type check failed for prop "${e}". Expected ${n.map((e) => e.name).join(" or ")}`);
14238
14272
  }
14239
14273
  //#endregion
14240
14274
  //#region src/directives/ViewportFollow.ts
14241
- var Ju = class extends k {
14275
+ var td = class extends k {
14242
14276
  onInit(e) {}
14243
14277
  onMount(e) {
14244
14278
  this.onUpdate(e.props.viewportFollow, e);
@@ -14269,10 +14303,10 @@ var Ju = class extends k {
14269
14303
  t && n && n.plugins.remove("follow");
14270
14304
  }
14271
14305
  };
14272
- A("viewportFollow", Ju);
14306
+ A("viewportFollow", td);
14273
14307
  //#endregion
14274
14308
  //#region src/directives/Sound.ts
14275
- var Yu = [
14309
+ var nd = [
14276
14310
  "load",
14277
14311
  "loaderror",
14278
14312
  "playerror",
@@ -14286,7 +14320,7 @@ var Yu = [
14286
14320
  "seek",
14287
14321
  "fade",
14288
14322
  "unlock"
14289
- ], Xu = class extends k {
14323
+ ], rd = class extends k {
14290
14324
  constructor(...e) {
14291
14325
  super(...e), this.sounds = [], this.eventsFn = [], this.maxVolume = 1, this.maxDistance = 100;
14292
14326
  }
@@ -14303,7 +14337,7 @@ var Yu = [
14303
14337
  loop: o,
14304
14338
  volume: s
14305
14339
  });
14306
- for (let e of Yu) {
14340
+ for (let e of nd) {
14307
14341
  if (!r[e]) continue;
14308
14342
  let n = r[e];
14309
14343
  this.eventsFn.push(n), t.on(e, n);
@@ -14331,13 +14365,13 @@ var Yu = [
14331
14365
  onDestroy() {
14332
14366
  this.sounds.forEach((e) => {
14333
14367
  e.stop();
14334
- for (let t of Yu) {
14368
+ for (let t of nd) {
14335
14369
  let n = this.eventsFn.find((e) => e === this.eventsFn[t]);
14336
14370
  n && e.off(t, n);
14337
14371
  }
14338
14372
  }), this.sounds = [], this.eventsFn = [], this.tickSubscription?.unsubscribe();
14339
14373
  }
14340
- }, Zu = class extends k {
14374
+ }, id = class extends k {
14341
14375
  onMount(e) {
14342
14376
  e.props.context.soundListenerPosition = e.propObservables?.soundListenerPosition;
14343
14377
  }
@@ -14345,15 +14379,15 @@ var Yu = [
14345
14379
  onUpdate(e) {}
14346
14380
  onDestroy() {}
14347
14381
  };
14348
- A("sound", Xu), A("soundListenerPosition", Zu);
14382
+ A("sound", rd), A("soundListenerPosition", id);
14349
14383
  //#endregion
14350
14384
  //#region src/hooks/addContext.ts
14351
- var Qu = (e, t, n) => {
14385
+ var ad = (e, t, n) => {
14352
14386
  e.props.context = {
14353
14387
  ...e.props.context ?? {},
14354
14388
  [t]: n
14355
14389
  };
14356
- }, $u = class extends k {
14390
+ }, od = class extends k {
14357
14391
  constructor(...e) {
14358
14392
  super(...e), this.elementRef = null;
14359
14393
  }
@@ -14361,13 +14395,13 @@ var Qu = (e, t, n) => {
14361
14395
  this.elementRef = e;
14362
14396
  }
14363
14397
  onMount(e) {
14364
- Qu(e, "drop", e);
14398
+ ad(e, "drop", e);
14365
14399
  }
14366
14400
  onUpdate() {}
14367
14401
  onDestroy() {
14368
14402
  this.elementRef = null;
14369
14403
  }
14370
- }, ed = class extends k {
14404
+ }, sd = class extends k {
14371
14405
  constructor(...e) {
14372
14406
  super(...e), this.elementRef = null, this.stageRef = null, this.offsetInParent = new y(), this.isDragging = !1, this.viewport = null, this.animationFrameId = null, this.lastPointerPosition = new y(), this.pressedKeys = /* @__PURE__ */ new Set(), this.pointerIsDown = !1, this.onDragMoveHandler = () => {}, this.onDragEndHandler = () => {}, this.onDragStartHandler = () => {}, this.onKeyDownHandler = () => {}, this.onKeyUpHandler = () => {}, this.subscriptions = [];
14373
14407
  }
@@ -14462,10 +14496,10 @@ var Qu = (e, t, n) => {
14462
14496
  e && e.off("pointerdown", this.onDragStartHandler), this.stageRef && (this.stageRef.off("pointermove", this.onDragMoveHandler), this.stageRef.off("pointerup", this.onDragEndHandler), this.stageRef.off("pointerupoutside", this.onDragEndHandler)), window.removeEventListener("keydown", this.onKeyDownHandler), window.removeEventListener("keyup", this.onKeyUpHandler), this.stageRef = null, this.viewport = null, this.pressedKeys.clear(), this.pointerIsDown = !1;
14463
14497
  }
14464
14498
  };
14465
- A("drag", ed), A("drop", $u);
14499
+ A("drag", sd), A("drop", od);
14466
14500
  //#endregion
14467
14501
  //#region src/directives/Transition.ts
14468
- var td = class extends k {
14502
+ var cd = class extends k {
14469
14503
  onInit(e) {}
14470
14504
  onMount(e) {
14471
14505
  let { image: t } = e.props.transition, n = new x(C.from(t));
@@ -14485,10 +14519,10 @@ var td = class extends k {
14485
14519
  onUpdate(e) {}
14486
14520
  onDestroy() {}
14487
14521
  };
14488
- A("transition", td);
14522
+ A("transition", cd);
14489
14523
  //#endregion
14490
14524
  //#region src/directives/Shake.ts
14491
- var nd = class extends k {
14525
+ var ld = class extends k {
14492
14526
  constructor(...e) {
14493
14527
  super(...e), this.elementRef = null, this.originalPosition = new y(), this.progressSignal = null, this.shakeSubscription = null, this.positionEffect = null, this.currentShakeConfig = null;
14494
14528
  }
@@ -14547,10 +14581,10 @@ var nd = class extends k {
14547
14581
  this.shakeSubscription &&= (this.shakeSubscription.unsubscribe(), null), this.elementRef = null;
14548
14582
  }
14549
14583
  };
14550
- A("shake", nd);
14584
+ A("shake", ld);
14551
14585
  //#endregion
14552
14586
  //#region src/directives/Flash.ts
14553
- var rd = class extends k {
14587
+ var ud = class extends k {
14554
14588
  constructor(...e) {
14555
14589
  super(...e), this.elementRef = null, this.progressSignal = null, this.flashSubscription = null, this.alphaEffect = null, this.tintEffect = null, this.originalAlpha = 1, this.originalTint = 16777215, this.currentFlashConfig = null;
14556
14590
  }
@@ -14635,10 +14669,10 @@ var rd = class extends k {
14635
14669
  this.flashSubscription &&= null, this.elementRef = null;
14636
14670
  }
14637
14671
  };
14638
- A("flash", rd);
14672
+ A("flash", ud);
14639
14673
  //#endregion
14640
14674
  //#region src/directives/FogVisibility.ts
14641
- var id = (e, t, n) => Math.max(t, Math.min(n, e)), ad = class extends k {
14675
+ var dd = (e, t, n) => Math.max(t, Math.min(n, e)), fd = class extends k {
14642
14676
  constructor(...e) {
14643
14677
  super(...e), this.elementRef = null, this.tickSubscription = null, this.sampleAccumulatorMs = 0, this.managesAlpha = !1;
14644
14678
  }
@@ -14667,7 +14701,7 @@ var id = (e, t, n) => Math.max(t, Math.min(n, e)), ad = class extends k {
14667
14701
  return e == null ? t : P(e) ? e() ?? t : e;
14668
14702
  }
14669
14703
  readOptions() {
14670
- let e = this.elementRef?.props?.fogVisibility, t = e?.value ?? e ?? {}, n = this.resolveSignalValue(t.controller, null), r = this.resolveSignalValue(t.mode, "visible"), i = id(Number(this.resolveSignalValue(t.threshold, .65)), 0, 1), a = this.resolveSignalValue(t.hideAs, "visible"), o = id(Number(this.resolveSignalValue(t.hiddenAlpha, 0)), 0, 1), s = id(Number(this.resolveSignalValue(t.sampleHz, 30)), 1, 240), c = t.point ? this.resolveSignalValue(t.point, void 0) : void 0;
14704
+ let e = this.elementRef?.props?.fogVisibility, t = e?.value ?? e ?? {}, n = this.resolveSignalValue(t.controller, null), r = this.resolveSignalValue(t.mode, "visible"), i = dd(Number(this.resolveSignalValue(t.threshold, .65)), 0, 1), a = this.resolveSignalValue(t.hideAs, "visible"), o = dd(Number(this.resolveSignalValue(t.hiddenAlpha, 0)), 0, 1), s = dd(Number(this.resolveSignalValue(t.sampleHz, 30)), 1, 240), c = t.point ? this.resolveSignalValue(t.point, void 0) : void 0;
14671
14705
  return {
14672
14706
  controller: n && typeof n == "object" ? n : null,
14673
14707
  mode: r,
@@ -14684,7 +14718,7 @@ var id = (e, t, n) => Math.max(t, Math.min(n, e)), ad = class extends k {
14684
14718
  }
14685
14719
  readBaseAlpha() {
14686
14720
  let e = this.elementRef?.propObservables?.alpha ?? this.elementRef?.props?.alpha, t = Number(this.resolveSignalValue(e, 1));
14687
- return Number.isFinite(t) ? id(t, 0, 1) : 1;
14721
+ return Number.isFinite(t) ? dd(t, 0, 1) : 1;
14688
14722
  }
14689
14723
  samplePoint(e) {
14690
14724
  if (e.point && typeof e.point == "object") {
@@ -14728,15 +14762,15 @@ var id = (e, t, n) => Math.max(t, Math.min(n, e)), ad = class extends k {
14728
14762
  t.visible = r && s, this.managesAlpha &&= (t.alpha = i, !1);
14729
14763
  }
14730
14764
  };
14731
- A("fogVisibility", ad);
14765
+ A("fogVisibility", fd);
14732
14766
  //#endregion
14733
14767
  //#region ../../node_modules/.pnpm/pixi-filters@6.1.5_pixi.js@8.9.2/node_modules/pixi-filters/lib/defaults/default2.mjs
14734
- var od = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n", sd = "struct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>\n };\n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); \n}\n\nfn getSize() -> vec2<f32>\n{\n return gfu.uGlobalFrame.zw;\n}\n \n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>, \n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition)\n );\n}", cd = "precision highp float;\nin vec2 vTextureCoord;\nout vec4 finalColor;\n\nuniform sampler2D uTexture;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\n\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = ${ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vTextureCoord.x + uThickness.x * cos(angle);\n displacedPos.y = vTextureCoord.y + uThickness.y * sin(angle);\n displacedColor = texture(uTexture, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture(uTexture, vTextureCoord);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vTextureCoord.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n finalColor = contentColor + outlineColor;\n}\n", ld = "struct OutlineUniforms {\n uThickness:vec2<f32>,\n uColor:vec3<f32>,\n uAlpha:f32,\n uAngleStep:f32,\n uKnockout:f32,\n};\n\nstruct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n\n@group(0) @binding(1) var uTexture: texture_2d<f32>; \n@group(0) @binding(2) var uSampler: sampler;\n@group(1) @binding(0) var<uniform> outlineUniforms : OutlineUniforms;\n\n@fragment\nfn mainFragment(\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>\n) -> @location(0) vec4<f32> {\n let sourceColor: vec4<f32> = textureSample(uTexture, uSampler, uv);\n let contentColor: vec4<f32> = sourceColor * (1. - outlineUniforms.uKnockout);\n \n let outlineAlpha: f32 = outlineUniforms.uAlpha * outlineMaxAlphaAtPos(uv) * (1. - sourceColor.a);\n let outlineColor: vec4<f32> = vec4<f32>(vec3<f32>(outlineUniforms.uColor) * outlineAlpha, outlineAlpha);\n \n return contentColor + outlineColor;\n}\n\nfn outlineMaxAlphaAtPos(uv: vec2<f32>) -> f32 {\n let thickness = outlineUniforms.uThickness;\n\n if (thickness.x == 0. || thickness.y == 0.) {\n return 0.;\n }\n \n let angleStep = outlineUniforms.uAngleStep;\n\n var displacedColor: vec4<f32>;\n var displacedPos: vec2<f32>;\n\n var maxAlpha: f32 = 0.;\n var displaced: vec2<f32>;\n var curColor: vec4<f32>;\n\n for (var angle = 0.; angle <= DOUBLE_PI; angle += angleStep)\n {\n displaced.x = uv.x + thickness.x * cos(angle);\n displaced.y = uv.y + thickness.y * sin(angle);\n curColor = textureSample(uTexture, uSampler, clamp(displaced, gfu.uInputClamp.xy, gfu.uInputClamp.zw));\n maxAlpha = max(maxAlpha, curColor.a);\n }\n\n return maxAlpha;\n}\n\nconst DOUBLE_PI: f32 = 3.14159265358979323846264 * 2.;", ud = Object.defineProperty, dd = (e, t, n) => t in e ? ud(e, t, {
14768
+ var pd = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n", md = "struct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>\n };\n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); \n}\n\nfn getSize() -> vec2<f32>\n{\n return gfu.uGlobalFrame.zw;\n}\n \n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>, \n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition)\n );\n}", hd = "precision highp float;\nin vec2 vTextureCoord;\nout vec4 finalColor;\n\nuniform sampler2D uTexture;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\n\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = ${ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vTextureCoord.x + uThickness.x * cos(angle);\n displacedPos.y = vTextureCoord.y + uThickness.y * sin(angle);\n displacedColor = texture(uTexture, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture(uTexture, vTextureCoord);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vTextureCoord.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n finalColor = contentColor + outlineColor;\n}\n", gd = "struct OutlineUniforms {\n uThickness:vec2<f32>,\n uColor:vec3<f32>,\n uAlpha:f32,\n uAngleStep:f32,\n uKnockout:f32,\n};\n\nstruct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n\n@group(0) @binding(1) var uTexture: texture_2d<f32>; \n@group(0) @binding(2) var uSampler: sampler;\n@group(1) @binding(0) var<uniform> outlineUniforms : OutlineUniforms;\n\n@fragment\nfn mainFragment(\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>\n) -> @location(0) vec4<f32> {\n let sourceColor: vec4<f32> = textureSample(uTexture, uSampler, uv);\n let contentColor: vec4<f32> = sourceColor * (1. - outlineUniforms.uKnockout);\n \n let outlineAlpha: f32 = outlineUniforms.uAlpha * outlineMaxAlphaAtPos(uv) * (1. - sourceColor.a);\n let outlineColor: vec4<f32> = vec4<f32>(vec3<f32>(outlineUniforms.uColor) * outlineAlpha, outlineAlpha);\n \n return contentColor + outlineColor;\n}\n\nfn outlineMaxAlphaAtPos(uv: vec2<f32>) -> f32 {\n let thickness = outlineUniforms.uThickness;\n\n if (thickness.x == 0. || thickness.y == 0.) {\n return 0.;\n }\n \n let angleStep = outlineUniforms.uAngleStep;\n\n var displacedColor: vec4<f32>;\n var displacedPos: vec2<f32>;\n\n var maxAlpha: f32 = 0.;\n var displaced: vec2<f32>;\n var curColor: vec4<f32>;\n\n for (var angle = 0.; angle <= DOUBLE_PI; angle += angleStep)\n {\n displaced.x = uv.x + thickness.x * cos(angle);\n displaced.y = uv.y + thickness.y * sin(angle);\n curColor = textureSample(uTexture, uSampler, clamp(displaced, gfu.uInputClamp.xy, gfu.uInputClamp.zw));\n maxAlpha = max(maxAlpha, curColor.a);\n }\n\n return maxAlpha;\n}\n\nconst DOUBLE_PI: f32 = 3.14159265358979323846264 * 2.;", _d = Object.defineProperty, vd = (e, t, n) => t in e ? _d(e, t, {
14735
14769
  enumerable: !0,
14736
14770
  configurable: !0,
14737
14771
  writable: !0,
14738
14772
  value: n
14739
- }) : e[t] = n, fd = (e, t, n) => (dd(e, typeof t == "symbol" ? t : t + "", n), n), pd = class e extends l {
14773
+ }) : e[t] = n, yd = (e, t, n) => (vd(e, typeof t == "symbol" ? t : t + "", n), n), bd = class e extends l {
14740
14774
  constructor(...t) {
14741
14775
  let n = t[0] ?? {};
14742
14776
  typeof n == "number" && (re("6.0.0", "OutlineFilter constructor params are now options object. See params: { thickness, color, quality, alpha, knockout }"), n = { thickness: n }, t[1] !== void 0 && (n.color = t[1]), t[2] !== void 0 && (n.quality = t[2]), t[3] !== void 0 && (n.alpha = t[3]), t[4] !== void 0 && (n.knockout = t[4])), n = {
@@ -14745,16 +14779,16 @@ var od = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize
14745
14779
  };
14746
14780
  let r = n.quality ?? .1, a = f.from({
14747
14781
  vertex: {
14748
- source: sd,
14782
+ source: md,
14749
14783
  entryPoint: "mainVertex"
14750
14784
  },
14751
14785
  fragment: {
14752
- source: ld,
14786
+ source: gd,
14753
14787
  entryPoint: "mainFragment"
14754
14788
  }
14755
14789
  }), o = d.from({
14756
- vertex: od,
14757
- fragment: cd.replace(/\$\{ANGLE_STEP\}/, e.getAngleStep(r).toFixed(7)),
14790
+ vertex: pd,
14791
+ fragment: hd.replace(/\$\{ANGLE_STEP\}/, e.getAngleStep(r).toFixed(7)),
14758
14792
  name: "outline-filter"
14759
14793
  });
14760
14794
  super({
@@ -14782,7 +14816,7 @@ var od = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize
14782
14816
  type: "f32"
14783
14817
  }
14784
14818
  } }
14785
- }), fd(this, "uniforms"), fd(this, "_thickness"), fd(this, "_quality"), fd(this, "_color"), this.uniforms = this.resources.outlineUniforms.uniforms, this.uniforms.uAngleStep = e.getAngleStep(r), this._color = new i(), this.color = n.color ?? 0, Object.assign(this, n);
14819
+ }), yd(this, "uniforms"), yd(this, "_thickness"), yd(this, "_quality"), yd(this, "_color"), this.uniforms = this.resources.outlineUniforms.uniforms, this.uniforms.uAngleStep = e.getAngleStep(r), this._color = new i(), this.color = n.color ?? 0, Object.assign(this, n);
14786
14820
  }
14787
14821
  apply(e, t, n, r) {
14788
14822
  this.uniforms.uThickness[0] = this.thickness / t.source.width, this.uniforms.uThickness[1] = this.thickness / t.source.height, e.applyFilter(this, t, n, r);
@@ -14823,25 +14857,25 @@ var od = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize
14823
14857
  this.uniforms.uKnockout = +!!e;
14824
14858
  }
14825
14859
  };
14826
- fd(pd, "DEFAULT_OPTIONS", {
14860
+ yd(bd, "DEFAULT_OPTIONS", {
14827
14861
  thickness: 1,
14828
14862
  color: 0,
14829
14863
  alpha: 1,
14830
14864
  quality: .1,
14831
14865
  knockout: !1
14832
- }), fd(pd, "MIN_SAMPLES", 1), fd(pd, "MAX_SAMPLES", 100);
14833
- var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
14866
+ }), yd(bd, "MIN_SAMPLES", 1), yd(bd, "MAX_SAMPLES", 100);
14867
+ var xd = bd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, Sd = (e) => {
14834
14868
  if (e !== void 0) return P(e) ? e() : e;
14835
- }, gd = (e) => e === void 0 ? [] : Array.isArray(e) ? e : [e], _d = (e) => {
14869
+ }, Cd = (e) => e === void 0 ? [] : Array.isArray(e) ? e : [e], wd = (e) => {
14836
14870
  let t = e.filters;
14837
14871
  return t ? Array.isArray(t) ? [...t] : [t] : [];
14838
- }, vd = (e, t) => {
14872
+ }, Td = (e, t) => {
14839
14873
  e.filters = t.length > 0 ? t : [];
14840
- }, yd = (e) => {
14841
- let t = hd(e);
14874
+ }, Ed = (e) => {
14875
+ let t = Sd(e);
14842
14876
  return L(t) ? t.componentInstance ?? null : t instanceof a || t && typeof t == "object" && typeof t.getBounds == "function" ? t : null;
14843
- }, bd = (e) => new b(e?.x ?? 0, e?.y ?? 0, e?.width ?? 0, e?.height ?? 0), xd = (e, t = "bounds") => {
14844
- let n = bd(typeof e.getBounds == "function" ? e.getBounds() : {
14877
+ }, Dd = (e) => new b(e?.x ?? 0, e?.y ?? 0, e?.width ?? 0, e?.height ?? 0), Od = (e, t = "bounds") => {
14878
+ let n = Dd(typeof e.getBounds == "function" ? e.getBounds() : {
14845
14879
  x: e.x ?? 0,
14846
14880
  y: e.y ?? 0,
14847
14881
  width: e.width ?? 0,
@@ -14850,21 +14884,21 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
14850
14884
  if (t !== "hitbox" || !e.hitbox) return n;
14851
14885
  let r = e.hitbox;
14852
14886
  return new b(n.x + Math.max(0, (n.width - r.w) / 2), n.y + Math.max(0, n.height - r.h), r.w, r.h);
14853
- }, Sd = (e, t) => {
14887
+ }, kd = (e, t) => {
14854
14888
  let n = Math.max(e.x, t.x), r = Math.max(e.y, t.y), i = Math.min(e.x + e.width, t.x + t.width), a = Math.min(e.y + e.height, t.y + t.height), o = i - n, s = a - r;
14855
14889
  return o <= 0 || s <= 0 ? null : new b(n, r, o, s);
14856
- }, Cd = (e, t) => {
14890
+ }, Ad = (e, t) => {
14857
14891
  e.rect(t.x, t.y, t.width, t.height), e.fill(16777215);
14858
- }, wd = (e, t) => {
14892
+ }, jd = (e, t) => {
14859
14893
  t.parent !== e.parent && (t.parent && t.parent.removeChild(t), e.parent?.addChild(t));
14860
- }, Td = (e, t, n = !1) => {
14894
+ }, Md = (e, t, n = !1) => {
14861
14895
  e && (typeof e.setMask == "function" ? (t ?? (e.mask = null), e.setMask({
14862
14896
  mask: t ?? null,
14863
14897
  inverse: n
14864
14898
  })) : e.mask = t ?? null);
14865
- }, Ed = (e, t) => {
14866
- Td(e, t ?? null);
14867
- }, Dd = (e, t) => {
14899
+ }, Nd = (e, t) => {
14900
+ Md(e, t ?? null);
14901
+ }, Pd = (e, t) => {
14868
14902
  let n = {
14869
14903
  x: t.x ?? t.position?.x ?? 0,
14870
14904
  y: t.y ?? t.position?.y ?? 0
@@ -14879,11 +14913,11 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
14879
14913
  x: 0,
14880
14914
  y: 0
14881
14915
  }), e.rotation = t.rotation ?? 0;
14882
- }, Od = (e, t, n) => {
14883
- Dd(e, t);
14916
+ }, Fd = (e, t, n) => {
14917
+ Pd(e, t);
14884
14918
  let r = t.texture?.orig?.width ?? t.texture?.width ?? t.width ?? n.width, i = t.texture?.orig?.height ?? t.texture?.height ?? t.height ?? n.height, a = t.width || r || 1, o = t.height || i || 1, s = t.anchor?.x ?? 0, c = t.anchor?.y ?? 0;
14885
- Cd(e, new b(-s * r + n.x * r / a, -c * i + n.y * i / o, n.width * r / a, n.height * i / o));
14886
- }, kd = class extends k {
14919
+ Ad(e, new b(-s * r + n.x * r / a, -c * i + n.y * i / o, n.width * r / a, n.height * i / o));
14920
+ }, Id = class extends k {
14887
14921
  constructor(...e) {
14888
14922
  super(...e), this.elementRef = null, this.filter = null, this.updateEffect = null;
14889
14923
  }
@@ -14902,7 +14936,7 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
14902
14936
  this.removeFilter(), this.updateEffect?.subscription.unsubscribe(), this.updateEffect = null, this.elementRef = null;
14903
14937
  }
14904
14938
  get props() {
14905
- let e = hd(this.elementRef?.props.outline);
14939
+ let e = Sd(this.elementRef?.props.outline);
14906
14940
  return e === !0 ? {} : e === !1 ? { enabled: !1 } : e ?? {};
14907
14941
  }
14908
14942
  apply() {
@@ -14913,18 +14947,18 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
14913
14947
  this.removeFilter();
14914
14948
  return;
14915
14949
  }
14916
- this.filter || (this.filter = new md({
14950
+ this.filter || (this.filter = new xd({
14917
14951
  thickness: $(t.thickness, 1),
14918
14952
  color: $(t.color, 16777215),
14919
14953
  quality: $(t.quality, .1),
14920
14954
  alpha: $(t.alpha, 1)
14921
- }), vd(e, [..._d(e), this.filter])), this.filter.thickness = $(t.thickness, 1), this.filter.color = $(t.color, 16777215), this.filter.quality = $(t.quality, .1), this.filter.alpha = $(t.alpha, 1);
14955
+ }), Td(e, [...wd(e), this.filter])), this.filter.thickness = $(t.thickness, 1), this.filter.color = $(t.color, 16777215), this.filter.quality = $(t.quality, .1), this.filter.alpha = $(t.alpha, 1);
14922
14956
  }
14923
14957
  removeFilter() {
14924
14958
  let e = this.elementRef?.componentInstance;
14925
- !e || !this.filter || (vd(e, _d(e).filter((e) => e !== this.filter)), this.filter = null);
14959
+ !e || !this.filter || (Td(e, wd(e).filter((e) => e !== this.filter)), this.filter = null);
14926
14960
  }
14927
- }, Ad = class extends k {
14961
+ }, Ld = class extends k {
14928
14962
  constructor(...e) {
14929
14963
  super(...e), this.elementRef = null, this.maskGraphics = null, this.previousMask = null, this.tickSubscription = null, this.updateEffect = null;
14930
14964
  }
@@ -14943,28 +14977,28 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
14943
14977
  }
14944
14978
  onDestroy() {
14945
14979
  let e = this.elementRef?.componentInstance;
14946
- e && this.maskGraphics && Ed(e, this.previousMask), this.maskGraphics?.parent && this.maskGraphics.parent.removeChild(this.maskGraphics), this.maskGraphics?.destroy(), this.maskGraphics = null, this.previousMask = null, this.tickSubscription?.unsubscribe(), this.tickSubscription = null, this.updateEffect?.subscription.unsubscribe(), this.updateEffect = null, this.elementRef = null;
14980
+ e && this.maskGraphics && Nd(e, this.previousMask), this.maskGraphics?.parent && this.maskGraphics.parent.removeChild(this.maskGraphics), this.maskGraphics?.destroy(), this.maskGraphics = null, this.previousMask = null, this.tickSubscription?.unsubscribe(), this.tickSubscription = null, this.updateEffect?.subscription.unsubscribe(), this.updateEffect = null, this.elementRef = null;
14947
14981
  }
14948
14982
  get props() {
14949
- return hd(this.elementRef?.props.clip) ?? null;
14983
+ return Sd(this.elementRef?.props.clip) ?? null;
14950
14984
  }
14951
14985
  apply() {
14952
14986
  let e = this.elementRef?.componentInstance, t = this.props;
14953
14987
  if (!e || !e.parent || !t?.shape) return;
14954
14988
  if (!$(t.enabled, !0)) {
14955
- this.maskGraphics && (Ed(e, this.previousMask), this.maskGraphics.clear());
14989
+ this.maskGraphics && (Nd(e, this.previousMask), this.maskGraphics.clear());
14956
14990
  return;
14957
14991
  }
14958
- this.maskGraphics || (this.maskGraphics = new p(), this.previousMask = e.mask ?? null), wd(e, this.maskGraphics), this.maskGraphics.clear();
14992
+ this.maskGraphics || (this.maskGraphics = new p(), this.previousMask = e.mask ?? null), jd(e, this.maskGraphics), this.maskGraphics.clear();
14959
14993
  let n = t.shape;
14960
14994
  if (n.type === "rect") {
14961
14995
  let t = new b($(n.x, 0), $(n.y, 0), $(n.width, 0), $(n.height, 0));
14962
- Od(this.maskGraphics, e, t);
14996
+ Fd(this.maskGraphics, e, t);
14963
14997
  }
14964
14998
  let r = $(t.mode, "keep") === "hide";
14965
- Td(e, this.maskGraphics, r);
14999
+ Md(e, this.maskGraphics, r);
14966
15000
  }
14967
- }, jd = class extends k {
15001
+ }, Rd = class extends k {
14968
15002
  constructor(...e) {
14969
15003
  super(...e), this.elementRef = null, this.maskGraphics = null, this.ghostSprite = null, this.tickSubscription = null, this.updateEffect = null;
14970
15004
  }
@@ -14982,10 +15016,10 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
14982
15016
  this.apply();
14983
15017
  }
14984
15018
  onDestroy() {
14985
- Ed(this.ghostSprite, null), this.ghostSprite?.parent && this.ghostSprite.parent.removeChild(this.ghostSprite), this.ghostSprite?.destroy(), this.maskGraphics?.parent && this.maskGraphics.parent.removeChild(this.maskGraphics), this.maskGraphics?.destroy(), this.maskGraphics = null, this.ghostSprite = null, this.tickSubscription?.unsubscribe(), this.tickSubscription = null, this.updateEffect?.subscription.unsubscribe(), this.updateEffect = null, this.elementRef = null;
15019
+ Nd(this.ghostSprite, null), this.ghostSprite?.parent && this.ghostSprite.parent.removeChild(this.ghostSprite), this.ghostSprite?.destroy(), this.maskGraphics?.parent && this.maskGraphics.parent.removeChild(this.maskGraphics), this.maskGraphics?.destroy(), this.maskGraphics = null, this.ghostSprite = null, this.tickSubscription?.unsubscribe(), this.tickSubscription = null, this.updateEffect?.subscription.unsubscribe(), this.updateEffect = null, this.elementRef = null;
14986
15020
  }
14987
15021
  get props() {
14988
- return hd(this.elementRef?.props.occlusion) ?? null;
15022
+ return Sd(this.elementRef?.props.occlusion) ?? null;
14989
15023
  }
14990
15024
  apply() {
14991
15025
  let e = this.elementRef?.componentInstance, t = this.props;
@@ -14998,13 +15032,13 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
14998
15032
  if (!e.texture) return;
14999
15033
  this.maskGraphics = new p(), this.ghostSprite = new x(e.texture);
15000
15034
  }
15001
- wd(e, this.maskGraphics), this.ghostSprite.parent !== e.parent && (this.ghostSprite.parent && this.ghostSprite.parent.removeChild(this.ghostSprite), e.parent?.addChild(this.ghostSprite)), this.maskGraphics.clear(), this.ghostSprite.texture = e.texture, this.ghostSprite.width = e.width, this.ghostSprite.height = e.height, this.ghostSprite.visible = !1, this.ghostSprite.alpha = $(t.alpha, .35), Dd(this.ghostSprite, e), e.anchor && this.ghostSprite.anchor && this.ghostSprite.anchor.copyFrom(e.anchor);
15002
- let n = $(t.bounds, "bounds"), r = $(t.padding, 0), i = xd(e, n), a = !1, o = e.zIndex ?? 0;
15003
- for (let s of gd(hd(t.obstacles))) {
15004
- let t = yd(s);
15035
+ jd(e, this.maskGraphics), this.ghostSprite.parent !== e.parent && (this.ghostSprite.parent && this.ghostSprite.parent.removeChild(this.ghostSprite), e.parent?.addChild(this.ghostSprite)), this.maskGraphics.clear(), this.ghostSprite.texture = e.texture, this.ghostSprite.width = e.width, this.ghostSprite.height = e.height, this.ghostSprite.visible = !1, this.ghostSprite.alpha = $(t.alpha, .35), Pd(this.ghostSprite, e), e.anchor && this.ghostSprite.anchor && this.ghostSprite.anchor.copyFrom(e.anchor);
15036
+ let n = $(t.bounds, "bounds"), r = $(t.padding, 0), i = Od(e, n), a = !1, o = e.zIndex ?? 0;
15037
+ for (let s of Cd(Sd(t.obstacles))) {
15038
+ let t = Ed(s);
15005
15039
  if (!t) continue;
15006
15040
  o = Math.max(o, t.zIndex ?? 0);
15007
- let c = Sd(i, xd(t, n));
15041
+ let c = kd(i, Od(t, n));
15008
15042
  if (!c) continue;
15009
15043
  a = !0;
15010
15044
  let l = e.parent?.toLocal?.({
@@ -15014,15 +15048,15 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
15014
15048
  x: c.x - r,
15015
15049
  y: c.y - r
15016
15050
  };
15017
- Cd(this.maskGraphics, new b(l.x, l.y, c.width + r * 2, c.height + r * 2));
15051
+ Ad(this.maskGraphics, new b(l.x, l.y, c.width + r * 2, c.height + r * 2));
15018
15052
  }
15019
- a ? (this.ghostSprite.visible = !0, this.ghostSprite.zIndex = $(t.zIndex, o + 1), Td(this.ghostSprite, this.maskGraphics, !1)) : (this.ghostSprite.visible = !1, Ed(this.ghostSprite, null));
15053
+ a ? (this.ghostSprite.visible = !0, this.ghostSprite.zIndex = $(t.zIndex, o + 1), Md(this.ghostSprite, this.maskGraphics, !1)) : (this.ghostSprite.visible = !1, Nd(this.ghostSprite, null));
15020
15054
  }
15021
15055
  };
15022
- A("outline", kd), A("clip", Ad), A("occlusion", jd);
15056
+ A("outline", Id), A("clip", Ld), A("occlusion", Rd);
15023
15057
  //#endregion
15024
15058
  //#region src/engine/bootstrap.ts
15025
- var Md = async (e, n, r) => {
15059
+ var zd = async (e, n, r) => {
15026
15060
  let { components: i, autoRegister: a, enableLayout: o, ...s } = r ?? {};
15027
15061
  o !== !1 && await import("./dist-BOOc43Qm.js"), i ? (a !== !1 && Ha(), Object.entries(i).forEach(([e, t]) => {
15028
15062
  R(e, t);
@@ -15067,13 +15101,13 @@ var Md = async (e, n, r) => {
15067
15101
  };
15068
15102
  //#endregion
15069
15103
  //#region src/hooks/useFocus.ts
15070
- function Nd(e) {
15104
+ function Bd(e) {
15071
15105
  return X.getCurrentIndexSignal(e);
15072
15106
  }
15073
- function Pd(e) {
15107
+ function Vd(e) {
15074
15108
  return X.getFocusedElementSignal(e);
15075
15109
  }
15076
- function Fd(e, t) {
15110
+ function Hd(e, t) {
15077
15111
  let n = X.getCurrentIndexSignal(e), r = X.getFocusedElementSignal(e);
15078
15112
  if (!n || !r) return console.warn(`FocusContainer with id "${e}" not found`), () => {};
15079
15113
  let i = I(() => {
@@ -15085,7 +15119,7 @@ function Fd(e, t) {
15085
15119
  }
15086
15120
  //#endregion
15087
15121
  //#region src/utils/Ease.ts
15088
- var Id = {
15122
+ var Ud = {
15089
15123
  linear: Mi,
15090
15124
  easeIn: Ni,
15091
15125
  easeInOut: Fi,
@@ -15100,7 +15134,7 @@ var Id = {
15100
15134
  bounceIn: qi,
15101
15135
  bounceInOut: Ji,
15102
15136
  bounceOut: Ki
15103
- }, Ld = class {
15137
+ }, Wd = class {
15104
15138
  constructor(e, t, n, r, i, a, s = 0) {
15105
15139
  this.x0 = e, this.y0 = t, this.x1 = n, this.y1 = r, this.x2 = i, this.y2 = a, this.focalPoint = s, this.gradient = null, this.texture = null, this.size = 600, this.size = e;
15106
15140
  let c = this.size * .5;
@@ -15128,7 +15162,7 @@ var Id = {
15128
15162
  };
15129
15163
  //#endregion
15130
15164
  //#region src/utils/tabindex.ts
15131
- function Rd(e) {
15165
+ function Gd(e) {
15132
15166
  if ("count" in e) {
15133
15167
  let t = e.count();
15134
15168
  if (!Number.isFinite(t) || t <= 0) return null;
@@ -15146,7 +15180,7 @@ function Rd(e) {
15146
15180
  size: n - t + 1
15147
15181
  };
15148
15182
  }
15149
- function zd(e, t, n, r) {
15183
+ function Kd(e, t, n, r) {
15150
15184
  if (r === "clamp") return Math.min(n.max, Math.max(n.min, e));
15151
15185
  if (r === "none") return e < n.min || e > n.max ? t : e;
15152
15186
  let i = n.size;
@@ -15154,11 +15188,11 @@ function zd(e, t, n, r) {
15154
15188
  let a = ((e - n.min) % i + i) % i;
15155
15189
  return n.min + a;
15156
15190
  }
15157
- function Bd(e, t, n = "wrap") {
15191
+ function qd(e, t, n = "wrap") {
15158
15192
  let r = (r) => {
15159
- let i = e(), a = Rd(t);
15193
+ let i = e(), a = Gd(t);
15160
15194
  if (!a) return;
15161
- let o = zd(r, i, a, n);
15195
+ let o = Kd(r, i, a, n);
15162
15196
  o !== i && e.set(o);
15163
15197
  };
15164
15198
  return {
@@ -15167,7 +15201,7 @@ function Bd(e, t, n = "wrap") {
15167
15201
  };
15168
15202
  }
15169
15203
  //#endregion
15170
- var Vd = fs.Howler;
15171
- export { ir as ArraySubject, Du as Button, J as ButtonState, Qa as Canvas, ao as Circle, Ad as Clip, eo as Container, jn as ControlsBase, Ja as ControlsDirective, wu as DOMContainer, Cu as DOMElement, Eu as DOMSprite, U as DisplayObject, ed as Drag, $u as Drop, Xa as EVENTS, Id as Easing, oo as Ellipse, rd as Flash, Au as FocusContainer, ku as FocusManager, ad as FogVisibility, Qn as GamepadControls, to as Graphics, fs as Howl, Vd as Howler, Mn as Input, Ou as Joystick, er as JoystickControls, Fn as KeyboardControls, fo as Mesh, ju as Navigation, bu as NineSliceSprite, or as ObjectSubject, jd as Occlusion, kd as Outline, ds as ParticlesEmitter, Ld as RadialGradient, io as Rect, po as Scene, Ya as Scheduler, nd as Shake, Xu as Sound, gs as Sprite, co as Svg, Nl as Text, Pl as TilingSprite, td as Transition, so as Triangle, mn as Utils, _s as Video, yu as Viewport, Ju as ViewportFollow, Da as animatedSequence, Ea as animatedSignal, Md as bootstrapCanvas, Ua as checkDependencies, F as computed, qa as cond, V as createComponent, Uu as createHotComponent, Bd as createTabindexNavigator, Iu as currentDefinePropsTracker, Fu as currentSubscriptionsTracker, B as destroyElement, I as effect, X as focusManager, Z as h, Ta as isAnimatedSignal, ar as isArraySubject, lr as isComputed, L as isElement, z as isElementFrozen, sr as isObjectSubject, Kt as isObservable, Ma as isPrimitive, P as isSignal, kl as isTrigger, ur as linkedSignal, Ka as loop, zu as mount, Lu as mountTracker, jl as on, Ha as registerAllComponents, R as registerComponent, N as signal, Bu as tick, Al as trigger, dr as untracked, Ku as useDefineProps, Fd as useFocusChange, Nd as useFocusIndex, Pd as useFocusedElement, Q as useProps, Wa as waitForDependencies };
15204
+ var Jd = fs.Howler;
15205
+ export { ir as ArraySubject, Du as Button, J as ButtonState, Qa as Canvas, ao as Circle, Ld as Clip, eo as Container, jn as ControlsBase, Ja as ControlsDirective, wu as DOMContainer, Cu as DOMElement, Eu as DOMSprite, U as DisplayObject, sd as Drag, od as Drop, Xa as EVENTS, Ud as Easing, oo as Ellipse, ud as Flash, Au as FocusContainer, ku as FocusManager, fd as FogVisibility, Qn as GamepadControls, to as Graphics, fs as Howl, Jd as Howler, Mn as Input, Ou as Joystick, er as JoystickControls, Fn as KeyboardControls, fo as Mesh, ju as Navigation, bu as NineSliceSprite, or as ObjectSubject, Rd as Occlusion, Id as Outline, ds as ParticlesEmitter, Wd as RadialGradient, io as Rect, po as Scene, Ya as Scheduler, ld as Shake, rd as Sound, gs as Sprite, co as Svg, Nl as Text, Pl as TilingSprite, cd as Transition, so as Triangle, mn as Utils, _s as Video, yu as Viewport, td as ViewportFollow, Da as animatedSequence, Ea as animatedSignal, zd as bootstrapCanvas, Ua as checkDependencies, F as computed, qa as cond, V as createComponent, Gu as createHotComponent, qd as createTabindexNavigator, Iu as currentDefinePropsTracker, Fu as currentSubscriptionsTracker, B as destroyElement, I as effect, X as focusManager, Z as h, Ta as isAnimatedSignal, ar as isArraySubject, lr as isComputed, L as isElement, z as isElementFrozen, sr as isObjectSubject, Kt as isObservable, Ma as isPrimitive, P as isSignal, kl as isTrigger, ur as linkedSignal, Ka as loop, Vu as mount, Lu as mountTracker, jl as on, Ha as registerAllComponents, R as registerComponent, N as signal, Hu as tick, Al as trigger, dr as untracked, $u as useDefineEmits, Xu as useDefineProps, Hd as useFocusChange, Bd as useFocusIndex, Vd as useFocusedElement, Q as useProps, Wa as waitForDependencies };
15172
15206
 
15173
15207
  //# sourceMappingURL=index.js.map